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

Fix subscription test #1

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Fix subscription test #1

wants to merge 7 commits into from

Conversation

bclozel
Copy link

@bclozel bclozel commented Aug 3, 2022

  • Clean build file
  • Remove EnableWebFlux annotation
  • Clean up application properties
  • Rework GraphQL controllers
  • Move test query document
  • Add toString
  • Rewrite GraphQL subscription test

bclozel added 7 commits August 3, 2022 11:21
Removed websocket dependency, as this one is designed for Servlet
applications. The websocket support is shipped with webflux already.

Removed the kickstart dependency as there is no use for this here.
Adding this annotation disables completely the Spring Boot
auto-configuration for WebFlux.
See https://docs.spring.io/spring-boot/docs/current/reference/html/web.html#web.reactive.webflux.auto-configuration
Removing configuration properties already aligned with default values.
Also enabling GraphiQL UI for testing locally.

See http://localhost:8080/graphiql
Prior to this commit, the `getFluxOfObjects` query was not mapped nor
used. This commit adds a new Greeting controller for testing a vanilla
query.

The subscription schema entry has been improved to take an argument
setting the number of elements that should be streamed.
As of spring-projects/spring-graphql#338, the location for test
documents has changed.
Prior to this commit, the test would require to manually start the
application and test subscriptions with hand-crafted queries using only
an HTTP client.

This commit rewrites the test as a `@GraphQlTest`, which does not
require a live server and uses instead a `GraphQlTester` for useful
assertions.

This behavior can be checked against the live server still using the
graphiql UI at http://localhost:8080/graphiql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant