---
keyword: [Extend, Workday Graph API, Graph API, GraphQL]
nav: wcp_docs
parent_url: /wcp_docs/
title: Query Filters
layout: subsection
---

You can use these query filters:

-   <b>Data source filter</b>: Performs an exact match of the filter fields to narrow the number of business object instances from a data source. If a query provides data source filters, you can specify a data source `filter` in the `dataSource` query argument. See <b>Data Source Filter</b> in [Graph API Queries](/wcp_docs/qxq1671067079349.html)
-   <b>Where criteria filter</b>: Further refines query results by providing support for boolean expressions, multiple criteria fields, and comparison operators. Specify the where criteria in the `where` query argument.


## Where Criteria Filters

Where criteria filters enable you to perform advanced filtering in your Graph API queries. In the schema, the `where` argument in a query is a Criteria object that provides the available boolean expressions and criteria fields. To use advanced filtering in the `where` argument, specify either a boolean expression or a set of criteria fields (which use an implicit AND expression).

In the `where` argument, you can specify 1 of the following:

-   `AND` expression.

    Returns instances that meet all criteria conditions. This is the default if you specify multiple criteria fields without a boolean expression. Specify an array containing multiple criteria fields with comparison operators. You can nest boolean expressions in an AND condition.

    Example:

    ```
    where:{
      AND:[
        {accountingDate: {gte:"2024-01-01"}}, 
        {accountingDate: {lte:"2024-01-31"}}
      ]
    }
    ```

-   `OR` expression.

    Returns instances that meet any of the criteria conditions. Specify an array containing multiple criteria fields with comparison operators. You can nest boolean expressions in an OR condition.

    ```
    where:{
      OR: [
        {name: {in: ["ella"]}},
        {name: {in: ["chase"]}}
      ]
    }
    ```

-   `NOT` expression.

    Returns instances that don't meet the criteria condition. Specify a single condition. You can nest boolean expressions in the NOT condition.

    ```
    where:{
      NOT: { name: {eq: "ella"} }
    }
    ```

-   One or more criteria fields with comparison operators.

    Criteria fields without a boolean expression use an implicit AND expression. You can specify a criteria field only once. If you need to specify the same criteria field more than once (such as a date range criteria), use the AND or OR expression.

    Example:

    ```
    where:{
      accountingDate: {gte:"2024-01-01"}, 
      journalStatus: {
        workdayID: {notIn:  {type:"Journal_Entry_Status_ID", id:"Posted"}  } 
      }
    }
    ```



<b>Note:</b> At the root level of the `where` argument, you can’t specify more than 1 boolean expression nor combine a boolean expression with a set of criteria fields (which uses an implicit AND).

Example: The `where` argument of the `worker` query uses the `Worker_Criteria` type. In the `where` argument, specify either a boolean expression or any of the available criteria fields of `Worker_Criteria`.

![](GUID-15ca44c1-679c-4fec-af5b-0bda7f9ce94c.jpg)

You can also filter queries for model business objects using the available criteria fields in the schema.

<b>Note:</b> To enable new criteria fields in the schema for the model business objects in your app, redeploy the app.

Here’s a sample of a model component with its Criteria object and available criteria fields:

![](GUID-91714ee5-983a-4ff3-a367-30db78a820a4.jpg)

See [Sample Query Filters](/wcp_docs/GUID-892f38dd-d294-42e2-bf4b-19ed68e72980-enHYPHENus.html).

## Comparison Operators

This table lists all comparison operators and their supported data types. Note that in the schema, you can see the supported comparison operators for each criteria field. The schema lists the comparison operators as the fields of the corresponding Filter type.

<b>Note:</b> Graph API supports dates in Coordinated Universal Time (UTC) or Pacific Standard Time (PST). Use the yyyy-MM-dd date format.

<table><thead><tr><th>Operator</th><th>Field Data Type Compatibility</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>contains</code></td><td>String</td><td>The comparison value is a subset of the field value. Case insensitive.</td><td>where: { licensePlate: {contains: "123"} }</td></tr><tr><td><code>empty</code></td><td><p>BigDecimal</p> <p>BigInt</p> <p>Boolean</p> <p>Instance</p> <p>Instant</p> <p>LocalDateTime</p> <p>Numeric</p> <p>String</p></td><td>The field has no value.</td><td>where: { regFee: {empty: true} }</td></tr><tr><td><code>endsWith</code></td><td>String</td><td>The last characters of the field value match all characters of the comparison value. Case insensitive.</td><td>where: { model: {endsWith: "reza"} }</td></tr><tr><td><code>eq</code></td><td><p>BigDecimal</p> <p>BigInt</p> <p>Boolean</p> <p>Instant</p> <p>LocalDateTime</p> <p>String</p></td><td>Equal match.</td><td>where: { someDate: {eq: "2024-02-01"} }</td></tr><tr><td><code>gt</code></td><td><p>BigDecimal</p> <p>BigInt</p> <p>BigDecimal</p> <p>Instant</p> <p>LocalDateTime</p></td><td>Greater than.</td><td>where: { regFee: {gt: 20.50} }</td></tr><tr><td><code>gte</code></td><td><p>BigInt</p> <p>BigDecimal</p> <p>Instant</p> <p>LocalDateTime</p></td><td>Greater than or equal to.</td><td>where: { someDate:{gte:"2024-01-01"} }</td></tr><tr><td><code>in</code></td><td><p>[IdentifierInput]</p> <p>[String]</p></td><td>The field value matches at least 1 of the given values.</td><td>where: { model: {in: ["Legacy","WRX"]} }</td></tr><tr><td><code>lt</code></td><td><p>BigInt</p> <p>BigDecimal</p> <p>Instant</p> <p>LocalDateTime</p></td><td>Less than.</td><td>where: { someDate: {lt: "2024-02-25"} }</td></tr><tr><td><code>lte</code></td><td><p>BigInt</p> <p>BigDecimal</p> <p>Instant</p> <p>LocalDateTime</p></td><td>Less than or equal to.</td><td>where: { regFee: {lte: 40} }</td></tr><tr><td><code>neq</code></td><td><p>BigDecimal</p> <p>BigInt</p> <p>Boolean</p> <p>Instant</p> <p>LocalDateTime</p> <p>String</p></td><td>Not equal match.</td><td>where: { regFee: {neq: 10} }</td></tr><tr><td><code>notContains</code></td><td>String</td><td>The comparison value isn't a subset of the field value. Case insensitive.</td><td>where: { licensePlate: {notContains: "DST"} }</td></tr><tr><td><code>notIn</code></td><td><p>[IdentifierInput]</p> <p>[String]</p></td><td>The field value doesn't match any of the given values.</td><td>where: { color: {notIn: ["blue", "silver"]} }</td></tr><tr><td><code>startsWith</code></td><td>String</td><td>The first characters of the field value match all characters of the comparison value. Case insensitive.</td><td>where: { make: {startsWith: "Sub"} }</td></tr></tbody></table><br/>

## <a id="section_1"></a>Performance Considerations

-   Use the `limit` and `offset` arguments on queries that return large data. See [Pagination of Graph API Query Results](/wcp_docs/jgu1675374294877.html)
-   Query depth adds increasing complexity and latency. The more deeply nested the query, the longer it takes to execute.
-   Where possible, use a focused data source filter with the where criteria. The data source filter limits the number of instances before applying advanced filtering with the `where` criteria.
-   Select only the fields that you really need. The more fields in the query, the more data processing and security checks are needed.


### Related Information

[Generate Queries on Graph API Explorer](/wcp_docs/uip1679531855079.html)

[Sample Query Filters](/wcp_docs/GUID-892f38dd-d294-42e2-bf4b-19ed68e72980-enHYPHENus.html)

[Workday Graph API](/wcp_docs/vyw1671061988370.html)

