Skip to content

Conversation

@andimarek
Copy link
Member

In the case of all fields removed from an object/interface via field visibility transformer, which is still referenced via additional types, the validation would fail with

graphql.schema.validation.InvalidSchemaException: invalid schema:
"ToDelete" must define one or more fields.

	at graphql.schema.GraphQLSchema$Builder.validateSchema(GraphQLSchema.java:886)
	at graphql.schema.GraphQLSchema$Builder.buildImpl(GraphQLSchema.java:874)
	at graphql.schema.GraphQLSchema$Builder.build(GraphQLSchema.java:841)
	at graphql.schema.SchemaTransformer$DummyRoot.rebuildSchema(SchemaTransformer.java:631)
	at graphql.schema.SchemaTransformer.transformImpl(SchemaTransformer.java:161)
	at graphql.schema.SchemaTransformer.transform(SchemaTransformer.java:120)
	at graphql.schema.SchemaTransformer.transformSchema(SchemaTransformer.java:88)
	at graphql.schema.transform.FieldVisibilitySchemaTransformation.apply(FieldVisibilitySchemaTransformation.java:79)

This fix ensures that the whole object is deleted if all fields are deleted, hence preventing this validation error.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

Test Results

  327 files  ±0    327 suites  ±0   5m 6s ⏱️ -2s
5 223 tests +2  5 214 ✅ +1  9 💤 +1  0 ❌ ±0 
5 312 runs  +2  5 303 ✅ +1  9 💤 +1  0 ❌ ±0 

Results for commit de1a152. ± Comparison against base commit 021fe1b.

This pull request removes 213 and adds 191 tests. Note that renamed tests count towards both.
	?

	, expected: combo-\"\\\b\f\n\r\t, #4]
                __schema { types { fields { args { type { name fields { name }}}}}}
                __schema { types { fields { type { name fields { name }}}}}
                __schema { types { inputFields { type { inputFields { name }}}}}
                __schema { types { interfaces { fields { type { interfaces { name } } } } } }
                __schema { types { name} }
                __type(name : "t") { name }
                a1: __schema { types { name} }
                a1: __type(name : "t") { name }
…
graphql.AssertTest ‑ assertFalse with different number of error args but false does not throw assertions [toRun: <graphql.AssertTest$__spock_feature_0_21prov0_closure23@14823f76 delegate=graphql.AssertTest@6c6333cd owner=graphql.AssertTest@6c6333cd thisObject=graphql.AssertTest@6c6333cd resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
graphql.AssertTest ‑ assertFalse with different number of error args but false does not throw assertions [toRun: <graphql.AssertTest$__spock_feature_0_21prov0_closure24@1442f788 delegate=graphql.AssertTest@6c6333cd owner=graphql.AssertTest@6c6333cd thisObject=graphql.AssertTest@6c6333cd resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2, #1]
graphql.AssertTest ‑ assertFalse with different number of error args but false does not throw assertions [toRun: <graphql.AssertTest$__spock_feature_0_21prov0_closure25@113e13f9 delegate=graphql.AssertTest@6c6333cd owner=graphql.AssertTest@6c6333cd thisObject=graphql.AssertTest@6c6333cd resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2 arg3, #2]
graphql.AssertTest ‑ assertFalse with different number of error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_20prov0_closure20@10643593 delegate=graphql.AssertTest@6c6333cd owner=graphql.AssertTest@6c6333cd thisObject=graphql.AssertTest@6c6333cd resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
graphql.AssertTest ‑ assertFalse with different number of error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_20prov0_closure21@f91da5e delegate=graphql.AssertTest@6c6333cd owner=graphql.AssertTest@6c6333cd thisObject=graphql.AssertTest@6c6333cd resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2, #1]
graphql.AssertTest ‑ assertFalse with different number of error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_20prov0_closure22@eca6a74 delegate=graphql.AssertTest@6c6333cd owner=graphql.AssertTest@6c6333cd thisObject=graphql.AssertTest@6c6333cd resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2 arg3, #2]
graphql.AssertTest ‑ assertNotNull with different number of  error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_5prov0_closure3@158f4cfe delegate=graphql.AssertTest@6c6333cd owner=graphql.AssertTest@6c6333cd thisObject=graphql.AssertTest@6c6333cd resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
graphql.AssertTest ‑ assertNotNull with different number of  error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_5prov0_closure4@3f702946 delegate=graphql.AssertTest@6c6333cd owner=graphql.AssertTest@6c6333cd thisObject=graphql.AssertTest@6c6333cd resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2, #1]
graphql.AssertTest ‑ assertNotNull with different number of  error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_5prov0_closure5@10823d72 delegate=graphql.AssertTest@6c6333cd owner=graphql.AssertTest@6c6333cd thisObject=graphql.AssertTest@6c6333cd resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2 arg3, #2]
graphql.AssertTest ‑ assertNotNull with different number of error args with non null does not throw assertions [toRun: <graphql.AssertTest$__spock_feature_0_6prov0_closure6@7e744f43 delegate=graphql.AssertTest@6c6333cd owner=graphql.AssertTest@6c6333cd thisObject=graphql.AssertTest@6c6333cd resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
…
This pull request skips 1 test.
graphql.schema.fetching.LambdaFetchingSupportTest ‑ different class loaders induce certain behaviours

♻️ This comment has been updated with latest results.

@andimarek andimarek merged commit 21b9743 into master Jan 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants