Skip to main content
Version: v3.x

Filter Based on Fields of Nested Objects

Introduction

You can use the fields of nested objects as well to filter your query results.

For example:

query {
articles(where: { author: { name: { _eq: "Sidney" } } }) {
id
title
}
}

The behavior of the comparison operators depends on whether the nested objects are a single object related via an object relationship or an array of objects related via an array relationship. Currently we only support object relationships.

  • In case of an object relationship, a row will be returned if the single nested object satisfies the defined condition.
Limitations

This is only supported for local relationships, such as relationships between two local database tables. This is not supported for remote relationships, such as remote database relationships or Remote Schema relationships.

Let's look at a few use cases based on the above:

Fetch if the single nested object defined via an object relationship satisfies a condition

Example:

Fetch all articles whose author's name starts with "A":

Loading...