docs: more improvements for omnigraph examples#2260
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughConverts Omnigraph examples to a config-driven, namespace-aware system; extends the GraphQL schema for protocol acceleration and profile resolution; updates SDK example queries and vendored snapshots; migrates Astro components from namespace IDs to human-readable labels and doc URLs; refreshes scripts, example generation, and docs pages. ChangesOmnigraph Examples & Documentation Modernization
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR overhauls the Omnigraph documentation examples: example metadata is consolidated into a single
Confidence Score: 4/5Safe to merge after fixing the curl comment-stripping issue; all other changes are additive documentation improvements. The curl example builder for docs/ensnode.io/src/lib/examples/omnigraph/docs-utils.ts — the Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[OMNIGRAPH_EXAMPLES_CONFIG\nconfig.ts] -->|"id + namespace + hostSeparatePage"| B[examples.ts]
B -->|"lookup id"| C[examples.json\nsnapshot]
B -->|"lookup id"| D[responses.json]
B -->|"getDocsOmnigraphNamespaceConfig(namespace)"| E[constants.ts\nNamespace Config]
E -->|"ensnodeUrl"| B
B -->|"omnigraphExamples[]"| F[visibleOmnigraphExamples\nhref !== undefined]
B -->|"getOmnigraphExampleById(id)"| G[resolveOmnigraphStaticExample]
G -->|"buildOmnigraphCurlExample"| H[docs-utils.ts\nCurl Builder]
H -->|"isSafeForSingleQuotes?"| I{Single-quote safe?}
I -->|"yes"| J["-d '...' format"]
I -->|"no (has apostrophe)"| K["heredoc format"]
G -->|"OmnigraphStaticExampleData"| L[OmnigraphStaticExampleSet.astro]
A -->|"OMNIGRAPH_EXAMPLES_SIDEBAR_ITEMS"| M[integrate.ts\nSidebar Config]
F -->|"cards"| N[examples/index.mdx]
Reviews (4): Last reviewed commit: "apply fixes for lightwalker's review" | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/ensnode-sdk/src/omnigraph-api/example-queries.ts (1)
650-669:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRegenerate SKILL examples to avoid source drift.
GRAPHQL_API_EXAMPLE_QUERIESnow updatesnamegraphand addsaccelerate-resolve, butpackages/ensskills/skills/omnigraph/SKILL.mdstill reflects the oldernamegraphexample and does not includeaccelerate-resolve. Please re-sync the AUTOGEN examples block from this source file.Also applies to: 704-723
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/ensnode-sdk/src/omnigraph-api/example-queries.ts` around lines 650 - 669, The SKILL.md examples block is out of sync with the canonical GRAPHQL_API_EXAMPLE_QUERIES in packages/ensnode-sdk/src/omnigraph-api/example-queries.ts: update the AUTOGEN examples in packages/ensskills/skills/omnigraph/SKILL.md to match the current entries (replace the old "namegraph" example and add the new "accelerate-resolve" example) by copying the examples (including queries, ids, and variables) from GRAPHQL_API_EXAMPLE_QUERIES (look for the namegraph entry around id: "namegraph" and the new accelerate-resolve entry) so the documentation and source remain aligned.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/ensnode.io/scripts/snapshot-omnigraph-version.mts`:
- Around line 49-56: The code currently silently skips missing SDK examples in
the OMNIGRAPH_EXAMPLES_CONFIG mapping; change the behavior in the
OMNIGRAPH_EXAMPLES_CONFIG.flatMap callback (where sdkExampleById.get(config.id)
is used to build examples) to throw an error instead of console.warn/return [],
e.g. throw a descriptive Error including the missing config.id so the build
fails fast and preserves the config↔snapshot contract; ensure the thrown message
clearly references the config id and the surrounding context (example id missing
from sdkExampleById) so the failure is actionable.
In `@docs/ensnode.io/src/lib/examples/omnigraph/example-query.ts`:
- Line 13: The schema uses namespace: z.custom<DocsOmnigraphExampleNamespace>()
which provides no runtime checks; change it to a runtime-validated schema such
as namespace: z.enum([...]) or namespace: z.union([z.literal('ns1'),
z.literal('ns2')]) or, if dynamic, namespace:
z.custom<DocsOmnigraphExampleNamespace>((v) => /* predicate returning boolean
*/) so that .parse(...) will fail for invalid namespaces; update the schema
where the namespace field is defined (replace the z.custom call referencing
DocsOmnigraphExampleNamespace).
---
Outside diff comments:
In `@packages/ensnode-sdk/src/omnigraph-api/example-queries.ts`:
- Around line 650-669: The SKILL.md examples block is out of sync with the
canonical GRAPHQL_API_EXAMPLE_QUERIES in
packages/ensnode-sdk/src/omnigraph-api/example-queries.ts: update the AUTOGEN
examples in packages/ensskills/skills/omnigraph/SKILL.md to match the current
entries (replace the old "namegraph" example and add the new
"accelerate-resolve" example) by copying the examples (including queries, ids,
and variables) from GRAPHQL_API_EXAMPLE_QUERIES (look for the namegraph entry
around id: "namegraph" and the new accelerate-resolve entry) so the
documentation and source remain aligned.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 53687c37-27d8-4675-b8e4-08a841299416
📒 Files selected for processing (49)
docs/ensnode.io/config/integrations/starlight/sidebar-topics/integrate.tsdocs/ensnode.io/scripts/fetch-omnigraph-example-responses.mtsdocs/ensnode.io/scripts/snapshot-omnigraph-version.mtsdocs/ensnode.io/src/components/molecules/omnigraph-static-example/CurlStaticCodeExample.astrodocs/ensnode.io/src/components/molecules/omnigraph-static-example/GraphqlStaticQueryExample.astrodocs/ensnode.io/src/components/molecules/omnigraph-static-example/SdkStaticCodeExample.astrodocs/ensnode.io/src/components/molecules/omnigraph-static-example/StaticExampleActionBar.astrodocs/ensnode.io/src/components/molecules/omnigraph-static-example/StaticExampleOutputSection.astrodocs/ensnode.io/src/components/molecules/omnigraph-static-example/StaticExamplePlaygroundHint.astrodocs/ensnode.io/src/components/molecules/omnigraph-static-example/constants.tsdocs/ensnode.io/src/components/organisms/OmnigraphStaticExampleSet.astrodocs/ensnode.io/src/content/docs/docs/integrate/index.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/account-events.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/account-migrated-names.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/account-primary-name.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/account-resolver-permissions.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-events.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-profile.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-records.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-resolver.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-subdomains.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domains-by-address.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/eth-by-version.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/find-domains.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/index.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/namegraph.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/permissions-by-contract.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/permissions-by-user.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/registry-domains.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/protocol-acceleration.mdxdocs/ensnode.io/src/data/omnigraph-examples/config.test.tsdocs/ensnode.io/src/data/omnigraph-examples/config.tsdocs/ensnode.io/src/data/omnigraph-examples/examples.jsondocs/ensnode.io/src/data/omnigraph-examples/examples.tsdocs/ensnode.io/src/data/omnigraph-examples/meta.tsdocs/ensnode.io/src/data/omnigraph-examples/responses.jsondocs/ensnode.io/src/data/omnigraph-examples/schema.graphqldocs/ensnode.io/src/data/omnigraph-examples/snapshot.jsondocs/ensnode.io/src/data/omnigraph-examples/types.tsdocs/ensnode.io/src/lib/examples/omnigraph/build-integration-snippets.test.tsdocs/ensnode.io/src/lib/examples/omnigraph/build-integration-snippets.tsdocs/ensnode.io/src/lib/examples/omnigraph/constants.tsdocs/ensnode.io/src/lib/examples/omnigraph/docs-utils.tsdocs/ensnode.io/src/lib/examples/omnigraph/example-query.tsdocs/ensnode.io/src/lib/examples/omnigraph/resolve-static-example.tsdocs/ensnode.io/src/lib/examples/stackblitz/static/buildProject.tsdocs/ensnode.io/src/lib/examples/stackblitz/static/resolveProject.tspackages/ensnode-sdk/src/omnigraph-api/example-queries.tspackages/ensskills/skills/omnigraph/SKILL.md
💤 Files with no reviewable changes (1)
- docs/ensnode.io/src/data/omnigraph-examples/meta.ts
|
@greptile review |
| @@ -1,3 +1,5 @@ | |||
| import { OMNIGRAPH_EXAMPLES_SIDEBAR_ITEMS } from "../../../../src/data/omnigraph-examples/config.ts"; | |||
There was a problem hiding this comment.
Would this work?
| import { OMNIGRAPH_EXAMPLES_SIDEBAR_ITEMS } from "../../../../src/data/omnigraph-examples/config.ts"; | |
| import { OMNIGRAPH_EXAMPLES_SIDEBAR_ITEMS } from "@data/omnigraph-examples/config.ts"; |
There was a problem hiding this comment.
I dont know why, if you know how to resolve it, feel free to push that commit :)
Summary
resolve.profileobjectsnamegraphquery to be consistent with other namegraph query in docdomain-resolverquery to fit into 5 seconds per requestaccelerate-resolveexample query only for "accelerate" pagecURLexample, now dont includeEOFif it's possible (always possible for current examples)Why
Make docs even better
Testing
Notes for Reviewer (Optional)
Pre-Review Checklist (Blocking)