Skip to content
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

Unable to implement custom directives as per documentation #28

Closed
luke88jones opened this issue Jul 17, 2023 · 3 comments · Fixed by mercurius-js/mercurius#1009
Closed

Comments

@luke88jones
Copy link

It's not possible to implement directives as per the custom directives documentation on the main library. This seems to be mainly due to the inability to use a GraphQLSchema instance when registering the federation library.

I've been able to get around the issue using the schemaTransforms property to register my directive handlers. To be honest this implementation is a bit nicer but I think it just needs to be documented.

@mcollina
Copy link
Contributor

Would you like to send a PR to specify the docs further in this module? Unfortunately this is a limitation that cannot be bypassed.

@Puppo
Copy link
Contributor

Puppo commented Aug 11, 2023

Hey @mcollina and @luke88jones ,
I created two new PR to improve the documentation about this issue.

First, in this repo, I created a new example in the example folder to show how to handle custom directives with federation. #35

Second in the mercurius-js/mercurius I improved the documentation in the relative section, adding also the link to the example indicated above mercurius-js/mercurius#1009

Please take a look at the two PRs and let me know if there are any mistakes or something to change.

@luke88jones
Copy link
Author

Hey @Puppo thanks for doing this. I was intended to update the docs but a new baby got in the way 😛. The docs updates look good to me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants