You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] Allow functions in directive parameters #422
I have a use case where I would like to be able to pass more than just a string as a directive argument. For example, if I have a directive designed to enforce uniqueness on arrays (in Zod), I would want to use the refine() method like so:
@elijaholmos Thanks for your suggestion!
I agree to accept this feature request. but this feature is difficult to treat in YAML configuration. Do you have any ideas?
graphql-codegen encourages the use of a typescript-based configuration by default, which naturally offers substantially more features than its yaml counterpart. We could perhaps simply not support this feature if a yaml configuration is present, as that would indeed be cumbersome to work with.
Activity
Code-Hex commentedon Aug 12, 2023
@elijaholmos Thanks for your suggestion!
I agree to accept this feature request. but this feature is difficult to treat in YAML configuration. Do you have any ideas?
elijaholmos commentedon Aug 14, 2023
graphql-codegen encourages the use of a typescript-based configuration by default, which naturally offers substantially more features than its yaml counterpart. We could perhaps simply not support this feature if a yaml configuration is present, as that would indeed be cumbersome to work with.
Code-Hex commentedon Dec 9, 2023
@elijaholmos Could you give me PR for this implementation? Thanks!
Better support for custom directives
Better support for custom directives
Code-Hex commentedon Apr 25, 2026
Fixed in #1423. Directive configuration now accepts function values in directive parameters.