zakodium / adonis-apollo

Apollo GraphQL server for AdonisJS 5
MIT License
53 stars 5 forks source link

Enhancement: using schema directives #25

Open tsubasax opened 3 years ago

tsubasax commented 3 years ago

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...
}
targos commented 3 years ago

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

tsubasax commented 3 years ago

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

yodosan commented 3 years ago

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

Thanks!