Describe the bug
Trying to invoke dataFetchingEnvironment.getSelectionSet().getFields() from a Mutation results in graphql.AssertException: no field with name mutationFieldName found in object Query exception being thrown out.
This seems be caused by https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/normalized/NormalizedQueryTreeFactory.java#L55 that assume that root is always a Query.
This worked fine in graphql-java 15, and is broken after upgrade to graphql-java 16.
To Reproduce
From a DataFetcher that's registered to resolve a Mutation field invoke something like below:
DataFetchingFieldSelectionSet selectionSet = environment.getSelectionSet();
if (selectionSet.getFields().stream().allMatch(field -> SUPPORTED_FIELDS.contains(field.getName()))) { return "xyz"; }
Describe the bug
Trying to invoke
dataFetchingEnvironment.getSelectionSet().getFields()from a Mutation results ingraphql.AssertException: no field with name mutationFieldName found in object Queryexception being thrown out.This seems be caused by https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/normalized/NormalizedQueryTreeFactory.java#L55 that assume that root is always a Query.
This worked fine in graphql-java 15, and is broken after upgrade to graphql-java 16.
To Reproduce
From a DataFetcher that's registered to resolve a Mutation field invoke something like below: