2018-09-11 14:11:24 +03:00
|
|
|
Simple object queries
|
|
|
|
=====================
|
|
|
|
|
2018-12-03 15:12:24 +03:00
|
|
|
.. contents:: Table of contents
|
|
|
|
:backlinks: none
|
|
|
|
:depth: 1
|
|
|
|
:local:
|
|
|
|
|
2018-09-11 14:11:24 +03:00
|
|
|
You can fetch a single node or multiple nodes of the same type using a simple object query.
|
|
|
|
|
2018-12-03 15:12:24 +03:00
|
|
|
Fetch list of objects
|
|
|
|
---------------------
|
2018-09-11 14:11:24 +03:00
|
|
|
For example, fetch a list of authors:
|
|
|
|
|
|
|
|
.. graphiql::
|
|
|
|
:view_only:
|
|
|
|
:query:
|
|
|
|
query {
|
|
|
|
author {
|
|
|
|
id
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
:response:
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"author": [
|
|
|
|
{
|
|
|
|
"id": 1,
|
|
|
|
"name": "Justin"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 2,
|
|
|
|
"name": "Beltran"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 3,
|
|
|
|
"name": "Sidney"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 4,
|
|
|
|
"name": "Anjela"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|