Hello!
I want to use the functionality of internal links to other documents in the project. This is very handy so that I don't lose links when the document slug changes or the URL structure changes, for example. But along with the required fields of the target page (urlSlug, title), I even get the whole Rich-text document on the client ... how can I bypass this to get only the required fields?
how can I exclude text field from getting it? I use GraphQL to get data from server.
Should I filter it on the server? Is it the only solution?
Thank you in advance!
As I understand, I need to sepcify correct value for maxDepth property of the relationship field in link native element? How can I do it? Or I have to override somehow native link element?
Hi @Kikky - yes you'll want to set a maxDepth on the relationship field which looks like this:
{
name: 'link',
type: 'relationship',
relationTo: ['posts', 'pages'],
maxDepth: 1,
}
You may want to reduce it further to maxDepth: 0
, try updating these and comparing your returned data.
I don't think this solution is possible. I created #2166 to track the capability that would solve the author's request.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.