Repository navigation
Is @proxy intended as a source-node or GraphQL alias? #39699
Replies: 1 comment 1 reply
|
It's an alias for the stored value, not for the resolved field. In gatsby@5.16.1 the I checked this with gatsby 5.16.1 and a
That was a synthetic node built with |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I've added a custom field to the Mdx nodes in my personal blog and noticed some unusual behaviour when adding a custom resolver.
The relevant part of the schema shape is
{ Mdx: { extract, fields: {extract}},with extract proxying fields.extract. When the data is created statically, proxy behaves as expected and extract mirrors fields.extract. However, when I add a custom resolver for fields.extract querying extract returns the unresolved form. Similarly, resolving the extract field leaves fields.extract invariant.
The docs are a bit ambiguous here... if @proxy is mostly intended for flattening queries this would be unexpected behaviour, but if it's intended for segmenting references to the source node the behaviour I'm seeing makes sense. Clarification would be much appreciated!
All reactions