Skip to content
This repository was archived by the owner on Aug 5, 2026. It is now read-only.
This repository was archived by the owner on Aug 5, 2026. It is now read-only.

enssdk: ship omnigraph schema at the exported path for gql.tada compatibility #2110

Description

@shrugs

Parent: #1360

Context

enssdk's package.json declares an exports entry that aliases the omnigraph schema:

"./omnigraph/schema.graphql": "./src/omnigraph/generated/schema.graphql"

In the docs for both enskit and enssdk integration guides (PR #2106), the gql.tada tsconfig plugin is configured with:

"schema": "node_modules/enssdk/src/omnigraph/generated/schema.graphql"

This works but couples users to enssdk's internal src/ layout. Reviewers (Copilot in #2106) suggested switching to the exported path:

"schema": "node_modules/enssdk/omnigraph/schema.graphql"

Why we didn't switch

Verified directly against the gql.tada 1.9.1 CLI in a clean repro: gql.tada reads the schema field as a literal filesystem path, not through Node's exports-map resolution. The export alias above only fires for module-resolution callers (require.resolve("enssdk/omnigraph/schema.graphql"), dynamic import() of an asset module, etc.) — it does not synthesize a file at node_modules/enssdk/omnigraph/schema.graphql. Pointing gql.tada at that path produces ENOENT.

Follow-up options

To let consumers use the stable exported path (and stop bot reviewers re-raising this on every doc/example update), pick one:

  1. Ship the schema at the exported path physically. Add a prepublish step that copies src/omnigraph/generated/schema.graphql to omnigraph/schema.graphql, include the new location in "files", and update both exports and the docs to point at node_modules/enssdk/omnigraph/schema.graphql. Lowest-friction for consumers.
  2. Open a feature request against gql.tada to resolve schema paths through Node's exports map. Cleanest semantically but blocks on upstream.
  3. Document the chosen path explicitly so future reviewers stop flagging it — leave the docs at node_modules/enssdk/src/omnigraph/generated/schema.graphql with a comment explaining why the apparently-shorter path doesn't work. This is the current state after Omnigraph Quickstart & Walkthrough & Example Apps & ENSv2 Readiness #2106.

Files touched if we go with (1)

  • packages/enssdk/package.jsonfiles, exports, add prepublish step
  • packages/enssdk/tsup.config.ts or scripts — copy schema.graphql into the new location
  • docs/ensnode.io/src/content/docs/docs/integrate/integration-options/{enskit,enssdk}.mdx
  • examples/enskit-react-example/tsconfig.json
  • examples/enssdk-example/tsconfig.json

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ensv2ENSv2 related

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions