You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DictionaryResolverType was returning GraphQL Schema Objects from a cache, however if the shema is transformed by SchemaTransformer, these GraphQL Schema Objects can change.
As such we should resolve the GraphQLObjectType from the schema object rather than a local cache.
Expected behavior
The DictionaryResolverType should return the same GraphQLObjectType instance as referenced in the schema.
Actual behavior
The DictionaryResolverType returns a different instance GraphQLObjectType than the schema if it was transformed.
@Test
fun`transformed schema should execute query`() {
val transformedSchema =SchemaTransformer().transform(schema, Transformer())
val transformedGql:GraphQL=GraphQL.newGraphQL(transformedSchema)
.queryExecutionStrategy(AsyncExecutionStrategy())
.build()
val data = assertNoGraphQlErrors(transformedGql) {
""" { otherUnionItems { ... on Item { itemId: id } ... on ThirdItem { thirdItemId: id } } }"""
}
assertEquals(data["otherUnionItems"], listOf(
mapOf("itemId" to 0),
mapOf("itemId" to 1),
mapOf("thirdItemId" to 100)
))
}
The text was updated successfully, but these errors were encountered:
Description
The DictionaryResolverType was returning GraphQL Schema Objects from a cache, however if the shema is transformed by SchemaTransformer, these GraphQL Schema Objects can change.
As such we should resolve the GraphQLObjectType from the schema object rather than a local cache.
Expected behavior
The DictionaryResolverType should return the same GraphQLObjectType instance as referenced in the schema.
Actual behavior
The DictionaryResolverType returns a different instance GraphQLObjectType than the schema if it was transformed.
Steps to reproduce the bug
https://github.com/timward60/graphql-java-tools/tree/timward/bug-592
The text was updated successfully, but these errors were encountered: