-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Use getDirectives
when retrieving cacheControl
directives
#6870
Comments
It's an interesting point. I do know that some movement has happened lately in the GraphQL world as far as potentially providing a more standard way of exposing directives (eg graphql/graphql-spec#300) and it might be a bit of a shame to adopt the non-standard |
Got it. Makes sense to me |
Issue
Currently we retrieve directives by calling
.directives
on the AST node, but this limits users with a code-first approach since in order for users to specifyinheritMaxAge
it has to be statically definedContext
apollo-server/packages/apollo-server-core/src/plugin/cacheControl/index.ts
Lines 305 to 321 in f6c5c9f
apollo-server/packages/apollo-server-core/src/plugin/cacheControl/index.ts
Lines 305 to 321 in f6c5c9f
apollo-server/packages/apollo-server-core/src/plugin/cacheControl/index.ts
Lines 323 to 333 in f6c5c9f
graphql/graphql-js#3213 (comment)
graphql/graphql-js#1343
Proposal
We currently already use parts of
@graphql-tools/*
. We can use@graphql-tools/utils
getDirectives
so that users with a code-first approach are able to specify directives viaextensions.directives
.So something like:
and then users could do:
The text was updated successfully, but these errors were encountered: