mercurius-js / mercurius

Implement GraphQL servers and gateways with Fastify
https://mercurius.dev/
MIT License
2.33k stars 234 forks source link

docs: custom directive examples and docs page #982

Closed brainrepo closed 1 year ago

brainrepo commented 1 year ago

This pr adds a doc page and an example of implementing a custom directive. After a few iterations, to keep this example compact and avoid working with the AST, I decided to use two libraries, @graphql-tools/schema and @graphql-tools/utils.

I also added some comments in the example file, but I am unsure whether to keep them.

closes #874

brainrepo commented 1 year ago

Thank you, All your comments make sense, I am going to implement your suggestions.

brainrepo commented 1 year ago

I implemented the suggestions

simoneb commented 1 year ago

@mcollina this looks good to me but I'd like another pair of eyes before we merge this