Live Preview missing graphql __typename (when using it to iterate and render blocks) #11040
Unanswered
J-Gonzalez
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The updated live preview object is missing __typename on blocks, which is being used to iterate through the blocks returned in document. __typename is needed since I'm fetching the original document using the Graphql endpoint (which uses unions in blocks) to be able to determine which blocks to show.
On initial preview load - everything works fine as the data is fetched from the server in NextJS (from graphql which is returning __typename). Then, the Live Preview takes over, and the original data is replaced with updated daae - which strips the __typename and nothing renders
Note: I'm using graphql-codegen to fetch and generate the schema from the payload graphql endpoint.
Beta Was this translation helpful? Give feedback.
All reactions