Easily restore your project to a previous version with our new Instant One-click Backup Recovery
Hygraph
Docs

Using filters

#Overview

Filtering allows you to restrict the content shown by specific parameters. This is helpful when trying to create a more curated overview of content.

These filters can be useful when building content views, looking for a specific type of content, or finding content that matches several parameters, such as "Created by a certain user & Stage published".

#Quick Filters

Our Quick Filters feature reduces the time and effort required to create a filter. Editors can now find the content they need, faster.

Quick FiltersQuick Filters

It offers several predefined filters that apply instantly when selected, allowing editors to focus on their work without unnecessary distractions.

To add Quick Filters, simply use the Filter menu to display the available options and select one.

Add a Quick FilterAdd a Quick Filter

Once you select a Quick Filter, the regular filter appears in the filter bar and the content table is sorted accordingly.

You can apply more than one Quick Filter. To do this, simply use the filter menu again and select another one.

For instance, the following image shows a content table where two Quick Filters have been applied, Created by me & Only published entries:

Quick Filter appliedQuick Filter applied

#Column filters

The Filter menu also contains column filters.

Column filtersColumn filters

Column filters allow you to filter content by some system and custom fields, stage and ID.

Quick and column filters function in the same way. The following document section explains how to use them.

#Adjust filters manually

You can find the filters on any content view, at the top of the content table. If there are no filters added, this is how it will look like:

Filter BarFilter Bar

To apply filters:

  1. Navigate to the Content Editor & select a view from the collapsible sidebar.
  2. Click the Filter button at the top of the content table.
  3. Select one of the fields listed for filtering. It can be a quick or column filter.
    • If you selected a quick filter, the results will show on the table below.
    • If you selected a column filter, you need to configure it:

For example, the following image shows that we have selected to filter by ID, then selected the condition contains, and finally we typed "002" in the input. As a result, the filter shows all entries that have an ID containing 002:

Filter exampleFilter example

To remove a filter, simply click the X button next to it.

Remove filterRemove filter

#Filtering by entry

After applying a quick or column filter, the results will display on the table below. The following example shows the Created By filter applied:

"Created By" filter applied"Created By" filter applied

You can adjust these filters manually by using the input fields or dropdown menus, and you can add additional filters by clicking on the filter icon.

Apply a FilterApply a Filter

Additionally, you can also filter by fields that allow multiple values. Here's an example showing an enumeration field for product size:

Multi-value enum filteringMulti-value enum filtering

#Filtering by relations

To filter your content entries by a reference field, click the Filter button and select the reference field from the column filters list.

To configure the filter:

  1. Select the field of this model that you want to use.
  2. Select a condition from the dropdown menu.
  3. Some conditions will require that you type in some data to filter by, such as a name or a slug. Updated At and Created At require that you select a date from a calendar and type in a time. Is null and Is not null do not require any additional input.

The following example filtering condition shows all of the content entries where the "Other products" reference field links to entries with a Slug that contains tote.

Filtering by relationsFiltering by relations

#Filtering by content stage

To filter content by stage, click the Filter button at the top of the content table, and select Stage from the column filters list.

After this, use the dropdown menus to select a condition and stage.

Filtering by content stageFiltering by content stage

#Stages and conditions

While there are three default stages - DRAFT, PUBLISHED, and PUBLISHED (!) - stages other than the default ones can exist in the projects of Growth and Enterprise plans.

Stage NameDefinition
DRAFTContent entries that exist in DRAFT, and don't exist in any other stage. This content has never been published.
PUBLISHEDContent entries that exist in PUBLISHED and are not outdated. This means that the published version of this content is also the latest version on the system.
PUBLISHED (!)Content entries that exist in PUBLISHED but are outdated. This means there is a version of this document currently published, but there is also another more recent version in the system.
ConditionDefinition
isSelect this condition to fetch content entries that only exist in the selected stage.
is notSelect this condition to fetch content entries that do not exist in the selected stage, and only exist in one stage.
containsSelect this condition to fetch content entries that exist in the selected stage, irrespective of also existing in other stages. This condition will only display for projects with more than two stages.
doesn't containSelect this condition to fetch content entries that don't exist in the selected stage, irrespective of also existing in other stages. This condition will only display for projects with more than two stages.

#Filtering conditions

The following list explains basic conditions and what they do:

OptionDescription
IsExact match
Is NullMatches empty (without content)
Is Not NullMatches not null (with any content added)
Is NotExclusion match
Less Thanfor numeric fields (including date and dateTime)
Less Than or Equal Tofor numeric fields (including date and dateTime)
Greater Thanfor numeric fields (including date and dateTime)
Greater Than or Equal Tofor numeric fields (including date and dateTime)
ContainsString search
Doesn't ContainExclusion by string search
Starts WithStarting string match
Doesn't Start WithExclusion by starting string match
Ends WithEnding string match
Doesn't End WithExclusion by ending string match
Includes somefor multi-value fields, some of the provided values match
Includes allfor multi-value fields, all of the provided values match
Includes nonefor multi-value fields, none of the provided values match