ViewConnections
Overview
All collections in the Finale GraphQL API are accessed via ViewConnection queries. This is a consistent pattern across all data types.
Naming Convention
For any collection {name}, the GraphQL query is {name}ViewConnection.
Examples:
product→productViewConnectionorder→orderViewConnectionlocation→locationViewConnection
Relay Connection Specification
ViewConnections follow the Relay connection specification, which provides:
- Pagination Support: Cursor-based pagination with
first,last,after, andbeforearguments - Edges and Nodes: Results are wrapped in
edgescontainingnodeobjects - Page Info: Metadata about pagination state via
pageInfo
Structure
{
{collection}ViewConnection(
first: Int
last: Int
after: String
before: String
sort: [SortInput]
# Collection-specific filters
) {
edges {
node {
# Fields from the collection
}
cursor
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
strategy # Query execution strategy used
}
}Example Query
query {
productViewConnection(first: 10) {
edges {
node {
productId
sku
description
}
}
pageInfo {
hasNextPage
endCursor
}
}
}Why ViewConnections?
This pattern provides:
- Consistent interface across all collections
- Built-in pagination support
- Efficient cursor-based navigation
- Standard way to handle large datasets
- Integration with Relay and other GraphQL clients
