adonis-apollo icon indicating copy to clipboard operation
adonis-apollo copied to clipboard

Enhancement: using schema directives

Open tsubasax opened this issue 5 years ago • 3 comments

How do we include custom schema directives in Config/apollo.ts ?

I'd like to implement them like below:

const config: ApolloConfig = {
  schemas: 'app/Schemas',
  resolvers: 'app/Resolvers',
  directives: 'app/Directives', // <- custom schema directives
  // and rest properties...
}

tsubasax avatar Dec 11 '20 15:12 tsubasax

could you point to the documentation about how to set directives in apollo server?

targos avatar Dec 11 '20 16:12 targos

It can be found on this page of Apollo Docs:

https://www.apollographql.com/docs/apollo-server/schema/directives/#using-custom-schema-directives

Maybe we can use mergeDirectives method inplemented in @graphql-tools/merge:

https://www.graphql-tools.com/docs/api/modules/merge#mergedirectives

tsubasax avatar Dec 11 '20 22:12 tsubasax

Hi! Any news on this? Or at least a workaround that allows adding a custom directive?

Thanks!

yodosan avatar Oct 26 '21 09:10 yodosan