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

fix(typeMerging): fix interface merging #1917

Merged
merged 1 commit into from Aug 17, 2020
Merged

fix(typeMerging): fix interface merging #1917

merged 1 commit into from Aug 17, 2020

Conversation

yaacovCR
Copy link
Collaborator

thanks go to @gmac for finding this bug and contributing test code
see: #1911 (comment)

@yaacovCR
Copy link
Collaborator Author

Note that mergeTypes: true has to be explicitly added. mergeTypes is false by default, but any type with merge configuration is automatically merged. This does not occur automatically for the interface, and so mergeTypes has to be explicitly set to true.

@theguild-bot
Copy link
Collaborator

theguild-bot commented Aug 17, 2020

The latest changes of this PR are available as alpha in npm: 6.0.19-alpha-b8551da1.0

Quickly update your package.json by running:

npx match-version @graphql-tools 6.0.19-alpha-b8551da1.0

@gmac
Copy link
Contributor

gmac commented Aug 17, 2020

Dang, while I don't have any specific use for this kind of interface merging, I sure am glad I can! I'll write up another section in the type merging guide on combined interface strategies. This is a woefully under-discussed concern across GraphQL projects for something that really isn't an obscure edge case.

thanks go to @gmac for finding this bug and contributing test code
see: #1911 (comment)
@ardatan ardatan added the bugfix label Aug 17, 2020
@yaacovCR yaacovCR merged commit b8551da into master Aug 17, 2020
@yaacovCR yaacovCR deleted the fix-merge-types branch August 17, 2020 20:01
@yaacovCR
Copy link
Collaborator Author

@yaacovCR
Copy link
Collaborator Author

Just a separate note relating back to mergeTypes,

extend interface Slot {
name: String!
}

Gateway type definition, if mergeTypes set to true, could use type instead of extend.

Not sure yet which one I would prefer based on style, I think I would prefer extend and I think it doesn't really matter, but I guess important to mention that type merging if enabled will also make gateway types no longer replace subschema types, but will also be merged.

@yaacovCR
Copy link
Collaborator Author

Thanks again @gmac for the huge amount of work you are putting in to type merging!!!

@gmac
Copy link
Contributor

gmac commented Aug 18, 2020

All praise goes to you, friend. It’s an honor to provide backup on such a great project.

The links you post pretty well summarize the state of cross-service interfaces in my research... inconclusive and full of fairly bad options.

yaacovCR pushed a commit that referenced this pull request Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants