Which implies that we need an AsyncIterator that yields objects of type JobStatus, that is to say:
{
jobStatus: 'something'
}
But when I use a custom written AsyncIterator to achieve this, I get errors saying jobStatus cannot be null. What I actually need to yield is the whole data payload:
Given a schema:
and types:
The generated subscription types looks like this:
Which implies that we need an
AsyncIterator
that yields objects of typeJobStatus
, that is to say:But when I use a custom written
AsyncIterator
to achieve this, I get errors sayingjobStatus
cannot be null. What I actually need to yield is the whole data payload:Is this a bug or am I doing something wrong?
EDIT: I feel this is also apparent in graphql-yoga examples, we need to return the entire payload i.e: https://github.com/prisma/graphql-yoga/tree/master/examples/subscriptions
instead of just
Versions
graphqlgen: 0.6.0-rc9 OS: Windows 10