mercurius-js / mercurius-federation

Build federated schema to be allow the service to be used in mercurius federation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to implement custom directives as per documentation

luke88jones opened this issue · comments

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.

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

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.

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 👍