Master de II. ULL. 1er cuatrimestre
Follow the two tutorials below and reproduce the steps.
See the section hello subscriptions
See section GraphQL Subscriptions with Node.js
Write a graphQL server tha counts the accepts hello
queries like:
query paula {
hello(name: "paula")
}
query pablo {
hello(name: "pablo")
}
query nico {
hello(name: "nicolas")
}
and clients can subscribe to a greetings
event that occurs each time a hello
query occurs.
The event triggered by the hello
is an object that has not only the name greeted but
also the number of times it has been greeted.
Therefore queries like this one must be supported:
subscription {
counter {
name
count
}
}
You can find a solution in the folder subscriptions/hello-name
of the repo crguezl/graphql-yoga-examples
subscriptions/hello/ in the repo
crguezl/graphql-yoga-examples`