Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Cover inline fragment without type condition in Anonymizer
Exercises the null branch in Anonymizer.visitInlineFragment that was
added because InlineFragment.getTypeCondition() is now @nullable,
restoring Anonymizer$4 coverage to its baseline.
  • Loading branch information
andimarek committed Apr 23, 2026
commit 6de2cc8658b25f5cb28c4874514b8e7a21636e7b
21 changes: 21 additions & 0 deletions src/test/groovy/graphql/util/AnonymizerTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,27 @@ type Object2 {

}

def "query with inline fragment without type condition"() {
given:
def schema = TestUtil.schema("""
type Query {
foo: Foo
}
type Foo {
bar1: String
bar2: ID
}
""")
def query = "{foo {... {bar1 bar2}}}"

when:
def result = Anonymizer.anonymizeSchemaAndQueries(schema, [query])
def newQuery = result.queries[0]

then:
newQuery == "{field1{...{field2 field3}}}"
}

def "query with arguments"() {
given:
def schema = TestUtil.schema("""
Expand Down