Loading...
This is a simple project to try out graphql subscription with graphql-yoga in the backend and wonka and subscriptions-transport in the frontend.
graphql-yoga
.resolve
- Is function that takes payload
and args
. payload
is the data we transfer in channel as the second argument. args
is the argument we subscribed with. This is the function that resolve the final output for the subscription into the channels.subscribe
- is the function that gets runs first when a user subscribe to a subscription. We have used withFilter
from yoga
to filter the subscription.withFilter
takes two functions as argument. The first one is where we subscribe to the channel and do any logic related work. The second function is the one that has logic to filter the subscription, returning false will not relay event to the particular subscriptions.npm run start
it will run the server at port 4000.npm run start
, will start the UI at port 8081.