[MGNLGQL-6] GraphQL simple filters Created: 13/May/20  Updated: 19/Aug/20  Resolved: 10/Aug/20

Status: Closed
Project: Magnolia GraphQL
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0

Type: Story Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Jaroslav Simak
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 3d 3h
Original Estimate: Not Specified

Issue Links:
Cloners
is cloned by MGNLGQL-23 GraphQL filter on metadata Closed
is cloned by MGNLGQL-35 Investigate - GraphQL simple filters Closed
Relates
relates to MGNLGQL-34 GraphQL get items with a particular p... Open
dependency
depends upon MGNLGQL-37 Add support for defining enums and sc... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Documentation update required:
Yes
Epic Link: GraphQL Phase 1
Sprint: HL & LD 8
Story Points: 8

 Description   

User story:

As a developer I want the GraphQL endpoint to support filtering which content that it returns, so I can get just the content I need.

Notes:
Implement simple predicate parser:

  • must support AND (&&) and OR (||)
  • must support these operators:
    • equal =
    • not equal !=
    • greater than >
    • less than <
    • greather or equal than >=
    • less or eqaul than <=
    • like
  • it must be possible to implement and register additional filter operators
  • filtering must be abstracted from JCR
    • JCR implementation will be the default

Example of such filter:

{
  characters(filter: '@releaseDate >= "2020-01-01" AND (@name LIKE "T%" OR @title LIKE "T%")') {
    name
    title
    releaseDate
    friends {
      name
      title
      releaseDate
  }
}

 

Acceptance criteria:

  • API respects arguments, So I can specify `"name": "R2-D2"` and only get items where name matches R2-D2.
  • API respects multiple arguments.
  • Filter based on LIKE.
  • Fulltext search

Generated at Mon Feb 12 05:51:37 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.