Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed deprecated methods in ExecutionInput #3511

Merged
merged 1 commit into from Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 1 addition & 32 deletions src/main/java/graphql/ExecutionInput.java
Expand Up @@ -278,38 +278,7 @@ public Builder context(Object context) {
return this;
}

/**
* The legacy context object
*
* @param contextBuilder the context builder object to use
*
* @return this builder
*
* @deprecated - the {@link ExecutionInput#getGraphQLContext()} is a fixed mutable instance now
*/
@Deprecated(since = "2021-07-05")
public Builder context(GraphQLContext.Builder contextBuilder) {
this.context = contextBuilder.build();
return this;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removes the context builder, do you still want to keep private final Object context; in ExecutionInput?


/**
* The legacy context object
*
* @param contextBuilderFunction the context builder function to use
*
* @return this builder
*
* @deprecated - the {@link ExecutionInput#getGraphQLContext()} is a fixed mutable instance now
*/
@Deprecated(since = "2021-07-05")
public Builder context(UnaryOperator<GraphQLContext.Builder> contextBuilderFunction) {
GraphQLContext.Builder builder = GraphQLContext.newContext();
builder = contextBuilderFunction.apply(builder);
return context(builder.build());
}

/**
/**
* This will give you a builder of {@link GraphQLContext} and any values you set will be copied
* into the underlying {@link GraphQLContext} of this execution input
*
Expand Down
17 changes: 0 additions & 17 deletions src/test/groovy/graphql/ExecutionInputTest.groovy
Expand Up @@ -45,23 +45,6 @@ class ExecutionInputTest extends Specification {
executionInput.graphQLContext.get("a") == "b"
}

def "legacy context methods work"() {
// Retaining deprecated method tests for coverage
when:
def executionInput = ExecutionInput.newExecutionInput().query(query)
.context({ builder -> builder.of("k1", "v1") } as UnaryOperator) // Retain deprecated for test coverage
.build()
then:
(executionInput.context as GraphQLContext).get("k1") == "v1" // Retain deprecated for test coverage

when:
executionInput = ExecutionInput.newExecutionInput().query(query)
.context(GraphQLContext.newContext().of("k2", "v2")) // Retain deprecated for test coverage
.build()
then:
(executionInput.context as GraphQLContext).get("k2") == "v2" // Retain deprecated for test coverage
}

def "legacy context is defaulted"() {
// Retaining deprecated method tests for coverage
when:
Expand Down