stockCardChanges query
stockCardChanges is a GraphQL query of the Chameleoon MAX API. Send it as POST https://max-api.chameleoon.sk/api/v1/graphql with your API key, see Chameleoon MAX.
Returns the real changes of stock cards, oldest first, forward from a cursor. Use it to keep the
stock in an external source up to date after a full export with stockCards.
Without after, the answer is an empty page whose endCursor is the head ("now"). Take it
before a full export.
Permissions
Requires the stockCard.read permission. Records of warehouses outside your API key's
warehouse, legal-entity or country scope are left out without an error.
Paging
A forward-only feed, as events.
firstis required, from 1 to 250.- Pass
pageInfo.endCursorasafterwhilepageInfo.hasNextPageistrue, then keep polling with it. - There is no
last, nobeforeand no total count. - The cursors are this feed's own and bound to your API key's organisation. An events cursor,
or another organisation's, returns
VALIDATIONatafter. - A cursor older than 30 days returns
VALIDATIONwithextensions.reasonCURSOR_EXPIRED. Export again and start without a cursor. - A page costs 2 + first × the cost of one node.
Filters
The server applies the filters, and the cursor moves past the records they leave out.
warehouseIds(at most 50) keeps the records of those warehouses.changedkeeps the records in which at least one of the named figures changed.- An omitted (or null) list matches all records, and an empty list matches none.
Waiting
wait holds the answer while nothing is waiting, until something is or the time is up.
waitis in seconds, from 0 (the default) to 25. Any other value returnsVALIDATIONatwait.- It waits only with
after, and only when the page would be empty withhasNextPagefalse. - It answers as soon as a record it would show arrives. When the time is up or the server is
shutting down, it answers with an empty page and an advanced
endCursor. - An empty answer is never an error. Poll again with its
endCursor. - Your API key holds at most 4 waits open on one server, those of
eventsincluded. A further one waits the lesser ofwaitand 5 seconds without watching for records, then answers what is there by then.
Good to know
- The records of one card come in version order.
- A record can be read about 1 to 3 seconds after the stock write.
Arguments
first:Intafter:StringwarehouseIds:[UUID!]changed:[StockFigure!]wait:Int
Returns
StockCardChangeConnection!: a page of StockCardChange.
Example
Query
Code
Variables
Code
Response
Code
Values are illustrative: replace IDs and codes with your own before you send the call.