Using filters

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 perimeters (such as Created after AND Content ID).

Filtering by entryAnchor

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

Filter Bar
Filter Bar

After you applied a filter, for example for a DateTime field, you can add more filters with the "plus" icon or Clear filters.

Apply a Filter
Apply a Filter

Additionally, you can also filter by fields that allow multiple values. Here's an example for a dropdown field:

Multi-value enum filtering
Multi-value enum filtering

  1. Navigate to the content tab in the left-hand sidebar.
  2. Choose a content model from the collapsible sidebar.
  3. Press the Filter icon at the end of the filter bar at the top of the content entries table.
  4. Choose from one of the fields listed for filtering.
  5. Select the filter method in the center of the filter box (default's to contains).
  6. Choose from one of the following options:
Option
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
Not ContainsExclusion by string search
Starts WithStarting string match
Not Starts WithExclusion by starting string match
Ends WithEnding string match
Not Ends 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
  1. To the right of the filter method, enter a comparison value.

Filtering by relationsAnchor

In order to filter your content entries by a relational field, click the +Filter button and select one of the referenced models.

Then, select the field of this model that you want to filter for, as well as the condition.

Finally, add the search term you're interested in, or select the value from a dropdown.

As an example, you will be able to build a filtering condition like this: Show all of the content entries where the Title of the referenced Category is exactly General.

Screenshot of Filtering by Relations in Hygraph
Screenshot of Filtering by Relations in Hygraph

Please note that it is not possible to filter by union-type reference fields - those that allow you to reference more than one model in a field. For instance, Staff reference field with Players and Coaches models referenced in the Team parent model.

Filtering by content stageAnchor

In order to filter your content by stage, click on the +Filter button and select Stage. After this, you must then select a stage from the dropdown, as well as a condition.

Filtering by content stage
Filtering by content stage

Stages and conditionsAnchor

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

Stage NameDefinition
Draft
Draft
Content entries that exist in DRAFT, and don't exist in any other stage. This content has never been published.
Published
Published
Content 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 (!)
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.

Please take into account that our stages are not linear and sequential. There are cases where content can be in more than one stage at the same time, such as PUBLISHED and QA. This would happen if, for instance, you edit an already published document, but select the QA stage from the dropdown upon publishing your changes.

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.

Please note that stage filtering can also be applied to your project's custom filters. Custom filters creation will result in a state that can be updated or outdated, and the behaviour will be the same as the updated/outdated behaviour shown above for PUBLISHED and PUBLISHED (!).