Views Between Filter for date fields not working in GraphQL Compose module

Created on 21 October 2024, 2 months ago

Problem/Motivation

The graphql_compose module does not properly handle the "Between" filter for date fields in Views. When using this filter on a date field, it generates a single input field (string), instead of two separate fields (one for the minimum date and one for the maximum date). This causes the filter to fail in filtering the date range correctly.

Steps to reproduce

  • Create a View that includes a date field.
  • Add a "Between" filter to the View for the date field.
  • Use GraphQL Compose to query the View with the "Between" filter.
  • The query generates a single input field (string), which does not work as expected for date ranges (missing min and max date fields).

Proposed resolution

To address the issue with the "Between" filter for date fields in Views, I propose creating a new schema type specifically for handling "Between" filters on date fields. This new schema type would correctly handle the filtering by generating two separate input fields: one for the minimum date and one for the maximum date.

Additionally, the schema type handling for Views would be updated to recognize when a date field uses the "Between" operator, and apply the appropriate filtering logic. This solution ensures that other field types and filters are not affected by the changes, maintaining compatibility with existing functionality.

🐛 Bug report
Status

Active

Version

2.2

Component

Code

Created by

🇨🇴Colombia codimpes

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024