Repository navigation
Cascade removal of elements referencing emptied types in FieldVisibilitySchemaTransformation - #4570
Open
mohit32886 wants to merge 1 commit into
Open
mohit32886 wants to merge 1 commit into
mohit32886 wants to merge 1 commit into
Conversation
…itySchemaTransformation Compute a fixpoint deletion plan before transforming the schema so that when all fields of a type (or all members of a union) are hidden, referencing fields, input fields, arguments, applied directive arguments, and interface implementations are also cleanly removed instead of throwing AssertException. Fixes graphql-java#4569
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #4569
Previously, when
VisibleFieldPredicatehid all fields of an object, interface, or input object type,FieldVisibilitySchemaTransformationdeleted the emptied type without removing the schema elements that still referenced it (fields, input fields, arguments, union members, or interface implementations). DuringSchemaTransformerzip-up (or subsequent type reference resolution), this resulted in internalAssertExceptionfailures such astype can't be nullorA Union type must define one or more member types..Changes
DeletionPlancomputation inFieldVisibilitySchemaTransformationthat:Querytype so an emptiedQueryfails cleanly withInvalidSchemaException.ElementRemovalVisitorto:typesToDelete.GraphQLUnionTypes and deleted interfaces fromGraphQLImplementingTypes (including when referenced viaGraphQLTypeReference).FieldVisibilitySchemaTransformationTestcovering nullable/non-null/list fields, arguments, input fields, interfaces, unions (partial and full member removal), directive arguments, multi-hop cascades,GraphQLTypeReferenceschemas, and emptied root types.Verification
./gradlew check— all 6,213 tests and verification checks (compileShadedJarConsumer,verifyOsgiManifest,verifyShadedClassAnnotations,archunit) passed.