Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Set `depth` selectively for rich text field with Slate

default discord avatar
diesieben07last year

We're using Slate as the rich text editor. In there we have two types of relations, one for embedded images (i.e. a relation to our media collection) and one for links (i.e. a relation to the pages collection). As far as I can tell you can only set one value for

depth

when querying this field via GraphQL. But this means the frontend will receive both the full image (which it needs)

and

the full contents of all pages which are linked to (which it doesn't need, it only needs the ID to generate the link). As far as I can tell there is no way to improve this situation. Am I correct in that?



Continuation and POC:

https://github.com/payloadcms/payload/discussions/3718
    Star on GitHub

    Star

    Chat on Discord

    Discord

    online

    Can't find what you're looking for?

    Get dedicated engineering support directly from the Payload team.