So, I’ve decided to try out GraphQL Yoga (and co) ...
# orm-help
i
So, I’ve decided to try out GraphQL Yoga (and co) for an app I am working on. The boilerplate that I am mainly looking at looks like I have to provide
where
options, even when I want a list of unfiltered objects. Is this true?
posts: [Post!]!
should not need a
where
argument. That should be optional but crashes my server because I don’t provide that in my resolver
n
No, that's not true.
i
So, I kind of figured it out. I accidentally missed an “s” but now I am just getting a subscription. Old Resolver (original issue):
Copy code
posts(parent, args, ctx, info) {
    return <http://ctx.db.query.post|ctx.db.query.post>();
  },
New Resolver (subscription issue):
Copy code
posts(parent, args, ctx, info) {
    return ctx.db.query.posts();
  },
n
What do you mean, you only get one subscription?
Copy code
posts(parent, args, ctx, info) {
    return ctx.db.query.posts({}, info);
  },
also you probably want to write this ^
i
When I execute the following, I have to press the stop button to stop the subscription. Logging everything out, I’m just getting back hundreds of empty post objects.
Copy code
{
  posts {
    id
  }
}
n
What subscription are you talking about?
i
Even with changing to your recommendation, it still happens.
n
I am not aware of any subscription.
i
It’s a query but it’s acting like a subscription
n
is your endpoint live so I can try this as well?
i
The query doesn’t execute like a query. I run the above query but I just get a real-time stream of posts, like you would expect from a subscription. (Which is why I have to press the stop button after I press the play button)
Ermm, no
Let me figure out how to push it up
n
What client are you using?
i
I’m just using localhost:4000 / the Prisma GraphiQL editor
No client
n
this is a client 🙂
what's your
graphql-yoga
version?
i
Well, no client in the traditional sense
Latest on every dep, including Prisma
n
please share the
graphql-yoga
version with me.
i
1.14.10
n
thanks
I can't reproduce this behaviour with the above boilerplate project.
It uses
graphql-yoga
1.14.10
.
i
I’m trying it out now
n
to be clear, you are using the in-browser version of Playground, correct?
not the electron app.
i
Yes
Browser version
I can confirm that the advanced example does not have the weird subscription error. I’ll spend some time debugging
👍 1
Thanks