Backend - GraphQL with Apollo - getting started queries for the playground
Closed this issue · 4 comments
(See backend issue #144: have documentation include getting started queries for the playground
Copy and paste from there.)
Arriving in the playground it's not immediately obvious what queries one can make.
Would be great if examples were included, either in the docs or when the playground starts up (maybe it does once it is seeded?) - There is something on this page in the docs:
https://docs.human-connection.org/nitro/backend/graphql-with-apollo
but would be great if there was something to copy and paste, or even something that just pops out when things start (apologies if there is already something like this after seeding)
@appinteractive :
There is a possibility in the latest GraphQL-Yoga Server to add predefined queries in the playground. That would be a good solution I think.
@roschaefer :
We should include images in the documentation. @tansaku e.g. if you click on the green "Schema" bookmark on the right side, that will give you an overview of the possibilities. Also, you can Ctrl+Space
to get auto-completion in the query editor on the left side.
E.g. type in {
, hit enter. Curly braces will be auto-closed. Hit Ctrl+Space
and you get a dropdown of all the resources. The response of the server is also quite helpful, e.g. you have to request at least one attribute etc.
@tansaku :
That's good to know Robert - we could also provide some simple text queries like:
{
Post {
title
}
}
to help folks get started ...
@roschaefer :
@tansaku I would say that is calling for a PR to our documentation including a screenshot and a query for copy+paste 👍
There is a defaultPlaygroundQuery
config key on our server which can include a starting query! See https://github.com/prisma/graphql-yoga/blob/master/README.md
Maybe this one would be a good starting point
{
statistics {
countUsers
countPosts
countComments
countNotifications
countOrganizations
countProjects
countInvites
countFollows
countShouts
}
}
Issue moved to Human-Connection/Human-Connection #458 via ZenHub
Issue moved to Human-Connection/Human-Connection #457 via ZenHub