Skip to content

Commit

Permalink
Update documentation for v6 release (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo authored Jan 15, 2025
1 parent bc549eb commit 90097bc
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 179 deletions.
2 changes: 1 addition & 1 deletion src/use/bun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface Extra {
* they default [`sendPingsAutomatically` to `true`](https://github.com/oven-sh/bun/blob/6a163cf933542506354dc836bd92693bcae5939b/src/deps/uws.zig#L893).
*
* ```ts
* import { makeHandler, handleProtocols } from 'graphql-ws/lib/use/lib/bun';
* import { makeHandler, handleProtocols } from 'graphql-ws/use/bun';
* import { schema } from './my-schema';
*
* Bun.serve({
Expand Down
2 changes: 1 addition & 1 deletion src/use/deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface Extra {
* import {
* makeHandler,
* GRAPHQL_TRANSPORT_WS_PROTOCOL,
* } from 'https://esm.sh/graphql-ws/lib/use/deno';
* } from 'https://esm.sh/graphql-ws/use/deno';
* import { schema } from './my-schema.ts';
*
* const handler = makeHandler({ schema });
Expand Down
12 changes: 5 additions & 7 deletions website/src/pages/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ export const schema = new GraphQLSchema({
#### With [ws](https://github.com/websockets/ws)

```ts
// import ws from 'ws'; yarn add ws@7
// const WebSocketServer = ws.Server;
import { useServer } from 'graphql-ws/lib/use/ws';
import { useServer } from 'graphql-ws/use/ws';
import { WebSocketServer } from 'ws'; // yarn add ws

import { schema } from './previous-step';
Expand All @@ -78,7 +76,7 @@ console.log('Listening to port 4000');
#### With [uWebSockets.js](https://github.com/uNetworking/uWebSockets.js)

```ts
import { makeBehavior } from 'graphql-ws/lib/use/uWebSockets';
import { makeBehavior } from 'graphql-ws/use/uWebSockets';
import uWS from 'uWebSockets.js'; // yarn add uWebSockets.js@uNetworking/uWebSockets.js#<tag>

import { schema } from './previous-step';
Expand All @@ -99,7 +97,7 @@ uWS
import fastifyWebsocket from '@fastify/websocket'; // yarn add @fastify/websocket
import Fastify from 'fastify'; // yarn add fastify

import { makeHandler } from 'graphql-ws/lib/use/@fastify/websocket';
import { makeHandler } from 'graphql-ws/use/@fastify/websocket';
import { schema } from './previous-step';

const fastify = Fastify();
Expand All @@ -121,7 +119,7 @@ fastify.listen(4000, (err) => {
#### With [Bun](https://bun.sh)

```ts
import { handleProtocols, makeHandler } from 'graphql-ws/lib/use/bun';
import { handleProtocols, makeHandler } from 'graphql-ws/use/bun';
import { schema } from './previous-step';

Bun.serve({
Expand Down Expand Up @@ -155,7 +153,7 @@ import { serve } from 'https://deno.land/std/http/mod.ts';
import {
GRAPHQL_TRANSPORT_WS_PROTOCOL,
makeHandler,
} from 'https://esm.sh/graphql-ws/lib/use/deno';
} from 'https://esm.sh/graphql-ws/use/deno';
import { schema } from './previous-step.ts';

const handler = makeHandler({ schema });
Expand Down
Loading

0 comments on commit 90097bc

Please sign in to comment.