use of graphql.schema.FieldCoordinates in project graphql-java by graphql-java.
the class ExecutableNormalizedOperationFactory method updateCoordinatedToNFMap.
private void updateCoordinatedToNFMap(ImmutableListMultimap.Builder<FieldCoordinates, ExecutableNormalizedField> coordinatesToNormalizedFields, ExecutableNormalizedField topLevel) {
for (String objectType : topLevel.getObjectTypeNames()) {
FieldCoordinates coordinates = FieldCoordinates.coordinates(objectType, topLevel.getFieldName());
coordinatesToNormalizedFields.put(coordinates, topLevel);
}
}
use of graphql.schema.FieldCoordinates in project graphql-java by graphql-java.
the class CodeRegistryVisitor method visitGraphQLFieldDefinition.
@Override
public TraversalControl visitGraphQLFieldDefinition(GraphQLFieldDefinition node, TraverserContext<GraphQLSchemaElement> context) {
GraphQLFieldsContainer parentContainerType = (GraphQLFieldsContainer) context.getParentContext().thisNode();
DataFetcher<?> dataFetcher = node.getDataFetcher();
if (dataFetcher != null) {
FieldCoordinates coordinates = coordinates(parentContainerType, node);
codeRegistry.dataFetcherIfAbsent(coordinates, dataFetcher);
}
return CONTINUE;
}
use of graphql.schema.FieldCoordinates in project spring-graphql by spring-projects.
the class DefaultGraphQlSourceBuilderTests method getDataFetcherForQuery.
private DataFetcher<?> getDataFetcherForQuery(GraphQLSchema schema, String query) {
FieldCoordinates coordinates = FieldCoordinates.coordinates("Query", query);
GraphQLFieldDefinition fieldDefinition = schema.getFieldDefinition(coordinates);
return schema.getCodeRegistry().getDataFetcher(coordinates, fieldDefinition);
}
Aggregations