Skip to content

Fix GraphQL private header routing priority mismatch#1308

Open
Zetazzz wants to merge 1 commit into
mainfrom
fix/graphql-svc-key-mode-priority
Open

Fix GraphQL private header routing priority mismatch#1308
Zetazzz wants to merge 1 commit into
mainfrom
fix/graphql-svc-key-mode-priority

Conversation

@Zetazzz

@Zetazzz Zetazzz commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Align private GraphQL API routing priority between getSvcKey() and determineMode().

Previously, requests containing both X-Api-Name and X-Schemata could be cached under an api:<db>:<apiName> service key while being resolved through the schemata-header path. That could store an admin-style schema-header API structure under a named API cache key.

This PR makes both paths use the same private header priority:

X-Api-Name > X-Schemata > X-Meta-Schema

Changes

  • Added a shared private header mode helper used by both service-key generation and mode selection.
  • Kept existing X-Api-Name service-key semantics unchanged.
  • Added regression tests for mixed X-Api-Name / X-Schemata requests.

Validation

  • pnpm --filter @constructive-io/graphql-server exec jest src/middleware/__tests__/api.test.ts --runInBand
  • pnpm --filter @constructive-io/graphql-server build
  • pnpm --filter @constructive-io/graphql-server exec jest --runInBand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant