8000 Removed deprecated methods in ExecutionInput by bbakerman · Pull Request #3511 · graphql-java/graphql-java · GitHub
[go: up one dir, main page]

Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 1 addition & 32 deletions src/main/java/graphql/ExecutionInput.java
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0