Skip to main content

Contact GraphQL

Nested getContactAddresses Resolver​

Contact now exposes getContactAddresses(filter, orderBy) for loading a contact's addresses with server-side filtering and sorting. Use it when a contact query only needs a subset of addresses or a deterministic address order.

query ContactAddresses($organizationId: Int!) {
getContacts(organizationId: $organizationId, filter: "contactId:123") {
items {
contactId
name
getContactAddresses(filter: "addressType:Shipping", orderBy: "cityName") {
contactAddressId
addressType
addressLine
cityName
stateCode
countryCode
}
}
}
}

Arguments:

ArgumentTypeDescription
filterStringLucene filter applied to the contact address rows for the parent contact.
orderByStringSort expression applied to the returned addresses.

The resolver is projected, so select only the address fields required by the UI or workflow.

Equipment Stored in Custom Values​

Contact.getEquipment(idPropertyName: String!) resolves an equipment record whose ID is stored in the contact's customValues. Pass the custom-value property name rather than the numeric ID itself. The resolver reads that property as an integer, scopes the lookup to the contact's organization, and returns null when the property is absent, is not an integer, or does not identify accessible equipment.

query ContactEquipment($organizationId: Int!) {
getContacts(organizationId: $organizationId, filter: "contactId:123") {
items {
contactId
getEquipment(idPropertyName: "currentEquipmentId") {
equipmentId
equipmentNumber
}
}
}
}