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

Fix for @deprecated directive not working #584

Merged
merged 1 commit into from
Mar 6, 2019

Conversation

mathewbyrne
Copy link
Contributor

Fixes #580

During buildDirectives in codegen, the builtin directives skip, include, and deprecated are skipped over. This causes them to not be registered with the builder later when building objects. It seems like deprecated is definitely needed, since it's a schema directive. skip and include I'm not so sure about. @vektah what's the reason for skipping these in build?

@vektah
Copy link
Collaborator

vektah commented Mar 6, 2019

That line comes from when they were first added, I'm guessing what that skip actually does has changed a little.

0924206#diff-5e244cf316790fef0b9112abc3070944R5

@mathewbyrne
Copy link
Contributor Author

Ok, so instead of skipping these directives then, we set a flag and only include directives with the flag in the DirectivesRoot.

These have an internal implementation and should be excluded from the
DirectiveRoot. In the future this may be a func that plugins could use
to add custom implementations.
@mathewbyrne mathewbyrne merged commit dcd208d into master Mar 6, 2019
@mathewbyrne mathewbyrne changed the title Fix for @deprecated directive not appearing Fix for @deprecated directive not working Mar 6, 2019
@vektah vektah deleted the fix-deprecated-directive branch March 6, 2019 11:06
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
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.

2 participants