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

getDirectiveDeclaration not sufficient to declare directives #4074

Closed
mfellner opened this issue May 6, 2020 · 2 comments
Closed

getDirectiveDeclaration not sufficient to declare directives #4074

mfellner opened this issue May 6, 2020 · 2 comments

Comments

@mfellner
Copy link

mfellner commented May 6, 2020

According to https://www.apollographql.com/docs/graphql-tools/schema-directives/#declaring-schema-directives when implementing the getDirectiveDeclaration on a custom SchemaDirectiveVisitor, it is not necessary to declare the directive in the SDL.

However this is no longer the case with graphql-tools >= 4.0.0 and graphql-js >= 14.0.0. Related issues are

Support for the documented solution is only considered for the next release of graphql-tools (ardatan/graphql-tools#1337).

The docs should be updated to reflect that.

@yaacovCR
Copy link

We are moving away from considering support for the documented solution, as the problem is with graphql-js v14 and the spec, not the tooling, and the available workarounds seem sufficient.

See ardatan/graphql-tools#1022 (comment)

The independent docs at graphql-tools should eventually be updated to reflect that.

@glasser
Copy link
Member

glasser commented May 6, 2021

Right now we are planning to remove support for schemaDirectives in Apollo Server 3, because the project that implements it (graphql-tools) considers it to be a legacy API. Folks who want to use schemaDirectives or its non-legacy replacement schemaTransforms can use @graphql-tools/schema directly to create a schema passed in with new ApolloServer({schema}); issues relating to these options should probably be opened in the graphql-tools repo.

@glasser glasser closed this as completed May 6, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants