This is a minimal reproduction of a compiler error on @isograph/[email protected] when selecting a Relay-style connection field with edges { node { ... } }.
@isograph/[email protected]@isograph/[email protected]- Deno (invoked via
deno run -A npm:@isograph/compiler@... compile)
Note: The same project compiles successfully with @isograph/[email protected].
isograph.config.json: standard config pointing toschema.graphqlschema.graphql: defines a simple Relay-style connection (Connection → edges → node)src/MyComp.tsx: minimalisocomponent selectingitems { edges { node { id name } } }
Run from the repo root of this gist:
deno run -A npm:@isograph/[email protected] compile
INFO Starting to compile.
ERROR Error when compiling.
Invalid field `node` in @exposeField directive
<generated>
Compilation took 1ms.
- The compiler should accept Relay-style connections and compile successfully (as it does on
@isograph/[email protected]).
- Aliasing the selection (e.g.,
item: node { ... }) does not avoid the error; it still fails with the same message. - In our larger codebase, we also refactored to avoid defining components on connection types (moved them to the parent type and passed through the connection). The error persists on main.
- Pin to
@isograph/[email protected]and@isograph/[email protected](compiles cleanly). - If schema can change: rename edge field from
nodeto something else (e.g.,item) or expose anodes: [Item]list alongsideedgesand select from that. This avoids selectingnodeentirely.
- If
nodeis intentionally disallowed for@exposeField, please document the new supported connection pattern and/or provide a configuration flag to permit Relay-styleedges { node }selections. - If this is an unintended regression, consider allowing the
nodefield in@exposeFieldgeneration (matching prior behavior in 0.3.1) or mapping it internally without error.
Thanks!