How to retrieve detailed information about a specific engagement
To retrieve information about a specific engagement, use the engagement query with
the engagement’s GID. Since the Engagement type is an interface implemented by
PurchaseEngagement and RefinanceEngagement, you’ll use inline fragments to access
type-specific fields.
Use the engagement(id: EngagementGID!) query to retrieve details about one engagement:
Request
Copy
query GetEngagementDetails($id: EngagementGID!) { engagement(id: $id) { ... on PurchaseEngagement { id shortId type closingDate owner createdAt clients { firstName lastName email phoneNumber } property { address { street unitNumber city province postalCode country } } status { ... on PurchaseEngagementReceivedStatus { state } ... on PurchaseEngagementSettingUpStatus { state } ... on PurchaseEngagementPreparingForClosingStatus { state } ... on PurchaseEngagementClosingInProgressStatus { state } ... on PurchaseEngagementClosedStatus { state } ... on PurchaseEngagementCancelledStatus { state } } } ... on RefinanceEngagement { id shortId type closingDate owner createdAt clients { firstName lastName email phoneNumber } property { address { street unitNumber city province postalCode country } } status { ... on RefinanceEngagementReceivedStatus { state } ... on RefinanceEngagementSettingUpStatus { state } ... on RefinanceEngagementPreparingForClosingStatus { state } ... on RefinanceEngagementClosingInProgressStatus { state } ... on RefinanceEngagementClosedStatus { state } ... on RefinanceEngagementCancelledStatus { state } } } }}
Since the engagement query returns the Engagement interface, you need inline fragments
to access the concrete type’s fields. The interface provides a common set of fields
(id, shortId, type, owner, clients, createdAt), but type-specific fields
like closingDate, property, and status are only available on the concrete types.
Copy
{ engagement(id: "gid://ownright/Engagement/42") { # Fields from the Engagement interface (available on all types) id shortId type owner # Type-specific fields require inline fragments ... on PurchaseEngagement { closingDate property { address { street city } } status { ... on PurchaseEngagementReceivedStatus { state } } } ... on RefinanceEngagement { closingDate property { address { street city } } status { ... on RefinanceEngagementReceivedStatus { state } } } }}
The status field is itself an interface with multiple concrete status types (one
per state). Each status type currently exposes a state field, but this pattern
allows for additional status-specific fields to be added in the future without breaking
changes.