Appearance
Parameters
Collections
It's a collection of items. As an example we take Article.
Article will always return only one item. If we don't add a filter, the first item in the collection.
Request
article?fields=COD
query {
article {
COD
}
}
Response
{
"data": {
"article": {
"COD": "001"
}
}
}
If we want to have multiple items, we add an s to it.
Articles will always return a collection of items. If we don't add a filter, the first 100 items in the collection.
Request
articles?fields=COD
query {
articles {
COD
}
}
Response
{
"data": {
"articles": [
{
"COD": "001"
},
{
"COD": "002"
},
...
]
}
}
Fields
Choose the fields that are returned in the current dataset.
REST API
?fields=COD,DESI
GraphQL
query {
articles {
COD
DESI
}
}
Filter
Used to search items in a collection. Add the moment it's only possible to use an = operator.
REST API
?COD=001
GraphQL
query {
articles(where: { COD: "001" }) {
COD
}
}
Limit
The default limit is set to 100 The max limit is set to 5000
REST API
?limit=100
GraphQL
query {
articles(limit: 100) {
COD
}
}
Offset
Skip the first n items in the response. Can be used for pagination.
REST API
?offset=10
GraphQL
query {
articles(offset: 10) {
COD
}
}