Deprecated directive is missing from the schema
See original GitHub issueLibrary Version latest snapshot
Describe the bug
@deprecated
directive is no longer applied to the schema
To Reproduce
Run example app and check generated schema - it contains 5 directives (custom @lowercase
, @stringEval
and @cakeOnly
as well as @skip
and @include
built-in ones).
Expected behavior
Schema should contain @deprecated
directive as some fields (e.g. simpleDeprecatedQuery
are deprecated)
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
What is up with schema directives right now? - Apollo GraphQL
Looking at the documentation for @graphql-tools , it states a general Schema Directive pattern that relies on using transforms, and in the ...
Read more >graphql-directive-deprecated - npm package - Snyk
A GraphQL schema directive for deprecating fields For more information about how ... Looks like graphql-directive-deprecated is missing a security policy.
Read more >Adding directives to the schema in code-first GraphQL servers
Contrasting schema- and query-type directives @deprecated is a schema-type directive, so it must be applied on the schema. However, what would ...
Read more >Learn Sangria
@addSpecial directive needs to add new field in the Query type. For all other fields in the schema we need to define default...
Read more >Combining Schemas – GraphQL Tools
... merged types, and declarative schema directives. ... Having a subschema return null without an error for missing or failed records is a ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@deprecated
directive is pretty special in a sense that it is just informational as there is no associatedRuntimeWiring
behind it that would customize it behavior.I was thinking that we could add explicit support for it (as well as the ability to customize the behavior) by doing something along those lines -> https://github.com/ExpediaDotCom/graphql-kotlin/pull/247
It appears that there are multiple potential issues
playground
related issues 339 and 816 - currentlyplayground
doesn’t handle deprecated well (as compared tographiql
), this is what actually started this investigationgraphql-java
related issue 1434 - currentlygraphql-java
filters out “common” directives (skip
,include
,defer
anddeprecated
) from printing in SDL.graphql-java
also only adds the deprecated directive to the schema when manually loading it from the file (e.g. here -> https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/schema/idl/SchemaGenerator.java#L265)graphql-java
adds@depreacted
directives directly to instrumentation results (e.g. here https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/introspection/IntrospectionResultToSchema.java#L237)