apollo-server icon indicating copy to clipboard operation
apollo-server copied to clipboard

docs: new path for useServer v6 and up

Open jchanke opened this issue 6 months ago • 4 comments

useServer should be imported from the path graphql-ws/use/ws instead of graphql-ws/lib/use/ws, starting from graphql versions 6.0.0 and up.

see https://github.com/enisdenjo/graphql-ws/issues/617

jchanke avatar Jun 24 '25 12:06 jchanke

@jchanke: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

apollo-cla avatar Jun 24 '25 12:06 apollo-cla

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

codesandbox-ci[bot] avatar Jun 24 '25 12:06 codesandbox-ci[bot]

Hi, are you sure that's the only change? In addition to another import in the same file, the code shows a few calls to useServer with methods whose options may have changed.

I can try to make the other changes myself but as I don't really actively use this WS support, it's easier to validate when the PR comes from somebody successfully using graphql-ws. Are you able to audit the calls to useServer in the file and update them too?

(We really only have this doc page as a replacement for the fact that we had subscriptions built in way back in Apollo Server v2; at some point we should just delete it and simply have a sentence somewhere noting that graphql-ws exists and is well-documented...)

glasser avatar Jul 02 '25 22:07 glasser

Thanks for pointing that out. I'll look into that as well!

jchanke avatar Jul 03 '25 13:07 jchanke