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

Add GetDirectiveLocation extension method #396

Merged
merged 2 commits into from
Aug 20, 2024
Merged

Conversation

Shane32
Copy link
Member

@Shane32 Shane32 commented Aug 19, 2024

Closes #395 with a non-breaking solution. Not quite ideal, but good enough; argument fields and input object fields now use derived classes, and an extension method to ASTNode provides the directive location.

Other non-breaking options:

  1. Move the method into ASTNode and override it in each derived class
  2. Return null instead of throwing in case of error

Breaking options:

  1. Move the method into IHasDirectives
  2. Make the GraphQLInputValueDefinition ctor internal
  3. Remove support for parsing into an GraphQLInputValueDefinition class

@Shane32 Shane32 requested a review from gao-artur August 19, 2024 21:09
@Shane32 Shane32 self-assigned this Aug 19, 2024
@Shane32
Copy link
Member Author

Shane32 commented Aug 19, 2024

@gao-artur Let's include this in v8 also (parser v9). I don't think I have any other changes to do.

src/GraphQLParser/Parser.cs Dismissed Show dismissed Hide dismissed
src/GraphQLParser/Parser.cs Dismissed Show dismissed Hide dismissed
src/GraphQLParser/Parser.cs Dismissed Show dismissed Hide dismissed
@Shane32 Shane32 merged commit 9faa2bd into master Aug 20, 2024
8 checks passed
@Shane32 Shane32 deleted the getdirectivelocation branch August 20, 2024 03:56
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.

Argument definitions and input field definitions use same class
2 participants