---
title: GraphQL Query Examples
description: "## 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…"
url: "https://extensionkit.unitfly.com/documentation/grapi-graphql-query-examples/"
updated: "2026-05-11"
category: GRAPI Wiki and User Guide
---

# GraphQL Query Examples

## 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
      }
    }
  }
}
```

## Field Arguments and Formatting

### Floating Property Rounding

Every GraphQL field generated from an M-Files `Floating` property exposes an optional `round: Int` argument.

When supplied, the returned value is rounded to that many decimal places (the everyday "0.5 rounds up" rule). When omitted, the raw `double` is returned.

```
query GetDeliveryDynamics {
  vault_name {
    deliveryDynamics {
      id
      daily_Minimum(round: 2)   # -> 40.8 instead of 40.79999923706055
      daily_Maximum(round: 2)
    }
  }
}
```

## 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
      }
    }
  }
}
```
