use of graphql.schema.GraphQLNonNull in project graphql-java by graphql-java.
the class Relay method mutation.
public GraphQLFieldDefinition mutation(String name, String fieldName, List<GraphQLInputObjectField> inputFields, List<GraphQLFieldDefinition> outputFields, DataFetcher dataFetcher) {
GraphQLInputObjectType inputObjectType = newInputObject().name(name + "Input").fields(inputFields).build();
GraphQLObjectType outputType = newObject().name(name + "Payload").fields(outputFields).build();
return newFieldDefinition().name(fieldName).type(outputType).argument(newArgument().name("input").type(new GraphQLNonNull(inputObjectType))).dataFetcher(dataFetcher).build();
}
Aggregations