Skip to content

✨ support nested operation namespaces#2743

Merged
edno merged 16 commits intomainfrom
feat/2717-support-nested-query-namespaces
Mar 6, 2026
Merged

✨ support nested operation namespaces#2743
edno merged 16 commits intomainfrom
feat/2717-support-nested-query-namespaces

Conversation

@edno
Copy link
Copy Markdown
Member

@edno edno commented Mar 6, 2026

Description

This PR implements nested operation namespace support for issue #2717.

Summary of changes:

  • namespace roots are treated as folders/sections, and only leaf operations generate pages
  • qualified names are preserved for namespaced operation relations and links
  • namespace container object types (for example AnalyticsQuery) are excluded from generated object entity pages
  • categorySort/group path formatting was hardened to avoid synthetic numeric prefixes in generated links

Validation performed:

  • bun run test -- packages/graphql/tests/unit/introspection.test.ts packages/core/tests/integration/generator.spec.ts
  • bun run test -- packages/graphql/tests/unit/relation.test.ts packages/printer-legacy/tests/unit/link.test.ts packages/core/tests/unit/renderer.test.ts
  • bun run lint
  • bun build:all
  • earthly +build-docs

Closes #2717

Checklist

  • My changes follow the contributing guidelines of this project.
  • I have performed a self-review of my code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my changes work.
  • New and existing unit tests pass locally with my changes.

Copilot AI review requested due to automatic review settings March 6, 2026 17:08
@edno edno linked an issue Mar 6, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class support for nested (namespaced) GraphQL operations so that namespace container fields become folders/sections and only leaf operations generate pages, while keeping qualified operation names for relations/links and avoiding generating object pages for namespace container types.

Changes:

  • Flatten nested operation fields into dotted operation keys during schema introspection and exclude namespace container object types from objects.
  • Update rendering/link generation to place namespaced operations under nested operation folders while preserving qualified names in relations/links.
  • Extend docs and test coverage (unit + integration) for namespaced operations, grouping, and link/path behavior.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/types/src/graphql.d.ts Adds OperationKind type used by namespace discovery logic.
packages/printer-legacy/src/link.ts Builds operation links with nested namespace path segments and leaf slugs.
packages/printer-legacy/tests/unit/link.test.ts Adds unit test asserting nested operation link URLs.
packages/graphql/src/introspection.ts Implements recursive collection of nested operation fields and filters namespace container object types from schema map.
packages/graphql/src/relation.ts Preserves qualified (dotted) operation names in relation outputs.
packages/graphql/tests/unit/introspection.test.ts Adds tests for dotted nested operation keys, cycle prevention, and object filtering.
packages/graphql/tests/unit/relation.test.ts Adds tests asserting qualified names for operation/field relations.
packages/docusaurus/tests/data/schema_with_grouping.graphql Updates fixture schema to include an AnalyticsQuery namespace example.
packages/core/src/renderer.ts Renders dotted operation keys into nested folders; hardens category folder formatting behavior.
packages/core/tests/unit/renderer.test.ts Adds tests for categorySort formatting consistency and nested namespace rendering paths.
packages/core/tests/integration/generator.spec.ts Adds integration test ensuring nested namespace leaf pages are generated (and no namespace container page).
packages/core/tests/data/schema_nested_query_namespace.graphql New fixture schema for nested query namespace behavior.
docs/settings.md Documents namespaced operation behavior under hierarchy settings (with a link).
docs/intro.md Mentions support for namespaced operations in the project intro.
docs/advanced/namespaced-operations.md New advanced documentation page describing namespaced operations behavior.

edno and others added 4 commits March 6, 2026 18:18
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Grégory Heitz <324670+edno@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Grégory Heitz <324670+edno@users.noreply.github.com>
@edno edno changed the title feat: support nested operation namespaces ✨ support nested operation namespaces Mar 6, 2026
@edno edno requested a review from Copilot March 6, 2026 17:33
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 6, 2026

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.

@edno edno requested a review from Copilot March 6, 2026 17:52
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 6, 2026

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 6, 2026

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 6, 2026

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 6, 2026

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 6, 2026

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 6, 2026

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 6, 2026

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 6, 2026

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.

@edno edno merged commit 42177b8 into main Mar 6, 2026
37 checks passed
@edno edno deleted the feat/2717-support-nested-query-namespaces branch March 6, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Support nested query namespaces

2 participants