We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import {createPubSub, createSchema, createYoga} from 'graphql-yoga' const pubSub = createPubSub<{ randomNumber: [topic: number, random: number] }>() // Provide your schema const yoga = createYoga({ schema: createSchema({ typeDefs: /* GraphQL */ ` type Query { hello: String } type Subscription { randomNumber: Float! } type Mutation { broadcastRandomNumber: Boolean } `, resolvers: { Subscription: { randomNumber: { // subscribe to the randomNumber event subscribe: () => { return pubSub.subscribe('randomNumber', 1) }, resolve: payload => payload } } } }) }) setInterval(() => { pubSub.publish('randomNumber', 1, Math.random()) }, 1000) const server = Bun.serve({ fetch: yoga.fetch, port: 4000 }) console.info( `Server is running on ${new URL( yoga.graphqlEndpoint, `http://${server.hostname}:${server.port}` )}` )
bun run index.ts
It should not close the connection
No response
@graphql-yoga
The text was updated successfully, but these errors were encountered:
Works with NodeJS
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Screen.Recording.2024-11-06.at.11.07.14.mov
Your Example Website or App
Steps to Reproduce the Bug or Issue
Expected behavior
It should not close the connection
Screenshots or Videos
No response
Platform
@graphql-yoga
5.7.0Additional context
No response
The text was updated successfully, but these errors were encountered: