@rename directive not affect @rules validation #2709
Replies: 1 comment
-
It just was not implemented that way, doing anything at all with I can see where you are going with this and am open to reviewing a pull request that explores this behaviour change but am not looking into it myself. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a question regarding the behavior of the
@rename
and @rules directives in Lighthouse, especially when using Laravel validation.We use Laravel validation, which expects keys in snake_case (e.g.
billing_id
). However, even when I apply the@rename(attribute: "billing_id")
directive to thebillingId
field in my GraphQL input, the validation performed by the@rules
directive (for example,exists:billings,id
) still refers to the original GraphQL argument name,billingId
, not the renamedbilling_id
.As a result, I have to define both
billingId
andbilling_id
in my translation files, which causes confusion and breaks Laravel conventions.Is there a reason why the
@rename
directive does not affect the keys used during validation by@rules
?Is it possible to make validation work with the renamed keys, or are there any plans to change this behavior in Lighthouse?
Beta Was this translation helpful? Give feedback.
All reactions