Skip to content

spring server updates #361

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

Merged
merged 2 commits into from
Sep 20, 2019
Merged

Conversation

dariuszkuc
Copy link
Collaborator

@dariuszkuc dariuszkuc commented Sep 20, 2019

📝 Description

graphql-kotlin-spring-server updates:

  • update GraphQLContextFactory to use coroutines for building the context
  • extract SubscriptionHandler logic from default WebSocketHandler, default subscription WebSocketHandler will now call available SubscriberHandler bean
  • update SimpleSubscriptionHandler to use GraphQLContext - fixes GraphQLContext unavailable for Subscriptions #360
  • add error handling to SimpleSubscriptionHandler

🔗 Related Issues

#360

- update `GraphQLContextFactory` to use coroutines for building the context
- extract `SubscriptionHandler` logic from default `WebSocketHandler`, default subscription `WebSocketHandler` will now call available `SubscriberHandler` bean
- update `SimpleSubscriptionHandler` to use `GraphQLContext` - fixes ExpediaGroup#360
- add error handling to `SimpleSubscriptionHandler`
ContextWebFilter returns a mono publisher that will compute the final result only after chain is subscribed to. StepVerifier was attempting to verify the context on the un-completed chain which did not populate the reactor context yet. Fix is to manually capture the context in the publisher chain, complete the publisher chain and then verify the contents of the captured reactor context.
@codecov-io
Copy link

codecov-io commented Sep 20, 2019

Codecov Report

Merging #361 into master will decrease coverage by 0.22%.
The diff coverage is 90.32%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #361      +/-   ##
============================================
- Coverage     94.69%   94.46%   -0.23%     
- Complexity      320      323       +3     
============================================
  Files            96       97       +1     
  Lines          1131     1139       +8     
  Branches        203      204       +1     
============================================
+ Hits           1071     1076       +5     
- Misses           21       22       +1     
- Partials         39       41       +2
Impacted Files Coverage Δ Complexity Δ
.../graphql/spring/execution/GraphQLContextFactory.kt 100% <100%> (ø) 0 <0> (ø) ⬇️
...up/graphql/spring/SubscriptionAutoConfiguration.kt 100% <100%> (ø) 5 <3> (+1) ⬆️
...up/graphql/spring/execution/SubscriptionHandler.kt 100% <100%> (+5.55%) 0 <0> (ø) ⬇️
...group/graphql/spring/execution/ContextWebFilter.kt 50% <50%> (-25%) 2 <1> (ø)
...l/spring/execution/SubscriptionWebSocketHandler.kt 92.85% <92.85%> (ø) 2 <2> (?)
...xpediagroup/graphql/spring/model/GraphQLRequest.kt 90.9% <0%> (-9.1%) 4% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d319b4...f746a88. Read the comment docs.

@smyrick smyrick merged commit 2cb7ed1 into ExpediaGroup:master Sep 20, 2019
@dariuszkuc dariuszkuc deleted the spring_server branch September 20, 2019 16:10
@smyrick smyrick added changes: minor Changes require a minor version type: bug Something isn't working type: enhancement New feature or request labels Sep 24, 2019
dariuszkuc added a commit to dariuszkuc/graphql-kotlin that referenced this pull request Aug 5, 2022
* spring server updates

- update `GraphQLContextFactory` to use coroutines for building the context
- extract `SubscriptionHandler` logic from default `WebSocketHandler`, default subscription `WebSocketHandler` will now call available `SubscriberHandler` bean
- update `SimpleSubscriptionHandler` to use `GraphQLContext` - fixes ExpediaGroup#360
- add error handling to `SimpleSubscriptionHandler`

* fix context web filter test

ContextWebFilter returns a mono publisher that will compute the final result only after chain is subscribed to. StepVerifier was attempting to verify the context on the un-completed chain which did not populate the reactor context yet. Fix is to manually capture the context in the publisher chain, complete the publisher chain and then verify the contents of the captured reactor context.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes: minor Changes require a minor version type: bug Something isn't working type: enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

GraphQLContext unavailable for Subscriptions
3 participants