Built to teach myself about how to use GraphQL with Rails.
So far, only supports querying.
Here are some examples, though:
Sorry this is sparse, but just, for now:
rails db:migrate
to set up the schema,rails db:seed
to set up the testing datarails s
to start up, and...- You're ready to send queries! Just send a query to
/graphql
and you'll see the results.
- In headers:
Content-Type
:application/json
- Request URL:
http://localhost:3000/graphql
- For the body (in raw JSON), send this:
{
"query" : "query { authors { poems { title } } }"
}
And you should get something like this back:
{
"data": {
"authors": [
{
"poems": [
{
"title": "Sonnet I"
},
{
"title": "Sonnet II"
}
]
},
{
"poems": [
{
"title": "Lovers Infiniteness"
}
]
}
]
}
}