-
Notifications
You must be signed in to change notification settings - Fork 5
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
Can I use with Graphql subscription ? #9
Comments
I have some schema issues, but that'S the code I have right now. Hope it works. |
Thank you sir |
I had to change |
Thank you sir |
Apologies for not seeing this sooner! Thank you @Extarys for your example, I might document this in the README. |
No problem, my pleasure |
I fix it by changing |
https://github.com/n3ologism/music-fastify/tree/backend/backend/src This is my repository |
@lagmanzaza tnx, its work for me import { execute, subscribe } from 'graphql'
import { SubscriptionServer } from 'subscriptions-transport-ws';
import { schema } from "./api/schema"
const fastify = require('fastify')({
logger: false
})
// This `listen` method launches a web-server
fastify.listen(3000, (err, address) => {
if (err) throw err
console.log('\x1b[35m', `🚀 Server ready at http://localhost:3000/graphql`)
console.log("\x1b[35m", `🚀 Subscription server ws://localhost:3000/graphql`)
})
new SubscriptionServer(
{
schema,
execute,
subscribe,
},
{
server: fastify.server,
path: '/graphql',
},
); |
@nikitamarcius Actually, You can use Apollo server instead |
@lagmanzaza nope. Tried first, HTTP endpont works, but subscriptions no Better Graphql + Fastify + subscriptions. |
No description provided.
The text was updated successfully, but these errors were encountered: