WebInterceptor contract revision

WebInterceptor now uses delegation, forming a chain of interceptors
followed by a GraphQLService at the end to invoke graphql.GraphQL.

Closes gh-49
This commit is contained in:
Rossen Stoyanchev
2021-04-30 21:26:26 +01:00
parent e5a92a310d
commit f93c46eee3
29 changed files with 402 additions and 407 deletions

View File

@@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.graphql.web.WebGraphQLService;
import org.springframework.graphql.web.WebGraphQLHandler;
import org.springframework.graphql.test.tester.GraphQLTester;
/**
@@ -34,9 +34,9 @@ public class QueryTests {
@BeforeEach
public void setUp(@Autowired WebGraphQLService service) {
public void setUp(@Autowired WebGraphQLHandler handler) {
this.graphQLTester = GraphQLTester.create(webInput ->
service.execute(webInput).contextWrite(context -> context.put("name", "James")));
handler.handle(webInput).contextWrite(context -> context.put("name", "James")));
}

View File

@@ -23,7 +23,7 @@ import reactor.test.StepVerifier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.graphql.web.WebGraphQLService;
import org.springframework.graphql.web.WebGraphQLHandler;
import org.springframework.graphql.test.tester.GraphQLTester;
/**
@@ -36,9 +36,9 @@ public class SubscriptionTests {
@BeforeEach
public void setUp(@Autowired WebGraphQLService service) {
public void setUp(@Autowired WebGraphQLHandler handler) {
this.graphQLTester = GraphQLTester.create(webInput ->
service.execute(webInput).contextWrite(context -> context.put("name", "James")));
handler.handle(webInput).contextWrite(context -> context.put("name", "James")));
}