test: cover isCompositeType identity across package entrypoints#4831
test: cover isCompositeType identity across package entrypoints#4831dosacha wants to merge 1 commit into
Conversation
|
Someone is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel. A member of the Team first needs to authorize it. |
|
|
2cf9bec to
18d5a2f
Compare
|
Hi, thanks for raising this PR and engaging with the repository. We appreciate it. In terms of this PR, I'm confused by #4830 => in the sense that although the internal mechanism of GraphQL schema element identify are now managed by symbols rather than In terms of this PR, I do not think we need to add these tests. We need only a single test to prove we have imported the same package, which means our internal symbols are the same. Adding extra tests for just a single function does not do too much. Another way of thinking about this is that for completeness, we would then need to add every predicate. Do you have any insight as to why #4830 apparently did not hit v16? That's where I'm at with this one, I have asked for a reproduction there. Thanks again for contributing! |
Summary
Adds integration coverage for
isCompositeTypeidentity across GraphQL.js package entrypoints and module conditions.This is related to #4830, where upstream code using:
can observe no composite types if GraphQL type instances and predicates come from different evaluated
graphqlmodule instances.What changed
graphqlandgraphql/typeshare the sameGraphQLObjectTypegraphqlandgraphql/typeshare the sameGraphQLStringgraphqlandgraphql/typeshare the sameisCompositeTypeisCompositeTypeisCompositeTypepredicatesrequire('graphql/type')path checks alongside the existingrequire('graphql')path check.Why
GraphQL.js v17 type predicates rely on internal
__kindbrand symbols. If supported package entrypoints or module conditions accidentally evaluate separate GraphQL.js module instances, a type created by one entrypoint can fail a predicate imported from another entrypoint.This test does not change duplicate-module semantics. It only ensures that the supported package entrypoints and CJS/ESM conditions preserve predicate identity for the same built package.
Tests
Ran:
Also ran a smoke check against the built npm package:
Not run:
because it requires the full Docker-based integration test environment.
Refs #4830