Hi,
I’m trying to query order agreements using the GraphQL admin API, but I’m stuck on how to retrieve additonal pages for the nested “sales” connection within each agreement My initial query to get the agreements, with extraneous fields stripped out, looks something like the following - the section in bold is the nested connection that I need to be able to query for more pages :
query getOrder($id: ID!) {
order(id: $id) {
agreements(first: 2) {
edges {
node {
id
happenedAt
**sales(first: 5) {**
<strong> edges {
node {
lineType
actionType
}
}
pageInfo {
hasNextPage
endCursor
}
}
}</strong>
cursor
}
pageInfo {
hasNextPage
endCursor
}
}
}
}
Where the outer pagination indicates that there are more agreements to retrieve I can use a similar query, passing in a cursor to get the next page of agreements:
query getMoreAgreements($id: ID!, $cursor: String) {
order(id: $id) {
agreements(first: 5, after: $cursor) {
... <snip>
}
}
}
What I can’t figure out is a way that I can query for a specific OrderAgreement in order that I can then use the appropriate cursor to get the next page of "Sale"s for that agreement.
Could anyone suggest how to achieve this?
Thanks,
Tim