You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Still can't figure out how to create directive the way the docs from that link show and then use it as an input in TypeGraphQLModule.forRoot(). I'm trying to build the directive using the class GraphQLDirective from grapql, but with no success so far. Don't really know what locations mean and still trying to figure out how to assign to args...
You only put @Directive() decorator over your field and queries. The directives will be living inside the GraphQLSchema it builds under the hood, so that Apollo Server sees it.
As stated, they do not appear in the printed schema file.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to implement server side caching, following this documentation: https://www.apollographql.com/docs/apollo-server/performance/caching/. Is there an example on how to add custom directives, so that the appear in generated schema?
Beta Was this translation helpful? Give feedback.
All reactions