So we finally got some feedback from the team. Sorry about the delay on this. The issue is that your GraphQuery request in the URL is far too large. The URL request is limited to 2048 characters, whereas your URL is 3659 characters long.
There are certain things you can do to reduce the size of the URL. For example, GraphQuery provides you with the Fragment Syntax which allows you to retrieve all fields in a document using three dots ..., you can read about that here:
You can also try reducing whitespace in the URL which creates a lot of characters in the URL when encoding.
Will ...postFields grab all slice content that is entered?
eg:
const postGraphQuery = { post { ...postFields authors { author { ...on author { full_name role bio avatar } } } categories { category { ...on category { title description image } } } related_posts { post { ...on post { title meta_decription share_image } } } } }
How can we strip more white space without breaking the structure of the query?
what are other ways we need to trim down the query to still the data represented here?
do we just do for example
related_posts {
post {
...on post {
...postFields
}
}
}
also, is there a way to condese the white space to related_posts { post { ...on post { ...postFields }}} instead of needing the white space and line breaks?
I'm really glad this worked for you, I'll definitely update the docs. Can you copy and paste the text you wanted to suggest here, because the attachments aren't working?
Optimization Tips
Our graphQuery object is a powerful tool when using GraphQL is not an option or when you need to make fewer queries on related documents, but it has limitations.
The total api request, with query params, needs to be less than 2048 characters (including escaped characters like "{").
The above graphQuery examples show the object structures, but you can reduce your string length by using linebreaks with no spaces or tabs like: