Get Prices in Graphql
This query returns price history rows for one instrument (by user_code).
GraphQL Query
query GetPriceHistoryList {
price_history(
pagination: {
limit: 20
offset: 0
}
filters: {
instrument: {
user_code: {
exact: "XS2200244072"
}
}
}
) {
id
date
principal_price
instrument {
id
user_code
name
}
pricing_policy {
id
user_code
}
}
}
Filter Highlights
Filter by Related Object Field
filters: {
instrument: {
user_code: { exact: "XS2200244072" }
}
}
instrumentis a related object.- You can filter it by its fields.
exactmeans strict match.
Why Use user_code
- Stable identifier for business use.
- No need to know internal
id.
Notes
Your query had extra commas after blocks. GraphQL doesnotneed commas.- Add a date filter if you want one day only:
date: { exact: "2023-12-01" }
- Pagination stays the same for list queries.
