Basic Object Retrieval #
Get Multiple Objects #
query GetDocuments {
production {
documents(limit: 10) {
id
title
documentDate
customer {
title
customerCode
}
}
}
}
Get Single Object by ID #
query GetDocument {
production {
document(id: 123) {
id
title
description
documentDate
customer {
id
title
customerCode
contactPerson {
title
email
}
}
files {
id
title
extension
logicalSize
}
}
}
}
Advanced Filtering #
GRAPI provides comprehensive filtering capabilities on all object properties:
Text Filtering #
query FilterByText {
production {
documents(where: {
title: { contains: "Contract" }
description: { startsWith: "Important" }
}) {
id
title
description
}
}
}
Numeric and Date Filtering #
query FilterByNumericAndDate {
production {
documents(where: {
documentDate: { gte: "2024-01-01T00:00:00Z" }
priority: { gt: 2.0 }
isActive: { eq: true }
}) {
id
title
documentDate
priority
}
}
}
Lookup Property Filtering #
query FilterByLookup {
production {
documents(where: {
customer: {
customerCode: { startsWith: "CORP" }
isActive: { eq: true }
}
documentType: {
displayValue: { contains: "Contract" }
}
}) {
id
title
customer {
title
customerCode
}
documentType {
displayValue
}
}
}
}
Multi-Select Lookup Filtering #
query FilterByMultiSelect {
production {
documents(where: {
keywords: {
some: {
displayValue: { in: ["Important", "Urgent", "Priority"] }
}
}
}) {
id
title
keywords {
displayValue
}
}
}
}
Complex Business Queries #
Customer Contract Summary #
query GetCustomerContractSummary {
production {
customers(where: {
isActive: { eq: true }
customerCode: { startsWith: "CORP" }
}) {
id
title
customerCode
# Related documents through reverse lookup documents(where: {
documentType: {
displayValue: { contains: "Contract" }
}
isActive: { eq: true }
}) {
id
title
documentDate
contractValue
status {
displayValue
}
}
contactPerson {
title
email
phone
}
}
}
}