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
duplicate directives when merging schemas since version 5.0.0 #1656
Comments
Are you using mergeDirectives: true? Best would be a minimal reproduction with the result/error you are getting and what you would like to get? We may need a onDirectiveConflict option like onTypeConflict, but I want to make sure that I understand exactly the bug fix/feature you are requesting. |
yeah. I am using I am trying to merge fully functional sdls, each containing it's own type directive definitions. I guess the prev versions of graphql-tools had a bug with mergeDirectives since stitched schema only had these 3 directives (excluded all custom directives we had). But now since version 5.0.0, I am getting all the directives merged (which it should be). But it means in the generated schema I am getting duplicate include, skip, deprecated directives. I will try to add a minimal repro schema. |
Fixes #1656. Later directives with the same name should override earlier directives rather than causing an error. Directives with the same names from a later subschema will override an earlier subschema. Directives from typedefs will override both. Mixing of legacy schemas argument and newer subschemas, typeDefs, and types arguments should respect this same order. We can consider adding onDirectiveConflict option to match onTypeConflict for customization.
Fixes #1656. Later directives with the same name should override earlier directives rather than causing an error. Directives with the same names from a later subschema will override an earlier subschema. Directives from typedefs will override both. Mixing of legacy schemas argument and newer subschemas, typeDefs, and types arguments should respect this same order. We can consider adding onDirectiveConflict option to match onTypeConflict for customization.
Thanks again for reporting this! #1665 attempts a simple fix to avoid duplicates without yet introducing an onDirectiveConflict option. This is available as alpha in npm: Quickly update your package.json by running:
|
Appreciate the quick turnaround on this. |
Available in v6.0.11! |
When merging schemas with common directives, in the stitched schema we are getting duplicate directives.
Is there a way to have just unique list of directives in the stitched graphql schema?
The text was updated successfully, but these errors were encountered: