A query allows you to read a set of records.
The query keyword is followed by an edge node nested structure that handles the properties of the nodes.
The following table shows a simple query example and its result.
{
xtremMasterData {
item {
query {
edges {
node {
isActive
name
}
}
}
}
}
}
|
{
"data": {
"xtremMasterData": {
"item": {
"query": {
"edges": [
{
"node": {
"isActive": true,
"name": "Capteur pression"
}
},
{
"node": {
"isActive": true,
"name": "Capteur haute pression"
}
}
]
}
}
}
}
}
|
The references are managed as subgroups. For instance, if you add a stock unit reference to the previous query, you need to define the properties you want to get:
{
xtremMasterData {
item {
query {
edges {
node {
isActive
name
stockUnit{
name
symbol
}
}
}
}
}
}
}
|
{
data": {
"xtremMasterData": {
"item": {
"query": {
"edges": [
{
"node": {
"isActive": true,
"name": "Capteur pression",
"stockUnit": {
"name": "each",
"symbol": "each"
}
}
},
{
"node": {
"isActive": true,
"name":"Capteur haute pression",
"stockUnit": {
"name": "each",
"symbol": "each"
}
}
},
]
}
}
}
}
}
|
For headers and lines, you can have nested edges nodes structures such as:
{
xtremMasterData{
item{
query {
totalCount
edges {
node {
id
customers{
query{
edges{
node{
name
customer {
id
}
}
}
}
}
}
}
}
}
}
}
|
{
"data": {
"xtremMasterData": {
"item": {
"query": {
"totalCount": 53,
"edges": [
{
"node": {
"isActive": true,
"name": "Capteur pression",
"stockUnit": {
"name": "each",
"symbol": "each"
}
}
},
{
"node": {
"isActive": true,
"name": "Capteur haute pression",
"stockUnit": {
"name": "each",
"symbol": "each"
}
}
}
]
}
}
}
}
}
|