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
Original file line number Diff line number Diff line change
@@ -1,40 +1,18 @@
---
import { Aside } from "@astrojs/starlight/components";

interface Props {
/**
* Which SDK(s) the warning is for.
* - "enssdk": only enssdk
* - "enskit": both enskit and enssdk (enskit depends on enssdk)
* - "both": mention both enssdk and enskit, show both install commands
*/
for?: "enssdk" | "enskit" | "both";
}
import { ACTIVE_OMNIGRAPH_VERSION } from "@data/omnigraph-examples/active";

const { for: target = "enssdk" } = Astro.props;

const isEnskit = target === "enskit";
const isBoth = target === "both";

const sdkList = isEnskit
? "<code>enskit@1.13.1</code> and <code>enssdk@1.13.1</code>"
: isBoth
? "<code>enssdk@1.13.1</code> (and <code>enskit@1.13.1</code> when using React)"
: "<code>enssdk@1.13.1</code>";
// The SDK version is locked to the production-deployed Omnigraph version (see
// `@data/omnigraph-examples/active`). The SDK bundles the Omnigraph schema, so pinning the matching
// version keeps gql.tada's generated types aligned with the deployed API. Updates on promotion.
const VERSION = ACTIVE_OMNIGRAPH_VERSION.replace(/^v/, "");
---

<Aside type="caution" title="Version compatibility with hosted instances">
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:
Our hosted ENSNode instances currently run ENSNode <code>{VERSION}</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 <code>enssdk@{VERSION}</code> (and <code>enskit@{VERSION}</code> when using React) to keep your generated types matched to the deployed schema. Use these exact install commands:

{isBoth ? (
<pre>npm install enssdk@1.13.1
<pre>{`npm install enssdk@${VERSION}
# or, for React apps:
npm install enskit@1.13.1 enssdk@1.13.1</pre>
) : isEnskit ? (
<pre>npm install enskit@1.13.1 enssdk@1.13.1</pre>
) : (
<pre>npm install enssdk@1.13.1</pre>
)}

This notice will be removed once the hosted instances are upgraded.
npm install enskit@${VERSION} enssdk@${VERSION}`}</pre>
Comment thread
shrugs marked this conversation as resolved.
Comment thread
shrugs marked this conversation as resolved.
</Aside>
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
---
import { Aside, LinkCard } from "@astrojs/starlight/components";
import HostedInstanceSdkVersionWarning from "./HostedInstanceSdkVersionWarning.astro";

interface Props {
/**
* Which SDK the warning should target. Passed through to HostedInstanceSdkVersionWarning.
* - "enssdk": enssdk-only warning
* - "enskit": both enskit and enssdk warning
* - "both": mention both enssdk and enskit, show both install commands (default)
*/
for?: "enssdk" | "enskit" | "both";
}

const { for: target = "both" } = Astro.props;
---

<Aside type="tip" title="No backend required">
You don't need to run your own ENSNode to follow this guide — the steps below default to a NameHash-hosted instance. Browse the available deployments below.
</Aside>
<HostedInstanceSdkVersionWarning for={target} />
<HostedInstanceSdkVersionWarning />
<LinkCard
title="Hosted ENSNode Instances"
href="/docs/hosted-instances"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
import omnigraphSchemaSdl from "enssdk/omnigraph/schema.graphql?raw";
import { buildSchema } from "graphql";
import { ACTIVE_OMNIGRAPH_VERSION } from "@data/omnigraph-examples/active";
import GraphQLSchemaDocExplorer from "./GraphQLSchemaDocExplorer.tsx";

// select the active omnigraph schema for rendering
const schemasByVersion = import.meta.glob<string>(
"../../data/omnigraph-examples/versions/*/schema.graphql",
{ query: "?raw", import: "default", eager: true },
);

const omnigraphSchemaSdl =
schemasByVersion[
`../../data/omnigraph-examples/versions/${ACTIVE_OMNIGRAPH_VERSION}/schema.graphql`
];

if (!omnigraphSchemaSdl) {
throw new Error(`No Omnigraph schema snapshot for version "${ACTIVE_OMNIGRAPH_VERSION}".`);
}

const omnigraphSchema = buildSchema(omnigraphSchemaSdl);

export default function OmnigraphSchemaDocExplorer() {
Expand Down
Loading
Loading