Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non-scalars to be used as directive arguments #1493

Merged

Conversation

kschat
Copy link
Contributor

@kschat kschat commented Mar 15, 2024

TypeDirective argument types seem to be erroneously limited to just scalars. Per the GraphQL spec, DirectiveDefinition defines ArgumentsDefinition as ( InputValueDefinition ), which allows argument types to be NamedType, ListType, or NonNullType.

I believe InputType is the appropriate trait to use here, but if it's not please let me know and I can update this PR.

EDIT: I updated this PR to also support default arguments in TypeDirectives using the #[graphql(default)] attribute.

@sunli829
Copy link
Collaborator

thanks 🙂

@sunli829 sunli829 merged commit 2f093d7 into async-graphql:master Mar 16, 2024
7 checks passed
@kschat kschat deleted the fix-type-directive-argument-types branch March 16, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants