Skip to content
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

feat(handler): Use Koa #80

Merged
merged 3 commits into from
Sep 7, 2023
Merged

feat(handler): Use Koa #80

merged 3 commits into from
Sep 7, 2023

Conversation

enisdenjo
Copy link
Owner

@enisdenjo enisdenjo commented Sep 7, 2023

Closes #78

Server usage with Koa

import Koa from 'koa'; // yarn add koa
import mount from 'koa-mount'; // yarn add koa-mount
import { createHandler } from 'graphql-sse/lib/use/koa';
import { schema } from './my-graphql';

// Create a Koa app
const app = new Koa();

// Serve all methods on `/graphql/stream`
app.use(mount('/graphql/stream', createHandler({ schema })));

app.listen({ port: 4000 });
console.log('Listening to port 4000');

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

💻 Website Preview

The latest changes are available as preview in: https://bb426d76.graphql-sse.pages.dev

@enisdenjo enisdenjo merged commit 283b453 into master Sep 7, 2023
7 checks passed
@enisdenjo enisdenjo deleted the koa branch September 7, 2023 20:20
enisdenjo pushed a commit that referenced this pull request Sep 7, 2023
# [2.3.0](v2.2.3...v2.3.0) (2023-09-07)

### Features

* **handler:** Use Koa ([#80](#80)) ([283b453](283b453)), closes [#78](#78)
@enisdenjo
Copy link
Owner Author

🎉 This PR is included in version 2.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@enisdenjo enisdenjo added the released Has been released and published label Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Has been released and published
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant