This adds the field selection set to the type resolver#2597
This adds the field selection set to the type resolver#2597
Conversation
| * @deprecated use {@link #getGraphQLContext()} instead | ||
| */ | ||
| @Deprecated | ||
| public <T> T getContext() { |
There was a problem hiding this comment.
This should have been deprecated when we did the context work. Its is now like all the others
| */ | ||
| public GraphQLContext getGraphQLContext() { | ||
| return graphQLContext; | ||
| } |
There was a problem hiding this comment.
This was missed as being a replacement for the above
| /** | ||
| * @return the {@link DataFetchingFieldSelectionSet} for the current field fetch that needs type resolution | ||
| */ | ||
| public DataFetchingFieldSelectionSet getSelectionSet() { |
There was a problem hiding this comment.
This is the new capability
| GraphQLInterfaceType abstractType = params.getGraphQLInterfaceType(); | ||
| TypeResolver typeResolver = params.getSchema().getCodeRegistry().getTypeResolver(abstractType); | ||
| GraphQLObjectType result = typeResolver.getType(env); | ||
| if (result == null) { |
There was a problem hiding this comment.
I refactored this a little because the same code was repeated in each
|
|
||
| if (result == null) { | ||
| throw new UnresolvedTypeException(abstractType); | ||
| } |
There was a problem hiding this comment.
Hard to see but the common red code above is now here in a common method
| import java.util.Map; | ||
|
|
||
| @PublicApi | ||
| @Internal |
There was a problem hiding this comment.
This should NEVER have been public API
Is never visible to any one - there is no way for a consumer to get this class
It was ONLY ever used in graphql.execution.ResolveType and that is an internal class
This makes the field selection set available to the TypeResolvers
This relates to #2593
Even if this PR is not accepted, we should take elements of it. Namely a miss labeled API class, the missing GraphqlContext and the missing deprecation on context object