Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/thin-lemons-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ensapi": patch
---

Updated `ensIndexerSchema` value that is passed into `subgraphGraphQLMiddleware` function.
6 changes: 5 additions & 1 deletion apps/ensapi/src/handlers/subgraph/subgraph-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ import config from "@/config";

import { createDocumentationMiddleware } from "ponder-enrich-gql-docs-middleware";

// FIXME: use the import from:
// import { ensIndexerSchema } from "@/lib/ensdb/singleton";
// Once the lazy proxy implemented for `ensIndexerSchema` export is improved
// to support Drizzle ORM in `ponder-subgraph` package.
Comment on lines +7 to +8
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The FIXME comment is a bit ambiguous about what needs to be “improved”. Consider clarifying that the current lazyProxy implementation doesn’t support key enumeration (e.g. Object.entries/Object.keys/ownKeys), which is what Drizzle (via ponder-subgraph) relies on, so future readers know the precise blocker.

Suggested change
// Once the lazy proxy implemented for `ensIndexerSchema` export is improved
// to support Drizzle ORM in `ponder-subgraph` package.
// once the `lazyProxy` used for the `ensIndexerSchema` export supports key
// enumeration (e.g. Object.keys/Object.entries/Reflect.ownKeys), which Drizzle
// (used by the `@ensnode/ponder-subgraph` package) currently relies on.

Copilot uses AI. Check for mistakes.
import * as ensIndexerSchema from "@ensnode/ensdb-sdk/ensindexer-abstract";
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The identifier ensIndexerSchema is now importing the abstract schema module (@ensnode/ensdb-sdk/ensindexer-abstract), not the concrete EnsDbReader.ensIndexerSchema. Renaming this import to something like abstractEnsIndexerSchema (and updating the filterSchemaByPrefix call) would avoid confusion and make it clear why setDatabaseSchema is needed downstream.

Copilot uses AI. Check for mistakes.
import { type Duration, hasSubgraphApiConfigSupport } from "@ensnode/ensnode-sdk";
import { subgraphGraphQLMiddleware } from "@ensnode/ponder-subgraph";

import { ensIndexerSchema } from "@/lib/ensdb/singleton";
import { createApp } from "@/lib/hono-factory";
import { lazy } from "@/lib/lazy";
import { makeSubgraphApiDocumentation } from "@/lib/subgraph/api-documentation";
Expand Down
Loading