🚀 Query Samples

Below are some sample queries to get you started.

Tickets

Tickets with subfields

GraphQL
GraphQL
query tickets_with_subfields {
LoadTicket(limit: 100) {
TicketNumber
TicketDate
NetWeight
TareWeight
Truck {
TruckID
Hauler {
HaulerID
}
}
Order {
OrderNumber
Description
PONumber
}
OrderProduct {
UnitPrice
Product {
ProductID
ProductDescription
}
}
}
}

Tickets after a given date

GraphQL
GraphQL
query tickets_after_given_date {
LoadTicket(where: {TicketDate: {_gte: "2021-05-01"}}) {
TicketNumber
TicketDate
Operator
NetWeight
TareWeight
GrossWeight
}
}

Tickets filtered by customer and product

GraphQL
GraphQL
query tickets_filtered_by_customer_product {
LoadTicket(
where: {
Order: {Customer: {CustomerID: {_eq: ""}}},
OrderProduct: {Product: {ProductID: {_eq: ""}}}
}
) {
TicketNumber
NetWeight
Order {
Customer {
CustomerID
}
}
OrderProduct {
Product {
ProductID
}
}
}
}

Orders

Orders added since a given date

GraphQL
GraphQL
query orders_since_given_date {
Order(where: {DateAdded: {_gt: "2021-05-01"}}) {
OrderNumber
Description
PONumber
DefaultJob
DeliveryLocation
DateAdded
Latitude
Longitude
Customer {
CustomerID
CustomerName
}
}
}

Orders with expanded OrderProducts

GraphQL
GraphQL
query orders_with_expanded_orderproducts {
Order {
OrderNumber
Customer {
CustomerID
}
Description
PONumber
DefaultJob
Direction
Status
Salesperson {
Name
}
OrderProducts {
Product {
ProductID
ProductDescription
}
UnitPrice
FreightRate
FreightType
Surcharge
SurchargeType
TaxCode {
Code
MaterialPercent
FreightPercent
SurchargePercent
}
PricingAdjustment1 {
Description
AdjustmentType
Method
}
PricingAdjustment2 {
Description
AdjustmentType
Method
}
PricingAdjustment3 {
Description
AdjustmentType
Method
}
}
}
}