Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Support graphql-ws #812

Open
Open

Description

@bostandyksoft

Hi.

I tried to use this library with JS client. All tutorials about it said, that need use "graphql-ws" library for subscriptions. But all worked examples of servers with this library used "subscriptions-transport-ws".

NPM install for this JS-library says

The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.co
m/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws    For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md

So I have question - I there is a way to switch library WebSocket support to graphql-ws either - do you have plan to support it?

I've added my client. To checking it on your own project, you can change parts of code under //TODO
dist.zip

Best regards. Alexey

Activity

  1. bostandyksoft commented on Apr 26, 2022

    @bostandyksoft
    Author

    I've notice, that subscriptions are broken since 12.0.0 version. For version 11.0.0 all is good

  2. oliemansm commented on Apr 26, 2022

    @oliemansm
    Member

    Do you have spring-boot-starter-websocket in your dependencies? In 11.0.0 it would automatically pull in all sorts of spring boot starters, while in 12.0.0 it relies on you to add the proper dependencies. Then the kickstart starter will only enable features depending on things that are on the classpath. Meaning if you do not have a websocket starter on your classpath it will not configure support for subscriptions.

    In gradle it would be:

    implementation 'org.springframework.boot:spring-boot-starter-websocket:2.6.7'
    
  3. bostandyksoft commented on Apr 26, 2022

    @bostandyksoft
    Author

    Thanks for quick response. This fixes second notice. But apollo client, based on graphql-ws still not working.

  4. oliemansm commented on Apr 26, 2022

    @oliemansm
    Member

    There should be some documentation on the Apollo repo on how to migrate from subscriptions-transport-ws to graphql-ws. The underlying protocol should still be the same, it's just a matter of how to set it up on the client side that's changed. Support for that is out of scope of this project.

  5. KammererTob commented on Apr 29, 2022

    @KammererTob

    The underlying protocol is not the same i think, mainly because GraphQL did not define it in any spec (see here: https://www.apollographql.com/docs/react/data/subscriptions/#choosing-a-subscription-library). graphql-ws besides also supporting the subscription operation, allows to use GraphQL over WS entirely (unless i misunderstood something). More discussion here: graphql/graphql-over-http#140.
    I am not sure if this is matured enough already to warrant any work. Although with Apollo already having this implemented it is probably somewhat safe to say that it will stay.
    This is the new protocol: https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md
    The correct repo for this would probably be: https://github.com/graphql-java-kickstart/graphql-java-servlet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions