[MGNLGQL-5] GraphQL asset references Created: 13/May/20  Updated: 09/Oct/20  Resolved: 29/Jul/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: Canh Nguyen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 10d 3h
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLGQL-40 GraphQL assets' folder support Open
relates to MGNLGQL-49 Cannot retrieve assets from root Closed
relation
is related to MGNLGQL-43 Implement support for asset variants 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
Date of First Response:
Epic Link: GraphQL Phase 1
Sprint: HL & LD 6, HL & LD 7, HL & LD 8
Story Points: 8

 Description   

User story:

As a developer I want the GraphQL endpoint to support returning referenced assets, so I can get exactly the content that I want with one request.

Notes:

This is the 'graph' part of graphQL. It is like the 'reference resolving' feature of the Delivery endpoints.

Acceptance criteria:

  • Asset fields in content types should be respected.
  • Link fields to assets in page and component template dialogs should be respected.
  • Relationships should be discoverable in the GraphiQL tool.
  • It should support returning actual urls to the linked items
  • It should support returning asset rendition urls (based on the site theme)


 Comments   
Comment by Jaroslav Simak [ 30/Jun/20 ]

canh.nguyen
Let's focus on these two points of AC:

  • Asset fields in content types should be respected.
  • It should support returning actual urls to the linked items

Here's a brief description of what we'll need to do to support Assets:

  • Register Asset type in GraphQL Schema
    • you can use yaml definition to register asset type
  • Custom DataFetcher implementation for retrieving assets
  • Adjust JcrContentTypeModelMapper to support asset type
    • see JcrContentTypeModelMapper.JcrContentTypePropertyMapper#newType

The other points does not make much sense in context with content types. We might look at asset renditions once the above is done.

Don't hesitate to ping me if you should need some guidance.

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