Skip to content

Commit 142dace

Browse files
authored
Merge pull request #185 from pcarrier/pcarrier/simpler_ro
GraphQLSchemaProvider#copyReadOnly: simpler, supports CodeRegistry
2 parents 5f2d53f + fd8ca5b commit 142dace

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/main/java/graphql/servlet/GraphQLSchemaProvider.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package graphql.servlet;
22

3+
import graphql.schema.GraphQLObjectType;
34
import graphql.schema.GraphQLSchema;
45

56
import javax.servlet.http.HttpServletRequest;
@@ -8,11 +9,8 @@
89
public interface GraphQLSchemaProvider {
910

1011
static GraphQLSchema copyReadOnly(GraphQLSchema schema) {
11-
return GraphQLSchema.newSchema()
12-
.query(schema.getQueryType())
13-
.codeRegistry(schema.getCodeRegistry())
14-
.subscription(schema.getSubscriptionType())
15-
.additionalTypes(schema.getAdditionalTypes())
12+
return GraphQLSchema.newSchema(schema)
13+
.mutation((GraphQLObjectType) null)
1614
.build();
1715
}
1816

0 commit comments

Comments
 (0)