use of graphql.language.ObjectTypeDefinition in project graphql-java by graphql-java.
the class SchemaDiff method synthOperationTypeDefinition.
// looks for a type called `Query|Mutation|Subscription` and if it exist then assumes it as an operation def
private Optional<OperationTypeDefinition> synthOperationTypeDefinition(Function<Type, Optional<ObjectTypeDefinition>> typeReteriver, String opName) {
TypeName type = new TypeName(capitalize(opName));
Optional<ObjectTypeDefinition> typeDef = typeReteriver.apply(type);
return typeDef.map(objectTypeDefinition -> new OperationTypeDefinition(opName, type));
}
Aggregations