diff --git a/src/main/java/graphql/GraphQL.java b/src/main/java/graphql/GraphQL.java index 4026ffc3c2..1210ee7115 100644 --- a/src/main/java/graphql/GraphQL.java +++ b/src/main/java/graphql/GraphQL.java @@ -324,97 +324,6 @@ public ExecutionResult execute(String query) { return execute(executionInput); } - /** - * Info: This sets context = root to be backwards compatible. - * - * @param query the query/mutation/subscription - * @param context custom object provided to each {@link graphql.schema.DataFetcher} - * - * @return an {@link ExecutionResult} which can include errors - * - * @deprecated Use {@link #execute(ExecutionInput)} - */ - @Deprecated - @DeprecatedAt("2017-06-02") - public ExecutionResult execute(String query, Object context) { - ExecutionInput executionInput = ExecutionInput.newExecutionInput() - .query(query) - .context(context) - .root(context) // This we are doing do be backwards compatible - .build(); - return execute(executionInput); - } - - /** - * Info: This sets context = root to be backwards compatible. - * - * @param query the query/mutation/subscription - * @param operationName the name of the operation to execute - * @param context custom object provided to each {@link graphql.schema.DataFetcher} - * - * @return an {@link ExecutionResult} which can include errors - * - * @deprecated Use {@link #execute(ExecutionInput)} - */ - @Deprecated - @DeprecatedAt("2017-06-02") - public ExecutionResult execute(String query, String operationName, Object context) { - ExecutionInput executionInput = ExecutionInput.newExecutionInput() - .query(query) - .operationName(operationName) - .context(context) - .root(context) // This we are doing do be backwards compatible - .build(); - return execute(executionInput); - } - - /** - * Info: This sets context = root to be backwards compatible. - * - * @param query the query/mutation/subscription - * @param context custom object provided to each {@link graphql.schema.DataFetcher} - * @param variables variable values uses as argument - * - * @return an {@link ExecutionResult} which can include errors - * - * @deprecated Use {@link #execute(ExecutionInput)} - */ - @Deprecated - @DeprecatedAt("2017-06-02") - public ExecutionResult execute(String query, Object context, Map variables) { - ExecutionInput executionInput = ExecutionInput.newExecutionInput() - .query(query) - .context(context) - .root(context) // This we are doing do be backwards compatible - .variables(variables) - .build(); - return execute(executionInput); - } - - /** - * Info: This sets context = root to be backwards compatible. - * - * @param query the query/mutation/subscription - * @param operationName name of the operation to execute - * @param context custom object provided to each {@link graphql.schema.DataFetcher} - * @param variables variable values uses as argument - * - * @return an {@link ExecutionResult} which can include errors - * - * @deprecated Use {@link #execute(ExecutionInput)} - */ - @Deprecated - @DeprecatedAt("2017-06-02") - public ExecutionResult execute(String query, String operationName, Object context, Map variables) { - ExecutionInput executionInput = ExecutionInput.newExecutionInput() - .query(query) - .operationName(operationName) - .context(context) - .root(context) // This we are doing do be backwards compatible - .variables(variables) - .build(); - return execute(executionInput); - } /** * Executes the graphql query using the provided input object builder diff --git a/src/test/groovy/graphql/MutationTest.groovy b/src/test/groovy/graphql/MutationTest.groovy index 68da613740..d6613a2176 100644 --- a/src/test/groovy/graphql/MutationTest.groovy +++ b/src/test/groovy/graphql/MutationTest.groovy @@ -47,7 +47,8 @@ class MutationTest extends Specification { ] when: - def executionResult = GraphQL.newGraphQL(MutationSchema.schema).build().execute(query, new MutationSchema.SubscriptionRoot(6)) + def ei = ExecutionInput.newExecutionInput(query).root(new MutationSchema.SubscriptionRoot(6)).build() + def executionResult = GraphQL.newGraphQL(MutationSchema.schema).build().execute(ei) then: @@ -93,7 +94,8 @@ class MutationTest extends Specification { ] when: - def executionResult = GraphQL.newGraphQL(MutationSchema.schema).build().execute(query, new MutationSchema.SubscriptionRoot(6)) + def ei = ExecutionInput.newExecutionInput(query).root(new MutationSchema.SubscriptionRoot(6)).build() + def executionResult = GraphQL.newGraphQL(MutationSchema.schema).build().execute(ei) then: diff --git a/src/test/groovy/graphql/StarWarsQueryTest.groovy b/src/test/groovy/graphql/StarWarsQueryTest.groovy index f28cb3fe1b..0ed8b46bb2 100644 --- a/src/test/groovy/graphql/StarWarsQueryTest.groovy +++ b/src/test/groovy/graphql/StarWarsQueryTest.groovy @@ -190,7 +190,8 @@ class StarWarsQueryTest extends Specification { ] ] when: - def result = GraphQL.newGraphQL(StarWarsSchema.starWarsSchema).build().execute(query, null, params).data + def ei = ExecutionInput.newExecutionInput(query).variables(params).build() + def result = GraphQL.newGraphQL(StarWarsSchema.starWarsSchema).build().execute(ei).data then: result == expected @@ -212,7 +213,8 @@ class StarWarsQueryTest extends Specification { human: null ] when: - def result = GraphQL.newGraphQL(StarWarsSchema.starWarsSchema).build().execute(query, null, params).data + def ei = ExecutionInput.newExecutionInput(query).variables(params).build() + def result = GraphQL.newGraphQL(StarWarsSchema.starWarsSchema).build().execute(ei).data then: result == expected diff --git a/src/test/groovy/graphql/UnionTest.groovy b/src/test/groovy/graphql/UnionTest.groovy index 4fb9f2af25..5f8334130d 100644 --- a/src/test/groovy/graphql/UnionTest.groovy +++ b/src/test/groovy/graphql/UnionTest.groovy @@ -96,7 +96,8 @@ class UnionTest extends Specification { ] when: - def executionResult = GraphQL.newGraphQL(GarfieldSchema.GarfieldSchema).build().execute(query, GarfieldSchema.john) + def ei = ExecutionInput.newExecutionInput(query).root(GarfieldSchema.john).build() + def executionResult = GraphQL.newGraphQL(GarfieldSchema.GarfieldSchema).build().execute(ei) then: executionResult.data == expectedResult @@ -148,7 +149,8 @@ class UnionTest extends Specification { ] ] when: - def executionResult = GraphQL.newGraphQL(GarfieldSchema.GarfieldSchema).build().execute(query, GarfieldSchema.john) + def ei = ExecutionInput.newExecutionInput(query).root(GarfieldSchema.john).build() + def executionResult = GraphQL.newGraphQL(GarfieldSchema.GarfieldSchema).build().execute(ei) then: executionResult.data == expectedResult diff --git a/src/test/groovy/graphql/normalized/ExecutableNormalizedOperationFactoryTest.groovy b/src/test/groovy/graphql/normalized/ExecutableNormalizedOperationFactoryTest.groovy index 1b18fa97f3..b27d042472 100644 --- a/src/test/groovy/graphql/normalized/ExecutableNormalizedOperationFactoryTest.groovy +++ b/src/test/groovy/graphql/normalized/ExecutableNormalizedOperationFactoryTest.groovy @@ -1,5 +1,6 @@ package graphql.normalized +import graphql.ExecutionInput import graphql.GraphQL import graphql.TestUtil import graphql.execution.CoercedVariables @@ -1314,7 +1315,8 @@ schema { private void assertValidQuery(GraphQLSchema graphQLSchema, String query, Map variables = [:]) { GraphQL graphQL = GraphQL.newGraphQL(graphQLSchema).build() - assert graphQL.execute(query, null, variables).errors.size() == 0 + def ei = ExecutionInput.newExecutionInput(query).variables(variables).build() + assert graphQL.execute(ei).errors.size() == 0 } def "normalized arguments"() {