Skip to content

Commit

Permalink
Revert PreparsedDocumentProvider in GraphQlSource
Browse files Browse the repository at this point in the history
  • Loading branch information
jord1e committed Jan 30, 2022
1 parent 753fa6c commit 65545a7
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 179 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import graphql.schema.idl.WiringFactory;

import org.springframework.core.io.Resource;
import org.springframework.graphql.execution.preparsed.SpringNoOpPreparsedDocumentProvider;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;

Expand All @@ -72,9 +71,6 @@ class DefaultGraphQlSourceBuilder implements GraphQlSource.Builder {

private final List<Instrumentation> instrumentations = new ArrayList<>();

@Nullable
private PreparsedDocumentProvider preparsedDocumentProvider;

@Nullable
private BiFunction<TypeDefinitionRegistry, RuntimeWiring, GraphQLSchema> schemaFactory;

Expand All @@ -99,12 +95,6 @@ public GraphQlSource.Builder defaultTypeResolver(TypeResolver typeResolver) {
return this;
}

@Override
public GraphQlSource.Builder preparsedDocumentProvider(PreparsedDocumentProvider preparsedDocumentProvider) {
this.preparsedDocumentProvider = preparsedDocumentProvider;
return this;
}

@Override
public GraphQlSource.Builder exceptionResolvers(List<DataFetcherExceptionResolver> resolvers) {
this.exceptionResolvers.addAll(resolvers);
Expand Down Expand Up @@ -159,12 +149,6 @@ public GraphQlSource build() {
builder = builder.instrumentation(new ChainedInstrumentation(this.instrumentations));
}

PreparsedDocumentProvider preparsedDocumentProvider = (this.preparsedDocumentProvider != null ?
this.preparsedDocumentProvider :
SpringNoOpPreparsedDocumentProvider.INSTANCE);

builder = builder.preparsedDocumentProvider(preparsedDocumentProvider);

this.graphQlConfigurers.accept(builder);
GraphQL graphQl = builder.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@

import graphql.GraphQL;
import graphql.execution.instrumentation.Instrumentation;
import graphql.execution.preparsed.PreparsedDocumentProvider;
import graphql.language.Document;
import graphql.schema.GraphQLSchema;
import graphql.schema.GraphQLTypeVisitor;
import graphql.schema.TypeResolver;
import graphql.schema.idl.RuntimeWiring;
import graphql.schema.idl.TypeDefinitionRegistry;

import org.springframework.core.io.Resource;
import org.springframework.graphql.execution.preparsed.SpringNoOpPreparsedDocumentProvider;

/**
* Strategy to resolve the {@link GraphQL} instance to use.
Expand Down Expand Up @@ -112,22 +109,6 @@ interface Builder {
*/
Builder defaultTypeResolver(TypeResolver typeResolver);

/**
* Configure the {@link PreparsedDocumentProvider} to use for GraphQL requests.
* <p>
* A {@code PreparsedDocumentProvider} can be used to cache and/or whitelist
* {@link Document} instances for queries. Configuring a
* {@code PreparsedDocumentProvider} gives you the ability to skip query parsing
* and validation.
* <p>
* By default, this is set to {@link SpringNoOpPreparsedDocumentProvider}, which
* calls the {@code parseAndValidateFunction}, and does nothing else.
* @param preparsedDocumentProvider the {@code PreparsedDocumentProvider} to use
* @return the current builder
* @see GraphQL#getPreparsedDocumentProvider()
*/
Builder preparsedDocumentProvider(PreparsedDocumentProvider preparsedDocumentProvider);

/**
* Add {@link DataFetcherExceptionResolver}'s to use for resolving exceptions from
* {@link graphql.schema.DataFetcher}'s.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.List;

import graphql.GraphQL;
import graphql.execution.preparsed.PreparsedDocumentProvider;
import graphql.schema.DataFetcher;
import graphql.schema.GraphQLTypeVisitor;
import graphql.schema.TypeResolver;
Expand Down Expand Up @@ -102,11 +101,6 @@ public GraphQlSetup typeResolver(TypeResolver typeResolver) {
return this;
}

public GraphQlSetup preparsedDocumentProvider(PreparsedDocumentProvider preparsedDocumentProvider) {
this.graphQlSourceBuilder.preparsedDocumentProvider(preparsedDocumentProvider);
return this;
}

public GraphQlSetup typeVisitor(GraphQLTypeVisitor... visitors) {
this.graphQlSourceBuilder.typeVisitors(Arrays.asList(visitors));
return this;
Expand Down

0 comments on commit 65545a7

Please sign in to comment.