-
-
Notifications
You must be signed in to change notification settings - Fork 247
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
add support for graphql-transport-ws #1354
add support for graphql-transport-ws #1354
Conversation
Hey @paulpdaniels, What are these new variants? Where can I read about them, please? |
https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md was deprecated in favor of https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md |
interop/tapir/src/main/scala/caliban/interop/tapir/TapirAdapter.scala
Outdated
Show resolved
Hide resolved
interop/tapir/src/test/scala/caliban/interop/tapir/ws/ProtocolSpec.scala
Outdated
Show resolved
Hide resolved
4cf0f6b
to
99ca015
Compare
@frekw @ghostdogpr I made some significant changes since the last review, namely I refactored the pipeline logic so that it could more seamlessly handle detecting the protocol, and I had to rewire the websocket handler because the |
Only the akka and play adapters seems to fail 🤔 |
c0f37d8
to
662506b
Compare
I'm traveling this weekend and Monday but I'll take a look in the coming week! |
662506b
to
4be72b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very nice!
In addition to unit tests, did you also test with a client such as Altair? Just wondering if I should do additional manual tests just to make sure there is no regression.
interop/tapir/src/test/scala/caliban/interop/tapir/TestService.scala
Outdated
Show resolved
Hide resolved
adapters/akka-http/src/test/scala/caliban/AkkaHttpAdapterSpec.scala
Outdated
Show resolved
Hide resolved
interop/tapir/src/main/scala/caliban/interop/tapir/TapirAdapter.scala
Outdated
Show resolved
Hide resolved
interop/tapir/src/test/scala/caliban/interop/tapir/TapirAdapterSpec.scala
Outdated
Show resolved
Hide resolved
interop/tapir/src/main/scala/caliban/interop/tapir/ws/Protocol.scala
Outdated
Show resolved
Hide resolved
@ghostdogpr I just tried with the zio-http/akka and it works (it supports both formats simultaneously!). Http4s had what seems like a small compatibilty issue (sent back a null payload when it shouldn't), so I patched that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM to me! Just a tiny remark but good to merge for me.
* upgrade zio-config to 2.0.0 (#1367) * Update http4s-blaze-server to 0.23.12 (#1368) * Properly validate floating point numbers on input (#1370) * Escape quotes in description strings (#1372) Escape " with \" in normally quoted strings and """ with \""" in triple-quoted strings. https://spec.graphql.org/October2021/#sec-String-Value * Improve persisted query performance by caching the document (#1371) * improve persisted query performance by caching the document instead of the unparsed string. * address comments * Escape special characters in normally quoted strings (#1373) * Correct field types for interface fields on union (#1375) Ensure that when an interface fragment is used on a union that the fields its selected have the correct type instead of always being `String`. * Coerce non-null values into lists of size one (#1376) * Coerce non-null values into lists of size one As per the specification, if a value passed as an input to a list type is not a list and is not null then it should be coerced into a list of size one. * Make work on Scala 3 * Client auto-gen Option conflict (#1377) * have ClientWriter print scala.Option instead of Option * Fix replace case where Option may appear multiple times * Add test for various returns of GQL Option and scala.Option * run fmt * update ClientWriterViewSpec * SchemaWrite should also print scala.Option instead of Option * add a scripted test with a schema containing type Option * flatten scripted compile tests * make helper method for safe Option string replacement * add support for graphql-transport-ws (#1354) * add support for graphql-transport-ws * Set api mappings for ZIO (#1381) Co-authored-by: Lordie <levimanga@gmail.com> Co-authored-by: Scala Steward <43047562+scala-steward@users.noreply.github.com> Co-authored-by: Kevin Mooney <moonkev@users.noreply.github.com> Co-authored-by: Johannes Eriksson <johannes@stepzen.com> Co-authored-by: Paul Daniels <paulpdaniels@gmail.com> Co-authored-by: Mark Rudolph <mark@k8ty.app>
Adds support for the new graphql subscription variant. Splits the handling of the protocol into a separate type so that it can be implemented in a single place rather than in the adapters + zio-http.
There is probably even more refactoring that can be done here to get a smaller LOC profile, but I got as far as the weekend would allow so figured this would be a good checkin that we can continue to enhance.