You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeah there's a few workarounds here, that all work:
Manually provide the __typename in the mock
Make sure the inline fragment also selects __typename
Re-order the fragment to put __typename above everything else
Mostly just reporting for visibility in case someone else hits this too. A simple fix to MockPayloadGenerator might just sort the selections to shift a __typename up to the top before generating?
We have a regression between v12 and v13 in example queries using
MockPayloadGenerator
.This is caused by a bug in MockPayloadGenerator, but appears as a regression when upgrading.
It has to do with the feature where the
__typename
is correctly provided in the mock payload if you don't provide a__typename
value in the mock data.Assume we have these 2 selections generated by the compiler(s):
For a query that looks like this
These 2 selections are going to be in a request under a linked field
The JS compiler always output the
__typename
field first in this list of selectionsWhich leads to this (correct) output
The rust compiler changed the output ordering of fields, and
__typename
is no longer first.Now this gives us incorrect output
This means that queries that we're previously mocked fine no longer work
The text was updated successfully, but these errors were encountered: