/** * This helps you transform the current GraphQL object into another one by starting a builder with all * the current values and allows you to transform it how you want. * * @param builderConsumer the consumer code that will be given a builder to transform * * @return a new GraphQL object based on calling build on that builder */ public GraphQL transform(Consumer<GraphQL.Builder> builderConsumer) { Builder builder = new Builder(this.graphQLSchema); builder .queryExecutionStrategy(nvl(this.queryStrategy, builder.queryExecutionStrategy)) .mutationExecutionStrategy(nvl(this.mutationStrategy, builder.mutationExecutionStrategy)) .subscriptionExecutionStrategy(nvl(this.subscriptionStrategy, builder.subscriptionExecutionStrategy)) .executionIdProvider(nvl(this.idProvider, builder.idProvider)) .instrumentation(nvl(this.instrumentation, builder.instrumentation)) .preparsedDocumentProvider(nvl(this.preparsedDocumentProvider, builder.preparsedDocumentProvider)); builderConsumer.accept(builder); return builder.build(); }
Objects.requireNonNull(graphqlQuery, "GraphQL query cannot be null"); GraphQL graphQL = new GraphQL.Builder(schema()).build();
/** * This helps you transform the current GraphQL object into another one by starting a builder with all * the current values and allows you to transform it how you want. * * @param builderConsumer the consumer code that will be given a builder to transform * * @return a new GraphQL object based on calling build on that builder */ public GraphQL transform(Consumer<GraphQL.Builder> builderConsumer) { Builder builder = new Builder(this.graphQLSchema); builder .queryExecutionStrategy(nvl(this.queryStrategy, builder.queryExecutionStrategy)) .mutationExecutionStrategy(nvl(this.mutationStrategy, builder.mutationExecutionStrategy)) .subscriptionExecutionStrategy(nvl(this.subscriptionStrategy, builder.subscriptionExecutionStrategy)) .executionIdProvider(nvl(this.idProvider, builder.idProvider)) .instrumentation(nvl(this.instrumentation, builder.instrumentation)) .preparsedDocumentProvider(nvl(this.preparsedDocumentProvider, builder.preparsedDocumentProvider)); builderConsumer.accept(builder); return builder.build(); }
" }"; GraphQL graphQL = new GraphQL.Builder(schema).build();
/** * Helps you build a GraphQL object ready to execute queries * * @param graphQLSchema the schema to use * * @return a builder of GraphQL objects */ public static Builder newGraphQL(GraphQLSchema graphQLSchema) { return new Builder(graphQLSchema); }
/** * Helps you build a GraphQL object ready to execute queries * * @param graphQLSchema the schema to use * * @return a builder of GraphQL objects */ public static Builder newGraphQL(GraphQLSchema graphQLSchema) { return new Builder(graphQLSchema); }