Skip to content

Commit ddf3bd5

Browse files
shrugsclaude
andcommitted
docs: version-lock Omnigraph walkthroughs and schema reference to active version
The schema reference rendered the live `main` SDL while examples were locked to the production-deployed version; the walkthroughs hardcoded 1.14.x schema/code against production endpoints running 1.13.1 — so both were broken against production. - Schema reference (OmnigraphSchemaDocExplorer) now loads the active version's frozen schema.graphql instead of `enssdk/omnigraph/schema.graphql?raw`. - Walkthroughs (omnigraph-graphql-api, enssdk, enskit) are split into per-version MDX partials under @components/walkthroughs/<guide>/, with the route page rendering the partial matching ACTIVE_OMNIGRAPH_VERSION. Authored v1.13.1 (production) and v1.14.1 (blue) variants; promote by bumping the constant. - HostedInstanceSdkVersionWarning derives the pinned SDK version from the active version. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 758ed77 commit ddf3bd5

11 files changed

Lines changed: 1874 additions & 917 deletions

File tree

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
import { Aside } from "@astrojs/starlight/components";
33
4+
import { ACTIVE_OMNIGRAPH_VERSION } from "@data/omnigraph-examples/active";
5+
46
interface Props {
57
/**
68
* Which SDK(s) the warning is for.
@@ -16,25 +18,28 @@ const { for: target = "enssdk" } = Astro.props;
1618
const isEnskit = target === "enskit";
1719
const isBoth = target === "both";
1820
21+
// The SDK version is locked to the production-deployed Omnigraph version (see
22+
// `@data/omnigraph-examples/active`). The SDK bundles the Omnigraph schema, so pinning the matching
23+
// version keeps gql.tada's generated types aligned with the deployed API. Updates on promotion.
24+
const sdkVersion = ACTIVE_OMNIGRAPH_VERSION.replace(/^v/, "");
25+
1926
const sdkList = isEnskit
20-
? "<code>enskit@1.13.1</code> and <code>enssdk@1.13.1</code>"
27+
? `<code>enskit@${sdkVersion}</code> and <code>enssdk@${sdkVersion}</code>`
2128
: isBoth
22-
? "<code>enssdk@1.13.1</code> (and <code>enskit@1.13.1</code> when using React)"
23-
: "<code>enssdk@1.13.1</code>";
29+
? `<code>enssdk@${sdkVersion}</code> (and <code>enskit@${sdkVersion}</code> when using React)`
30+
: `<code>enssdk@${sdkVersion}</code>`;
2431
---
2532

2633
<Aside type="caution" title="Version compatibility with hosted instances">
27-
Our hosted ENSNode instances currently run ENSNode v1.13. If you are querying them from your own app, you <strong>must</strong> use <span set:html={sdkList} />. The latest published versions (<code>1.14.0+</code>) contain breaking changes in the Omnigraph API data model not yet deployed to our hosted infrastructure. Use these exact install commands:
34+
Our hosted ENSNode instances run ENSNode <code>{sdkVersion}</code>. The Omnigraph GraphQL schema is bundled inside the SDK and consumed by the <code>gql.tada</code> TypeScript plugin to type your queries, so pin an <strong>exact</strong> version (no <code>^</code> or <code>~</code>) of <span set:html={sdkList} /> to keep your generated types matched to the deployed schema. Use these exact install commands:
2835

2936
{isBoth ? (
30-
<pre>npm install enssdk@1.13.1
37+
<pre>{`npm install enssdk@${sdkVersion}
3138
# or, for React apps:
32-
npm install enskit@1.13.1 enssdk@1.13.1</pre>
39+
npm install enskit@${sdkVersion} enssdk@${sdkVersion}`}</pre>
3340
) : isEnskit ? (
34-
<pre>npm install enskit@1.13.1 enssdk@1.13.1</pre>
41+
<pre>{`npm install enskit@${sdkVersion} enssdk@${sdkVersion}`}</pre>
3542
) : (
36-
<pre>npm install enssdk@1.13.1</pre>
43+
<pre>{`npm install enssdk@${sdkVersion}`}</pre>
3744
)}
38-
39-
This notice will be removed once the hosted instances are upgraded.
4045
</Aside>

docs/ensnode.io/src/components/organisms/OmnigraphSchemaDocExplorer.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,24 @@ import "@graphiql/plugin-doc-explorer/style.css";
33

44
import { DocExplorer, DocExplorerStore } from "@graphiql/plugin-doc-explorer";
55
import { GraphiQLProvider } from "@graphiql/react";
6-
import omnigraphSchemaSdl from "enssdk/omnigraph/schema.graphql?raw";
76
import { buildSchema } from "graphql";
7+
import { ACTIVE_OMNIGRAPH_VERSION } from "@data/omnigraph-examples/active";
8+
9+
// Render the schema for the production-locked Omnigraph version (the same version the examples and
10+
// walkthroughs target), NOT the live `main` SDL — `main` runs ahead of production. Schemas are frozen
11+
// per-version under `src/data/omnigraph-examples/versions/<version>/schema.graphql`; glob all (Vite
12+
// can't import a runtime-variable path) and select the active one.
13+
const schemasByVersion = import.meta.glob<string>(
14+
"../../data/omnigraph-examples/versions/*/schema.graphql",
15+
{ query: "?raw", import: "default", eager: true },
16+
);
17+
const omnigraphSchemaSdl =
18+
schemasByVersion[
19+
`../../data/omnigraph-examples/versions/${ACTIVE_OMNIGRAPH_VERSION}/schema.graphql`
20+
];
21+
if (!omnigraphSchemaSdl) {
22+
throw new Error(`No Omnigraph schema snapshot for version "${ACTIVE_OMNIGRAPH_VERSION}".`);
23+
}
824

925
const omnigraphSchema = buildSchema(omnigraphSchemaSdl);
1026

0 commit comments

Comments
 (0)