S_keys
Supported arguments
The following arguments are supported by S_keys query:
Field | Type | Description |
---|---|---|
after | String | Returns the elements that come after the specified cursor |
first | Int | Returns up to the first n elements from the list |
stockId | S_Uuid | The ID of the stock item. Either this argument, "stockId" or "orderNumber" is required. |
state | S_KeyState | The state of keys. If NULL provided - all state keys will be returned |
sort | S_API_KeysSort | Keys sorting option. Default to oldest first |
ids | [S_Uuid!] | IDs of requested keys. Either this argument, "stockId", "orderNumber" or "ordersNumbers" is required. |
orderNumber | String | Associated order number. Either this argument, "stockId", "ordersNumbers" or "ids" is required. |
ordersNumbers | [String!] | Associated orders numbers. Either this argument, "stockId", "orderNumber" or "ids" is required. |
Return type
The query returns theS_API_KeyConnection
type.
Example usage
You can get auction's keys by performing S_keys
query with your auction ID and (optional) state.
Query
Get your auction's active keys.
{
S_keys(stockId: "ffffffff-23bc-11e9-9c94-ffffffffffff", state: ACTIVE) {
edges {
node {
id
value
state
}
}
}
}
Result
{
"data": {
"S_keys": {
"edges": [
{
"node": {
"id": "ffffffff-691e-11ea-afc4-ffffffffffff",
"value": "first-key",
"state": "ACTIVE"
}
},
{
"node": {
"id": "ffffffff-691e-11ea-b590-ffffffffffff",
"value": "second-key",
"state": "ACTIVE"
}
}
]
}
}
}
Query
Get your auction's reported keys.
{
S_keys(state: REPORTED, stockId: "ffffffff-3c55-11ea-aedd-ffffffffffff") {
edges {
node {
id
reportReason
}
}
}
}
Result
{
"data": {
"S_keys": {
"edges": [
{
"node": {
"id": "ffffffff-3c58-11ea-af1e-ffffffffffff",
"reportReason": "Part of the key was not visible"
}
}
]
}
}
}
Query
Get keys by IDs.
{
S_keys(ids: [ "1bd07056-ffff-11ab-eeee-295c93cf53bd", "ggggc3f0-7260-1cee-ac76-eeee38eff69b" ]) {
edges {
node {
id
value
state
}
}
}
}
Result
{
"data": {
"S_keys": {
"edges": [
{
"node": {
"id": "1bd07056-ffff-11ab-eeee-295c93cf53bd",
"value": "first-key",
"state": "SOLD"
}
},
{
"node": {
"id": "ggggc3f0-7260-1cee-ac76-eeee38eff69b",
"value": "second-key",
"state": "SOLD"
}
}
]
}
}
}