public GraphQL build() { assertNotNull(graphQLSchema, "graphQLSchema must be non null"); assertNotNull(queryExecutionStrategy, "queryStrategy must be non null"); assertNotNull(idProvider, "idProvider must be non null"); return new GraphQL(graphQLSchema, queryExecutionStrategy, mutationExecutionStrategy, subscriptionExecutionStrategy, idProvider, instrumentation, preparsedDocumentProvider); } }
/** * Executes the graphql query using the provided input object builder * * @param executionInputBuilder {@link ExecutionInput.Builder} * * @return an {@link ExecutionResult} which can include errors */ public ExecutionResult execute(ExecutionInput.Builder executionInputBuilder) { return execute(executionInputBuilder.build()); }
/** * Executes the specified graphql query/mutation/subscription * * @param query the query/mutation/subscription * * @return an {@link ExecutionResult} which can include errors */ public ExecutionResult execute(String query) { ExecutionInput executionInput = ExecutionInput.newExecutionInput() .query(query) .build(); return execute(executionInput); }
private static Map<String, Object> introspect(GraphQLSchema schema) { GraphQL gql = GraphQL.newGraphQL(schema).build(); ExecutionResult result = gql.execute(IntrospectionQuery.INTROSPECTION_QUERY); Assert.assertTrue(result.getErrors().size() == 0, "The schema has errors during Introspection"); return result.getData(); } }
private GraphQL buildSchema() { return GraphQL.newGraphQL(schema) .build(); }
/** * Executes the graphql query using the provided input object builder * <p> * This will return a promise (aka {@link CompletableFuture}) to provide a {@link ExecutionResult} * which is the result of executing the provided query. * * @param executionInputBuilder {@link ExecutionInput.Builder} * * @return a promise to an {@link ExecutionResult} which can include errors */ public CompletableFuture<ExecutionResult> executeAsync(ExecutionInput.Builder executionInputBuilder) { return executeAsync(executionInputBuilder.build()); }
public Builder context(UnaryOperator<GraphQLContext.Builder> contextBuilderFunction) { GraphQLContext.Builder builder = GraphQLContext.newContext(); builder = contextBuilderFunction.apply(builder); return context(builder.build()); }
@Internal protected EnumValue(String name, SourceLocation sourceLocation, List<Comment> comments, IgnoredChars ignoredChars) { super(sourceLocation, comments, ignoredChars); this.name = name; }
/** * Types that can contain input fields are marked with this interface * * @see graphql.schema.GraphQLInputType */ @PublicApi public interface GraphQLInputFieldsContainer extends GraphQLType { GraphQLInputObjectField getFieldDefinition(String name); List<GraphQLInputObjectField> getFieldDefinitions(); }
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass") @Override public boolean equals(Object o) { return GraphqlErrorHelper.equals(this, o); }
@Override public int hashCode() { return GraphqlErrorHelper.hashCode(this); } }
/** * Returns a {@link GraphQLScalarType} given scalar defined in IDL * * @param environment the wiring environment * * @return a {@link GraphQLScalarType} */ default GraphQLScalarType getScalar(ScalarWiringEnvironment environment) { return assertShouldNeverHappen(); }
public NumberHolder changeNumber(int newNumber) { this.numberHolder.theNumber = newNumber; informSubscribers(newNumber); return this.numberHolder; }
private GraphQL buildSchema() { return GraphQL.newGraphQL(schema) .build(); }
@Internal protected ObjectTypeExtensionDefinition(String name, List<Type> implementz, List<Directive> directives, List<FieldDefinition> fieldDefinitions, Description description, SourceLocation sourceLocation, List<Comment> comments, IgnoredChars ignoredChars) { super(name, implementz, directives, fieldDefinitions, description, sourceLocation, comments, ignoredChars); }
/** * All Schema Definition Language (SDL) Definitions. * * @param <T> the actual Node type */ @PublicApi public interface SDLDefinition<T extends SDLDefinition> extends Definition<T> { }
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass") @Override public boolean equals(Object o) { return GraphqlErrorHelper.equals(this, o); }
private GraphQL buildSchema() { return GraphQL.newGraphQL(schema) .build(); }
@Internal protected OperationTypeDefinition(String name, TypeName typeName, SourceLocation sourceLocation, List<Comment> comments, IgnoredChars ignoredChars) { super(sourceLocation, comments, ignoredChars); this.name = name; this.typeName = typeName; }