You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the provided, basic example of using graphql-yoga with Bun + graphiql to create a "countdown" subscription, the data data doesnt return until the subscription has ended (as opposed to a streaming countdown you just get the final result)
Your Example Website or App
Please see attached code (couldn't find an online playground for bun)
Expected to see streaming results, but I'm only seeing results upon completion.
Screenshots or Videos
No response
Platform
OS: macOS
Bun: 0.5.8
@graphql-yoga/* version(s): 3.7.0
Additional context
import{createYoga,createSchema}from'graphql-yoga';constyoga=createYoga({schema: createSchema({typeDefs: /* GraphQL */` type Query { greetings: String } type Subscription { countdown(from: Int!): Int! } `,resolvers: {Query: {greetings: ()=>'Hello from Yoga in a Bun app!',},Subscription: {countdown: {// This will return the value on every 1 sec until it reaches 0subscribe: asyncfunction*(_,{ from }){for(leti=from;i>=0;i--){awaitnewPromise((resolve)=>setTimeout(resolve,1000));yield{countdown: i};}},},},},}),});constserver=Bun.serve(yoga);console.info(`Server is running on ${newURL(yoga.graphqlEndpoint,`http://${server.hostname}:${server.port}`)}`);
The text was updated successfully, but these errors were encountered:
Describe the bug
Using the provided, basic example of using graphql-yoga with Bun + graphiql to create a "countdown" subscription, the data data doesnt return until the subscription has ended (as opposed to a streaming countdown you just get the final result)
Your Example Website or App
Please see attached code (couldn't find an online playground for bun)
Steps to Reproduce the Bug or Issue
Expected behavior
Expected to see streaming results, but I'm only seeing results upon completion.
Screenshots or Videos
No response
Platform
@graphql-yoga/*
version(s): 3.7.0Additional context
The text was updated successfully, but these errors were encountered: