[MGNLGQL-65] Make behavior of data fetching consistent across content types Created: 07/Dec/20  Updated: 20/Jan/21  Resolved: 12/Jan/21

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

Type: Improvement Priority: Neutral
Reporter: Jaroslav Simak Assignee: Jaroslav Simak
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 1d 5h
Original Estimate: Not Specified

Issue Links:
causality
is causing MGNLGQL-69 DOC: Data fetching is consistent acro... 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 18, HL & LD 19, HL & LD 20
Story Points: 5

 Description   

We have inconsistencies in behavior for queries for content types and assets.
The queries

{
  assets {
     ...
  }
}
# and
{
  assets(path: "/") {
    ...
  }
}

returns all assets located under the root.
The following query

{
  assets(path: "/some/path") {
    ...
  }
}

returns all assets under the "/some/path" folder.

The path and id options are not available for content type based items. Such inconsistency in behavior will confuse users of the GraphQL API and should be solved before 1st release.

After a discussion with rsiska and czimmermann, the following has been proposed to be implemented to be consistent:

  • assets / contentTypes will return all items regardless of folder structure
  • assets(path: "/") or contentTypes(path: "/") will return items directly under the root
  • assets(path: "/some/path") or contentTypes(path: "/some/path") will return items directly located under the specified path

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