15.3 The documents
Each file holds one named operation. The roots are the ones the API already has: discover for
queries, dispatch for trains run as mutations.
query Catalogue {
discover {
products(order: { sku: ASC }) {
nodes {
sku
name
price
stock
}
}
}
}mutation PlaceOrder($input: PlaceOrderInput!) {
dispatch {
placeOrder(input: $input) {
externalId
output {
orderId
total
}
}
}
}externalId is the run's id, which the page follows. runProgress is not written here: the hub
generates that document itself, for every train marked [TraxRunProgress].
query MyOrders {
discover {
orders {
nodes {
id
total
placedAt
}
}
}
}A document asks for what its page shows and nothing more. Every rule from the earlier chapters
still applies to it: the query filter scopes orders to the caller, and placeOrder admits only
customers.
SDK Reference
Generated clients | trax client | Client manifest | Fetch only what a component needs | Run progress