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

Revisit GraphQlTester to align with GraphQlClient #317

Closed
rstoyanchev opened this issue Mar 7, 2022 · 0 comments
Closed

Revisit GraphQlTester to align with GraphQlClient #317

rstoyanchev opened this issue Mar 7, 2022 · 0 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@rstoyanchev
Copy link
Contributor

GraphQlTester came first and supported HTTP only but not WebSocket so it never explored design issues from the mismatch between HTTP and WebSocket as underlying transports.

GraphQlTester needs to be updated to build on what's now available from the client work under #10, and to align it with the design approach. As part of that, it also needs to change for #310 for details, to use correct terminology, e.g. document vs query.

Two new contracts need to be incorporated,GraphQlRequest as the client side request representation of what goes on the wire and GraphQlTransport that decouples the client (or tester) from request execution. For implementations, the HTTP transports for client vs tester are WebClient vs WebTestClient based respectively, while the WebSocket transport is common.

GraphQlTester took the approach of exposing transport details such as HTTP headers during request execution. WebSocket, however, is connection oriented with HTTP headers only relevant for the WebSocket handshake. Moreover, GraphQL over WebSocket defines a higher level mechanism with a connection_init and connection_ack message exchange after the WebSocket connection is established. GraphQlClient is modelled with connection-oriented, multiplexed transports in mind as a common denominator. It expects transport details to be configured at build time, and supports mutation as a first class mechanism so it's easy to create multiple, independent client instances. GraphQlTester will be aligned to follow the same approach.

@rstoyanchev rstoyanchev added the type: enhancement A general enhancement label Mar 7, 2022
@rstoyanchev rstoyanchev added this to the 1.0.0-M6 milestone Mar 7, 2022
@rstoyanchev rstoyanchev self-assigned this Mar 7, 2022
rstoyanchev added a commit that referenced this issue Mar 7, 2022
rstoyanchev added a commit that referenced this issue Mar 7, 2022
As these are expected to be used as local variables, "Spec" reduces
readability and the IDE creates variables called "spec", which
increases that effect. Given those are nested within `GraphQlClient`
and `GraphQlTester`, it makes sense to drop the spec part and local
variable names such as request and response make sense.

See gh-10, see gh-317
rstoyanchev added a commit that referenced this issue Mar 7, 2022
rstoyanchev added a commit that referenced this issue Mar 7, 2022
The JSON Encoder and Decoder implementations configured via
CodecConfigurer for HTTP and WebSocket are adapted to a JSONPath
MappingProvider and now automatically registered in JSONPath
configuration.

See gh-10, see gh-317
bclozel added a commit to spring-projects/spring-boot that referenced this issue Mar 8, 2022
This commit switches to 1.0.0-SNAPSHOT for Spring GraphQL, before its
upcoming 1.0.0-M6 version.

This commit adapts to the changes introduced in
spring-projects/spring-graphql#317 : now that `GraphQlClient` has been
introduced, `GraphQlTester` has been aligned with the new
infrastructure. The `@GraphQlTest` and `@SpringBootTest` testing support
is now using different variants for each.

All samples have been updated to use the proper GraphQL terminology, see
and spring-projects/spring-graphql#310 .

See gh-29637
rstoyanchev added a commit that referenced this issue Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant