diff --git a/.gitignore b/.gitignore index 9c137b7098..4661582273 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,11 @@ go.work.sum # Serena .serena/ +/.playwright-mcp + +# PR review workspace — local-only, never commit +/TODO.md +/DONE.md +/FEEDBACK.md +/COMMENTS.md +/docs/superpowers/ \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md index af5b2e8f72..aa61f7f266 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1 +1,301 @@ -# CLAUDE.md +# CLAUDE.md — Cosmo Repository Guide + +Top-level notes and gotchas accumulated while working on this repo. +For subsystem-specific details, see the per-package `CLAUDE.md` files and the +`docs/` directory. + +## Repository layout + +| Path | What it is | +|------|------------| +| `composition/` | TypeScript library that normalizes subgraph SDL and produces `ConfigurationData` consumed by the router. See `composition/CLAUDE.md`. | +| `composition-go/` | Go wrapper around the composition TypeScript bundle. Used by router-tests and demo tooling. Regenerate the bundle with `composition-go/generate.sh`. | +| `shared/` | TypeScript package that serializes `ConfigurationData` into the router config proto (`graphql-configuration.ts`). | +| `proto/wg/cosmo/node/v1/node.proto` | Wire format for router configuration. Regenerate Go + TS bindings via `make generate-go` (TS proto lives in `connect/src/wg/cosmo/node/v1/node_pb.ts`). | +| `router/` | Go router binary. Entity caching + resolver wiring lives in `router/core/factoryresolver.go`. | +| `router-tests/` | Integration tests. The entity caching suite is in `router-tests/entity_caching/` with a `make compose` target to regenerate `testdata/config.json` via `cmd/compose/main.go`. | +| `playground/` | React GraphiQL-based playground. Built with `pnpm build:router` to embed into the router binary via `router/internal/graphiql/graphiql.html`. | +| `demo/` | Standalone demo subgraphs + cache-only runner. See `demo/cmd/cache-demo/main.go`. Recompose demo config with `make compose-cache` from `demo/`. | +| `docs/` | Developer docs. Entity caching + `@requestScoped` live here. | + +The graphql-go-tools dependency is typically resolved from the path replacement in +`router/go.mod` and `router-tests/go.mod` — currently pointing at a local sibling +clone. Changes to resolver/planner code happen in that repo, not here. + +## Post-change rebuild triggers + +These three rebuild chains are non-optional. +Skipping any step makes the change invisible to downstream consumers, often silently. + +- **Change anything under `composition/`**: rebuild composition, shared, and the composition-go bundle, then recompose router-test configs. + ```bash + cd composition && pnpm build \ + && cd ../shared && pnpm build \ + && cd ../composition-go && bash generate.sh \ + && cd ../router-tests/entity_caching && make compose + ``` + Order matters — `composition-go/generate.sh` pulls in both composition and shared builds, + so both must be fresh first. + See "Pipeline: composition → router" below for the full 9-step wiring when the change also touches proto types. + +- **Change anything under `proto/wg/cosmo/node/`**: regenerate Go and Connect bindings. + ```bash + make generate-go + ``` + CI's `git-dirty-check-graphqlmetrics` runs against `graphqlmetrics/**` only; + if CI skips it because the change is elsewhere, + trigger it manually (or touch a file under `graphqlmetrics/`) to clear a stale sticky. + +- **Change anything under `playground/`**: rebuild the router-embedded bundle. + ```bash + cd playground && pnpm build:router + ``` + Plain `npm run build` / `pnpm build` only builds the library bundle — it does NOT copy to `router/internal/graphiql/graphiql.html`. + Always use `build:router`, then restart the router so the `//go:embed` picks up the new HTML. + +## Entity caching + `@requestScoped` + +- **[@requestScoped directive](./docs/REQUEST_SCOPED.md)** — Per-request coordinate L1 + cache for fields that resolve to the same value within a request. Symmetric design + with a single mandatory `key` argument. Every participating field is both a reader + and a writer. See the linked doc for full semantics, architecture, and examples. +- **Acceptance criteria**: `graphql-go-tools/docs/entity-caching/ENTITY_CACHING_ACCEPTANCE_CRITERIA.md` +- **Demo**: `docs/entity-caching/ENTITY_CACHING_DEMO.md` — visual guide with the + canonical cross-subgraph cached query. + +## Cache normalization — unified pipeline + +Coordinate L1 (`@requestScoped`), entity L1, and entity L2 caches all share the +same alias-aware normalization pipeline based on the response plan's `*Object` tree: + +- **Normalize for write**: `normalizeForCache(value, obj)` renames aliases to schema + field names and applies arg-hash suffixes. Fast path when `obj.HasAliases` is false. +- **Widening check**: `validateItemHasRequiredData(cached, obj)` verifies all required + fields are present. Missing field → skip the cache and refetch. +- **Denormalized read**: `shallowCopyProvidedFields(cached, obj)` copies fields from + schema-named cache into a response-named object (re-applies aliases). + +Do not write a parallel normalization path for a new cache. Use `ProvidesData *Object` +references and the existing helpers. + +## Pipeline: composition → router + +Changes to caching config types (e.g., adding `isBatch`, `key`, etc.) must be wired +through the entire stack, in order: + +1. `composition/src/router-configuration/types.ts` — TypeScript type +2. `composition/` — extraction logic in `normalization-factory.ts` +3. `proto/wg/cosmo/node/v1/node.proto` — protobuf message (use `reserved` when + removing fields to preserve wire compatibility) +4. `make generate-go` — regenerates Go proto (`router/gen/proto/...`, `connect-go/gen/...`) +5. `connect/src/wg/cosmo/node/v1/node_pb.ts` — generated TS proto class (manually + edit when removing fields if no TS regen script is handy) +6. `shared/src/router-config/graphql-configuration.ts` — proto serialization +7. `router/core/factoryresolver.go` — proto → planner metadata mapping +8. `composition-go/generate.sh` — rebuild JS bundle (pulls in composition + shared + builds; must rebuild both TS packages first) +9. `router-tests/entity_caching && make compose` — regenerate integration test config + +Missing any step causes the field to silently drop from the final config JSON. +When a field is present in composition output but missing in the final config.json, +check the shared package serializer first. + +## Debugging silent field drops + +If a field you added to `ConfigurationData` (or to a nested config type) doesn't appear +in the final `config.json`: + +1. `cd composition && npx vitest run tests/v1/directives/entity-caching.test.ts` — + does the composition test see the field? +2. Inline inspect the shared serializer with a quick test — does it write the field? +3. Check if the proto generated TS class has the field (`connect/src/.../node_pb.ts`) +4. Check if composition-go bundle is stale — `cd composition-go && bash generate.sh` +5. Check if shared package is stale — `cd shared && pnpm build` + +## Per-request cache control headers (dev only) + +The router supports these headers, gated on tracing authorization +(dev mode or valid studio request token): + +- `X-WG-Disable-Entity-Cache: true` → disable both L1 and L2 +- `X-WG-Disable-Entity-Cache-L1: true` → disable L1 only (including coordinate L1) +- `X-WG-Disable-Entity-Cache-L2: true` → disable L2 only + +See `router/core/graphql_handler.go:cachingOptions`. + +The playground exposes a cache mode dropdown ("Caching enabled / L2 only / L1 only / +disabled") that injects these headers transparently via a ref (not a state dep) to +avoid resetting the cache stats display on mode switch. + +## Playground embedding + +The playground is embedded into the router binary via `//go:embed graphiql.html`. +Rebuild workflow: + +```bash +cd playground && pnpm build:router # builds + copies to router/internal/graphiql/graphiql.html +# then restart the router — Go re-embeds on next build +``` + +Just running `npm run build` in the playground builds the library bundle but does +NOT copy to the router. +Always use `build:router`. + +### Two playgrounds, only one has the Cache Explorer + +There are two separate playground implementations in this repo — do not assume a change to one affects the other: + +| Playground | Source | Surfaces | +|---|---|---| +| **Router** (`http:///`) | `playground/` package, embedded via `graphiql.html` | Cache Explorer view, cache-mode dropdown (`X-WG-Disable-Entity-Cache[-L1/-L2]` headers), cache-annotated trace view | +| **Studio** (`http://studio/.../graph/.../playground`) | `studio/src/components/playground/*` + `studio/src/pages/[...]/playground.tsx` (own GraphiQL wrapper using `@graphiql/plugin-explorer`) | Request Trace (Tree + Waterfall) with `Load Skipped` annotations, Plan view — **no Cache Explorer, no cache-mode dropdown** | + +Studio does NOT import `@wundergraph/playground`. +To get Cache Explorer parity in Studio, either iframe the router playground or port the cache-explorer files (`cache-explorer-view.tsx`, `cache-explorer-controller.tsx`, `cache-explorer-runner.ts`, the `cacheMode` types, and the `graphiQLFetch` header injection) into `studio/src/components/playground/`. + +## Full local stack bring-up (infra in docker, CP/studio/router local) + +For end-to-end testing of router ↔ control plane flows (as opposed to `execution_config.file` offline mode), bring up the stack in this shape: + +- **Docker (`make infra-up` → `docker-compose.yml --profile dev`)**: postgres, keycloak, clickhouse, redis, nats, kafka, rustfs, cdn, otelcollector, graphqlmetrics. +- **Local (host)**: controlplane, studio, subgraphs, router. + +### Phase order +1. `make infra-up` — then poll keycloak `http://localhost:8080/realms/cosmo` (200) and redis `docker exec cosmo-dev-redis-1 redis-cli PING` (PONG) before moving on. +2. `cd controlplane && cp .env.example .env && pnpm migrate && pnpm seed && LOG_LEVEL=debug pnpm dev` — seeds the fixed API key `cosmo_669b576aaadc10ee1ae81d9193425705` and user `foo@wundergraph.com` / `wunder@123`. +3. `cd studio && cp .env.local.example .env.local && pnpm dev` — serves at `http://localhost:3000`. +4. Subgraphs (for cache demo: `cd demo && go run ./cmd/cache-demo` → :4012/:4013/:4014). +5. `pnpm wgc` flows to create namespace, federated-graph, subgraphs, publish schemas, and mint a router token. +6. Router with `GRAPH_API_TOKEN`, `CONTROLPLANE_URL=http://localhost:3001`, `CDN_URL=http://localhost:11000`, **no `execution_config.file`** — it polls CDN every 10s. + See `demo/router-cache-cp.yaml` for an entity-caching + L2 Redis example. + +### Gotchas collected during stack bring-up + +- **`pnpm dev` does NOT run migrations** — `pnpm seed` fails with `relation "users" does not exist` unless `pnpm migrate` was run first. + `pnpm migrate` runs both `db:migrate` (drizzle, pg) and `ch:migrate` (dbmate, clickhouse). +- **Keycloak image mismatch**: if docker has previously pulled a stale `ghcr.io/wundergraph/cosmo/keycloak:latest` that is actually the Bitnami image, it restarts in a loop with `exec: start: not found`. + Fix: `docker rmi ghcr.io/wundergraph/cosmo/keycloak:latest && docker compose -f docker-compose.yml --profile dev build keycloak` — the local `keycloak/Dockerfile` builds from `quay.io/keycloak/keycloak` with custom theme providers. +- **Rustfs on :10000**: `S3_STORAGE_URL` defaults to `http://localhost:10000/cosmo` in `controlplane/.env.example`. + Rustfs container maps its internal `:9000` to host `:10000` / `:10001`. +- **Port map to remember**: studio `:3000`, controlplane `:3001`, router `:3002`, cache demo subgraphs `:4012`-`:4014`, postgres `:5432`, redis `:6379`, keycloak `:8080`, rustfs `:10000`, cdn `:11000`. +- **CDN eventual consistency**: after `pnpm wgc subgraph publish ...`, the router may still serve the previous supergraph config for up to 10s (the config poller interval). + +### wgc CLI env + +`cli/.env` needs at minimum: + +```bash +COSMO_API_KEY=cosmo_669b576aaadc10ee1ae81d9193425705 +COSMO_API_URL=http://localhost:3001 +CDN_URL=http://localhost:11000 +``` + +Then `pnpm wgc ` from either `cli/` or from `demo/` works (via the workspace root alias). + +## Demo subgraph gqlgen gotcha: directive name prefixes + +Subgraphs under `demo/pkg/subgraphs/` that use `@openfed__*` caching/request-scoped directives in their `schema.graphqls` must list the directive names in `gqlgen.yml` with their **full prefixed names**, not the local short names: + +```yaml +# WRONG — skip_runtime silently no-ops, runtime errors with "directive openfed__queryCache is not implemented" +directives: + entityCache: + skip_runtime: true + queryCache: + skip_runtime: true + +# CORRECT +directives: + openfed__entityCache: + skip_runtime: true + openfed__queryCache: + skip_runtime: true +``` + +Gqlgen matches the `directives:` keys against the directive name as it appears in the SDL. +If the name in `gqlgen.yml` doesn't match, `skip_runtime` is ignored and the generated `DirectiveRoot` struct contains a field that panics with `"directive ... is not implemented"` on every request touching that field. +This is silent at generate time — only surfaces when a federated router actually fetches from the subgraph. +Affected subgraphs in this repo: `cachegraph`, `cachegraph_ext`, `viewer` (all fixed). + +## Pre-existing bugs found and fixed in this session + +For future reference when working on related code: + +- **Composition**: `@is(fields:)` directive extraction was reading `"field"` (singular) + instead of the constant `FIELDS` (plural) that the AST definition actually uses. + Silently broke all @is extraction. +- **Composition**: Independent `@key` directives (OR semantics) were being merged into + a single composite mapping (AND semantics) in `buildAutoMappings`. Fixed by removing + the merge step — each `@key` produces its own `EntityKeyMappingConfig`. +- **Composition**: `REQUEST_SCOPED_DEFINITION_DATA` had an empty `argumentTypeNodeByName` + map, so any `@requestScoped(...)` argument was rejected as "unexpected". Made the + directive unusable with arguments. +- **graphql-go-tools**: `SubscriptionEntityPopulationConfiguration.FieldName` was never + set in `factoryresolver.go`, but a recent change switched the lookup to + `FindByTypeAndFieldName` — the empty FieldName meant no lookup ever matched, + silently breaking subscription cache populate/invalidate. +- **graphql-go-tools**: `configureFetchCaching` in visitor.go was dropping + `RequestScopedHints`/`RequestScopedExports` when the entity fetch path or + L2-enabled root fetch path returned a fresh `FetchCacheConfiguration`. Fixed by + preserving them. +- **graphql-go-tools**: `exportRequestScopedFields` stored a pointer into the + goroutine arena, which was reused within the same request — dangling pointer + crash on subsequent reads. Fixed by detaching via `normalizeForCache` (allocates + on the per-request `jsonArena`) or explicit `MarshalTo + MustParseBytes` copy. +- **graphql-go-tools**: entity L1 cache writes had the same lifetime hazard on + the no-alias fast path. `normalizeForCache` returns the original pointer when no + alias/arg rewrite is needed, so writing that result directly to `l1Cache` + stores a value backed by a reusable arena. Fixed by routing all entity L1 writes + through `detachValueForL1Store` and by adding arena-reuse regressions for both + entity-fetch and root-field L1 population paths. +- **graphql-go-tools**: `tryRequestScopedInjection` was partially mutating items + when a later hint failed, leaving inconsistent state. Fixed with collect-then-inject: + verify all hints can be satisfied, then mutate. +- **Router**: `resolveEntityCacheProviderID` dereferenced a nil `*config.EntityCachingConfiguration` + in the plan generator path. Added a nil guard. +- **Playground**: cache mode dropdown was in the fetcher's `useMemo` dep array, + causing re-creation on mode change which triggered introspection re-run and + reset the response/cache stats. Fixed by using a ref instead. +- **Playground**: `collectCacheSummary` was excluding `load_skipped` fetches from + the total, producing misleading "5/5 Cached" when 3 skipped fetches were actually + cache hits. Fixed to count every fetch with a trace. +- **Playground**: Status code badge (200 OK) was shown alongside the red bolt icon + for skipped fetches. Fixed by hiding the badge when `loadSkipped` is true. + +## Per-subsystem CLAUDE.md files + +- `composition/CLAUDE.md` — composition library architecture, entity caching mapping rules +- `router-tests/CLAUDE.md` — router integration test patterns, sync helpers +- (graphql-go-tools repo) `CLAUDE.md` and `v2/pkg/engine/resolve/CLAUDE.md` — + resolver internals, entity caching layers, `@requestScoped` implementation details + +## Commands cheatsheet + +```bash +# Composition +cd composition && npx vitest run # all composition tests +cd composition && npx tsc --noEmit # type check +cd composition && pnpm build # build + +# Shared + composition-go bundle rebuild after composition changes +cd shared && pnpm build +cd composition-go && bash generate.sh + +# Proto regeneration +make generate-go + +# Router tests +cd router-tests/entity_caching && make compose # regenerate testdata/config.json +cd router-tests/entity_caching && go test -run "TestEntityCaching" -count=1 . + +# graphql-go-tools (in the local sibling clone) +cd v2 && go test ./pkg/engine/resolve/ ./pkg/engine/plan/ ./pkg/engine/datasource/graphql_datasource/ -count=1 + +# Demo +cd demo && make compose-cache # recompose config-cache-only.json +cd demo && go run ./cmd/cache-demo/ # start subgraphs +cd router && go run ./cmd/router/ --config ../demo/router-cache.yaml + +# Playground embed +cd playground && pnpm build:router +``` diff --git a/Makefile b/Makefile index f7777d71f7..ecd6bbd2d7 100644 --- a/Makefile +++ b/Makefile @@ -184,6 +184,51 @@ docker-build-minikube: docker-build-local rm -f mk-*.tar +demo-compose: + cd demo && $(MAKE) compose-cache + +DEMO_STARTUP_ATTEMPTS ?= 60 +DEMO_STARTUP_SLEEP ?= 0.5 + +demo: + @echo "Composing subgraph schemas..." + cd demo && $(MAKE) compose-cache + @echo "Starting subgraphs and router..." + @echo "Playground will be at http://localhost:3002/" + @set -e; \ + cd demo && go run cmd/all/main.go & \ + pid=$$!; \ + trap 'kill $$pid 2>/dev/null || true' EXIT INT TERM HUP; \ + for p in 4012 4013 4014; do \ + for i in $$(seq 1 $(DEMO_STARTUP_ATTEMPTS)); do \ + nc -z 127.0.0.1 $$p && break; \ + sleep $(DEMO_STARTUP_SLEEP); \ + done; \ + nc -z 127.0.0.1 $$p || { echo "subgraph $$p did not start" >&2; exit 1; }; \ + done; \ + cd router && go run cmd/router/main.go --config ../demo/router-cache.yaml + +benchmark-cache-demo: + pnpm dlx tsx benchmark/scripts/run_suite.ts --all \ + $(if $(VUS),--vus $(VUS),) \ + $(if $(DURATION),--duration $(DURATION),) \ + $(if $(RAMP_UP),--ramp-up $(RAMP_UP),) \ + $(if $(RAMP_DOWN),--ramp-down $(RAMP_DOWN),) + +benchmark-cache-demo-scenario: + @if [ -z "$(SCENARIO)" ]; then \ + echo "Usage: make benchmark-cache-demo-scenario SCENARIO="; \ + exit 1; \ + fi + pnpm dlx tsx benchmark/scripts/run_suite.ts --scenario $(SCENARIO) \ + $(if $(VUS),--vus $(VUS),) \ + $(if $(DURATION),--duration $(DURATION),) \ + $(if $(RAMP_UP),--ramp-up $(RAMP_UP),) \ + $(if $(RAMP_DOWN),--ramp-down $(RAMP_DOWN),) + +benchmark-cache-demo-validate: + pnpm dlx tsx benchmark/scripts/run_suite.ts validate + run-subgraphs-local: cd demo && go run cmd/all/main.go diff --git a/PLAN.md b/PLAN.md new file mode 100644 index 0000000000..f35a16479f --- /dev/null +++ b/PLAN.md @@ -0,0 +1,185 @@ +# PR #2777 Review Action Plan + +**PR:** https://github.com/wundergraph/cosmo/pull/2777 — entity caching (~40k lines). +**Reviewers processed:** CodeRabbit bot (37 findings) + SkArchon (5 inline comments). +**Already addressed by commit `4bf4040f0`:** 25 findings (not repeated here). +**Second opinion:** codex (0.121.0) — agreed on ignores, escalated two items to blockers. + +Legend: +- **FIX / BLOCKER** — must land before merge. +- **FIX** — should land before merge; small scope. +- **IGNORE** — rejected with reason. + +--- + +## BLOCKERS (codex escalation — must fix before merge) + +### B1. Fuzz tests must assert a single expected outcome +*Finding [19] — `composition/tests/v1/directives/entity-cache-fuzz.test.ts` L160-197, 262-288, 412-488.* + +Current pattern: `if (result.success) { ... } // if it errored, that's fine`. +A fuzz suite that accepts both success and failure catches no regressions. + +**Action:** for each flagged case, pick the correct expected outcome +(success with specific config, or failure with specific error code) and lock it in. +If the current behavior is underspecified, decide the spec first, then assert. + +### B2. Parameterize cache-layer test harness (L1-only / L2-only / both) +*Finding [SkArchon L164, L2184] — `router-tests/entity_caching/harness_test.go:216`.* + +`entityCachingOptions(cache)` hard-codes L1+L2 enabled. +Tests labeled "L1/…" or "L2/…" currently get both layers. +Any L1-only assertion that passes today may be silently riding on L2. +This is a cache-correctness PR; ambiguous layer isolation is a real defect. + +**Action:** +1. Add helpers `entityCachingL1OnlyOptions(cache)` and `entityCachingL2OnlyOptions(cache)` + mirroring the existing `entityCachingOptions`. +2. Audit every subtest under `L1/…` and `L2/…` prefixes in + `entity_caching_test.go` and switch to the matching helper. +3. Run the suite under `-race -count=3` after the switch to catch any test + that was relying on the other layer. + +### B3. Add inverse "L1 disabled → N calls" test for dedupe claims +*Finding [SkArchon L2235].* + +Whenever a test asserts "L1 dedupes to 1 call", add a sibling test with L1 +disabled asserting the subgraph sees the expected 3 calls. +Prevents false positives if the planner ever starts merging calls for an +unrelated reason. + +**Action:** under each `L1/deduplicates…` subtest, add a companion +`L1-disabled/…` case using `entityCachingL2OnlyOptions` (or no entity caching) +that locks in the un-deduped count. + +--- + +## FIX (small, low risk) + +### F1. Align `demo/go.mod` OpenTelemetry to router's pattern +*Finding [1] — codex refinement.* + +Router and router-tests pin `go.opentelemetry.io/otel` and all companion +packages (`otel`, `otel/sdk`, `otel/sdk/metric`, `otel/trace`, `otel/metric`) +to `require v1.39.0` with `replace → v1.28.0`. +`demo/go.mod` drifts at `v1.36.0` with no replace. +CodeRabbit's CVE callout (PATH hijack) is real but negligible for a demo; +the real fix is consistency with router. +A repo-wide jump to `v1.43.0` is out of scope for this PR. + +**Action:** bump `demo/go.mod` otel require-block to `v1.39.0` and add the +same `replace` directive block as `router/go.mod:191+`. +Run `go mod tidy` in `demo/`. +Leave `router/` and `router-tests/` alone. + +### F2. Shell script timeouts and shutdown correctness +*Findings [6][7][8] — benchmark harness scripts.* + +- `benchmark/scripts/stop_stack.sh:13-17` — replace bare `wait "${pid}"` + (no-op on non-child PIDs from `start_new_session=True`) with a + `kill -0` polling loop (5s timeout) then SIGKILL fallback, THEN + `rm -f pid_file`. +- `benchmark/scripts/capture_pprof.sh:9-12` — add + `--connect-timeout 2 --max-time $((PPROF_SECONDS+15))` to both curl calls. +- `benchmark/scripts/wait_ready.sh:6-14` — add + `--connect-timeout 1 --max-time 2` to each probe and + `timeout 2 docker exec …` around the redis ping. + +### F3. Validate CLI options in `benchmark/scripts/run_suite.ts` +*Finding [37] L65-87.* + +`--vus` can silently become `NaN`; missing `--duration` / `--ramp-up` / +`--ramp-down` values error deep in the pipeline. + +**Action:** parse and validate each flag up front; reject with a clear +usage message. +Add a unit test for the option parser if one doesn't exist. + +### F4. Documentation cleanups (trivial, batch-fix) +*Findings [28][29][31][35].* + +- `composition/AGENTS.md:60,63,68` — escape `@openfed\_\_…` + (currently renders as `@openfed**…`). +- `docs/entity-caching/ENTITY_CACHING_DEMO.md:5,90,128,159,229,260` — + add fence languages (`text` is fine for diagrams). +- `demo/pkg/subgraphs/cachegraph/subgraph/data.go:146` — the + "metric data" comment precedes `recommendedArticlesByViewer`, not metrics. + Either delete the comment or move it to line 154 above `metricsData`. +- `docs/entity-caching/directives.md:13-15` — the naming-principle + paragraph says entity caching uses unprefixed directives but the + whole doc uses `@openfed__…`. + Reword to match the actual surface. + +### F5. Simplify or delete the vacuous L1-dedupe test +*Finding [SkArchon L698-L699] — `entity_caching_test.go:698` `L1/deduplicates repeated entity loads`.* + +The test's own 20-line comment (added in `4bf4040f0`) openly admits the +assertion is vacuous — the planner merges identical entity fetches +regardless of L1 state. +SkArchon flagged both "comment too verbose" and "test doesn't add value"; +they're the same observation. + +**Action:** **delete the test** and cite `request_scoped_nested_dedup` +(coordinate L1) and the new B2 L1-only / L2-only harness split as the +real coverage. +Keeping a test that admits it proves nothing is worse than removing it. +(If there's product reason to keep the query-shape pinned, move the +assertion into an L2-only test where the L1 path is a no-op and the +assertion is meaningful.) + +--- + +## IGNORE (with rationale) + +### I1. CodeRabbit [3] — "use `interface` for warning params object shapes" +*`composition/src/v1/warnings/params.ts:14-53`.* + +Local convention in `composition/` is `export type X = { ... }` for object +shapes. +`composition/src/router-configuration/types.ts` has ~15 `export type` shapes +and zero `export interface`. +Codex confirmed. +CodeRabbit's guidance is a generic TS rule that contradicts local style. + +### I2. CodeRabbit [4] — "add `@requestScoped` to both `currentViewer` fields in benchmark query" +*`benchmark/queries/request_scoped_viewer_articles.graphql:2-13`.* + +`@openfed__requestScoped` is declared `on FIELD_DEFINITION` in the subgraph +schema (`demo/pkg/subgraphs/viewer/subgraph/schema.graphqls:7`). +Clients do not annotate operations with it. +The benchmark query already exercises coordinate L1 via the schema-side +declaration on `Query.currentViewer` and `Personalized.currentViewer`. +Codex confirmed. +CodeRabbit misread the directive's locations. + +### I3. CodeRabbit [30] — "use hyphenated `proto-generated`" +*`CLAUDE.md:111`.* + +Grammatical nit in a guidance file authored by the repo owner. +No functional impact; editorial freedom. + +--- + +## Summary & merge gate + +Must land before merge: **B1, B2, B3** (3 items, all test-quality). +Should land before merge: **F1, F2, F3, F4, F5** (5 items, mostly trivial). +Ignored: **I1, I2, I3** (3 items). + +Total already-fixed: **25** (by `4bf4040f0`). +Total remaining work: **8 actionable items**, of which 3 are blockers +focused on the one systemic weakness codex flagged — weak test isolation +between cache layers and under-specified fuzz expectations. +Everything else is cleanup. + +## Suggested commit ordering + +1. `test(entity-caching): add L1-only / L2-only option helpers` (B2 helpers only). +2. `test(entity-caching): switch L1/L2 subtests to layer-isolated options` (B2 audit). +3. `test(entity-caching): add inverse L1-disabled assertions` (B3). +4. `test(composition): lock single expected outcome in entity-cache fuzz` (B1). +5. `test(entity-caching): delete vacuous L1-dedupe test` (F5). +6. `chore(demo): align otel packages with router's v1.39.0 + v1.28.0 replace` (F1). +7. `chore(benchmark): bound shell probes and shutdowns with timeouts` (F2). +8. `chore(benchmark): validate run_suite.ts CLI options up front` (F3). +9. `docs(entity-caching): misc doc cleanups (AGENTS escaping, fences, comment placement, naming)` (F4). diff --git a/benchmark/.gitignore b/benchmark/.gitignore new file mode 100644 index 0000000000..525fef9f16 --- /dev/null +++ b/benchmark/.gitignore @@ -0,0 +1,5 @@ +.run/ +.tmp-metrics/ +.tmp-pprof/ +results/* +!results/.gitkeep diff --git a/benchmark/README.md b/benchmark/README.md new file mode 100644 index 0000000000..5cc5c1bdc8 --- /dev/null +++ b/benchmark/README.md @@ -0,0 +1,114 @@ +# Cache Demo Benchmark Suite + +Local benchmark harness for the cache demo on `localhost:3002`, using: + +- the existing `cache-demo` subgraphs +- a dedicated Redis Docker container for L2 cache storage on `localhost:6399` +- k6 for request load +- router Prometheus and pprof for runtime capture + +## Prerequisites + +- `go` with the repo’s expected toolchain +- `pnpm` +- `k6` +- `docker` +- free local ports: + - `3002` + - `4012` + - `4013` + - `4014` + - `6060` + - `8088` + - `6399` + +## Key Files + +- `benchmark/router-cache.redis.yaml`: Redis-backed router config for the benchmark +- `benchmark/scenarios/cache-demo.json`: scenario manifest +- `benchmark/queries/*.graphql`: canonical benchmark operations +- `benchmark/fixtures/*.response.json`: uncached router response fixtures +- `benchmark/k6/cache_demo.js`: k6 runner with exact response assertion + +## Scenarios + +- `article_simple` +- `articles_by_ids_batch` +- `listing_composite_key` +- `venue_nested_key` +- `user_profile_header_sensitive` +- `catalogs_partial_load` +- `request_scoped_viewer_articles` +- `viewer_articles_deep_nested` + +## Auth Profiles + +The demo uses fake bearer tokens: + +- `alice` -> `Bearer token-alice` +- `bob` -> `Bearer token-bob` +- `charlie` -> `Bearer token-charlie` + +Auth-sensitive scenarios must not fall back to anonymous requests. + +## Commands + +Validate the manifest and checked-in fixtures: + +```bash +make benchmark-cache-demo-validate +``` + +Run the full suite with default load settings: + +```bash +make benchmark-cache-demo +``` + +Run one scenario with default load settings: + +```bash +make benchmark-cache-demo-scenario SCENARIO=article_simple +``` + +Run one scenario with direct control over k6 stages: + +```bash +pnpm dlx tsx benchmark/scripts/run_suite.ts \ + --scenario article_simple \ + --vus 10 \ + --duration 30s \ + --ramp-up 5s \ + --ramp-down 5s +``` + +## Output Layout + +Result bundles are written under: + +```text +benchmark/results//// +``` + +Each mode directory contains: + +- `summary.json` +- `k6-summary.json` +- `metrics-before.prom` +- `metrics-after.prom` +- `metrics-delta.json` +- `redis-info-before.txt` +- `redis-info-after.txt` +- `redis-docker-stats-before.json` +- `redis-docker-stats-after.json` +- `equivalence.json` +- `pprof/router_cpu.pb.gz` +- `pprof/router_heap.pb.gz` + +`summary.json` also records the warmup request count, k6 stage config, parsed k6 summary, and selected Redis INFO and Docker stats values so downstream interpretation does not need to scrape raw artifacts first. + +## Notes + +- The harness owns the stack. If the required ports are already in use, startup fails rather than benchmarking against a dirty environment. +- L2 cache storage is intentionally externalized to Redis so router memory measurements do not include the full L2 object footprint. +- The suite always performs deterministic uncached equivalence checks before load generation and serial warmup requests before each mode run. diff --git a/benchmark/fixtures/article_simple.response.json b/benchmark/fixtures/article_simple.response.json new file mode 100644 index 0000000000..dd56307011 --- /dev/null +++ b/benchmark/fixtures/article_simple.response.json @@ -0,0 +1 @@ +{"data":{"article":{"id":"1","title":"Introduction to GraphQL Caching","authorName":"Alice"}}} diff --git a/benchmark/fixtures/articles_by_ids_batch.response.json b/benchmark/fixtures/articles_by_ids_batch.response.json new file mode 100644 index 0000000000..8394ffed01 --- /dev/null +++ b/benchmark/fixtures/articles_by_ids_batch.response.json @@ -0,0 +1 @@ +{"data":{"articlesByIds":[{"id":"1","title":"Introduction to GraphQL Caching","authorName":"Alice"},{"id":"2","title":"Advanced Federation Patterns","authorName":"Bob"},{"id":"3","title":"Cache Invalidation Strategies","authorName":"Charlie"}]}} diff --git a/benchmark/fixtures/catalogs_partial_load.response.json b/benchmark/fixtures/catalogs_partial_load.response.json new file mode 100644 index 0000000000..eb9de2384d --- /dev/null +++ b/benchmark/fixtures/catalogs_partial_load.response.json @@ -0,0 +1 @@ +{"data":{"catalogs":[{"id":"c1","name":"Electronics","description":"Consumer electronics, gadgets, and accessories.","lastUpdated":"2025-03-15T08:00:00Z","itemCount":342},{"id":"c2","name":"Books","description":"Fiction, non-fiction, technical books, and audiobooks.","lastUpdated":"2025-03-20T12:00:00Z","itemCount":1205},{"id":"c3","name":"Clothing","description":"Men's, women's, and children's apparel.","lastUpdated":"2025-03-25T16:00:00Z","itemCount":567}]}} diff --git a/benchmark/fixtures/listing_composite_key.response.json b/benchmark/fixtures/listing_composite_key.response.json new file mode 100644 index 0000000000..445a0db0cd --- /dev/null +++ b/benchmark/fixtures/listing_composite_key.response.json @@ -0,0 +1 @@ +{"data":{"listing":{"sellerId":"s1","sku":"WIDGET-01","title":"Premium Widget","price":29.99,"currency":"USD","inStock":true}}} diff --git a/benchmark/fixtures/request_scoped_viewer_articles.response.json b/benchmark/fixtures/request_scoped_viewer_articles.response.json new file mode 100644 index 0000000000..0e41501d5b --- /dev/null +++ b/benchmark/fixtures/request_scoped_viewer_articles.response.json @@ -0,0 +1 @@ +{"data":{"currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"articles":[{"id":"1","title":"Introduction to GraphQL Caching","currentViewer":{"id":"v1","name":"Alice"},"viewCount":12453,"rating":4.7},{"id":"2","title":"Advanced Federation Patterns","currentViewer":{"id":"v1","name":"Alice"},"viewCount":8921,"rating":4.3},{"id":"3","title":"Cache Invalidation Strategies","currentViewer":{"id":"v1","name":"Alice"},"viewCount":15678,"rating":4.9},{"id":"4","title":"Performance Tuning with Entity Caching","currentViewer":{"id":"v1","name":"Alice"},"viewCount":6234,"rating":4.1}]}} diff --git a/benchmark/fixtures/user_profile_header_sensitive.alice.response.json b/benchmark/fixtures/user_profile_header_sensitive.alice.response.json new file mode 100644 index 0000000000..37f29effba --- /dev/null +++ b/benchmark/fixtures/user_profile_header_sensitive.alice.response.json @@ -0,0 +1 @@ +{"data":{"userProfile":{"id":"u1","username":"alice","role":"admin","email":"alice@example.com"}}} diff --git a/benchmark/fixtures/user_profile_header_sensitive.bob.response.json b/benchmark/fixtures/user_profile_header_sensitive.bob.response.json new file mode 100644 index 0000000000..d34aa719b9 --- /dev/null +++ b/benchmark/fixtures/user_profile_header_sensitive.bob.response.json @@ -0,0 +1 @@ +{"data":{"userProfile":{"id":"u2","username":"bob","role":"editor","email":"bob@example.com"}}} diff --git a/benchmark/fixtures/venue_nested_key.response.json b/benchmark/fixtures/venue_nested_key.response.json new file mode 100644 index 0000000000..f730c695fe --- /dev/null +++ b/benchmark/fixtures/venue_nested_key.response.json @@ -0,0 +1 @@ +{"data":{"venue":{"address":{"id":"v1"},"name":"Grand Conference Hall","capacity":500,"city":"Berlin"}}} diff --git a/benchmark/fixtures/viewer_articles_deep_nested.response.json b/benchmark/fixtures/viewer_articles_deep_nested.response.json new file mode 100644 index 0000000000..bf62808dc1 --- /dev/null +++ b/benchmark/fixtures/viewer_articles_deep_nested.response.json @@ -0,0 +1 @@ +{"data":{"articles":[{"id":"1","title":"Introduction to GraphQL Caching","body":"Entity caching allows you to cache resolved entities at the subgraph level.","relatedArticles":[{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"2","title":"Advanced Federation Patterns","tags":["federation","advanced"],"viewCount":8921,"rating":4.3,"reviewSummary":"Deep dive into federation. Could use more diagrams.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]}]},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]},{"id":"2","title":"Advanced Federation Patterns","tags":["federation","advanced"],"viewCount":8921,"rating":4.3,"reviewSummary":"Deep dive into federation. Could use more diagrams.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]}]}]},{"id":"2","title":"Advanced Federation Patterns","body":"Learn how to use composite keys and nested keys in federation.","relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"2","title":"Advanced Federation Patterns","tags":["federation","advanced"],"viewCount":8921,"rating":4.3,"reviewSummary":"Deep dive into federation. Could use more diagrams.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]}]},{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"2","title":"Advanced Federation Patterns","tags":["federation","advanced"],"viewCount":8921,"rating":4.3,"reviewSummary":"Deep dive into federation. Could use more diagrams.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]}]}]},{"id":"3","title":"Cache Invalidation Strategies","body":"Explore different approaches to invalidating cached entities.","relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"2","title":"Advanced Federation Patterns","tags":["federation","advanced"],"viewCount":8921,"rating":4.3,"reviewSummary":"Deep dive into federation. Could use more diagrams.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]}]},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]},{"id":"2","title":"Advanced Federation Patterns","tags":["federation","advanced"],"viewCount":8921,"rating":4.3,"reviewSummary":"Deep dive into federation. Could use more diagrams.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]}]}]},{"id":"4","title":"Performance Tuning with Entity Caching","body":"How to get the most out of entity caching in production.","relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"2","title":"Advanced Federation Patterns","tags":["federation","advanced"],"viewCount":8921,"rating":4.3,"reviewSummary":"Deep dive into federation. Could use more diagrams.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]}]},{"id":"2","title":"Advanced Federation Patterns","tags":["federation","advanced"],"viewCount":8921,"rating":4.3,"reviewSummary":"Deep dive into federation. Could use more diagrams.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]},{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]}]}]}],"currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com","recommendedArticles":[{"id":"2","title":"Advanced Federation Patterns","tags":["federation","advanced"],"viewCount":8921,"rating":4.3,"reviewSummary":"Deep dive into federation. Could use more diagrams.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]},{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]}]},{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"3","title":"Cache Invalidation Strategies","tags":["caching","patterns"],"viewCount":15678,"rating":4.9,"reviewSummary":"The definitive guide to cache invalidation. Must read.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]},{"id":"4","title":"Performance Tuning with Entity Caching","tags":["performance","caching"],"viewCount":6234,"rating":4.1,"reviewSummary":"Practical tips for production caching. Solid advice.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"},"relatedArticles":[{"id":"1","title":"Introduction to GraphQL Caching","tags":["graphql","caching","federation"],"viewCount":12453,"rating":4.7,"reviewSummary":"Excellent introduction to caching concepts. Clear examples.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}},{"id":"2","title":"Advanced Federation Patterns","tags":["federation","advanced"],"viewCount":8921,"rating":4.3,"reviewSummary":"Deep dive into federation. Could use more diagrams.","personalizedRecommendation":"Hey Alice, based on your interests you'll love this article!","currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}}]}]}]}}} diff --git a/benchmark/k6/cache_demo.js b/benchmark/k6/cache_demo.js new file mode 100644 index 0000000000..baeb9e81fb --- /dev/null +++ b/benchmark/k6/cache_demo.js @@ -0,0 +1,123 @@ +import http from "k6/http"; +import { check, fail } from "k6"; +import { Counter, Rate } from "k6/metrics"; + +const payload = JSON.parse(__ENV.BENCHMARK_PAYLOAD || "{}"); + +if (!payload.url || !payload.query) { + fail("BENCHMARK_PAYLOAD must include url and query"); +} + +const mismatchRate = new Rate("response_mismatch_rate"); +const graphqlErrorRate = new Rate("graphql_error_rate"); +const mismatchCount = new Counter("response_mismatch_count"); + +function normalizeJson(value) { + if (Array.isArray(value)) { + return value.map((item) => normalizeJson(item)); + } + + if (value !== null && typeof value === "object") { + const out = {}; + for (const key of Object.keys(value).sort()) { + out[key] = normalizeJson(value[key]); + } + return out; + } + + return value; +} + +function normalizeResponseForComparison(value) { + if (value === null || typeof value !== "object" || Array.isArray(value)) { + return normalizeJson(value); + } + + const response = JSON.parse(JSON.stringify(value)); + const extensions = response.extensions; + + if (extensions && typeof extensions === "object" && !Array.isArray(extensions)) { + delete extensions.trace; + + if (Object.keys(extensions).length === 0) { + delete response.extensions; + } + } + + return normalizeJson(response); +} + +const expectedBody = JSON.stringify( + normalizeResponseForComparison(payload.expectedBody), +); + +export const options = payload.options || { + stages: [ + { duration: "30s", target: 20 }, + { duration: "2m", target: 20 }, + { duration: "10s", target: 0 }, + ], +}; + +export default function () { + const mergedHeaders = Object.assign( + { "content-type": "application/json" }, + payload.headers || {}, + ); + + const response = http.post( + payload.url, + JSON.stringify({ + operationName: payload.operationName, + query: payload.query, + variables: payload.variables || {}, + }), + { + headers: mergedHeaders, + }, + ); + + const ok = check(response, { + "http status is 200": (res) => res.status === 200, + }); + + if (!ok) { + mismatchRate.add(true); + mismatchCount.add(1); + graphqlErrorRate.add(false); + return; + } + + let body; + try { + body = response.json(); + } catch (_err) { + // Parse failure is both a response mismatch and a graphql-error-equivalent + // (the server returned a non-JSON body or truncated JSON under load). + mismatchRate.add(true); + mismatchCount.add(1); + graphqlErrorRate.add(true); + return; + } + + const hasGraphqlErrors = Array.isArray(body?.errors) && body.errors.length > 0; + graphqlErrorRate.add(hasGraphqlErrors); + + const sameBody = + JSON.stringify(normalizeResponseForComparison(body)) === expectedBody; + + const assertionOk = check( + { body, sameBody, hasGraphqlErrors }, + { + "graphql errors absent": (data) => !data.hasGraphqlErrors, + "response matches expected fixture": (data) => data.sameBody, + }, + ); + + if (!assertionOk || !sameBody) { + mismatchRate.add(true); + mismatchCount.add(1); + } else { + mismatchRate.add(false); + } +} diff --git a/benchmark/queries/article_simple.graphql b/benchmark/queries/article_simple.graphql new file mode 100644 index 0000000000..a18ccb6d74 --- /dev/null +++ b/benchmark/queries/article_simple.graphql @@ -0,0 +1,7 @@ +query ArticleSimple($id: ID!) { + article(id: $id) { + id + title + authorName + } +} diff --git a/benchmark/queries/articles_by_ids_batch.graphql b/benchmark/queries/articles_by_ids_batch.graphql new file mode 100644 index 0000000000..e057139e69 --- /dev/null +++ b/benchmark/queries/articles_by_ids_batch.graphql @@ -0,0 +1,7 @@ +query ArticlesByIdsBatch($ids: [ID!]!) { + articlesByIds(ids: $ids) { + id + title + authorName + } +} diff --git a/benchmark/queries/catalogs_partial_load.graphql b/benchmark/queries/catalogs_partial_load.graphql new file mode 100644 index 0000000000..8a274b616c --- /dev/null +++ b/benchmark/queries/catalogs_partial_load.graphql @@ -0,0 +1,9 @@ +query CatalogsPartialLoad { + catalogs { + id + name + description + lastUpdated + itemCount + } +} diff --git a/benchmark/queries/listing_composite_key.graphql b/benchmark/queries/listing_composite_key.graphql new file mode 100644 index 0000000000..a359a1d458 --- /dev/null +++ b/benchmark/queries/listing_composite_key.graphql @@ -0,0 +1,10 @@ +query ListingCompositeKey($key: ListingKey!) { + listing(key: $key) { + sellerId + sku + title + price + currency + inStock + } +} diff --git a/benchmark/queries/request_scoped_viewer_articles.graphql b/benchmark/queries/request_scoped_viewer_articles.graphql new file mode 100644 index 0000000000..926850ce00 --- /dev/null +++ b/benchmark/queries/request_scoped_viewer_articles.graphql @@ -0,0 +1,17 @@ +query RequestScopedViewerArticles { + currentViewer { + id + name + email + } + articles { + id + title + currentViewer { + id + name + } + viewCount + rating + } +} diff --git a/benchmark/queries/user_profile_header_sensitive.graphql b/benchmark/queries/user_profile_header_sensitive.graphql new file mode 100644 index 0000000000..8ef895cc1b --- /dev/null +++ b/benchmark/queries/user_profile_header_sensitive.graphql @@ -0,0 +1,8 @@ +query UserProfileHeaderSensitive($id: ID!) { + userProfile(id: $id) { + id + username + role + email + } +} diff --git a/benchmark/queries/venue_nested_key.graphql b/benchmark/queries/venue_nested_key.graphql new file mode 100644 index 0000000000..b3c39e9dfa --- /dev/null +++ b/benchmark/queries/venue_nested_key.graphql @@ -0,0 +1,10 @@ +query VenueNestedKey($location: VenueLocationKey!) { + venue(location: $location) { + address { + id + } + name + capacity + city + } +} diff --git a/benchmark/queries/viewer_articles_deep_nested.graphql b/benchmark/queries/viewer_articles_deep_nested.graphql new file mode 100644 index 0000000000..413990f300 --- /dev/null +++ b/benchmark/queries/viewer_articles_deep_nested.graphql @@ -0,0 +1,45 @@ +query ViewerArticles { + articles { + id + title + body + relatedArticles { + ...ArticleFields + relatedArticles { + ...ArticleFields + relatedArticles { + ...ArticleFields + } + } + } + } + currentViewer { + id + name + email + recommendedArticles { + ...ArticleFields + relatedArticles { + ...ArticleFields + relatedArticles { + ...ArticleFields + } + } + } + } +} + +fragment ArticleFields on Article { + id + title + tags + viewCount + rating + reviewSummary + personalizedRecommendation + currentViewer { + id + name + email + } +} diff --git a/benchmark/router-cache.redis.yaml b/benchmark/router-cache.redis.yaml new file mode 100644 index 0000000000..6be07fa782 --- /dev/null +++ b/benchmark/router-cache.redis.yaml @@ -0,0 +1,53 @@ +version: "1" + +execution_config: + file: + path: "../demo/config-cache-only.json" + +storage_providers: + redis: + - id: "benchmark-redis" + urls: + - "redis://localhost:6399/2" + cluster_enabled: false + +entity_caching: + enabled: true + l1: + enabled: true + l2: + enabled: true + storage: + provider_id: "benchmark-redis" + key_prefix: "cosmo_entity_cache" + circuit_breaker: + enabled: false + +headers: + subgraphs: + cachegraph: + request: + - op: propagate + named: Authorization + - op: propagate + named: X-Artificial-Latency + cachegraph-ext: + request: + - op: propagate + named: X-Artificial-Latency + viewer: + request: + - op: propagate + named: Authorization + - op: propagate + named: X-Artificial-Latency + +graph: + token: "" + +log_level: debug +dev_mode: true +listen_addr: "localhost:3002" +playground: + enabled: true + path: "/" diff --git a/benchmark/scenarios/cache-demo.json b/benchmark/scenarios/cache-demo.json new file mode 100644 index 0000000000..0d0380d464 --- /dev/null +++ b/benchmark/scenarios/cache-demo.json @@ -0,0 +1,164 @@ +{ + "scenarios": [ + { + "name": "article_simple", + "queryFile": "benchmark/queries/article_simple.graphql", + "operationName": "ArticleSimple", + "responseFixture": "benchmark/fixtures/article_simple.response.json", + "variables": { + "id": "1" + }, + "modeFamily": "entity_cache", + "warmupRequests": 10, + "headers": { + "X-Artificial-Latency": "80" + }, + "equivalenceModes": [ + "cache_enabled", + "entity_cache_disabled" + ] + }, + { + "name": "articles_by_ids_batch", + "queryFile": "benchmark/queries/articles_by_ids_batch.graphql", + "operationName": "ArticlesByIdsBatch", + "responseFixture": "benchmark/fixtures/articles_by_ids_batch.response.json", + "variables": { + "ids": [ + "1", + "2", + "3" + ] + }, + "modeFamily": "entity_cache", + "warmupRequests": 10, + "headers": { + "X-Artificial-Latency": "80" + }, + "equivalenceModes": [ + "cache_enabled", + "entity_cache_disabled" + ] + }, + { + "name": "listing_composite_key", + "queryFile": "benchmark/queries/listing_composite_key.graphql", + "operationName": "ListingCompositeKey", + "responseFixture": "benchmark/fixtures/listing_composite_key.response.json", + "variables": { + "key": { + "sellerId": "s1", + "sku": "WIDGET-01" + } + }, + "modeFamily": "entity_cache", + "warmupRequests": 10, + "headers": { + "X-Artificial-Latency": "80" + }, + "equivalenceModes": [ + "cache_enabled", + "entity_cache_disabled" + ] + }, + { + "name": "venue_nested_key", + "queryFile": "benchmark/queries/venue_nested_key.graphql", + "operationName": "VenueNestedKey", + "responseFixture": "benchmark/fixtures/venue_nested_key.response.json", + "variables": { + "location": { + "address": { + "id": "v1" + } + } + }, + "modeFamily": "entity_cache", + "warmupRequests": 10, + "headers": { + "X-Artificial-Latency": "80" + }, + "equivalenceModes": [ + "cache_enabled", + "entity_cache_disabled" + ] + }, + { + "name": "user_profile_header_sensitive", + "queryFile": "benchmark/queries/user_profile_header_sensitive.graphql", + "operationName": "UserProfileHeaderSensitive", + "responseFixtures": { + "alice": "benchmark/fixtures/user_profile_header_sensitive.alice.response.json", + "bob": "benchmark/fixtures/user_profile_header_sensitive.bob.response.json" + }, + "variables": { + "id": "u1" + }, + "modeFamily": "entity_cache", + "warmupRequests": 10, + "headers": { + "X-Artificial-Latency": "80" + }, + "authProfiles": [ + "alice", + "bob" + ], + "equivalenceModes": [ + "cache_enabled", + "entity_cache_disabled" + ] + }, + { + "name": "catalogs_partial_load", + "queryFile": "benchmark/queries/catalogs_partial_load.graphql", + "operationName": "CatalogsPartialLoad", + "responseFixture": "benchmark/fixtures/catalogs_partial_load.response.json", + "variables": {}, + "modeFamily": "entity_cache", + "warmupRequests": 10, + "headers": { + "X-Artificial-Latency": "80" + }, + "equivalenceModes": [ + "cache_enabled", + "entity_cache_disabled" + ] + }, + { + "name": "request_scoped_viewer_articles", + "queryFile": "benchmark/queries/request_scoped_viewer_articles.graphql", + "operationName": "RequestScopedViewerArticles", + "responseFixture": "benchmark/fixtures/request_scoped_viewer_articles.response.json", + "variables": {}, + "modeFamily": "request_scoped", + "warmupRequests": 10, + "headers": { + "X-Artificial-Latency": "80" + }, + "authProfile": "alice", + "equivalenceModes": [ + "request_scoped_default", + "request_scoped_l1_disabled" + ] + }, + { + "name": "viewer_articles_deep_nested", + "queryFile": "benchmark/queries/viewer_articles_deep_nested.graphql", + "operationName": "ViewerArticles", + "responseFixture": "benchmark/fixtures/viewer_articles_deep_nested.response.json", + "variables": {}, + "modeFamily": "request_scoped", + "warmupRequests": 10, + "headers": { + "X-Artificial-Latency": "80" + }, + "authProfile": "alice", + "equivalenceModes": [ + "request_scoped_default", + "request_scoped_l1_disabled", + "cache_enabled", + "entity_cache_disabled" + ] + } + ] +} diff --git a/benchmark/scripts/capture_pprof.sh b/benchmark/scripts/capture_pprof.sh new file mode 100755 index 0000000000..63aa239e1d --- /dev/null +++ b/benchmark/scripts/capture_pprof.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -euo pipefail + +OUTPUT_DIR="${1:?usage: capture_pprof.sh }" +PPROF_SECONDS="${PPROF_SECONDS:-5}" +CURL_CONNECT_TIMEOUT="${CURL_CONNECT_TIMEOUT:-2}" +# CPU capture runs PPROF_SECONDS server-side, so allow that plus headroom for +# connect/response overhead. Heap is bounded by a smaller constant. +CURL_CPU_MAX_TIME="${CURL_CPU_MAX_TIME:-$((PPROF_SECONDS + 15))}" +CURL_HEAP_MAX_TIME="${CURL_HEAP_MAX_TIME:-20}" + +mkdir -p "${OUTPUT_DIR}" + +curl -fsS --connect-timeout "${CURL_CONNECT_TIMEOUT}" --max-time "${CURL_CPU_MAX_TIME}" \ + "http://127.0.0.1:6060/debug/pprof/profile?seconds=${PPROF_SECONDS}" \ + -o "${OUTPUT_DIR}/router_cpu.pb.gz" +curl -fsS --connect-timeout "${CURL_CONNECT_TIMEOUT}" --max-time "${CURL_HEAP_MAX_TIME}" \ + "http://127.0.0.1:6060/debug/pprof/heap" \ + -o "${OUTPUT_DIR}/router_heap.pb.gz" diff --git a/benchmark/scripts/capture_redis_stats.sh b/benchmark/scripts/capture_redis_stats.sh new file mode 100755 index 0000000000..587ea33ffa --- /dev/null +++ b/benchmark/scripts/capture_redis_stats.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail + +PHASE="${1:?usage: capture_redis_stats.sh }" +OUTPUT_DIR="${2:?usage: capture_redis_stats.sh }" +REDIS_CONTAINER="${BENCHMARK_REDIS_CONTAINER:-cosmo-benchmark-redis}" + +mkdir -p "${OUTPUT_DIR}" + +docker exec "${REDIS_CONTAINER}" redis-cli INFO > "${OUTPUT_DIR}/redis-info-${PHASE}.txt" +docker stats --no-stream --format '{{json .}}' "${REDIS_CONTAINER}" \ + > "${OUTPUT_DIR}/redis-docker-stats-${PHASE}.json" diff --git a/benchmark/scripts/lib.test.ts b/benchmark/scripts/lib.test.ts new file mode 100644 index 0000000000..1612498815 --- /dev/null +++ b/benchmark/scripts/lib.test.ts @@ -0,0 +1,702 @@ +import assert from "node:assert/strict"; +import test from "node:test"; + +import { + buildK6Stages, + buildSuiteSummary, + extractComparableModeSummary, + fetchJsonWithRetry, + loadManifest, + normalizeJson, + normalizeResponseForComparison, + parseDockerStatsSummary, + parseRedisInfoSummary, + resolveHeaders, + resolveRequestMatrix, + resolveScenario, +} from "./lib"; + +test("normalizeJson sorts object keys and preserves array order", () => { + const input = { + z: 1, + a: { + y: 2, + x: 3, + }, + arr: [ + { b: 2, a: 1 }, + { d: 4, c: 3 }, + ], + }; + + assert.deepEqual(normalizeJson(input), { + a: { + x: 3, + y: 2, + }, + arr: [ + { a: 1, b: 2 }, + { c: 3, d: 4 }, + ], + z: 1, + }); +}); + +test("loadManifest returns the benchmark scenarios", () => { + const manifest = loadManifest(); + + assert.ok(manifest.scenarios.length >= 8); + assert.ok( + manifest.scenarios.some( + (scenario) => scenario.name === "viewer_articles_deep_nested", + ), + ); +}); + +test("resolveRequestMatrix expands auth matrices and fixture paths", () => { + const manifest = loadManifest(); + const scenario = manifest.scenarios.find( + (item) => item.name === "user_profile_header_sensitive", + ); + + assert.ok(scenario); + + const matrix = resolveRequestMatrix(scenario); + + assert.deepEqual( + matrix.map((item) => item.authProfile), + ["alice", "bob"], + ); + assert.equal( + matrix[0]?.fixturePath.endsWith( + "benchmark/fixtures/user_profile_header_sensitive.alice.response.json", + ), + true, + ); +}); + +test("buildK6Stages creates deterministic stage layout", () => { + assert.deepEqual( + buildK6Stages({ + vus: 25, + duration: "90s", + rampUp: "15s", + rampDown: "5s", + }), + [ + { duration: "15s", target: 25 }, + { duration: "90s", target: 25 }, + { duration: "5s", target: 0 }, + ], + ); +}); + +test("parseRedisInfoSummary keeps selected runtime fields", () => { + const raw = `# Memory +used_memory:1024 +used_memory_human:1.00K +used_memory_peak:2048 +connected_clients:3 +total_commands_processed:42 +keyspace_hits:7 +keyspace_misses:2 +db2:keys=12,expires=0,avg_ttl=0 +`; + + assert.deepEqual(parseRedisInfoSummary(raw), { + used_memory: 1024, + used_memory_human: "1.00K", + used_memory_peak: 2048, + connected_clients: 3, + total_commands_processed: 42, + keyspace_hits: 7, + keyspace_misses: 2, + db2: "keys=12,expires=0,avg_ttl=0", + }); +}); + +test("parseDockerStatsSummary keeps the expected docker stats fields", () => { + assert.deepEqual( + parseDockerStatsSummary( + JSON.stringify({ + CPUPerc: "1.23%", + MemUsage: "12.3MiB / 1GiB", + NetIO: "1kB / 2kB", + BlockIO: "0B / 0B", + PIDs: "9", + Name: "ignored", + }), + ), + { + CPUPerc: "1.23%", + MemUsage: "12.3MiB / 1GiB", + NetIO: "1kB / 2kB", + BlockIO: "0B / 0B", + PIDs: "9", + }, + ); +}); + +test("resolveHeaders enables trace so benchmark cache controls are honored", () => { + const scenario = resolveScenario("article_simple"); + + expectHeaders(resolveHeaders(scenario, "entity_cache_disabled", undefined, "bench-a"), { + "X-WG-Trace": "enable_predictable_debug_timings", + "X-WG-Disable-Entity-Cache": "true", + "X-WG-Cache-Key-Prefix": "bench-a", + }); + + expectHeaders(resolveHeaders(scenario, "cache_enabled", undefined, "bench-b"), { + "X-WG-Trace": "enable_predictable_debug_timings", + "X-WG-Cache-Key-Prefix": "bench-b", + }); +}); + +test("normalizeResponseForComparison strips trace extensions and removes empty extensions", () => { + const response = { + data: { + article: { + id: "a1", + title: "Example", + }, + }, + extensions: { + trace: { + version: "1", + fetches: [], + }, + }, + }; + + assert.deepEqual(normalizeResponseForComparison(response), { + data: { + article: { + id: "a1", + title: "Example", + }, + }, + }); +}); + +test("fetchJsonWithRetry retries once for retryable fetch pipe errors", async () => { + let calls = 0; + + const result = await fetchJsonWithRetry({ + url: "http://example.test/graphql", + init: { + method: "POST", + body: "{}", + }, + fetchImpl: async () => { + calls += 1; + if (calls === 1) { + const error = new TypeError("fetch failed") as TypeError & { + cause?: { code?: string }; + }; + error.cause = { code: "EPIPE" }; + throw error; + } + + return new Response(JSON.stringify({ data: { ok: true } }), { + status: 200, + headers: { + "content-type": "application/json", + }, + }); + }, + }); + + assert.equal(calls, 2); + assert.deepEqual(result, { data: { ok: true } }); +}); + +test("fetchJsonWithRetry aborts a slow attempt via per-attempt timeout and retries", async () => { + let calls = 0; + + const result = await fetchJsonWithRetry({ + url: "http://example.test/graphql", + init: { + method: "POST", + body: "{}", + }, + timeoutMs: 50, + retries: 2, + fetchImpl: async (_url, opts) => { + calls += 1; + const signal = (opts as RequestInit | undefined)?.signal; + + if (calls === 1) { + // Simulate a hang that only resolves when the per-attempt timeout fires. + await new Promise((_resolve, reject) => { + if (!signal) { + return; + } + signal.addEventListener("abort", () => { + reject(signal.reason ?? new DOMException("aborted", "AbortError")); + }); + }); + throw new Error("unreachable"); + } + + return new Response(JSON.stringify({ data: { ok: true } }), { + status: 200, + headers: { "content-type": "application/json" }, + }); + }, + }); + + assert.equal(calls, 2); + assert.deepEqual(result, { data: { ok: true } }); +}); + +test("fetchJsonWithRetry gives up after exhausting retries on repeated timeouts", async () => { + let calls = 0; + + await assert.rejects( + () => + fetchJsonWithRetry({ + url: "http://example.test/graphql", + init: { + method: "POST", + body: "{}", + }, + timeoutMs: 20, + retries: 2, + fetchImpl: async (_url, opts) => { + calls += 1; + const signal = (opts as RequestInit | undefined)?.signal; + await new Promise((_resolve, reject) => { + if (!signal) { + return; + } + signal.addEventListener("abort", () => { + reject(signal.reason ?? new DOMException("aborted", "AbortError")); + }); + }); + throw new Error("unreachable"); + }, + }), + (error: unknown) => { + const name = (error as { name?: string } | null)?.name; + return name === "TimeoutError" || name === "AbortError"; + }, + ); + + // retries=2 → attempts 0, 1, 2 → 3 total calls + assert.equal(calls, 3); +}); + +test("fetchJsonWithRetry bubbles AbortError when the caller cancels", async () => { + const controller = new AbortController(); + let calls = 0; + + const pending = fetchJsonWithRetry({ + url: "http://example.test/graphql", + init: { + method: "POST", + body: "{}", + signal: controller.signal, + }, + timeoutMs: 5_000, + retries: 3, + fetchImpl: async (_url, opts) => { + calls += 1; + const signal = (opts as RequestInit | undefined)?.signal; + await new Promise((_resolve, reject) => { + if (!signal) { + return; + } + signal.addEventListener("abort", () => { + reject(signal.reason ?? new DOMException("aborted", "AbortError")); + }); + }); + throw new Error("unreachable"); + }, + }); + + // Cancel shortly after dispatch. + setTimeout(() => controller.abort(new DOMException("caller cancelled", "AbortError")), 20); + + await assert.rejects(pending, (error: unknown) => { + return (error as { name?: string } | null)?.name === "AbortError"; + }); + + // Caller cancellation must NOT trigger further retry attempts. + assert.equal(calls, 1); +}); + +test("fetchJsonWithRetry returns parsed JSON on happy path without retries", async () => { + let calls = 0; + + const result = await fetchJsonWithRetry({ + url: "http://example.test/graphql", + init: { method: "POST", body: "{}" }, + fetchImpl: async () => { + calls += 1; + return new Response(JSON.stringify({ data: { hello: "world" } }), { + status: 200, + headers: { "content-type": "application/json" }, + }); + }, + }); + + assert.equal(calls, 1); + assert.deepEqual(result, { data: { hello: "world" } }); +}); + +test("fetchJsonWithRetry does not retry non-retryable fetch failures", async () => { + let calls = 0; + + await assert.rejects( + () => + fetchJsonWithRetry({ + url: "http://example.test/graphql", + init: { + method: "POST", + body: "{}", + }, + fetchImpl: async () => { + calls += 1; + const error = new TypeError("fetch failed") as TypeError & { + cause?: { code?: string }; + }; + error.cause = { code: "ENOTFOUND" }; + throw error; + }, + }), + /fetch failed/, + ); + + assert.equal(calls, 1); +}); + +test("extractComparableModeSummary reads stable comparison metrics from mode artifacts", () => { + const modeSummary = extractComparableModeSummary({ + modePath: + "/tmp/results/article_simple/cache_enabled", + summaryDocument: { + scenario: "article_simple", + mode: "cache_enabled", + authProfile: null, + fixturePath: "benchmark/fixtures/article_simple.response.json", + k6: { + summary: { + metrics: { + http_reqs: { + count: 1000, + rate: 250, + }, + http_req_duration: { + avg: 4, + "p(95)": 7, + }, + iterations: { + count: 1000, + rate: 250, + }, + http_req_failed: { + value: 0, + }, + graphql_error_rate: { + value: 0, + }, + response_mismatch_rate: { + value: 0, + }, + }, + }, + }, + redis: { + infoAfter: { + used_memory: 4096, + used_memory_peak: 8192, + total_commands_processed: 120, + keyspace_hits: 90, + keyspace_misses: 30, + }, + dockerStatsAfter: { + CPUPerc: "12.5%", + MemUsage: "16MiB / 1GiB", + }, + }, + }, + metricsDeltaDocument: { + go_goroutines: 3, + go_memstats_alloc_bytes: 2048, + go_memstats_heap_alloc_bytes: 1024, + process_resident_memory_bytes: 512, + process_cpu_seconds_total: 1.5, + 'router_entity_cache_requests_stats_total{cache_level="l1",type="hits"}': 11, + 'router_entity_cache_requests_stats_total{cache_level="l1",type="misses"}': 2, + 'router_entity_cache_requests_stats_total{cache_level="l2",type="hits"}': 95, + 'router_entity_cache_requests_stats_total{cache_level="l2",type="misses"}': 5, + 'router_entity_cache_populations_total{source="query"}': 5, + 'router_entity_cache_keys_stats_total{cache_level="l2",operation="added"}': 5, + }, + }); + + assert.deepEqual(modeSummary, { + scenario: "article_simple", + mode: "cache_enabled", + authProfile: null, + fixturePath: "benchmark/fixtures/article_simple.response.json", + modePath: "/tmp/results/article_simple/cache_enabled", + requests: 1000, + requestRate: 250, + iterationCount: 1000, + iterationRate: 250, + latencyAvgMs: 4, + latencyP95Ms: 7, + httpFailureRate: 0, + graphqlErrorRate: 0, + responseMismatchRate: 0, + cache: { + l1Hits: 11, + l1Misses: 2, + l2Hits: 95, + l2Misses: 5, + populations: 5, + keysAdded: 5, + }, + router: { + goroutinesDelta: 3, + allocBytesDelta: 2048, + heapAllocBytesDelta: 1024, + residentMemoryBytesDelta: 512, + cpuSecondsDelta: 1.5, + }, + redis: { + usedMemoryBytes: 4096, + peakMemoryBytes: 8192, + commandsProcessed: 120, + keyspaceHits: 90, + keyspaceMisses: 30, + dockerCpuPercent: "12.5%", + dockerMemoryUsage: "16MiB / 1GiB", + }, + }); +}); + +test("buildSuiteSummary groups scenario variants and computes canonical mode comparisons", () => { + const suite = buildSuiteSummary({ + resultsRoot: "/tmp/results/run-1", + generatedAt: "2026-04-08T12:00:00.000Z", + modeSummaries: [ + { + scenario: "article_simple", + mode: "entity_cache_disabled", + authProfile: null, + fixturePath: "benchmark/fixtures/article_simple.response.json", + modePath: "/tmp/results/run-1/article_simple/entity_cache_disabled", + requests: 100, + requestRate: 50, + iterationCount: 100, + iterationRate: 50, + latencyAvgMs: 80, + latencyP95Ms: 100, + httpFailureRate: 0, + graphqlErrorRate: 0, + responseMismatchRate: 0, + cache: { + l1Hits: 0, + l1Misses: 0, + l2Hits: 0, + l2Misses: 0, + populations: 0, + keysAdded: 0, + }, + router: { + goroutinesDelta: 2, + allocBytesDelta: 4000, + heapAllocBytesDelta: 3000, + residentMemoryBytesDelta: 1200, + cpuSecondsDelta: 2, + }, + redis: { + usedMemoryBytes: 2048, + peakMemoryBytes: 4096, + commandsProcessed: 20, + keyspaceHits: 0, + keyspaceMisses: 0, + dockerCpuPercent: "1%", + dockerMemoryUsage: "8MiB / 1GiB", + }, + }, + { + scenario: "article_simple", + mode: "cache_enabled", + authProfile: null, + fixturePath: "benchmark/fixtures/article_simple.response.json", + modePath: "/tmp/results/run-1/article_simple/cache_enabled", + requests: 1000, + requestRate: 500, + iterationCount: 1000, + iterationRate: 500, + latencyAvgMs: 4, + latencyP95Ms: 6, + httpFailureRate: 0, + graphqlErrorRate: 0, + responseMismatchRate: 0, + cache: { + l1Hits: 0, + l1Misses: 0, + l2Hits: 900, + l2Misses: 100, + populations: 100, + keysAdded: 100, + }, + router: { + goroutinesDelta: 1, + allocBytesDelta: 1000, + heapAllocBytesDelta: 800, + residentMemoryBytesDelta: 400, + cpuSecondsDelta: 0.5, + }, + redis: { + usedMemoryBytes: 16384, + peakMemoryBytes: 32768, + commandsProcessed: 250, + keyspaceHits: 900, + keyspaceMisses: 100, + dockerCpuPercent: "4%", + dockerMemoryUsage: "16MiB / 1GiB", + }, + }, + { + scenario: "request_scoped_viewer_articles", + mode: "request_scoped_l1_disabled", + authProfile: "alice", + fixturePath: + "benchmark/fixtures/request_scoped_viewer_articles.response.json", + modePath: + "/tmp/results/run-1/request_scoped_viewer_articles/request_scoped_l1_disabled-alice", + requests: 100, + requestRate: 20, + iterationCount: 100, + iterationRate: 20, + latencyAvgMs: 40, + latencyP95Ms: 55, + httpFailureRate: 0, + graphqlErrorRate: 0, + responseMismatchRate: 0, + cache: { + l1Hits: 0, + l1Misses: 100, + l2Hits: 0, + l2Misses: 0, + populations: 0, + keysAdded: 0, + }, + router: { + goroutinesDelta: 1, + allocBytesDelta: 5000, + heapAllocBytesDelta: 4500, + residentMemoryBytesDelta: 2000, + cpuSecondsDelta: 1.5, + }, + redis: { + usedMemoryBytes: 0, + peakMemoryBytes: 0, + commandsProcessed: 0, + keyspaceHits: 0, + keyspaceMisses: 0, + dockerCpuPercent: "0%", + dockerMemoryUsage: "6MiB / 1GiB", + }, + }, + { + scenario: "request_scoped_viewer_articles", + mode: "request_scoped_default", + authProfile: "alice", + fixturePath: + "benchmark/fixtures/request_scoped_viewer_articles.response.json", + modePath: + "/tmp/results/run-1/request_scoped_viewer_articles/request_scoped_default-alice", + requests: 100, + requestRate: 40, + iterationCount: 100, + iterationRate: 40, + latencyAvgMs: 20, + latencyP95Ms: 30, + httpFailureRate: 0, + graphqlErrorRate: 0, + responseMismatchRate: 0, + cache: { + l1Hits: 60, + l1Misses: 40, + l2Hits: 0, + l2Misses: 0, + populations: 0, + keysAdded: 0, + }, + router: { + goroutinesDelta: 1, + allocBytesDelta: 2000, + heapAllocBytesDelta: 1800, + residentMemoryBytesDelta: 900, + cpuSecondsDelta: 0.8, + }, + redis: { + usedMemoryBytes: 0, + peakMemoryBytes: 0, + commandsProcessed: 0, + keyspaceHits: 0, + keyspaceMisses: 0, + dockerCpuPercent: "0%", + dockerMemoryUsage: "6MiB / 1GiB", + }, + }, + ], + }); + + assert.equal(suite.resultsRoot, "/tmp/results/run-1"); + assert.equal(suite.generatedAt, "2026-04-08T12:00:00.000Z"); + assert.equal(suite.scenarios.length, 2); + + assert.deepEqual(suite.scenarios[0], { + scenario: "article_simple", + authProfile: null, + modes: ["entity_cache_disabled", "cache_enabled"], + summaries: [ + suite.scenarios[0]?.summaries[0], + suite.scenarios[0]?.summaries[1], + ], + comparisons: [ + { + baselineMode: "entity_cache_disabled", + candidateMode: "cache_enabled", + requestRateMultiplier: 10, + latencyAvgImprovement: 20, + latencyP95Improvement: 16.666666666666668, + }, + ], + }); + + assert.deepEqual(suite.scenarios[1], { + scenario: "request_scoped_viewer_articles", + authProfile: "alice", + modes: ["request_scoped_l1_disabled", "request_scoped_default"], + summaries: [ + suite.scenarios[1]?.summaries[0], + suite.scenarios[1]?.summaries[1], + ], + comparisons: [ + { + baselineMode: "request_scoped_l1_disabled", + candidateMode: "request_scoped_default", + requestRateMultiplier: 2, + latencyAvgImprovement: 2, + latencyP95Improvement: 1.8333333333333333, + }, + ], + }); +}); + +function expectHeaders( + actual: Record, + expectedSubset: Record, +): void { + for (const [key, value] of Object.entries(expectedSubset)) { + assert.equal(actual[key], value); + } +} diff --git a/benchmark/scripts/lib.ts b/benchmark/scripts/lib.ts new file mode 100644 index 0000000000..c229e8f7bd --- /dev/null +++ b/benchmark/scripts/lib.ts @@ -0,0 +1,734 @@ +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +export type Mode = + | "cache_enabled" + | "entity_cache_disabled" + | "request_scoped_default" + | "request_scoped_l1_disabled"; + +export type AuthProfile = "alice" | "bob" | "charlie"; + +export type Scenario = { + name: string; + queryFile: string; + operationName: string; + responseFixture?: string; + responseFixtures?: Partial>; + variables: Record; + modeFamily: string; + warmupRequests: number; + headers?: Record; + authProfile?: AuthProfile; + authProfiles?: AuthProfile[]; + equivalenceModes: Mode[]; +}; + +export type Manifest = { + scenarios: Scenario[]; +}; + +export type RequestVariant = { + authProfile?: AuthProfile; + fixturePath: string; +}; + +export type K6Stage = { + duration: string; + target: number; +}; + +export type ComparableModeSummary = { + scenario: string; + mode: string; + authProfile: string | null; + fixturePath: string; + modePath: string; + requests: number; + requestRate: number; + iterationCount: number; + iterationRate: number; + latencyAvgMs: number; + latencyP95Ms: number; + httpFailureRate: number; + graphqlErrorRate: number; + responseMismatchRate: number; + cache: { + l1Hits: number; + l1Misses: number; + l2Hits: number; + l2Misses: number; + populations: number; + keysAdded: number; + }; + router: { + goroutinesDelta: number; + allocBytesDelta: number; + heapAllocBytesDelta: number; + residentMemoryBytesDelta: number | null; + cpuSecondsDelta: number | null; + }; + redis: { + usedMemoryBytes: number | null; + peakMemoryBytes: number | null; + commandsProcessed: number | null; + keyspaceHits: number | null; + keyspaceMisses: number | null; + dockerCpuPercent: string; + dockerMemoryUsage: string; + }; +}; + +export type ModeComparison = { + baselineMode: string; + candidateMode: string; + requestRateMultiplier: number | null; + latencyAvgImprovement: number | null; + latencyP95Improvement: number | null; +}; + +export type ScenarioVariantSummary = { + scenario: string; + authProfile: string | null; + modes: string[]; + summaries: ComparableModeSummary[]; + comparisons: ModeComparison[]; +}; + +export type SuiteSummary = { + generatedAt: string; + resultsRoot: string; + scenarios: ScenarioVariantSummary[]; +}; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const REPO_ROOT = path.resolve(__dirname, "..", ".."); + +export const AUTHORIZATION_BY_PROFILE: Record = { + alice: "Bearer token-alice", + bob: "Bearer token-bob", + charlie: "Bearer token-charlie", +}; + +const MODE_ORDER: Record = { + entity_cache_disabled: 0, + cache_enabled: 1, + request_scoped_l1_disabled: 2, + request_scoped_default: 3, +}; + +const COMPARISON_PAIRS: Array = [ + ["entity_cache_disabled", "cache_enabled"], + ["request_scoped_l1_disabled", "request_scoped_default"], +]; + +export function repoRoot(): string { + return REPO_ROOT; +} + +export function normalizeJson(value: unknown): unknown { + if (Array.isArray(value)) { + return value.map((item) => normalizeJson(item)); + } + + if (value && typeof value === "object") { + return Object.fromEntries( + Object.entries(value as Record) + .sort(([left], [right]) => left.localeCompare(right)) + .map(([key, item]) => [key, normalizeJson(item)]), + ); + } + + return value; +} + +export function normalizeResponseForComparison(value: unknown): unknown { + if (!value || typeof value !== "object" || Array.isArray(value)) { + return normalizeJson(value); + } + + const response = structuredClone(value as Record); + const extensions = response.extensions; + + if (extensions && typeof extensions === "object" && !Array.isArray(extensions)) { + delete (extensions as Record).trace; + + if (Object.keys(extensions as Record).length === 0) { + delete response.extensions; + } + } + + return normalizeJson(response); +} + +export function loadManifest(): Manifest { + const manifestPath = path.join( + REPO_ROOT, + "benchmark", + "scenarios", + "cache-demo.json", + ); + + return JSON.parse(fs.readFileSync(manifestPath, "utf8")) as Manifest; +} + +export function resolveScenario(name: string): Scenario { + const scenario = loadManifest().scenarios.find((item) => item.name === name); + if (!scenario) { + throw new Error(`unknown benchmark scenario: ${name}`); + } + return scenario; +} + +export function resolveScenarioQuery(scenario: Scenario): string { + return fs.readFileSync(path.join(REPO_ROOT, scenario.queryFile), "utf8"); +} + +export function resolveRequestMatrix(scenario: Scenario): RequestVariant[] { + if (scenario.responseFixtures && scenario.authProfiles?.length) { + return scenario.authProfiles.map((authProfile) => { + const fixturePath = scenario.responseFixtures?.[authProfile]; + if (!fixturePath) { + throw new Error( + `missing fixture path for ${scenario.name} auth profile ${authProfile}`, + ); + } + return { authProfile, fixturePath }; + }); + } + + if (!scenario.responseFixture) { + throw new Error(`scenario ${scenario.name} does not declare a response fixture`); + } + + return [{ authProfile: scenario.authProfile, fixturePath: scenario.responseFixture }]; +} + +export function resolveHeaders( + scenario: Scenario, + mode: Mode, + authProfile?: AuthProfile, + cacheKeyPrefix?: string, +): Record { + const headers: Record = { + "content-type": "application/json", + "X-WG-Trace": "enable_predictable_debug_timings", + ...(scenario.headers ?? {}), + }; + + if (authProfile) { + headers.Authorization = AUTHORIZATION_BY_PROFILE[authProfile]; + } + + if (cacheKeyPrefix) { + headers["X-WG-Cache-Key-Prefix"] = cacheKeyPrefix; + } + + if (mode === "entity_cache_disabled") { + headers["X-WG-Disable-Entity-Cache"] = "true"; + } + + if (mode === "request_scoped_l1_disabled") { + headers["X-WG-Disable-Entity-Cache-L1"] = "true"; + } + + return headers; +} + +export function readFixture(fixturePath: string): unknown { + return JSON.parse(fs.readFileSync(path.join(REPO_ROOT, fixturePath), "utf8")); +} + +export function buildK6Stages(input: { + vus: number; + duration: string; + rampUp: string; + rampDown: string; +}): K6Stage[] { + return [ + { duration: input.rampUp, target: input.vus }, + { duration: input.duration, target: input.vus }, + { duration: input.rampDown, target: 0 }, + ]; +} + +export function parseRedisInfoSummary(raw: string): Record { + const selectedKeys = new Set([ + "used_memory", + "used_memory_human", + "used_memory_peak", + "used_memory_peak_human", + "connected_clients", + "total_commands_processed", + "keyspace_hits", + "keyspace_misses", + ]); + const summary: Record = {}; + + for (const line of raw.split("\n")) { + if (!line || line.startsWith("#")) { + continue; + } + + const separatorIndex = line.indexOf(":"); + if (separatorIndex === -1) { + continue; + } + + const key = line.slice(0, separatorIndex); + const value = line.slice(separatorIndex + 1).trim(); + + if (key.startsWith("db")) { + summary[key] = value; + continue; + } + + if (!selectedKeys.has(key)) { + continue; + } + + const numeric = Number(value); + summary[key] = Number.isNaN(numeric) ? value : numeric; + } + + return summary; +} + +export function parseDockerStatsSummary(raw: string): Record { + const parsed = JSON.parse(raw) as Record; + + return { + CPUPerc: parsed.CPUPerc ?? "", + MemUsage: parsed.MemUsage ?? "", + NetIO: parsed.NetIO ?? "", + BlockIO: parsed.BlockIO ?? "", + PIDs: parsed.PIDs ?? "", + }; +} + +export function validateManifest(manifest: Manifest): string[] { + const errors: string[] = []; + + for (const scenario of manifest.scenarios) { + if (!fs.existsSync(path.join(REPO_ROOT, scenario.queryFile))) { + errors.push(`missing query file for ${scenario.name}: ${scenario.queryFile}`); + } + + try { + for (const variant of resolveRequestMatrix(scenario)) { + if (!fs.existsSync(path.join(REPO_ROOT, variant.fixturePath))) { + errors.push( + `missing fixture for ${scenario.name}: ${variant.fixturePath}`, + ); + } + } + } catch (error) { + errors.push( + error instanceof Error ? error.message : `invalid scenario: ${scenario.name}`, + ); + } + } + + return errors; +} + +function readMetricNumber( + metrics: Record, + metricName: string, + field: string, +): number { + const metric = metrics[metricName]; + if (!metric || typeof metric !== "object" || Array.isArray(metric)) { + return 0; + } + + const value = (metric as Record)[field]; + return typeof value === "number" ? value : 0; +} + +function readRecordNumber( + record: Record, + key: string, +): number | null { + const value = record[key]; + return typeof value === "number" ? value : null; +} + +function sumMetricValues( + metricsDeltaDocument: Record, + requiredFragments: string[], +): number { + let total = 0; + + for (const [key, value] of Object.entries(metricsDeltaDocument)) { + if (requiredFragments.every((fragment) => key.includes(fragment))) { + total += value; + } + } + + return total; +} + +function ratio(numerator: number, denominator: number): number | null { + if (denominator === 0) { + return null; + } + return numerator / denominator; +} + +export function extractComparableModeSummary(input: { + modePath: string; + summaryDocument: Record; + metricsDeltaDocument: Record; +}): ComparableModeSummary { + const k6 = + input.summaryDocument.k6 && + typeof input.summaryDocument.k6 === "object" && + !Array.isArray(input.summaryDocument.k6) + ? (input.summaryDocument.k6 as Record) + : {}; + const k6Summary = + k6.summary && typeof k6.summary === "object" && !Array.isArray(k6.summary) + ? (k6.summary as Record) + : {}; + const metrics = + k6Summary.metrics && + typeof k6Summary.metrics === "object" && + !Array.isArray(k6Summary.metrics) + ? (k6Summary.metrics as Record) + : {}; + const redis = + input.summaryDocument.redis && + typeof input.summaryDocument.redis === "object" && + !Array.isArray(input.summaryDocument.redis) + ? (input.summaryDocument.redis as Record) + : {}; + const redisInfo = + redis.infoAfter && + typeof redis.infoAfter === "object" && + !Array.isArray(redis.infoAfter) + ? (redis.infoAfter as Record) + : {}; + const dockerStats = + redis.dockerStatsAfter && + typeof redis.dockerStatsAfter === "object" && + !Array.isArray(redis.dockerStatsAfter) + ? (redis.dockerStatsAfter as Record) + : {}; + + return { + scenario: String(input.summaryDocument.scenario ?? ""), + mode: String(input.summaryDocument.mode ?? ""), + authProfile: + input.summaryDocument.authProfile === null || + typeof input.summaryDocument.authProfile === "string" + ? (input.summaryDocument.authProfile as string | null) + : null, + fixturePath: String(input.summaryDocument.fixturePath ?? ""), + modePath: input.modePath, + requests: readMetricNumber(metrics, "http_reqs", "count"), + requestRate: readMetricNumber(metrics, "http_reqs", "rate"), + iterationCount: readMetricNumber(metrics, "iterations", "count"), + iterationRate: readMetricNumber(metrics, "iterations", "rate"), + latencyAvgMs: readMetricNumber(metrics, "http_req_duration", "avg"), + latencyP95Ms: readMetricNumber(metrics, "http_req_duration", "p(95)"), + httpFailureRate: readMetricNumber(metrics, "http_req_failed", "value"), + graphqlErrorRate: readMetricNumber(metrics, "graphql_error_rate", "value"), + responseMismatchRate: readMetricNumber( + metrics, + "response_mismatch_rate", + "value", + ), + cache: { + l1Hits: sumMetricValues(input.metricsDeltaDocument, [ + "router_entity_cache_requests_stats_total", + 'cache_level="l1"', + 'type="hits"', + ]), + l1Misses: sumMetricValues(input.metricsDeltaDocument, [ + "router_entity_cache_requests_stats_total", + 'cache_level="l1"', + 'type="misses"', + ]), + l2Hits: sumMetricValues(input.metricsDeltaDocument, [ + "router_entity_cache_requests_stats_total", + 'cache_level="l2"', + 'type="hits"', + ]), + l2Misses: sumMetricValues(input.metricsDeltaDocument, [ + "router_entity_cache_requests_stats_total", + 'cache_level="l2"', + 'type="misses"', + ]), + populations: sumMetricValues(input.metricsDeltaDocument, [ + "router_entity_cache_populations_total", + ]), + keysAdded: sumMetricValues(input.metricsDeltaDocument, [ + "router_entity_cache_keys_stats_total", + 'operation="added"', + ]), + }, + router: { + goroutinesDelta: input.metricsDeltaDocument.go_goroutines ?? 0, + allocBytesDelta: input.metricsDeltaDocument.go_memstats_alloc_bytes ?? 0, + heapAllocBytesDelta: + input.metricsDeltaDocument.go_memstats_heap_alloc_bytes ?? 0, + residentMemoryBytesDelta: + input.metricsDeltaDocument.process_resident_memory_bytes ?? null, + cpuSecondsDelta: input.metricsDeltaDocument.process_cpu_seconds_total ?? null, + }, + redis: { + usedMemoryBytes: readRecordNumber(redisInfo, "used_memory"), + peakMemoryBytes: readRecordNumber(redisInfo, "used_memory_peak"), + commandsProcessed: readRecordNumber(redisInfo, "total_commands_processed"), + keyspaceHits: readRecordNumber(redisInfo, "keyspace_hits"), + keyspaceMisses: readRecordNumber(redisInfo, "keyspace_misses"), + dockerCpuPercent: + typeof dockerStats.CPUPerc === "string" ? dockerStats.CPUPerc : "", + dockerMemoryUsage: + typeof dockerStats.MemUsage === "string" ? dockerStats.MemUsage : "", + }, + }; +} + +export function buildSuiteSummary(input: { + resultsRoot: string; + generatedAt?: string; + modeSummaries: ComparableModeSummary[]; +}): SuiteSummary { + const grouped = new Map(); + + for (const modeSummary of [...input.modeSummaries].sort((left, right) => { + const scenarioCompare = left.scenario.localeCompare(right.scenario); + if (scenarioCompare !== 0) { + return scenarioCompare; + } + + const authCompare = (left.authProfile ?? "").localeCompare( + right.authProfile ?? "", + ); + if (authCompare !== 0) { + return authCompare; + } + + const leftOrder = MODE_ORDER[left.mode] ?? Number.MAX_SAFE_INTEGER; + const rightOrder = MODE_ORDER[right.mode] ?? Number.MAX_SAFE_INTEGER; + if (leftOrder !== rightOrder) { + return leftOrder - rightOrder; + } + + return left.modePath.localeCompare(right.modePath); + })) { + const key = `${modeSummary.scenario}::${modeSummary.authProfile ?? ""}`; + const existing = grouped.get(key); + if (existing) { + existing.modes.push(modeSummary.mode); + existing.summaries.push(modeSummary); + continue; + } + + grouped.set(key, { + scenario: modeSummary.scenario, + authProfile: modeSummary.authProfile, + modes: [modeSummary.mode], + summaries: [modeSummary], + comparisons: [], + }); + } + + const scenarios = [...grouped.values()]; + for (const scenario of scenarios) { + const modeLookup = new Map( + scenario.summaries.map((summary) => [summary.mode, summary]), + ); + + scenario.comparisons = COMPARISON_PAIRS.flatMap( + ([baselineMode, candidateMode]) => { + const baseline = modeLookup.get(baselineMode); + const candidate = modeLookup.get(candidateMode); + if (!baseline || !candidate) { + return []; + } + + return [ + { + baselineMode, + candidateMode, + requestRateMultiplier: ratio( + candidate.requestRate, + baseline.requestRate, + ), + latencyAvgImprovement: ratio( + baseline.latencyAvgMs, + candidate.latencyAvgMs, + ), + latencyP95Improvement: ratio( + baseline.latencyP95Ms, + candidate.latencyP95Ms, + ), + }, + ]; + }, + ); + } + + return { + generatedAt: input.generatedAt ?? new Date().toISOString(), + resultsRoot: input.resultsRoot, + scenarios, + }; +} + +function formatFactor(value: number | null): string { + if (value === null) { + return "n/a"; + } + return `${value.toFixed(2)}x`; +} + +export function renderSuiteSummaryMarkdown(summary: SuiteSummary): string { + const lines: string[] = [ + "# Cache Demo Benchmark Suite Summary", + "", + `- Generated at: ${summary.generatedAt}`, + `- Results root: ${summary.resultsRoot}`, + "", + ]; + + for (const scenario of summary.scenarios) { + lines.push( + `## ${scenario.scenario}${scenario.authProfile ? ` (${scenario.authProfile})` : ""}`, + "", + "| Mode | req/s | avg ms | p95 ms | l1 hits | l2 hits | l2 misses | populations | alloc delta | heap delta | goroutines | redis used | redis commands |", + "| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |", + ); + + for (const mode of scenario.summaries) { + lines.push( + `| ${mode.mode} | ${mode.requestRate.toFixed(2)} | ${mode.latencyAvgMs.toFixed(2)} | ${mode.latencyP95Ms.toFixed(2)} | ${mode.cache.l1Hits} | ${mode.cache.l2Hits} | ${mode.cache.l2Misses} | ${mode.cache.populations} | ${mode.router.allocBytesDelta} | ${mode.router.heapAllocBytesDelta} | ${mode.router.goroutinesDelta} | ${mode.redis.usedMemoryBytes ?? "n/a"} | ${mode.redis.commandsProcessed ?? "n/a"} |`, + ); + } + + if (scenario.comparisons.length > 0) { + lines.push("", "Comparisons:"); + for (const comparison of scenario.comparisons) { + lines.push( + `- ${comparison.candidateMode} vs ${comparison.baselineMode}: req/s ${formatFactor(comparison.requestRateMultiplier)}, avg latency ${formatFactor(comparison.latencyAvgImprovement)}, p95 latency ${formatFactor(comparison.latencyP95Improvement)}`, + ); + } + } + + lines.push(""); + } + + return `${lines.join("\n").trimEnd()}\n`; +} + +function isRetryableFetchError(error: unknown): boolean { + if (!(error instanceof TypeError)) { + return false; + } + + const code = + error && + typeof error === "object" && + "cause" in error && + error.cause && + typeof error.cause === "object" && + "code" in error.cause + ? String((error.cause as { code?: unknown }).code ?? "") + : ""; + + return code === "EPIPE" || code === "ECONNRESET" || code === "UND_ERR_SOCKET"; +} + +function isTimeoutAbortError(error: unknown): boolean { + if (!error || typeof error !== "object") { + return false; + } + + const name = (error as { name?: unknown }).name; + return name === "TimeoutError" || name === "AbortError"; +} + +async function delay(milliseconds: number): Promise { + await new Promise((resolve) => setTimeout(resolve, milliseconds)); +} + +export const FETCH_JSON_DEFAULT_TIMEOUT_MS = 30_000; + +export async function fetchJsonWithRetry(input: { + url: string; + init: RequestInit; + fetchImpl?: typeof fetch; + retries?: number; + timeoutMs?: number; +}): Promise { + const fetchImpl = input.fetchImpl ?? fetch; + const retries = input.retries ?? 1; + const timeoutMs = input.timeoutMs ?? FETCH_JSON_DEFAULT_TIMEOUT_MS; + const callerSignal = input.init.signal ?? undefined; + + for (let attempt = 0; ; attempt += 1) { + const timeoutSignal = AbortSignal.timeout(timeoutMs); + const signal = callerSignal + ? AbortSignal.any([callerSignal, timeoutSignal]) + : timeoutSignal; + + try { + const response = await fetchImpl(input.url, { ...input.init, signal }); + const body = await response.text(); + + if (!response.ok) { + throw new Error(`request failed: ${response.status} ${body}`); + } + + return JSON.parse(body); + } catch (error) { + // Caller explicitly cancelled — bubble immediately without retry. + if (callerSignal?.aborted) { + throw error; + } + + const retryable = + isRetryableFetchError(error) || isTimeoutAbortError(error); + + if (attempt >= retries || !retryable) { + throw error; + } + + await delay(100); + } + } +} + +export async function runGraphQLRequest(input: { + scenario: Scenario; + query: string; + headers: Record; + authProfile?: AuthProfile; +}): Promise { + try { + return await fetchJsonWithRetry({ + url: "http://127.0.0.1:3002/graphql", + init: { + method: "POST", + headers: { + connection: "close", + ...input.headers, + }, + body: JSON.stringify({ + operationName: input.scenario.operationName, + query: input.query, + variables: input.scenario.variables ?? {}, + }), + }, + }); + } catch (error) { + throw new Error( + `graphql request failed for ${input.scenario.name}: ${error instanceof Error ? error.message : String(error)}`, + ); + } +} diff --git a/benchmark/scripts/run_suite.test.ts b/benchmark/scripts/run_suite.test.ts new file mode 100644 index 0000000000..8ee376412e --- /dev/null +++ b/benchmark/scripts/run_suite.test.ts @@ -0,0 +1,80 @@ +import assert from "node:assert/strict"; +import test from "node:test"; + +import { parseArgs } from "./run_suite"; + +test("parseArgs returns defaults when no flags are passed", () => { + assert.deepEqual(parseArgs([]), { + scenario: undefined, + all: false, + vus: 20, + duration: "2m", + rampUp: "30s", + rampDown: "10s", + }); +}); + +test("parseArgs accepts a complete set of valid flags", () => { + assert.deepEqual( + parseArgs([ + "--scenario", "cache-demo", + "--vus", "50", + "--duration", "90s", + "--ramp-up", "10s", + "--ramp-down", "5s", + ]), + { + scenario: "cache-demo", + all: false, + vus: 50, + duration: "90s", + rampUp: "10s", + rampDown: "5s", + }, + ); +}); + +test("parseArgs rejects --vus that is not a positive integer", () => { + for (const bad of ["abc", "0", "-1", "1.5", ""]) { + assert.throws( + () => parseArgs(["--vus", bad]), + new RegExp(`--vus must be a positive integer, got "${bad}"`), + `expected --vus="${bad}" to fail`, + ); + } +}); + +test("parseArgs rejects malformed durations", () => { + for (const flag of ["--duration", "--ramp-up", "--ramp-down"]) { + assert.throws( + () => parseArgs([flag, "thirty-seconds"]), + new RegExp(`${flag} must look like 30s / 2m / 1h / 500ms, got "thirty-seconds"`), + ); + } +}); + +test("parseArgs rejects flags with no value", () => { + for (const flag of ["--scenario", "--vus", "--duration", "--ramp-up", "--ramp-down"]) { + assert.throws( + () => parseArgs([flag]), + new RegExp(`missing value for ${flag}`), + ); + // Also rejects when the next token is another flag + assert.throws( + () => parseArgs([flag, "--all"]), + new RegExp(`missing value for ${flag}`), + ); + } +}); + +test("parseArgs rejects unknown flags", () => { + assert.throws(() => parseArgs(["--bogus"]), /unknown argument: --bogus/); +}); + +test("parseArgs accepts integer-millisecond duration like 500ms", () => { + assert.equal(parseArgs(["--ramp-down", "500ms"]).rampDown, "500ms"); +}); + +test("parseArgs accepts plain integer (raw milliseconds) for duration", () => { + assert.equal(parseArgs(["--duration", "1000"]).duration, "1000"); +}); diff --git a/benchmark/scripts/run_suite.ts b/benchmark/scripts/run_suite.ts new file mode 100644 index 0000000000..3323454161 --- /dev/null +++ b/benchmark/scripts/run_suite.ts @@ -0,0 +1,576 @@ +import { execFileSync } from "node:child_process"; +import fs from "node:fs"; +import path from "node:path"; +import process from "node:process"; + +import { + buildK6Stages, + buildSuiteSummary, + extractComparableModeSummary, + normalizeResponseForComparison, + loadManifest, + parseDockerStatsSummary, + parseRedisInfoSummary, + readFixture, + renderSuiteSummaryMarkdown, + resolveHeaders, + resolveRequestMatrix, + resolveScenario, + resolveScenarioQuery, + runGraphQLRequest, + validateManifest, +} from "./lib"; + +function validate(): void { + const manifest = loadManifest(); + const errors = validateManifest(manifest); + + if (errors.length > 0) { + for (const error of errors) { + console.error(error); + } + process.exit(1); + } + + for (const scenario of manifest.scenarios) { + const fixturePaths = scenario.responseFixture + ? [scenario.responseFixture] + : Object.values(scenario.responseFixtures ?? {}); + console.log(`${scenario.name}: ${fixturePaths.join(", ")}`); + } +} + +export function parseArgs(argv: string[] = process.argv.slice(2)): { + scenario?: string; + all: boolean; + vus: number; + duration: string; + rampUp: string; + rampDown: string; +} { + const args = argv; + let scenario: string | undefined; + let all = false; + let vus = 20; + let duration = "2m"; + let rampUp = "30s"; + let rampDown = "10s"; + + const takeValue = (flag: string, idx: number): string => { + const raw = args[idx + 1]; + if (raw === undefined || raw.startsWith("--")) { + throw new Error(`missing value for ${flag}`); + } + return raw; + }; + + const parsePositiveInt = (flag: string, raw: string): number => { + const n = Number(raw); + if (!Number.isFinite(n) || !Number.isInteger(n) || n <= 0) { + throw new Error(`${flag} must be a positive integer, got "${raw}"`); + } + return n; + }; + + // Loose but enough to catch typos and missing values: "1s", "30s", "2m", "1h", + // or a plain integer millisecond count ("500"). Rejects empty strings and + // obviously malformed input like "30" with no unit followed by a letter. + const durationPattern = /^\d+(ms|s|m|h)?$/; + const parseDuration = (flag: string, raw: string): string => { + if (!durationPattern.test(raw)) { + throw new Error(`${flag} must look like 30s / 2m / 1h / 500ms, got "${raw}"`); + } + return raw; + }; + + for (let i = 0; i < args.length; i += 1) { + const arg = args[i]; + if (arg === "--all") { + all = true; + continue; + } + if (arg === "--scenario") { + scenario = takeValue(arg, i); + i += 1; + continue; + } + if (arg === "--vus") { + vus = parsePositiveInt(arg, takeValue(arg, i)); + i += 1; + continue; + } + if (arg === "--duration") { + duration = parseDuration(arg, takeValue(arg, i)); + i += 1; + continue; + } + if (arg === "--ramp-up") { + rampUp = parseDuration(arg, takeValue(arg, i)); + i += 1; + continue; + } + if (arg === "--ramp-down") { + rampDown = parseDuration(arg, takeValue(arg, i)); + i += 1; + continue; + } + throw new Error(`unknown argument: ${arg}`); + } + + return { scenario, all, vus, duration, rampUp, rampDown }; +} + +async function verifyScenarioEquivalence(scenarioName: string): Promise { + const scenario = resolveScenario(scenarioName); + const query = resolveScenarioQuery(scenario); + + for (const variant of resolveRequestMatrix(scenario)) { + const fixture = JSON.stringify( + normalizeResponseForComparison(readFixture(variant.fixturePath)), + ); + + for (const mode of scenario.equivalenceModes) { + const live = await runGraphQLRequest({ + scenario, + query, + authProfile: variant.authProfile, + headers: resolveHeaders( + scenario, + mode, + variant.authProfile, + `suite-${scenario.name}-${mode}-${Date.now()}`, + ), + }); + + if (JSON.stringify(normalizeResponseForComparison(live)) !== fixture) { + throw new Error( + `equivalence failed for ${scenario.name} mode=${mode} auth=${variant.authProfile ?? "anonymous"}`, + ); + } + } + } +} + +function metricDelta( + beforePath: string, + afterPath: string, +): Record { + const before = JSON.parse(fs.readFileSync(beforePath, "utf8")) as Record< + string, + number + >; + const after = JSON.parse(fs.readFileSync(afterPath, "utf8")) as Record< + string, + number + >; + + const delta: Record = {}; + for (const key of new Set([...Object.keys(before), ...Object.keys(after)])) { + delta[key] = (after[key] ?? 0) - (before[key] ?? 0); + } + return delta; +} + +function run(command: string, args: string[], env?: Record): void { + execFileSync(command, args, { + stdio: "inherit", + env: { + ...process.env, + ...env, + }, + }); +} + +function walkForFile(filePath: string, fileName: string, out: string[] = []): string[] { + for (const entry of fs.readdirSync(filePath, { withFileTypes: true })) { + const fullPath = path.join(filePath, entry.name); + if (entry.isDirectory()) { + walkForFile(fullPath, fileName, out); + continue; + } + + if (entry.isFile() && entry.name === fileName) { + out.push(fullPath); + } + } + + return out; +} + +function writeSuiteSummary(resultsRoot: string): void { + const modeSummaryPaths = walkForFile(resultsRoot, "summary.json").sort(); + const modeSummaries = modeSummaryPaths.map((summaryPath) => { + const modePath = path.dirname(summaryPath); + const metricsDeltaPath = path.join(modePath, "metrics-delta.json"); + + return extractComparableModeSummary({ + modePath, + summaryDocument: readJsonFile>(summaryPath), + metricsDeltaDocument: readJsonFile>(metricsDeltaPath), + }); + }); + + const suiteSummary = buildSuiteSummary({ + resultsRoot, + modeSummaries, + }); + + fs.writeFileSync( + path.join(resultsRoot, "suite-summary.json"), + `${JSON.stringify(suiteSummary, null, 2)}\n`, + "utf8", + ); + fs.writeFileSync( + path.join(resultsRoot, "suite-summary.md"), + renderSuiteSummaryMarkdown(suiteSummary), + "utf8", + ); +} + +function buildK6Payload(input: { + operationName: string; + query: string; + variables: Record; + headers: Record; + expectedBody: unknown; + stages: ReturnType; +}): string { + return JSON.stringify({ + url: "http://127.0.0.1:3002/graphql", + operationName: input.operationName, + query: input.query, + variables: input.variables, + headers: input.headers, + expectedBody: input.expectedBody, + options: { + stages: input.stages, + }, + }); +} + +async function warmupScenarioVariant(input: { + scenarioName: string; + query: string; + mode: Parameters[1]; + authProfile?: Parameters[2]; + fixturePath: string; + cachePrefix: string; + warmupRequests: number; +}): Promise { + const scenario = resolveScenario(input.scenarioName); + const expected = JSON.stringify( + normalizeResponseForComparison(readFixture(input.fixturePath)), + ); + + for (let index = 0; index < input.warmupRequests; index += 1) { + const live = await runGraphQLRequest({ + scenario, + query: input.query, + authProfile: input.authProfile, + headers: resolveHeaders( + scenario, + input.mode, + input.authProfile, + input.cachePrefix, + ), + }); + + if (JSON.stringify(normalizeResponseForComparison(live)) !== expected) { + throw new Error( + `warmup mismatch for ${scenario.name} mode=${input.mode} auth=${input.authProfile ?? "anonymous"} request=${index + 1}`, + ); + } + } +} + +function readJsonFile(filePath: string): T { + return JSON.parse(fs.readFileSync(filePath, "utf8")) as T; +} + +function createModeSummary(input: { + scenarioName: string; + mode: string; + authProfile?: string; + cachePrefix: string; + operationName: string; + fixturePath: string; + warmupRequests: number; + k6SummaryPath: string; + pprofDir: string; + stageConfig: ReturnType; + modeDir: string; +}): Record { + const redisInfoAfterPath = path.join(input.modeDir, "redis-info-after.txt"); + const redisDockerAfterPath = path.join( + input.modeDir, + "redis-docker-stats-after.json", + ); + + return { + scenario: input.scenarioName, + mode: input.mode, + authProfile: input.authProfile ?? null, + cachePrefix: input.cachePrefix, + operationName: input.operationName, + fixturePath: input.fixturePath, + warmup: { + requests: input.warmupRequests, + }, + k6: { + summaryPath: input.k6SummaryPath, + stages: input.stageConfig, + summary: readJsonFile>(input.k6SummaryPath), + }, + redis: { + container: + process.env.BENCHMARK_REDIS_CONTAINER ?? "cosmo-benchmark-redis", + port: process.env.BENCHMARK_REDIS_PORT ?? "6399", + image: process.env.BENCHMARK_REDIS_IMAGE ?? "redis:7-alpine", + infoAfter: parseRedisInfoSummary( + fs.readFileSync(redisInfoAfterPath, "utf8"), + ), + dockerStatsAfter: parseDockerStatsSummary( + fs.readFileSync(redisDockerAfterPath, "utf8"), + ), + }, + pprofDir: input.pprofDir, + }; +} + +async function runModeVariant(input: { + scenarioName: string; + mode: Parameters[1]; + authProfile?: Parameters[2]; + fixturePath: string; + scenarioRoot: string; + vus: number; + duration: string; + rampUp: string; + rampDown: string; +}): Promise { + const scenario = resolveScenario(input.scenarioName); + const query = resolveScenarioQuery(scenario); + const modeDir = path.join( + input.scenarioRoot, + input.authProfile ? `${input.mode}-${input.authProfile}` : input.mode, + ); + const pprofDir = path.join(modeDir, "pprof"); + const summaryExport = path.join(modeDir, "k6-summary.json"); + const stageConfig = buildK6Stages({ + vus: input.vus, + duration: input.duration, + rampUp: input.rampUp, + rampDown: input.rampDown, + }); + const cachePrefix = `bench-${scenario.name}-${input.mode}-${input.authProfile ?? "anonymous"}-${Date.now()}`; + const expectedBody = readFixture(input.fixturePath); + const headers = resolveHeaders( + scenario, + input.mode, + input.authProfile, + cachePrefix, + ); + + fs.mkdirSync(pprofDir, { recursive: true }); + + await warmupScenarioVariant({ + scenarioName: scenario.name, + query, + mode: input.mode, + authProfile: input.authProfile, + fixturePath: input.fixturePath, + cachePrefix, + warmupRequests: scenario.warmupRequests, + }); + + run("pnpm", [ + "dlx", + "tsx", + "benchmark/scripts/scrape_metrics.ts", + "before", + modeDir, + ]); + run("bash", ["benchmark/scripts/capture_redis_stats.sh", "before", modeDir]); + + const payload = buildK6Payload({ + operationName: scenario.operationName, + query, + variables: scenario.variables ?? {}, + headers, + expectedBody, + stages: stageConfig, + }); + + execFileSync( + "k6", + ["run", "--summary-export", summaryExport, "benchmark/k6/cache_demo.js"], + { + stdio: "inherit", + env: { + ...process.env, + BENCHMARK_PAYLOAD: payload, + }, + }, + ); + + run("pnpm", [ + "dlx", + "tsx", + "benchmark/scripts/scrape_metrics.ts", + "after", + modeDir, + ]); + run("bash", ["benchmark/scripts/capture_redis_stats.sh", "after", modeDir]); + run("bash", ["benchmark/scripts/capture_pprof.sh", pprofDir]); + + const delta = metricDelta( + path.join(modeDir, "metrics-before.json"), + path.join(modeDir, "metrics-after.json"), + ); + fs.writeFileSync( + path.join(modeDir, "metrics-delta.json"), + `${JSON.stringify(delta, null, 2)}\n`, + "utf8", + ); + fs.writeFileSync( + path.join(modeDir, "equivalence.json"), + `${JSON.stringify( + { + verified: true, + fixturePath: input.fixturePath, + mode: input.mode, + authProfile: input.authProfile ?? null, + }, + null, + 2, + )}\n`, + "utf8", + ); + fs.writeFileSync( + path.join(modeDir, "summary.json"), + `${JSON.stringify( + createModeSummary({ + scenarioName: scenario.name, + mode: input.mode, + authProfile: input.authProfile, + cachePrefix, + operationName: scenario.operationName, + fixturePath: input.fixturePath, + warmupRequests: scenario.warmupRequests, + k6SummaryPath: summaryExport, + pprofDir, + stageConfig, + modeDir, + }), + null, + 2, + )}\n`, + "utf8", + ); +} + +async function runScenarios(args: { + scenarioNames: string[]; + vus: number; + duration: string; + rampUp: string; + rampDown: string; +}): Promise { + const timestamp = new Date().toISOString().replaceAll(":", "-"); + const resultsRoot = path.join(process.cwd(), "benchmark", "results", timestamp); + console.log(`results root: ${resultsRoot}`); + + run("bash", ["benchmark/scripts/start_stack.sh"]); + + try { + run("bash", ["benchmark/scripts/wait_ready.sh"]); + + for (const scenarioName of args.scenarioNames) { + const scenario = resolveScenario(scenarioName); + const scenarioRoot = path.join(resultsRoot, scenario.name); + await verifyScenarioEquivalence(scenario.name); + + for (const variant of resolveRequestMatrix(scenario)) { + for (const mode of scenario.equivalenceModes) { + await runModeVariant({ + scenarioName: scenario.name, + mode, + authProfile: variant.authProfile, + fixturePath: variant.fixturePath, + scenarioRoot, + vus: args.vus, + duration: args.duration, + rampUp: args.rampUp, + rampDown: args.rampDown, + }); + } + } + } + + writeSuiteSummary(resultsRoot); + } finally { + run("bash", ["benchmark/scripts/stop_stack.sh"]); + } +} + +// Only run the CLI entry when this module is executed directly. Importing it +// (e.g. from run_suite.test.ts) must not parse process.argv or exit. +function isMainModule(): boolean { + const entry = process.argv[1]; + if (!entry) return false; + // Compare resolved paths so symlinks / "tsx ./scripts/run_suite.ts" / + // "tsx scripts/run_suite.ts" all match. + try { + return path.resolve(entry) === path.resolve(__filename); + } catch { + // __filename is undefined under ESM; fall back to URL comparison. + return import.meta.url === new URL(entry, "file:").href; + } +} + +if (isMainModule()) { + const subcommand = process.argv[2]; + + if (subcommand === "validate") { + validate(); + } else if (subcommand === "summarize") { + const resultsRoot = process.argv[3]; + if (!resultsRoot) { + console.error( + "usage: pnpm dlx tsx benchmark/scripts/run_suite.ts summarize ", + ); + process.exit(1); + } + writeSuiteSummary(path.resolve(resultsRoot)); + } else { + let args: ReturnType; + try { + args = parseArgs(); + } catch (error) { + console.error(error instanceof Error ? error.message : String(error)); + console.error( + "usage: pnpm dlx tsx benchmark/scripts/run_suite.ts validate | --all | --scenario [--vus ] [--duration ] [--ramp-up ] [--ramp-down ]", + ); + process.exit(1); + } + if (!args.all && !args.scenario) { + console.error( + "usage: pnpm dlx tsx benchmark/scripts/run_suite.ts validate | --all | --scenario [--vus ] [--duration ] [--ramp-up ] [--ramp-down ]", + ); + process.exit(1); + } + + runScenarios({ + scenarioNames: args.all + ? loadManifest().scenarios.map((scenario) => scenario.name) + : [args.scenario as string], + vus: args.vus, + duration: args.duration, + rampUp: args.rampUp, + rampDown: args.rampDown, + }).catch((error: unknown) => { + console.error(error instanceof Error ? error.message : String(error)); + process.exit(1); + }); + } +} diff --git a/benchmark/scripts/scrape_metrics.ts b/benchmark/scripts/scrape_metrics.ts new file mode 100644 index 0000000000..b39a1e7a5b --- /dev/null +++ b/benchmark/scripts/scrape_metrics.ts @@ -0,0 +1,75 @@ +import fs from "node:fs"; +import path from "node:path"; + +const ALLOWLIST = [ + "go_memstats_", + "go_gc_duration_seconds", + "go_goroutines", + "process_cpu_seconds_total", + "process_resident_memory_bytes", + "router_entity_cache_requests_stats_total", + "router_entity_cache_keys_stats_total", + "router_entity_cache_populations_total", + "router_entity_cache_latency", + "router_graphql_operation_planning_time", +]; + +function keepMetric(line: string): boolean { + return ALLOWLIST.some((prefix) => line.startsWith(prefix)); +} + +function parseMetrics(raw: string): Record { + const parsed: Record = {}; + + for (const line of raw.split("\n")) { + if (!line || line.startsWith("#") || !keepMetric(line)) { + continue; + } + + const match = line.match(/^([^{\s]+)(\{[^}]*\})?\s+([0-9.eE+-]+)$/); + if (!match) { + continue; + } + + const [, name, labels = "", value] = match; + const numeric = Number(value); + if (!Number.isNaN(numeric)) { + parsed[`${name}${labels}`] = numeric; + } + } + + return parsed; +} + +async function main(): Promise { + const phase = process.argv[2]; + const outputDir = process.argv[3]; + + if (!phase || !outputDir) { + throw new Error( + "usage: pnpm dlx tsx benchmark/scripts/scrape_metrics.ts ", + ); + } + + const response = await fetch("http://127.0.0.1:8088/metrics", { + signal: AbortSignal.timeout(15_000), + }); + if (!response.ok) { + throw new Error(`failed to fetch router metrics: ${response.status}`); + } + + const raw = await response.text(); + const parsed = parseMetrics(raw); + fs.mkdirSync(outputDir, { recursive: true }); + fs.writeFileSync(path.join(outputDir, `metrics-${phase}.prom`), raw, "utf8"); + fs.writeFileSync( + path.join(outputDir, `metrics-${phase}.json`), + `${JSON.stringify(parsed, null, 2)}\n`, + "utf8", + ); +} + +main().catch((error: unknown) => { + console.error(error instanceof Error ? error.message : String(error)); + process.exit(1); +}); diff --git a/benchmark/scripts/start_redis.sh b/benchmark/scripts/start_redis.sh new file mode 100755 index 0000000000..3ab9b70732 --- /dev/null +++ b/benchmark/scripts/start_redis.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT_DIR="$(cd "${SCRIPT_DIR}/../.." && pwd)" + +REDIS_PORT="${BENCHMARK_REDIS_PORT:-6399}" +REDIS_CONTAINER="${BENCHMARK_REDIS_CONTAINER:-cosmo-benchmark-redis}" +REDIS_IMAGE="${BENCHMARK_REDIS_IMAGE:-redis:7-alpine}" +RUN_DIR="${BENCHMARK_RUN_DIR:-${ROOT_DIR}/benchmark/.run}" + +mkdir -p "${RUN_DIR}" + +if ! command -v docker >/dev/null 2>&1; then + echo "docker is required to run benchmark Redis" >&2 + exit 1 +fi + +docker rm -f "${REDIS_CONTAINER}" >/dev/null 2>&1 || true + +if lsof -iTCP:"${REDIS_PORT}" -sTCP:LISTEN -n -P >/dev/null 2>&1; then + echo "benchmark Redis port ${REDIS_PORT} is already in use" >&2 + exit 1 +fi + +docker run -d \ + --name "${REDIS_CONTAINER}" \ + -p "${REDIS_PORT}:6379" \ + "${REDIS_IMAGE}" \ + redis-server --save "" --appendonly no >/dev/null + +for _ in $(seq 1 30); do + if docker exec "${REDIS_CONTAINER}" redis-cli ping >/dev/null 2>&1; then + { + echo "BENCHMARK_REDIS_CONTAINER=${REDIS_CONTAINER}" + echo "BENCHMARK_REDIS_PORT=${REDIS_PORT}" + echo "BENCHMARK_REDIS_IMAGE=${REDIS_IMAGE}" + } > "${RUN_DIR}/redis.env" + exit 0 + fi + sleep 1 +done + +echo "benchmark Redis failed to become ready" >&2 +docker logs "${REDIS_CONTAINER}" >&2 || true +exit 1 diff --git a/benchmark/scripts/start_stack.sh b/benchmark/scripts/start_stack.sh new file mode 100755 index 0000000000..775a1e69d5 --- /dev/null +++ b/benchmark/scripts/start_stack.sh @@ -0,0 +1,86 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT_DIR="$(cd "${SCRIPT_DIR}/../.." && pwd)" +RUN_DIR="${BENCHMARK_RUN_DIR:-${ROOT_DIR}/benchmark/.run}" + +mkdir -p "${RUN_DIR}" + +spawn_detached() { + local log_file="$1" + local pid_file="$2" + local work_dir="$3" + shift 3 + + python3 - "$log_file" "$pid_file" "$work_dir" "$@" <<'PY' +import os +import subprocess +import sys + +log_path, pid_path, work_dir, *cmd = sys.argv[1:] + +with open(log_path, "ab") as log_file: + proc = subprocess.Popen( + cmd, + cwd=work_dir, + stdin=subprocess.DEVNULL, + stdout=log_file, + stderr=log_file, + start_new_session=True, + ) + +with open(pid_path, "w", encoding="utf-8") as pid_file: + pid_file.write(f"{proc.pid}\n") +PY +} + +assert_port_free() { + local port="$1" + if lsof -iTCP:"${port}" -sTCP:LISTEN -n -P >/dev/null 2>&1; then + echo "required benchmark port ${port} is already in use" >&2 + exit 1 + fi +} + +assert_port_free 3002 +assert_port_free 4012 +assert_port_free 4013 +assert_port_free 4014 +assert_port_free 6060 +assert_port_free 8088 +assert_port_free 6399 + +cd "${ROOT_DIR}" +make demo-compose + +bash "${SCRIPT_DIR}/start_redis.sh" + +( + cd "${ROOT_DIR}/demo" + env -u GOROOT go build -o "${RUN_DIR}/cache-demo.bin" ./cmd/cache-demo +) + +( + cd "${ROOT_DIR}/router" + env -u GOROOT go build -o "${RUN_DIR}/router.bin" ./cmd/router +) + +spawn_detached \ + "${RUN_DIR}/cache-demo.log" \ + "${RUN_DIR}/cache-demo.pid" \ + "${ROOT_DIR}/demo" \ + "${RUN_DIR}/cache-demo.bin" + +spawn_detached \ + "${RUN_DIR}/router.log" \ + "${RUN_DIR}/router.pid" \ + "${ROOT_DIR}/router" \ + env ENGINE_ENABLE_SINGLE_FLIGHT=false \ + PROMETHEUS_ENABLED=true \ + PROMETHEUS_GRAPHQL_CACHE=true \ + ENGINE_DEBUG_ENABLE_CACHE_RESPONSE_HEADERS=true \ + TRACING_ENABLED=false \ + GOGC=200 \ + GOMEMLIMIT=4GiB \ + "${RUN_DIR}/router.bin" --config ../benchmark/router-cache.redis.yaml --pprof-addr :6060 diff --git a/benchmark/scripts/stop_redis.sh b/benchmark/scripts/stop_redis.sh new file mode 100755 index 0000000000..ad46edd818 --- /dev/null +++ b/benchmark/scripts/stop_redis.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -euo pipefail + +REDIS_CONTAINER="${BENCHMARK_REDIS_CONTAINER:-cosmo-benchmark-redis}" + +if ! command -v docker >/dev/null 2>&1; then + echo "docker is required to stop benchmark Redis" >&2 + exit 1 +fi + +docker rm -f "${REDIS_CONTAINER}" >/dev/null 2>&1 || true diff --git a/benchmark/scripts/stop_stack.sh b/benchmark/scripts/stop_stack.sh new file mode 100755 index 0000000000..58aa6fe1ac --- /dev/null +++ b/benchmark/scripts/stop_stack.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT_DIR="$(cd "${SCRIPT_DIR}/../.." && pwd)" +RUN_DIR="${BENCHMARK_RUN_DIR:-${ROOT_DIR}/benchmark/.run}" + +stop_pid_file() { + local pid_file="$1" + if [[ ! -f "${pid_file}" ]]; then + return 0 + fi + local pid + pid="$(cat "${pid_file}")" + if kill -0 "${pid}" >/dev/null 2>&1; then + # spawn_detached uses start_new_session=True, so the PID is not our child + # and `wait` returns immediately. Poll with kill -0 until the process is + # gone; after 5 s escalate to SIGKILL so a hung process can't orphan us. + kill "${pid}" >/dev/null 2>&1 || true + for _ in {1..20}; do + kill -0 "${pid}" >/dev/null 2>&1 || break + sleep 0.25 + done + if kill -0 "${pid}" >/dev/null 2>&1; then + kill -9 "${pid}" >/dev/null 2>&1 || true + sleep 0.25 + fi + fi + rm -f "${pid_file}" +} + +stop_pid_file "${RUN_DIR}/router.pid" +stop_pid_file "${RUN_DIR}/cache-demo.pid" + +bash "${SCRIPT_DIR}/stop_redis.sh" diff --git a/benchmark/scripts/verify_equivalence.ts b/benchmark/scripts/verify_equivalence.ts new file mode 100644 index 0000000000..798a0dbcb7 --- /dev/null +++ b/benchmark/scripts/verify_equivalence.ts @@ -0,0 +1,61 @@ +import process from "node:process"; + +import { + normalizeResponseForComparison, + readFixture, + resolveHeaders, + resolveRequestMatrix, + resolveScenario, + resolveScenarioQuery, + runGraphQLRequest, + type Mode, +} from "./lib"; + +async function main(): Promise { + const scenarioName = process.argv[2]; + + if (!scenarioName) { + throw new Error("usage: pnpm dlx tsx benchmark/scripts/verify_equivalence.ts "); + } + + const scenario = resolveScenario(scenarioName); + const query = resolveScenarioQuery(scenario); + + for (const variant of resolveRequestMatrix(scenario)) { + const fixture = normalizeResponseForComparison(readFixture(variant.fixturePath)); + + for (const mode of scenario.equivalenceModes as Mode[]) { + const live = normalizeResponseForComparison( + await runGraphQLRequest({ + scenario, + query, + authProfile: variant.authProfile, + headers: resolveHeaders( + scenario, + mode, + variant.authProfile, + `eq-${scenario.name}-${mode}-${Date.now()}`, + ), + }), + ); + + const expected = JSON.stringify(fixture); + const actual = JSON.stringify(live); + + if (expected !== actual) { + throw new Error( + `fixture mismatch for scenario=${scenario.name} auth=${variant.authProfile ?? "anonymous"} mode=${mode}`, + ); + } + + console.log( + `verified scenario=${scenario.name} auth=${variant.authProfile ?? "anonymous"} mode=${mode}`, + ); + } + } +} + +main().catch((error: unknown) => { + console.error(error instanceof Error ? error.message : String(error)); + process.exit(1); +}); diff --git a/benchmark/scripts/wait_ready.sh b/benchmark/scripts/wait_ready.sh new file mode 100755 index 0000000000..c56abf2383 --- /dev/null +++ b/benchmark/scripts/wait_ready.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -euo pipefail + +REDIS_CONTAINER="${BENCHMARK_REDIS_CONTAINER:-cosmo-benchmark-redis}" +CURL_CONNECT_TIMEOUT="${CURL_CONNECT_TIMEOUT:-1}" +CURL_MAX_TIME="${CURL_MAX_TIME:-2}" +REDIS_TIMEOUT="${REDIS_TIMEOUT:-2}" + +probe() { + curl -fsS --connect-timeout "${CURL_CONNECT_TIMEOUT}" --max-time "${CURL_MAX_TIME}" "$1" >/dev/null +} + +check_ready() { + timeout "${REDIS_TIMEOUT}" docker exec "${REDIS_CONTAINER}" redis-cli ping | rg -q '^PONG$' && + probe http://127.0.0.1:8088/metrics && + probe http://127.0.0.1:6060/debug/pprof/heap && + probe http://127.0.0.1:3002/ && + probe http://127.0.0.1:4012/ && + probe http://127.0.0.1:4013/ && + probe http://127.0.0.1:4014/ +} + +for _ in $(seq 1 60); do + if check_ready; then + exit 0 + fi + sleep 1 +done + +echo "benchmark stack failed readiness checks" >&2 +exit 1 diff --git a/cli/cachegraph-cachedemo/cosmo-composition.yaml b/cli/cachegraph-cachedemo/cosmo-composition.yaml new file mode 100644 index 0000000000..b85cafdfa2 --- /dev/null +++ b/cli/cachegraph-cachedemo/cosmo-composition.yaml @@ -0,0 +1,14 @@ +version: 1 +subgraphs: + - name: cachegraph + routing_url: http://localhost:4012/graphql + schema: + file: ./subgraphs/cachegraph.graphql + - name: cachegraph-ext + routing_url: http://localhost:4013/graphql + schema: + file: ./subgraphs/cachegraph-ext.graphql + - name: viewer + routing_url: http://localhost:4014/graphql + schema: + file: ./subgraphs/viewer.graphql diff --git a/cli/cachegraph-cachedemo/subgraphs/cachegraph-ext.graphql b/cli/cachegraph-cachedemo/subgraphs/cachegraph-ext.graphql new file mode 100644 index 0000000000..ee734f0c63 --- /dev/null +++ b/cli/cachegraph-cachedemo/subgraphs/cachegraph-ext.graphql @@ -0,0 +1,34 @@ +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key", "@external", "@requires"] + ) + +directive @openfed__entityCache( + maxAge: Int! + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT + +type Article @key(fields: "id") @openfed__entityCache(maxAge: 90) { + id: ID! + currentViewer: Viewer @external + viewCount: Int! + rating: Float! + reviewSummary: String! + relatedArticles: [Article!]! + personalizedRecommendation: String! @requires(fields: "currentViewer { id name }") +} + +type Viewer @key(fields: "id") { + id: ID! + name: String! @external +} + +"""Extends Catalog with description from a second subgraph (for partial cache load testing)""" +type Catalog @key(fields: "id") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) { + id: ID! + description: String! + lastUpdated: String! +} diff --git a/cli/cachegraph-cachedemo/subgraphs/cachegraph.graphql b/cli/cachegraph-cachedemo/subgraphs/cachegraph.graphql new file mode 100644 index 0000000000..c75cd1b445 --- /dev/null +++ b/cli/cachegraph-cachedemo/subgraphs/cachegraph.graphql @@ -0,0 +1,137 @@ +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key"] + ) + +directive @openfed__entityCache( + maxAge: Int! + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT + +directive @openfed__queryCache( + maxAge: Int! + includeHeaders: Boolean = false + shadowMode: Boolean = false +) on FIELD_DEFINITION + +directive @openfed__cacheInvalidate on FIELD_DEFINITION + +directive @openfed__cachePopulate(maxAge: Int) on FIELD_DEFINITION + +directive @openfed__is(fields: String!) on ARGUMENT_DEFINITION + +type Query { + """Simple key lookup""" + article(id: ID!): Article @openfed__queryCache(maxAge: 120) + """List query""" + articles: [Article!]! @openfed__queryCache(maxAge: 120) + """Batch lookup with @openfed__is""" + articlesByIds(ids: [ID!]! @openfed__is(fields: "id")): [Article!]! @openfed__queryCache(maxAge: 120) + """Argument remapping via @openfed__is""" + articleBySlug(slug: ID! @openfed__is(fields: "id")): Article @openfed__queryCache(maxAge: 120) + + """Composite key lookup via input object with @openfed__is""" + listing(key: ListingKey! @openfed__is(fields: "sellerId sku")): Listing @openfed__queryCache(maxAge: 60) + """List of all listings""" + listings: [Listing!]! @openfed__queryCache(maxAge: 60) + + """Nested key lookup with @openfed__is and input object""" + venue(location: VenueLocationKey! @openfed__is(fields: "address { id }")): Venue @openfed__queryCache(maxAge: 180) + """List of all venues""" + venues: [Venue!]! @openfed__queryCache(maxAge: 180) + + """Per-user profile (cache varies by Authorization header)""" + userProfile(id: ID!): UserProfile @openfed__queryCache(maxAge: 60, includeHeaders: true) + + """Single catalog entry""" + catalog(id: ID!): Catalog @openfed__queryCache(maxAge: 120) + """All catalog entries (for partial cache load testing)""" + catalogs: [Catalog!]! @openfed__queryCache(maxAge: 120) + + """Single metric (shadow mode - always fetches from subgraph, compares with cache)""" + metric(id: ID!): Metric @openfed__queryCache(maxAge: 300, shadowMode: true) +} + +type Mutation { + updateArticle(id: ID!, title: String!): Article @openfed__cacheInvalidate + createArticle(title: String!, body: String!, authorName: String!): Article! @openfed__cachePopulate(maxAge: 30) + deleteListing(key: ListingKey!): Listing @openfed__cacheInvalidate +} + +"""Per-user caching: includeHeaders makes the cache key include a hash of forwarded headers (e.g. Authorization)""" +type UserProfile @key(fields: "id") @openfed__entityCache(maxAge: 60, includeHeaders: true) { + id: ID! + username: String! + email: String! + role: String! +} + +"""Partial cache load: when some entities are cached and others aren't, only the missing ones are fetched""" +type Catalog @key(fields: "id") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) { + id: ID! + name: String! + category: String! + itemCount: Int! +} + +"""Shadow mode: always fetches from subgraph but compares with cache for staleness detection""" +type Metric @key(fields: "id") @openfed__entityCache(maxAge: 300, shadowMode: true) { + id: ID! + name: String! + value: Float! + unit: String! +} + +input ListingKey { + sellerId: ID! + sku: String! +} + +input VenueLocationKey { + address: VenueAddressKey! +} + +input VenueAddressKey { + id: ID! +} + +interface Personalized @key(fields: "id") { + id: ID! +} + +type Viewer @key(fields: "id") { + id: ID! + recommendedArticles: [Article!]! +} + +type Article implements Personalized @key(fields: "id") @openfed__entityCache(maxAge: 120) { + id: ID! + title: String! + body: String! + authorName: String! + publishedAt: String! + tags: [String!]! +} + +type Listing @key(fields: "sellerId sku") @openfed__entityCache(maxAge: 60) { + sellerId: ID! + sku: String! + title: String! + price: Float! + currency: String! + inStock: Boolean! +} + +type Address { + id: ID! +} + +type Venue @key(fields: "address { id }") @openfed__entityCache(maxAge: 180) { + address: Address! + name: String! + capacity: Int! + city: String! +} diff --git a/cli/cachegraph-cachedemo/subgraphs/viewer.graphql b/cli/cachegraph-cachedemo/subgraphs/viewer.graphql new file mode 100644 index 0000000000..1f41af7e2f --- /dev/null +++ b/cli/cachegraph-cachedemo/subgraphs/viewer.graphql @@ -0,0 +1,26 @@ +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key", "@interfaceObject", "@inaccessible"] + ) + +directive @openfed__requestScoped(key: String!) on FIELD_DEFINITION + +# Symmetric @openfed__requestScoped: both Query.currentViewer and Personalized.currentViewer +# declare key: "currentViewer". Their L1 cache entry is "viewer.currentViewer". +# Whichever is resolved first populates L1; subsequent fields with the same key +# inject from L1 and skip the fetch. +type Personalized @key(fields: "id") @interfaceObject { + id: ID! + currentViewer: Viewer @inaccessible @openfed__requestScoped(key: "currentViewer") +} + +type Viewer @key(fields: "id") { + id: ID! + name: String! + email: String! +} + +type Query { + currentViewer: Viewer @openfed__requestScoped(key: "currentViewer") +} diff --git a/cli/cachegraph-cachedemo/supergraph/cosmoClientSchema.graphql b/cli/cachegraph-cachedemo/supergraph/cosmoClientSchema.graphql new file mode 100644 index 0000000000..b84ab4f033 --- /dev/null +++ b/cli/cachegraph-cachedemo/supergraph/cosmoClientSchema.graphql @@ -0,0 +1,131 @@ +schema { + query: Query + mutation: Mutation +} + +type Query { + """Simple key lookup""" + article(id: ID!): Article + """List query""" + articles: [Article!]! + """Batch lookup with @openfed__is""" + articlesByIds(ids: [ID!]!): [Article!]! + """Argument remapping via @openfed__is""" + articleBySlug(slug: ID!): Article + """Composite key lookup via input object with @openfed__is""" + listing(key: ListingKey!): Listing + """List of all listings""" + listings: [Listing!]! + """Nested key lookup with @openfed__is and input object""" + venue(location: VenueLocationKey!): Venue + """List of all venues""" + venues: [Venue!]! + """Per-user profile (cache varies by Authorization header)""" + userProfile(id: ID!): UserProfile + """Single catalog entry""" + catalog(id: ID!): Catalog + """All catalog entries (for partial cache load testing)""" + catalogs: [Catalog!]! + """ + Single metric (shadow mode - always fetches from subgraph, compares with cache) + """ + metric(id: ID!): Metric + currentViewer: Viewer +} + +type Mutation { + updateArticle(id: ID!, title: String!): Article + createArticle(title: String!, body: String!, authorName: String!): Article! + deleteListing(key: ListingKey!): Listing +} + +""" +Per-user caching: includeHeaders makes the cache key include a hash of forwarded headers (e.g. Authorization) +""" +type UserProfile { + id: ID! + username: String! + email: String! + role: String! +} + +""" +Partial cache load: when some entities are cached and others aren't, only the missing ones are fetched +""" +type Catalog { + id: ID! + name: String! + category: String! + itemCount: Int! + description: String! + lastUpdated: String! +} + +""" +Shadow mode: always fetches from subgraph but compares with cache for staleness detection +""" +type Metric { + id: ID! + name: String! + value: Float! + unit: String! +} + +input ListingKey { + sellerId: ID! + sku: String! +} + +input VenueLocationKey { + address: VenueAddressKey! +} + +input VenueAddressKey { + id: ID! +} + +interface Personalized { + id: ID! +} + +type Viewer { + id: ID! + recommendedArticles: [Article!]! + name: String! + email: String! +} + +type Listing { + sellerId: ID! + sku: String! + title: String! + price: Float! + currency: String! + inStock: Boolean! +} + +type Address { + id: ID! +} + +type Venue { + address: Address! + name: String! + capacity: Int! + city: String! +} + +type Article implements Personalized { + id: ID! + title: String! + body: String! + authorName: String! + publishedAt: String! + tags: [String!]! + currentViewer: Viewer + viewCount: Int! + rating: Float! + reviewSummary: String! + relatedArticles: [Article!]! + personalizedRecommendation: String! +} \ No newline at end of file diff --git a/cli/cachegraph-cachedemo/supergraph/cosmoConfig.json b/cli/cachegraph-cachedemo/supergraph/cosmoConfig.json new file mode 100644 index 0000000000..e748ed263a --- /dev/null +++ b/cli/cachegraph-cachedemo/supergraph/cosmoConfig.json @@ -0,0 +1 @@ +{"engineConfig":{"defaultFlushInterval":"500","datasourceConfigurations":[{"kind":"GRAPHQL","rootNodes":[{"typeName":"Query","fieldNames":["article","articles","articlesByIds","articleBySlug","listing","listings","venue","venues","userProfile","catalog","catalogs","metric"]},{"typeName":"Mutation","fieldNames":["updateArticle","createArticle","deleteListing"]},{"typeName":"UserProfile","fieldNames":["id","username","email","role"]},{"typeName":"Catalog","fieldNames":["id","name","category","itemCount"]},{"typeName":"Metric","fieldNames":["id","name","value","unit"]},{"typeName":"Personalized","fieldNames":["id"]},{"typeName":"Viewer","fieldNames":["id","recommendedArticles"]},{"typeName":"Article","fieldNames":["id","title","body","authorName","publishedAt","tags"]},{"typeName":"Listing","fieldNames":["sellerId","sku","title","price","currency","inStock"]},{"typeName":"Venue","fieldNames":["address","name","capacity","city"]}],"childNodes":[{"typeName":"Address","fieldNames":["id"]}],"overrideFieldPathFromAlias":true,"customGraphql":{"fetch":{"url":{"staticVariableContent":"http://localhost:4012/graphql"},"method":"POST","body":{},"baseUrl":{},"path":{}},"subscription":{"enabled":true,"url":{"staticVariableContent":"http://localhost:4012/graphql"},"protocol":"GRAPHQL_SUBSCRIPTION_PROTOCOL_WS","websocketSubprotocol":"GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO"},"federation":{"enabled":true,"serviceSdl":"extend schema\n @link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\"@key\"]\n )\n\ndirective @openfed__entityCache(\n maxAge: Int!\n includeHeaders: Boolean = false\n partialCacheLoad: Boolean = false\n shadowMode: Boolean = false\n) on OBJECT\n\ndirective @openfed__queryCache(\n maxAge: Int!\n includeHeaders: Boolean = false\n shadowMode: Boolean = false\n) on FIELD_DEFINITION\n\ndirective @openfed__cacheInvalidate on FIELD_DEFINITION\n\ndirective @openfed__cachePopulate(maxAge: Int) on FIELD_DEFINITION\n\ndirective @openfed__is(fields: String!) on ARGUMENT_DEFINITION\n\ntype Query {\n \"\"\"Simple key lookup\"\"\"\n article(id: ID!): Article @openfed__queryCache(maxAge: 120)\n \"\"\"List query\"\"\"\n articles: [Article!]! @openfed__queryCache(maxAge: 120)\n \"\"\"Batch lookup with @openfed__is\"\"\"\n articlesByIds(ids: [ID!]! @openfed__is(fields: \"id\")): [Article!]! @openfed__queryCache(maxAge: 120)\n \"\"\"Argument remapping via @openfed__is\"\"\"\n articleBySlug(slug: ID! @openfed__is(fields: \"id\")): Article @openfed__queryCache(maxAge: 120)\n\n \"\"\"Composite key lookup via input object with @openfed__is\"\"\"\n listing(key: ListingKey! @openfed__is(fields: \"sellerId sku\")): Listing @openfed__queryCache(maxAge: 60)\n \"\"\"List of all listings\"\"\"\n listings: [Listing!]! @openfed__queryCache(maxAge: 60)\n\n \"\"\"Nested key lookup with @openfed__is and input object\"\"\"\n venue(location: VenueLocationKey! @openfed__is(fields: \"address { id }\")): Venue @openfed__queryCache(maxAge: 180)\n \"\"\"List of all venues\"\"\"\n venues: [Venue!]! @openfed__queryCache(maxAge: 180)\n\n \"\"\"Per-user profile (cache varies by Authorization header)\"\"\"\n userProfile(id: ID!): UserProfile @openfed__queryCache(maxAge: 60, includeHeaders: true)\n\n \"\"\"Single catalog entry\"\"\"\n catalog(id: ID!): Catalog @openfed__queryCache(maxAge: 120)\n \"\"\"All catalog entries (for partial cache load testing)\"\"\"\n catalogs: [Catalog!]! @openfed__queryCache(maxAge: 120)\n\n \"\"\"Single metric (shadow mode - always fetches from subgraph, compares with cache)\"\"\"\n metric(id: ID!): Metric @openfed__queryCache(maxAge: 300, shadowMode: true)\n}\n\ntype Mutation {\n updateArticle(id: ID!, title: String!): Article @openfed__cacheInvalidate\n createArticle(title: String!, body: String!, authorName: String!): Article! @openfed__cachePopulate(maxAge: 30)\n deleteListing(key: ListingKey!): Listing @openfed__cacheInvalidate\n}\n\n\"\"\"Per-user caching: includeHeaders makes the cache key include a hash of forwarded headers (e.g. Authorization)\"\"\"\ntype UserProfile @key(fields: \"id\") @openfed__entityCache(maxAge: 60, includeHeaders: true) {\n id: ID!\n username: String!\n email: String!\n role: String!\n}\n\n\"\"\"Partial cache load: when some entities are cached and others aren't, only the missing ones are fetched\"\"\"\ntype Catalog @key(fields: \"id\") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) {\n id: ID!\n name: String!\n category: String!\n itemCount: Int!\n}\n\n\"\"\"Shadow mode: always fetches from subgraph but compares with cache for staleness detection\"\"\"\ntype Metric @key(fields: \"id\") @openfed__entityCache(maxAge: 300, shadowMode: true) {\n id: ID!\n name: String!\n value: Float!\n unit: String!\n}\n\ninput ListingKey {\n sellerId: ID!\n sku: String!\n}\n\ninput VenueLocationKey {\n address: VenueAddressKey!\n}\n\ninput VenueAddressKey {\n id: ID!\n}\n\ninterface Personalized @key(fields: \"id\") {\n id: ID!\n}\n\ntype Viewer @key(fields: \"id\") {\n id: ID!\n recommendedArticles: [Article!]!\n}\n\ntype Article implements Personalized @key(fields: \"id\") @openfed__entityCache(maxAge: 120) {\n id: ID!\n title: String!\n body: String!\n authorName: String!\n publishedAt: String!\n tags: [String!]!\n}\n\ntype Listing @key(fields: \"sellerId sku\") @openfed__entityCache(maxAge: 60) {\n sellerId: ID!\n sku: String!\n title: String!\n price: Float!\n currency: String!\n inStock: Boolean!\n}\n\ntype Address {\n id: ID!\n}\n\ntype Venue @key(fields: \"address { id }\") @openfed__entityCache(maxAge: 180) {\n address: Address!\n name: String!\n capacity: Int!\n city: String!\n}\n"},"upstreamSchema":{"key":"48ffcc2db438392c0d3e51da4cfb72aa41f405b7"}},"requestTimeoutSeconds":"10","id":"28394922-9469-4c42-9d29-c08b184159c2","keys":[{"typeName":"UserProfile","selectionSet":"id"},{"typeName":"Catalog","selectionSet":"id"},{"typeName":"Metric","selectionSet":"id"},{"typeName":"Personalized","selectionSet":"id"},{"typeName":"Viewer","selectionSet":"id"},{"typeName":"Article","selectionSet":"id"},{"typeName":"Listing","selectionSet":"sellerId sku"},{"typeName":"Venue","selectionSet":"address { id }"}],"entityInterfaces":[{"interfaceTypeName":"Personalized","concreteTypeNames":["Article"]}],"entityCacheConfigurations":[{"typeName":"UserProfile","maxAgeSeconds":"60","includeHeaders":true},{"typeName":"Catalog","maxAgeSeconds":"120","partialCacheLoad":true},{"typeName":"Metric","maxAgeSeconds":"300","shadowMode":true},{"typeName":"Article","maxAgeSeconds":"120"},{"typeName":"Listing","maxAgeSeconds":"60"},{"typeName":"Venue","maxAgeSeconds":"180"}],"rootFieldCacheConfigurations":[{"fieldName":"article","maxAgeSeconds":"120","entityTypeName":"Article","entityKeyMappings":[{"entityTypeName":"Article","fieldMappings":[{"entityKeyField":"id","argumentPath":["id"]}]}]},{"fieldName":"articles","maxAgeSeconds":"120","entityTypeName":"Article"},{"fieldName":"articlesByIds","maxAgeSeconds":"120","entityTypeName":"Article","entityKeyMappings":[{"entityTypeName":"Article","fieldMappings":[{"entityKeyField":"id","argumentPath":["ids"],"isBatch":true}]}]},{"fieldName":"articleBySlug","maxAgeSeconds":"120","entityTypeName":"Article","entityKeyMappings":[{"entityTypeName":"Article","fieldMappings":[{"entityKeyField":"id","argumentPath":["slug"]}]}]},{"fieldName":"listing","maxAgeSeconds":"60","entityTypeName":"Listing","entityKeyMappings":[{"entityTypeName":"Listing","fieldMappings":[{"entityKeyField":"sellerId","argumentPath":["key","sellerId"]},{"entityKeyField":"sku","argumentPath":["key","sku"]}]}]},{"fieldName":"listings","maxAgeSeconds":"60","entityTypeName":"Listing"},{"fieldName":"venue","maxAgeSeconds":"180","entityTypeName":"Venue","entityKeyMappings":[{"entityTypeName":"Venue","fieldMappings":[{"entityKeyField":"address.id","argumentPath":["location","address","id"]}]}]},{"fieldName":"venues","maxAgeSeconds":"180","entityTypeName":"Venue"},{"fieldName":"userProfile","maxAgeSeconds":"60","includeHeaders":true,"entityTypeName":"UserProfile","entityKeyMappings":[{"entityTypeName":"UserProfile","fieldMappings":[{"entityKeyField":"id","argumentPath":["id"]}]}]},{"fieldName":"catalog","maxAgeSeconds":"120","entityTypeName":"Catalog","entityKeyMappings":[{"entityTypeName":"Catalog","fieldMappings":[{"entityKeyField":"id","argumentPath":["id"]}]}]},{"fieldName":"catalogs","maxAgeSeconds":"120","entityTypeName":"Catalog"},{"fieldName":"metric","maxAgeSeconds":"300","shadowMode":true,"entityTypeName":"Metric","entityKeyMappings":[{"entityTypeName":"Metric","fieldMappings":[{"entityKeyField":"id","argumentPath":["id"]}]}]}],"cachePopulateConfigurations":[{"fieldName":"createArticle","operationType":"Mutation","maxAgeSeconds":"30","entityTypeName":"Article"}],"cacheInvalidateConfigurations":[{"fieldName":"updateArticle","operationType":"Mutation","entityTypeName":"Article"},{"fieldName":"deleteListing","operationType":"Mutation","entityTypeName":"Listing"}]},{"kind":"GRAPHQL","rootNodes":[{"typeName":"Article","fieldNames":["id","viewCount","rating","reviewSummary","relatedArticles","personalizedRecommendation"],"externalFieldNames":["currentViewer"]},{"typeName":"Viewer","fieldNames":["id"],"externalFieldNames":["name"]},{"typeName":"Catalog","fieldNames":["id","description","lastUpdated"]}],"overrideFieldPathFromAlias":true,"customGraphql":{"fetch":{"url":{"staticVariableContent":"http://localhost:4013/graphql"},"method":"POST","body":{},"baseUrl":{},"path":{}},"subscription":{"enabled":true,"url":{"staticVariableContent":"http://localhost:4013/graphql"},"protocol":"GRAPHQL_SUBSCRIPTION_PROTOCOL_WS","websocketSubprotocol":"GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO"},"federation":{"enabled":true,"serviceSdl":"extend schema\n @link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\"@key\", \"@external\", \"@requires\"]\n )\n\ndirective @openfed__entityCache(\n maxAge: Int!\n includeHeaders: Boolean = false\n partialCacheLoad: Boolean = false\n shadowMode: Boolean = false\n) on OBJECT\n\ntype Article @key(fields: \"id\") @openfed__entityCache(maxAge: 90) {\n id: ID!\n currentViewer: Viewer @external\n viewCount: Int!\n rating: Float!\n reviewSummary: String!\n relatedArticles: [Article!]!\n personalizedRecommendation: String! @requires(fields: \"currentViewer { id name }\")\n}\n\ntype Viewer @key(fields: \"id\") {\n id: ID!\n name: String! @external\n}\n\n\"\"\"Extends Catalog with description from a second subgraph (for partial cache load testing)\"\"\"\ntype Catalog @key(fields: \"id\") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) {\n id: ID!\n description: String!\n lastUpdated: String!\n}\n"},"upstreamSchema":{"key":"0648fb0c1d57991af5b181acf97c7949950c7b17"}},"requestTimeoutSeconds":"10","id":"c1e62a9e-230f-4b45-89c5-8de7b1542205","keys":[{"typeName":"Article","selectionSet":"id"},{"typeName":"Viewer","selectionSet":"id"},{"typeName":"Catalog","selectionSet":"id"}],"requires":[{"typeName":"Article","fieldName":"personalizedRecommendation","selectionSet":"currentViewer { id name }"}],"entityCacheConfigurations":[{"typeName":"Article","maxAgeSeconds":"90"},{"typeName":"Catalog","maxAgeSeconds":"120","partialCacheLoad":true}]},{"kind":"GRAPHQL","rootNodes":[{"typeName":"Personalized","fieldNames":["id","currentViewer"]},{"typeName":"Viewer","fieldNames":["id","name","email"]},{"typeName":"Query","fieldNames":["currentViewer"]},{"typeName":"Article","fieldNames":["id","currentViewer"]}],"overrideFieldPathFromAlias":true,"customGraphql":{"fetch":{"url":{"staticVariableContent":"http://localhost:4014/graphql"},"method":"POST","body":{},"baseUrl":{},"path":{}},"subscription":{"enabled":true,"url":{"staticVariableContent":"http://localhost:4014/graphql"},"protocol":"GRAPHQL_SUBSCRIPTION_PROTOCOL_WS","websocketSubprotocol":"GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO"},"federation":{"enabled":true,"serviceSdl":"extend schema\n @link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\"@key\", \"@interfaceObject\", \"@inaccessible\"]\n )\n\ndirective @openfed__requestScoped(key: String!) on FIELD_DEFINITION\n\n# Symmetric @openfed__requestScoped: both Query.currentViewer and Personalized.currentViewer\n# declare key: \"currentViewer\". Their L1 cache entry is \"viewer.currentViewer\".\n# Whichever is resolved first populates L1; subsequent fields with the same key\n# inject from L1 and skip the fetch.\ntype Personalized @key(fields: \"id\") @interfaceObject {\n id: ID!\n currentViewer: Viewer @inaccessible @openfed__requestScoped(key: \"currentViewer\")\n}\n\ntype Viewer @key(fields: \"id\") {\n id: ID!\n name: String!\n email: String!\n}\n\ntype Query {\n currentViewer: Viewer @openfed__requestScoped(key: \"currentViewer\")\n}\n"},"upstreamSchema":{"key":"9ee951b49b83d66e073d83402d78cd8078181571"}},"requestTimeoutSeconds":"10","id":"3ada3b5e-6050-4834-a366-2ab2bb551d9d","keys":[{"typeName":"Personalized","selectionSet":"id"},{"typeName":"Viewer","selectionSet":"id"},{"typeName":"Article","selectionSet":"id"}],"interfaceObjects":[{"interfaceTypeName":"Personalized","concreteTypeNames":["Article"]}],"requestScopedFields":[{"fieldName":"currentViewer","typeName":"Personalized","l1Key":"viewer.currentViewer"},{"fieldName":"currentViewer","typeName":"Query","l1Key":"viewer.currentViewer"}]}],"fieldConfigurations":[{"typeName":"Query","fieldName":"article","argumentsConfiguration":[{"name":"id","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Query","fieldName":"articlesByIds","argumentsConfiguration":[{"name":"ids","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Query","fieldName":"articleBySlug","argumentsConfiguration":[{"name":"slug","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Query","fieldName":"listing","argumentsConfiguration":[{"name":"key","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Query","fieldName":"venue","argumentsConfiguration":[{"name":"location","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Query","fieldName":"userProfile","argumentsConfiguration":[{"name":"id","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Query","fieldName":"catalog","argumentsConfiguration":[{"name":"id","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Query","fieldName":"metric","argumentsConfiguration":[{"name":"id","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Mutation","fieldName":"updateArticle","argumentsConfiguration":[{"name":"id","sourceType":"FIELD_ARGUMENT"},{"name":"title","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Mutation","fieldName":"createArticle","argumentsConfiguration":[{"name":"title","sourceType":"FIELD_ARGUMENT"},{"name":"body","sourceType":"FIELD_ARGUMENT"},{"name":"authorName","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Mutation","fieldName":"deleteListing","argumentsConfiguration":[{"name":"key","sourceType":"FIELD_ARGUMENT"}]}],"graphqlSchema":"schema {\n query: Query\n mutation: Mutation\n}\n\ndirective @inaccessible on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION\n\ntype Query {\n \"\"\"Simple key lookup\"\"\"\n article(id: ID!): Article\n \"\"\"List query\"\"\"\n articles: [Article!]!\n \"\"\"Batch lookup with @openfed__is\"\"\"\n articlesByIds(ids: [ID!]!): [Article!]!\n \"\"\"Argument remapping via @openfed__is\"\"\"\n articleBySlug(slug: ID!): Article\n \"\"\"Composite key lookup via input object with @openfed__is\"\"\"\n listing(key: ListingKey!): Listing\n \"\"\"List of all listings\"\"\"\n listings: [Listing!]!\n \"\"\"Nested key lookup with @openfed__is and input object\"\"\"\n venue(location: VenueLocationKey!): Venue\n \"\"\"List of all venues\"\"\"\n venues: [Venue!]!\n \"\"\"Per-user profile (cache varies by Authorization header)\"\"\"\n userProfile(id: ID!): UserProfile\n \"\"\"Single catalog entry\"\"\"\n catalog(id: ID!): Catalog\n \"\"\"All catalog entries (for partial cache load testing)\"\"\"\n catalogs: [Catalog!]!\n \"\"\"\n Single metric (shadow mode - always fetches from subgraph, compares with cache)\n \"\"\"\n metric(id: ID!): Metric\n currentViewer: Viewer\n}\n\ntype Mutation {\n updateArticle(id: ID!, title: String!): Article\n createArticle(title: String!, body: String!, authorName: String!): Article!\n deleteListing(key: ListingKey!): Listing\n}\n\n\"\"\"\nPer-user caching: includeHeaders makes the cache key include a hash of forwarded headers (e.g. Authorization)\n\"\"\"\ntype UserProfile {\n id: ID!\n username: String!\n email: String!\n role: String!\n}\n\n\"\"\"\nPartial cache load: when some entities are cached and others aren't, only the missing ones are fetched\n\"\"\"\ntype Catalog {\n id: ID!\n name: String!\n category: String!\n itemCount: Int!\n description: String!\n lastUpdated: String!\n}\n\n\"\"\"\nShadow mode: always fetches from subgraph but compares with cache for staleness detection\n\"\"\"\ntype Metric {\n id: ID!\n name: String!\n value: Float!\n unit: String!\n}\n\ninput ListingKey {\n sellerId: ID!\n sku: String!\n}\n\ninput VenueLocationKey {\n address: VenueAddressKey!\n}\n\ninput VenueAddressKey {\n id: ID!\n}\n\ninterface Personalized {\n id: ID!\n currentViewer: Viewer @inaccessible\n}\n\ntype Viewer {\n id: ID!\n recommendedArticles: [Article!]!\n name: String!\n email: String!\n}\n\ntype Listing {\n sellerId: ID!\n sku: String!\n title: String!\n price: Float!\n currency: String!\n inStock: Boolean!\n}\n\ntype Address {\n id: ID!\n}\n\ntype Venue {\n address: Address!\n name: String!\n capacity: Int!\n city: String!\n}\n\ntype Article implements Personalized {\n id: ID!\n title: String!\n body: String!\n authorName: String!\n publishedAt: String!\n tags: [String!]!\n currentViewer: Viewer\n viewCount: Int!\n rating: Float!\n reviewSummary: String!\n relatedArticles: [Article!]!\n personalizedRecommendation: String!\n}","stringStorage":{"48ffcc2db438392c0d3e51da4cfb72aa41f405b7":"schema {\n query: Query\n mutation: Mutation\n}\n\ndirective @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT\n\ndirective @link(as: String, for: link__Purpose, import: [link__Import], url: String!) repeatable on SCHEMA\n\ndirective @openfed__cacheInvalidate on FIELD_DEFINITION\n\ndirective @openfed__cachePopulate(maxAge: Int) on FIELD_DEFINITION\n\ndirective @openfed__entityCache(includeHeaders: Boolean = false, maxAge: Int!, partialCacheLoad: Boolean = false, shadowMode: Boolean = false) on OBJECT\n\ndirective @openfed__is(fields: String!) on ARGUMENT_DEFINITION\n\ndirective @openfed__queryCache(includeHeaders: Boolean = false, maxAge: Int!, shadowMode: Boolean = false) on FIELD_DEFINITION\n\ntype Address {\n id: ID!\n}\n\ntype Article implements Personalized @key(fields: \"id\") @openfed__entityCache(maxAge: 120) {\n authorName: String!\n body: String!\n id: ID!\n publishedAt: String!\n tags: [String!]!\n title: String!\n}\n\n\"\"\"\nPartial cache load: when some entities are cached and others aren't, only the missing ones are fetched\n\"\"\"\ntype Catalog @key(fields: \"id\") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) {\n category: String!\n id: ID!\n itemCount: Int!\n name: String!\n}\n\ntype Listing @key(fields: \"sellerId sku\") @openfed__entityCache(maxAge: 60) {\n currency: String!\n inStock: Boolean!\n price: Float!\n sellerId: ID!\n sku: String!\n title: String!\n}\n\ninput ListingKey {\n sellerId: ID!\n sku: String!\n}\n\n\"\"\"\nShadow mode: always fetches from subgraph but compares with cache for staleness detection\n\"\"\"\ntype Metric @key(fields: \"id\") @openfed__entityCache(maxAge: 300, shadowMode: true) {\n id: ID!\n name: String!\n unit: String!\n value: Float!\n}\n\ntype Mutation {\n createArticle(authorName: String!, body: String!, title: String!): Article! @openfed__cachePopulate(maxAge: 30)\n deleteListing(key: ListingKey!): Listing @openfed__cacheInvalidate\n updateArticle(id: ID!, title: String!): Article @openfed__cacheInvalidate\n}\n\ninterface Personalized @key(fields: \"id\") {\n id: ID!\n}\n\ntype Query {\n \"\"\"Simple key lookup\"\"\"\n article(id: ID!): Article @openfed__queryCache(maxAge: 120)\n \"\"\"Argument remapping via @openfed__is\"\"\"\n articleBySlug(slug: ID! @openfed__is(fields: \"id\")): Article @openfed__queryCache(maxAge: 120)\n \"\"\"List query\"\"\"\n articles: [Article!]! @openfed__queryCache(maxAge: 120)\n \"\"\"Batch lookup with @openfed__is\"\"\"\n articlesByIds(ids: [ID!]! @openfed__is(fields: \"id\")): [Article!]! @openfed__queryCache(maxAge: 120)\n \"\"\"Single catalog entry\"\"\"\n catalog(id: ID!): Catalog @openfed__queryCache(maxAge: 120)\n \"\"\"All catalog entries (for partial cache load testing)\"\"\"\n catalogs: [Catalog!]! @openfed__queryCache(maxAge: 120)\n \"\"\"Composite key lookup via input object with @openfed__is\"\"\"\n listing(key: ListingKey! @openfed__is(fields: \"sellerId sku\")): Listing @openfed__queryCache(maxAge: 60)\n \"\"\"List of all listings\"\"\"\n listings: [Listing!]! @openfed__queryCache(maxAge: 60)\n \"\"\"\n Single metric (shadow mode - always fetches from subgraph, compares with cache)\n \"\"\"\n metric(id: ID!): Metric @openfed__queryCache(maxAge: 300, shadowMode: true)\n \"\"\"Per-user profile (cache varies by Authorization header)\"\"\"\n userProfile(id: ID!): UserProfile @openfed__queryCache(maxAge: 60, includeHeaders: true)\n \"\"\"Nested key lookup with @openfed__is and input object\"\"\"\n venue(location: VenueLocationKey! @openfed__is(fields: \"address { id }\")): Venue @openfed__queryCache(maxAge: 180)\n \"\"\"List of all venues\"\"\"\n venues: [Venue!]! @openfed__queryCache(maxAge: 180)\n}\n\n\"\"\"\nPer-user caching: includeHeaders makes the cache key include a hash of forwarded headers (e.g. Authorization)\n\"\"\"\ntype UserProfile @key(fields: \"id\") @openfed__entityCache(maxAge: 60, includeHeaders: true) {\n email: String!\n id: ID!\n role: String!\n username: String!\n}\n\ntype Venue @key(fields: \"address { id }\") @openfed__entityCache(maxAge: 180) {\n address: Address!\n capacity: Int!\n city: String!\n name: String!\n}\n\ninput VenueAddressKey {\n id: ID!\n}\n\ninput VenueLocationKey {\n address: VenueAddressKey!\n}\n\ntype Viewer @key(fields: \"id\") {\n id: ID!\n recommendedArticles: [Article!]!\n}\n\nscalar link__Import\n\nenum link__Purpose {\n EXECUTION\n SECURITY\n}\n\nscalar openfed__FieldSet","0648fb0c1d57991af5b181acf97c7949950c7b17":"directive @external on FIELD_DEFINITION | OBJECT\n\ndirective @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT\n\ndirective @link(as: String, for: link__Purpose, import: [link__Import], url: String!) repeatable on SCHEMA\n\ndirective @openfed__entityCache(includeHeaders: Boolean = false, maxAge: Int!, partialCacheLoad: Boolean = false, shadowMode: Boolean = false) on OBJECT\n\ndirective @requires(fields: openfed__FieldSet!) on FIELD_DEFINITION\n\ntype Article @key(fields: \"id\") @openfed__entityCache(maxAge: 90) {\n currentViewer: Viewer @external\n id: ID!\n personalizedRecommendation: String! @requires(fields: \"currentViewer { id name }\")\n rating: Float!\n relatedArticles: [Article!]!\n reviewSummary: String!\n viewCount: Int!\n}\n\n\"\"\"\nExtends Catalog with description from a second subgraph (for partial cache load testing)\n\"\"\"\ntype Catalog @key(fields: \"id\") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) {\n description: String!\n id: ID!\n lastUpdated: String!\n}\n\ntype Viewer @key(fields: \"id\") {\n id: ID!\n name: String! @external\n}\n\nscalar link__Import\n\nenum link__Purpose {\n EXECUTION\n SECURITY\n}\n\nscalar openfed__FieldSet","9ee951b49b83d66e073d83402d78cd8078181571":"schema {\n query: Query\n}\n\ndirective @inaccessible on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION\n\ndirective @interfaceObject on OBJECT\n\ndirective @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT\n\ndirective @link(as: String, for: link__Purpose, import: [link__Import], url: String!) repeatable on SCHEMA\n\ndirective @openfed__requestScoped(key: String!) on FIELD_DEFINITION\n\ntype Personalized @key(fields: \"id\") @interfaceObject {\n currentViewer: Viewer @inaccessible @openfed__requestScoped(key: \"currentViewer\")\n id: ID!\n}\n\ntype Query {\n currentViewer: Viewer @openfed__requestScoped(key: \"currentViewer\")\n}\n\ntype Viewer @key(fields: \"id\") {\n email: String!\n id: ID!\n name: String!\n}\n\nscalar link__Import\n\nenum link__Purpose {\n EXECUTION\n SECURITY\n}\n\nscalar openfed__FieldSet"},"graphqlClientSchema":"schema {\n query: Query\n mutation: Mutation\n}\n\ntype Query {\n \"\"\"Simple key lookup\"\"\"\n article(id: ID!): Article\n \"\"\"List query\"\"\"\n articles: [Article!]!\n \"\"\"Batch lookup with @openfed__is\"\"\"\n articlesByIds(ids: [ID!]!): [Article!]!\n \"\"\"Argument remapping via @openfed__is\"\"\"\n articleBySlug(slug: ID!): Article\n \"\"\"Composite key lookup via input object with @openfed__is\"\"\"\n listing(key: ListingKey!): Listing\n \"\"\"List of all listings\"\"\"\n listings: [Listing!]!\n \"\"\"Nested key lookup with @openfed__is and input object\"\"\"\n venue(location: VenueLocationKey!): Venue\n \"\"\"List of all venues\"\"\"\n venues: [Venue!]!\n \"\"\"Per-user profile (cache varies by Authorization header)\"\"\"\n userProfile(id: ID!): UserProfile\n \"\"\"Single catalog entry\"\"\"\n catalog(id: ID!): Catalog\n \"\"\"All catalog entries (for partial cache load testing)\"\"\"\n catalogs: [Catalog!]!\n \"\"\"\n Single metric (shadow mode - always fetches from subgraph, compares with cache)\n \"\"\"\n metric(id: ID!): Metric\n currentViewer: Viewer\n}\n\ntype Mutation {\n updateArticle(id: ID!, title: String!): Article\n createArticle(title: String!, body: String!, authorName: String!): Article!\n deleteListing(key: ListingKey!): Listing\n}\n\n\"\"\"\nPer-user caching: includeHeaders makes the cache key include a hash of forwarded headers (e.g. Authorization)\n\"\"\"\ntype UserProfile {\n id: ID!\n username: String!\n email: String!\n role: String!\n}\n\n\"\"\"\nPartial cache load: when some entities are cached and others aren't, only the missing ones are fetched\n\"\"\"\ntype Catalog {\n id: ID!\n name: String!\n category: String!\n itemCount: Int!\n description: String!\n lastUpdated: String!\n}\n\n\"\"\"\nShadow mode: always fetches from subgraph but compares with cache for staleness detection\n\"\"\"\ntype Metric {\n id: ID!\n name: String!\n value: Float!\n unit: String!\n}\n\ninput ListingKey {\n sellerId: ID!\n sku: String!\n}\n\ninput VenueLocationKey {\n address: VenueAddressKey!\n}\n\ninput VenueAddressKey {\n id: ID!\n}\n\ninterface Personalized {\n id: ID!\n}\n\ntype Viewer {\n id: ID!\n recommendedArticles: [Article!]!\n name: String!\n email: String!\n}\n\ntype Listing {\n sellerId: ID!\n sku: String!\n title: String!\n price: Float!\n currency: String!\n inStock: Boolean!\n}\n\ntype Address {\n id: ID!\n}\n\ntype Venue {\n address: Address!\n name: String!\n capacity: Int!\n city: String!\n}\n\ntype Article implements Personalized {\n id: ID!\n title: String!\n body: String!\n authorName: String!\n publishedAt: String!\n tags: [String!]!\n currentViewer: Viewer\n viewCount: Int!\n rating: Float!\n reviewSummary: String!\n relatedArticles: [Article!]!\n personalizedRecommendation: String!\n}"},"version":"457aea05-bbf8-4ff0-9743-d1c6deb33e51","subgraphs":[{"id":"28394922-9469-4c42-9d29-c08b184159c2","name":"cachegraph","routingUrl":"http://localhost:4012/graphql"},{"id":"c1e62a9e-230f-4b45-89c5-8de7b1542205","name":"cachegraph-ext","routingUrl":"http://localhost:4013/graphql"},{"id":"3ada3b5e-6050-4834-a366-2ab2bb551d9d","name":"viewer","routingUrl":"http://localhost:4014/graphql"}],"compatibilityVersion":"1:{{$COMPOSITION__VERSION}}"} \ No newline at end of file diff --git a/cli/cachegraph-cachedemo/supergraph/cosmoSchema.graphql b/cli/cachegraph-cachedemo/supergraph/cosmoSchema.graphql new file mode 100644 index 0000000000..fb37d0744d --- /dev/null +++ b/cli/cachegraph-cachedemo/supergraph/cosmoSchema.graphql @@ -0,0 +1,134 @@ +schema { + query: Query + mutation: Mutation +} + +directive @inaccessible on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION + +type Query { + """Simple key lookup""" + article(id: ID!): Article + """List query""" + articles: [Article!]! + """Batch lookup with @openfed__is""" + articlesByIds(ids: [ID!]!): [Article!]! + """Argument remapping via @openfed__is""" + articleBySlug(slug: ID!): Article + """Composite key lookup via input object with @openfed__is""" + listing(key: ListingKey!): Listing + """List of all listings""" + listings: [Listing!]! + """Nested key lookup with @openfed__is and input object""" + venue(location: VenueLocationKey!): Venue + """List of all venues""" + venues: [Venue!]! + """Per-user profile (cache varies by Authorization header)""" + userProfile(id: ID!): UserProfile + """Single catalog entry""" + catalog(id: ID!): Catalog + """All catalog entries (for partial cache load testing)""" + catalogs: [Catalog!]! + """ + Single metric (shadow mode - always fetches from subgraph, compares with cache) + """ + metric(id: ID!): Metric + currentViewer: Viewer +} + +type Mutation { + updateArticle(id: ID!, title: String!): Article + createArticle(title: String!, body: String!, authorName: String!): Article! + deleteListing(key: ListingKey!): Listing +} + +""" +Per-user caching: includeHeaders makes the cache key include a hash of forwarded headers (e.g. Authorization) +""" +type UserProfile { + id: ID! + username: String! + email: String! + role: String! +} + +""" +Partial cache load: when some entities are cached and others aren't, only the missing ones are fetched +""" +type Catalog { + id: ID! + name: String! + category: String! + itemCount: Int! + description: String! + lastUpdated: String! +} + +""" +Shadow mode: always fetches from subgraph but compares with cache for staleness detection +""" +type Metric { + id: ID! + name: String! + value: Float! + unit: String! +} + +input ListingKey { + sellerId: ID! + sku: String! +} + +input VenueLocationKey { + address: VenueAddressKey! +} + +input VenueAddressKey { + id: ID! +} + +interface Personalized { + id: ID! + currentViewer: Viewer @inaccessible +} + +type Viewer { + id: ID! + recommendedArticles: [Article!]! + name: String! + email: String! +} + +type Listing { + sellerId: ID! + sku: String! + title: String! + price: Float! + currency: String! + inStock: Boolean! +} + +type Address { + id: ID! +} + +type Venue { + address: Address! + name: String! + capacity: Int! + city: String! +} + +type Article implements Personalized { + id: ID! + title: String! + body: String! + authorName: String! + publishedAt: String! + tags: [String!]! + currentViewer: Viewer + viewCount: Int! + rating: Float! + reviewSummary: String! + relatedArticles: [Article!]! + personalizedRecommendation: String! +} \ No newline at end of file diff --git a/composition-go/index.global.js b/composition-go/index.global.js index 362a85aa65..d52fd01f28 100644 --- a/composition-go/index.global.js +++ b/composition-go/index.global.js @@ -15,17 +15,17 @@ class URL { return urlCanParse(url, base || ''); } } -"use strict";var shim=(()=>{var Wz=Object.create;var Jd=Object.defineProperty,Xz=Object.defineProperties,Zz=Object.getOwnPropertyDescriptor,eH=Object.getOwnPropertyDescriptors,tH=Object.getOwnPropertyNames,zm=Object.getOwnPropertySymbols,nH=Object.getPrototypeOf,eI=Object.prototype.hasOwnProperty,WR=Object.prototype.propertyIsEnumerable;var cn=Math.pow,Zy=(e,t,n)=>t in e?Jd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M=(e,t)=>{for(var n in t||(t={}))eI.call(t,n)&&Zy(e,n,t[n]);if(zm)for(var n of zm(t))WR.call(t,n)&&Zy(e,n,t[n]);return e},$=(e,t)=>Xz(e,eH(t));var XR=(e,t)=>{var n={};for(var r in e)eI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zm)for(var r of zm(e))t.indexOf(r)<0&&WR.call(e,r)&&(n[r]=e[r]);return n};var nc=(e,t)=>()=>(e&&(t=e(e=0)),t);var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Hm=(e,t)=>{for(var n in t)Jd(e,n,{get:t[n],enumerable:!0})},ZR=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tH(t))!eI.call(e,i)&&i!==n&&Jd(e,i,{get:()=>t[i],enumerable:!(r=Zz(t,i))||r.enumerable});return e};var hi=(e,t,n)=>(n=e!=null?Wz(nH(e)):{},ZR(t||!e||!e.__esModule?Jd(n,"default",{value:e,enumerable:!0}):n,e)),Wm=e=>ZR(Jd({},"__esModule",{value:!0}),e);var g=(e,t,n)=>(Zy(e,typeof t!="symbol"?t+"":t,n),n),tI=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var nI=(e,t,n)=>(tI(e,t,"read from private field"),n?n.call(e):t.get(e)),rc=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},rI=(e,t,n,r)=>(tI(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var yl=(e,t,n)=>(tI(e,t,"access private method"),n);var Ci=(e,t,n)=>new Promise((r,i)=>{var a=l=>{try{u(n.next(l))}catch(d){i(d)}},o=l=>{try{u(n.throw(l))}catch(d){i(d)}},u=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,o);u((n=n.apply(e,t)).next())});var m=nc(()=>{"use strict"});var O={};Hm(O,{_debugEnd:()=>VP,_debugProcess:()=>qP,_events:()=>rF,_eventsCount:()=>iF,_exiting:()=>gP,_fatalExceptions:()=>BP,_getActiveHandles:()=>OP,_getActiveRequests:()=>SP,_kill:()=>bP,_linkedBinding:()=>yP,_maxListeners:()=>nF,_preload_modules:()=>ZP,_rawDebug:()=>EP,_startProfilerIdleNotifier:()=>jP,_stopProfilerIdleNotifier:()=>KP,_tickCallback:()=>xP,abort:()=>YP,addListener:()=>aF,allowedNodeEnvironmentFlags:()=>LP,arch:()=>iP,argv:()=>oP,argv0:()=>XP,assert:()=>CP,binding:()=>fP,chdir:()=>NP,config:()=>_P,cpuUsage:()=>eN,cwd:()=>mP,debugPort:()=>WP,default:()=>mF,dlopen:()=>vP,domain:()=>IP,emit:()=>lF,emitWarning:()=>dP,env:()=>sP,execArgv:()=>uP,execPath:()=>HP,exit:()=>FP,features:()=>UP,hasUncaughtExceptionCaptureCallback:()=>MP,hrtime:()=>Zm,kill:()=>PP,listeners:()=>pF,memoryUsage:()=>RP,moduleLoadList:()=>hP,nextTick:()=>tP,off:()=>oF,on:()=>Ds,once:()=>sF,openStdin:()=>wP,pid:()=>JP,platform:()=>aP,ppid:()=>zP,prependListener:()=>dF,prependOnceListener:()=>fF,reallyExit:()=>DP,release:()=>TP,removeAllListeners:()=>cF,removeListener:()=>uF,resourceUsage:()=>AP,setSourceMapsEnabled:()=>eF,setUncaughtExceptionCaptureCallback:()=>kP,stderr:()=>GP,stdin:()=>QP,stdout:()=>$P,title:()=>rP,umask:()=>pP,uptime:()=>tF,version:()=>cP,versions:()=>lP});function sI(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function rH(){!Il||!ic||(Il=!1,ic.length?Os=ic.concat(Os):Xm=-1,Os.length&&eP())}function eP(){if(!Il){var e=setTimeout(rH,0);Il=!0;for(var t=Os.length;t;){for(ic=Os,Os=[];++Xm1)for(var n=1;n{"use strict";m();T();N();Os=[],Il=!1,Xm=-1;nP.prototype.run=function(){this.fun.apply(null,this.array)};rP="browser",iP="x64",aP="browser",sP={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},oP=["/usr/bin/node"],uP=[],cP="v16.8.0",lP={},dP=function(e,t){console.warn((t?t+": ":"")+e)},fP=function(e){sI("binding")},pP=function(e){return 0},mP=function(){return"/"},NP=function(e){},TP={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};EP=Pr,hP=[];IP={},gP=!1,_P={};DP=Pr,bP=Pr,eN=function(){return{}},AP=eN,RP=eN,PP=Pr,FP=Pr,wP=Pr,LP={};UP={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},BP=Pr,kP=Pr;xP=Pr,qP=Pr,VP=Pr,jP=Pr,KP=Pr,$P=void 0,GP=void 0,QP=void 0,YP=Pr,JP=2,zP=1,HP="/bin/usr/node",WP=9229,XP="node",ZP=[],eF=Pr,Tu={now:typeof performance!="undefined"?performance.now.bind(performance):void 0,timing:typeof performance!="undefined"?performance.timing:void 0};Tu.now===void 0&&(iI=Date.now(),Tu.timing&&Tu.timing.navigationStart&&(iI=Tu.timing.navigationStart),Tu.now=()=>Date.now()-iI);aI=1e9;Zm.bigint=function(e){var t=Zm(e);return typeof BigInt=="undefined"?t[0]*aI+t[1]:BigInt(t[0]*aI)+BigInt(t[1])};nF=10,rF={},iF=0;aF=Ds,sF=Ds,oF=Ds,uF=Ds,cF=Ds,lF=Pr,dF=Ds,fF=Ds;mF={version:cP,versions:lP,arch:iP,platform:aP,release:TP,_rawDebug:EP,moduleLoadList:hP,binding:fP,_linkedBinding:yP,_events:rF,_eventsCount:iF,_maxListeners:nF,on:Ds,addListener:aF,once:sF,off:oF,removeListener:uF,removeAllListeners:cF,emit:lF,prependListener:dF,prependOnceListener:fF,listeners:pF,domain:IP,_exiting:gP,config:_P,dlopen:vP,uptime:tF,_getActiveRequests:SP,_getActiveHandles:OP,reallyExit:DP,_kill:bP,cpuUsage:eN,resourceUsage:AP,memoryUsage:RP,kill:PP,exit:FP,openStdin:wP,allowedNodeEnvironmentFlags:LP,assert:CP,features:UP,_fatalExceptions:BP,setUncaughtExceptionCaptureCallback:kP,hasUncaughtExceptionCaptureCallback:MP,emitWarning:dP,nextTick:tP,_tickCallback:xP,_debugProcess:qP,_debugEnd:VP,_startProfilerIdleNotifier:jP,_stopProfilerIdleNotifier:KP,stdout:$P,stdin:QP,stderr:GP,abort:YP,umask:pP,chdir:NP,cwd:mP,env:sP,title:rP,argv:oP,execArgv:uP,pid:JP,ppid:zP,execPath:HP,debugPort:WP,hrtime:Zm,argv0:XP,_preload_modules:ZP,setSourceMapsEnabled:eF}});var N=nc(()=>{"use strict";NF()});function iH(){if(TF)return zd;TF=!0,zd.byteLength=u,zd.toByteArray=d,zd.fromByteArray=h;for(var e=[],t=[],n=typeof Uint8Array!="undefined"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,a=r.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var B=v.indexOf("=");B===-1&&(B=A);var V=B===A?0:4-B%4;return[B,V]}function u(v){var A=o(v),B=A[0],V=A[1];return(B+V)*3/4-V}function l(v,A,B){return(A+B)*3/4-B}function d(v){var A,B=o(v),V=B[0],J=B[1],re=new n(l(v,V,J)),ie=0,Ne=J>0?V-4:V,Ee;for(Ee=0;Ee>16&255,re[ie++]=A>>8&255,re[ie++]=A&255;return J===2&&(A=t[v.charCodeAt(Ee)]<<2|t[v.charCodeAt(Ee+1)]>>4,re[ie++]=A&255),J===1&&(A=t[v.charCodeAt(Ee)]<<10|t[v.charCodeAt(Ee+1)]<<4|t[v.charCodeAt(Ee+2)]>>2,re[ie++]=A>>8&255,re[ie++]=A&255),re}function p(v){return e[v>>18&63]+e[v>>12&63]+e[v>>6&63]+e[v&63]}function E(v,A,B){for(var V,J=[],re=A;reNe?Ne:ie+re));return V===1?(A=v[B-1],J.push(e[A>>2]+e[A<<4&63]+"==")):V===2&&(A=(v[B-2]<<8)+v[B-1],J.push(e[A>>10]+e[A>>4&63]+e[A<<2&63]+"=")),J.join("")}return zd}function aH(){if(EF)return tN;EF=!0;return tN.read=function(e,t,n,r,i){var a,o,u=i*8-r-1,l=(1<>1,p=-7,E=n?i-1:0,h=n?-1:1,v=e[t+E];for(E+=h,a=v&(1<<-p)-1,v>>=-p,p+=u;p>0;a=a*256+e[t+E],E+=h,p-=8);for(o=a&(1<<-p)-1,a>>=-p,p+=r;p>0;o=o*256+e[t+E],E+=h,p-=8);if(a===0)a=1-d;else{if(a===l)return o?NaN:(v?-1:1)*(1/0);o=o+Math.pow(2,r),a=a-d}return(v?-1:1)*o*Math.pow(2,a-r)},tN.write=function(e,t,n,r,i,a){var o,u,l,d=a*8-i-1,p=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=r?0:a-1,A=r?1:-1,B=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,o=p):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+E>=1?t+=h/l:t+=h*Math.pow(2,1-E),t*l>=2&&(o++,l/=2),o+E>=p?(u=0,o=p):o+E>=1?(u=(t*l-1)*Math.pow(2,i),o=o+E):(u=t*Math.pow(2,E-1)*Math.pow(2,i),o=0));i>=8;e[n+v]=u&255,v+=A,u/=256,i-=8);for(o=o<0;e[n+v]=o&255,v+=A,o/=256,d-=8);e[n+v-A]|=B*128},tN}function sH(){if(hF)return ac;hF=!0;let e=iH(),t=aH(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ac.Buffer=o,ac.SlowBuffer=J,ac.INSPECT_MAX_BYTES=50;let r=2147483647;ac.kMaxLength=r,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{let P=new Uint8Array(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,Uint8Array.prototype),Object.setPrototypeOf(P,I),P.foo()===42}catch(P){return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function a(P){if(P>r)throw new RangeError('The value "'+P+'" is invalid for option "size"');let I=new Uint8Array(P);return Object.setPrototypeOf(I,o.prototype),I}function o(P,I,_){if(typeof P=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(P)}return u(P,I,_)}o.poolSize=8192;function u(P,I,_){if(typeof P=="string")return E(P,I);if(ArrayBuffer.isView(P))return v(P);if(P==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P);if($t(P,ArrayBuffer)||P&&$t(P.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&($t(P,SharedArrayBuffer)||P&&$t(P.buffer,SharedArrayBuffer)))return A(P,I,_);if(typeof P=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let U=P.valueOf&&P.valueOf();if(U!=null&&U!==P)return o.from(U,I,_);let K=B(P);if(K)return K;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof P[Symbol.toPrimitive]=="function")return o.from(P[Symbol.toPrimitive]("string"),I,_);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P)}o.from=function(P,I,_){return u(P,I,_)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function l(P){if(typeof P!="number")throw new TypeError('"size" argument must be of type number');if(P<0)throw new RangeError('The value "'+P+'" is invalid for option "size"')}function d(P,I,_){return l(P),P<=0?a(P):I!==void 0?typeof _=="string"?a(P).fill(I,_):a(P).fill(I):a(P)}o.alloc=function(P,I,_){return d(P,I,_)};function p(P){return l(P),a(P<0?0:V(P)|0)}o.allocUnsafe=function(P){return p(P)},o.allocUnsafeSlow=function(P){return p(P)};function E(P,I){if((typeof I!="string"||I==="")&&(I="utf8"),!o.isEncoding(I))throw new TypeError("Unknown encoding: "+I);let _=re(P,I)|0,U=a(_),K=U.write(P,I);return K!==_&&(U=U.slice(0,K)),U}function h(P){let I=P.length<0?0:V(P.length)|0,_=a(I);for(let U=0;U=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return P|0}function J(P){return+P!=P&&(P=0),o.alloc(+P)}o.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==o.prototype},o.compare=function(I,_){if($t(I,Uint8Array)&&(I=o.from(I,I.offset,I.byteLength)),$t(_,Uint8Array)&&(_=o.from(_,_.offset,_.byteLength)),!o.isBuffer(I)||!o.isBuffer(_))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===_)return 0;let U=I.length,K=_.length;for(let ee=0,ce=Math.min(U,K);eeK.length?(o.isBuffer(ce)||(ce=o.from(ce)),ce.copy(K,ee)):Uint8Array.prototype.set.call(K,ce,ee);else if(o.isBuffer(ce))ce.copy(K,ee);else throw new TypeError('"list" argument must be an Array of Buffers');ee+=ce.length}return K};function re(P,I){if(o.isBuffer(P))return P.length;if(ArrayBuffer.isView(P)||$t(P,ArrayBuffer))return P.byteLength;if(typeof P!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof P);let _=P.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&_===0)return 0;let K=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return _;case"utf8":case"utf-8":return Ns(P).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _*2;case"hex":return _>>>1;case"base64":return gr(P).length;default:if(K)return U?-1:Ns(P).length;I=(""+I).toLowerCase(),K=!0}}o.byteLength=re;function ie(P,I,_){let U=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((_===void 0||_>this.length)&&(_=this.length),_<=0)||(_>>>=0,I>>>=0,_<=I))return"";for(P||(P="utf8");;)switch(P){case"hex":return rr(this,I,_);case"utf8":case"utf-8":return In(this,I,_);case"ascii":return Kt(this,I,_);case"latin1":case"binary":return qr(this,I,_);case"base64":return Zt(this,I,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return En(this,I,_);default:if(U)throw new TypeError("Unknown encoding: "+P);P=(P+"").toLowerCase(),U=!0}}o.prototype._isBuffer=!0;function Ne(P,I,_){let U=P[I];P[I]=P[_],P[_]=U}o.prototype.swap16=function(){let I=this.length;if(I%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let _=0;__&&(I+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(I,_,U,K,ee){if($t(I,Uint8Array)&&(I=o.from(I,I.offset,I.byteLength)),!o.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(_===void 0&&(_=0),U===void 0&&(U=I?I.length:0),K===void 0&&(K=0),ee===void 0&&(ee=this.length),_<0||U>I.length||K<0||ee>this.length)throw new RangeError("out of range index");if(K>=ee&&_>=U)return 0;if(K>=ee)return-1;if(_>=U)return 1;if(_>>>=0,U>>>=0,K>>>=0,ee>>>=0,this===I)return 0;let ce=ee-K,Tt=U-_,hn=Math.min(ce,Tt),un=this.slice(K,ee),vn=I.slice(_,U);for(let sn=0;sn2147483647?_=2147483647:_<-2147483648&&(_=-2147483648),_=+_,_r(_)&&(_=K?0:P.length-1),_<0&&(_=P.length+_),_>=P.length){if(K)return-1;_=P.length-1}else if(_<0)if(K)_=0;else return-1;if(typeof I=="string"&&(I=o.from(I,U)),o.isBuffer(I))return I.length===0?-1:_e(P,I,_,U,K);if(typeof I=="number")return I=I&255,typeof Uint8Array.prototype.indexOf=="function"?K?Uint8Array.prototype.indexOf.call(P,I,_):Uint8Array.prototype.lastIndexOf.call(P,I,_):_e(P,[I],_,U,K);throw new TypeError("val must be string, number or Buffer")}function _e(P,I,_,U,K){let ee=1,ce=P.length,Tt=I.length;if(U!==void 0&&(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(P.length<2||I.length<2)return-1;ee=2,ce/=2,Tt/=2,_/=2}function hn(vn,sn){return ee===1?vn[sn]:vn.readUInt16BE(sn*ee)}let un;if(K){let vn=-1;for(un=_;unce&&(_=ce-Tt),un=_;un>=0;un--){let vn=!0;for(let sn=0;snK&&(U=K)):U=K;let ee=I.length;U>ee/2&&(U=ee/2);let ce;for(ce=0;ce>>0,isFinite(U)?(U=U>>>0,K===void 0&&(K="utf8")):(K=U,U=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let ee=this.length-_;if((U===void 0||U>ee)&&(U=ee),I.length>0&&(U<0||_<0)||_>this.length)throw new RangeError("Attempt to write outside buffer bounds");K||(K="utf8");let ce=!1;for(;;)switch(K){case"hex":return ye(this,I,_,U);case"utf8":case"utf-8":return qe(this,I,_,U);case"ascii":case"latin1":case"binary":return Z(this,I,_,U);case"base64":return ge(this,I,_,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return It(this,I,_,U);default:if(ce)throw new TypeError("Unknown encoding: "+K);K=(""+K).toLowerCase(),ce=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Zt(P,I,_){return I===0&&_===P.length?e.fromByteArray(P):e.fromByteArray(P.slice(I,_))}function In(P,I,_){_=Math.min(P.length,_);let U=[],K=I;for(;K<_;){let ee=P[K],ce=null,Tt=ee>239?4:ee>223?3:ee>191?2:1;if(K+Tt<=_){let hn,un,vn,sn;switch(Tt){case 1:ee<128&&(ce=ee);break;case 2:hn=P[K+1],(hn&192)===128&&(sn=(ee&31)<<6|hn&63,sn>127&&(ce=sn));break;case 3:hn=P[K+1],un=P[K+2],(hn&192)===128&&(un&192)===128&&(sn=(ee&15)<<12|(hn&63)<<6|un&63,sn>2047&&(sn<55296||sn>57343)&&(ce=sn));break;case 4:hn=P[K+1],un=P[K+2],vn=P[K+3],(hn&192)===128&&(un&192)===128&&(vn&192)===128&&(sn=(ee&15)<<18|(hn&63)<<12|(un&63)<<6|vn&63,sn>65535&&sn<1114112&&(ce=sn))}}ce===null?(ce=65533,Tt=1):ce>65535&&(ce-=65536,U.push(ce>>>10&1023|55296),ce=56320|ce&1023),U.push(ce),K+=Tt}return Ot(U)}let Tn=4096;function Ot(P){let I=P.length;if(I<=Tn)return String.fromCharCode.apply(String,P);let _="",U=0;for(;UU)&&(_=U);let K="";for(let ee=I;ee<_;++ee)K+=Gu[P[ee]];return K}function En(P,I,_){let U=P.slice(I,_),K="";for(let ee=0;eeU&&(I=U),_<0?(_+=U,_<0&&(_=0)):_>U&&(_=U),__)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(I,_,U){I=I>>>0,_=_>>>0,U||en(I,_,this.length);let K=this[I],ee=1,ce=0;for(;++ce<_&&(ee*=256);)K+=this[I+ce]*ee;return K},o.prototype.readUintBE=o.prototype.readUIntBE=function(I,_,U){I=I>>>0,_=_>>>0,U||en(I,_,this.length);let K=this[I+--_],ee=1;for(;_>0&&(ee*=256);)K+=this[I+--_]*ee;return K},o.prototype.readUint8=o.prototype.readUInt8=function(I,_){return I=I>>>0,_||en(I,1,this.length),this[I]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(I,_){return I=I>>>0,_||en(I,2,this.length),this[I]|this[I+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(I,_){return I=I>>>0,_||en(I,2,this.length),this[I]<<8|this[I+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(I,_){return I=I>>>0,_||en(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(I,_){return I=I>>>0,_||en(I,4,this.length),this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])},o.prototype.readBigUInt64LE=ka(function(I){I=I>>>0,it(I,"offset");let _=this[I],U=this[I+7];(_===void 0||U===void 0)&&Lt(I,this.length-8);let K=_+this[++I]*cn(2,8)+this[++I]*cn(2,16)+this[++I]*cn(2,24),ee=this[++I]+this[++I]*cn(2,8)+this[++I]*cn(2,16)+U*cn(2,24);return BigInt(K)+(BigInt(ee)<>>0,it(I,"offset");let _=this[I],U=this[I+7];(_===void 0||U===void 0)&&Lt(I,this.length-8);let K=_*cn(2,24)+this[++I]*cn(2,16)+this[++I]*cn(2,8)+this[++I],ee=this[++I]*cn(2,24)+this[++I]*cn(2,16)+this[++I]*cn(2,8)+U;return(BigInt(K)<>>0,_=_>>>0,U||en(I,_,this.length);let K=this[I],ee=1,ce=0;for(;++ce<_&&(ee*=256);)K+=this[I+ce]*ee;return ee*=128,K>=ee&&(K-=Math.pow(2,8*_)),K},o.prototype.readIntBE=function(I,_,U){I=I>>>0,_=_>>>0,U||en(I,_,this.length);let K=_,ee=1,ce=this[I+--K];for(;K>0&&(ee*=256);)ce+=this[I+--K]*ee;return ee*=128,ce>=ee&&(ce-=Math.pow(2,8*_)),ce},o.prototype.readInt8=function(I,_){return I=I>>>0,_||en(I,1,this.length),this[I]&128?(255-this[I]+1)*-1:this[I]},o.prototype.readInt16LE=function(I,_){I=I>>>0,_||en(I,2,this.length);let U=this[I]|this[I+1]<<8;return U&32768?U|4294901760:U},o.prototype.readInt16BE=function(I,_){I=I>>>0,_||en(I,2,this.length);let U=this[I+1]|this[I]<<8;return U&32768?U|4294901760:U},o.prototype.readInt32LE=function(I,_){return I=I>>>0,_||en(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},o.prototype.readInt32BE=function(I,_){return I=I>>>0,_||en(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},o.prototype.readBigInt64LE=ka(function(I){I=I>>>0,it(I,"offset");let _=this[I],U=this[I+7];(_===void 0||U===void 0)&&Lt(I,this.length-8);let K=this[I+4]+this[I+5]*cn(2,8)+this[I+6]*cn(2,16)+(U<<24);return(BigInt(K)<>>0,it(I,"offset");let _=this[I],U=this[I+7];(_===void 0||U===void 0)&&Lt(I,this.length-8);let K=(_<<24)+this[++I]*cn(2,16)+this[++I]*cn(2,8)+this[++I];return(BigInt(K)<>>0,_||en(I,4,this.length),t.read(this,I,!0,23,4)},o.prototype.readFloatBE=function(I,_){return I=I>>>0,_||en(I,4,this.length),t.read(this,I,!1,23,4)},o.prototype.readDoubleLE=function(I,_){return I=I>>>0,_||en(I,8,this.length),t.read(this,I,!0,52,8)},o.prototype.readDoubleBE=function(I,_){return I=I>>>0,_||en(I,8,this.length),t.read(this,I,!1,52,8)};function Ln(P,I,_,U,K,ee){if(!o.isBuffer(P))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>K||IP.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(I,_,U,K){if(I=+I,_=_>>>0,U=U>>>0,!K){let Tt=Math.pow(2,8*U)-1;Ln(this,I,_,U,Tt,0)}let ee=1,ce=0;for(this[_]=I&255;++ce>>0,U=U>>>0,!K){let Tt=Math.pow(2,8*U)-1;Ln(this,I,_,U,Tt,0)}let ee=U-1,ce=1;for(this[_+ee]=I&255;--ee>=0&&(ce*=256);)this[_+ee]=I/ce&255;return _+U},o.prototype.writeUint8=o.prototype.writeUInt8=function(I,_,U){return I=+I,_=_>>>0,U||Ln(this,I,_,1,255,0),this[_]=I&255,_+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(I,_,U){return I=+I,_=_>>>0,U||Ln(this,I,_,2,65535,0),this[_]=I&255,this[_+1]=I>>>8,_+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(I,_,U){return I=+I,_=_>>>0,U||Ln(this,I,_,2,65535,0),this[_]=I>>>8,this[_+1]=I&255,_+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(I,_,U){return I=+I,_=_>>>0,U||Ln(this,I,_,4,4294967295,0),this[_+3]=I>>>24,this[_+2]=I>>>16,this[_+1]=I>>>8,this[_]=I&255,_+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(I,_,U){return I=+I,_=_>>>0,U||Ln(this,I,_,4,4294967295,0),this[_]=I>>>24,this[_+1]=I>>>16,this[_+2]=I>>>8,this[_+3]=I&255,_+4};function se(P,I,_,U,K){Mt(I,U,K,P,_,7);let ee=Number(I&BigInt(4294967295));P[_++]=ee,ee=ee>>8,P[_++]=ee,ee=ee>>8,P[_++]=ee,ee=ee>>8,P[_++]=ee;let ce=Number(I>>BigInt(32)&BigInt(4294967295));return P[_++]=ce,ce=ce>>8,P[_++]=ce,ce=ce>>8,P[_++]=ce,ce=ce>>8,P[_++]=ce,_}function Ae(P,I,_,U,K){Mt(I,U,K,P,_,7);let ee=Number(I&BigInt(4294967295));P[_+7]=ee,ee=ee>>8,P[_+6]=ee,ee=ee>>8,P[_+5]=ee,ee=ee>>8,P[_+4]=ee;let ce=Number(I>>BigInt(32)&BigInt(4294967295));return P[_+3]=ce,ce=ce>>8,P[_+2]=ce,ce=ce>>8,P[_+1]=ce,ce=ce>>8,P[_]=ce,_+8}o.prototype.writeBigUInt64LE=ka(function(I,_=0){return se(this,I,_,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=ka(function(I,_=0){return Ae(this,I,_,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(I,_,U,K){if(I=+I,_=_>>>0,!K){let hn=Math.pow(2,8*U-1);Ln(this,I,_,U,hn-1,-hn)}let ee=0,ce=1,Tt=0;for(this[_]=I&255;++ee>0)-Tt&255;return _+U},o.prototype.writeIntBE=function(I,_,U,K){if(I=+I,_=_>>>0,!K){let hn=Math.pow(2,8*U-1);Ln(this,I,_,U,hn-1,-hn)}let ee=U-1,ce=1,Tt=0;for(this[_+ee]=I&255;--ee>=0&&(ce*=256);)I<0&&Tt===0&&this[_+ee+1]!==0&&(Tt=1),this[_+ee]=(I/ce>>0)-Tt&255;return _+U},o.prototype.writeInt8=function(I,_,U){return I=+I,_=_>>>0,U||Ln(this,I,_,1,127,-128),I<0&&(I=255+I+1),this[_]=I&255,_+1},o.prototype.writeInt16LE=function(I,_,U){return I=+I,_=_>>>0,U||Ln(this,I,_,2,32767,-32768),this[_]=I&255,this[_+1]=I>>>8,_+2},o.prototype.writeInt16BE=function(I,_,U){return I=+I,_=_>>>0,U||Ln(this,I,_,2,32767,-32768),this[_]=I>>>8,this[_+1]=I&255,_+2},o.prototype.writeInt32LE=function(I,_,U){return I=+I,_=_>>>0,U||Ln(this,I,_,4,2147483647,-2147483648),this[_]=I&255,this[_+1]=I>>>8,this[_+2]=I>>>16,this[_+3]=I>>>24,_+4},o.prototype.writeInt32BE=function(I,_,U){return I=+I,_=_>>>0,U||Ln(this,I,_,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[_]=I>>>24,this[_+1]=I>>>16,this[_+2]=I>>>8,this[_+3]=I&255,_+4},o.prototype.writeBigInt64LE=ka(function(I,_=0){return se(this,I,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=ka(function(I,_=0){return Ae(this,I,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ve(P,I,_,U,K,ee){if(_+U>P.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("Index out of range")}function Ce(P,I,_,U,K){return I=+I,_=_>>>0,K||ve(P,I,_,4),t.write(P,I,_,U,23,4),_+4}o.prototype.writeFloatLE=function(I,_,U){return Ce(this,I,_,!0,U)},o.prototype.writeFloatBE=function(I,_,U){return Ce(this,I,_,!1,U)};function bt(P,I,_,U,K){return I=+I,_=_>>>0,K||ve(P,I,_,8),t.write(P,I,_,U,52,8),_+8}o.prototype.writeDoubleLE=function(I,_,U){return bt(this,I,_,!0,U)},o.prototype.writeDoubleBE=function(I,_,U){return bt(this,I,_,!1,U)},o.prototype.copy=function(I,_,U,K){if(!o.isBuffer(I))throw new TypeError("argument should be a Buffer");if(U||(U=0),!K&&K!==0&&(K=this.length),_>=I.length&&(_=I.length),_||(_=0),K>0&&K=this.length)throw new RangeError("Index out of range");if(K<0)throw new RangeError("sourceEnd out of bounds");K>this.length&&(K=this.length),I.length-_>>0,U=U===void 0?this.length:U>>>0,I||(I=0);let ee;if(typeof I=="number")for(ee=_;eecn(2,32)?K=Ke(String(_)):typeof _=="bigint"&&(K=String(_),(_>cn(BigInt(2),BigInt(32))||_<-cn(BigInt(2),BigInt(32)))&&(K=Ke(K)),K+="n"),U+=` It must be ${I}. Received ${K}`,U},RangeError);function Ke(P){let I="",_=P.length,U=P[0]==="-"?1:0;for(;_>=U+4;_-=3)I=`_${P.slice(_-3,_)}${I}`;return`${P.slice(0,_)}${I}`}function He(P,I,_){it(I,"offset"),(P[I]===void 0||P[I+_]===void 0)&&Lt(I,P.length-(_+1))}function Mt(P,I,_,U,K,ee){if(P>_||P3?I===0||I===BigInt(0)?Tt=`>= 0${ce} and < 2${ce} ** ${(ee+1)*8}${ce}`:Tt=`>= -(2${ce} ** ${(ee+1)*8-1}${ce}) and < 2 ** ${(ee+1)*8-1}${ce}`:Tt=`>= ${I}${ce} and <= ${_}${ce}`,new z.ERR_OUT_OF_RANGE("value",Tt,P)}He(U,K,ee)}function it(P,I){if(typeof P!="number")throw new z.ERR_INVALID_ARG_TYPE(I,"number",P)}function Lt(P,I,_){throw Math.floor(P)!==P?(it(P,_),new z.ERR_OUT_OF_RANGE(_||"offset","an integer",P)):I<0?new z.ERR_BUFFER_OUT_OF_BOUNDS:new z.ERR_OUT_OF_RANGE(_||"offset",`>= ${_?1:0} and <= ${I}`,P)}let ms=/[^+/0-9A-Za-z-_]/g;function Wr(P){if(P=P.split("=")[0],P=P.trim().replace(ms,""),P.length<2)return"";for(;P.length%4!==0;)P=P+"=";return P}function Ns(P,I){I=I||1/0;let _,U=P.length,K=null,ee=[];for(let ce=0;ce55295&&_<57344){if(!K){if(_>56319){(I-=3)>-1&&ee.push(239,191,189);continue}else if(ce+1===U){(I-=3)>-1&&ee.push(239,191,189);continue}K=_;continue}if(_<56320){(I-=3)>-1&&ee.push(239,191,189),K=_;continue}_=(K-55296<<10|_-56320)+65536}else K&&(I-=3)>-1&&ee.push(239,191,189);if(K=null,_<128){if((I-=1)<0)break;ee.push(_)}else if(_<2048){if((I-=2)<0)break;ee.push(_>>6|192,_&63|128)}else if(_<65536){if((I-=3)<0)break;ee.push(_>>12|224,_>>6&63|128,_&63|128)}else if(_<1114112){if((I-=4)<0)break;ee.push(_>>18|240,_>>12&63|128,_>>6&63|128,_&63|128)}else throw new Error("Invalid code point")}return ee}function al(P){let I=[];for(let _=0;_>8,K=_%256,ee.push(K),ee.push(U);return ee}function gr(P){return e.toByteArray(Wr(P))}function di(P,I,_,U){let K;for(K=0;K=I.length||K>=P.length);++K)I[K+_]=P[K];return K}function $t(P,I){return P instanceof I||P!=null&&P.constructor!=null&&P.constructor.name!=null&&P.constructor.name===I.name}function _r(P){return P!==P}let Gu=function(){let P="0123456789abcdef",I=new Array(256);for(let _=0;_<16;++_){let U=_*16;for(let K=0;K<16;++K)I[U+K]=P[_]+P[K]}return I}();function ka(P){return typeof BigInt=="undefined"?Qu:P}function Qu(){throw new Error("BigInt not supported")}return ac}var zd,TF,tN,EF,ac,hF,sc,D,Eme,hme,yF=nc(()=>{"use strict";m();T();N();zd={},TF=!1;tN={},EF=!1;ac={},hF=!1;sc=sH();sc.Buffer;sc.SlowBuffer;sc.INSPECT_MAX_BYTES;sc.kMaxLength;D=sc.Buffer,Eme=sc.INSPECT_MAX_BYTES,hme=sc.kMaxLength});var T=nc(()=>{"use strict";yF()});var IF=F(gl=>{"use strict";m();T();N();Object.defineProperty(gl,"__esModule",{value:!0});gl.versionInfo=gl.version=void 0;var oH="16.9.0";gl.version=oH;var uH=Object.freeze({major:16,minor:9,patch:0,preReleaseTag:null});gl.versionInfo=uH});var $r=F(oI=>{"use strict";m();T();N();Object.defineProperty(oI,"__esModule",{value:!0});oI.devAssert=cH;function cH(e,t){if(!!!e)throw new Error(t)}});var nN=F(uI=>{"use strict";m();T();N();Object.defineProperty(uI,"__esModule",{value:!0});uI.isPromise=lH;function lH(e){return typeof(e==null?void 0:e.then)=="function"}});var Va=F(cI=>{"use strict";m();T();N();Object.defineProperty(cI,"__esModule",{value:!0});cI.isObjectLike=dH;function dH(e){return typeof e=="object"&&e!==null}});var Fr=F(lI=>{"use strict";m();T();N();Object.defineProperty(lI,"__esModule",{value:!0});lI.invariant=fH;function fH(e,t){if(!!!e)throw new Error(t!=null?t:"Unexpected invariant triggered.")}});var rN=F(dI=>{"use strict";m();T();N();Object.defineProperty(dI,"__esModule",{value:!0});dI.getLocation=NH;var pH=Fr(),mH=/\r\n|[\n\r]/g;function NH(e,t){let n=0,r=1;for(let i of e.body.matchAll(mH)){if(typeof i.index=="number"||(0,pH.invariant)(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}});var fI=F(iN=>{"use strict";m();T();N();Object.defineProperty(iN,"__esModule",{value:!0});iN.printLocation=EH;iN.printSourceLocation=_F;var TH=rN();function EH(e){return _F(e.source,(0,TH.getLocation)(e.source,e.start))}function _F(e,t){let n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,u=t.line===1?n:0,l=t.column+u,d=`${e.name}:${o}:${l} -`,p=r.split(/\r\n|[\n\r]/g),E=p[i];if(E.length>120){let h=Math.floor(l/80),v=l%80,A=[];for(let B=0;B["|",B]),["|","^".padStart(v)],["|",A[h+1]]])}return d+gF([[`${o-1} |`,p[i-1]],[`${o} |`,E],["|","^".padStart(l)],[`${o+1} |`,p[i+1]]])}function gF(e){let t=e.filter(([r,i])=>i!==void 0),n=Math.max(...t.map(([r])=>r.length));return t.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(` -`)}});var Ze=F(_l=>{"use strict";m();T();N();Object.defineProperty(_l,"__esModule",{value:!0});_l.GraphQLError=void 0;_l.formatError=gH;_l.printError=IH;var hH=Va(),vF=rN(),SF=fI();function yH(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var pI=class e extends Error{constructor(t,...n){var r,i,a;let{nodes:o,source:u,positions:l,path:d,originalError:p,extensions:E}=yH(n);super(t),this.name="GraphQLError",this.path=d!=null?d:void 0,this.originalError=p!=null?p:void 0,this.nodes=OF(Array.isArray(o)?o:o?[o]:void 0);let h=OF((r=this.nodes)===null||r===void 0?void 0:r.map(A=>A.loc).filter(A=>A!=null));this.source=u!=null?u:h==null||(i=h[0])===null||i===void 0?void 0:i.source,this.positions=l!=null?l:h==null?void 0:h.map(A=>A.start),this.locations=l&&u?l.map(A=>(0,vF.getLocation)(u,A)):h==null?void 0:h.map(A=>(0,vF.getLocation)(A.source,A.start));let v=(0,hH.isObjectLike)(p==null?void 0:p.extensions)?p==null?void 0:p.extensions:void 0;this.extensions=(a=E!=null?E:v)!==null&&a!==void 0?a:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),p!=null&&p.stack?Object.defineProperty(this,"stack",{value:p.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` +"use strict";var shim=(()=>{var dz=Object.create;var np=Object.defineProperty,pz=Object.defineProperties,fz=Object.getOwnPropertyDescriptor,mz=Object.getOwnPropertyDescriptors,Nz=Object.getOwnPropertyNames,cN=Object.getOwnPropertySymbols,Tz=Object.getPrototypeOf,mI=Object.prototype.hasOwnProperty,mP=Object.prototype.propertyIsEnumerable;var ln=Math.pow,fI=(e,t,n)=>t in e?np(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q=(e,t)=>{for(var n in t||(t={}))mI.call(t,n)&&fI(e,n,t[n]);if(cN)for(var n of cN(t))mP.call(t,n)&&fI(e,n,t[n]);return e},W=(e,t)=>pz(e,mz(t));var NP=(e,t)=>{var n={};for(var r in e)mI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cN)for(var r of cN(e))t.indexOf(r)<0&&mP.call(e,r)&&(n[r]=e[r]);return n};var lc=(e,t)=>()=>(e&&(t=e(e=0)),t);var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),lN=(e,t)=>{for(var n in t)np(e,n,{get:t[n],enumerable:!0})},TP=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Nz(t))!mI.call(e,i)&&i!==n&&np(e,i,{get:()=>t[i],enumerable:!(r=fz(t,i))||r.enumerable});return e};var gi=(e,t,n)=>(n=e!=null?dz(Tz(e)):{},TP(t||!e||!e.__esModule?np(n,"default",{value:e,enumerable:!0}):n,e)),dN=e=>TP(np({},"__esModule",{value:!0}),e);var y=(e,t,n)=>(fI(e,typeof t!="symbol"?t+"":t,n),n),NI=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var TI=(e,t,n)=>(NI(e,t,"read from private field"),n?n.call(e):t.get(e)),dc=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},EI=(e,t,n,r)=>(NI(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Al=(e,t,n)=>(NI(e,t,"access private method"),n);var Bi=(e,t,n)=>new Promise((r,i)=>{var a=l=>{try{u(n.next(l))}catch(d){i(d)}},o=l=>{try{u(n.throw(l))}catch(d){i(d)}},u=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,o);u((n=n.apply(e,t)).next())});var m=lc(()=>{"use strict"});var D={};lN(D,{_debugEnd:()=>iF,_debugProcess:()=>rF,_events:()=>IF,_eventsCount:()=>gF,_exiting:()=>MP,_fatalExceptions:()=>ZP,_getActiveHandles:()=>KP,_getActiveRequests:()=>VP,_kill:()=>$P,_linkedBinding:()=>BP,_maxListeners:()=>yF,_preload_modules:()=>TF,_rawDebug:()=>CP,_startProfilerIdleNotifier:()=>aF,_stopProfilerIdleNotifier:()=>sF,_tickCallback:()=>nF,abort:()=>lF,addListener:()=>_F,allowedNodeEnvironmentFlags:()=>zP,arch:()=>gP,argv:()=>SP,argv0:()=>NF,assert:()=>WP,binding:()=>RP,chdir:()=>LP,config:()=>xP,cpuUsage:()=>mN,cwd:()=>FP,debugPort:()=>mF,default:()=>FF,dlopen:()=>qP,domain:()=>kP,emit:()=>bF,emitWarning:()=>AP,env:()=>vP,execArgv:()=>OP,execPath:()=>fF,exit:()=>JP,features:()=>XP,hasUncaughtExceptionCaptureCallback:()=>tF,hrtime:()=>fN,kill:()=>YP,listeners:()=>PF,memoryUsage:()=>QP,moduleLoadList:()=>UP,nextTick:()=>hP,off:()=>SF,on:()=>Ds,once:()=>vF,openStdin:()=>HP,pid:()=>dF,platform:()=>_P,ppid:()=>pF,prependListener:()=>AF,prependOnceListener:()=>RF,reallyExit:()=>jP,release:()=>wP,removeAllListeners:()=>DF,removeListener:()=>OF,resourceUsage:()=>GP,setSourceMapsEnabled:()=>EF,setUncaughtExceptionCaptureCallback:()=>eF,stderr:()=>uF,stdin:()=>cF,stdout:()=>oF,title:()=>IP,umask:()=>PP,uptime:()=>hF,version:()=>DP,versions:()=>bP});function II(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function Ez(){!Rl||!pc||(Rl=!1,pc.length?Os=pc.concat(Os):pN=-1,Os.length&&EP())}function EP(){if(!Rl){var e=setTimeout(Ez,0);Rl=!0;for(var t=Os.length;t;){for(pc=Os,Os=[];++pN1)for(var n=1;n{"use strict";m();T();N();Os=[],Rl=!1,pN=-1;yP.prototype.run=function(){this.fun.apply(null,this.array)};IP="browser",gP="x64",_P="browser",vP={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},SP=["/usr/bin/node"],OP=[],DP="v16.8.0",bP={},AP=function(e,t){console.warn((t?t+": ":"")+e)},RP=function(e){II("binding")},PP=function(e){return 0},FP=function(){return"/"},LP=function(e){},wP={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};CP=wr,UP=[];kP={},MP=!1,xP={};jP=wr,$P=wr,mN=function(){return{}},GP=mN,QP=mN,YP=wr,JP=wr,HP=wr,zP={};XP={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ZP=wr,eF=wr;nF=wr,rF=wr,iF=wr,aF=wr,sF=wr,oF=void 0,uF=void 0,cF=void 0,lF=wr,dF=2,pF=1,fF="/bin/usr/node",mF=9229,NF="node",TF=[],EF=wr,vu={now:typeof performance!="undefined"?performance.now.bind(performance):void 0,timing:typeof performance!="undefined"?performance.timing:void 0};vu.now===void 0&&(hI=Date.now(),vu.timing&&vu.timing.navigationStart&&(hI=vu.timing.navigationStart),vu.now=()=>Date.now()-hI);yI=1e9;fN.bigint=function(e){var t=fN(e);return typeof BigInt=="undefined"?t[0]*yI+t[1]:BigInt(t[0]*yI)+BigInt(t[1])};yF=10,IF={},gF=0;_F=Ds,vF=Ds,SF=Ds,OF=Ds,DF=Ds,bF=wr,AF=Ds,RF=Ds;FF={version:DP,versions:bP,arch:gP,platform:_P,release:wP,_rawDebug:CP,moduleLoadList:UP,binding:RP,_linkedBinding:BP,_events:IF,_eventsCount:gF,_maxListeners:yF,on:Ds,addListener:_F,once:vF,off:SF,removeListener:OF,removeAllListeners:DF,emit:bF,prependListener:AF,prependOnceListener:RF,listeners:PF,domain:kP,_exiting:MP,config:xP,dlopen:qP,uptime:hF,_getActiveRequests:VP,_getActiveHandles:KP,reallyExit:jP,_kill:$P,cpuUsage:mN,resourceUsage:GP,memoryUsage:QP,kill:YP,exit:JP,openStdin:HP,allowedNodeEnvironmentFlags:zP,assert:WP,features:XP,_fatalExceptions:ZP,setUncaughtExceptionCaptureCallback:eF,hasUncaughtExceptionCaptureCallback:tF,emitWarning:AP,nextTick:hP,_tickCallback:nF,_debugProcess:rF,_debugEnd:iF,_startProfilerIdleNotifier:aF,_stopProfilerIdleNotifier:sF,stdout:oF,stdin:cF,stderr:uF,abort:lF,umask:PP,chdir:LP,cwd:FP,env:vP,title:IP,argv:SP,execArgv:OP,pid:dF,ppid:pF,execPath:fF,debugPort:mF,hrtime:fN,argv0:NF,_preload_modules:TF,setSourceMapsEnabled:EF}});var N=lc(()=>{"use strict";LF()});function hz(){if(wF)return rp;wF=!0,rp.byteLength=u,rp.toByteArray=d,rp.fromByteArray=h;for(var e=[],t=[],n=typeof Uint8Array!="undefined"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,a=r.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var k=_.indexOf("=");k===-1&&(k=S);var B=k===S?0:4-k%4;return[k,B]}function u(_){var S=o(_),k=S[0],B=S[1];return(k+B)*3/4-B}function l(_,S,k){return(S+k)*3/4-k}function d(_){var S,k=o(_),B=k[0],K=k[1],ne=new n(l(_,B,K)),ee=0,oe=K>0?B-4:B,de;for(de=0;de>16&255,ne[ee++]=S>>8&255,ne[ee++]=S&255;return K===2&&(S=t[_.charCodeAt(de)]<<2|t[_.charCodeAt(de+1)]>>4,ne[ee++]=S&255),K===1&&(S=t[_.charCodeAt(de)]<<10|t[_.charCodeAt(de+1)]<<4|t[_.charCodeAt(de+2)]>>2,ne[ee++]=S>>8&255,ne[ee++]=S&255),ne}function p(_){return e[_>>18&63]+e[_>>12&63]+e[_>>6&63]+e[_&63]}function E(_,S,k){for(var B,K=[],ne=S;neoe?oe:ee+ne));return B===1?(S=_[k-1],K.push(e[S>>2]+e[S<<4&63]+"==")):B===2&&(S=(_[k-2]<<8)+_[k-1],K.push(e[S>>10]+e[S>>4&63]+e[S<<2&63]+"=")),K.join("")}return rp}function yz(){if(CF)return NN;CF=!0;return NN.read=function(e,t,n,r,i){var a,o,u=i*8-r-1,l=(1<>1,p=-7,E=n?i-1:0,h=n?-1:1,_=e[t+E];for(E+=h,a=_&(1<<-p)-1,_>>=-p,p+=u;p>0;a=a*256+e[t+E],E+=h,p-=8);for(o=a&(1<<-p)-1,a>>=-p,p+=r;p>0;o=o*256+e[t+E],E+=h,p-=8);if(a===0)a=1-d;else{if(a===l)return o?NaN:(_?-1:1)*(1/0);o=o+Math.pow(2,r),a=a-d}return(_?-1:1)*o*Math.pow(2,a-r)},NN.write=function(e,t,n,r,i,a){var o,u,l,d=a*8-i-1,p=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=r?0:a-1,S=r?1:-1,k=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,o=p):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+E>=1?t+=h/l:t+=h*Math.pow(2,1-E),t*l>=2&&(o++,l/=2),o+E>=p?(u=0,o=p):o+E>=1?(u=(t*l-1)*Math.pow(2,i),o=o+E):(u=t*Math.pow(2,E-1)*Math.pow(2,i),o=0));i>=8;e[n+_]=u&255,_+=S,u/=256,i-=8);for(o=o<0;e[n+_]=o&255,_+=S,o/=256,d-=8);e[n+_-S]|=k*128},NN}function Iz(){if(UF)return fc;UF=!0;let e=hz(),t=yz(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;fc.Buffer=o,fc.SlowBuffer=K,fc.INSPECT_MAX_BYTES=50;let r=2147483647;fc.kMaxLength=r,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{let P=new Uint8Array(1),g={foo:function(){return 42}};return Object.setPrototypeOf(g,Uint8Array.prototype),Object.setPrototypeOf(P,g),P.foo()===42}catch(P){return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function a(P){if(P>r)throw new RangeError('The value "'+P+'" is invalid for option "size"');let g=new Uint8Array(P);return Object.setPrototypeOf(g,o.prototype),g}function o(P,g,v){if(typeof P=="number"){if(typeof g=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(P)}return u(P,g,v)}o.poolSize=8192;function u(P,g,v){if(typeof P=="string")return E(P,g);if(ArrayBuffer.isView(P))return _(P);if(P==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P);if(Jt(P,ArrayBuffer)||P&&Jt(P.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(Jt(P,SharedArrayBuffer)||P&&Jt(P.buffer,SharedArrayBuffer)))return S(P,g,v);if(typeof P=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let x=P.valueOf&&P.valueOf();if(x!=null&&x!==P)return o.from(x,g,v);let z=k(P);if(z)return z;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof P[Symbol.toPrimitive]=="function")return o.from(P[Symbol.toPrimitive]("string"),g,v);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P)}o.from=function(P,g,v){return u(P,g,v)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function l(P){if(typeof P!="number")throw new TypeError('"size" argument must be of type number');if(P<0)throw new RangeError('The value "'+P+'" is invalid for option "size"')}function d(P,g,v){return l(P),P<=0?a(P):g!==void 0?typeof v=="string"?a(P).fill(g,v):a(P).fill(g):a(P)}o.alloc=function(P,g,v){return d(P,g,v)};function p(P){return l(P),a(P<0?0:B(P)|0)}o.allocUnsafe=function(P){return p(P)},o.allocUnsafeSlow=function(P){return p(P)};function E(P,g){if((typeof g!="string"||g==="")&&(g="utf8"),!o.isEncoding(g))throw new TypeError("Unknown encoding: "+g);let v=ne(P,g)|0,x=a(v),z=x.write(P,g);return z!==v&&(x=x.slice(0,z)),x}function h(P){let g=P.length<0?0:B(P.length)|0,v=a(g);for(let x=0;x=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return P|0}function K(P){return+P!=P&&(P=0),o.alloc(+P)}o.isBuffer=function(g){return g!=null&&g._isBuffer===!0&&g!==o.prototype},o.compare=function(g,v){if(Jt(g,Uint8Array)&&(g=o.from(g,g.offset,g.byteLength)),Jt(v,Uint8Array)&&(v=o.from(v,v.offset,v.byteLength)),!o.isBuffer(g)||!o.isBuffer(v))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(g===v)return 0;let x=g.length,z=v.length;for(let ie=0,fe=Math.min(x,z);iez.length?(o.isBuffer(fe)||(fe=o.from(fe)),fe.copy(z,ie)):Uint8Array.prototype.set.call(z,fe,ie);else if(o.isBuffer(fe))fe.copy(z,ie);else throw new TypeError('"list" argument must be an Array of Buffers');ie+=fe.length}return z};function ne(P,g){if(o.isBuffer(P))return P.length;if(ArrayBuffer.isView(P)||Jt(P,ArrayBuffer))return P.byteLength;if(typeof P!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof P);let v=P.length,x=arguments.length>2&&arguments[2]===!0;if(!x&&v===0)return 0;let z=!1;for(;;)switch(g){case"ascii":case"latin1":case"binary":return v;case"utf8":case"utf-8":return Ns(P).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v*2;case"hex":return v>>>1;case"base64":return Dr(P).length;default:if(z)return x?-1:Ns(P).length;g=(""+g).toLowerCase(),z=!0}}o.byteLength=ne;function ee(P,g,v){let x=!1;if((g===void 0||g<0)&&(g=0),g>this.length||((v===void 0||v>this.length)&&(v=this.length),v<=0)||(v>>>=0,g>>>=0,v<=g))return"";for(P||(P="utf8");;)switch(P){case"hex":return or(this,g,v);case"utf8":case"utf-8":return _n(this,g,v);case"ascii":return Yt(this,g,v);case"latin1":case"binary":return jr(this,g,v);case"base64":return Qt(this,g,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return yn(this,g,v);default:if(x)throw new TypeError("Unknown encoding: "+P);P=(P+"").toLowerCase(),x=!0}}o.prototype._isBuffer=!0;function oe(P,g,v){let x=P[g];P[g]=P[v],P[v]=x}o.prototype.swap16=function(){let g=this.length;if(g%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let v=0;vv&&(g+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(g,v,x,z,ie){if(Jt(g,Uint8Array)&&(g=o.from(g,g.offset,g.byteLength)),!o.isBuffer(g))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof g);if(v===void 0&&(v=0),x===void 0&&(x=g?g.length:0),z===void 0&&(z=0),ie===void 0&&(ie=this.length),v<0||x>g.length||z<0||ie>this.length)throw new RangeError("out of range index");if(z>=ie&&v>=x)return 0;if(z>=ie)return-1;if(v>=x)return 1;if(v>>>=0,x>>>=0,z>>>=0,ie>>>=0,this===g)return 0;let fe=ie-z,gt=x-v,In=Math.min(fe,gt),cn=this.slice(z,ie),bn=g.slice(v,x);for(let on=0;on2147483647?v=2147483647:v<-2147483648&&(v=-2147483648),v=+v,br(v)&&(v=z?0:P.length-1),v<0&&(v=P.length+v),v>=P.length){if(z)return-1;v=P.length-1}else if(v<0)if(z)v=0;else return-1;if(typeof g=="string"&&(g=o.from(g,x)),o.isBuffer(g))return g.length===0?-1:me(P,g,v,x,z);if(typeof g=="number")return g=g&255,typeof Uint8Array.prototype.indexOf=="function"?z?Uint8Array.prototype.indexOf.call(P,g,v):Uint8Array.prototype.lastIndexOf.call(P,g,v):me(P,[g],v,x,z);throw new TypeError("val must be string, number or Buffer")}function me(P,g,v,x,z){let ie=1,fe=P.length,gt=g.length;if(x!==void 0&&(x=String(x).toLowerCase(),x==="ucs2"||x==="ucs-2"||x==="utf16le"||x==="utf-16le")){if(P.length<2||g.length<2)return-1;ie=2,fe/=2,gt/=2,v/=2}function In(bn,on){return ie===1?bn[on]:bn.readUInt16BE(on*ie)}let cn;if(z){let bn=-1;for(cn=v;cnfe&&(v=fe-gt),cn=v;cn>=0;cn--){let bn=!0;for(let on=0;onz&&(x=z)):x=z;let ie=g.length;x>ie/2&&(x=ie/2);let fe;for(fe=0;fe>>0,isFinite(x)?(x=x>>>0,z===void 0&&(z="utf8")):(z=x,x=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let ie=this.length-v;if((x===void 0||x>ie)&&(x=ie),g.length>0&&(x<0||v<0)||v>this.length)throw new RangeError("Attempt to write outside buffer bounds");z||(z="utf8");let fe=!1;for(;;)switch(z){case"hex":return pe(this,g,v,x);case"utf8":case"utf-8":return ge(this,g,v,x);case"ascii":case"latin1":case"binary":return H(this,g,v,x);case"base64":return he(this,g,v,x);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Je(this,g,v,x);default:if(fe)throw new TypeError("Unknown encoding: "+z);z=(""+z).toLowerCase(),fe=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Qt(P,g,v){return g===0&&v===P.length?e.fromByteArray(P):e.fromByteArray(P.slice(g,v))}function _n(P,g,v){v=Math.min(P.length,v);let x=[],z=g;for(;z239?4:ie>223?3:ie>191?2:1;if(z+gt<=v){let In,cn,bn,on;switch(gt){case 1:ie<128&&(fe=ie);break;case 2:In=P[z+1],(In&192)===128&&(on=(ie&31)<<6|In&63,on>127&&(fe=on));break;case 3:In=P[z+1],cn=P[z+2],(In&192)===128&&(cn&192)===128&&(on=(ie&15)<<12|(In&63)<<6|cn&63,on>2047&&(on<55296||on>57343)&&(fe=on));break;case 4:In=P[z+1],cn=P[z+2],bn=P[z+3],(In&192)===128&&(cn&192)===128&&(bn&192)===128&&(on=(ie&15)<<18|(In&63)<<12|(cn&63)<<6|bn&63,on>65535&&on<1114112&&(fe=on))}}fe===null?(fe=65533,gt=1):fe>65535&&(fe-=65536,x.push(fe>>>10&1023|55296),fe=56320|fe&1023),x.push(fe),z+=gt}return bt(x)}let hn=4096;function bt(P){let g=P.length;if(g<=hn)return String.fromCharCode.apply(String,P);let v="",x=0;for(;xx)&&(v=x);let z="";for(let ie=g;iex&&(g=x),v<0?(v+=x,v<0&&(v=0)):v>x&&(v=x),vv)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(g,v,x){g=g>>>0,v=v>>>0,x||tn(g,v,this.length);let z=this[g],ie=1,fe=0;for(;++fe>>0,v=v>>>0,x||tn(g,v,this.length);let z=this[g+--v],ie=1;for(;v>0&&(ie*=256);)z+=this[g+--v]*ie;return z},o.prototype.readUint8=o.prototype.readUInt8=function(g,v){return g=g>>>0,v||tn(g,1,this.length),this[g]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(g,v){return g=g>>>0,v||tn(g,2,this.length),this[g]|this[g+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(g,v){return g=g>>>0,v||tn(g,2,this.length),this[g]<<8|this[g+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(g,v){return g=g>>>0,v||tn(g,4,this.length),(this[g]|this[g+1]<<8|this[g+2]<<16)+this[g+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(g,v){return g=g>>>0,v||tn(g,4,this.length),this[g]*16777216+(this[g+1]<<16|this[g+2]<<8|this[g+3])},o.prototype.readBigUInt64LE=Ma(function(g){g=g>>>0,ot(g,"offset");let v=this[g],x=this[g+7];(v===void 0||x===void 0)&&Bt(g,this.length-8);let z=v+this[++g]*ln(2,8)+this[++g]*ln(2,16)+this[++g]*ln(2,24),ie=this[++g]+this[++g]*ln(2,8)+this[++g]*ln(2,16)+x*ln(2,24);return BigInt(z)+(BigInt(ie)<>>0,ot(g,"offset");let v=this[g],x=this[g+7];(v===void 0||x===void 0)&&Bt(g,this.length-8);let z=v*ln(2,24)+this[++g]*ln(2,16)+this[++g]*ln(2,8)+this[++g],ie=this[++g]*ln(2,24)+this[++g]*ln(2,16)+this[++g]*ln(2,8)+x;return(BigInt(z)<>>0,v=v>>>0,x||tn(g,v,this.length);let z=this[g],ie=1,fe=0;for(;++fe=ie&&(z-=Math.pow(2,8*v)),z},o.prototype.readIntBE=function(g,v,x){g=g>>>0,v=v>>>0,x||tn(g,v,this.length);let z=v,ie=1,fe=this[g+--z];for(;z>0&&(ie*=256);)fe+=this[g+--z]*ie;return ie*=128,fe>=ie&&(fe-=Math.pow(2,8*v)),fe},o.prototype.readInt8=function(g,v){return g=g>>>0,v||tn(g,1,this.length),this[g]&128?(255-this[g]+1)*-1:this[g]},o.prototype.readInt16LE=function(g,v){g=g>>>0,v||tn(g,2,this.length);let x=this[g]|this[g+1]<<8;return x&32768?x|4294901760:x},o.prototype.readInt16BE=function(g,v){g=g>>>0,v||tn(g,2,this.length);let x=this[g+1]|this[g]<<8;return x&32768?x|4294901760:x},o.prototype.readInt32LE=function(g,v){return g=g>>>0,v||tn(g,4,this.length),this[g]|this[g+1]<<8|this[g+2]<<16|this[g+3]<<24},o.prototype.readInt32BE=function(g,v){return g=g>>>0,v||tn(g,4,this.length),this[g]<<24|this[g+1]<<16|this[g+2]<<8|this[g+3]},o.prototype.readBigInt64LE=Ma(function(g){g=g>>>0,ot(g,"offset");let v=this[g],x=this[g+7];(v===void 0||x===void 0)&&Bt(g,this.length-8);let z=this[g+4]+this[g+5]*ln(2,8)+this[g+6]*ln(2,16)+(x<<24);return(BigInt(z)<>>0,ot(g,"offset");let v=this[g],x=this[g+7];(v===void 0||x===void 0)&&Bt(g,this.length-8);let z=(v<<24)+this[++g]*ln(2,16)+this[++g]*ln(2,8)+this[++g];return(BigInt(z)<>>0,v||tn(g,4,this.length),t.read(this,g,!0,23,4)},o.prototype.readFloatBE=function(g,v){return g=g>>>0,v||tn(g,4,this.length),t.read(this,g,!1,23,4)},o.prototype.readDoubleLE=function(g,v){return g=g>>>0,v||tn(g,8,this.length),t.read(this,g,!0,52,8)},o.prototype.readDoubleBE=function(g,v){return g=g>>>0,v||tn(g,8,this.length),t.read(this,g,!1,52,8)};function kn(P,g,v,x,z,ie){if(!o.isBuffer(P))throw new TypeError('"buffer" argument must be a Buffer instance');if(g>z||gP.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(g,v,x,z){if(g=+g,v=v>>>0,x=x>>>0,!z){let gt=Math.pow(2,8*x)-1;kn(this,g,v,x,gt,0)}let ie=1,fe=0;for(this[v]=g&255;++fe>>0,x=x>>>0,!z){let gt=Math.pow(2,8*x)-1;kn(this,g,v,x,gt,0)}let ie=x-1,fe=1;for(this[v+ie]=g&255;--ie>=0&&(fe*=256);)this[v+ie]=g/fe&255;return v+x},o.prototype.writeUint8=o.prototype.writeUInt8=function(g,v,x){return g=+g,v=v>>>0,x||kn(this,g,v,1,255,0),this[v]=g&255,v+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(g,v,x){return g=+g,v=v>>>0,x||kn(this,g,v,2,65535,0),this[v]=g&255,this[v+1]=g>>>8,v+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(g,v,x){return g=+g,v=v>>>0,x||kn(this,g,v,2,65535,0),this[v]=g>>>8,this[v+1]=g&255,v+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(g,v,x){return g=+g,v=v>>>0,x||kn(this,g,v,4,4294967295,0),this[v+3]=g>>>24,this[v+2]=g>>>16,this[v+1]=g>>>8,this[v]=g&255,v+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(g,v,x){return g=+g,v=v>>>0,x||kn(this,g,v,4,4294967295,0),this[v]=g>>>24,this[v+1]=g>>>16,this[v+2]=g>>>8,this[v+3]=g&255,v+4};function ce(P,g,v,x,z){Vt(g,x,z,P,v,7);let ie=Number(g&BigInt(4294967295));P[v++]=ie,ie=ie>>8,P[v++]=ie,ie=ie>>8,P[v++]=ie,ie=ie>>8,P[v++]=ie;let fe=Number(g>>BigInt(32)&BigInt(4294967295));return P[v++]=fe,fe=fe>>8,P[v++]=fe,fe=fe>>8,P[v++]=fe,fe=fe>>8,P[v++]=fe,v}function Le(P,g,v,x,z){Vt(g,x,z,P,v,7);let ie=Number(g&BigInt(4294967295));P[v+7]=ie,ie=ie>>8,P[v+6]=ie,ie=ie>>8,P[v+5]=ie,ie=ie>>8,P[v+4]=ie;let fe=Number(g>>BigInt(32)&BigInt(4294967295));return P[v+3]=fe,fe=fe>>8,P[v+2]=fe,fe=fe>>8,P[v+1]=fe,fe=fe>>8,P[v]=fe,v+8}o.prototype.writeBigUInt64LE=Ma(function(g,v=0){return ce(this,g,v,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=Ma(function(g,v=0){return Le(this,g,v,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(g,v,x,z){if(g=+g,v=v>>>0,!z){let In=Math.pow(2,8*x-1);kn(this,g,v,x,In-1,-In)}let ie=0,fe=1,gt=0;for(this[v]=g&255;++ie>0)-gt&255;return v+x},o.prototype.writeIntBE=function(g,v,x,z){if(g=+g,v=v>>>0,!z){let In=Math.pow(2,8*x-1);kn(this,g,v,x,In-1,-In)}let ie=x-1,fe=1,gt=0;for(this[v+ie]=g&255;--ie>=0&&(fe*=256);)g<0&>===0&&this[v+ie+1]!==0&&(gt=1),this[v+ie]=(g/fe>>0)-gt&255;return v+x},o.prototype.writeInt8=function(g,v,x){return g=+g,v=v>>>0,x||kn(this,g,v,1,127,-128),g<0&&(g=255+g+1),this[v]=g&255,v+1},o.prototype.writeInt16LE=function(g,v,x){return g=+g,v=v>>>0,x||kn(this,g,v,2,32767,-32768),this[v]=g&255,this[v+1]=g>>>8,v+2},o.prototype.writeInt16BE=function(g,v,x){return g=+g,v=v>>>0,x||kn(this,g,v,2,32767,-32768),this[v]=g>>>8,this[v+1]=g&255,v+2},o.prototype.writeInt32LE=function(g,v,x){return g=+g,v=v>>>0,x||kn(this,g,v,4,2147483647,-2147483648),this[v]=g&255,this[v+1]=g>>>8,this[v+2]=g>>>16,this[v+3]=g>>>24,v+4},o.prototype.writeInt32BE=function(g,v,x){return g=+g,v=v>>>0,x||kn(this,g,v,4,2147483647,-2147483648),g<0&&(g=4294967295+g+1),this[v]=g>>>24,this[v+1]=g>>>16,this[v+2]=g>>>8,this[v+3]=g&255,v+4},o.prototype.writeBigInt64LE=Ma(function(g,v=0){return ce(this,g,v,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=Ma(function(g,v=0){return Le(this,g,v,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Se(P,g,v,x,z,ie){if(v+x>P.length)throw new RangeError("Index out of range");if(v<0)throw new RangeError("Index out of range")}function Me(P,g,v,x,z){return g=+g,v=v>>>0,z||Se(P,g,v,4),t.write(P,g,v,x,23,4),v+4}o.prototype.writeFloatLE=function(g,v,x){return Me(this,g,v,!0,x)},o.prototype.writeFloatBE=function(g,v,x){return Me(this,g,v,!1,x)};function Pt(P,g,v,x,z){return g=+g,v=v>>>0,z||Se(P,g,v,8),t.write(P,g,v,x,52,8),v+8}o.prototype.writeDoubleLE=function(g,v,x){return Pt(this,g,v,!0,x)},o.prototype.writeDoubleBE=function(g,v,x){return Pt(this,g,v,!1,x)},o.prototype.copy=function(g,v,x,z){if(!o.isBuffer(g))throw new TypeError("argument should be a Buffer");if(x||(x=0),!z&&z!==0&&(z=this.length),v>=g.length&&(v=g.length),v||(v=0),z>0&&z=this.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("sourceEnd out of bounds");z>this.length&&(z=this.length),g.length-v>>0,x=x===void 0?this.length:x>>>0,g||(g=0);let ie;if(typeof g=="number")for(ie=v;ieln(2,32)?z=je(String(v)):typeof v=="bigint"&&(z=String(v),(v>ln(BigInt(2),BigInt(32))||v<-ln(BigInt(2),BigInt(32)))&&(z=je(z)),z+="n"),x+=` It must be ${g}. Received ${z}`,x},RangeError);function je(P){let g="",v=P.length,x=P[0]==="-"?1:0;for(;v>=x+4;v-=3)g=`_${P.slice(v-3,v)}${g}`;return`${P.slice(0,v)}${g}`}function We(P,g,v){ot(g,"offset"),(P[g]===void 0||P[g+v]===void 0)&&Bt(g,P.length-(v+1))}function Vt(P,g,v,x,z,ie){if(P>v||P3?g===0||g===BigInt(0)?gt=`>= 0${fe} and < 2${fe} ** ${(ie+1)*8}${fe}`:gt=`>= -(2${fe} ** ${(ie+1)*8-1}${fe}) and < 2 ** ${(ie+1)*8-1}${fe}`:gt=`>= ${g}${fe} and <= ${v}${fe}`,new Z.ERR_OUT_OF_RANGE("value",gt,P)}We(x,z,ie)}function ot(P,g){if(typeof P!="number")throw new Z.ERR_INVALID_ARG_TYPE(g,"number",P)}function Bt(P,g,v){throw Math.floor(P)!==P?(ot(P,v),new Z.ERR_OUT_OF_RANGE(v||"offset","an integer",P)):g<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(v||"offset",`>= ${v?1:0} and <= ${g}`,P)}let ms=/[^+/0-9A-Za-z-_]/g;function ti(P){if(P=P.split("=")[0],P=P.trim().replace(ms,""),P.length<2)return"";for(;P.length%4!==0;)P=P+"=";return P}function Ns(P,g){g=g||1/0;let v,x=P.length,z=null,ie=[];for(let fe=0;fe55295&&v<57344){if(!z){if(v>56319){(g-=3)>-1&&ie.push(239,191,189);continue}else if(fe+1===x){(g-=3)>-1&&ie.push(239,191,189);continue}z=v;continue}if(v<56320){(g-=3)>-1&&ie.push(239,191,189),z=v;continue}v=(z-55296<<10|v-56320)+65536}else z&&(g-=3)>-1&&ie.push(239,191,189);if(z=null,v<128){if((g-=1)<0)break;ie.push(v)}else if(v<2048){if((g-=2)<0)break;ie.push(v>>6|192,v&63|128)}else if(v<65536){if((g-=3)<0)break;ie.push(v>>12|224,v>>6&63|128,v&63|128)}else if(v<1114112){if((g-=4)<0)break;ie.push(v>>18|240,v>>12&63|128,v>>6&63|128,v&63|128)}else throw new Error("Invalid code point")}return ie}function ml(P){let g=[];for(let v=0;v>8,z=v%256,ie.push(z),ie.push(x);return ie}function Dr(P){return e.toByteArray(ti(P))}function mi(P,g,v,x){let z;for(z=0;z=g.length||z>=P.length);++z)g[z+v]=P[z];return z}function Jt(P,g){return P instanceof g||P!=null&&P.constructor!=null&&P.constructor.name!=null&&P.constructor.name===g.name}function br(P){return P!==P}let Zu=function(){let P="0123456789abcdef",g=new Array(256);for(let v=0;v<16;++v){let x=v*16;for(let z=0;z<16;++z)g[x+z]=P[v]+P[z]}return g}();function Ma(P){return typeof BigInt=="undefined"?ec:P}function ec(){throw new Error("BigInt not supported")}return fc}var rp,wF,NN,CF,fc,UF,mc,A,fNe,mNe,BF=lc(()=>{"use strict";m();T();N();rp={},wF=!1;NN={},CF=!1;fc={},UF=!1;mc=Iz();mc.Buffer;mc.SlowBuffer;mc.INSPECT_MAX_BYTES;mc.kMaxLength;A=mc.Buffer,fNe=mc.INSPECT_MAX_BYTES,mNe=mc.kMaxLength});var T=lc(()=>{"use strict";BF()});var kF=F(Pl=>{"use strict";m();T();N();Object.defineProperty(Pl,"__esModule",{value:!0});Pl.versionInfo=Pl.version=void 0;var gz="16.9.0";Pl.version=gz;var _z=Object.freeze({major:16,minor:9,patch:0,preReleaseTag:null});Pl.versionInfo=_z});var Yr=F(gI=>{"use strict";m();T();N();Object.defineProperty(gI,"__esModule",{value:!0});gI.devAssert=vz;function vz(e,t){if(!!!e)throw new Error(t)}});var TN=F(_I=>{"use strict";m();T();N();Object.defineProperty(_I,"__esModule",{value:!0});_I.isPromise=Sz;function Sz(e){return typeof(e==null?void 0:e.then)=="function"}});var Ka=F(vI=>{"use strict";m();T();N();Object.defineProperty(vI,"__esModule",{value:!0});vI.isObjectLike=Oz;function Oz(e){return typeof e=="object"&&e!==null}});var Cr=F(SI=>{"use strict";m();T();N();Object.defineProperty(SI,"__esModule",{value:!0});SI.invariant=Dz;function Dz(e,t){if(!!!e)throw new Error(t!=null?t:"Unexpected invariant triggered.")}});var EN=F(OI=>{"use strict";m();T();N();Object.defineProperty(OI,"__esModule",{value:!0});OI.getLocation=Rz;var bz=Cr(),Az=/\r\n|[\n\r]/g;function Rz(e,t){let n=0,r=1;for(let i of e.body.matchAll(Az)){if(typeof i.index=="number"||(0,bz.invariant)(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}});var DI=F(hN=>{"use strict";m();T();N();Object.defineProperty(hN,"__esModule",{value:!0});hN.printLocation=Fz;hN.printSourceLocation=xF;var Pz=EN();function Fz(e){return xF(e.source,(0,Pz.getLocation)(e.source,e.start))}function xF(e,t){let n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,u=t.line===1?n:0,l=t.column+u,d=`${e.name}:${o}:${l} +`,p=r.split(/\r\n|[\n\r]/g),E=p[i];if(E.length>120){let h=Math.floor(l/80),_=l%80,S=[];for(let k=0;k["|",k]),["|","^".padStart(_)],["|",S[h+1]]])}return d+MF([[`${o-1} |`,p[i-1]],[`${o} |`,E],["|","^".padStart(l)],[`${o+1} |`,p[i+1]]])}function MF(e){let t=e.filter(([r,i])=>i!==void 0),n=Math.max(...t.map(([r])=>r.length));return t.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(` +`)}});var tt=F(Fl=>{"use strict";m();T();N();Object.defineProperty(Fl,"__esModule",{value:!0});Fl.GraphQLError=void 0;Fl.formatError=Uz;Fl.printError=Cz;var Lz=Ka(),qF=EN(),VF=DI();function wz(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var bI=class e extends Error{constructor(t,...n){var r,i,a;let{nodes:o,source:u,positions:l,path:d,originalError:p,extensions:E}=wz(n);super(t),this.name="GraphQLError",this.path=d!=null?d:void 0,this.originalError=p!=null?p:void 0,this.nodes=KF(Array.isArray(o)?o:o?[o]:void 0);let h=KF((r=this.nodes)===null||r===void 0?void 0:r.map(S=>S.loc).filter(S=>S!=null));this.source=u!=null?u:h==null||(i=h[0])===null||i===void 0?void 0:i.source,this.positions=l!=null?l:h==null?void 0:h.map(S=>S.start),this.locations=l&&u?l.map(S=>(0,qF.getLocation)(u,S)):h==null?void 0:h.map(S=>(0,qF.getLocation)(S.source,S.start));let _=(0,Lz.isObjectLike)(p==null?void 0:p.extensions)?p==null?void 0:p.extensions:void 0;this.extensions=(a=E!=null?E:_)!==null&&a!==void 0?a:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),p!=null&&p.stack?Object.defineProperty(this,"stack",{value:p.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` -`+(0,SF.printLocation)(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` +`+(0,VF.printLocation)(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` -`+(0,SF.printSourceLocation)(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};_l.GraphQLError=pI;function OF(e){return e===void 0||e.length===0?void 0:e}function IH(e){return e.toString()}function gH(e){return e.toJSON()}});var aN=F(mI=>{"use strict";m();T();N();Object.defineProperty(mI,"__esModule",{value:!0});mI.syntaxError=vH;var _H=Ze();function vH(e,t,n){return new _H.GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}});var ja=F(Ui=>{"use strict";m();T();N();Object.defineProperty(Ui,"__esModule",{value:!0});Ui.Token=Ui.QueryDocumentKeys=Ui.OperationTypeNode=Ui.Location=void 0;Ui.isNode=OH;var NI=class{constructor(t,n,r){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}};Ui.Location=NI;var TI=class{constructor(t,n,r,i,a,o){this.kind=t,this.start=n,this.end=r,this.line=i,this.column=a,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}};Ui.Token=TI;var DF={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};Ui.QueryDocumentKeys=DF;var SH=new Set(Object.keys(DF));function OH(e){let t=e==null?void 0:e.kind;return typeof t=="string"&&SH.has(t)}var EI;Ui.OperationTypeNode=EI;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(EI||(Ui.OperationTypeNode=EI={}))});var vl=F(Hd=>{"use strict";m();T();N();Object.defineProperty(Hd,"__esModule",{value:!0});Hd.DirectiveLocation=void 0;var hI;Hd.DirectiveLocation=hI;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(hI||(Hd.DirectiveLocation=hI={}))});var Ut=F(Wd=>{"use strict";m();T();N();Object.defineProperty(Wd,"__esModule",{value:!0});Wd.Kind=void 0;var yI;Wd.Kind=yI;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(yI||(Wd.Kind=yI={}))});var sN=F(oc=>{"use strict";m();T();N();Object.defineProperty(oc,"__esModule",{value:!0});oc.isDigit=bF;oc.isLetter=II;oc.isNameContinue=AH;oc.isNameStart=bH;oc.isWhiteSpace=DH;function DH(e){return e===9||e===32}function bF(e){return e>=48&&e<=57}function II(e){return e>=97&&e<=122||e>=65&&e<=90}function bH(e){return II(e)||e===95}function AH(e){return II(e)||bF(e)||e===95}});var Zd=F(Xd=>{"use strict";m();T();N();Object.defineProperty(Xd,"__esModule",{value:!0});Xd.dedentBlockStringLines=RH;Xd.isPrintableAsBlockString=FH;Xd.printBlockString=wH;var gI=sN();function RH(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;ou===0?o:o.slice(n)).slice((t=r)!==null&&t!==void 0?t:0,i+1)}function PH(e){let t=0;for(;t1&&r.slice(1).every(v=>v.length===0||(0,gI.isWhiteSpace)(v.charCodeAt(0))),o=n.endsWith('\\"""'),u=e.endsWith('"')&&!o,l=e.endsWith("\\"),d=u||l,p=!(t!=null&&t.minimize)&&(!i||e.length>70||d||a||o),E="",h=i&&(0,gI.isWhiteSpace)(e.charCodeAt(0));return(p&&!h||a)&&(E+=` +`+(0,VF.printSourceLocation)(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};Fl.GraphQLError=bI;function KF(e){return e===void 0||e.length===0?void 0:e}function Cz(e){return e.toString()}function Uz(e){return e.toJSON()}});var yN=F(AI=>{"use strict";m();T();N();Object.defineProperty(AI,"__esModule",{value:!0});AI.syntaxError=kz;var Bz=tt();function kz(e,t,n){return new Bz.GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}});var ja=F(ki=>{"use strict";m();T();N();Object.defineProperty(ki,"__esModule",{value:!0});ki.Token=ki.QueryDocumentKeys=ki.OperationTypeNode=ki.Location=void 0;ki.isNode=xz;var RI=class{constructor(t,n,r){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}};ki.Location=RI;var PI=class{constructor(t,n,r,i,a,o){this.kind=t,this.start=n,this.end=r,this.line=i,this.column=a,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}};ki.Token=PI;var jF={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};ki.QueryDocumentKeys=jF;var Mz=new Set(Object.keys(jF));function xz(e){let t=e==null?void 0:e.kind;return typeof t=="string"&&Mz.has(t)}var FI;ki.OperationTypeNode=FI;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(FI||(ki.OperationTypeNode=FI={}))});var Ll=F(ip=>{"use strict";m();T();N();Object.defineProperty(ip,"__esModule",{value:!0});ip.DirectiveLocation=void 0;var LI;ip.DirectiveLocation=LI;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(LI||(ip.DirectiveLocation=LI={}))});var Mt=F(ap=>{"use strict";m();T();N();Object.defineProperty(ap,"__esModule",{value:!0});ap.Kind=void 0;var wI;ap.Kind=wI;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(wI||(ap.Kind=wI={}))});var IN=F(Nc=>{"use strict";m();T();N();Object.defineProperty(Nc,"__esModule",{value:!0});Nc.isDigit=$F;Nc.isLetter=CI;Nc.isNameContinue=Kz;Nc.isNameStart=Vz;Nc.isWhiteSpace=qz;function qz(e){return e===9||e===32}function $F(e){return e>=48&&e<=57}function CI(e){return e>=97&&e<=122||e>=65&&e<=90}function Vz(e){return CI(e)||e===95}function Kz(e){return CI(e)||$F(e)||e===95}});var op=F(sp=>{"use strict";m();T();N();Object.defineProperty(sp,"__esModule",{value:!0});sp.dedentBlockStringLines=jz;sp.isPrintableAsBlockString=Gz;sp.printBlockString=Qz;var UI=IN();function jz(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;ou===0?o:o.slice(n)).slice((t=r)!==null&&t!==void 0?t:0,i+1)}function $z(e){let t=0;for(;t1&&r.slice(1).every(_=>_.length===0||(0,UI.isWhiteSpace)(_.charCodeAt(0))),o=n.endsWith('\\"""'),u=e.endsWith('"')&&!o,l=e.endsWith("\\"),d=u||l,p=!(t!=null&&t.minimize)&&(!i||e.length>70||d||a||o),E="",h=i&&(0,UI.isWhiteSpace)(e.charCodeAt(0));return(p&&!h||a)&&(E+=` `),E+=n,(p||d)&&(E+=` -`),'"""'+E+'"""'}});var tf=F(ef=>{"use strict";m();T();N();Object.defineProperty(ef,"__esModule",{value:!0});ef.TokenKind=void 0;var _I;ef.TokenKind=_I;(function(e){e.SOF="",e.EOF="",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(_I||(ef.TokenKind=_I={}))});var uN=F(rf=>{"use strict";m();T();N();Object.defineProperty(rf,"__esModule",{value:!0});rf.Lexer=void 0;rf.isPunctuatorTokenKind=CH;var la=aN(),RF=ja(),LH=Zd(),uc=sN(),St=tf(),SI=class{constructor(t){let n=new RF.Token(St.TokenKind.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==St.TokenKind.EOF)do if(t.next)t=t.next;else{let n=UH(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===St.TokenKind.COMMENT);return t}};rf.Lexer=SI;function CH(e){return e===St.TokenKind.BANG||e===St.TokenKind.DOLLAR||e===St.TokenKind.AMP||e===St.TokenKind.PAREN_L||e===St.TokenKind.PAREN_R||e===St.TokenKind.SPREAD||e===St.TokenKind.COLON||e===St.TokenKind.EQUALS||e===St.TokenKind.AT||e===St.TokenKind.BRACKET_L||e===St.TokenKind.BRACKET_R||e===St.TokenKind.BRACE_L||e===St.TokenKind.PIPE||e===St.TokenKind.BRACE_R}function Sl(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function oN(e,t){return PF(e.charCodeAt(t))&&FF(e.charCodeAt(t+1))}function PF(e){return e>=55296&&e<=56319}function FF(e){return e>=56320&&e<=57343}function cc(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return St.TokenKind.EOF;if(n>=32&&n<=126){let r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function zn(e,t,n,r,i){let a=e.line,o=1+n-e.lineStart;return new RF.Token(t,n,r,a,o,i)}function UH(e,t){let n=e.source.body,r=n.length,i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function VH(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` -`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw(0,la.syntaxError)(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function jH(e,t){let n=e.source.body,r=n.length,i=e.lineStart,a=t+3,o=a,u="",l=[];for(;a{"use strict";m();T();N();Object.defineProperty(OI,"__esModule",{value:!0});OI.inspect=GH;var $H=10,wF=2;function GH(e){return cN(e,[])}function cN(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return QH(e,t);default:return String(e)}}function QH(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(YH(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:cN(r,n)}else if(Array.isArray(e))return zH(e,n);return JH(e,n)}function YH(e){return typeof e.toJSON=="function"}function JH(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>wF?"["+HH(e)+"]":"{ "+n.map(([i,a])=>i+": "+cN(a,t)).join(", ")+" }"}function zH(e,t){if(e.length===0)return"[]";if(t.length>wF)return"[Array]";let n=Math.min($H,e.length),r=e.length-n,i=[];for(let a=0;a1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function HH(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}});var af=F(lN=>{"use strict";m();T();N();Object.defineProperty(lN,"__esModule",{value:!0});lN.instanceOf=void 0;var WH=nn(),XH=globalThis.process&&O.env.NODE_ENV==="production",ZH=XH?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var r;let i=n.prototype[Symbol.toStringTag],a=Symbol.toStringTag in t?t[Symbol.toStringTag]:(r=t.constructor)===null||r===void 0?void 0:r.name;if(i===a){let o=(0,WH.inspect)(t);throw new Error(`Cannot use ${i} "${o}" from another module or realm. +`),'"""'+E+'"""'}});var cp=F(up=>{"use strict";m();T();N();Object.defineProperty(up,"__esModule",{value:!0});up.TokenKind=void 0;var BI;up.TokenKind=BI;(function(e){e.SOF="",e.EOF="",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(BI||(up.TokenKind=BI={}))});var _N=F(dp=>{"use strict";m();T();N();Object.defineProperty(dp,"__esModule",{value:!0});dp.Lexer=void 0;dp.isPunctuatorTokenKind=Jz;var pa=yN(),QF=ja(),Yz=op(),Tc=IN(),Dt=cp(),MI=class{constructor(t){let n=new QF.Token(Dt.TokenKind.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==Dt.TokenKind.EOF)do if(t.next)t=t.next;else{let n=Hz(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===Dt.TokenKind.COMMENT);return t}};dp.Lexer=MI;function Jz(e){return e===Dt.TokenKind.BANG||e===Dt.TokenKind.DOLLAR||e===Dt.TokenKind.AMP||e===Dt.TokenKind.PAREN_L||e===Dt.TokenKind.PAREN_R||e===Dt.TokenKind.SPREAD||e===Dt.TokenKind.COLON||e===Dt.TokenKind.EQUALS||e===Dt.TokenKind.AT||e===Dt.TokenKind.BRACKET_L||e===Dt.TokenKind.BRACKET_R||e===Dt.TokenKind.BRACE_L||e===Dt.TokenKind.PIPE||e===Dt.TokenKind.BRACE_R}function wl(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function gN(e,t){return YF(e.charCodeAt(t))&&JF(e.charCodeAt(t+1))}function YF(e){return e>=55296&&e<=56319}function JF(e){return e>=56320&&e<=57343}function Ec(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return Dt.TokenKind.EOF;if(n>=32&&n<=126){let r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Xn(e,t,n,r,i){let a=e.line,o=1+n-e.lineStart;return new QF.Token(t,n,r,a,o,i)}function Hz(e,t){let n=e.source.body,r=n.length,i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function tW(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` +`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw(0,pa.syntaxError)(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function nW(e,t){let n=e.source.body,r=n.length,i=e.lineStart,a=t+3,o=a,u="",l=[];for(;a{"use strict";m();T();N();Object.defineProperty(xI,"__esModule",{value:!0});xI.inspect=aW;var iW=10,HF=2;function aW(e){return vN(e,[])}function vN(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return sW(e,t);default:return String(e)}}function sW(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(oW(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:vN(r,n)}else if(Array.isArray(e))return cW(e,n);return uW(e,n)}function oW(e){return typeof e.toJSON=="function"}function uW(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>HF?"["+lW(e)+"]":"{ "+n.map(([i,a])=>i+": "+vN(a,t)).join(", ")+" }"}function cW(e,t){if(e.length===0)return"[]";if(t.length>HF)return"[Array]";let n=Math.min(iW,e.length),r=e.length-n,i=[];for(let a=0;a1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function lW(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}});var pp=F(SN=>{"use strict";m();T();N();Object.defineProperty(SN,"__esModule",{value:!0});SN.instanceOf=void 0;var dW=rn(),pW=globalThis.process&&D.env.NODE_ENV==="production",fW=pW?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var r;let i=n.prototype[Symbol.toStringTag],a=Symbol.toStringTag in t?t[Symbol.toStringTag]:(r=t.constructor)===null||r===void 0?void 0:r.name;if(i===a){let o=(0,dW.inspect)(t);throw new Error(`Cannot use ${i} "${o}" from another module or realm. Ensure that there is only one instance of "graphql" in the node_modules directory. If different versions of "graphql" are the dependencies of other @@ -36,42 +36,42 @@ https://yarnpkg.com/en/docs/selective-version-resolutions Duplicate "graphql" modules cannot be used at the same time since different versions may have different capabilities and behavior. The data from one version used in the function from another could produce confusing and -spurious results.`)}}return!1};lN.instanceOf=ZH});var fN=F(sf=>{"use strict";m();T();N();Object.defineProperty(sf,"__esModule",{value:!0});sf.Source=void 0;sf.isSource=n3;var DI=$r(),e3=nn(),t3=af(),dN=class{constructor(t,n="GraphQL request",r={line:1,column:1}){typeof t=="string"||(0,DI.devAssert)(!1,`Body must be a string. Received: ${(0,e3.inspect)(t)}.`),this.body=t,this.name=n,this.locationOffset=r,this.locationOffset.line>0||(0,DI.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,DI.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};sf.Source=dN;function n3(e){return(0,t3.instanceOf)(e,dN)}});var Ol=F(Eu=>{"use strict";m();T();N();Object.defineProperty(Eu,"__esModule",{value:!0});Eu.Parser=void 0;Eu.parse=i3;Eu.parseConstValue=s3;Eu.parseType=o3;Eu.parseValue=a3;var lc=aN(),of=ja(),r3=vl(),ct=Ut(),CF=uN(),LF=fN(),be=tf();function i3(e,t){return new dc(e,t).parseDocument()}function a3(e,t){let n=new dc(e,t);n.expectToken(be.TokenKind.SOF);let r=n.parseValueLiteral(!1);return n.expectToken(be.TokenKind.EOF),r}function s3(e,t){let n=new dc(e,t);n.expectToken(be.TokenKind.SOF);let r=n.parseConstValueLiteral();return n.expectToken(be.TokenKind.EOF),r}function o3(e,t){let n=new dc(e,t);n.expectToken(be.TokenKind.SOF);let r=n.parseTypeReference();return n.expectToken(be.TokenKind.EOF),r}var dc=class{constructor(t,n={}){let r=(0,LF.isSource)(t)?t:new LF.Source(t);this._lexer=new CF.Lexer(r),this._options=n,this._tokenCounter=0}parseName(){let t=this.expectToken(be.TokenKind.NAME);return this.node(t,{kind:ct.Kind.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:ct.Kind.DOCUMENT,definitions:this.many(be.TokenKind.SOF,this.parseDefinition,be.TokenKind.EOF)})}parseDefinition(){if(this.peek(be.TokenKind.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===be.TokenKind.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw(0,lc.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(be.TokenKind.BRACE_L))return this.node(t,{kind:ct.Kind.OPERATION_DEFINITION,operation:of.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),r;return this.peek(be.TokenKind.NAME)&&(r=this.parseName()),this.node(t,{kind:ct.Kind.OPERATION_DEFINITION,operation:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(be.TokenKind.NAME);switch(t.value){case"query":return of.OperationTypeNode.QUERY;case"mutation":return of.OperationTypeNode.MUTATION;case"subscription":return of.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(be.TokenKind.PAREN_L,this.parseVariableDefinition,be.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:ct.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(be.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(be.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(be.TokenKind.DOLLAR),this.node(t,{kind:ct.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:ct.Kind.SELECTION_SET,selections:this.many(be.TokenKind.BRACE_L,this.parseSelection,be.TokenKind.BRACE_R)})}parseSelection(){return this.peek(be.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),r,i;return this.expectOptionalToken(be.TokenKind.COLON)?(r=n,i=this.parseName()):i=n,this.node(t,{kind:ct.Kind.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(be.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(be.TokenKind.PAREN_L,n,be.TokenKind.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,r=this.parseName();return this.expectToken(be.TokenKind.COLON),this.node(n,{kind:ct.Kind.ARGUMENT,name:r,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(be.TokenKind.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(be.TokenKind.NAME)?this.node(t,{kind:ct.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:ct.Kind.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:ct.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:ct.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case be.TokenKind.BRACKET_L:return this.parseList(t);case be.TokenKind.BRACE_L:return this.parseObject(t);case be.TokenKind.INT:return this.advanceLexer(),this.node(n,{kind:ct.Kind.INT,value:n.value});case be.TokenKind.FLOAT:return this.advanceLexer(),this.node(n,{kind:ct.Kind.FLOAT,value:n.value});case be.TokenKind.STRING:case be.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case be.TokenKind.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:ct.Kind.BOOLEAN,value:!0});case"false":return this.node(n,{kind:ct.Kind.BOOLEAN,value:!1});case"null":return this.node(n,{kind:ct.Kind.NULL});default:return this.node(n,{kind:ct.Kind.ENUM,value:n.value})}case be.TokenKind.DOLLAR:if(t)if(this.expectToken(be.TokenKind.DOLLAR),this._lexer.token.kind===be.TokenKind.NAME){let r=this._lexer.token.value;throw(0,lc.syntaxError)(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:ct.Kind.STRING,value:t.value,block:t.kind===be.TokenKind.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:ct.Kind.LIST,values:this.any(be.TokenKind.BRACKET_L,n,be.TokenKind.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:ct.Kind.OBJECT,fields:this.any(be.TokenKind.BRACE_L,n,be.TokenKind.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,r=this.parseName();return this.expectToken(be.TokenKind.COLON),this.node(n,{kind:ct.Kind.OBJECT_FIELD,name:r,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(be.TokenKind.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(be.TokenKind.AT),this.node(n,{kind:ct.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(be.TokenKind.BRACKET_L)){let r=this.parseTypeReference();this.expectToken(be.TokenKind.BRACKET_R),n=this.node(t,{kind:ct.Kind.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(be.TokenKind.BANG)?this.node(t,{kind:ct.Kind.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:ct.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(be.TokenKind.STRING)||this.peek(be.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let r=this.parseConstDirectives(),i=this.many(be.TokenKind.BRACE_L,this.parseOperationTypeDefinition,be.TokenKind.BRACE_R);return this.node(t,{kind:ct.Kind.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(be.TokenKind.COLON);let r=this.parseNamedType();return this.node(t,{kind:ct.Kind.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let r=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:ct.Kind.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let r=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:ct.Kind.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:a,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(be.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(be.TokenKind.BRACE_L,this.parseFieldDefinition,be.TokenKind.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(be.TokenKind.COLON);let a=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:ct.Kind.FIELD_DEFINITION,description:n,name:r,arguments:i,type:a,directives:o})}parseArgumentDefs(){return this.optionalMany(be.TokenKind.PAREN_L,this.parseInputValueDef,be.TokenKind.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(be.TokenKind.COLON);let i=this.parseTypeReference(),a;this.expectOptionalToken(be.TokenKind.EQUALS)&&(a=this.parseConstValueLiteral());let o=this.parseConstDirectives();return this.node(t,{kind:ct.Kind.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:a,directives:o})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let r=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:ct.Kind.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:a,fields:o})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let r=this.parseName(),i=this.parseConstDirectives(),a=this.parseUnionMemberTypes();return this.node(t,{kind:ct.Kind.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:a})}parseUnionMemberTypes(){return this.expectOptionalToken(be.TokenKind.EQUALS)?this.delimitedMany(be.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let r=this.parseName(),i=this.parseConstDirectives(),a=this.parseEnumValuesDefinition();return this.node(t,{kind:ct.Kind.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:a})}parseEnumValuesDefinition(){return this.optionalMany(be.TokenKind.BRACE_L,this.parseEnumValueDefinition,be.TokenKind.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:ct.Kind.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw(0,lc.syntaxError)(this._lexer.source,this._lexer.token.start,`${pN(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let r=this.parseName(),i=this.parseConstDirectives(),a=this.parseInputFieldsDefinition();return this.node(t,{kind:ct.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:a})}parseInputFieldsDefinition(){return this.optionalMany(be.TokenKind.BRACE_L,this.parseInputValueDef,be.TokenKind.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===be.TokenKind.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),r=this.optionalMany(be.TokenKind.BRACE_L,this.parseOperationTypeDefinition,be.TokenKind.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:ct.Kind.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(t,{kind:ct.Kind.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(t,{kind:ct.Kind.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:a})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(t,{kind:ct.Kind.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:a})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:ct.Kind.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:ct.Kind.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:ct.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(be.TokenKind.AT);let r=this.parseName(),i=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let o=this.parseDirectiveLocations();return this.node(t,{kind:ct.Kind.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(be.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(r3.DirectiveLocation,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new of.Location(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw(0,lc.syntaxError)(this._lexer.source,n.start,`Expected ${UF(t)}, found ${pN(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===be.TokenKind.NAME&&n.value===t)this.advanceLexer();else throw(0,lc.syntaxError)(this._lexer.source,n.start,`Expected "${t}", found ${pN(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===be.TokenKind.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t!=null?t:this._lexer.token;return(0,lc.syntaxError)(this._lexer.source,n.start,`Unexpected ${pN(n)}.`)}any(t,n,r){this.expectToken(t);let i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(t,n,r){if(this.expectOptionalToken(t)){let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return[]}many(t,n,r){this.expectToken(t);let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(t,n){this.expectOptionalToken(t);let r=[];do r.push(n.call(this));while(this.expectOptionalToken(t));return r}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==be.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw(0,lc.syntaxError)(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};Eu.Parser=dc;function pN(e){let t=e.value;return UF(e.kind)+(t!=null?` "${t}"`:"")}function UF(e){return(0,CF.isPunctuatorTokenKind)(e)?`"${e}"`:e}});var hu=F(bI=>{"use strict";m();T();N();Object.defineProperty(bI,"__esModule",{value:!0});bI.didYouMean=c3;var u3=5;function c3(e,t){let[n,r]=t?[e,t]:[void 0,e],i=" Did you mean ";n&&(i+=n+" ");let a=r.map(l=>`"${l}"`);switch(a.length){case 0:return"";case 1:return i+a[0]+"?";case 2:return i+a[0]+" or "+a[1]+"?"}let o=a.slice(0,u3),u=o.pop();return i+o.join(", ")+", or "+u+"?"}});var BF=F(AI=>{"use strict";m();T();N();Object.defineProperty(AI,"__esModule",{value:!0});AI.identityFunc=l3;function l3(e){return e}});var yu=F(RI=>{"use strict";m();T();N();Object.defineProperty(RI,"__esModule",{value:!0});RI.keyMap=d3;function d3(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}});var uf=F(PI=>{"use strict";m();T();N();Object.defineProperty(PI,"__esModule",{value:!0});PI.keyValMap=f3;function f3(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}});var wI=F(FI=>{"use strict";m();T();N();Object.defineProperty(FI,"__esModule",{value:!0});FI.mapValue=p3;function p3(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}});var cf=F(CI=>{"use strict";m();T();N();Object.defineProperty(CI,"__esModule",{value:!0});CI.naturalCompare=m3;function m3(e,t){let n=0,r=0;for(;n0);let u=0;do++r,u=u*10+a-LI,a=t.charCodeAt(r);while(mN(a)&&u>0);if(ou)return 1}else{if(ia)return 1;++n,++r}}return e.length-t.length}var LI=48,N3=57;function mN(e){return!isNaN(e)&&LI<=e&&e<=N3}});var Iu=F(BI=>{"use strict";m();T();N();Object.defineProperty(BI,"__esModule",{value:!0});BI.suggestionList=E3;var T3=cf();function E3(e,t){let n=Object.create(null),r=new UI(e),i=Math.floor(e.length*.4)+1;for(let a of t){let o=r.measure(a,i);o!==void 0&&(n[a]=o)}return Object.keys(n).sort((a,o)=>{let u=n[a]-n[o];return u!==0?u:(0,T3.naturalCompare)(a,o)})}var UI=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=kF(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let r=t.toLowerCase();if(this._inputLowerCase===r)return 1;let i=kF(r),a=this._inputArray;if(i.lengthn)return;let l=this._rows;for(let p=0;p<=u;p++)l[0][p]=p;for(let p=1;p<=o;p++){let E=l[(p-1)%3],h=l[p%3],v=h[0]=p;for(let A=1;A<=u;A++){let B=i[p-1]===a[A-1]?0:1,V=Math.min(E[A]+1,h[A-1]+1,E[A-1]+B);if(p>1&&A>1&&i[p-1]===a[A-2]&&i[p-2]===a[A-1]){let J=l[(p-2)%3][A-2];V=Math.min(V,J+1)}Vn)return}let d=l[o%3][u];return d<=n?d:void 0}};function kF(e){let t=e.length,n=new Array(t);for(let r=0;r{"use strict";m();T();N();Object.defineProperty(kI,"__esModule",{value:!0});kI.toObjMap=h3;function h3(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,r]of Object.entries(e))t[n]=r;return t}});var MF=F(MI=>{"use strict";m();T();N();Object.defineProperty(MI,"__esModule",{value:!0});MI.printString=y3;function y3(e){return`"${e.replace(I3,g3)}"`}var I3=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function g3(e){return _3[e.charCodeAt(0)]}var _3=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]});var fc=F(gu=>{"use strict";m();T();N();Object.defineProperty(gu,"__esModule",{value:!0});gu.BREAK=void 0;gu.getEnterLeaveForKind=TN;gu.getVisitFn=b3;gu.visit=O3;gu.visitInParallel=D3;var v3=$r(),S3=nn(),xI=ja(),xF=Ut(),Dl=Object.freeze({});gu.BREAK=Dl;function O3(e,t,n=xI.QueryDocumentKeys){let r=new Map;for(let J of Object.values(xF.Kind))r.set(J,TN(t,J));let i,a=Array.isArray(e),o=[e],u=-1,l=[],d=e,p,E,h=[],v=[];do{u++;let J=u===o.length,re=J&&l.length!==0;if(J){if(p=v.length===0?void 0:h[h.length-1],d=E,E=v.pop(),re)if(a){d=d.slice();let Ne=0;for(let[Ee,_e]of l){let ye=Ee-Ne;_e===null?(d.splice(ye,1),Ne++):d[ye]=_e}}else{d=Object.defineProperties({},Object.getOwnPropertyDescriptors(d));for(let[Ne,Ee]of l)d[Ne]=Ee}u=i.index,o=i.keys,l=i.edits,a=i.inArray,i=i.prev}else if(E){if(p=a?u:o[u],d=E[p],d==null)continue;h.push(p)}let ie;if(!Array.isArray(d)){var A,B;(0,xI.isNode)(d)||(0,v3.devAssert)(!1,`Invalid AST Node: ${(0,S3.inspect)(d)}.`);let Ne=J?(A=r.get(d.kind))===null||A===void 0?void 0:A.leave:(B=r.get(d.kind))===null||B===void 0?void 0:B.enter;if(ie=Ne==null?void 0:Ne.call(t,d,p,E,h,v),ie===Dl)break;if(ie===!1){if(!J){h.pop();continue}}else if(ie!==void 0&&(l.push([p,ie]),!J))if((0,xI.isNode)(ie))d=ie;else{h.pop();continue}}if(ie===void 0&&re&&l.push([p,d]),J)h.pop();else{var V;i={inArray:a,index:u,keys:o,edits:l,prev:i},a=Array.isArray(d),o=a?d:(V=n[d.kind])!==null&&V!==void 0?V:[],u=-1,l=[],E&&v.push(E),E=d}}while(i!==void 0);return l.length!==0?l[l.length-1][1]:e}function D3(e){let t=new Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values(xF.Kind)){let i=!1,a=new Array(e.length).fill(void 0),o=new Array(e.length).fill(void 0);for(let l=0;l{"use strict";m();T();N();Object.defineProperty(qI,"__esModule",{value:!0});qI.print=F3;var A3=Zd(),R3=MF(),P3=fc();function F3(e){return(0,P3.visit)(e,L3)}var w3=80,L3={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>$e(e.definitions,` +spurious results.`)}}return!1};SN.instanceOf=fW});var DN=F(fp=>{"use strict";m();T();N();Object.defineProperty(fp,"__esModule",{value:!0});fp.Source=void 0;fp.isSource=TW;var qI=Yr(),mW=rn(),NW=pp(),ON=class{constructor(t,n="GraphQL request",r={line:1,column:1}){typeof t=="string"||(0,qI.devAssert)(!1,`Body must be a string. Received: ${(0,mW.inspect)(t)}.`),this.body=t,this.name=n,this.locationOffset=r,this.locationOffset.line>0||(0,qI.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,qI.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};fp.Source=ON;function TW(e){return(0,NW.instanceOf)(e,ON)}});var Cl=F(Su=>{"use strict";m();T();N();Object.defineProperty(Su,"__esModule",{value:!0});Su.Parser=void 0;Su.parse=hW;Su.parseConstValue=IW;Su.parseType=gW;Su.parseValue=yW;var hc=yN(),mp=ja(),EW=Ll(),pt=Mt(),WF=_N(),zF=DN(),Fe=cp();function hW(e,t){return new yc(e,t).parseDocument()}function yW(e,t){let n=new yc(e,t);n.expectToken(Fe.TokenKind.SOF);let r=n.parseValueLiteral(!1);return n.expectToken(Fe.TokenKind.EOF),r}function IW(e,t){let n=new yc(e,t);n.expectToken(Fe.TokenKind.SOF);let r=n.parseConstValueLiteral();return n.expectToken(Fe.TokenKind.EOF),r}function gW(e,t){let n=new yc(e,t);n.expectToken(Fe.TokenKind.SOF);let r=n.parseTypeReference();return n.expectToken(Fe.TokenKind.EOF),r}var yc=class{constructor(t,n={}){let r=(0,zF.isSource)(t)?t:new zF.Source(t);this._lexer=new WF.Lexer(r),this._options=n,this._tokenCounter=0}parseName(){let t=this.expectToken(Fe.TokenKind.NAME);return this.node(t,{kind:pt.Kind.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:pt.Kind.DOCUMENT,definitions:this.many(Fe.TokenKind.SOF,this.parseDefinition,Fe.TokenKind.EOF)})}parseDefinition(){if(this.peek(Fe.TokenKind.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===Fe.TokenKind.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw(0,hc.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(Fe.TokenKind.BRACE_L))return this.node(t,{kind:pt.Kind.OPERATION_DEFINITION,operation:mp.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),r;return this.peek(Fe.TokenKind.NAME)&&(r=this.parseName()),this.node(t,{kind:pt.Kind.OPERATION_DEFINITION,operation:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(Fe.TokenKind.NAME);switch(t.value){case"query":return mp.OperationTypeNode.QUERY;case"mutation":return mp.OperationTypeNode.MUTATION;case"subscription":return mp.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(Fe.TokenKind.PAREN_L,this.parseVariableDefinition,Fe.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:pt.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Fe.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Fe.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(Fe.TokenKind.DOLLAR),this.node(t,{kind:pt.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:pt.Kind.SELECTION_SET,selections:this.many(Fe.TokenKind.BRACE_L,this.parseSelection,Fe.TokenKind.BRACE_R)})}parseSelection(){return this.peek(Fe.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),r,i;return this.expectOptionalToken(Fe.TokenKind.COLON)?(r=n,i=this.parseName()):i=n,this.node(t,{kind:pt.Kind.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Fe.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(Fe.TokenKind.PAREN_L,n,Fe.TokenKind.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,r=this.parseName();return this.expectToken(Fe.TokenKind.COLON),this.node(n,{kind:pt.Kind.ARGUMENT,name:r,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(Fe.TokenKind.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(Fe.TokenKind.NAME)?this.node(t,{kind:pt.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:pt.Kind.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:pt.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:pt.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case Fe.TokenKind.BRACKET_L:return this.parseList(t);case Fe.TokenKind.BRACE_L:return this.parseObject(t);case Fe.TokenKind.INT:return this.advanceLexer(),this.node(n,{kind:pt.Kind.INT,value:n.value});case Fe.TokenKind.FLOAT:return this.advanceLexer(),this.node(n,{kind:pt.Kind.FLOAT,value:n.value});case Fe.TokenKind.STRING:case Fe.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case Fe.TokenKind.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:pt.Kind.BOOLEAN,value:!0});case"false":return this.node(n,{kind:pt.Kind.BOOLEAN,value:!1});case"null":return this.node(n,{kind:pt.Kind.NULL});default:return this.node(n,{kind:pt.Kind.ENUM,value:n.value})}case Fe.TokenKind.DOLLAR:if(t)if(this.expectToken(Fe.TokenKind.DOLLAR),this._lexer.token.kind===Fe.TokenKind.NAME){let r=this._lexer.token.value;throw(0,hc.syntaxError)(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:pt.Kind.STRING,value:t.value,block:t.kind===Fe.TokenKind.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:pt.Kind.LIST,values:this.any(Fe.TokenKind.BRACKET_L,n,Fe.TokenKind.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:pt.Kind.OBJECT,fields:this.any(Fe.TokenKind.BRACE_L,n,Fe.TokenKind.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,r=this.parseName();return this.expectToken(Fe.TokenKind.COLON),this.node(n,{kind:pt.Kind.OBJECT_FIELD,name:r,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(Fe.TokenKind.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(Fe.TokenKind.AT),this.node(n,{kind:pt.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(Fe.TokenKind.BRACKET_L)){let r=this.parseTypeReference();this.expectToken(Fe.TokenKind.BRACKET_R),n=this.node(t,{kind:pt.Kind.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(Fe.TokenKind.BANG)?this.node(t,{kind:pt.Kind.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:pt.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Fe.TokenKind.STRING)||this.peek(Fe.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let r=this.parseConstDirectives(),i=this.many(Fe.TokenKind.BRACE_L,this.parseOperationTypeDefinition,Fe.TokenKind.BRACE_R);return this.node(t,{kind:pt.Kind.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(Fe.TokenKind.COLON);let r=this.parseNamedType();return this.node(t,{kind:pt.Kind.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let r=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:pt.Kind.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let r=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:pt.Kind.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:a,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Fe.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Fe.TokenKind.BRACE_L,this.parseFieldDefinition,Fe.TokenKind.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(Fe.TokenKind.COLON);let a=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:pt.Kind.FIELD_DEFINITION,description:n,name:r,arguments:i,type:a,directives:o})}parseArgumentDefs(){return this.optionalMany(Fe.TokenKind.PAREN_L,this.parseInputValueDef,Fe.TokenKind.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(Fe.TokenKind.COLON);let i=this.parseTypeReference(),a;this.expectOptionalToken(Fe.TokenKind.EQUALS)&&(a=this.parseConstValueLiteral());let o=this.parseConstDirectives();return this.node(t,{kind:pt.Kind.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:a,directives:o})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let r=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:pt.Kind.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:a,fields:o})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let r=this.parseName(),i=this.parseConstDirectives(),a=this.parseUnionMemberTypes();return this.node(t,{kind:pt.Kind.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:a})}parseUnionMemberTypes(){return this.expectOptionalToken(Fe.TokenKind.EQUALS)?this.delimitedMany(Fe.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let r=this.parseName(),i=this.parseConstDirectives(),a=this.parseEnumValuesDefinition();return this.node(t,{kind:pt.Kind.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:a})}parseEnumValuesDefinition(){return this.optionalMany(Fe.TokenKind.BRACE_L,this.parseEnumValueDefinition,Fe.TokenKind.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:pt.Kind.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw(0,hc.syntaxError)(this._lexer.source,this._lexer.token.start,`${bN(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let r=this.parseName(),i=this.parseConstDirectives(),a=this.parseInputFieldsDefinition();return this.node(t,{kind:pt.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:a})}parseInputFieldsDefinition(){return this.optionalMany(Fe.TokenKind.BRACE_L,this.parseInputValueDef,Fe.TokenKind.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===Fe.TokenKind.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),r=this.optionalMany(Fe.TokenKind.BRACE_L,this.parseOperationTypeDefinition,Fe.TokenKind.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:pt.Kind.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(t,{kind:pt.Kind.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(t,{kind:pt.Kind.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:a})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(t,{kind:pt.Kind.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:a})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:pt.Kind.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:pt.Kind.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:pt.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Fe.TokenKind.AT);let r=this.parseName(),i=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let o=this.parseDirectiveLocations();return this.node(t,{kind:pt.Kind.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(Fe.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(EW.DirectiveLocation,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new mp.Location(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw(0,hc.syntaxError)(this._lexer.source,n.start,`Expected ${XF(t)}, found ${bN(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===Fe.TokenKind.NAME&&n.value===t)this.advanceLexer();else throw(0,hc.syntaxError)(this._lexer.source,n.start,`Expected "${t}", found ${bN(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===Fe.TokenKind.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t!=null?t:this._lexer.token;return(0,hc.syntaxError)(this._lexer.source,n.start,`Unexpected ${bN(n)}.`)}any(t,n,r){this.expectToken(t);let i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(t,n,r){if(this.expectOptionalToken(t)){let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return[]}many(t,n,r){this.expectToken(t);let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(t,n){this.expectOptionalToken(t);let r=[];do r.push(n.call(this));while(this.expectOptionalToken(t));return r}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==Fe.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw(0,hc.syntaxError)(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};Su.Parser=yc;function bN(e){let t=e.value;return XF(e.kind)+(t!=null?` "${t}"`:"")}function XF(e){return(0,WF.isPunctuatorTokenKind)(e)?`"${e}"`:e}});var Ou=F(VI=>{"use strict";m();T();N();Object.defineProperty(VI,"__esModule",{value:!0});VI.didYouMean=vW;var _W=5;function vW(e,t){let[n,r]=t?[e,t]:[void 0,e],i=" Did you mean ";n&&(i+=n+" ");let a=r.map(l=>`"${l}"`);switch(a.length){case 0:return"";case 1:return i+a[0]+"?";case 2:return i+a[0]+" or "+a[1]+"?"}let o=a.slice(0,_W),u=o.pop();return i+o.join(", ")+", or "+u+"?"}});var ZF=F(KI=>{"use strict";m();T();N();Object.defineProperty(KI,"__esModule",{value:!0});KI.identityFunc=SW;function SW(e){return e}});var Du=F(jI=>{"use strict";m();T();N();Object.defineProperty(jI,"__esModule",{value:!0});jI.keyMap=OW;function OW(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}});var Np=F($I=>{"use strict";m();T();N();Object.defineProperty($I,"__esModule",{value:!0});$I.keyValMap=DW;function DW(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}});var QI=F(GI=>{"use strict";m();T();N();Object.defineProperty(GI,"__esModule",{value:!0});GI.mapValue=bW;function bW(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}});var Tp=F(JI=>{"use strict";m();T();N();Object.defineProperty(JI,"__esModule",{value:!0});JI.naturalCompare=AW;function AW(e,t){let n=0,r=0;for(;n0);let u=0;do++r,u=u*10+a-YI,a=t.charCodeAt(r);while(AN(a)&&u>0);if(ou)return 1}else{if(ia)return 1;++n,++r}}return e.length-t.length}var YI=48,RW=57;function AN(e){return!isNaN(e)&&YI<=e&&e<=RW}});var bu=F(zI=>{"use strict";m();T();N();Object.defineProperty(zI,"__esModule",{value:!0});zI.suggestionList=FW;var PW=Tp();function FW(e,t){let n=Object.create(null),r=new HI(e),i=Math.floor(e.length*.4)+1;for(let a of t){let o=r.measure(a,i);o!==void 0&&(n[a]=o)}return Object.keys(n).sort((a,o)=>{let u=n[a]-n[o];return u!==0?u:(0,PW.naturalCompare)(a,o)})}var HI=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=eL(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let r=t.toLowerCase();if(this._inputLowerCase===r)return 1;let i=eL(r),a=this._inputArray;if(i.lengthn)return;let l=this._rows;for(let p=0;p<=u;p++)l[0][p]=p;for(let p=1;p<=o;p++){let E=l[(p-1)%3],h=l[p%3],_=h[0]=p;for(let S=1;S<=u;S++){let k=i[p-1]===a[S-1]?0:1,B=Math.min(E[S]+1,h[S-1]+1,E[S-1]+k);if(p>1&&S>1&&i[p-1]===a[S-2]&&i[p-2]===a[S-1]){let K=l[(p-2)%3][S-2];B=Math.min(B,K+1)}B<_&&(_=B),h[S]=B}if(_>n)return}let d=l[o%3][u];return d<=n?d:void 0}};function eL(e){let t=e.length,n=new Array(t);for(let r=0;r{"use strict";m();T();N();Object.defineProperty(WI,"__esModule",{value:!0});WI.toObjMap=LW;function LW(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,r]of Object.entries(e))t[n]=r;return t}});var tL=F(XI=>{"use strict";m();T();N();Object.defineProperty(XI,"__esModule",{value:!0});XI.printString=wW;function wW(e){return`"${e.replace(CW,UW)}"`}var CW=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function UW(e){return BW[e.charCodeAt(0)]}var BW=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]});var Ic=F(Au=>{"use strict";m();T();N();Object.defineProperty(Au,"__esModule",{value:!0});Au.BREAK=void 0;Au.getEnterLeaveForKind=PN;Au.getVisitFn=VW;Au.visit=xW;Au.visitInParallel=qW;var kW=Yr(),MW=rn(),ZI=ja(),nL=Mt(),Ul=Object.freeze({});Au.BREAK=Ul;function xW(e,t,n=ZI.QueryDocumentKeys){let r=new Map;for(let K of Object.values(nL.Kind))r.set(K,PN(t,K));let i,a=Array.isArray(e),o=[e],u=-1,l=[],d=e,p,E,h=[],_=[];do{u++;let K=u===o.length,ne=K&&l.length!==0;if(K){if(p=_.length===0?void 0:h[h.length-1],d=E,E=_.pop(),ne)if(a){d=d.slice();let oe=0;for(let[de,me]of l){let pe=de-oe;me===null?(d.splice(pe,1),oe++):d[pe]=me}}else{d=Object.defineProperties({},Object.getOwnPropertyDescriptors(d));for(let[oe,de]of l)d[oe]=de}u=i.index,o=i.keys,l=i.edits,a=i.inArray,i=i.prev}else if(E){if(p=a?u:o[u],d=E[p],d==null)continue;h.push(p)}let ee;if(!Array.isArray(d)){var S,k;(0,ZI.isNode)(d)||(0,kW.devAssert)(!1,`Invalid AST Node: ${(0,MW.inspect)(d)}.`);let oe=K?(S=r.get(d.kind))===null||S===void 0?void 0:S.leave:(k=r.get(d.kind))===null||k===void 0?void 0:k.enter;if(ee=oe==null?void 0:oe.call(t,d,p,E,h,_),ee===Ul)break;if(ee===!1){if(!K){h.pop();continue}}else if(ee!==void 0&&(l.push([p,ee]),!K))if((0,ZI.isNode)(ee))d=ee;else{h.pop();continue}}if(ee===void 0&&ne&&l.push([p,d]),K)h.pop();else{var B;i={inArray:a,index:u,keys:o,edits:l,prev:i},a=Array.isArray(d),o=a?d:(B=n[d.kind])!==null&&B!==void 0?B:[],u=-1,l=[],E&&_.push(E),E=d}}while(i!==void 0);return l.length!==0?l[l.length-1][1]:e}function qW(e){let t=new Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values(nL.Kind)){let i=!1,a=new Array(e.length).fill(void 0),o=new Array(e.length).fill(void 0);for(let l=0;l{"use strict";m();T();N();Object.defineProperty(eg,"__esModule",{value:!0});eg.print=GW;var KW=op(),jW=tL(),$W=Ic();function GW(e){return(0,$W.visit)(e,YW)}var QW=80,YW={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>$e(e.definitions,` -`)},OperationDefinition:{leave(e){let t=Ft("(",$e(e.variableDefinitions,", "),")"),n=$e([e.operation,$e([e.name,t]),$e(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Ft(" = ",n)+Ft(" ",$e(r," "))},SelectionSet:{leave:({selections:e})=>da(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let a=Ft("",e,": ")+t,o=a+Ft("(",$e(n,", "),")");return o.length>w3&&(o=a+Ft(`( -`,EN($e(n,` +`)},OperationDefinition:{leave(e){let t=Ct("(",$e(e.variableDefinitions,", "),")"),n=$e([e.operation,$e([e.name,t]),$e(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Ct(" = ",n)+Ct(" ",$e(r," "))},SelectionSet:{leave:({selections:e})=>fa(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let a=Ct("",e,": ")+t,o=a+Ct("(",$e(n,", "),")");return o.length>QW&&(o=a+Ct(`( +`,FN($e(n,` `)),` -)`)),$e([o,$e(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Ft(" ",$e(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>$e(["...",Ft("on ",e),$e(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Ft("(",$e(n,", "),")")} on ${t} ${Ft("",$e(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,A3.printBlockString)(e):(0,R3.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+$e(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+$e(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Ft("(",$e(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Ft("",e,` -`)+$e(["schema",$e(t," "),da(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Ft("",e,` -`)+$e(["scalar",t,$e(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Ft("",e,` -`)+$e(["type",t,Ft("implements ",$e(n," & ")),$e(r," "),da(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>Ft("",e,` -`)+t+(qF(n)?Ft(`( -`,EN($e(n,` +)`)),$e([o,$e(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Ct(" ",$e(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>$e(["...",Ct("on ",e),$e(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Ct("(",$e(n,", "),")")} on ${t} ${Ct("",$e(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,KW.printBlockString)(e):(0,jW.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+$e(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+$e(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Ct("(",$e(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Ct("",e,` +`)+$e(["schema",$e(t," "),fa(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Ct("",e,` +`)+$e(["scalar",t,$e(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Ct("",e,` +`)+$e(["type",t,Ct("implements ",$e(n," & ")),$e(r," "),fa(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>Ct("",e,` +`)+t+(rL(n)?Ct(`( +`,FN($e(n,` `)),` -)`):Ft("(",$e(n,", "),")"))+": "+r+Ft(" ",$e(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>Ft("",e,` -`)+$e([t+": "+n,Ft("= ",r),$e(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Ft("",e,` -`)+$e(["interface",t,Ft("implements ",$e(n," & ")),$e(r," "),da(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>Ft("",e,` -`)+$e(["union",t,$e(n," "),Ft("= ",$e(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>Ft("",e,` -`)+$e(["enum",t,$e(n," "),da(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Ft("",e,` -`)+$e([t,$e(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>Ft("",e,` -`)+$e(["input",t,$e(n," "),da(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>Ft("",e,` -`)+"directive @"+t+(qF(n)?Ft(`( -`,EN($e(n,` +)`):Ct("(",$e(n,", "),")"))+": "+r+Ct(" ",$e(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>Ct("",e,` +`)+$e([t+": "+n,Ct("= ",r),$e(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Ct("",e,` +`)+$e(["interface",t,Ct("implements ",$e(n," & ")),$e(r," "),fa(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>Ct("",e,` +`)+$e(["union",t,$e(n," "),Ct("= ",$e(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>Ct("",e,` +`)+$e(["enum",t,$e(n," "),fa(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Ct("",e,` +`)+$e([t,$e(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>Ct("",e,` +`)+$e(["input",t,$e(n," "),fa(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>Ct("",e,` +`)+"directive @"+t+(rL(n)?Ct(`( +`,FN($e(n,` `)),` -)`):Ft("(",$e(n,", "),")"))+(r?" repeatable":"")+" on "+$e(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>$e(["extend schema",$e(e," "),da(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>$e(["extend scalar",e,$e(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>$e(["extend type",e,Ft("implements ",$e(t," & ")),$e(n," "),da(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>$e(["extend interface",e,Ft("implements ",$e(t," & ")),$e(n," "),da(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>$e(["extend union",e,$e(t," "),Ft("= ",$e(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>$e(["extend enum",e,$e(t," "),da(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>$e(["extend input",e,$e(t," "),da(n)]," ")}};function $e(e,t=""){var n;return(n=e==null?void 0:e.filter(r=>r).join(t))!==null&&n!==void 0?n:""}function da(e){return Ft(`{ -`,EN($e(e,` +)`):Ct("(",$e(n,", "),")"))+(r?" repeatable":"")+" on "+$e(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>$e(["extend schema",$e(e," "),fa(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>$e(["extend scalar",e,$e(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>$e(["extend type",e,Ct("implements ",$e(t," & ")),$e(n," "),fa(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>$e(["extend interface",e,Ct("implements ",$e(t," & ")),$e(n," "),fa(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>$e(["extend union",e,$e(t," "),Ct("= ",$e(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>$e(["extend enum",e,$e(t," "),fa(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>$e(["extend input",e,$e(t," "),fa(n)]," ")}};function $e(e,t=""){var n;return(n=e==null?void 0:e.filter(r=>r).join(t))!==null&&n!==void 0?n:""}function fa(e){return Ct(`{ +`,FN($e(e,` `)),` -}`)}function Ft(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function EN(e){return Ft(" ",e.replace(/\n/g,` - `))}function qF(e){var t;return(t=e==null?void 0:e.some(n=>n.includes(` -`)))!==null&&t!==void 0?t:!1}});var KI=F(jI=>{"use strict";m();T();N();Object.defineProperty(jI,"__esModule",{value:!0});jI.valueFromASTUntyped=VI;var C3=uf(),bs=Ut();function VI(e,t){switch(e.kind){case bs.Kind.NULL:return null;case bs.Kind.INT:return parseInt(e.value,10);case bs.Kind.FLOAT:return parseFloat(e.value);case bs.Kind.STRING:case bs.Kind.ENUM:case bs.Kind.BOOLEAN:return e.value;case bs.Kind.LIST:return e.values.map(n=>VI(n,t));case bs.Kind.OBJECT:return(0,C3.keyValMap)(e.fields,n=>n.name.value,n=>VI(n.value,t));case bs.Kind.VARIABLE:return t==null?void 0:t[e.name.value]}}});var lf=F(yN=>{"use strict";m();T();N();Object.defineProperty(yN,"__esModule",{value:!0});yN.assertEnumValueName=U3;yN.assertName=KF;var VF=$r(),hN=Ze(),jF=sN();function KF(e){if(e!=null||(0,VF.devAssert)(!1,"Must provide name."),typeof e=="string"||(0,VF.devAssert)(!1,"Expected name to be a string."),e.length===0)throw new hN.GraphQLError("Expected name to be a non-empty string.");for(let t=1;t{"use strict";m();T();N();Object.defineProperty(Qe,"__esModule",{value:!0});Qe.GraphQLUnionType=Qe.GraphQLScalarType=Qe.GraphQLObjectType=Qe.GraphQLNonNull=Qe.GraphQLList=Qe.GraphQLInterfaceType=Qe.GraphQLInputObjectType=Qe.GraphQLEnumType=void 0;Qe.argsToArgsConfig=nw;Qe.assertAbstractType=tW;Qe.assertCompositeType=eW;Qe.assertEnumType=Y3;Qe.assertInputObjectType=J3;Qe.assertInputType=W3;Qe.assertInterfaceType=G3;Qe.assertLeafType=Z3;Qe.assertListType=z3;Qe.assertNamedType=aW;Qe.assertNonNullType=H3;Qe.assertNullableType=rW;Qe.assertObjectType=$3;Qe.assertOutputType=X3;Qe.assertScalarType=K3;Qe.assertType=j3;Qe.assertUnionType=Q3;Qe.assertWrappingType=nW;Qe.defineArguments=ew;Qe.getNamedType=sW;Qe.getNullableType=iW;Qe.isAbstractType=HF;Qe.isCompositeType=zF;Qe.isEnumType=Tc;Qe.isInputObjectType=ff;Qe.isInputType=$I;Qe.isInterfaceType=mc;Qe.isLeafType=JF;Qe.isListType=FN;Qe.isNamedType=WF;Qe.isNonNullType=vu;Qe.isNullableType=QI;Qe.isObjectType=Al;Qe.isOutputType=GI;Qe.isRequiredArgument=oW;Qe.isRequiredInputField=lW;Qe.isScalarType=pc;Qe.isType=PN;Qe.isUnionType=Nc;Qe.isWrappingType=pf;Qe.resolveObjMapThunk=JI;Qe.resolveReadonlyArrayThunk=YI;var mr=$r(),B3=hu(),$F=BF(),Nn=nn(),_u=af(),k3=Va(),M3=yu(),YF=uf(),RN=wI(),x3=Iu(),Ka=NN(),df=Ze(),q3=Ut(),GF=yi(),V3=KI(),$a=lf();function PN(e){return pc(e)||Al(e)||mc(e)||Nc(e)||Tc(e)||ff(e)||FN(e)||vu(e)}function j3(e){if(!PN(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL type.`);return e}function pc(e){return(0,_u.instanceOf)(e,vN)}function K3(e){if(!pc(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL Scalar type.`);return e}function Al(e){return(0,_u.instanceOf)(e,SN)}function $3(e){if(!Al(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL Object type.`);return e}function mc(e){return(0,_u.instanceOf)(e,ON)}function G3(e){if(!mc(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL Interface type.`);return e}function Nc(e){return(0,_u.instanceOf)(e,DN)}function Q3(e){if(!Nc(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL Union type.`);return e}function Tc(e){return(0,_u.instanceOf)(e,bN)}function Y3(e){if(!Tc(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL Enum type.`);return e}function ff(e){return(0,_u.instanceOf)(e,AN)}function J3(e){if(!ff(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL Input Object type.`);return e}function FN(e){return(0,_u.instanceOf)(e,gN)}function z3(e){if(!FN(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL List type.`);return e}function vu(e){return(0,_u.instanceOf)(e,_N)}function H3(e){if(!vu(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL Non-Null type.`);return e}function $I(e){return pc(e)||Tc(e)||ff(e)||pf(e)&&$I(e.ofType)}function W3(e){if(!$I(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL input type.`);return e}function GI(e){return pc(e)||Al(e)||mc(e)||Nc(e)||Tc(e)||pf(e)&&GI(e.ofType)}function X3(e){if(!GI(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL output type.`);return e}function JF(e){return pc(e)||Tc(e)}function Z3(e){if(!JF(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL leaf type.`);return e}function zF(e){return Al(e)||mc(e)||Nc(e)}function eW(e){if(!zF(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL composite type.`);return e}function HF(e){return mc(e)||Nc(e)}function tW(e){if(!HF(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL abstract type.`);return e}var gN=class{constructor(t){PN(t)||(0,mr.devAssert)(!1,`Expected ${(0,Nn.inspect)(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}};Qe.GraphQLList=gN;var _N=class{constructor(t){QI(t)||(0,mr.devAssert)(!1,`Expected ${(0,Nn.inspect)(t)} to be a GraphQL nullable type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}};Qe.GraphQLNonNull=_N;function pf(e){return FN(e)||vu(e)}function nW(e){if(!pf(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL wrapping type.`);return e}function QI(e){return PN(e)&&!vu(e)}function rW(e){if(!QI(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL nullable type.`);return e}function iW(e){if(e)return vu(e)?e.ofType:e}function WF(e){return pc(e)||Al(e)||mc(e)||Nc(e)||Tc(e)||ff(e)}function aW(e){if(!WF(e))throw new Error(`Expected ${(0,Nn.inspect)(e)} to be a GraphQL named type.`);return e}function sW(e){if(e){let t=e;for(;pf(t);)t=t.ofType;return t}}function YI(e){return typeof e=="function"?e():e}function JI(e){return typeof e=="function"?e():e}var vN=class{constructor(t){var n,r,i,a;let o=(n=t.parseValue)!==null&&n!==void 0?n:$F.identityFunc;this.name=(0,$a.assertName)(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(r=t.serialize)!==null&&r!==void 0?r:$F.identityFunc,this.parseValue=o,this.parseLiteral=(i=t.parseLiteral)!==null&&i!==void 0?i:(u,l)=>o((0,V3.valueFromASTUntyped)(u,l)),this.extensions=(0,Ka.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(a=t.extensionASTNodes)!==null&&a!==void 0?a:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||(0,mr.devAssert)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,Nn.inspect)(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||(0,mr.devAssert)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||(0,mr.devAssert)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Qe.GraphQLScalarType=vN;var SN=class{constructor(t){var n;this.name=(0,$a.assertName)(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=(0,Ka.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>ZF(t),this._interfaces=()=>XF(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||(0,mr.devAssert)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,Nn.inspect)(t.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:tw(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Qe.GraphQLObjectType=SN;function XF(e){var t;let n=YI((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||(0,mr.devAssert)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function ZF(e){let t=JI(e.fields);return bl(t)||(0,mr.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,RN.mapValue)(t,(n,r)=>{var i;bl(n)||(0,mr.devAssert)(!1,`${e.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||(0,mr.devAssert)(!1,`${e.name}.${r} field resolver must be a function if provided, but got: ${(0,Nn.inspect)(n.resolve)}.`);let a=(i=n.args)!==null&&i!==void 0?i:{};return bl(a)||(0,mr.devAssert)(!1,`${e.name}.${r} args must be an object with argument names as keys.`),{name:(0,$a.assertName)(r),description:n.description,type:n.type,args:ew(a),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:(0,Ka.toObjMap)(n.extensions),astNode:n.astNode}})}function ew(e){return Object.entries(e).map(([t,n])=>({name:(0,$a.assertName)(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:(0,Ka.toObjMap)(n.extensions),astNode:n.astNode}))}function bl(e){return(0,k3.isObjectLike)(e)&&!Array.isArray(e)}function tw(e){return(0,RN.mapValue)(e,t=>({description:t.description,type:t.type,args:nw(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function nw(e){return(0,YF.keyValMap)(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function oW(e){return vu(e.type)&&e.defaultValue===void 0}var ON=class{constructor(t){var n;this.name=(0,$a.assertName)(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=(0,Ka.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=ZF.bind(void 0,t),this._interfaces=XF.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||(0,mr.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,Nn.inspect)(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:tw(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Qe.GraphQLInterfaceType=ON;var DN=class{constructor(t){var n;this.name=(0,$a.assertName)(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=(0,Ka.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=uW.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||(0,mr.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,Nn.inspect)(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Qe.GraphQLUnionType=DN;function uW(e){let t=YI(e.types);return Array.isArray(t)||(0,mr.devAssert)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}var bN=class{constructor(t){var n;this.name=(0,$a.assertName)(t.name),this.description=t.description,this.extensions=(0,Ka.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof t.values=="function"?t.values:QF(this.name,t.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=QF(this.name,this._values())),this._values}getValue(t){return this._nameLookup===null&&(this._nameLookup=(0,M3.keyMap)(this.getValues(),n=>n.name)),this._nameLookup[t]}serialize(t){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(r=>[r.value,r])));let n=this._valueLookup.get(t);if(n===void 0)throw new df.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0,Nn.inspect)(t)}`);return n.name}parseValue(t){if(typeof t!="string"){let r=(0,Nn.inspect)(t);throw new df.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${r}.`+IN(this,r))}let n=this.getValue(t);if(n==null)throw new df.GraphQLError(`Value "${t}" does not exist in "${this.name}" enum.`+IN(this,t));return n.value}parseLiteral(t,n){if(t.kind!==q3.Kind.ENUM){let i=(0,GF.print)(t);throw new df.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+IN(this,i),{nodes:t})}let r=this.getValue(t.value);if(r==null){let i=(0,GF.print)(t);throw new df.GraphQLError(`Value "${i}" does not exist in "${this.name}" enum.`+IN(this,i),{nodes:t})}return r.value}toConfig(){let t=(0,YF.keyValMap)(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Qe.GraphQLEnumType=bN;function IN(e,t){let n=e.getValues().map(i=>i.name),r=(0,x3.suggestionList)(t,n);return(0,B3.didYouMean)("the enum value",r)}function QF(e,t){return bl(t)||(0,mr.devAssert)(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,r])=>(bl(r)||(0,mr.devAssert)(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${(0,Nn.inspect)(r)}.`),{name:(0,$a.assertEnumValueName)(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:(0,Ka.toObjMap)(r.extensions),astNode:r.astNode}))}var AN=class{constructor(t){var n,r;this.name=(0,$a.assertName)(t.name),this.description=t.description,this.extensions=(0,Ka.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(r=t.isOneOf)!==null&&r!==void 0?r:!1,this._fields=cW.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=(0,RN.mapValue)(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};Qe.GraphQLInputObjectType=AN;function cW(e){let t=JI(e.fields);return bl(t)||(0,mr.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,RN.mapValue)(t,(n,r)=>(!("resolve"in n)||(0,mr.devAssert)(!1,`${e.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:(0,$a.assertName)(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:(0,Ka.toObjMap)(n.extensions),astNode:n.astNode}))}function lW(e){return vu(e.type)&&e.defaultValue===void 0}});var Nf=F(mf=>{"use strict";m();T();N();Object.defineProperty(mf,"__esModule",{value:!0});mf.doTypesOverlap=dW;mf.isEqualType=zI;mf.isTypeSubTypeOf=wN;var wr=Bt();function zI(e,t){return e===t?!0:(0,wr.isNonNullType)(e)&&(0,wr.isNonNullType)(t)||(0,wr.isListType)(e)&&(0,wr.isListType)(t)?zI(e.ofType,t.ofType):!1}function wN(e,t,n){return t===n?!0:(0,wr.isNonNullType)(n)?(0,wr.isNonNullType)(t)?wN(e,t.ofType,n.ofType):!1:(0,wr.isNonNullType)(t)?wN(e,t.ofType,n):(0,wr.isListType)(n)?(0,wr.isListType)(t)?wN(e,t.ofType,n.ofType):!1:(0,wr.isListType)(t)?!1:(0,wr.isAbstractType)(n)&&((0,wr.isInterfaceType)(t)||(0,wr.isObjectType)(t))&&e.isSubType(n,t)}function dW(e,t,n){return t===n?!0:(0,wr.isAbstractType)(t)?(0,wr.isAbstractType)(n)?e.getPossibleTypes(t).some(r=>e.isSubType(n,r)):e.isSubType(t,n):(0,wr.isAbstractType)(n)?e.isSubType(n,t):!1}});var Ga=F(sr=>{"use strict";m();T();N();Object.defineProperty(sr,"__esModule",{value:!0});sr.GraphQLString=sr.GraphQLInt=sr.GraphQLID=sr.GraphQLFloat=sr.GraphQLBoolean=sr.GRAPHQL_MIN_INT=sr.GRAPHQL_MAX_INT=void 0;sr.isSpecifiedScalarType=fW;sr.specifiedScalarTypes=void 0;var fa=nn(),rw=Va(),Nr=Ze(),Ec=Ut(),Tf=yi(),Ef=Bt(),LN=2147483647;sr.GRAPHQL_MAX_INT=LN;var CN=-2147483648;sr.GRAPHQL_MIN_INT=CN;var iw=new Ef.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=hf(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isInteger(n))throw new Nr.GraphQLError(`Int cannot represent non-integer value: ${(0,fa.inspect)(t)}`);if(n>LN||nLN||eLN||te.name===t)}function hf(e){if((0,rw.isObjectLike)(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!(0,rw.isObjectLike)(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}});var ni=F(jn=>{"use strict";m();T();N();Object.defineProperty(jn,"__esModule",{value:!0});jn.GraphQLSpecifiedByDirective=jn.GraphQLSkipDirective=jn.GraphQLOneOfDirective=jn.GraphQLIncludeDirective=jn.GraphQLDirective=jn.GraphQLDeprecatedDirective=jn.DEFAULT_DEPRECATION_REASON=void 0;jn.assertDirective=hW;jn.isDirective=dw;jn.isSpecifiedDirective=yW;jn.specifiedDirectives=void 0;var lw=$r(),pW=nn(),mW=af(),NW=Va(),TW=NN(),Bi=vl(),EW=lf(),yf=Bt(),UN=Ga();function dw(e){return(0,mW.instanceOf)(e,As)}function hW(e){if(!dw(e))throw new Error(`Expected ${(0,pW.inspect)(e)} to be a GraphQL directive.`);return e}var As=class{constructor(t){var n,r;this.name=(0,EW.assertName)(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=(0,TW.toObjMap)(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||(0,lw.devAssert)(!1,`@${t.name} locations must be an Array.`);let i=(r=t.args)!==null&&r!==void 0?r:{};(0,NW.isObjectLike)(i)&&!Array.isArray(i)||(0,lw.devAssert)(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=(0,yf.defineArguments)(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:(0,yf.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}};jn.GraphQLDirective=As;var fw=new As({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[Bi.DirectiveLocation.FIELD,Bi.DirectiveLocation.FRAGMENT_SPREAD,Bi.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new yf.GraphQLNonNull(UN.GraphQLBoolean),description:"Included when true."}}});jn.GraphQLIncludeDirective=fw;var pw=new As({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[Bi.DirectiveLocation.FIELD,Bi.DirectiveLocation.FRAGMENT_SPREAD,Bi.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new yf.GraphQLNonNull(UN.GraphQLBoolean),description:"Skipped when true."}}});jn.GraphQLSkipDirective=pw;var mw="No longer supported";jn.DEFAULT_DEPRECATION_REASON=mw;var Nw=new As({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[Bi.DirectiveLocation.FIELD_DEFINITION,Bi.DirectiveLocation.ARGUMENT_DEFINITION,Bi.DirectiveLocation.INPUT_FIELD_DEFINITION,Bi.DirectiveLocation.ENUM_VALUE],args:{reason:{type:UN.GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:mw}}});jn.GraphQLDeprecatedDirective=Nw;var Tw=new As({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[Bi.DirectiveLocation.SCALAR],args:{url:{type:new yf.GraphQLNonNull(UN.GraphQLString),description:"The URL that specifies the behavior of this scalar."}}});jn.GraphQLSpecifiedByDirective=Tw;var Ew=new As({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[Bi.DirectiveLocation.INPUT_OBJECT],args:{}});jn.GraphQLOneOfDirective=Ew;var hw=Object.freeze([fw,pw,Nw,Tw,Ew]);jn.specifiedDirectives=hw;function yW(e){return hw.some(({name:t})=>t===e.name)}});var BN=F(HI=>{"use strict";m();T();N();Object.defineProperty(HI,"__esModule",{value:!0});HI.isIterableObject=IW;function IW(e){return typeof e=="object"&&typeof(e==null?void 0:e[Symbol.iterator])=="function"}});var _f=F(WI=>{"use strict";m();T();N();Object.defineProperty(WI,"__esModule",{value:!0});WI.astFromValue=gf;var yw=nn(),gW=Fr(),_W=BN(),vW=Va(),ki=Ut(),If=Bt(),SW=Ga();function gf(e,t){if((0,If.isNonNullType)(t)){let n=gf(e,t.ofType);return(n==null?void 0:n.kind)===ki.Kind.NULL?null:n}if(e===null)return{kind:ki.Kind.NULL};if(e===void 0)return null;if((0,If.isListType)(t)){let n=t.ofType;if((0,_W.isIterableObject)(e)){let r=[];for(let i of e){let a=gf(i,n);a!=null&&r.push(a)}return{kind:ki.Kind.LIST,values:r}}return gf(e,n)}if((0,If.isInputObjectType)(t)){if(!(0,vW.isObjectLike)(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=gf(e[r.name],r.type);i&&n.push({kind:ki.Kind.OBJECT_FIELD,name:{kind:ki.Kind.NAME,value:r.name},value:i})}return{kind:ki.Kind.OBJECT,fields:n}}if((0,If.isLeafType)(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return{kind:ki.Kind.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let r=String(n);return Iw.test(r)?{kind:ki.Kind.INT,value:r}:{kind:ki.Kind.FLOAT,value:r}}if(typeof n=="string")return(0,If.isEnumType)(t)?{kind:ki.Kind.ENUM,value:n}:t===SW.GraphQLID&&Iw.test(n)?{kind:ki.Kind.INT,value:n}:{kind:ki.Kind.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${(0,yw.inspect)(n)}.`)}(0,gW.invariant)(!1,"Unexpected input type: "+(0,yw.inspect)(t))}var Iw=/^-?(?:0|[1-9][0-9]*)$/});var xi=F(rn=>{"use strict";m();T();N();Object.defineProperty(rn,"__esModule",{value:!0});rn.introspectionTypes=rn.__TypeKind=rn.__Type=rn.__Schema=rn.__InputValue=rn.__Field=rn.__EnumValue=rn.__DirectiveLocation=rn.__Directive=rn.TypeNameMetaFieldDef=rn.TypeMetaFieldDef=rn.TypeKind=rn.SchemaMetaFieldDef=void 0;rn.isIntrospectionType=wW;var OW=nn(),DW=Fr(),or=vl(),bW=yi(),AW=_f(),Ve=Bt(),ln=Ga(),XI=new Ve.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:ln.GraphQLString,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new Ve.GraphQLNonNull(new Ve.GraphQLList(new Ve.GraphQLNonNull(Mi))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new Ve.GraphQLNonNull(Mi),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Mi,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Mi,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new Ve.GraphQLNonNull(new Ve.GraphQLList(new Ve.GraphQLNonNull(ZI))),resolve:e=>e.getDirectives()}})});rn.__Schema=XI;var ZI=new Ve.GraphQLObjectType({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. +}`)}function Ct(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function FN(e){return Ct(" ",e.replace(/\n/g,` + `))}function rL(e){var t;return(t=e==null?void 0:e.some(n=>n.includes(` +`)))!==null&&t!==void 0?t:!1}});var rg=F(ng=>{"use strict";m();T();N();Object.defineProperty(ng,"__esModule",{value:!0});ng.valueFromASTUntyped=tg;var JW=Np(),bs=Mt();function tg(e,t){switch(e.kind){case bs.Kind.NULL:return null;case bs.Kind.INT:return parseInt(e.value,10);case bs.Kind.FLOAT:return parseFloat(e.value);case bs.Kind.STRING:case bs.Kind.ENUM:case bs.Kind.BOOLEAN:return e.value;case bs.Kind.LIST:return e.values.map(n=>tg(n,t));case bs.Kind.OBJECT:return(0,JW.keyValMap)(e.fields,n=>n.name.value,n=>tg(n.value,t));case bs.Kind.VARIABLE:return t==null?void 0:t[e.name.value]}}});var Ep=F(wN=>{"use strict";m();T();N();Object.defineProperty(wN,"__esModule",{value:!0});wN.assertEnumValueName=HW;wN.assertName=sL;var iL=Yr(),LN=tt(),aL=IN();function sL(e){if(e!=null||(0,iL.devAssert)(!1,"Must provide name."),typeof e=="string"||(0,iL.devAssert)(!1,"Expected name to be a string."),e.length===0)throw new LN.GraphQLError("Expected name to be a non-empty string.");for(let t=1;t{"use strict";m();T();N();Object.defineProperty(Qe,"__esModule",{value:!0});Qe.GraphQLUnionType=Qe.GraphQLScalarType=Qe.GraphQLObjectType=Qe.GraphQLNonNull=Qe.GraphQLList=Qe.GraphQLInterfaceType=Qe.GraphQLInputObjectType=Qe.GraphQLEnumType=void 0;Qe.argsToArgsConfig=yL;Qe.assertAbstractType=N3;Qe.assertCompositeType=m3;Qe.assertEnumType=o3;Qe.assertInputObjectType=u3;Qe.assertInputType=d3;Qe.assertInterfaceType=a3;Qe.assertLeafType=f3;Qe.assertListType=c3;Qe.assertNamedType=y3;Qe.assertNonNullType=l3;Qe.assertNullableType=E3;Qe.assertObjectType=i3;Qe.assertOutputType=p3;Qe.assertScalarType=r3;Qe.assertType=n3;Qe.assertUnionType=s3;Qe.assertWrappingType=T3;Qe.defineArguments=EL;Qe.getNamedType=I3;Qe.getNullableType=h3;Qe.isAbstractType=fL;Qe.isCompositeType=pL;Qe.isEnumType=Sc;Qe.isInputObjectType=yp;Qe.isInputType=ig;Qe.isInterfaceType=_c;Qe.isLeafType=dL;Qe.isListType=GN;Qe.isNamedType=mL;Qe.isNonNullType=Pu;Qe.isNullableType=sg;Qe.isObjectType=kl;Qe.isOutputType=ag;Qe.isRequiredArgument=g3;Qe.isRequiredInputField=S3;Qe.isScalarType=gc;Qe.isType=$N;Qe.isUnionType=vc;Qe.isWrappingType=Ip;Qe.resolveObjMapThunk=ug;Qe.resolveReadonlyArrayThunk=og;var hr=Yr(),zW=Ou(),oL=ZF(),Tn=rn(),Ru=pp(),WW=Ka(),XW=Du(),lL=Np(),jN=QI(),ZW=bu(),$a=RN(),hp=tt(),e3=Mt(),uL=_i(),t3=rg(),Ga=Ep();function $N(e){return gc(e)||kl(e)||_c(e)||vc(e)||Sc(e)||yp(e)||GN(e)||Pu(e)}function n3(e){if(!$N(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL type.`);return e}function gc(e){return(0,Ru.instanceOf)(e,kN)}function r3(e){if(!gc(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL Scalar type.`);return e}function kl(e){return(0,Ru.instanceOf)(e,MN)}function i3(e){if(!kl(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL Object type.`);return e}function _c(e){return(0,Ru.instanceOf)(e,xN)}function a3(e){if(!_c(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL Interface type.`);return e}function vc(e){return(0,Ru.instanceOf)(e,qN)}function s3(e){if(!vc(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL Union type.`);return e}function Sc(e){return(0,Ru.instanceOf)(e,VN)}function o3(e){if(!Sc(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL Enum type.`);return e}function yp(e){return(0,Ru.instanceOf)(e,KN)}function u3(e){if(!yp(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL Input Object type.`);return e}function GN(e){return(0,Ru.instanceOf)(e,UN)}function c3(e){if(!GN(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL List type.`);return e}function Pu(e){return(0,Ru.instanceOf)(e,BN)}function l3(e){if(!Pu(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL Non-Null type.`);return e}function ig(e){return gc(e)||Sc(e)||yp(e)||Ip(e)&&ig(e.ofType)}function d3(e){if(!ig(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL input type.`);return e}function ag(e){return gc(e)||kl(e)||_c(e)||vc(e)||Sc(e)||Ip(e)&&ag(e.ofType)}function p3(e){if(!ag(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL output type.`);return e}function dL(e){return gc(e)||Sc(e)}function f3(e){if(!dL(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL leaf type.`);return e}function pL(e){return kl(e)||_c(e)||vc(e)}function m3(e){if(!pL(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL composite type.`);return e}function fL(e){return _c(e)||vc(e)}function N3(e){if(!fL(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL abstract type.`);return e}var UN=class{constructor(t){$N(t)||(0,hr.devAssert)(!1,`Expected ${(0,Tn.inspect)(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}};Qe.GraphQLList=UN;var BN=class{constructor(t){sg(t)||(0,hr.devAssert)(!1,`Expected ${(0,Tn.inspect)(t)} to be a GraphQL nullable type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}};Qe.GraphQLNonNull=BN;function Ip(e){return GN(e)||Pu(e)}function T3(e){if(!Ip(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL wrapping type.`);return e}function sg(e){return $N(e)&&!Pu(e)}function E3(e){if(!sg(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL nullable type.`);return e}function h3(e){if(e)return Pu(e)?e.ofType:e}function mL(e){return gc(e)||kl(e)||_c(e)||vc(e)||Sc(e)||yp(e)}function y3(e){if(!mL(e))throw new Error(`Expected ${(0,Tn.inspect)(e)} to be a GraphQL named type.`);return e}function I3(e){if(e){let t=e;for(;Ip(t);)t=t.ofType;return t}}function og(e){return typeof e=="function"?e():e}function ug(e){return typeof e=="function"?e():e}var kN=class{constructor(t){var n,r,i,a;let o=(n=t.parseValue)!==null&&n!==void 0?n:oL.identityFunc;this.name=(0,Ga.assertName)(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(r=t.serialize)!==null&&r!==void 0?r:oL.identityFunc,this.parseValue=o,this.parseLiteral=(i=t.parseLiteral)!==null&&i!==void 0?i:(u,l)=>o((0,t3.valueFromASTUntyped)(u,l)),this.extensions=(0,$a.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(a=t.extensionASTNodes)!==null&&a!==void 0?a:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||(0,hr.devAssert)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,Tn.inspect)(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||(0,hr.devAssert)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||(0,hr.devAssert)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Qe.GraphQLScalarType=kN;var MN=class{constructor(t){var n;this.name=(0,Ga.assertName)(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=(0,$a.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>TL(t),this._interfaces=()=>NL(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||(0,hr.devAssert)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,Tn.inspect)(t.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:hL(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Qe.GraphQLObjectType=MN;function NL(e){var t;let n=og((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||(0,hr.devAssert)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function TL(e){let t=ug(e.fields);return Bl(t)||(0,hr.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,jN.mapValue)(t,(n,r)=>{var i;Bl(n)||(0,hr.devAssert)(!1,`${e.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||(0,hr.devAssert)(!1,`${e.name}.${r} field resolver must be a function if provided, but got: ${(0,Tn.inspect)(n.resolve)}.`);let a=(i=n.args)!==null&&i!==void 0?i:{};return Bl(a)||(0,hr.devAssert)(!1,`${e.name}.${r} args must be an object with argument names as keys.`),{name:(0,Ga.assertName)(r),description:n.description,type:n.type,args:EL(a),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:(0,$a.toObjMap)(n.extensions),astNode:n.astNode}})}function EL(e){return Object.entries(e).map(([t,n])=>({name:(0,Ga.assertName)(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:(0,$a.toObjMap)(n.extensions),astNode:n.astNode}))}function Bl(e){return(0,WW.isObjectLike)(e)&&!Array.isArray(e)}function hL(e){return(0,jN.mapValue)(e,t=>({description:t.description,type:t.type,args:yL(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function yL(e){return(0,lL.keyValMap)(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function g3(e){return Pu(e.type)&&e.defaultValue===void 0}var xN=class{constructor(t){var n;this.name=(0,Ga.assertName)(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=(0,$a.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=TL.bind(void 0,t),this._interfaces=NL.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||(0,hr.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,Tn.inspect)(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:hL(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Qe.GraphQLInterfaceType=xN;var qN=class{constructor(t){var n;this.name=(0,Ga.assertName)(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=(0,$a.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=_3.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||(0,hr.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,Tn.inspect)(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Qe.GraphQLUnionType=qN;function _3(e){let t=og(e.types);return Array.isArray(t)||(0,hr.devAssert)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}var VN=class{constructor(t){var n;this.name=(0,Ga.assertName)(t.name),this.description=t.description,this.extensions=(0,$a.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof t.values=="function"?t.values:cL(this.name,t.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=cL(this.name,this._values())),this._values}getValue(t){return this._nameLookup===null&&(this._nameLookup=(0,XW.keyMap)(this.getValues(),n=>n.name)),this._nameLookup[t]}serialize(t){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(r=>[r.value,r])));let n=this._valueLookup.get(t);if(n===void 0)throw new hp.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0,Tn.inspect)(t)}`);return n.name}parseValue(t){if(typeof t!="string"){let r=(0,Tn.inspect)(t);throw new hp.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${r}.`+CN(this,r))}let n=this.getValue(t);if(n==null)throw new hp.GraphQLError(`Value "${t}" does not exist in "${this.name}" enum.`+CN(this,t));return n.value}parseLiteral(t,n){if(t.kind!==e3.Kind.ENUM){let i=(0,uL.print)(t);throw new hp.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+CN(this,i),{nodes:t})}let r=this.getValue(t.value);if(r==null){let i=(0,uL.print)(t);throw new hp.GraphQLError(`Value "${i}" does not exist in "${this.name}" enum.`+CN(this,i),{nodes:t})}return r.value}toConfig(){let t=(0,lL.keyValMap)(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Qe.GraphQLEnumType=VN;function CN(e,t){let n=e.getValues().map(i=>i.name),r=(0,ZW.suggestionList)(t,n);return(0,zW.didYouMean)("the enum value",r)}function cL(e,t){return Bl(t)||(0,hr.devAssert)(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,r])=>(Bl(r)||(0,hr.devAssert)(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${(0,Tn.inspect)(r)}.`),{name:(0,Ga.assertEnumValueName)(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:(0,$a.toObjMap)(r.extensions),astNode:r.astNode}))}var KN=class{constructor(t){var n,r;this.name=(0,Ga.assertName)(t.name),this.description=t.description,this.extensions=(0,$a.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(r=t.isOneOf)!==null&&r!==void 0?r:!1,this._fields=v3.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=(0,jN.mapValue)(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};Qe.GraphQLInputObjectType=KN;function v3(e){let t=ug(e.fields);return Bl(t)||(0,hr.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,jN.mapValue)(t,(n,r)=>(!("resolve"in n)||(0,hr.devAssert)(!1,`${e.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:(0,Ga.assertName)(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:(0,$a.toObjMap)(n.extensions),astNode:n.astNode}))}function S3(e){return Pu(e.type)&&e.defaultValue===void 0}});var _p=F(gp=>{"use strict";m();T();N();Object.defineProperty(gp,"__esModule",{value:!0});gp.doTypesOverlap=O3;gp.isEqualType=cg;gp.isTypeSubTypeOf=QN;var Ur=xt();function cg(e,t){return e===t?!0:(0,Ur.isNonNullType)(e)&&(0,Ur.isNonNullType)(t)||(0,Ur.isListType)(e)&&(0,Ur.isListType)(t)?cg(e.ofType,t.ofType):!1}function QN(e,t,n){return t===n?!0:(0,Ur.isNonNullType)(n)?(0,Ur.isNonNullType)(t)?QN(e,t.ofType,n.ofType):!1:(0,Ur.isNonNullType)(t)?QN(e,t.ofType,n):(0,Ur.isListType)(n)?(0,Ur.isListType)(t)?QN(e,t.ofType,n.ofType):!1:(0,Ur.isListType)(t)?!1:(0,Ur.isAbstractType)(n)&&((0,Ur.isInterfaceType)(t)||(0,Ur.isObjectType)(t))&&e.isSubType(n,t)}function O3(e,t,n){return t===n?!0:(0,Ur.isAbstractType)(t)?(0,Ur.isAbstractType)(n)?e.getPossibleTypes(t).some(r=>e.isSubType(n,r)):e.isSubType(t,n):(0,Ur.isAbstractType)(n)?e.isSubType(n,t):!1}});var Qa=F(lr=>{"use strict";m();T();N();Object.defineProperty(lr,"__esModule",{value:!0});lr.GraphQLString=lr.GraphQLInt=lr.GraphQLID=lr.GraphQLFloat=lr.GraphQLBoolean=lr.GRAPHQL_MIN_INT=lr.GRAPHQL_MAX_INT=void 0;lr.isSpecifiedScalarType=D3;lr.specifiedScalarTypes=void 0;var ma=rn(),IL=Ka(),yr=tt(),Oc=Mt(),vp=_i(),Sp=xt(),YN=2147483647;lr.GRAPHQL_MAX_INT=YN;var JN=-2147483648;lr.GRAPHQL_MIN_INT=JN;var gL=new Sp.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=Op(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isInteger(n))throw new yr.GraphQLError(`Int cannot represent non-integer value: ${(0,ma.inspect)(t)}`);if(n>YN||nYN||eYN||te.name===t)}function Op(e){if((0,IL.isObjectLike)(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!(0,IL.isObjectLike)(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}});var si=F(Qn=>{"use strict";m();T();N();Object.defineProperty(Qn,"__esModule",{value:!0});Qn.GraphQLSpecifiedByDirective=Qn.GraphQLSkipDirective=Qn.GraphQLOneOfDirective=Qn.GraphQLIncludeDirective=Qn.GraphQLDirective=Qn.GraphQLDeprecatedDirective=Qn.DEFAULT_DEPRECATION_REASON=void 0;Qn.assertDirective=L3;Qn.isDirective=AL;Qn.isSpecifiedDirective=w3;Qn.specifiedDirectives=void 0;var bL=Yr(),b3=rn(),A3=pp(),R3=Ka(),P3=RN(),Mi=Ll(),F3=Ep(),Dp=xt(),HN=Qa();function AL(e){return(0,A3.instanceOf)(e,As)}function L3(e){if(!AL(e))throw new Error(`Expected ${(0,b3.inspect)(e)} to be a GraphQL directive.`);return e}var As=class{constructor(t){var n,r;this.name=(0,F3.assertName)(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=(0,P3.toObjMap)(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||(0,bL.devAssert)(!1,`@${t.name} locations must be an Array.`);let i=(r=t.args)!==null&&r!==void 0?r:{};(0,R3.isObjectLike)(i)&&!Array.isArray(i)||(0,bL.devAssert)(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=(0,Dp.defineArguments)(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:(0,Dp.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}};Qn.GraphQLDirective=As;var RL=new As({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[Mi.DirectiveLocation.FIELD,Mi.DirectiveLocation.FRAGMENT_SPREAD,Mi.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new Dp.GraphQLNonNull(HN.GraphQLBoolean),description:"Included when true."}}});Qn.GraphQLIncludeDirective=RL;var PL=new As({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[Mi.DirectiveLocation.FIELD,Mi.DirectiveLocation.FRAGMENT_SPREAD,Mi.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new Dp.GraphQLNonNull(HN.GraphQLBoolean),description:"Skipped when true."}}});Qn.GraphQLSkipDirective=PL;var FL="No longer supported";Qn.DEFAULT_DEPRECATION_REASON=FL;var LL=new As({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[Mi.DirectiveLocation.FIELD_DEFINITION,Mi.DirectiveLocation.ARGUMENT_DEFINITION,Mi.DirectiveLocation.INPUT_FIELD_DEFINITION,Mi.DirectiveLocation.ENUM_VALUE],args:{reason:{type:HN.GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:FL}}});Qn.GraphQLDeprecatedDirective=LL;var wL=new As({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[Mi.DirectiveLocation.SCALAR],args:{url:{type:new Dp.GraphQLNonNull(HN.GraphQLString),description:"The URL that specifies the behavior of this scalar."}}});Qn.GraphQLSpecifiedByDirective=wL;var CL=new As({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[Mi.DirectiveLocation.INPUT_OBJECT],args:{}});Qn.GraphQLOneOfDirective=CL;var UL=Object.freeze([RL,PL,LL,wL,CL]);Qn.specifiedDirectives=UL;function w3(e){return UL.some(({name:t})=>t===e.name)}});var zN=F(lg=>{"use strict";m();T();N();Object.defineProperty(lg,"__esModule",{value:!0});lg.isIterableObject=C3;function C3(e){return typeof e=="object"&&typeof(e==null?void 0:e[Symbol.iterator])=="function"}});var Rp=F(dg=>{"use strict";m();T();N();Object.defineProperty(dg,"__esModule",{value:!0});dg.astFromValue=Ap;var BL=rn(),U3=Cr(),B3=zN(),k3=Ka(),xi=Mt(),bp=xt(),M3=Qa();function Ap(e,t){if((0,bp.isNonNullType)(t)){let n=Ap(e,t.ofType);return(n==null?void 0:n.kind)===xi.Kind.NULL?null:n}if(e===null)return{kind:xi.Kind.NULL};if(e===void 0)return null;if((0,bp.isListType)(t)){let n=t.ofType;if((0,B3.isIterableObject)(e)){let r=[];for(let i of e){let a=Ap(i,n);a!=null&&r.push(a)}return{kind:xi.Kind.LIST,values:r}}return Ap(e,n)}if((0,bp.isInputObjectType)(t)){if(!(0,k3.isObjectLike)(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=Ap(e[r.name],r.type);i&&n.push({kind:xi.Kind.OBJECT_FIELD,name:{kind:xi.Kind.NAME,value:r.name},value:i})}return{kind:xi.Kind.OBJECT,fields:n}}if((0,bp.isLeafType)(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return{kind:xi.Kind.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let r=String(n);return kL.test(r)?{kind:xi.Kind.INT,value:r}:{kind:xi.Kind.FLOAT,value:r}}if(typeof n=="string")return(0,bp.isEnumType)(t)?{kind:xi.Kind.ENUM,value:n}:t===M3.GraphQLID&&kL.test(n)?{kind:xi.Kind.INT,value:n}:{kind:xi.Kind.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${(0,BL.inspect)(n)}.`)}(0,U3.invariant)(!1,"Unexpected input type: "+(0,BL.inspect)(t))}var kL=/^-?(?:0|[1-9][0-9]*)$/});var Vi=F(an=>{"use strict";m();T();N();Object.defineProperty(an,"__esModule",{value:!0});an.introspectionTypes=an.__TypeKind=an.__Type=an.__Schema=an.__InputValue=an.__Field=an.__EnumValue=an.__DirectiveLocation=an.__Directive=an.TypeNameMetaFieldDef=an.TypeMetaFieldDef=an.TypeKind=an.SchemaMetaFieldDef=void 0;an.isIntrospectionType=Q3;var x3=rn(),q3=Cr(),dr=Ll(),V3=_i(),K3=Rp(),Ve=xt(),dn=Qa(),pg=new Ve.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:dn.GraphQLString,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new Ve.GraphQLNonNull(new Ve.GraphQLList(new Ve.GraphQLNonNull(qi))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new Ve.GraphQLNonNull(qi),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:qi,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:qi,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new Ve.GraphQLNonNull(new Ve.GraphQLList(new Ve.GraphQLNonNull(fg))),resolve:e=>e.getDirectives()}})});an.__Schema=pg;var fg=new Ve.GraphQLObjectType({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. -In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new Ve.GraphQLNonNull(ln.GraphQLString),resolve:e=>e.name},description:{type:ln.GraphQLString,resolve:e=>e.description},isRepeatable:{type:new Ve.GraphQLNonNull(ln.GraphQLBoolean),resolve:e=>e.isRepeatable},locations:{type:new Ve.GraphQLNonNull(new Ve.GraphQLList(new Ve.GraphQLNonNull(eg))),resolve:e=>e.locations},args:{type:new Ve.GraphQLNonNull(new Ve.GraphQLList(new Ve.GraphQLNonNull(vf))),args:{includeDeprecated:{type:ln.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}}})});rn.__Directive=ZI;var eg=new Ve.GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:or.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:or.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:or.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:or.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:or.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:or.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:or.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:or.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:or.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:or.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:or.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:or.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:or.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:or.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:or.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:or.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:or.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:or.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:or.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});rn.__DirectiveLocation=eg;var Mi=new Ve.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new Ve.GraphQLNonNull(rg),resolve(e){if((0,Ve.isScalarType)(e))return ur.SCALAR;if((0,Ve.isObjectType)(e))return ur.OBJECT;if((0,Ve.isInterfaceType)(e))return ur.INTERFACE;if((0,Ve.isUnionType)(e))return ur.UNION;if((0,Ve.isEnumType)(e))return ur.ENUM;if((0,Ve.isInputObjectType)(e))return ur.INPUT_OBJECT;if((0,Ve.isListType)(e))return ur.LIST;if((0,Ve.isNonNullType)(e))return ur.NON_NULL;(0,DW.invariant)(!1,`Unexpected type: "${(0,OW.inspect)(e)}".`)}},name:{type:ln.GraphQLString,resolve:e=>"name"in e?e.name:void 0},description:{type:ln.GraphQLString,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:ln.GraphQLString,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new Ve.GraphQLList(new Ve.GraphQLNonNull(tg)),args:{includeDeprecated:{type:ln.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,Ve.isObjectType)(e)||(0,Ve.isInterfaceType)(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new Ve.GraphQLList(new Ve.GraphQLNonNull(Mi)),resolve(e){if((0,Ve.isObjectType)(e)||(0,Ve.isInterfaceType)(e))return e.getInterfaces()}},possibleTypes:{type:new Ve.GraphQLList(new Ve.GraphQLNonNull(Mi)),resolve(e,t,n,{schema:r}){if((0,Ve.isAbstractType)(e))return r.getPossibleTypes(e)}},enumValues:{type:new Ve.GraphQLList(new Ve.GraphQLNonNull(ng)),args:{includeDeprecated:{type:ln.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,Ve.isEnumType)(e)){let n=e.getValues();return t?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new Ve.GraphQLList(new Ve.GraphQLNonNull(vf)),args:{includeDeprecated:{type:ln.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,Ve.isInputObjectType)(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:Mi,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:ln.GraphQLBoolean,resolve:e=>{if((0,Ve.isInputObjectType)(e))return e.isOneOf}}})});rn.__Type=Mi;var tg=new Ve.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new Ve.GraphQLNonNull(ln.GraphQLString),resolve:e=>e.name},description:{type:ln.GraphQLString,resolve:e=>e.description},args:{type:new Ve.GraphQLNonNull(new Ve.GraphQLList(new Ve.GraphQLNonNull(vf))),args:{includeDeprecated:{type:ln.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new Ve.GraphQLNonNull(Mi),resolve:e=>e.type},isDeprecated:{type:new Ve.GraphQLNonNull(ln.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:ln.GraphQLString,resolve:e=>e.deprecationReason}})});rn.__Field=tg;var vf=new Ve.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new Ve.GraphQLNonNull(ln.GraphQLString),resolve:e=>e.name},description:{type:ln.GraphQLString,resolve:e=>e.description},type:{type:new Ve.GraphQLNonNull(Mi),resolve:e=>e.type},defaultValue:{type:ln.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:n}=e,r=(0,AW.astFromValue)(n,t);return r?(0,bW.print)(r):null}},isDeprecated:{type:new Ve.GraphQLNonNull(ln.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:ln.GraphQLString,resolve:e=>e.deprecationReason}})});rn.__InputValue=vf;var ng=new Ve.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new Ve.GraphQLNonNull(ln.GraphQLString),resolve:e=>e.name},description:{type:ln.GraphQLString,resolve:e=>e.description},isDeprecated:{type:new Ve.GraphQLNonNull(ln.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:ln.GraphQLString,resolve:e=>e.deprecationReason}})});rn.__EnumValue=ng;var ur;rn.TypeKind=ur;(function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"})(ur||(rn.TypeKind=ur={}));var rg=new Ve.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:ur.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:ur.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:ur.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:ur.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:ur.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:ur.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:ur.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:ur.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});rn.__TypeKind=rg;var RW={name:"__schema",type:new Ve.GraphQLNonNull(XI),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};rn.SchemaMetaFieldDef=RW;var PW={name:"__type",type:Mi,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new Ve.GraphQLNonNull(ln.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};rn.TypeMetaFieldDef=PW;var FW={name:"__typename",type:new Ve.GraphQLNonNull(ln.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};rn.TypeNameMetaFieldDef=FW;var gw=Object.freeze([XI,ZI,eg,Mi,tg,vf,ng,rg]);rn.introspectionTypes=gw;function wW(e){return gw.some(({name:t})=>e.name===t)}});var hc=F(Rl=>{"use strict";m();T();N();Object.defineProperty(Rl,"__esModule",{value:!0});Rl.GraphQLSchema=void 0;Rl.assertSchema=kW;Rl.isSchema=vw;var kN=$r(),ag=nn(),LW=af(),CW=Va(),UW=NN(),ig=ja(),pa=Bt(),_w=ni(),BW=xi();function vw(e){return(0,LW.instanceOf)(e,MN)}function kW(e){if(!vw(e))throw new Error(`Expected ${(0,ag.inspect)(e)} to be a GraphQL schema.`);return e}var MN=class{constructor(t){var n,r;this.__validationErrors=t.assumeValid===!0?[]:void 0,(0,CW.isObjectLike)(t)||(0,kN.devAssert)(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||(0,kN.devAssert)(!1,`"types" must be Array if provided but got: ${(0,ag.inspect)(t.types)}.`),!t.directives||Array.isArray(t.directives)||(0,kN.devAssert)(!1,`"directives" must be Array if provided but got: ${(0,ag.inspect)(t.directives)}.`),this.description=t.description,this.extensions=(0,UW.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(r=t.directives)!==null&&r!==void 0?r:_w.specifiedDirectives;let i=new Set(t.types);if(t.types!=null)for(let a of t.types)i.delete(a),ma(a,i);this._queryType!=null&&ma(this._queryType,i),this._mutationType!=null&&ma(this._mutationType,i),this._subscriptionType!=null&&ma(this._subscriptionType,i);for(let a of this._directives)if((0,_w.isDirective)(a))for(let o of a.args)ma(o.type,i);ma(BW.__Schema,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let a of i){if(a==null)continue;let o=a.name;if(o||(0,kN.devAssert)(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=a,(0,pa.isInterfaceType)(a)){for(let u of a.getInterfaces())if((0,pa.isInterfaceType)(u)){let l=this._implementationsMap[u.name];l===void 0&&(l=this._implementationsMap[u.name]={objects:[],interfaces:[]}),l.interfaces.push(a)}}else if((0,pa.isObjectType)(a)){for(let u of a.getInterfaces())if((0,pa.isInterfaceType)(u)){let l=this._implementationsMap[u.name];l===void 0&&(l=this._implementationsMap[u.name]={objects:[],interfaces:[]}),l.objects.push(a)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case ig.OperationTypeNode.QUERY:return this.getQueryType();case ig.OperationTypeNode.MUTATION:return this.getMutationType();case ig.OperationTypeNode.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return(0,pa.isUnionType)(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let n=this._implementationsMap[t.name];return n!=null?n:{objects:[],interfaces:[]}}isSubType(t,n){let r=this._subTypeMap[t.name];if(r===void 0){if(r=Object.create(null),(0,pa.isUnionType)(t))for(let i of t.getTypes())r[i.name]=!0;else{let i=this.getImplementations(t);for(let a of i.objects)r[a.name]=!0;for(let a of i.interfaces)r[a.name]=!0}this._subTypeMap[t.name]=r}return r[n.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}};Rl.GraphQLSchema=MN;function ma(e,t){let n=(0,pa.getNamedType)(e);if(!t.has(n)){if(t.add(n),(0,pa.isUnionType)(n))for(let r of n.getTypes())ma(r,t);else if((0,pa.isObjectType)(n)||(0,pa.isInterfaceType)(n)){for(let r of n.getInterfaces())ma(r,t);for(let r of Object.values(n.getFields())){ma(r.type,t);for(let i of r.args)ma(i.type,t)}}else if((0,pa.isInputObjectType)(n))for(let r of Object.values(n.getFields()))ma(r.type,t)}return t}});var Of=F(xN=>{"use strict";m();T();N();Object.defineProperty(xN,"__esModule",{value:!0});xN.assertValidSchema=VW;xN.validateSchema=Rw;var Lr=nn(),MW=Ze(),sg=ja(),Sw=Nf(),Un=Bt(),Aw=ni(),xW=xi(),qW=hc();function Rw(e){if((0,qW.assertSchema)(e),e.__validationErrors)return e.__validationErrors;let t=new ug(e);jW(t),KW(t),$W(t);let n=t.getErrors();return e.__validationErrors=n,n}function VW(e){let t=Rw(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` +In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new Ve.GraphQLNonNull(dn.GraphQLString),resolve:e=>e.name},description:{type:dn.GraphQLString,resolve:e=>e.description},isRepeatable:{type:new Ve.GraphQLNonNull(dn.GraphQLBoolean),resolve:e=>e.isRepeatable},locations:{type:new Ve.GraphQLNonNull(new Ve.GraphQLList(new Ve.GraphQLNonNull(mg))),resolve:e=>e.locations},args:{type:new Ve.GraphQLNonNull(new Ve.GraphQLList(new Ve.GraphQLNonNull(Pp))),args:{includeDeprecated:{type:dn.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}}})});an.__Directive=fg;var mg=new Ve.GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:dr.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:dr.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:dr.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:dr.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:dr.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:dr.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:dr.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:dr.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:dr.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:dr.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:dr.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:dr.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:dr.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:dr.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:dr.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:dr.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:dr.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:dr.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:dr.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});an.__DirectiveLocation=mg;var qi=new Ve.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new Ve.GraphQLNonNull(Eg),resolve(e){if((0,Ve.isScalarType)(e))return pr.SCALAR;if((0,Ve.isObjectType)(e))return pr.OBJECT;if((0,Ve.isInterfaceType)(e))return pr.INTERFACE;if((0,Ve.isUnionType)(e))return pr.UNION;if((0,Ve.isEnumType)(e))return pr.ENUM;if((0,Ve.isInputObjectType)(e))return pr.INPUT_OBJECT;if((0,Ve.isListType)(e))return pr.LIST;if((0,Ve.isNonNullType)(e))return pr.NON_NULL;(0,q3.invariant)(!1,`Unexpected type: "${(0,x3.inspect)(e)}".`)}},name:{type:dn.GraphQLString,resolve:e=>"name"in e?e.name:void 0},description:{type:dn.GraphQLString,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:dn.GraphQLString,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new Ve.GraphQLList(new Ve.GraphQLNonNull(Ng)),args:{includeDeprecated:{type:dn.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,Ve.isObjectType)(e)||(0,Ve.isInterfaceType)(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new Ve.GraphQLList(new Ve.GraphQLNonNull(qi)),resolve(e){if((0,Ve.isObjectType)(e)||(0,Ve.isInterfaceType)(e))return e.getInterfaces()}},possibleTypes:{type:new Ve.GraphQLList(new Ve.GraphQLNonNull(qi)),resolve(e,t,n,{schema:r}){if((0,Ve.isAbstractType)(e))return r.getPossibleTypes(e)}},enumValues:{type:new Ve.GraphQLList(new Ve.GraphQLNonNull(Tg)),args:{includeDeprecated:{type:dn.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,Ve.isEnumType)(e)){let n=e.getValues();return t?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new Ve.GraphQLList(new Ve.GraphQLNonNull(Pp)),args:{includeDeprecated:{type:dn.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,Ve.isInputObjectType)(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:qi,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:dn.GraphQLBoolean,resolve:e=>{if((0,Ve.isInputObjectType)(e))return e.isOneOf}}})});an.__Type=qi;var Ng=new Ve.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new Ve.GraphQLNonNull(dn.GraphQLString),resolve:e=>e.name},description:{type:dn.GraphQLString,resolve:e=>e.description},args:{type:new Ve.GraphQLNonNull(new Ve.GraphQLList(new Ve.GraphQLNonNull(Pp))),args:{includeDeprecated:{type:dn.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new Ve.GraphQLNonNull(qi),resolve:e=>e.type},isDeprecated:{type:new Ve.GraphQLNonNull(dn.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:dn.GraphQLString,resolve:e=>e.deprecationReason}})});an.__Field=Ng;var Pp=new Ve.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new Ve.GraphQLNonNull(dn.GraphQLString),resolve:e=>e.name},description:{type:dn.GraphQLString,resolve:e=>e.description},type:{type:new Ve.GraphQLNonNull(qi),resolve:e=>e.type},defaultValue:{type:dn.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:n}=e,r=(0,K3.astFromValue)(n,t);return r?(0,V3.print)(r):null}},isDeprecated:{type:new Ve.GraphQLNonNull(dn.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:dn.GraphQLString,resolve:e=>e.deprecationReason}})});an.__InputValue=Pp;var Tg=new Ve.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new Ve.GraphQLNonNull(dn.GraphQLString),resolve:e=>e.name},description:{type:dn.GraphQLString,resolve:e=>e.description},isDeprecated:{type:new Ve.GraphQLNonNull(dn.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:dn.GraphQLString,resolve:e=>e.deprecationReason}})});an.__EnumValue=Tg;var pr;an.TypeKind=pr;(function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"})(pr||(an.TypeKind=pr={}));var Eg=new Ve.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:pr.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:pr.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:pr.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:pr.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:pr.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:pr.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:pr.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:pr.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});an.__TypeKind=Eg;var j3={name:"__schema",type:new Ve.GraphQLNonNull(pg),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};an.SchemaMetaFieldDef=j3;var $3={name:"__type",type:qi,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new Ve.GraphQLNonNull(dn.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};an.TypeMetaFieldDef=$3;var G3={name:"__typename",type:new Ve.GraphQLNonNull(dn.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};an.TypeNameMetaFieldDef=G3;var ML=Object.freeze([pg,fg,mg,qi,Ng,Pp,Tg,Eg]);an.introspectionTypes=ML;function Q3(e){return ML.some(({name:t})=>e.name===t)}});var Dc=F(Ml=>{"use strict";m();T();N();Object.defineProperty(Ml,"__esModule",{value:!0});Ml.GraphQLSchema=void 0;Ml.assertSchema=W3;Ml.isSchema=qL;var WN=Yr(),yg=rn(),Y3=pp(),J3=Ka(),H3=RN(),hg=ja(),Na=xt(),xL=si(),z3=Vi();function qL(e){return(0,Y3.instanceOf)(e,XN)}function W3(e){if(!qL(e))throw new Error(`Expected ${(0,yg.inspect)(e)} to be a GraphQL schema.`);return e}var XN=class{constructor(t){var n,r;this.__validationErrors=t.assumeValid===!0?[]:void 0,(0,J3.isObjectLike)(t)||(0,WN.devAssert)(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||(0,WN.devAssert)(!1,`"types" must be Array if provided but got: ${(0,yg.inspect)(t.types)}.`),!t.directives||Array.isArray(t.directives)||(0,WN.devAssert)(!1,`"directives" must be Array if provided but got: ${(0,yg.inspect)(t.directives)}.`),this.description=t.description,this.extensions=(0,H3.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(r=t.directives)!==null&&r!==void 0?r:xL.specifiedDirectives;let i=new Set(t.types);if(t.types!=null)for(let a of t.types)i.delete(a),Ta(a,i);this._queryType!=null&&Ta(this._queryType,i),this._mutationType!=null&&Ta(this._mutationType,i),this._subscriptionType!=null&&Ta(this._subscriptionType,i);for(let a of this._directives)if((0,xL.isDirective)(a))for(let o of a.args)Ta(o.type,i);Ta(z3.__Schema,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let a of i){if(a==null)continue;let o=a.name;if(o||(0,WN.devAssert)(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=a,(0,Na.isInterfaceType)(a)){for(let u of a.getInterfaces())if((0,Na.isInterfaceType)(u)){let l=this._implementationsMap[u.name];l===void 0&&(l=this._implementationsMap[u.name]={objects:[],interfaces:[]}),l.interfaces.push(a)}}else if((0,Na.isObjectType)(a)){for(let u of a.getInterfaces())if((0,Na.isInterfaceType)(u)){let l=this._implementationsMap[u.name];l===void 0&&(l=this._implementationsMap[u.name]={objects:[],interfaces:[]}),l.objects.push(a)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case hg.OperationTypeNode.QUERY:return this.getQueryType();case hg.OperationTypeNode.MUTATION:return this.getMutationType();case hg.OperationTypeNode.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return(0,Na.isUnionType)(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let n=this._implementationsMap[t.name];return n!=null?n:{objects:[],interfaces:[]}}isSubType(t,n){let r=this._subTypeMap[t.name];if(r===void 0){if(r=Object.create(null),(0,Na.isUnionType)(t))for(let i of t.getTypes())r[i.name]=!0;else{let i=this.getImplementations(t);for(let a of i.objects)r[a.name]=!0;for(let a of i.interfaces)r[a.name]=!0}this._subTypeMap[t.name]=r}return r[n.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}};Ml.GraphQLSchema=XN;function Ta(e,t){let n=(0,Na.getNamedType)(e);if(!t.has(n)){if(t.add(n),(0,Na.isUnionType)(n))for(let r of n.getTypes())Ta(r,t);else if((0,Na.isObjectType)(n)||(0,Na.isInterfaceType)(n)){for(let r of n.getInterfaces())Ta(r,t);for(let r of Object.values(n.getFields())){Ta(r.type,t);for(let i of r.args)Ta(i.type,t)}}else if((0,Na.isInputObjectType)(n))for(let r of Object.values(n.getFields()))Ta(r.type,t)}return t}});var Lp=F(ZN=>{"use strict";m();T();N();Object.defineProperty(ZN,"__esModule",{value:!0});ZN.assertValidSchema=t6;ZN.validateSchema=QL;var Br=rn(),X3=tt(),Ig=ja(),VL=_p(),xn=xt(),GL=si(),Z3=Vi(),e6=Dc();function QL(e){if((0,e6.assertSchema)(e),e.__validationErrors)return e.__validationErrors;let t=new _g(e);n6(t),r6(t),i6(t);let n=t.getErrors();return e.__validationErrors=n,n}function t6(e){let t=QL(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` -`))}var ug=class{constructor(t){this._errors=[],this.schema=t}reportError(t,n){let r=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new MW.GraphQLError(t,{nodes:r}))}getErrors(){return this._errors}};function jW(e){let t=e.schema,n=t.getQueryType();if(!n)e.reportError("Query root type must be provided.",t.astNode);else if(!(0,Un.isObjectType)(n)){var r;e.reportError(`Query root type must be Object type, it cannot be ${(0,Lr.inspect)(n)}.`,(r=og(t,sg.OperationTypeNode.QUERY))!==null&&r!==void 0?r:n.astNode)}let i=t.getMutationType();if(i&&!(0,Un.isObjectType)(i)){var a;e.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,Lr.inspect)(i)}.`,(a=og(t,sg.OperationTypeNode.MUTATION))!==null&&a!==void 0?a:i.astNode)}let o=t.getSubscriptionType();if(o&&!(0,Un.isObjectType)(o)){var u;e.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,Lr.inspect)(o)}.`,(u=og(t,sg.OperationTypeNode.SUBSCRIPTION))!==null&&u!==void 0?u:o.astNode)}}function og(e,t){var n;return(n=[e.astNode,...e.extensionASTNodes].flatMap(r=>{var i;return(i=r==null?void 0:r.operationTypes)!==null&&i!==void 0?i:[]}).find(r=>r.operation===t))===null||n===void 0?void 0:n.type}function KW(e){for(let n of e.schema.getDirectives()){if(!(0,Aw.isDirective)(n)){e.reportError(`Expected directive but got: ${(0,Lr.inspect)(n)}.`,n==null?void 0:n.astNode);continue}yc(e,n);for(let r of n.args)if(yc(e,r),(0,Un.isInputType)(r.type)||e.reportError(`The type of @${n.name}(${r.name}:) must be Input Type but got: ${(0,Lr.inspect)(r.type)}.`,r.astNode),(0,Un.isRequiredArgument)(r)&&r.deprecationReason!=null){var t;e.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[cg(r.astNode),(t=r.astNode)===null||t===void 0?void 0:t.type])}}}function yc(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function $W(e){let t=WW(e),n=e.schema.getTypeMap();for(let r of Object.values(n)){if(!(0,Un.isNamedType)(r)){e.reportError(`Expected GraphQL named type but got: ${(0,Lr.inspect)(r)}.`,r.astNode);continue}(0,xW.isIntrospectionType)(r)||yc(e,r),(0,Un.isObjectType)(r)||(0,Un.isInterfaceType)(r)?(Ow(e,r),Dw(e,r)):(0,Un.isUnionType)(r)?YW(e,r):(0,Un.isEnumType)(r)?JW(e,r):(0,Un.isInputObjectType)(r)&&(zW(e,r),t(r))}}function Ow(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let o of n){if(yc(e,o),!(0,Un.isOutputType)(o.type)){var r;e.reportError(`The type of ${t.name}.${o.name} must be Output Type but got: ${(0,Lr.inspect)(o.type)}.`,(r=o.astNode)===null||r===void 0?void 0:r.type)}for(let u of o.args){let l=u.name;if(yc(e,u),!(0,Un.isInputType)(u.type)){var i;e.reportError(`The type of ${t.name}.${o.name}(${l}:) must be Input Type but got: ${(0,Lr.inspect)(u.type)}.`,(i=u.astNode)===null||i===void 0?void 0:i.type)}if((0,Un.isRequiredArgument)(u)&&u.deprecationReason!=null){var a;e.reportError(`Required argument ${t.name}.${o.name}(${l}:) cannot be deprecated.`,[cg(u.astNode),(a=u.astNode)===null||a===void 0?void 0:a.type])}}}}function Dw(e,t){let n=Object.create(null);for(let r of t.getInterfaces()){if(!(0,Un.isInterfaceType)(r)){e.reportError(`Type ${(0,Lr.inspect)(t)} must only implement Interface types, it cannot implement ${(0,Lr.inspect)(r)}.`,Sf(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,Sf(t,r));continue}if(n[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,Sf(t,r));continue}n[r.name]=!0,QW(e,t,r),GW(e,t,r)}}function GW(e,t,n){let r=t.getFields();for(let l of Object.values(n.getFields())){let d=l.name,p=r[d];if(!p){e.reportError(`Interface field ${n.name}.${d} expected but ${t.name} does not provide it.`,[l.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!(0,Sw.isTypeSubTypeOf)(e.schema,p.type,l.type)){var i,a;e.reportError(`Interface field ${n.name}.${d} expects type ${(0,Lr.inspect)(l.type)} but ${t.name}.${d} is type ${(0,Lr.inspect)(p.type)}.`,[(i=l.astNode)===null||i===void 0?void 0:i.type,(a=p.astNode)===null||a===void 0?void 0:a.type])}for(let E of l.args){let h=E.name,v=p.args.find(A=>A.name===h);if(!v){e.reportError(`Interface field argument ${n.name}.${d}(${h}:) expected but ${t.name}.${d} does not provide it.`,[E.astNode,p.astNode]);continue}if(!(0,Sw.isEqualType)(E.type,v.type)){var o,u;e.reportError(`Interface field argument ${n.name}.${d}(${h}:) expects type ${(0,Lr.inspect)(E.type)} but ${t.name}.${d}(${h}:) is type ${(0,Lr.inspect)(v.type)}.`,[(o=E.astNode)===null||o===void 0?void 0:o.type,(u=v.astNode)===null||u===void 0?void 0:u.type])}}for(let E of p.args){let h=E.name;!l.args.find(A=>A.name===h)&&(0,Un.isRequiredArgument)(E)&&e.reportError(`Object field ${t.name}.${d} includes required argument ${h} that is missing from the Interface field ${n.name}.${d}.`,[E.astNode,l.astNode])}}}function QW(e,t,n){let r=t.getInterfaces();for(let i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...Sf(n,i),...Sf(t,n)])}function YW(e,t){let n=t.getTypes();n.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=Object.create(null);for(let i of n){if(r[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,bw(t,i.name));continue}r[i.name]=!0,(0,Un.isObjectType)(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,Lr.inspect)(i)}.`,bw(t,String(i)))}}function JW(e,t){let n=t.getValues();n.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let r of n)yc(e,r)}function zW(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let a of n){if(yc(e,a),!(0,Un.isInputType)(a.type)){var r;e.reportError(`The type of ${t.name}.${a.name} must be Input Type but got: ${(0,Lr.inspect)(a.type)}.`,(r=a.astNode)===null||r===void 0?void 0:r.type)}if((0,Un.isRequiredInputField)(a)&&a.deprecationReason!=null){var i;e.reportError(`Required input field ${t.name}.${a.name} cannot be deprecated.`,[cg(a.astNode),(i=a.astNode)===null||i===void 0?void 0:i.type])}t.isOneOf&&HW(t,a,e)}}function HW(e,t,n){if((0,Un.isNonNullType)(t.type)){var r;n.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,(r=t.astNode)===null||r===void 0?void 0:r.type)}t.defaultValue!==void 0&&n.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}function WW(e){let t=Object.create(null),n=[],r=Object.create(null);return i;function i(a){if(t[a.name])return;t[a.name]=!0,r[a.name]=n.length;let o=Object.values(a.getFields());for(let u of o)if((0,Un.isNonNullType)(u.type)&&(0,Un.isInputObjectType)(u.type.ofType)){let l=u.type.ofType,d=r[l.name];if(n.push(u),d===void 0)i(l);else{let p=n.slice(d),E=p.map(h=>h.name).join(".");e.reportError(`Cannot reference Input Object "${l.name}" within itself through a series of non-null fields: "${E}".`,p.map(h=>h.astNode))}n.pop()}r[a.name]=void 0}}function Sf(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap(a=>{var o;return(o=a.interfaces)!==null&&o!==void 0?o:[]}).filter(a=>a.name.value===t.name)}function bw(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap(a=>{var o;return(o=a.types)!==null&&o!==void 0?o:[]}).filter(a=>a.name.value===t)}function cg(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(n=>n.name.value===Aw.GraphQLDeprecatedDirective.name)}});var Qa=F(fg=>{"use strict";m();T();N();Object.defineProperty(fg,"__esModule",{value:!0});fg.typeFromAST=dg;var lg=Ut(),Pw=Bt();function dg(e,t){switch(t.kind){case lg.Kind.LIST_TYPE:{let n=dg(e,t.type);return n&&new Pw.GraphQLList(n)}case lg.Kind.NON_NULL_TYPE:{let n=dg(e,t.type);return n&&new Pw.GraphQLNonNull(n)}case lg.Kind.NAMED_TYPE:return e.getType(t.name.value)}}});var qN=F(Df=>{"use strict";m();T();N();Object.defineProperty(Df,"__esModule",{value:!0});Df.TypeInfo=void 0;Df.visitWithTypeInfo=e6;var XW=ja(),Bn=Ut(),Fw=fc(),kn=Bt(),Pl=xi(),ww=Qa(),pg=class{constructor(t,n,r){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=r!=null?r:ZW,n&&((0,kn.isInputType)(n)&&this._inputTypeStack.push(n),(0,kn.isCompositeType)(n)&&this._parentTypeStack.push(n),(0,kn.isOutputType)(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){let n=this._schema;switch(t.kind){case Bn.Kind.SELECTION_SET:{let i=(0,kn.getNamedType)(this.getType());this._parentTypeStack.push((0,kn.isCompositeType)(i)?i:void 0);break}case Bn.Kind.FIELD:{let i=this.getParentType(),a,o;i&&(a=this._getFieldDef(n,i,t),a&&(o=a.type)),this._fieldDefStack.push(a),this._typeStack.push((0,kn.isOutputType)(o)?o:void 0);break}case Bn.Kind.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case Bn.Kind.OPERATION_DEFINITION:{let i=n.getRootType(t.operation);this._typeStack.push((0,kn.isObjectType)(i)?i:void 0);break}case Bn.Kind.INLINE_FRAGMENT:case Bn.Kind.FRAGMENT_DEFINITION:{let i=t.typeCondition,a=i?(0,ww.typeFromAST)(n,i):(0,kn.getNamedType)(this.getType());this._typeStack.push((0,kn.isOutputType)(a)?a:void 0);break}case Bn.Kind.VARIABLE_DEFINITION:{let i=(0,ww.typeFromAST)(n,t.type);this._inputTypeStack.push((0,kn.isInputType)(i)?i:void 0);break}case Bn.Kind.ARGUMENT:{var r;let i,a,o=(r=this.getDirective())!==null&&r!==void 0?r:this.getFieldDef();o&&(i=o.args.find(u=>u.name===t.name.value),i&&(a=i.type)),this._argument=i,this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push((0,kn.isInputType)(a)?a:void 0);break}case Bn.Kind.LIST:{let i=(0,kn.getNullableType)(this.getInputType()),a=(0,kn.isListType)(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,kn.isInputType)(a)?a:void 0);break}case Bn.Kind.OBJECT_FIELD:{let i=(0,kn.getNamedType)(this.getInputType()),a,o;(0,kn.isInputObjectType)(i)&&(o=i.getFields()[t.name.value],o&&(a=o.type)),this._defaultValueStack.push(o?o.defaultValue:void 0),this._inputTypeStack.push((0,kn.isInputType)(a)?a:void 0);break}case Bn.Kind.ENUM:{let i=(0,kn.getNamedType)(this.getInputType()),a;(0,kn.isEnumType)(i)&&(a=i.getValue(t.value)),this._enumValue=a;break}default:}}leave(t){switch(t.kind){case Bn.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case Bn.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case Bn.Kind.DIRECTIVE:this._directive=null;break;case Bn.Kind.OPERATION_DEFINITION:case Bn.Kind.INLINE_FRAGMENT:case Bn.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case Bn.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case Bn.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Bn.Kind.LIST:case Bn.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Bn.Kind.ENUM:this._enumValue=null;break;default:}}};Df.TypeInfo=pg;function ZW(e,t,n){let r=n.name.value;if(r===Pl.SchemaMetaFieldDef.name&&e.getQueryType()===t)return Pl.SchemaMetaFieldDef;if(r===Pl.TypeMetaFieldDef.name&&e.getQueryType()===t)return Pl.TypeMetaFieldDef;if(r===Pl.TypeNameMetaFieldDef.name&&(0,kn.isCompositeType)(t))return Pl.TypeNameMetaFieldDef;if((0,kn.isObjectType)(t)||(0,kn.isInterfaceType)(t))return t.getFields()[r]}function e6(e,t){return{enter(...n){let r=n[0];e.enter(r);let i=(0,Fw.getEnterLeaveForKind)(t,r.kind).enter;if(i){let a=i.apply(t,n);return a!==void 0&&(e.leave(r),(0,XW.isNode)(a)&&e.enter(a)),a}},leave(...n){let r=n[0],i=(0,Fw.getEnterLeaveForKind)(t,r.kind).leave,a;return i&&(a=i.apply(t,n)),e.leave(r),a}}}});var Ic=F(qi=>{"use strict";m();T();N();Object.defineProperty(qi,"__esModule",{value:!0});qi.isConstValueNode=mg;qi.isDefinitionNode=t6;qi.isExecutableDefinitionNode=Lw;qi.isSelectionNode=n6;qi.isTypeDefinitionNode=Bw;qi.isTypeExtensionNode=Mw;qi.isTypeNode=r6;qi.isTypeSystemDefinitionNode=Uw;qi.isTypeSystemExtensionNode=kw;qi.isValueNode=Cw;var kt=Ut();function t6(e){return Lw(e)||Uw(e)||kw(e)}function Lw(e){return e.kind===kt.Kind.OPERATION_DEFINITION||e.kind===kt.Kind.FRAGMENT_DEFINITION}function n6(e){return e.kind===kt.Kind.FIELD||e.kind===kt.Kind.FRAGMENT_SPREAD||e.kind===kt.Kind.INLINE_FRAGMENT}function Cw(e){return e.kind===kt.Kind.VARIABLE||e.kind===kt.Kind.INT||e.kind===kt.Kind.FLOAT||e.kind===kt.Kind.STRING||e.kind===kt.Kind.BOOLEAN||e.kind===kt.Kind.NULL||e.kind===kt.Kind.ENUM||e.kind===kt.Kind.LIST||e.kind===kt.Kind.OBJECT}function mg(e){return Cw(e)&&(e.kind===kt.Kind.LIST?e.values.some(mg):e.kind===kt.Kind.OBJECT?e.fields.some(t=>mg(t.value)):e.kind!==kt.Kind.VARIABLE)}function r6(e){return e.kind===kt.Kind.NAMED_TYPE||e.kind===kt.Kind.LIST_TYPE||e.kind===kt.Kind.NON_NULL_TYPE}function Uw(e){return e.kind===kt.Kind.SCHEMA_DEFINITION||Bw(e)||e.kind===kt.Kind.DIRECTIVE_DEFINITION}function Bw(e){return e.kind===kt.Kind.SCALAR_TYPE_DEFINITION||e.kind===kt.Kind.OBJECT_TYPE_DEFINITION||e.kind===kt.Kind.INTERFACE_TYPE_DEFINITION||e.kind===kt.Kind.UNION_TYPE_DEFINITION||e.kind===kt.Kind.ENUM_TYPE_DEFINITION||e.kind===kt.Kind.INPUT_OBJECT_TYPE_DEFINITION}function kw(e){return e.kind===kt.Kind.SCHEMA_EXTENSION||Mw(e)}function Mw(e){return e.kind===kt.Kind.SCALAR_TYPE_EXTENSION||e.kind===kt.Kind.OBJECT_TYPE_EXTENSION||e.kind===kt.Kind.INTERFACE_TYPE_EXTENSION||e.kind===kt.Kind.UNION_TYPE_EXTENSION||e.kind===kt.Kind.ENUM_TYPE_EXTENSION||e.kind===kt.Kind.INPUT_OBJECT_TYPE_EXTENSION}});var Tg=F(Ng=>{"use strict";m();T();N();Object.defineProperty(Ng,"__esModule",{value:!0});Ng.ExecutableDefinitionsRule=s6;var i6=Ze(),xw=Ut(),a6=Ic();function s6(e){return{Document(t){for(let n of t.definitions)if(!(0,a6.isExecutableDefinitionNode)(n)){let r=n.kind===xw.Kind.SCHEMA_DEFINITION||n.kind===xw.Kind.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new i6.GraphQLError(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}});var hg=F(Eg=>{"use strict";m();T();N();Object.defineProperty(Eg,"__esModule",{value:!0});Eg.FieldsOnCorrectTypeRule=l6;var qw=hu(),o6=cf(),u6=Iu(),c6=Ze(),bf=Bt();function l6(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let i=e.getSchema(),a=t.name.value,o=(0,qw.didYouMean)("to use an inline fragment on",d6(i,n,a));o===""&&(o=(0,qw.didYouMean)(f6(n,a))),e.reportError(new c6.GraphQLError(`Cannot query field "${a}" on type "${n.name}".`+o,{nodes:t}))}}}}function d6(e,t,n){if(!(0,bf.isAbstractType)(t))return[];let r=new Set,i=Object.create(null);for(let o of e.getPossibleTypes(t))if(o.getFields()[n]){r.add(o),i[o.name]=1;for(let u of o.getInterfaces()){var a;u.getFields()[n]&&(r.add(u),i[u.name]=((a=i[u.name])!==null&&a!==void 0?a:0)+1)}}return[...r].sort((o,u)=>{let l=i[u.name]-i[o.name];return l!==0?l:(0,bf.isInterfaceType)(o)&&e.isSubType(o,u)?-1:(0,bf.isInterfaceType)(u)&&e.isSubType(u,o)?1:(0,o6.naturalCompare)(o.name,u.name)}).map(o=>o.name)}function f6(e,t){if((0,bf.isObjectType)(e)||(0,bf.isInterfaceType)(e)){let n=Object.keys(e.getFields());return(0,u6.suggestionList)(t,n)}return[]}});var Ig=F(yg=>{"use strict";m();T();N();Object.defineProperty(yg,"__esModule",{value:!0});yg.FragmentsOnCompositeTypesRule=p6;var Vw=Ze(),jw=yi(),Kw=Bt(),$w=Qa();function p6(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let r=(0,$w.typeFromAST)(e.getSchema(),n);if(r&&!(0,Kw.isCompositeType)(r)){let i=(0,jw.print)(n);e.reportError(new Vw.GraphQLError(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(t){let n=(0,$w.typeFromAST)(e.getSchema(),t.typeCondition);if(n&&!(0,Kw.isCompositeType)(n)){let r=(0,jw.print)(t.typeCondition);e.reportError(new Vw.GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${r}".`,{nodes:t.typeCondition}))}}}}});var gg=F(VN=>{"use strict";m();T();N();Object.defineProperty(VN,"__esModule",{value:!0});VN.KnownArgumentNamesOnDirectivesRule=Jw;VN.KnownArgumentNamesRule=T6;var Gw=hu(),Qw=Iu(),Yw=Ze(),m6=Ut(),N6=ni();function T6(e){return $(M({},Jw(e)),{Argument(t){let n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){let a=t.name.value,o=r.args.map(l=>l.name),u=(0,Qw.suggestionList)(a,o);e.reportError(new Yw.GraphQLError(`Unknown argument "${a}" on field "${i.name}.${r.name}".`+(0,Gw.didYouMean)(u),{nodes:t}))}}})}function Jw(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():N6.specifiedDirectives;for(let o of r)t[o.name]=o.args.map(u=>u.name);let i=e.getDocument().definitions;for(let o of i)if(o.kind===m6.Kind.DIRECTIVE_DEFINITION){var a;let u=(a=o.arguments)!==null&&a!==void 0?a:[];t[o.name.value]=u.map(l=>l.name.value)}return{Directive(o){let u=o.name.value,l=t[u];if(o.arguments&&l)for(let d of o.arguments){let p=d.name.value;if(!l.includes(p)){let E=(0,Qw.suggestionList)(p,l);e.reportError(new Yw.GraphQLError(`Unknown argument "${p}" on directive "@${u}".`+(0,Gw.didYouMean)(E),{nodes:d}))}}return!1}}}});var Og=F(Sg=>{"use strict";m();T();N();Object.defineProperty(Sg,"__esModule",{value:!0});Sg.KnownDirectivesRule=y6;var E6=nn(),_g=Fr(),zw=Ze(),vg=ja(),cr=vl(),_n=Ut(),h6=ni();function y6(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():h6.specifiedDirectives;for(let a of r)t[a.name]=a.locations;let i=e.getDocument().definitions;for(let a of i)a.kind===_n.Kind.DIRECTIVE_DEFINITION&&(t[a.name.value]=a.locations.map(o=>o.value));return{Directive(a,o,u,l,d){let p=a.name.value,E=t[p];if(!E){e.reportError(new zw.GraphQLError(`Unknown directive "@${p}".`,{nodes:a}));return}let h=I6(d);h&&!E.includes(h)&&e.reportError(new zw.GraphQLError(`Directive "@${p}" may not be used on ${h}.`,{nodes:a}))}}}function I6(e){let t=e[e.length-1];switch("kind"in t||(0,_g.invariant)(!1),t.kind){case _n.Kind.OPERATION_DEFINITION:return g6(t.operation);case _n.Kind.FIELD:return cr.DirectiveLocation.FIELD;case _n.Kind.FRAGMENT_SPREAD:return cr.DirectiveLocation.FRAGMENT_SPREAD;case _n.Kind.INLINE_FRAGMENT:return cr.DirectiveLocation.INLINE_FRAGMENT;case _n.Kind.FRAGMENT_DEFINITION:return cr.DirectiveLocation.FRAGMENT_DEFINITION;case _n.Kind.VARIABLE_DEFINITION:return cr.DirectiveLocation.VARIABLE_DEFINITION;case _n.Kind.SCHEMA_DEFINITION:case _n.Kind.SCHEMA_EXTENSION:return cr.DirectiveLocation.SCHEMA;case _n.Kind.SCALAR_TYPE_DEFINITION:case _n.Kind.SCALAR_TYPE_EXTENSION:return cr.DirectiveLocation.SCALAR;case _n.Kind.OBJECT_TYPE_DEFINITION:case _n.Kind.OBJECT_TYPE_EXTENSION:return cr.DirectiveLocation.OBJECT;case _n.Kind.FIELD_DEFINITION:return cr.DirectiveLocation.FIELD_DEFINITION;case _n.Kind.INTERFACE_TYPE_DEFINITION:case _n.Kind.INTERFACE_TYPE_EXTENSION:return cr.DirectiveLocation.INTERFACE;case _n.Kind.UNION_TYPE_DEFINITION:case _n.Kind.UNION_TYPE_EXTENSION:return cr.DirectiveLocation.UNION;case _n.Kind.ENUM_TYPE_DEFINITION:case _n.Kind.ENUM_TYPE_EXTENSION:return cr.DirectiveLocation.ENUM;case _n.Kind.ENUM_VALUE_DEFINITION:return cr.DirectiveLocation.ENUM_VALUE;case _n.Kind.INPUT_OBJECT_TYPE_DEFINITION:case _n.Kind.INPUT_OBJECT_TYPE_EXTENSION:return cr.DirectiveLocation.INPUT_OBJECT;case _n.Kind.INPUT_VALUE_DEFINITION:{let n=e[e.length-3];return"kind"in n||(0,_g.invariant)(!1),n.kind===_n.Kind.INPUT_OBJECT_TYPE_DEFINITION?cr.DirectiveLocation.INPUT_FIELD_DEFINITION:cr.DirectiveLocation.ARGUMENT_DEFINITION}default:(0,_g.invariant)(!1,"Unexpected kind: "+(0,E6.inspect)(t.kind))}}function g6(e){switch(e){case vg.OperationTypeNode.QUERY:return cr.DirectiveLocation.QUERY;case vg.OperationTypeNode.MUTATION:return cr.DirectiveLocation.MUTATION;case vg.OperationTypeNode.SUBSCRIPTION:return cr.DirectiveLocation.SUBSCRIPTION}}});var bg=F(Dg=>{"use strict";m();T();N();Object.defineProperty(Dg,"__esModule",{value:!0});Dg.KnownFragmentNamesRule=v6;var _6=Ze();function v6(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new _6.GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}}});var Pg=F(Rg=>{"use strict";m();T();N();Object.defineProperty(Rg,"__esModule",{value:!0});Rg.KnownTypeNamesRule=R6;var S6=hu(),O6=Iu(),D6=Ze(),Ag=Ic(),b6=xi(),A6=Ga();function R6(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(let a of e.getDocument().definitions)(0,Ag.isTypeDefinitionNode)(a)&&(r[a.name.value]=!0);let i=[...Object.keys(n),...Object.keys(r)];return{NamedType(a,o,u,l,d){let p=a.name.value;if(!n[p]&&!r[p]){var E;let h=(E=d[2])!==null&&E!==void 0?E:u,v=h!=null&&P6(h);if(v&&Hw.includes(p))return;let A=(0,O6.suggestionList)(p,v?Hw.concat(i):i);e.reportError(new D6.GraphQLError(`Unknown type "${p}".`+(0,S6.didYouMean)(A),{nodes:a}))}}}}var Hw=[...A6.specifiedScalarTypes,...b6.introspectionTypes].map(e=>e.name);function P6(e){return"kind"in e&&((0,Ag.isTypeSystemDefinitionNode)(e)||(0,Ag.isTypeSystemExtensionNode)(e))}});var wg=F(Fg=>{"use strict";m();T();N();Object.defineProperty(Fg,"__esModule",{value:!0});Fg.LoneAnonymousOperationRule=L6;var F6=Ze(),w6=Ut();function L6(e){let t=0;return{Document(n){t=n.definitions.filter(r=>r.kind===w6.Kind.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new F6.GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}}});var Cg=F(Lg=>{"use strict";m();T();N();Object.defineProperty(Lg,"__esModule",{value:!0});Lg.LoneSchemaDefinitionRule=C6;var Ww=Ze();function C6(e){var t,n,r;let i=e.getSchema(),a=(t=(n=(r=i==null?void 0:i.astNode)!==null&&r!==void 0?r:i==null?void 0:i.getQueryType())!==null&&n!==void 0?n:i==null?void 0:i.getMutationType())!==null&&t!==void 0?t:i==null?void 0:i.getSubscriptionType(),o=0;return{SchemaDefinition(u){if(a){e.reportError(new Ww.GraphQLError("Cannot define a new schema within a schema extension.",{nodes:u}));return}o>0&&e.reportError(new Ww.GraphQLError("Must provide only one schema definition.",{nodes:u})),++o}}}});var Bg=F(Ug=>{"use strict";m();T();N();Object.defineProperty(Ug,"__esModule",{value:!0});Ug.MaxIntrospectionDepthRule=k6;var U6=Ze(),Xw=Ut(),B6=3;function k6(e){function t(n,r=Object.create(null),i=0){if(n.kind===Xw.Kind.FRAGMENT_SPREAD){let a=n.name.value;if(r[a]===!0)return!1;let o=e.getFragment(a);if(!o)return!1;try{return r[a]=!0,t(o,r,i)}finally{r[a]=void 0}}if(n.kind===Xw.Kind.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(i++,i>=B6))return!0;if("selectionSet"in n&&n.selectionSet){for(let a of n.selectionSet.selections)if(t(a,r,i))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new U6.GraphQLError("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}});var Mg=F(kg=>{"use strict";m();T();N();Object.defineProperty(kg,"__esModule",{value:!0});kg.NoFragmentCyclesRule=x6;var M6=Ze();function x6(e){let t=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(a){return i(a),!1}};function i(a){if(t[a.name.value])return;let o=a.name.value;t[o]=!0;let u=e.getFragmentSpreads(a.selectionSet);if(u.length!==0){r[o]=n.length;for(let l of u){let d=l.name.value,p=r[d];if(n.push(l),p===void 0){let E=e.getFragment(d);E&&i(E)}else{let E=n.slice(p),h=E.slice(0,-1).map(v=>'"'+v.name.value+'"').join(", ");e.reportError(new M6.GraphQLError(`Cannot spread fragment "${d}" within itself`+(h!==""?` via ${h}.`:"."),{nodes:E}))}n.pop()}r[o]=void 0}}}});var qg=F(xg=>{"use strict";m();T();N();Object.defineProperty(xg,"__esModule",{value:!0});xg.NoUndefinedVariablesRule=V6;var q6=Ze();function V6(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i}of r){let a=i.name.value;t[a]!==!0&&e.reportError(new q6.GraphQLError(n.name?`Variable "$${a}" is not defined by operation "${n.name.value}".`:`Variable "$${a}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(n){t[n.variable.name.value]=!0}}}});var jg=F(Vg=>{"use strict";m();T();N();Object.defineProperty(Vg,"__esModule",{value:!0});Vg.NoUnusedFragmentsRule=K6;var j6=Ze();function K6(e){let t=[],n=[];return{OperationDefinition(r){return t.push(r),!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){let r=Object.create(null);for(let i of t)for(let a of e.getRecursivelyReferencedFragments(i))r[a.name.value]=!0;for(let i of n){let a=i.name.value;r[a]!==!0&&e.reportError(new j6.GraphQLError(`Fragment "${a}" is never used.`,{nodes:i}))}}}}}});var $g=F(Kg=>{"use strict";m();T();N();Object.defineProperty(Kg,"__esModule",{value:!0});Kg.NoUnusedVariablesRule=G6;var $6=Ze();function G6(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){let r=Object.create(null),i=e.getRecursiveVariableUsages(n);for(let{node:a}of i)r[a.name.value]=!0;for(let a of t){let o=a.variable.name.value;r[o]!==!0&&e.reportError(new $6.GraphQLError(n.name?`Variable "$${o}" is never used in operation "${n.name.value}".`:`Variable "$${o}" is never used.`,{nodes:a}))}}},VariableDefinition(n){t.push(n)}}}});var Yg=F(Qg=>{"use strict";m();T();N();Object.defineProperty(Qg,"__esModule",{value:!0});Qg.sortValueNode=Gg;var Q6=cf(),Rs=Ut();function Gg(e){switch(e.kind){case Rs.Kind.OBJECT:return $(M({},e),{fields:Y6(e.fields)});case Rs.Kind.LIST:return $(M({},e),{values:e.values.map(Gg)});case Rs.Kind.INT:case Rs.Kind.FLOAT:case Rs.Kind.STRING:case Rs.Kind.BOOLEAN:case Rs.Kind.NULL:case Rs.Kind.ENUM:case Rs.Kind.VARIABLE:return e}}function Y6(e){return e.map(t=>$(M({},t),{value:Gg(t.value)})).sort((t,n)=>(0,Q6.naturalCompare)(t.name.value,n.name.value))}});var e_=F(Zg=>{"use strict";m();T();N();Object.defineProperty(Zg,"__esModule",{value:!0});Zg.OverlappingFieldsCanBeMergedRule=W6;var Zw=nn(),J6=Ze(),Jg=Ut(),z6=yi(),ri=Bt(),H6=Yg(),tL=Qa();function nL(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+nL(n)).join(" and "):e}function W6(e){let t=new Wg,n=new Map;return{SelectionSet(r){let i=X6(e,n,t,e.getParentType(),r);for(let[[a,o],u,l]of i){let d=nL(o);e.reportError(new J6.GraphQLError(`Fields "${a}" conflict because ${d}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:u.concat(l)}))}}}}function X6(e,t,n,r,i){let a=[],[o,u]=$N(e,t,r,i);if(e4(e,a,t,n,o),u.length!==0)for(let l=0;l1)for(let u=0;u[a.value,o]));return n.every(a=>{let o=a.value,u=i.get(a.name.value);return u===void 0?!1:eL(o)===eL(u)})}function eL(e){return(0,z6.print)((0,H6.sortValueNode)(e))}function zg(e,t){return(0,ri.isListType)(e)?(0,ri.isListType)(t)?zg(e.ofType,t.ofType):!0:(0,ri.isListType)(t)?!0:(0,ri.isNonNullType)(e)?(0,ri.isNonNullType)(t)?zg(e.ofType,t.ofType):!0:(0,ri.isNonNullType)(t)?!0:(0,ri.isLeafType)(e)||(0,ri.isLeafType)(t)?e!==t:!1}function $N(e,t,n,r){let i=t.get(r);if(i)return i;let a=Object.create(null),o=Object.create(null);iL(e,n,r,a,o);let u=[a,Object.keys(o)];return t.set(r,u),u}function Hg(e,t,n){let r=t.get(n.selectionSet);if(r)return r;let i=(0,tL.typeFromAST)(e.getSchema(),n.typeCondition);return $N(e,t,i,n.selectionSet)}function iL(e,t,n,r,i){for(let a of n.selections)switch(a.kind){case Jg.Kind.FIELD:{let o=a.name.value,u;((0,ri.isObjectType)(t)||(0,ri.isInterfaceType)(t))&&(u=t.getFields()[o]);let l=a.alias?a.alias.value:o;r[l]||(r[l]=[]),r[l].push([t,a,u]);break}case Jg.Kind.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case Jg.Kind.INLINE_FRAGMENT:{let o=a.typeCondition,u=o?(0,tL.typeFromAST)(e.getSchema(),o):t;iL(e,u,a.selectionSet,r,i);break}}}function n4(e,t,n,r){if(e.length>0)return[[t,e.map(([i])=>i)],[n,...e.map(([,i])=>i).flat()],[r,...e.map(([,,i])=>i).flat()]]}var Wg=class{constructor(){this._data=new Map}has(t,n,r){var i;let[a,o]=t{"use strict";m();T();N();Object.defineProperty(n_,"__esModule",{value:!0});n_.PossibleFragmentSpreadsRule=i4;var GN=nn(),aL=Ze(),t_=Bt(),sL=Nf(),r4=Qa();function i4(e){return{InlineFragment(t){let n=e.getType(),r=e.getParentType();if((0,t_.isCompositeType)(n)&&(0,t_.isCompositeType)(r)&&!(0,sL.doTypesOverlap)(e.getSchema(),n,r)){let i=(0,GN.inspect)(r),a=(0,GN.inspect)(n);e.reportError(new aL.GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${a}".`,{nodes:t}))}},FragmentSpread(t){let n=t.name.value,r=a4(e,n),i=e.getParentType();if(r&&i&&!(0,sL.doTypesOverlap)(e.getSchema(),r,i)){let a=(0,GN.inspect)(i),o=(0,GN.inspect)(r);e.reportError(new aL.GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${a}" can never be of type "${o}".`,{nodes:t}))}}}}function a4(e,t){let n=e.getFragment(t);if(n){let r=(0,r4.typeFromAST)(e.getSchema(),n.typeCondition);if((0,t_.isCompositeType)(r))return r}}});var a_=F(i_=>{"use strict";m();T();N();Object.defineProperty(i_,"__esModule",{value:!0});i_.PossibleTypeExtensionsRule=c4;var s4=hu(),uL=nn(),cL=Fr(),o4=Iu(),oL=Ze(),On=Ut(),u4=Ic(),Fl=Bt();function c4(e){let t=e.getSchema(),n=Object.create(null);for(let i of e.getDocument().definitions)(0,u4.isTypeDefinitionNode)(i)&&(n[i.name.value]=i);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(i){let a=i.name.value,o=n[a],u=t==null?void 0:t.getType(a),l;if(o?l=l4[o.kind]:u&&(l=d4(u)),l){if(l!==i.kind){let d=f4(i.kind);e.reportError(new oL.GraphQLError(`Cannot extend non-${d} type "${a}".`,{nodes:o?[o,i]:i}))}}else{let d=Object.keys(M(M({},n),t==null?void 0:t.getTypeMap())),p=(0,o4.suggestionList)(a,d);e.reportError(new oL.GraphQLError(`Cannot extend type "${a}" because it is not defined.`+(0,s4.didYouMean)(p),{nodes:i.name}))}}}var l4={[On.Kind.SCALAR_TYPE_DEFINITION]:On.Kind.SCALAR_TYPE_EXTENSION,[On.Kind.OBJECT_TYPE_DEFINITION]:On.Kind.OBJECT_TYPE_EXTENSION,[On.Kind.INTERFACE_TYPE_DEFINITION]:On.Kind.INTERFACE_TYPE_EXTENSION,[On.Kind.UNION_TYPE_DEFINITION]:On.Kind.UNION_TYPE_EXTENSION,[On.Kind.ENUM_TYPE_DEFINITION]:On.Kind.ENUM_TYPE_EXTENSION,[On.Kind.INPUT_OBJECT_TYPE_DEFINITION]:On.Kind.INPUT_OBJECT_TYPE_EXTENSION};function d4(e){if((0,Fl.isScalarType)(e))return On.Kind.SCALAR_TYPE_EXTENSION;if((0,Fl.isObjectType)(e))return On.Kind.OBJECT_TYPE_EXTENSION;if((0,Fl.isInterfaceType)(e))return On.Kind.INTERFACE_TYPE_EXTENSION;if((0,Fl.isUnionType)(e))return On.Kind.UNION_TYPE_EXTENSION;if((0,Fl.isEnumType)(e))return On.Kind.ENUM_TYPE_EXTENSION;if((0,Fl.isInputObjectType)(e))return On.Kind.INPUT_OBJECT_TYPE_EXTENSION;(0,cL.invariant)(!1,"Unexpected type: "+(0,uL.inspect)(e))}function f4(e){switch(e){case On.Kind.SCALAR_TYPE_EXTENSION:return"scalar";case On.Kind.OBJECT_TYPE_EXTENSION:return"object";case On.Kind.INTERFACE_TYPE_EXTENSION:return"interface";case On.Kind.UNION_TYPE_EXTENSION:return"union";case On.Kind.ENUM_TYPE_EXTENSION:return"enum";case On.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:(0,cL.invariant)(!1,"Unexpected kind: "+(0,uL.inspect)(e))}}});var o_=F(QN=>{"use strict";m();T();N();Object.defineProperty(QN,"__esModule",{value:!0});QN.ProvidedRequiredArgumentsOnDirectivesRule=mL;QN.ProvidedRequiredArgumentsRule=N4;var dL=nn(),lL=yu(),fL=Ze(),pL=Ut(),p4=yi(),s_=Bt(),m4=ni();function N4(e){return $(M({},mL(e)),{Field:{leave(t){var n;let r=e.getFieldDef();if(!r)return!1;let i=new Set((n=t.arguments)===null||n===void 0?void 0:n.map(a=>a.name.value));for(let a of r.args)if(!i.has(a.name)&&(0,s_.isRequiredArgument)(a)){let o=(0,dL.inspect)(a.type);e.reportError(new fL.GraphQLError(`Field "${r.name}" argument "${a.name}" of type "${o}" is required, but it was not provided.`,{nodes:t}))}}}})}function mL(e){var t;let n=Object.create(null),r=e.getSchema(),i=(t=r==null?void 0:r.getDirectives())!==null&&t!==void 0?t:m4.specifiedDirectives;for(let u of i)n[u.name]=(0,lL.keyMap)(u.args.filter(s_.isRequiredArgument),l=>l.name);let a=e.getDocument().definitions;for(let u of a)if(u.kind===pL.Kind.DIRECTIVE_DEFINITION){var o;let l=(o=u.arguments)!==null&&o!==void 0?o:[];n[u.name.value]=(0,lL.keyMap)(l.filter(T4),d=>d.name.value)}return{Directive:{leave(u){let l=u.name.value,d=n[l];if(d){var p;let E=(p=u.arguments)!==null&&p!==void 0?p:[],h=new Set(E.map(v=>v.name.value));for(let[v,A]of Object.entries(d))if(!h.has(v)){let B=(0,s_.isType)(A.type)?(0,dL.inspect)(A.type):(0,p4.print)(A.type);e.reportError(new fL.GraphQLError(`Directive "@${l}" argument "${v}" of type "${B}" is required, but it was not provided.`,{nodes:u}))}}}}}}function T4(e){return e.type.kind===pL.Kind.NON_NULL_TYPE&&e.defaultValue==null}});var c_=F(u_=>{"use strict";m();T();N();Object.defineProperty(u_,"__esModule",{value:!0});u_.ScalarLeafsRule=E4;var NL=nn(),TL=Ze(),EL=Bt();function E4(e){return{Field(t){let n=e.getType(),r=t.selectionSet;if(n){if((0,EL.isLeafType)((0,EL.getNamedType)(n))){if(r){let i=t.name.value,a=(0,NL.inspect)(n);e.reportError(new TL.GraphQLError(`Field "${i}" must not have a selection since type "${a}" has no subfields.`,{nodes:r}))}}else if(!r){let i=t.name.value,a=(0,NL.inspect)(n);e.reportError(new TL.GraphQLError(`Field "${i}" of type "${a}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}}}}}});var d_=F(l_=>{"use strict";m();T();N();Object.defineProperty(l_,"__esModule",{value:!0});l_.printPathArray=h4;function h4(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}});var Af=F(YN=>{"use strict";m();T();N();Object.defineProperty(YN,"__esModule",{value:!0});YN.addPath=y4;YN.pathToArray=I4;function y4(e,t,n){return{prev:e,key:t,typename:n}}function I4(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}});var p_=F(f_=>{"use strict";m();T();N();Object.defineProperty(f_,"__esModule",{value:!0});f_.coerceInputValue=b4;var g4=hu(),JN=nn(),_4=Fr(),v4=BN(),S4=Va(),Na=Af(),O4=d_(),D4=Iu(),Ps=Ze(),Rf=Bt();function b4(e,t,n=A4){return Pf(e,t,n,void 0)}function A4(e,t,n){let r="Invalid value "+(0,JN.inspect)(t);throw e.length>0&&(r+=` at "value${(0,O4.printPathArray)(e)}"`),n.message=r+": "+n.message,n}function Pf(e,t,n,r){if((0,Rf.isNonNullType)(t)){if(e!=null)return Pf(e,t.ofType,n,r);n((0,Na.pathToArray)(r),e,new Ps.GraphQLError(`Expected non-nullable type "${(0,JN.inspect)(t)}" not to be null.`));return}if(e==null)return null;if((0,Rf.isListType)(t)){let i=t.ofType;return(0,v4.isIterableObject)(e)?Array.from(e,(a,o)=>{let u=(0,Na.addPath)(r,o,void 0);return Pf(a,i,n,u)}):[Pf(e,i,n,r)]}if((0,Rf.isInputObjectType)(t)){if(!(0,S4.isObjectLike)(e)){n((0,Na.pathToArray)(r),e,new Ps.GraphQLError(`Expected type "${t.name}" to be an object.`));return}let i={},a=t.getFields();for(let o of Object.values(a)){let u=e[o.name];if(u===void 0){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if((0,Rf.isNonNullType)(o.type)){let l=(0,JN.inspect)(o.type);n((0,Na.pathToArray)(r),e,new Ps.GraphQLError(`Field "${o.name}" of required type "${l}" was not provided.`))}continue}i[o.name]=Pf(u,o.type,n,(0,Na.addPath)(r,o.name,t.name))}for(let o of Object.keys(e))if(!a[o]){let u=(0,D4.suggestionList)(o,Object.keys(t.getFields()));n((0,Na.pathToArray)(r),e,new Ps.GraphQLError(`Field "${o}" is not defined by type "${t.name}".`+(0,g4.didYouMean)(u)))}if(t.isOneOf){let o=Object.keys(i);o.length!==1&&n((0,Na.pathToArray)(r),e,new Ps.GraphQLError(`Exactly one key must be specified for OneOf type "${t.name}".`));let u=o[0],l=i[u];l===null&&n((0,Na.pathToArray)(r).concat(u),l,new Ps.GraphQLError(`Field "${u}" must be non-null.`))}return i}if((0,Rf.isLeafType)(t)){let i;try{i=t.parseValue(e)}catch(a){a instanceof Ps.GraphQLError?n((0,Na.pathToArray)(r),e,a):n((0,Na.pathToArray)(r),e,new Ps.GraphQLError(`Expected type "${t.name}". `+a.message,{originalError:a}));return}return i===void 0&&n((0,Na.pathToArray)(r),e,new Ps.GraphQLError(`Expected type "${t.name}".`)),i}(0,_4.invariant)(!1,"Unexpected input type: "+(0,JN.inspect)(t))}});var wf=F(m_=>{"use strict";m();T();N();Object.defineProperty(m_,"__esModule",{value:!0});m_.valueFromAST=Ff;var R4=nn(),P4=Fr(),F4=yu(),wl=Ut(),gc=Bt();function Ff(e,t,n){if(e){if(e.kind===wl.Kind.VARIABLE){let r=e.name.value;if(n==null||n[r]===void 0)return;let i=n[r];return i===null&&(0,gc.isNonNullType)(t)?void 0:i}if((0,gc.isNonNullType)(t))return e.kind===wl.Kind.NULL?void 0:Ff(e,t.ofType,n);if(e.kind===wl.Kind.NULL)return null;if((0,gc.isListType)(t)){let r=t.ofType;if(e.kind===wl.Kind.LIST){let a=[];for(let o of e.values)if(hL(o,n)){if((0,gc.isNonNullType)(r))return;a.push(null)}else{let u=Ff(o,r,n);if(u===void 0)return;a.push(u)}return a}let i=Ff(e,r,n);return i===void 0?void 0:[i]}if((0,gc.isInputObjectType)(t)){if(e.kind!==wl.Kind.OBJECT)return;let r=Object.create(null),i=(0,F4.keyMap)(e.fields,a=>a.name.value);for(let a of Object.values(t.getFields())){let o=i[a.name];if(!o||hL(o.value,n)){if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if((0,gc.isNonNullType)(a.type))return;continue}let u=Ff(o.value,a.type,n);if(u===void 0)return;r[a.name]=u}if(t.isOneOf){let a=Object.keys(r);if(a.length!==1||r[a[0]]===null)return}return r}if((0,gc.isLeafType)(t)){let r;try{r=t.parseLiteral(e,n)}catch(i){return}return r===void 0?void 0:r}(0,P4.invariant)(!1,"Unexpected input type: "+(0,R4.inspect)(t))}}function hL(e,t){return e.kind===wl.Kind.VARIABLE&&(t==null||t[e.name.value]===void 0)}});var Ul=F(Lf=>{"use strict";m();T();N();Object.defineProperty(Lf,"__esModule",{value:!0});Lf.getArgumentValues=_L;Lf.getDirectiveValues=M4;Lf.getVariableValues=B4;var Ll=nn(),w4=yu(),L4=d_(),Fs=Ze(),yL=Ut(),IL=yi(),Cl=Bt(),C4=p_(),U4=Qa(),gL=wf();function B4(e,t,n,r){let i=[],a=r==null?void 0:r.maxErrors;try{let o=k4(e,t,n,u=>{if(a!=null&&i.length>=a)throw new Fs.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");i.push(u)});if(i.length===0)return{coerced:o}}catch(o){i.push(o)}return{errors:i}}function k4(e,t,n,r){let i={};for(let a of t){let o=a.variable.name.value,u=(0,U4.typeFromAST)(e,a.type);if(!(0,Cl.isInputType)(u)){let d=(0,IL.print)(a.type);r(new Fs.GraphQLError(`Variable "$${o}" expected value of type "${d}" which cannot be used as an input type.`,{nodes:a.type}));continue}if(!vL(n,o)){if(a.defaultValue)i[o]=(0,gL.valueFromAST)(a.defaultValue,u);else if((0,Cl.isNonNullType)(u)){let d=(0,Ll.inspect)(u);r(new Fs.GraphQLError(`Variable "$${o}" of required type "${d}" was not provided.`,{nodes:a}))}continue}let l=n[o];if(l===null&&(0,Cl.isNonNullType)(u)){let d=(0,Ll.inspect)(u);r(new Fs.GraphQLError(`Variable "$${o}" of non-null type "${d}" must not be null.`,{nodes:a}));continue}i[o]=(0,C4.coerceInputValue)(l,u,(d,p,E)=>{let h=`Variable "$${o}" got invalid value `+(0,Ll.inspect)(p);d.length>0&&(h+=` at "${o}${(0,L4.printPathArray)(d)}"`),r(new Fs.GraphQLError(h+"; "+E.message,{nodes:a,originalError:E}))})}return i}function _L(e,t,n){var r;let i={},a=(r=t.arguments)!==null&&r!==void 0?r:[],o=(0,w4.keyMap)(a,u=>u.name.value);for(let u of e.args){let l=u.name,d=u.type,p=o[l];if(!p){if(u.defaultValue!==void 0)i[l]=u.defaultValue;else if((0,Cl.isNonNullType)(d))throw new Fs.GraphQLError(`Argument "${l}" of required type "${(0,Ll.inspect)(d)}" was not provided.`,{nodes:t});continue}let E=p.value,h=E.kind===yL.Kind.NULL;if(E.kind===yL.Kind.VARIABLE){let A=E.name.value;if(n==null||!vL(n,A)){if(u.defaultValue!==void 0)i[l]=u.defaultValue;else if((0,Cl.isNonNullType)(d))throw new Fs.GraphQLError(`Argument "${l}" of required type "${(0,Ll.inspect)(d)}" was provided the variable "$${A}" which was not provided a runtime value.`,{nodes:E});continue}h=n[A]==null}if(h&&(0,Cl.isNonNullType)(d))throw new Fs.GraphQLError(`Argument "${l}" of non-null type "${(0,Ll.inspect)(d)}" must not be null.`,{nodes:E});let v=(0,gL.valueFromAST)(E,d,n);if(v===void 0)throw new Fs.GraphQLError(`Argument "${l}" has invalid value ${(0,IL.print)(E)}.`,{nodes:E});i[l]=v}return i}function M4(e,t,n){var r;let i=(r=t.directives)===null||r===void 0?void 0:r.find(a=>a.name.value===e.name);if(i)return _L(e,i,n)}function vL(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var WN=F(HN=>{"use strict";m();T();N();Object.defineProperty(HN,"__esModule",{value:!0});HN.collectFields=V4;HN.collectSubfields=j4;var N_=Ut(),x4=Bt(),SL=ni(),q4=Qa(),OL=Ul();function V4(e,t,n,r,i){let a=new Map;return zN(e,t,n,r,i,a,new Set),a}function j4(e,t,n,r,i){let a=new Map,o=new Set;for(let u of i)u.selectionSet&&zN(e,t,n,r,u.selectionSet,a,o);return a}function zN(e,t,n,r,i,a,o){for(let u of i.selections)switch(u.kind){case N_.Kind.FIELD:{if(!T_(n,u))continue;let l=K4(u),d=a.get(l);d!==void 0?d.push(u):a.set(l,[u]);break}case N_.Kind.INLINE_FRAGMENT:{if(!T_(n,u)||!DL(e,u,r))continue;zN(e,t,n,r,u.selectionSet,a,o);break}case N_.Kind.FRAGMENT_SPREAD:{let l=u.name.value;if(o.has(l)||!T_(n,u))continue;o.add(l);let d=t[l];if(!d||!DL(e,d,r))continue;zN(e,t,n,r,d.selectionSet,a,o);break}}}function T_(e,t){let n=(0,OL.getDirectiveValues)(SL.GraphQLSkipDirective,t,e);if((n==null?void 0:n.if)===!0)return!1;let r=(0,OL.getDirectiveValues)(SL.GraphQLIncludeDirective,t,e);return(r==null?void 0:r.if)!==!1}function DL(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=(0,q4.typeFromAST)(e,r);return i===n?!0:(0,x4.isAbstractType)(i)?e.isSubType(i,n):!1}function K4(e){return e.alias?e.alias.value:e.name.value}});var h_=F(E_=>{"use strict";m();T();N();Object.defineProperty(E_,"__esModule",{value:!0});E_.SingleFieldSubscriptionsRule=Q4;var bL=Ze(),$4=Ut(),G4=WN();function Q4(e){return{OperationDefinition(t){if(t.operation==="subscription"){let n=e.getSchema(),r=n.getSubscriptionType();if(r){let i=t.name?t.name.value:null,a=Object.create(null),o=e.getDocument(),u=Object.create(null);for(let d of o.definitions)d.kind===$4.Kind.FRAGMENT_DEFINITION&&(u[d.name.value]=d);let l=(0,G4.collectFields)(n,u,a,r,t.selectionSet);if(l.size>1){let E=[...l.values()].slice(1).flat();e.reportError(new bL.GraphQLError(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:E}))}for(let d of l.values())d[0].name.value.startsWith("__")&&e.reportError(new bL.GraphQLError(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:d}))}}}}}});var XN=F(y_=>{"use strict";m();T();N();Object.defineProperty(y_,"__esModule",{value:!0});y_.groupBy=Y4;function Y4(e,t){let n=new Map;for(let r of e){let i=t(r),a=n.get(i);a===void 0?n.set(i,[r]):a.push(r)}return n}});var g_=F(I_=>{"use strict";m();T();N();Object.defineProperty(I_,"__esModule",{value:!0});I_.UniqueArgumentDefinitionNamesRule=H4;var J4=XN(),z4=Ze();function H4(e){return{DirectiveDefinition(r){var i;let a=(i=r.arguments)!==null&&i!==void 0?i:[];return n(`@${r.name.value}`,a)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(r){var i;let a=r.name.value,o=(i=r.fields)!==null&&i!==void 0?i:[];for(let l of o){var u;let d=l.name.value,p=(u=l.arguments)!==null&&u!==void 0?u:[];n(`${a}.${d}`,p)}return!1}function n(r,i){let a=(0,J4.groupBy)(i,o=>o.name.value);for(let[o,u]of a)u.length>1&&e.reportError(new z4.GraphQLError(`Argument "${r}(${o}:)" can only be defined once.`,{nodes:u.map(l=>l.name)}));return!1}}});var v_=F(__=>{"use strict";m();T();N();Object.defineProperty(__,"__esModule",{value:!0});__.UniqueArgumentNamesRule=Z4;var W4=XN(),X4=Ze();function Z4(e){return{Field:t,Directive:t};function t(n){var r;let i=(r=n.arguments)!==null&&r!==void 0?r:[],a=(0,W4.groupBy)(i,o=>o.name.value);for(let[o,u]of a)u.length>1&&e.reportError(new X4.GraphQLError(`There can be only one argument named "${o}".`,{nodes:u.map(l=>l.name)}))}}});var O_=F(S_=>{"use strict";m();T();N();Object.defineProperty(S_,"__esModule",{value:!0});S_.UniqueDirectiveNamesRule=e8;var AL=Ze();function e8(e){let t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;if(n!=null&&n.getDirective(i)){e.reportError(new AL.GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return t[i]?e.reportError(new AL.GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1}}}});var A_=F(b_=>{"use strict";m();T();N();Object.defineProperty(b_,"__esModule",{value:!0});b_.UniqueDirectivesPerLocationRule=r8;var t8=Ze(),D_=Ut(),RL=Ic(),n8=ni();function r8(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():n8.specifiedDirectives;for(let u of r)t[u.name]=!u.isRepeatable;let i=e.getDocument().definitions;for(let u of i)u.kind===D_.Kind.DIRECTIVE_DEFINITION&&(t[u.name.value]=!u.repeatable);let a=Object.create(null),o=Object.create(null);return{enter(u){if(!("directives"in u)||!u.directives)return;let l;if(u.kind===D_.Kind.SCHEMA_DEFINITION||u.kind===D_.Kind.SCHEMA_EXTENSION)l=a;else if((0,RL.isTypeDefinitionNode)(u)||(0,RL.isTypeExtensionNode)(u)){let d=u.name.value;l=o[d],l===void 0&&(o[d]=l=Object.create(null))}else l=Object.create(null);for(let d of u.directives){let p=d.name.value;t[p]&&(l[p]?e.reportError(new t8.GraphQLError(`The directive "@${p}" can only be used once at this location.`,{nodes:[l[p],d]})):l[p]=d)}}}}});var P_=F(R_=>{"use strict";m();T();N();Object.defineProperty(R_,"__esModule",{value:!0});R_.UniqueEnumValueNamesRule=a8;var PL=Ze(),i8=Bt();function a8(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(a){var o;let u=a.name.value;r[u]||(r[u]=Object.create(null));let l=(o=a.values)!==null&&o!==void 0?o:[],d=r[u];for(let p of l){let E=p.name.value,h=n[u];(0,i8.isEnumType)(h)&&h.getValue(E)?e.reportError(new PL.GraphQLError(`Enum value "${u}.${E}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:p.name})):d[E]?e.reportError(new PL.GraphQLError(`Enum value "${u}.${E}" can only be defined once.`,{nodes:[d[E],p.name]})):d[E]=p.name}return!1}}});var L_=F(w_=>{"use strict";m();T();N();Object.defineProperty(w_,"__esModule",{value:!0});w_.UniqueFieldDefinitionNamesRule=s8;var FL=Ze(),F_=Bt();function s8(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(a){var o;let u=a.name.value;r[u]||(r[u]=Object.create(null));let l=(o=a.fields)!==null&&o!==void 0?o:[],d=r[u];for(let p of l){let E=p.name.value;o8(n[u],E)?e.reportError(new FL.GraphQLError(`Field "${u}.${E}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:p.name})):d[E]?e.reportError(new FL.GraphQLError(`Field "${u}.${E}" can only be defined once.`,{nodes:[d[E],p.name]})):d[E]=p.name}return!1}}function o8(e,t){return(0,F_.isObjectType)(e)||(0,F_.isInterfaceType)(e)||(0,F_.isInputObjectType)(e)?e.getFields()[t]!=null:!1}});var U_=F(C_=>{"use strict";m();T();N();Object.defineProperty(C_,"__esModule",{value:!0});C_.UniqueFragmentNamesRule=c8;var u8=Ze();function c8(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){let r=n.name.value;return t[r]?e.reportError(new u8.GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,!1}}}});var k_=F(B_=>{"use strict";m();T();N();Object.defineProperty(B_,"__esModule",{value:!0});B_.UniqueInputFieldNamesRule=f8;var l8=Fr(),d8=Ze();function f8(e){let t=[],n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){let r=t.pop();r||(0,l8.invariant)(!1),n=r}},ObjectField(r){let i=r.name.value;n[i]?e.reportError(new d8.GraphQLError(`There can be only one input field named "${i}".`,{nodes:[n[i],r.name]})):n[i]=r.name}}}});var x_=F(M_=>{"use strict";m();T();N();Object.defineProperty(M_,"__esModule",{value:!0});M_.UniqueOperationNamesRule=m8;var p8=Ze();function m8(e){let t=Object.create(null);return{OperationDefinition(n){let r=n.name;return r&&(t[r.value]?e.reportError(new p8.GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}}});var V_=F(q_=>{"use strict";m();T();N();Object.defineProperty(q_,"__esModule",{value:!0});q_.UniqueOperationTypesRule=N8;var wL=Ze();function N8(e){let t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(a){var o;let u=(o=a.operationTypes)!==null&&o!==void 0?o:[];for(let l of u){let d=l.operation,p=n[d];r[d]?e.reportError(new wL.GraphQLError(`Type for ${d} already defined in the schema. It cannot be redefined.`,{nodes:l})):p?e.reportError(new wL.GraphQLError(`There can be only one ${d} type in schema.`,{nodes:[p,l]})):n[d]=l}return!1}}});var K_=F(j_=>{"use strict";m();T();N();Object.defineProperty(j_,"__esModule",{value:!0});j_.UniqueTypeNamesRule=T8;var LL=Ze();function T8(e){let t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(i){let a=i.name.value;if(n!=null&&n.getType(a)){e.reportError(new LL.GraphQLError(`Type "${a}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return t[a]?e.reportError(new LL.GraphQLError(`There can be only one type named "${a}".`,{nodes:[t[a],i.name]})):t[a]=i.name,!1}}});var G_=F($_=>{"use strict";m();T();N();Object.defineProperty($_,"__esModule",{value:!0});$_.UniqueVariableNamesRule=y8;var E8=XN(),h8=Ze();function y8(e){return{OperationDefinition(t){var n;let r=(n=t.variableDefinitions)!==null&&n!==void 0?n:[],i=(0,E8.groupBy)(r,a=>a.variable.name.value);for(let[a,o]of i)o.length>1&&e.reportError(new h8.GraphQLError(`There can be only one variable named "$${a}".`,{nodes:o.map(u=>u.variable.name)}))}}}});var J_=F(Y_=>{"use strict";m();T();N();Object.defineProperty(Y_,"__esModule",{value:!0});Y_.ValuesOfCorrectTypeRule=v8;var I8=hu(),Cf=nn(),g8=yu(),_8=Iu(),Ja=Ze(),Q_=Ut(),ZN=yi(),Ya=Bt();function v8(e){let t={};return{OperationDefinition:{enter(){t={}}},VariableDefinition(n){t[n.variable.name.value]=n},ListValue(n){let r=(0,Ya.getNullableType)(e.getParentInputType());if(!(0,Ya.isListType)(r))return _c(e,n),!1},ObjectValue(n){let r=(0,Ya.getNamedType)(e.getInputType());if(!(0,Ya.isInputObjectType)(r))return _c(e,n),!1;let i=(0,g8.keyMap)(n.fields,a=>a.name.value);for(let a of Object.values(r.getFields()))if(!i[a.name]&&(0,Ya.isRequiredInputField)(a)){let u=(0,Cf.inspect)(a.type);e.reportError(new Ja.GraphQLError(`Field "${r.name}.${a.name}" of required type "${u}" was not provided.`,{nodes:n}))}r.isOneOf&&S8(e,n,r,i,t)},ObjectField(n){let r=(0,Ya.getNamedType)(e.getParentInputType());if(!e.getInputType()&&(0,Ya.isInputObjectType)(r)){let a=(0,_8.suggestionList)(n.name.value,Object.keys(r.getFields()));e.reportError(new Ja.GraphQLError(`Field "${n.name.value}" is not defined by type "${r.name}".`+(0,I8.didYouMean)(a),{nodes:n}))}},NullValue(n){let r=e.getInputType();(0,Ya.isNonNullType)(r)&&e.reportError(new Ja.GraphQLError(`Expected value of type "${(0,Cf.inspect)(r)}", found ${(0,ZN.print)(n)}.`,{nodes:n}))},EnumValue:n=>_c(e,n),IntValue:n=>_c(e,n),FloatValue:n=>_c(e,n),StringValue:n=>_c(e,n),BooleanValue:n=>_c(e,n)}}function _c(e,t){let n=e.getInputType();if(!n)return;let r=(0,Ya.getNamedType)(n);if(!(0,Ya.isLeafType)(r)){let i=(0,Cf.inspect)(n);e.reportError(new Ja.GraphQLError(`Expected value of type "${i}", found ${(0,ZN.print)(t)}.`,{nodes:t}));return}try{if(r.parseLiteral(t,void 0)===void 0){let a=(0,Cf.inspect)(n);e.reportError(new Ja.GraphQLError(`Expected value of type "${a}", found ${(0,ZN.print)(t)}.`,{nodes:t}))}}catch(i){let a=(0,Cf.inspect)(n);i instanceof Ja.GraphQLError?e.reportError(i):e.reportError(new Ja.GraphQLError(`Expected value of type "${a}", found ${(0,ZN.print)(t)}; `+i.message,{nodes:t,originalError:i}))}}function S8(e,t,n,r,i){var a;let o=Object.keys(r);if(o.length!==1){e.reportError(new Ja.GraphQLError(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[t]}));return}let l=(a=r[o[0]])===null||a===void 0?void 0:a.value,d=!l||l.kind===Q_.Kind.NULL,p=(l==null?void 0:l.kind)===Q_.Kind.VARIABLE;if(d){e.reportError(new Ja.GraphQLError(`Field "${n.name}.${o[0]}" must be non-null.`,{nodes:[t]}));return}if(p){let E=l.name.value;i[E].type.kind!==Q_.Kind.NON_NULL_TYPE&&e.reportError(new Ja.GraphQLError(`Variable "${E}" must be non-nullable to be used for OneOf Input Object "${n.name}".`,{nodes:[t]}))}}});var H_=F(z_=>{"use strict";m();T();N();Object.defineProperty(z_,"__esModule",{value:!0});z_.VariablesAreInputTypesRule=R8;var O8=Ze(),D8=yi(),b8=Bt(),A8=Qa();function R8(e){return{VariableDefinition(t){let n=(0,A8.typeFromAST)(e.getSchema(),t.type);if(n!==void 0&&!(0,b8.isInputType)(n)){let r=t.variable.name.value,i=(0,D8.print)(t.type);e.reportError(new O8.GraphQLError(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}});var X_=F(W_=>{"use strict";m();T();N();Object.defineProperty(W_,"__esModule",{value:!0});W_.VariablesInAllowedPositionRule=L8;var CL=nn(),P8=Ze(),F8=Ut(),UL=Bt(),BL=Nf(),w8=Qa();function L8(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i,type:a,defaultValue:o}of r){let u=i.name.value,l=t[u];if(l&&a){let d=e.getSchema(),p=(0,w8.typeFromAST)(d,l.type);if(p&&!C8(d,p,l.defaultValue,a,o)){let E=(0,CL.inspect)(p),h=(0,CL.inspect)(a);e.reportError(new P8.GraphQLError(`Variable "$${u}" of type "${E}" used in position expecting type "${h}".`,{nodes:[l,i]}))}}}}},VariableDefinition(n){t[n.variable.name.value]=n}}}function C8(e,t,n,r,i){if((0,UL.isNonNullType)(r)&&!(0,UL.isNonNullType)(t)){if(!(n!=null&&n.kind!==F8.Kind.NULL)&&!(i!==void 0))return!1;let u=r.ofType;return(0,BL.isTypeSubTypeOf)(e,t,u)}return(0,BL.isTypeSubTypeOf)(e,t,r)}});var Z_=F(Su=>{"use strict";m();T();N();Object.defineProperty(Su,"__esModule",{value:!0});Su.specifiedSDLRules=Su.specifiedRules=Su.recommendedRules=void 0;var U8=Tg(),B8=hg(),k8=Ig(),kL=gg(),ML=Og(),M8=bg(),xL=Pg(),x8=wg(),q8=Cg(),V8=Bg(),j8=Mg(),K8=qg(),$8=jg(),G8=$g(),Q8=e_(),Y8=r_(),J8=a_(),qL=o_(),z8=c_(),H8=h_(),W8=g_(),VL=v_(),X8=O_(),jL=A_(),Z8=P_(),eX=L_(),tX=U_(),KL=k_(),nX=x_(),rX=V_(),iX=K_(),aX=G_(),sX=J_(),oX=H_(),uX=X_(),$L=Object.freeze([V8.MaxIntrospectionDepthRule]);Su.recommendedRules=$L;var cX=Object.freeze([U8.ExecutableDefinitionsRule,nX.UniqueOperationNamesRule,x8.LoneAnonymousOperationRule,H8.SingleFieldSubscriptionsRule,xL.KnownTypeNamesRule,k8.FragmentsOnCompositeTypesRule,oX.VariablesAreInputTypesRule,z8.ScalarLeafsRule,B8.FieldsOnCorrectTypeRule,tX.UniqueFragmentNamesRule,M8.KnownFragmentNamesRule,$8.NoUnusedFragmentsRule,Y8.PossibleFragmentSpreadsRule,j8.NoFragmentCyclesRule,aX.UniqueVariableNamesRule,K8.NoUndefinedVariablesRule,G8.NoUnusedVariablesRule,ML.KnownDirectivesRule,jL.UniqueDirectivesPerLocationRule,kL.KnownArgumentNamesRule,VL.UniqueArgumentNamesRule,sX.ValuesOfCorrectTypeRule,qL.ProvidedRequiredArgumentsRule,uX.VariablesInAllowedPositionRule,Q8.OverlappingFieldsCanBeMergedRule,KL.UniqueInputFieldNamesRule,...$L]);Su.specifiedRules=cX;var lX=Object.freeze([q8.LoneSchemaDefinitionRule,rX.UniqueOperationTypesRule,iX.UniqueTypeNamesRule,Z8.UniqueEnumValueNamesRule,eX.UniqueFieldDefinitionNamesRule,W8.UniqueArgumentDefinitionNamesRule,X8.UniqueDirectiveNamesRule,xL.KnownTypeNamesRule,ML.KnownDirectivesRule,jL.UniqueDirectivesPerLocationRule,J8.PossibleTypeExtensionsRule,kL.KnownArgumentNamesOnDirectivesRule,VL.UniqueArgumentNamesRule,KL.UniqueInputFieldNamesRule,qL.ProvidedRequiredArgumentsOnDirectivesRule]);Su.specifiedSDLRules=lX});var nv=F(Ou=>{"use strict";m();T();N();Object.defineProperty(Ou,"__esModule",{value:!0});Ou.ValidationContext=Ou.SDLValidationContext=Ou.ASTValidationContext=void 0;var GL=Ut(),dX=fc(),QL=qN(),Uf=class{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(let r of this.getDocument().definitions)r.kind===GL.Kind.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let r=[t],i;for(;i=r.pop();)for(let a of i.selections)a.kind===GL.Kind.FRAGMENT_SPREAD?n.push(a):a.selectionSet&&r.push(a.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let r=Object.create(null),i=[t.selectionSet],a;for(;a=i.pop();)for(let o of this.getFragmentSpreads(a)){let u=o.name.value;if(r[u]!==!0){r[u]=!0;let l=this.getFragment(u);l&&(n.push(l),i.push(l.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}};Ou.ASTValidationContext=Uf;var ev=class extends Uf{constructor(t,n,r){super(t,r),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}};Ou.SDLValidationContext=ev;var tv=class extends Uf{constructor(t,n,r,i){super(n,i),this._schema=t,this._typeInfo=r,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let n=this._variableUsages.get(t);if(!n){let r=[],i=new QL.TypeInfo(this._schema);(0,dX.visit)(t,(0,QL.visitWithTypeInfo)(i,{VariableDefinition:()=>!1,Variable(a){r.push({node:a,type:i.getInputType(),defaultValue:i.getDefaultValue()})}})),n=r,this._variableUsages.set(t,n)}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(let r of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(r));this._recursiveVariableUsages.set(t,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}};Ou.ValidationContext=tv});var kl=F(Bl=>{"use strict";m();T();N();Object.defineProperty(Bl,"__esModule",{value:!0});Bl.assertValidSDL=TX;Bl.assertValidSDLExtension=EX;Bl.validate=NX;Bl.validateSDL=rv;var fX=$r(),pX=Ze(),eT=fc(),mX=Of(),YL=qN(),JL=Z_(),zL=nv();function NX(e,t,n=JL.specifiedRules,r,i=new YL.TypeInfo(e)){var a;let o=(a=r==null?void 0:r.maxErrors)!==null&&a!==void 0?a:100;t||(0,fX.devAssert)(!1,"Must provide document."),(0,mX.assertValidSchema)(e);let u=Object.freeze({}),l=[],d=new zL.ValidationContext(e,t,i,E=>{if(l.length>=o)throw l.push(new pX.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),u;l.push(E)}),p=(0,eT.visitInParallel)(n.map(E=>E(d)));try{(0,eT.visit)(t,(0,YL.visitWithTypeInfo)(i,p))}catch(E){if(E!==u)throw E}return l}function rv(e,t,n=JL.specifiedSDLRules){let r=[],i=new zL.SDLValidationContext(e,t,o=>{r.push(o)}),a=n.map(o=>o(i));return(0,eT.visit)(e,(0,eT.visitInParallel)(a)),r}function TX(e){let t=rv(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` +`))}var _g=class{constructor(t){this._errors=[],this.schema=t}reportError(t,n){let r=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new X3.GraphQLError(t,{nodes:r}))}getErrors(){return this._errors}};function n6(e){let t=e.schema,n=t.getQueryType();if(!n)e.reportError("Query root type must be provided.",t.astNode);else if(!(0,xn.isObjectType)(n)){var r;e.reportError(`Query root type must be Object type, it cannot be ${(0,Br.inspect)(n)}.`,(r=gg(t,Ig.OperationTypeNode.QUERY))!==null&&r!==void 0?r:n.astNode)}let i=t.getMutationType();if(i&&!(0,xn.isObjectType)(i)){var a;e.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,Br.inspect)(i)}.`,(a=gg(t,Ig.OperationTypeNode.MUTATION))!==null&&a!==void 0?a:i.astNode)}let o=t.getSubscriptionType();if(o&&!(0,xn.isObjectType)(o)){var u;e.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,Br.inspect)(o)}.`,(u=gg(t,Ig.OperationTypeNode.SUBSCRIPTION))!==null&&u!==void 0?u:o.astNode)}}function gg(e,t){var n;return(n=[e.astNode,...e.extensionASTNodes].flatMap(r=>{var i;return(i=r==null?void 0:r.operationTypes)!==null&&i!==void 0?i:[]}).find(r=>r.operation===t))===null||n===void 0?void 0:n.type}function r6(e){for(let n of e.schema.getDirectives()){if(!(0,GL.isDirective)(n)){e.reportError(`Expected directive but got: ${(0,Br.inspect)(n)}.`,n==null?void 0:n.astNode);continue}bc(e,n);for(let r of n.args)if(bc(e,r),(0,xn.isInputType)(r.type)||e.reportError(`The type of @${n.name}(${r.name}:) must be Input Type but got: ${(0,Br.inspect)(r.type)}.`,r.astNode),(0,xn.isRequiredArgument)(r)&&r.deprecationReason!=null){var t;e.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[vg(r.astNode),(t=r.astNode)===null||t===void 0?void 0:t.type])}}}function bc(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function i6(e){let t=d6(e),n=e.schema.getTypeMap();for(let r of Object.values(n)){if(!(0,xn.isNamedType)(r)){e.reportError(`Expected GraphQL named type but got: ${(0,Br.inspect)(r)}.`,r.astNode);continue}(0,Z3.isIntrospectionType)(r)||bc(e,r),(0,xn.isObjectType)(r)||(0,xn.isInterfaceType)(r)?(KL(e,r),jL(e,r)):(0,xn.isUnionType)(r)?o6(e,r):(0,xn.isEnumType)(r)?u6(e,r):(0,xn.isInputObjectType)(r)&&(c6(e,r),t(r))}}function KL(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let o of n){if(bc(e,o),!(0,xn.isOutputType)(o.type)){var r;e.reportError(`The type of ${t.name}.${o.name} must be Output Type but got: ${(0,Br.inspect)(o.type)}.`,(r=o.astNode)===null||r===void 0?void 0:r.type)}for(let u of o.args){let l=u.name;if(bc(e,u),!(0,xn.isInputType)(u.type)){var i;e.reportError(`The type of ${t.name}.${o.name}(${l}:) must be Input Type but got: ${(0,Br.inspect)(u.type)}.`,(i=u.astNode)===null||i===void 0?void 0:i.type)}if((0,xn.isRequiredArgument)(u)&&u.deprecationReason!=null){var a;e.reportError(`Required argument ${t.name}.${o.name}(${l}:) cannot be deprecated.`,[vg(u.astNode),(a=u.astNode)===null||a===void 0?void 0:a.type])}}}}function jL(e,t){let n=Object.create(null);for(let r of t.getInterfaces()){if(!(0,xn.isInterfaceType)(r)){e.reportError(`Type ${(0,Br.inspect)(t)} must only implement Interface types, it cannot implement ${(0,Br.inspect)(r)}.`,Fp(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,Fp(t,r));continue}if(n[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,Fp(t,r));continue}n[r.name]=!0,s6(e,t,r),a6(e,t,r)}}function a6(e,t,n){let r=t.getFields();for(let l of Object.values(n.getFields())){let d=l.name,p=r[d];if(!p){e.reportError(`Interface field ${n.name}.${d} expected but ${t.name} does not provide it.`,[l.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!(0,VL.isTypeSubTypeOf)(e.schema,p.type,l.type)){var i,a;e.reportError(`Interface field ${n.name}.${d} expects type ${(0,Br.inspect)(l.type)} but ${t.name}.${d} is type ${(0,Br.inspect)(p.type)}.`,[(i=l.astNode)===null||i===void 0?void 0:i.type,(a=p.astNode)===null||a===void 0?void 0:a.type])}for(let E of l.args){let h=E.name,_=p.args.find(S=>S.name===h);if(!_){e.reportError(`Interface field argument ${n.name}.${d}(${h}:) expected but ${t.name}.${d} does not provide it.`,[E.astNode,p.astNode]);continue}if(!(0,VL.isEqualType)(E.type,_.type)){var o,u;e.reportError(`Interface field argument ${n.name}.${d}(${h}:) expects type ${(0,Br.inspect)(E.type)} but ${t.name}.${d}(${h}:) is type ${(0,Br.inspect)(_.type)}.`,[(o=E.astNode)===null||o===void 0?void 0:o.type,(u=_.astNode)===null||u===void 0?void 0:u.type])}}for(let E of p.args){let h=E.name;!l.args.find(S=>S.name===h)&&(0,xn.isRequiredArgument)(E)&&e.reportError(`Object field ${t.name}.${d} includes required argument ${h} that is missing from the Interface field ${n.name}.${d}.`,[E.astNode,l.astNode])}}}function s6(e,t,n){let r=t.getInterfaces();for(let i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...Fp(n,i),...Fp(t,n)])}function o6(e,t){let n=t.getTypes();n.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=Object.create(null);for(let i of n){if(r[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,$L(t,i.name));continue}r[i.name]=!0,(0,xn.isObjectType)(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,Br.inspect)(i)}.`,$L(t,String(i)))}}function u6(e,t){let n=t.getValues();n.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let r of n)bc(e,r)}function c6(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let a of n){if(bc(e,a),!(0,xn.isInputType)(a.type)){var r;e.reportError(`The type of ${t.name}.${a.name} must be Input Type but got: ${(0,Br.inspect)(a.type)}.`,(r=a.astNode)===null||r===void 0?void 0:r.type)}if((0,xn.isRequiredInputField)(a)&&a.deprecationReason!=null){var i;e.reportError(`Required input field ${t.name}.${a.name} cannot be deprecated.`,[vg(a.astNode),(i=a.astNode)===null||i===void 0?void 0:i.type])}t.isOneOf&&l6(t,a,e)}}function l6(e,t,n){if((0,xn.isNonNullType)(t.type)){var r;n.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,(r=t.astNode)===null||r===void 0?void 0:r.type)}t.defaultValue!==void 0&&n.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}function d6(e){let t=Object.create(null),n=[],r=Object.create(null);return i;function i(a){if(t[a.name])return;t[a.name]=!0,r[a.name]=n.length;let o=Object.values(a.getFields());for(let u of o)if((0,xn.isNonNullType)(u.type)&&(0,xn.isInputObjectType)(u.type.ofType)){let l=u.type.ofType,d=r[l.name];if(n.push(u),d===void 0)i(l);else{let p=n.slice(d),E=p.map(h=>h.name).join(".");e.reportError(`Cannot reference Input Object "${l.name}" within itself through a series of non-null fields: "${E}".`,p.map(h=>h.astNode))}n.pop()}r[a.name]=void 0}}function Fp(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap(a=>{var o;return(o=a.interfaces)!==null&&o!==void 0?o:[]}).filter(a=>a.name.value===t.name)}function $L(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap(a=>{var o;return(o=a.types)!==null&&o!==void 0?o:[]}).filter(a=>a.name.value===t)}function vg(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(n=>n.name.value===GL.GraphQLDeprecatedDirective.name)}});var Ya=F(Dg=>{"use strict";m();T();N();Object.defineProperty(Dg,"__esModule",{value:!0});Dg.typeFromAST=Og;var Sg=Mt(),YL=xt();function Og(e,t){switch(t.kind){case Sg.Kind.LIST_TYPE:{let n=Og(e,t.type);return n&&new YL.GraphQLList(n)}case Sg.Kind.NON_NULL_TYPE:{let n=Og(e,t.type);return n&&new YL.GraphQLNonNull(n)}case Sg.Kind.NAMED_TYPE:return e.getType(t.name.value)}}});var eT=F(wp=>{"use strict";m();T();N();Object.defineProperty(wp,"__esModule",{value:!0});wp.TypeInfo=void 0;wp.visitWithTypeInfo=m6;var p6=ja(),qn=Mt(),JL=Ic(),Vn=xt(),xl=Vi(),HL=Ya(),bg=class{constructor(t,n,r){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=r!=null?r:f6,n&&((0,Vn.isInputType)(n)&&this._inputTypeStack.push(n),(0,Vn.isCompositeType)(n)&&this._parentTypeStack.push(n),(0,Vn.isOutputType)(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){let n=this._schema;switch(t.kind){case qn.Kind.SELECTION_SET:{let i=(0,Vn.getNamedType)(this.getType());this._parentTypeStack.push((0,Vn.isCompositeType)(i)?i:void 0);break}case qn.Kind.FIELD:{let i=this.getParentType(),a,o;i&&(a=this._getFieldDef(n,i,t),a&&(o=a.type)),this._fieldDefStack.push(a),this._typeStack.push((0,Vn.isOutputType)(o)?o:void 0);break}case qn.Kind.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case qn.Kind.OPERATION_DEFINITION:{let i=n.getRootType(t.operation);this._typeStack.push((0,Vn.isObjectType)(i)?i:void 0);break}case qn.Kind.INLINE_FRAGMENT:case qn.Kind.FRAGMENT_DEFINITION:{let i=t.typeCondition,a=i?(0,HL.typeFromAST)(n,i):(0,Vn.getNamedType)(this.getType());this._typeStack.push((0,Vn.isOutputType)(a)?a:void 0);break}case qn.Kind.VARIABLE_DEFINITION:{let i=(0,HL.typeFromAST)(n,t.type);this._inputTypeStack.push((0,Vn.isInputType)(i)?i:void 0);break}case qn.Kind.ARGUMENT:{var r;let i,a,o=(r=this.getDirective())!==null&&r!==void 0?r:this.getFieldDef();o&&(i=o.args.find(u=>u.name===t.name.value),i&&(a=i.type)),this._argument=i,this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push((0,Vn.isInputType)(a)?a:void 0);break}case qn.Kind.LIST:{let i=(0,Vn.getNullableType)(this.getInputType()),a=(0,Vn.isListType)(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,Vn.isInputType)(a)?a:void 0);break}case qn.Kind.OBJECT_FIELD:{let i=(0,Vn.getNamedType)(this.getInputType()),a,o;(0,Vn.isInputObjectType)(i)&&(o=i.getFields()[t.name.value],o&&(a=o.type)),this._defaultValueStack.push(o?o.defaultValue:void 0),this._inputTypeStack.push((0,Vn.isInputType)(a)?a:void 0);break}case qn.Kind.ENUM:{let i=(0,Vn.getNamedType)(this.getInputType()),a;(0,Vn.isEnumType)(i)&&(a=i.getValue(t.value)),this._enumValue=a;break}default:}}leave(t){switch(t.kind){case qn.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case qn.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case qn.Kind.DIRECTIVE:this._directive=null;break;case qn.Kind.OPERATION_DEFINITION:case qn.Kind.INLINE_FRAGMENT:case qn.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case qn.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case qn.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case qn.Kind.LIST:case qn.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case qn.Kind.ENUM:this._enumValue=null;break;default:}}};wp.TypeInfo=bg;function f6(e,t,n){let r=n.name.value;if(r===xl.SchemaMetaFieldDef.name&&e.getQueryType()===t)return xl.SchemaMetaFieldDef;if(r===xl.TypeMetaFieldDef.name&&e.getQueryType()===t)return xl.TypeMetaFieldDef;if(r===xl.TypeNameMetaFieldDef.name&&(0,Vn.isCompositeType)(t))return xl.TypeNameMetaFieldDef;if((0,Vn.isObjectType)(t)||(0,Vn.isInterfaceType)(t))return t.getFields()[r]}function m6(e,t){return{enter(...n){let r=n[0];e.enter(r);let i=(0,JL.getEnterLeaveForKind)(t,r.kind).enter;if(i){let a=i.apply(t,n);return a!==void 0&&(e.leave(r),(0,p6.isNode)(a)&&e.enter(a)),a}},leave(...n){let r=n[0],i=(0,JL.getEnterLeaveForKind)(t,r.kind).leave,a;return i&&(a=i.apply(t,n)),e.leave(r),a}}}});var Ac=F(Ki=>{"use strict";m();T();N();Object.defineProperty(Ki,"__esModule",{value:!0});Ki.isConstValueNode=Ag;Ki.isDefinitionNode=N6;Ki.isExecutableDefinitionNode=zL;Ki.isSelectionNode=T6;Ki.isTypeDefinitionNode=ZL;Ki.isTypeExtensionNode=tw;Ki.isTypeNode=E6;Ki.isTypeSystemDefinitionNode=XL;Ki.isTypeSystemExtensionNode=ew;Ki.isValueNode=WL;var qt=Mt();function N6(e){return zL(e)||XL(e)||ew(e)}function zL(e){return e.kind===qt.Kind.OPERATION_DEFINITION||e.kind===qt.Kind.FRAGMENT_DEFINITION}function T6(e){return e.kind===qt.Kind.FIELD||e.kind===qt.Kind.FRAGMENT_SPREAD||e.kind===qt.Kind.INLINE_FRAGMENT}function WL(e){return e.kind===qt.Kind.VARIABLE||e.kind===qt.Kind.INT||e.kind===qt.Kind.FLOAT||e.kind===qt.Kind.STRING||e.kind===qt.Kind.BOOLEAN||e.kind===qt.Kind.NULL||e.kind===qt.Kind.ENUM||e.kind===qt.Kind.LIST||e.kind===qt.Kind.OBJECT}function Ag(e){return WL(e)&&(e.kind===qt.Kind.LIST?e.values.some(Ag):e.kind===qt.Kind.OBJECT?e.fields.some(t=>Ag(t.value)):e.kind!==qt.Kind.VARIABLE)}function E6(e){return e.kind===qt.Kind.NAMED_TYPE||e.kind===qt.Kind.LIST_TYPE||e.kind===qt.Kind.NON_NULL_TYPE}function XL(e){return e.kind===qt.Kind.SCHEMA_DEFINITION||ZL(e)||e.kind===qt.Kind.DIRECTIVE_DEFINITION}function ZL(e){return e.kind===qt.Kind.SCALAR_TYPE_DEFINITION||e.kind===qt.Kind.OBJECT_TYPE_DEFINITION||e.kind===qt.Kind.INTERFACE_TYPE_DEFINITION||e.kind===qt.Kind.UNION_TYPE_DEFINITION||e.kind===qt.Kind.ENUM_TYPE_DEFINITION||e.kind===qt.Kind.INPUT_OBJECT_TYPE_DEFINITION}function ew(e){return e.kind===qt.Kind.SCHEMA_EXTENSION||tw(e)}function tw(e){return e.kind===qt.Kind.SCALAR_TYPE_EXTENSION||e.kind===qt.Kind.OBJECT_TYPE_EXTENSION||e.kind===qt.Kind.INTERFACE_TYPE_EXTENSION||e.kind===qt.Kind.UNION_TYPE_EXTENSION||e.kind===qt.Kind.ENUM_TYPE_EXTENSION||e.kind===qt.Kind.INPUT_OBJECT_TYPE_EXTENSION}});var Pg=F(Rg=>{"use strict";m();T();N();Object.defineProperty(Rg,"__esModule",{value:!0});Rg.ExecutableDefinitionsRule=I6;var h6=tt(),nw=Mt(),y6=Ac();function I6(e){return{Document(t){for(let n of t.definitions)if(!(0,y6.isExecutableDefinitionNode)(n)){let r=n.kind===nw.Kind.SCHEMA_DEFINITION||n.kind===nw.Kind.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new h6.GraphQLError(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}});var Lg=F(Fg=>{"use strict";m();T();N();Object.defineProperty(Fg,"__esModule",{value:!0});Fg.FieldsOnCorrectTypeRule=S6;var rw=Ou(),g6=Tp(),_6=bu(),v6=tt(),Cp=xt();function S6(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let i=e.getSchema(),a=t.name.value,o=(0,rw.didYouMean)("to use an inline fragment on",O6(i,n,a));o===""&&(o=(0,rw.didYouMean)(D6(n,a))),e.reportError(new v6.GraphQLError(`Cannot query field "${a}" on type "${n.name}".`+o,{nodes:t}))}}}}function O6(e,t,n){if(!(0,Cp.isAbstractType)(t))return[];let r=new Set,i=Object.create(null);for(let o of e.getPossibleTypes(t))if(o.getFields()[n]){r.add(o),i[o.name]=1;for(let u of o.getInterfaces()){var a;u.getFields()[n]&&(r.add(u),i[u.name]=((a=i[u.name])!==null&&a!==void 0?a:0)+1)}}return[...r].sort((o,u)=>{let l=i[u.name]-i[o.name];return l!==0?l:(0,Cp.isInterfaceType)(o)&&e.isSubType(o,u)?-1:(0,Cp.isInterfaceType)(u)&&e.isSubType(u,o)?1:(0,g6.naturalCompare)(o.name,u.name)}).map(o=>o.name)}function D6(e,t){if((0,Cp.isObjectType)(e)||(0,Cp.isInterfaceType)(e)){let n=Object.keys(e.getFields());return(0,_6.suggestionList)(t,n)}return[]}});var Cg=F(wg=>{"use strict";m();T();N();Object.defineProperty(wg,"__esModule",{value:!0});wg.FragmentsOnCompositeTypesRule=b6;var iw=tt(),aw=_i(),sw=xt(),ow=Ya();function b6(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let r=(0,ow.typeFromAST)(e.getSchema(),n);if(r&&!(0,sw.isCompositeType)(r)){let i=(0,aw.print)(n);e.reportError(new iw.GraphQLError(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(t){let n=(0,ow.typeFromAST)(e.getSchema(),t.typeCondition);if(n&&!(0,sw.isCompositeType)(n)){let r=(0,aw.print)(t.typeCondition);e.reportError(new iw.GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${r}".`,{nodes:t.typeCondition}))}}}}});var Ug=F(tT=>{"use strict";m();T();N();Object.defineProperty(tT,"__esModule",{value:!0});tT.KnownArgumentNamesOnDirectivesRule=dw;tT.KnownArgumentNamesRule=P6;var uw=Ou(),cw=bu(),lw=tt(),A6=Mt(),R6=si();function P6(e){return W(q({},dw(e)),{Argument(t){let n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){let a=t.name.value,o=r.args.map(l=>l.name),u=(0,cw.suggestionList)(a,o);e.reportError(new lw.GraphQLError(`Unknown argument "${a}" on field "${i.name}.${r.name}".`+(0,uw.didYouMean)(u),{nodes:t}))}}})}function dw(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():R6.specifiedDirectives;for(let o of r)t[o.name]=o.args.map(u=>u.name);let i=e.getDocument().definitions;for(let o of i)if(o.kind===A6.Kind.DIRECTIVE_DEFINITION){var a;let u=(a=o.arguments)!==null&&a!==void 0?a:[];t[o.name.value]=u.map(l=>l.name.value)}return{Directive(o){let u=o.name.value,l=t[u];if(o.arguments&&l)for(let d of o.arguments){let p=d.name.value;if(!l.includes(p)){let E=(0,cw.suggestionList)(p,l);e.reportError(new lw.GraphQLError(`Unknown argument "${p}" on directive "@${u}".`+(0,uw.didYouMean)(E),{nodes:d}))}}return!1}}}});var xg=F(Mg=>{"use strict";m();T();N();Object.defineProperty(Mg,"__esModule",{value:!0});Mg.KnownDirectivesRule=w6;var F6=rn(),Bg=Cr(),pw=tt(),kg=ja(),fr=Ll(),Sn=Mt(),L6=si();function w6(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():L6.specifiedDirectives;for(let a of r)t[a.name]=a.locations;let i=e.getDocument().definitions;for(let a of i)a.kind===Sn.Kind.DIRECTIVE_DEFINITION&&(t[a.name.value]=a.locations.map(o=>o.value));return{Directive(a,o,u,l,d){let p=a.name.value,E=t[p];if(!E){e.reportError(new pw.GraphQLError(`Unknown directive "@${p}".`,{nodes:a}));return}let h=C6(d);h&&!E.includes(h)&&e.reportError(new pw.GraphQLError(`Directive "@${p}" may not be used on ${h}.`,{nodes:a}))}}}function C6(e){let t=e[e.length-1];switch("kind"in t||(0,Bg.invariant)(!1),t.kind){case Sn.Kind.OPERATION_DEFINITION:return U6(t.operation);case Sn.Kind.FIELD:return fr.DirectiveLocation.FIELD;case Sn.Kind.FRAGMENT_SPREAD:return fr.DirectiveLocation.FRAGMENT_SPREAD;case Sn.Kind.INLINE_FRAGMENT:return fr.DirectiveLocation.INLINE_FRAGMENT;case Sn.Kind.FRAGMENT_DEFINITION:return fr.DirectiveLocation.FRAGMENT_DEFINITION;case Sn.Kind.VARIABLE_DEFINITION:return fr.DirectiveLocation.VARIABLE_DEFINITION;case Sn.Kind.SCHEMA_DEFINITION:case Sn.Kind.SCHEMA_EXTENSION:return fr.DirectiveLocation.SCHEMA;case Sn.Kind.SCALAR_TYPE_DEFINITION:case Sn.Kind.SCALAR_TYPE_EXTENSION:return fr.DirectiveLocation.SCALAR;case Sn.Kind.OBJECT_TYPE_DEFINITION:case Sn.Kind.OBJECT_TYPE_EXTENSION:return fr.DirectiveLocation.OBJECT;case Sn.Kind.FIELD_DEFINITION:return fr.DirectiveLocation.FIELD_DEFINITION;case Sn.Kind.INTERFACE_TYPE_DEFINITION:case Sn.Kind.INTERFACE_TYPE_EXTENSION:return fr.DirectiveLocation.INTERFACE;case Sn.Kind.UNION_TYPE_DEFINITION:case Sn.Kind.UNION_TYPE_EXTENSION:return fr.DirectiveLocation.UNION;case Sn.Kind.ENUM_TYPE_DEFINITION:case Sn.Kind.ENUM_TYPE_EXTENSION:return fr.DirectiveLocation.ENUM;case Sn.Kind.ENUM_VALUE_DEFINITION:return fr.DirectiveLocation.ENUM_VALUE;case Sn.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Sn.Kind.INPUT_OBJECT_TYPE_EXTENSION:return fr.DirectiveLocation.INPUT_OBJECT;case Sn.Kind.INPUT_VALUE_DEFINITION:{let n=e[e.length-3];return"kind"in n||(0,Bg.invariant)(!1),n.kind===Sn.Kind.INPUT_OBJECT_TYPE_DEFINITION?fr.DirectiveLocation.INPUT_FIELD_DEFINITION:fr.DirectiveLocation.ARGUMENT_DEFINITION}default:(0,Bg.invariant)(!1,"Unexpected kind: "+(0,F6.inspect)(t.kind))}}function U6(e){switch(e){case kg.OperationTypeNode.QUERY:return fr.DirectiveLocation.QUERY;case kg.OperationTypeNode.MUTATION:return fr.DirectiveLocation.MUTATION;case kg.OperationTypeNode.SUBSCRIPTION:return fr.DirectiveLocation.SUBSCRIPTION}}});var Vg=F(qg=>{"use strict";m();T();N();Object.defineProperty(qg,"__esModule",{value:!0});qg.KnownFragmentNamesRule=k6;var B6=tt();function k6(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new B6.GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}}});var $g=F(jg=>{"use strict";m();T();N();Object.defineProperty(jg,"__esModule",{value:!0});jg.KnownTypeNamesRule=j6;var M6=Ou(),x6=bu(),q6=tt(),Kg=Ac(),V6=Vi(),K6=Qa();function j6(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(let a of e.getDocument().definitions)(0,Kg.isTypeDefinitionNode)(a)&&(r[a.name.value]=!0);let i=[...Object.keys(n),...Object.keys(r)];return{NamedType(a,o,u,l,d){let p=a.name.value;if(!n[p]&&!r[p]){var E;let h=(E=d[2])!==null&&E!==void 0?E:u,_=h!=null&&$6(h);if(_&&fw.includes(p))return;let S=(0,x6.suggestionList)(p,_?fw.concat(i):i);e.reportError(new q6.GraphQLError(`Unknown type "${p}".`+(0,M6.didYouMean)(S),{nodes:a}))}}}}var fw=[...K6.specifiedScalarTypes,...V6.introspectionTypes].map(e=>e.name);function $6(e){return"kind"in e&&((0,Kg.isTypeSystemDefinitionNode)(e)||(0,Kg.isTypeSystemExtensionNode)(e))}});var Qg=F(Gg=>{"use strict";m();T();N();Object.defineProperty(Gg,"__esModule",{value:!0});Gg.LoneAnonymousOperationRule=Y6;var G6=tt(),Q6=Mt();function Y6(e){let t=0;return{Document(n){t=n.definitions.filter(r=>r.kind===Q6.Kind.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new G6.GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}}});var Jg=F(Yg=>{"use strict";m();T();N();Object.defineProperty(Yg,"__esModule",{value:!0});Yg.LoneSchemaDefinitionRule=J6;var mw=tt();function J6(e){var t,n,r;let i=e.getSchema(),a=(t=(n=(r=i==null?void 0:i.astNode)!==null&&r!==void 0?r:i==null?void 0:i.getQueryType())!==null&&n!==void 0?n:i==null?void 0:i.getMutationType())!==null&&t!==void 0?t:i==null?void 0:i.getSubscriptionType(),o=0;return{SchemaDefinition(u){if(a){e.reportError(new mw.GraphQLError("Cannot define a new schema within a schema extension.",{nodes:u}));return}o>0&&e.reportError(new mw.GraphQLError("Must provide only one schema definition.",{nodes:u})),++o}}}});var zg=F(Hg=>{"use strict";m();T();N();Object.defineProperty(Hg,"__esModule",{value:!0});Hg.MaxIntrospectionDepthRule=W6;var H6=tt(),Nw=Mt(),z6=3;function W6(e){function t(n,r=Object.create(null),i=0){if(n.kind===Nw.Kind.FRAGMENT_SPREAD){let a=n.name.value;if(r[a]===!0)return!1;let o=e.getFragment(a);if(!o)return!1;try{return r[a]=!0,t(o,r,i)}finally{r[a]=void 0}}if(n.kind===Nw.Kind.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(i++,i>=z6))return!0;if("selectionSet"in n&&n.selectionSet){for(let a of n.selectionSet.selections)if(t(a,r,i))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new H6.GraphQLError("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}});var Xg=F(Wg=>{"use strict";m();T();N();Object.defineProperty(Wg,"__esModule",{value:!0});Wg.NoFragmentCyclesRule=Z6;var X6=tt();function Z6(e){let t=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(a){return i(a),!1}};function i(a){if(t[a.name.value])return;let o=a.name.value;t[o]=!0;let u=e.getFragmentSpreads(a.selectionSet);if(u.length!==0){r[o]=n.length;for(let l of u){let d=l.name.value,p=r[d];if(n.push(l),p===void 0){let E=e.getFragment(d);E&&i(E)}else{let E=n.slice(p),h=E.slice(0,-1).map(_=>'"'+_.name.value+'"').join(", ");e.reportError(new X6.GraphQLError(`Cannot spread fragment "${d}" within itself`+(h!==""?` via ${h}.`:"."),{nodes:E}))}n.pop()}r[o]=void 0}}}});var e_=F(Zg=>{"use strict";m();T();N();Object.defineProperty(Zg,"__esModule",{value:!0});Zg.NoUndefinedVariablesRule=t4;var e4=tt();function t4(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i}of r){let a=i.name.value;t[a]!==!0&&e.reportError(new e4.GraphQLError(n.name?`Variable "$${a}" is not defined by operation "${n.name.value}".`:`Variable "$${a}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(n){t[n.variable.name.value]=!0}}}});var n_=F(t_=>{"use strict";m();T();N();Object.defineProperty(t_,"__esModule",{value:!0});t_.NoUnusedFragmentsRule=r4;var n4=tt();function r4(e){let t=[],n=[];return{OperationDefinition(r){return t.push(r),!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){let r=Object.create(null);for(let i of t)for(let a of e.getRecursivelyReferencedFragments(i))r[a.name.value]=!0;for(let i of n){let a=i.name.value;r[a]!==!0&&e.reportError(new n4.GraphQLError(`Fragment "${a}" is never used.`,{nodes:i}))}}}}}});var i_=F(r_=>{"use strict";m();T();N();Object.defineProperty(r_,"__esModule",{value:!0});r_.NoUnusedVariablesRule=a4;var i4=tt();function a4(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){let r=Object.create(null),i=e.getRecursiveVariableUsages(n);for(let{node:a}of i)r[a.name.value]=!0;for(let a of t){let o=a.variable.name.value;r[o]!==!0&&e.reportError(new i4.GraphQLError(n.name?`Variable "$${o}" is never used in operation "${n.name.value}".`:`Variable "$${o}" is never used.`,{nodes:a}))}}},VariableDefinition(n){t.push(n)}}}});var o_=F(s_=>{"use strict";m();T();N();Object.defineProperty(s_,"__esModule",{value:!0});s_.sortValueNode=a_;var s4=Tp(),Rs=Mt();function a_(e){switch(e.kind){case Rs.Kind.OBJECT:return W(q({},e),{fields:o4(e.fields)});case Rs.Kind.LIST:return W(q({},e),{values:e.values.map(a_)});case Rs.Kind.INT:case Rs.Kind.FLOAT:case Rs.Kind.STRING:case Rs.Kind.BOOLEAN:case Rs.Kind.NULL:case Rs.Kind.ENUM:case Rs.Kind.VARIABLE:return e}}function o4(e){return e.map(t=>W(q({},t),{value:a_(t.value)})).sort((t,n)=>(0,s4.naturalCompare)(t.name.value,n.name.value))}});var m_=F(f_=>{"use strict";m();T();N();Object.defineProperty(f_,"__esModule",{value:!0});f_.OverlappingFieldsCanBeMergedRule=d4;var Tw=rn(),u4=tt(),u_=Mt(),c4=_i(),oi=xt(),l4=o_(),hw=Ya();function yw(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+yw(n)).join(" and "):e}function d4(e){let t=new d_,n=new Map;return{SelectionSet(r){let i=p4(e,n,t,e.getParentType(),r);for(let[[a,o],u,l]of i){let d=yw(o);e.reportError(new u4.GraphQLError(`Fields "${a}" conflict because ${d}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:u.concat(l)}))}}}}function p4(e,t,n,r,i){let a=[],[o,u]=iT(e,t,r,i);if(m4(e,a,t,n,o),u.length!==0)for(let l=0;l1)for(let u=0;u[a.value,o]));return n.every(a=>{let o=a.value,u=i.get(a.name.value);return u===void 0?!1:Ew(o)===Ew(u)})}function Ew(e){return(0,c4.print)((0,l4.sortValueNode)(e))}function c_(e,t){return(0,oi.isListType)(e)?(0,oi.isListType)(t)?c_(e.ofType,t.ofType):!0:(0,oi.isListType)(t)?!0:(0,oi.isNonNullType)(e)?(0,oi.isNonNullType)(t)?c_(e.ofType,t.ofType):!0:(0,oi.isNonNullType)(t)?!0:(0,oi.isLeafType)(e)||(0,oi.isLeafType)(t)?e!==t:!1}function iT(e,t,n,r){let i=t.get(r);if(i)return i;let a=Object.create(null),o=Object.create(null);gw(e,n,r,a,o);let u=[a,Object.keys(o)];return t.set(r,u),u}function l_(e,t,n){let r=t.get(n.selectionSet);if(r)return r;let i=(0,hw.typeFromAST)(e.getSchema(),n.typeCondition);return iT(e,t,i,n.selectionSet)}function gw(e,t,n,r,i){for(let a of n.selections)switch(a.kind){case u_.Kind.FIELD:{let o=a.name.value,u;((0,oi.isObjectType)(t)||(0,oi.isInterfaceType)(t))&&(u=t.getFields()[o]);let l=a.alias?a.alias.value:o;r[l]||(r[l]=[]),r[l].push([t,a,u]);break}case u_.Kind.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case u_.Kind.INLINE_FRAGMENT:{let o=a.typeCondition,u=o?(0,hw.typeFromAST)(e.getSchema(),o):t;gw(e,u,a.selectionSet,r,i);break}}}function T4(e,t,n,r){if(e.length>0)return[[t,e.map(([i])=>i)],[n,...e.map(([,i])=>i).flat()],[r,...e.map(([,,i])=>i).flat()]]}var d_=class{constructor(){this._data=new Map}has(t,n,r){var i;let[a,o]=t{"use strict";m();T();N();Object.defineProperty(T_,"__esModule",{value:!0});T_.PossibleFragmentSpreadsRule=h4;var aT=rn(),_w=tt(),N_=xt(),vw=_p(),E4=Ya();function h4(e){return{InlineFragment(t){let n=e.getType(),r=e.getParentType();if((0,N_.isCompositeType)(n)&&(0,N_.isCompositeType)(r)&&!(0,vw.doTypesOverlap)(e.getSchema(),n,r)){let i=(0,aT.inspect)(r),a=(0,aT.inspect)(n);e.reportError(new _w.GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${a}".`,{nodes:t}))}},FragmentSpread(t){let n=t.name.value,r=y4(e,n),i=e.getParentType();if(r&&i&&!(0,vw.doTypesOverlap)(e.getSchema(),r,i)){let a=(0,aT.inspect)(i),o=(0,aT.inspect)(r);e.reportError(new _w.GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${a}" can never be of type "${o}".`,{nodes:t}))}}}}function y4(e,t){let n=e.getFragment(t);if(n){let r=(0,E4.typeFromAST)(e.getSchema(),n.typeCondition);if((0,N_.isCompositeType)(r))return r}}});var y_=F(h_=>{"use strict";m();T();N();Object.defineProperty(h_,"__esModule",{value:!0});h_.PossibleTypeExtensionsRule=v4;var I4=Ou(),Ow=rn(),Dw=Cr(),g4=bu(),Sw=tt(),Rn=Mt(),_4=Ac(),ql=xt();function v4(e){let t=e.getSchema(),n=Object.create(null);for(let i of e.getDocument().definitions)(0,_4.isTypeDefinitionNode)(i)&&(n[i.name.value]=i);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(i){let a=i.name.value,o=n[a],u=t==null?void 0:t.getType(a),l;if(o?l=S4[o.kind]:u&&(l=O4(u)),l){if(l!==i.kind){let d=D4(i.kind);e.reportError(new Sw.GraphQLError(`Cannot extend non-${d} type "${a}".`,{nodes:o?[o,i]:i}))}}else{let d=Object.keys(q(q({},n),t==null?void 0:t.getTypeMap())),p=(0,g4.suggestionList)(a,d);e.reportError(new Sw.GraphQLError(`Cannot extend type "${a}" because it is not defined.`+(0,I4.didYouMean)(p),{nodes:i.name}))}}}var S4={[Rn.Kind.SCALAR_TYPE_DEFINITION]:Rn.Kind.SCALAR_TYPE_EXTENSION,[Rn.Kind.OBJECT_TYPE_DEFINITION]:Rn.Kind.OBJECT_TYPE_EXTENSION,[Rn.Kind.INTERFACE_TYPE_DEFINITION]:Rn.Kind.INTERFACE_TYPE_EXTENSION,[Rn.Kind.UNION_TYPE_DEFINITION]:Rn.Kind.UNION_TYPE_EXTENSION,[Rn.Kind.ENUM_TYPE_DEFINITION]:Rn.Kind.ENUM_TYPE_EXTENSION,[Rn.Kind.INPUT_OBJECT_TYPE_DEFINITION]:Rn.Kind.INPUT_OBJECT_TYPE_EXTENSION};function O4(e){if((0,ql.isScalarType)(e))return Rn.Kind.SCALAR_TYPE_EXTENSION;if((0,ql.isObjectType)(e))return Rn.Kind.OBJECT_TYPE_EXTENSION;if((0,ql.isInterfaceType)(e))return Rn.Kind.INTERFACE_TYPE_EXTENSION;if((0,ql.isUnionType)(e))return Rn.Kind.UNION_TYPE_EXTENSION;if((0,ql.isEnumType)(e))return Rn.Kind.ENUM_TYPE_EXTENSION;if((0,ql.isInputObjectType)(e))return Rn.Kind.INPUT_OBJECT_TYPE_EXTENSION;(0,Dw.invariant)(!1,"Unexpected type: "+(0,Ow.inspect)(e))}function D4(e){switch(e){case Rn.Kind.SCALAR_TYPE_EXTENSION:return"scalar";case Rn.Kind.OBJECT_TYPE_EXTENSION:return"object";case Rn.Kind.INTERFACE_TYPE_EXTENSION:return"interface";case Rn.Kind.UNION_TYPE_EXTENSION:return"union";case Rn.Kind.ENUM_TYPE_EXTENSION:return"enum";case Rn.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:(0,Dw.invariant)(!1,"Unexpected kind: "+(0,Ow.inspect)(e))}}});var g_=F(sT=>{"use strict";m();T();N();Object.defineProperty(sT,"__esModule",{value:!0});sT.ProvidedRequiredArgumentsOnDirectivesRule=Fw;sT.ProvidedRequiredArgumentsRule=R4;var Aw=rn(),bw=Du(),Rw=tt(),Pw=Mt(),b4=_i(),I_=xt(),A4=si();function R4(e){return W(q({},Fw(e)),{Field:{leave(t){var n;let r=e.getFieldDef();if(!r)return!1;let i=new Set((n=t.arguments)===null||n===void 0?void 0:n.map(a=>a.name.value));for(let a of r.args)if(!i.has(a.name)&&(0,I_.isRequiredArgument)(a)){let o=(0,Aw.inspect)(a.type);e.reportError(new Rw.GraphQLError(`Field "${r.name}" argument "${a.name}" of type "${o}" is required, but it was not provided.`,{nodes:t}))}}}})}function Fw(e){var t;let n=Object.create(null),r=e.getSchema(),i=(t=r==null?void 0:r.getDirectives())!==null&&t!==void 0?t:A4.specifiedDirectives;for(let u of i)n[u.name]=(0,bw.keyMap)(u.args.filter(I_.isRequiredArgument),l=>l.name);let a=e.getDocument().definitions;for(let u of a)if(u.kind===Pw.Kind.DIRECTIVE_DEFINITION){var o;let l=(o=u.arguments)!==null&&o!==void 0?o:[];n[u.name.value]=(0,bw.keyMap)(l.filter(P4),d=>d.name.value)}return{Directive:{leave(u){let l=u.name.value,d=n[l];if(d){var p;let E=(p=u.arguments)!==null&&p!==void 0?p:[],h=new Set(E.map(_=>_.name.value));for(let[_,S]of Object.entries(d))if(!h.has(_)){let k=(0,I_.isType)(S.type)?(0,Aw.inspect)(S.type):(0,b4.print)(S.type);e.reportError(new Rw.GraphQLError(`Directive "@${l}" argument "${_}" of type "${k}" is required, but it was not provided.`,{nodes:u}))}}}}}}function P4(e){return e.type.kind===Pw.Kind.NON_NULL_TYPE&&e.defaultValue==null}});var v_=F(__=>{"use strict";m();T();N();Object.defineProperty(__,"__esModule",{value:!0});__.ScalarLeafsRule=F4;var Lw=rn(),ww=tt(),Cw=xt();function F4(e){return{Field(t){let n=e.getType(),r=t.selectionSet;if(n){if((0,Cw.isLeafType)((0,Cw.getNamedType)(n))){if(r){let i=t.name.value,a=(0,Lw.inspect)(n);e.reportError(new ww.GraphQLError(`Field "${i}" must not have a selection since type "${a}" has no subfields.`,{nodes:r}))}}else if(!r){let i=t.name.value,a=(0,Lw.inspect)(n);e.reportError(new ww.GraphQLError(`Field "${i}" of type "${a}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}}}}}});var O_=F(S_=>{"use strict";m();T();N();Object.defineProperty(S_,"__esModule",{value:!0});S_.printPathArray=L4;function L4(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}});var Up=F(oT=>{"use strict";m();T();N();Object.defineProperty(oT,"__esModule",{value:!0});oT.addPath=w4;oT.pathToArray=C4;function w4(e,t,n){return{prev:e,key:t,typename:n}}function C4(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}});var b_=F(D_=>{"use strict";m();T();N();Object.defineProperty(D_,"__esModule",{value:!0});D_.coerceInputValue=V4;var U4=Ou(),uT=rn(),B4=Cr(),k4=zN(),M4=Ka(),Ea=Up(),x4=O_(),q4=bu(),Ps=tt(),Bp=xt();function V4(e,t,n=K4){return kp(e,t,n,void 0)}function K4(e,t,n){let r="Invalid value "+(0,uT.inspect)(t);throw e.length>0&&(r+=` at "value${(0,x4.printPathArray)(e)}"`),n.message=r+": "+n.message,n}function kp(e,t,n,r){if((0,Bp.isNonNullType)(t)){if(e!=null)return kp(e,t.ofType,n,r);n((0,Ea.pathToArray)(r),e,new Ps.GraphQLError(`Expected non-nullable type "${(0,uT.inspect)(t)}" not to be null.`));return}if(e==null)return null;if((0,Bp.isListType)(t)){let i=t.ofType;return(0,k4.isIterableObject)(e)?Array.from(e,(a,o)=>{let u=(0,Ea.addPath)(r,o,void 0);return kp(a,i,n,u)}):[kp(e,i,n,r)]}if((0,Bp.isInputObjectType)(t)){if(!(0,M4.isObjectLike)(e)){n((0,Ea.pathToArray)(r),e,new Ps.GraphQLError(`Expected type "${t.name}" to be an object.`));return}let i={},a=t.getFields();for(let o of Object.values(a)){let u=e[o.name];if(u===void 0){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if((0,Bp.isNonNullType)(o.type)){let l=(0,uT.inspect)(o.type);n((0,Ea.pathToArray)(r),e,new Ps.GraphQLError(`Field "${o.name}" of required type "${l}" was not provided.`))}continue}i[o.name]=kp(u,o.type,n,(0,Ea.addPath)(r,o.name,t.name))}for(let o of Object.keys(e))if(!a[o]){let u=(0,q4.suggestionList)(o,Object.keys(t.getFields()));n((0,Ea.pathToArray)(r),e,new Ps.GraphQLError(`Field "${o}" is not defined by type "${t.name}".`+(0,U4.didYouMean)(u)))}if(t.isOneOf){let o=Object.keys(i);o.length!==1&&n((0,Ea.pathToArray)(r),e,new Ps.GraphQLError(`Exactly one key must be specified for OneOf type "${t.name}".`));let u=o[0],l=i[u];l===null&&n((0,Ea.pathToArray)(r).concat(u),l,new Ps.GraphQLError(`Field "${u}" must be non-null.`))}return i}if((0,Bp.isLeafType)(t)){let i;try{i=t.parseValue(e)}catch(a){a instanceof Ps.GraphQLError?n((0,Ea.pathToArray)(r),e,a):n((0,Ea.pathToArray)(r),e,new Ps.GraphQLError(`Expected type "${t.name}". `+a.message,{originalError:a}));return}return i===void 0&&n((0,Ea.pathToArray)(r),e,new Ps.GraphQLError(`Expected type "${t.name}".`)),i}(0,B4.invariant)(!1,"Unexpected input type: "+(0,uT.inspect)(t))}});var xp=F(A_=>{"use strict";m();T();N();Object.defineProperty(A_,"__esModule",{value:!0});A_.valueFromAST=Mp;var j4=rn(),$4=Cr(),G4=Du(),Vl=Mt(),Rc=xt();function Mp(e,t,n){if(e){if(e.kind===Vl.Kind.VARIABLE){let r=e.name.value;if(n==null||n[r]===void 0)return;let i=n[r];return i===null&&(0,Rc.isNonNullType)(t)?void 0:i}if((0,Rc.isNonNullType)(t))return e.kind===Vl.Kind.NULL?void 0:Mp(e,t.ofType,n);if(e.kind===Vl.Kind.NULL)return null;if((0,Rc.isListType)(t)){let r=t.ofType;if(e.kind===Vl.Kind.LIST){let a=[];for(let o of e.values)if(Uw(o,n)){if((0,Rc.isNonNullType)(r))return;a.push(null)}else{let u=Mp(o,r,n);if(u===void 0)return;a.push(u)}return a}let i=Mp(e,r,n);return i===void 0?void 0:[i]}if((0,Rc.isInputObjectType)(t)){if(e.kind!==Vl.Kind.OBJECT)return;let r=Object.create(null),i=(0,G4.keyMap)(e.fields,a=>a.name.value);for(let a of Object.values(t.getFields())){let o=i[a.name];if(!o||Uw(o.value,n)){if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if((0,Rc.isNonNullType)(a.type))return;continue}let u=Mp(o.value,a.type,n);if(u===void 0)return;r[a.name]=u}if(t.isOneOf){let a=Object.keys(r);if(a.length!==1||r[a[0]]===null)return}return r}if((0,Rc.isLeafType)(t)){let r;try{r=t.parseLiteral(e,n)}catch(i){return}return r===void 0?void 0:r}(0,$4.invariant)(!1,"Unexpected input type: "+(0,j4.inspect)(t))}}function Uw(e,t){return e.kind===Vl.Kind.VARIABLE&&(t==null||t[e.name.value]===void 0)}});var $l=F(qp=>{"use strict";m();T();N();Object.defineProperty(qp,"__esModule",{value:!0});qp.getArgumentValues=xw;qp.getDirectiveValues=X4;qp.getVariableValues=z4;var Kl=rn(),Q4=Du(),Y4=O_(),Fs=tt(),Bw=Mt(),kw=_i(),jl=xt(),J4=b_(),H4=Ya(),Mw=xp();function z4(e,t,n,r){let i=[],a=r==null?void 0:r.maxErrors;try{let o=W4(e,t,n,u=>{if(a!=null&&i.length>=a)throw new Fs.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");i.push(u)});if(i.length===0)return{coerced:o}}catch(o){i.push(o)}return{errors:i}}function W4(e,t,n,r){let i={};for(let a of t){let o=a.variable.name.value,u=(0,H4.typeFromAST)(e,a.type);if(!(0,jl.isInputType)(u)){let d=(0,kw.print)(a.type);r(new Fs.GraphQLError(`Variable "$${o}" expected value of type "${d}" which cannot be used as an input type.`,{nodes:a.type}));continue}if(!qw(n,o)){if(a.defaultValue)i[o]=(0,Mw.valueFromAST)(a.defaultValue,u);else if((0,jl.isNonNullType)(u)){let d=(0,Kl.inspect)(u);r(new Fs.GraphQLError(`Variable "$${o}" of required type "${d}" was not provided.`,{nodes:a}))}continue}let l=n[o];if(l===null&&(0,jl.isNonNullType)(u)){let d=(0,Kl.inspect)(u);r(new Fs.GraphQLError(`Variable "$${o}" of non-null type "${d}" must not be null.`,{nodes:a}));continue}i[o]=(0,J4.coerceInputValue)(l,u,(d,p,E)=>{let h=`Variable "$${o}" got invalid value `+(0,Kl.inspect)(p);d.length>0&&(h+=` at "${o}${(0,Y4.printPathArray)(d)}"`),r(new Fs.GraphQLError(h+"; "+E.message,{nodes:a,originalError:E}))})}return i}function xw(e,t,n){var r;let i={},a=(r=t.arguments)!==null&&r!==void 0?r:[],o=(0,Q4.keyMap)(a,u=>u.name.value);for(let u of e.args){let l=u.name,d=u.type,p=o[l];if(!p){if(u.defaultValue!==void 0)i[l]=u.defaultValue;else if((0,jl.isNonNullType)(d))throw new Fs.GraphQLError(`Argument "${l}" of required type "${(0,Kl.inspect)(d)}" was not provided.`,{nodes:t});continue}let E=p.value,h=E.kind===Bw.Kind.NULL;if(E.kind===Bw.Kind.VARIABLE){let S=E.name.value;if(n==null||!qw(n,S)){if(u.defaultValue!==void 0)i[l]=u.defaultValue;else if((0,jl.isNonNullType)(d))throw new Fs.GraphQLError(`Argument "${l}" of required type "${(0,Kl.inspect)(d)}" was provided the variable "$${S}" which was not provided a runtime value.`,{nodes:E});continue}h=n[S]==null}if(h&&(0,jl.isNonNullType)(d))throw new Fs.GraphQLError(`Argument "${l}" of non-null type "${(0,Kl.inspect)(d)}" must not be null.`,{nodes:E});let _=(0,Mw.valueFromAST)(E,d,n);if(_===void 0)throw new Fs.GraphQLError(`Argument "${l}" has invalid value ${(0,kw.print)(E)}.`,{nodes:E});i[l]=_}return i}function X4(e,t,n){var r;let i=(r=t.directives)===null||r===void 0?void 0:r.find(a=>a.name.value===e.name);if(i)return xw(e,i,n)}function qw(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var dT=F(lT=>{"use strict";m();T();N();Object.defineProperty(lT,"__esModule",{value:!0});lT.collectFields=t8;lT.collectSubfields=n8;var R_=Mt(),Z4=xt(),Vw=si(),e8=Ya(),Kw=$l();function t8(e,t,n,r,i){let a=new Map;return cT(e,t,n,r,i,a,new Set),a}function n8(e,t,n,r,i){let a=new Map,o=new Set;for(let u of i)u.selectionSet&&cT(e,t,n,r,u.selectionSet,a,o);return a}function cT(e,t,n,r,i,a,o){for(let u of i.selections)switch(u.kind){case R_.Kind.FIELD:{if(!P_(n,u))continue;let l=r8(u),d=a.get(l);d!==void 0?d.push(u):a.set(l,[u]);break}case R_.Kind.INLINE_FRAGMENT:{if(!P_(n,u)||!jw(e,u,r))continue;cT(e,t,n,r,u.selectionSet,a,o);break}case R_.Kind.FRAGMENT_SPREAD:{let l=u.name.value;if(o.has(l)||!P_(n,u))continue;o.add(l);let d=t[l];if(!d||!jw(e,d,r))continue;cT(e,t,n,r,d.selectionSet,a,o);break}}}function P_(e,t){let n=(0,Kw.getDirectiveValues)(Vw.GraphQLSkipDirective,t,e);if((n==null?void 0:n.if)===!0)return!1;let r=(0,Kw.getDirectiveValues)(Vw.GraphQLIncludeDirective,t,e);return(r==null?void 0:r.if)!==!1}function jw(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=(0,e8.typeFromAST)(e,r);return i===n?!0:(0,Z4.isAbstractType)(i)?e.isSubType(i,n):!1}function r8(e){return e.alias?e.alias.value:e.name.value}});var L_=F(F_=>{"use strict";m();T();N();Object.defineProperty(F_,"__esModule",{value:!0});F_.SingleFieldSubscriptionsRule=s8;var $w=tt(),i8=Mt(),a8=dT();function s8(e){return{OperationDefinition(t){if(t.operation==="subscription"){let n=e.getSchema(),r=n.getSubscriptionType();if(r){let i=t.name?t.name.value:null,a=Object.create(null),o=e.getDocument(),u=Object.create(null);for(let d of o.definitions)d.kind===i8.Kind.FRAGMENT_DEFINITION&&(u[d.name.value]=d);let l=(0,a8.collectFields)(n,u,a,r,t.selectionSet);if(l.size>1){let E=[...l.values()].slice(1).flat();e.reportError(new $w.GraphQLError(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:E}))}for(let d of l.values())d[0].name.value.startsWith("__")&&e.reportError(new $w.GraphQLError(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:d}))}}}}}});var pT=F(w_=>{"use strict";m();T();N();Object.defineProperty(w_,"__esModule",{value:!0});w_.groupBy=o8;function o8(e,t){let n=new Map;for(let r of e){let i=t(r),a=n.get(i);a===void 0?n.set(i,[r]):a.push(r)}return n}});var U_=F(C_=>{"use strict";m();T();N();Object.defineProperty(C_,"__esModule",{value:!0});C_.UniqueArgumentDefinitionNamesRule=l8;var u8=pT(),c8=tt();function l8(e){return{DirectiveDefinition(r){var i;let a=(i=r.arguments)!==null&&i!==void 0?i:[];return n(`@${r.name.value}`,a)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(r){var i;let a=r.name.value,o=(i=r.fields)!==null&&i!==void 0?i:[];for(let l of o){var u;let d=l.name.value,p=(u=l.arguments)!==null&&u!==void 0?u:[];n(`${a}.${d}`,p)}return!1}function n(r,i){let a=(0,u8.groupBy)(i,o=>o.name.value);for(let[o,u]of a)u.length>1&&e.reportError(new c8.GraphQLError(`Argument "${r}(${o}:)" can only be defined once.`,{nodes:u.map(l=>l.name)}));return!1}}});var k_=F(B_=>{"use strict";m();T();N();Object.defineProperty(B_,"__esModule",{value:!0});B_.UniqueArgumentNamesRule=f8;var d8=pT(),p8=tt();function f8(e){return{Field:t,Directive:t};function t(n){var r;let i=(r=n.arguments)!==null&&r!==void 0?r:[],a=(0,d8.groupBy)(i,o=>o.name.value);for(let[o,u]of a)u.length>1&&e.reportError(new p8.GraphQLError(`There can be only one argument named "${o}".`,{nodes:u.map(l=>l.name)}))}}});var x_=F(M_=>{"use strict";m();T();N();Object.defineProperty(M_,"__esModule",{value:!0});M_.UniqueDirectiveNamesRule=m8;var Gw=tt();function m8(e){let t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;if(n!=null&&n.getDirective(i)){e.reportError(new Gw.GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return t[i]?e.reportError(new Gw.GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1}}}});var K_=F(V_=>{"use strict";m();T();N();Object.defineProperty(V_,"__esModule",{value:!0});V_.UniqueDirectivesPerLocationRule=E8;var N8=tt(),q_=Mt(),Qw=Ac(),T8=si();function E8(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():T8.specifiedDirectives;for(let u of r)t[u.name]=!u.isRepeatable;let i=e.getDocument().definitions;for(let u of i)u.kind===q_.Kind.DIRECTIVE_DEFINITION&&(t[u.name.value]=!u.repeatable);let a=Object.create(null),o=Object.create(null);return{enter(u){if(!("directives"in u)||!u.directives)return;let l;if(u.kind===q_.Kind.SCHEMA_DEFINITION||u.kind===q_.Kind.SCHEMA_EXTENSION)l=a;else if((0,Qw.isTypeDefinitionNode)(u)||(0,Qw.isTypeExtensionNode)(u)){let d=u.name.value;l=o[d],l===void 0&&(o[d]=l=Object.create(null))}else l=Object.create(null);for(let d of u.directives){let p=d.name.value;t[p]&&(l[p]?e.reportError(new N8.GraphQLError(`The directive "@${p}" can only be used once at this location.`,{nodes:[l[p],d]})):l[p]=d)}}}}});var $_=F(j_=>{"use strict";m();T();N();Object.defineProperty(j_,"__esModule",{value:!0});j_.UniqueEnumValueNamesRule=y8;var Yw=tt(),h8=xt();function y8(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(a){var o;let u=a.name.value;r[u]||(r[u]=Object.create(null));let l=(o=a.values)!==null&&o!==void 0?o:[],d=r[u];for(let p of l){let E=p.name.value,h=n[u];(0,h8.isEnumType)(h)&&h.getValue(E)?e.reportError(new Yw.GraphQLError(`Enum value "${u}.${E}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:p.name})):d[E]?e.reportError(new Yw.GraphQLError(`Enum value "${u}.${E}" can only be defined once.`,{nodes:[d[E],p.name]})):d[E]=p.name}return!1}}});var Y_=F(Q_=>{"use strict";m();T();N();Object.defineProperty(Q_,"__esModule",{value:!0});Q_.UniqueFieldDefinitionNamesRule=I8;var Jw=tt(),G_=xt();function I8(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(a){var o;let u=a.name.value;r[u]||(r[u]=Object.create(null));let l=(o=a.fields)!==null&&o!==void 0?o:[],d=r[u];for(let p of l){let E=p.name.value;g8(n[u],E)?e.reportError(new Jw.GraphQLError(`Field "${u}.${E}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:p.name})):d[E]?e.reportError(new Jw.GraphQLError(`Field "${u}.${E}" can only be defined once.`,{nodes:[d[E],p.name]})):d[E]=p.name}return!1}}function g8(e,t){return(0,G_.isObjectType)(e)||(0,G_.isInterfaceType)(e)||(0,G_.isInputObjectType)(e)?e.getFields()[t]!=null:!1}});var H_=F(J_=>{"use strict";m();T();N();Object.defineProperty(J_,"__esModule",{value:!0});J_.UniqueFragmentNamesRule=v8;var _8=tt();function v8(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){let r=n.name.value;return t[r]?e.reportError(new _8.GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,!1}}}});var W_=F(z_=>{"use strict";m();T();N();Object.defineProperty(z_,"__esModule",{value:!0});z_.UniqueInputFieldNamesRule=D8;var S8=Cr(),O8=tt();function D8(e){let t=[],n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){let r=t.pop();r||(0,S8.invariant)(!1),n=r}},ObjectField(r){let i=r.name.value;n[i]?e.reportError(new O8.GraphQLError(`There can be only one input field named "${i}".`,{nodes:[n[i],r.name]})):n[i]=r.name}}}});var Z_=F(X_=>{"use strict";m();T();N();Object.defineProperty(X_,"__esModule",{value:!0});X_.UniqueOperationNamesRule=A8;var b8=tt();function A8(e){let t=Object.create(null);return{OperationDefinition(n){let r=n.name;return r&&(t[r.value]?e.reportError(new b8.GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}}});var tv=F(ev=>{"use strict";m();T();N();Object.defineProperty(ev,"__esModule",{value:!0});ev.UniqueOperationTypesRule=R8;var Hw=tt();function R8(e){let t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(a){var o;let u=(o=a.operationTypes)!==null&&o!==void 0?o:[];for(let l of u){let d=l.operation,p=n[d];r[d]?e.reportError(new Hw.GraphQLError(`Type for ${d} already defined in the schema. It cannot be redefined.`,{nodes:l})):p?e.reportError(new Hw.GraphQLError(`There can be only one ${d} type in schema.`,{nodes:[p,l]})):n[d]=l}return!1}}});var rv=F(nv=>{"use strict";m();T();N();Object.defineProperty(nv,"__esModule",{value:!0});nv.UniqueTypeNamesRule=P8;var zw=tt();function P8(e){let t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(i){let a=i.name.value;if(n!=null&&n.getType(a)){e.reportError(new zw.GraphQLError(`Type "${a}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return t[a]?e.reportError(new zw.GraphQLError(`There can be only one type named "${a}".`,{nodes:[t[a],i.name]})):t[a]=i.name,!1}}});var av=F(iv=>{"use strict";m();T();N();Object.defineProperty(iv,"__esModule",{value:!0});iv.UniqueVariableNamesRule=w8;var F8=pT(),L8=tt();function w8(e){return{OperationDefinition(t){var n;let r=(n=t.variableDefinitions)!==null&&n!==void 0?n:[],i=(0,F8.groupBy)(r,a=>a.variable.name.value);for(let[a,o]of i)o.length>1&&e.reportError(new L8.GraphQLError(`There can be only one variable named "$${a}".`,{nodes:o.map(u=>u.variable.name)}))}}}});var uv=F(ov=>{"use strict";m();T();N();Object.defineProperty(ov,"__esModule",{value:!0});ov.ValuesOfCorrectTypeRule=k8;var C8=Ou(),Vp=rn(),U8=Du(),B8=bu(),Ha=tt(),sv=Mt(),fT=_i(),Ja=xt();function k8(e){let t={};return{OperationDefinition:{enter(){t={}}},VariableDefinition(n){t[n.variable.name.value]=n},ListValue(n){let r=(0,Ja.getNullableType)(e.getParentInputType());if(!(0,Ja.isListType)(r))return Pc(e,n),!1},ObjectValue(n){let r=(0,Ja.getNamedType)(e.getInputType());if(!(0,Ja.isInputObjectType)(r))return Pc(e,n),!1;let i=(0,U8.keyMap)(n.fields,a=>a.name.value);for(let a of Object.values(r.getFields()))if(!i[a.name]&&(0,Ja.isRequiredInputField)(a)){let u=(0,Vp.inspect)(a.type);e.reportError(new Ha.GraphQLError(`Field "${r.name}.${a.name}" of required type "${u}" was not provided.`,{nodes:n}))}r.isOneOf&&M8(e,n,r,i,t)},ObjectField(n){let r=(0,Ja.getNamedType)(e.getParentInputType());if(!e.getInputType()&&(0,Ja.isInputObjectType)(r)){let a=(0,B8.suggestionList)(n.name.value,Object.keys(r.getFields()));e.reportError(new Ha.GraphQLError(`Field "${n.name.value}" is not defined by type "${r.name}".`+(0,C8.didYouMean)(a),{nodes:n}))}},NullValue(n){let r=e.getInputType();(0,Ja.isNonNullType)(r)&&e.reportError(new Ha.GraphQLError(`Expected value of type "${(0,Vp.inspect)(r)}", found ${(0,fT.print)(n)}.`,{nodes:n}))},EnumValue:n=>Pc(e,n),IntValue:n=>Pc(e,n),FloatValue:n=>Pc(e,n),StringValue:n=>Pc(e,n),BooleanValue:n=>Pc(e,n)}}function Pc(e,t){let n=e.getInputType();if(!n)return;let r=(0,Ja.getNamedType)(n);if(!(0,Ja.isLeafType)(r)){let i=(0,Vp.inspect)(n);e.reportError(new Ha.GraphQLError(`Expected value of type "${i}", found ${(0,fT.print)(t)}.`,{nodes:t}));return}try{if(r.parseLiteral(t,void 0)===void 0){let a=(0,Vp.inspect)(n);e.reportError(new Ha.GraphQLError(`Expected value of type "${a}", found ${(0,fT.print)(t)}.`,{nodes:t}))}}catch(i){let a=(0,Vp.inspect)(n);i instanceof Ha.GraphQLError?e.reportError(i):e.reportError(new Ha.GraphQLError(`Expected value of type "${a}", found ${(0,fT.print)(t)}; `+i.message,{nodes:t,originalError:i}))}}function M8(e,t,n,r,i){var a;let o=Object.keys(r);if(o.length!==1){e.reportError(new Ha.GraphQLError(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[t]}));return}let l=(a=r[o[0]])===null||a===void 0?void 0:a.value,d=!l||l.kind===sv.Kind.NULL,p=(l==null?void 0:l.kind)===sv.Kind.VARIABLE;if(d){e.reportError(new Ha.GraphQLError(`Field "${n.name}.${o[0]}" must be non-null.`,{nodes:[t]}));return}if(p){let E=l.name.value;i[E].type.kind!==sv.Kind.NON_NULL_TYPE&&e.reportError(new Ha.GraphQLError(`Variable "${E}" must be non-nullable to be used for OneOf Input Object "${n.name}".`,{nodes:[t]}))}}});var lv=F(cv=>{"use strict";m();T();N();Object.defineProperty(cv,"__esModule",{value:!0});cv.VariablesAreInputTypesRule=j8;var x8=tt(),q8=_i(),V8=xt(),K8=Ya();function j8(e){return{VariableDefinition(t){let n=(0,K8.typeFromAST)(e.getSchema(),t.type);if(n!==void 0&&!(0,V8.isInputType)(n)){let r=t.variable.name.value,i=(0,q8.print)(t.type);e.reportError(new x8.GraphQLError(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}});var pv=F(dv=>{"use strict";m();T();N();Object.defineProperty(dv,"__esModule",{value:!0});dv.VariablesInAllowedPositionRule=Y8;var Ww=rn(),$8=tt(),G8=Mt(),Xw=xt(),Zw=_p(),Q8=Ya();function Y8(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i,type:a,defaultValue:o}of r){let u=i.name.value,l=t[u];if(l&&a){let d=e.getSchema(),p=(0,Q8.typeFromAST)(d,l.type);if(p&&!J8(d,p,l.defaultValue,a,o)){let E=(0,Ww.inspect)(p),h=(0,Ww.inspect)(a);e.reportError(new $8.GraphQLError(`Variable "$${u}" of type "${E}" used in position expecting type "${h}".`,{nodes:[l,i]}))}}}}},VariableDefinition(n){t[n.variable.name.value]=n}}}function J8(e,t,n,r,i){if((0,Xw.isNonNullType)(r)&&!(0,Xw.isNonNullType)(t)){if(!(n!=null&&n.kind!==G8.Kind.NULL)&&!(i!==void 0))return!1;let u=r.ofType;return(0,Zw.isTypeSubTypeOf)(e,t,u)}return(0,Zw.isTypeSubTypeOf)(e,t,r)}});var fv=F(Fu=>{"use strict";m();T();N();Object.defineProperty(Fu,"__esModule",{value:!0});Fu.specifiedSDLRules=Fu.specifiedRules=Fu.recommendedRules=void 0;var H8=Pg(),z8=Lg(),W8=Cg(),eC=Ug(),tC=xg(),X8=Vg(),nC=$g(),Z8=Qg(),eX=Jg(),tX=zg(),nX=Xg(),rX=e_(),iX=n_(),aX=i_(),sX=m_(),oX=E_(),uX=y_(),rC=g_(),cX=v_(),lX=L_(),dX=U_(),iC=k_(),pX=x_(),aC=K_(),fX=$_(),mX=Y_(),NX=H_(),sC=W_(),TX=Z_(),EX=tv(),hX=rv(),yX=av(),IX=uv(),gX=lv(),_X=pv(),oC=Object.freeze([tX.MaxIntrospectionDepthRule]);Fu.recommendedRules=oC;var vX=Object.freeze([H8.ExecutableDefinitionsRule,TX.UniqueOperationNamesRule,Z8.LoneAnonymousOperationRule,lX.SingleFieldSubscriptionsRule,nC.KnownTypeNamesRule,W8.FragmentsOnCompositeTypesRule,gX.VariablesAreInputTypesRule,cX.ScalarLeafsRule,z8.FieldsOnCorrectTypeRule,NX.UniqueFragmentNamesRule,X8.KnownFragmentNamesRule,iX.NoUnusedFragmentsRule,oX.PossibleFragmentSpreadsRule,nX.NoFragmentCyclesRule,yX.UniqueVariableNamesRule,rX.NoUndefinedVariablesRule,aX.NoUnusedVariablesRule,tC.KnownDirectivesRule,aC.UniqueDirectivesPerLocationRule,eC.KnownArgumentNamesRule,iC.UniqueArgumentNamesRule,IX.ValuesOfCorrectTypeRule,rC.ProvidedRequiredArgumentsRule,_X.VariablesInAllowedPositionRule,sX.OverlappingFieldsCanBeMergedRule,sC.UniqueInputFieldNamesRule,...oC]);Fu.specifiedRules=vX;var SX=Object.freeze([eX.LoneSchemaDefinitionRule,EX.UniqueOperationTypesRule,hX.UniqueTypeNamesRule,fX.UniqueEnumValueNamesRule,mX.UniqueFieldDefinitionNamesRule,dX.UniqueArgumentDefinitionNamesRule,pX.UniqueDirectiveNamesRule,nC.KnownTypeNamesRule,tC.KnownDirectivesRule,aC.UniqueDirectivesPerLocationRule,uX.PossibleTypeExtensionsRule,eC.KnownArgumentNamesOnDirectivesRule,iC.UniqueArgumentNamesRule,sC.UniqueInputFieldNamesRule,rC.ProvidedRequiredArgumentsOnDirectivesRule]);Fu.specifiedSDLRules=SX});var Tv=F(Lu=>{"use strict";m();T();N();Object.defineProperty(Lu,"__esModule",{value:!0});Lu.ValidationContext=Lu.SDLValidationContext=Lu.ASTValidationContext=void 0;var uC=Mt(),OX=Ic(),cC=eT(),Kp=class{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(let r of this.getDocument().definitions)r.kind===uC.Kind.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let r=[t],i;for(;i=r.pop();)for(let a of i.selections)a.kind===uC.Kind.FRAGMENT_SPREAD?n.push(a):a.selectionSet&&r.push(a.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let r=Object.create(null),i=[t.selectionSet],a;for(;a=i.pop();)for(let o of this.getFragmentSpreads(a)){let u=o.name.value;if(r[u]!==!0){r[u]=!0;let l=this.getFragment(u);l&&(n.push(l),i.push(l.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}};Lu.ASTValidationContext=Kp;var mv=class extends Kp{constructor(t,n,r){super(t,r),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}};Lu.SDLValidationContext=mv;var Nv=class extends Kp{constructor(t,n,r,i){super(n,i),this._schema=t,this._typeInfo=r,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let n=this._variableUsages.get(t);if(!n){let r=[],i=new cC.TypeInfo(this._schema);(0,OX.visit)(t,(0,cC.visitWithTypeInfo)(i,{VariableDefinition:()=>!1,Variable(a){r.push({node:a,type:i.getInputType(),defaultValue:i.getDefaultValue()})}})),n=r,this._variableUsages.set(t,n)}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(let r of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(r));this._recursiveVariableUsages.set(t,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}};Lu.ValidationContext=Nv});var Ql=F(Gl=>{"use strict";m();T();N();Object.defineProperty(Gl,"__esModule",{value:!0});Gl.assertValidSDL=PX;Gl.assertValidSDLExtension=FX;Gl.validate=RX;Gl.validateSDL=Ev;var DX=Yr(),bX=tt(),mT=Ic(),AX=Lp(),lC=eT(),dC=fv(),pC=Tv();function RX(e,t,n=dC.specifiedRules,r,i=new lC.TypeInfo(e)){var a;let o=(a=r==null?void 0:r.maxErrors)!==null&&a!==void 0?a:100;t||(0,DX.devAssert)(!1,"Must provide document."),(0,AX.assertValidSchema)(e);let u=Object.freeze({}),l=[],d=new pC.ValidationContext(e,t,i,E=>{if(l.length>=o)throw l.push(new bX.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),u;l.push(E)}),p=(0,mT.visitInParallel)(n.map(E=>E(d)));try{(0,mT.visit)(t,(0,lC.visitWithTypeInfo)(i,p))}catch(E){if(E!==u)throw E}return l}function Ev(e,t,n=dC.specifiedSDLRules){let r=[],i=new pC.SDLValidationContext(e,t,o=>{r.push(o)}),a=n.map(o=>o(i));return(0,mT.visit)(e,(0,mT.visitInParallel)(a)),r}function PX(e){let t=Ev(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` -`))}function EX(e,t){let n=rv(e,t);if(n.length!==0)throw new Error(n.map(r=>r.message).join(` +`))}function FX(e,t){let n=Ev(e,t);if(n.length!==0)throw new Error(n.map(r=>r.message).join(` -`))}});var HL=F(iv=>{"use strict";m();T();N();Object.defineProperty(iv,"__esModule",{value:!0});iv.memoize3=hX;function hX(e){let t;return function(r,i,a){t===void 0&&(t=new WeakMap);let o=t.get(r);o===void 0&&(o=new WeakMap,t.set(r,o));let u=o.get(i);u===void 0&&(u=new WeakMap,o.set(i,u));let l=u.get(a);return l===void 0&&(l=e(r,i,a),u.set(a,l)),l}}});var WL=F(av=>{"use strict";m();T();N();Object.defineProperty(av,"__esModule",{value:!0});av.promiseForObject=yX;function yX(e){return Promise.all(Object.values(e)).then(t=>{let n=Object.create(null);for(let[r,i]of Object.keys(e).entries())n[i]=t[r];return n})}});var XL=F(sv=>{"use strict";m();T();N();Object.defineProperty(sv,"__esModule",{value:!0});sv.promiseReduce=gX;var IX=nN();function gX(e,t,n){let r=n;for(let i of e)r=(0,IX.isPromise)(r)?r.then(a=>t(a,i)):t(r,i);return r}});var ZL=F(uv=>{"use strict";m();T();N();Object.defineProperty(uv,"__esModule",{value:!0});uv.toError=vX;var _X=nn();function vX(e){return e instanceof Error?e:new ov(e)}var ov=class extends Error{constructor(t){super("Unexpected error value: "+(0,_X.inspect)(t)),this.name="NonErrorThrown",this.thrownValue=t}}});var tT=F(cv=>{"use strict";m();T();N();Object.defineProperty(cv,"__esModule",{value:!0});cv.locatedError=DX;var SX=ZL(),OX=Ze();function DX(e,t,n){var r;let i=(0,SX.toError)(e);return bX(i)?i:new OX.GraphQLError(i.message,{nodes:(r=i.nodes)!==null&&r!==void 0?r:t,source:i.source,positions:i.positions,path:n,originalError:i})}function bX(e){return Array.isArray(e.path)}});var kf=F(ji=>{"use strict";m();T();N();Object.defineProperty(ji,"__esModule",{value:!0});ji.assertValidExecutionArguments=oC;ji.buildExecutionContext=uC;ji.buildResolveInfo=lC;ji.defaultTypeResolver=ji.defaultFieldResolver=void 0;ji.execute=sC;ji.executeSync=CX;ji.getFieldDef=fC;var dv=$r(),vc=nn(),AX=Fr(),RX=BN(),mv=Va(),Ta=nN(),PX=HL(),Sc=Af(),eC=WL(),FX=XL(),Vi=Ze(),rT=tT(),lv=ja(),tC=Ut(),Du=Bt(),Ml=xi(),wX=Of(),iC=WN(),aC=Ul(),LX=(0,PX.memoize3)((e,t,n)=>(0,iC.collectSubfields)(e.schema,e.fragments,e.variableValues,t,n));function sC(e){arguments.length<2||(0,dv.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,document:n,variableValues:r,rootValue:i}=e;oC(t,n,r);let a=uC(e);if(!("schema"in a))return{errors:a};try{let{operation:o}=a,u=UX(a,o,i);return(0,Ta.isPromise)(u)?u.then(l=>nT(l,a.errors),l=>(a.errors.push(l),nT(null,a.errors))):nT(u,a.errors)}catch(o){return a.errors.push(o),nT(null,a.errors)}}function CX(e){let t=sC(e);if((0,Ta.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function nT(e,t){return t.length===0?{data:e}:{errors:t,data:e}}function oC(e,t,n){t||(0,dv.devAssert)(!1,"Must provide document."),(0,wX.assertValidSchema)(e),n==null||(0,mv.isObjectLike)(n)||(0,dv.devAssert)(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function uC(e){var t,n;let{schema:r,document:i,rootValue:a,contextValue:o,variableValues:u,operationName:l,fieldResolver:d,typeResolver:p,subscribeFieldResolver:E}=e,h,v=Object.create(null);for(let V of i.definitions)switch(V.kind){case tC.Kind.OPERATION_DEFINITION:if(l==null){if(h!==void 0)return[new Vi.GraphQLError("Must provide operation name if query contains multiple operations.")];h=V}else((t=V.name)===null||t===void 0?void 0:t.value)===l&&(h=V);break;case tC.Kind.FRAGMENT_DEFINITION:v[V.name.value]=V;break;default:}if(!h)return l!=null?[new Vi.GraphQLError(`Unknown operation named "${l}".`)]:[new Vi.GraphQLError("Must provide an operation.")];let A=(n=h.variableDefinitions)!==null&&n!==void 0?n:[],B=(0,aC.getVariableValues)(r,A,u!=null?u:{},{maxErrors:50});return B.errors?B.errors:{schema:r,fragments:v,rootValue:a,contextValue:o,operation:h,variableValues:B.coerced,fieldResolver:d!=null?d:pv,typeResolver:p!=null?p:dC,subscribeFieldResolver:E!=null?E:pv,errors:[]}}function UX(e,t,n){let r=e.schema.getRootType(t.operation);if(r==null)throw new Vi.GraphQLError(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let i=(0,iC.collectFields)(e.schema,e.fragments,e.variableValues,r,t.selectionSet),a=void 0;switch(t.operation){case lv.OperationTypeNode.QUERY:return iT(e,r,n,a,i);case lv.OperationTypeNode.MUTATION:return BX(e,r,n,a,i);case lv.OperationTypeNode.SUBSCRIPTION:return iT(e,r,n,a,i)}}function BX(e,t,n,r,i){return(0,FX.promiseReduce)(i.entries(),(a,[o,u])=>{let l=(0,Sc.addPath)(r,o,t.name),d=cC(e,t,n,u,l);return d===void 0?a:(0,Ta.isPromise)(d)?d.then(p=>(a[o]=p,a)):(a[o]=d,a)},Object.create(null))}function iT(e,t,n,r,i){let a=Object.create(null),o=!1;try{for(let[u,l]of i.entries()){let d=(0,Sc.addPath)(r,u,t.name),p=cC(e,t,n,l,d);p!==void 0&&(a[u]=p,(0,Ta.isPromise)(p)&&(o=!0))}}catch(u){if(o)return(0,eC.promiseForObject)(a).finally(()=>{throw u});throw u}return o?(0,eC.promiseForObject)(a):a}function cC(e,t,n,r,i){var a;let o=fC(e.schema,t,r[0]);if(!o)return;let u=o.type,l=(a=o.resolve)!==null&&a!==void 0?a:e.fieldResolver,d=lC(e,o,r,t,i);try{let p=(0,aC.getArgumentValues)(o,r[0],e.variableValues),E=e.contextValue,h=l(n,p,E,d),v;return(0,Ta.isPromise)(h)?v=h.then(A=>Bf(e,u,r,d,i,A)):v=Bf(e,u,r,d,i,h),(0,Ta.isPromise)(v)?v.then(void 0,A=>{let B=(0,rT.locatedError)(A,r,(0,Sc.pathToArray)(i));return aT(B,u,e)}):v}catch(p){let E=(0,rT.locatedError)(p,r,(0,Sc.pathToArray)(i));return aT(E,u,e)}}function lC(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function aT(e,t,n){if((0,Du.isNonNullType)(t))throw e;return n.errors.push(e),null}function Bf(e,t,n,r,i,a){if(a instanceof Error)throw a;if((0,Du.isNonNullType)(t)){let o=Bf(e,t.ofType,n,r,i,a);if(o===null)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return o}if(a==null)return null;if((0,Du.isListType)(t))return kX(e,t,n,r,i,a);if((0,Du.isLeafType)(t))return MX(t,a);if((0,Du.isAbstractType)(t))return xX(e,t,n,r,i,a);if((0,Du.isObjectType)(t))return fv(e,t,n,r,i,a);(0,AX.invariant)(!1,"Cannot complete value of unexpected output type: "+(0,vc.inspect)(t))}function kX(e,t,n,r,i,a){if(!(0,RX.isIterableObject)(a))throw new Vi.GraphQLError(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);let o=t.ofType,u=!1,l=Array.from(a,(d,p)=>{let E=(0,Sc.addPath)(i,p,void 0);try{let h;return(0,Ta.isPromise)(d)?h=d.then(v=>Bf(e,o,n,r,E,v)):h=Bf(e,o,n,r,E,d),(0,Ta.isPromise)(h)?(u=!0,h.then(void 0,v=>{let A=(0,rT.locatedError)(v,n,(0,Sc.pathToArray)(E));return aT(A,o,e)})):h}catch(h){let v=(0,rT.locatedError)(h,n,(0,Sc.pathToArray)(E));return aT(v,o,e)}});return u?Promise.all(l):l}function MX(e,t){let n=e.serialize(t);if(n==null)throw new Error(`Expected \`${(0,vc.inspect)(e)}.serialize(${(0,vc.inspect)(t)})\` to return non-nullable value, returned: ${(0,vc.inspect)(n)}`);return n}function xX(e,t,n,r,i,a){var o;let u=(o=t.resolveType)!==null&&o!==void 0?o:e.typeResolver,l=e.contextValue,d=u(a,l,r,t);return(0,Ta.isPromise)(d)?d.then(p=>fv(e,nC(p,e,t,n,r,a),n,r,i,a)):fv(e,nC(d,e,t,n,r,a),n,r,i,a)}function nC(e,t,n,r,i,a){if(e==null)throw new Vi.GraphQLError(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if((0,Du.isObjectType)(e))throw new Vi.GraphQLError("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if(typeof e!="string")throw new Vi.GraphQLError(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${(0,vc.inspect)(a)}, received "${(0,vc.inspect)(e)}".`);let o=t.schema.getType(e);if(o==null)throw new Vi.GraphQLError(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!(0,Du.isObjectType)(o))throw new Vi.GraphQLError(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,o))throw new Vi.GraphQLError(`Runtime Object type "${o.name}" is not a possible type for "${n.name}".`,{nodes:r});return o}function fv(e,t,n,r,i,a){let o=LX(e,t,n);if(t.isTypeOf){let u=t.isTypeOf(a,e.contextValue,r);if((0,Ta.isPromise)(u))return u.then(l=>{if(!l)throw rC(t,a,n);return iT(e,t,a,i,o)});if(!u)throw rC(t,a,n)}return iT(e,t,a,i,o)}function rC(e,t,n){return new Vi.GraphQLError(`Expected value of type "${e.name}" but got: ${(0,vc.inspect)(t)}.`,{nodes:n})}var dC=function(e,t,n,r){if((0,mv.isObjectLike)(e)&&typeof e.__typename=="string")return e.__typename;let i=n.schema.getPossibleTypes(r),a=[];for(let o=0;o{for(let u=0;u{"use strict";m();T();N();Object.defineProperty(sT,"__esModule",{value:!0});sT.graphql=QX;sT.graphqlSync=YX;var qX=$r(),VX=nN(),jX=Ol(),KX=Of(),$X=kl(),GX=kf();function QX(e){return new Promise(t=>t(pC(e)))}function YX(e){let t=pC(e);if((0,VX.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function pC(e){arguments.length<2||(0,qX.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,source:n,rootValue:r,contextValue:i,variableValues:a,operationName:o,fieldResolver:u,typeResolver:l}=e,d=(0,KX.validateSchema)(t);if(d.length>0)return{errors:d};let p;try{p=(0,jX.parse)(n)}catch(h){return{errors:[h]}}let E=(0,$X.validate)(t,p);return E.length>0?{errors:E}:(0,GX.execute)({schema:t,document:p,rootValue:r,contextValue:i,variableValues:a,operationName:o,fieldResolver:u,typeResolver:l})}});var EC=F(he=>{"use strict";m();T();N();Object.defineProperty(he,"__esModule",{value:!0});Object.defineProperty(he,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return Ea.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(he,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return ws.GRAPHQL_MAX_INT}});Object.defineProperty(he,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return ws.GRAPHQL_MIN_INT}});Object.defineProperty(he,"GraphQLBoolean",{enumerable:!0,get:function(){return ws.GraphQLBoolean}});Object.defineProperty(he,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return Ea.GraphQLDeprecatedDirective}});Object.defineProperty(he,"GraphQLDirective",{enumerable:!0,get:function(){return Ea.GraphQLDirective}});Object.defineProperty(he,"GraphQLEnumType",{enumerable:!0,get:function(){return at.GraphQLEnumType}});Object.defineProperty(he,"GraphQLFloat",{enumerable:!0,get:function(){return ws.GraphQLFloat}});Object.defineProperty(he,"GraphQLID",{enumerable:!0,get:function(){return ws.GraphQLID}});Object.defineProperty(he,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return Ea.GraphQLIncludeDirective}});Object.defineProperty(he,"GraphQLInputObjectType",{enumerable:!0,get:function(){return at.GraphQLInputObjectType}});Object.defineProperty(he,"GraphQLInt",{enumerable:!0,get:function(){return ws.GraphQLInt}});Object.defineProperty(he,"GraphQLInterfaceType",{enumerable:!0,get:function(){return at.GraphQLInterfaceType}});Object.defineProperty(he,"GraphQLList",{enumerable:!0,get:function(){return at.GraphQLList}});Object.defineProperty(he,"GraphQLNonNull",{enumerable:!0,get:function(){return at.GraphQLNonNull}});Object.defineProperty(he,"GraphQLObjectType",{enumerable:!0,get:function(){return at.GraphQLObjectType}});Object.defineProperty(he,"GraphQLOneOfDirective",{enumerable:!0,get:function(){return Ea.GraphQLOneOfDirective}});Object.defineProperty(he,"GraphQLScalarType",{enumerable:!0,get:function(){return at.GraphQLScalarType}});Object.defineProperty(he,"GraphQLSchema",{enumerable:!0,get:function(){return Nv.GraphQLSchema}});Object.defineProperty(he,"GraphQLSkipDirective",{enumerable:!0,get:function(){return Ea.GraphQLSkipDirective}});Object.defineProperty(he,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return Ea.GraphQLSpecifiedByDirective}});Object.defineProperty(he,"GraphQLString",{enumerable:!0,get:function(){return ws.GraphQLString}});Object.defineProperty(he,"GraphQLUnionType",{enumerable:!0,get:function(){return at.GraphQLUnionType}});Object.defineProperty(he,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return ii.SchemaMetaFieldDef}});Object.defineProperty(he,"TypeKind",{enumerable:!0,get:function(){return ii.TypeKind}});Object.defineProperty(he,"TypeMetaFieldDef",{enumerable:!0,get:function(){return ii.TypeMetaFieldDef}});Object.defineProperty(he,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return ii.TypeNameMetaFieldDef}});Object.defineProperty(he,"__Directive",{enumerable:!0,get:function(){return ii.__Directive}});Object.defineProperty(he,"__DirectiveLocation",{enumerable:!0,get:function(){return ii.__DirectiveLocation}});Object.defineProperty(he,"__EnumValue",{enumerable:!0,get:function(){return ii.__EnumValue}});Object.defineProperty(he,"__Field",{enumerable:!0,get:function(){return ii.__Field}});Object.defineProperty(he,"__InputValue",{enumerable:!0,get:function(){return ii.__InputValue}});Object.defineProperty(he,"__Schema",{enumerable:!0,get:function(){return ii.__Schema}});Object.defineProperty(he,"__Type",{enumerable:!0,get:function(){return ii.__Type}});Object.defineProperty(he,"__TypeKind",{enumerable:!0,get:function(){return ii.__TypeKind}});Object.defineProperty(he,"assertAbstractType",{enumerable:!0,get:function(){return at.assertAbstractType}});Object.defineProperty(he,"assertCompositeType",{enumerable:!0,get:function(){return at.assertCompositeType}});Object.defineProperty(he,"assertDirective",{enumerable:!0,get:function(){return Ea.assertDirective}});Object.defineProperty(he,"assertEnumType",{enumerable:!0,get:function(){return at.assertEnumType}});Object.defineProperty(he,"assertEnumValueName",{enumerable:!0,get:function(){return TC.assertEnumValueName}});Object.defineProperty(he,"assertInputObjectType",{enumerable:!0,get:function(){return at.assertInputObjectType}});Object.defineProperty(he,"assertInputType",{enumerable:!0,get:function(){return at.assertInputType}});Object.defineProperty(he,"assertInterfaceType",{enumerable:!0,get:function(){return at.assertInterfaceType}});Object.defineProperty(he,"assertLeafType",{enumerable:!0,get:function(){return at.assertLeafType}});Object.defineProperty(he,"assertListType",{enumerable:!0,get:function(){return at.assertListType}});Object.defineProperty(he,"assertName",{enumerable:!0,get:function(){return TC.assertName}});Object.defineProperty(he,"assertNamedType",{enumerable:!0,get:function(){return at.assertNamedType}});Object.defineProperty(he,"assertNonNullType",{enumerable:!0,get:function(){return at.assertNonNullType}});Object.defineProperty(he,"assertNullableType",{enumerable:!0,get:function(){return at.assertNullableType}});Object.defineProperty(he,"assertObjectType",{enumerable:!0,get:function(){return at.assertObjectType}});Object.defineProperty(he,"assertOutputType",{enumerable:!0,get:function(){return at.assertOutputType}});Object.defineProperty(he,"assertScalarType",{enumerable:!0,get:function(){return at.assertScalarType}});Object.defineProperty(he,"assertSchema",{enumerable:!0,get:function(){return Nv.assertSchema}});Object.defineProperty(he,"assertType",{enumerable:!0,get:function(){return at.assertType}});Object.defineProperty(he,"assertUnionType",{enumerable:!0,get:function(){return at.assertUnionType}});Object.defineProperty(he,"assertValidSchema",{enumerable:!0,get:function(){return NC.assertValidSchema}});Object.defineProperty(he,"assertWrappingType",{enumerable:!0,get:function(){return at.assertWrappingType}});Object.defineProperty(he,"getNamedType",{enumerable:!0,get:function(){return at.getNamedType}});Object.defineProperty(he,"getNullableType",{enumerable:!0,get:function(){return at.getNullableType}});Object.defineProperty(he,"introspectionTypes",{enumerable:!0,get:function(){return ii.introspectionTypes}});Object.defineProperty(he,"isAbstractType",{enumerable:!0,get:function(){return at.isAbstractType}});Object.defineProperty(he,"isCompositeType",{enumerable:!0,get:function(){return at.isCompositeType}});Object.defineProperty(he,"isDirective",{enumerable:!0,get:function(){return Ea.isDirective}});Object.defineProperty(he,"isEnumType",{enumerable:!0,get:function(){return at.isEnumType}});Object.defineProperty(he,"isInputObjectType",{enumerable:!0,get:function(){return at.isInputObjectType}});Object.defineProperty(he,"isInputType",{enumerable:!0,get:function(){return at.isInputType}});Object.defineProperty(he,"isInterfaceType",{enumerable:!0,get:function(){return at.isInterfaceType}});Object.defineProperty(he,"isIntrospectionType",{enumerable:!0,get:function(){return ii.isIntrospectionType}});Object.defineProperty(he,"isLeafType",{enumerable:!0,get:function(){return at.isLeafType}});Object.defineProperty(he,"isListType",{enumerable:!0,get:function(){return at.isListType}});Object.defineProperty(he,"isNamedType",{enumerable:!0,get:function(){return at.isNamedType}});Object.defineProperty(he,"isNonNullType",{enumerable:!0,get:function(){return at.isNonNullType}});Object.defineProperty(he,"isNullableType",{enumerable:!0,get:function(){return at.isNullableType}});Object.defineProperty(he,"isObjectType",{enumerable:!0,get:function(){return at.isObjectType}});Object.defineProperty(he,"isOutputType",{enumerable:!0,get:function(){return at.isOutputType}});Object.defineProperty(he,"isRequiredArgument",{enumerable:!0,get:function(){return at.isRequiredArgument}});Object.defineProperty(he,"isRequiredInputField",{enumerable:!0,get:function(){return at.isRequiredInputField}});Object.defineProperty(he,"isScalarType",{enumerable:!0,get:function(){return at.isScalarType}});Object.defineProperty(he,"isSchema",{enumerable:!0,get:function(){return Nv.isSchema}});Object.defineProperty(he,"isSpecifiedDirective",{enumerable:!0,get:function(){return Ea.isSpecifiedDirective}});Object.defineProperty(he,"isSpecifiedScalarType",{enumerable:!0,get:function(){return ws.isSpecifiedScalarType}});Object.defineProperty(he,"isType",{enumerable:!0,get:function(){return at.isType}});Object.defineProperty(he,"isUnionType",{enumerable:!0,get:function(){return at.isUnionType}});Object.defineProperty(he,"isWrappingType",{enumerable:!0,get:function(){return at.isWrappingType}});Object.defineProperty(he,"resolveObjMapThunk",{enumerable:!0,get:function(){return at.resolveObjMapThunk}});Object.defineProperty(he,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return at.resolveReadonlyArrayThunk}});Object.defineProperty(he,"specifiedDirectives",{enumerable:!0,get:function(){return Ea.specifiedDirectives}});Object.defineProperty(he,"specifiedScalarTypes",{enumerable:!0,get:function(){return ws.specifiedScalarTypes}});Object.defineProperty(he,"validateSchema",{enumerable:!0,get:function(){return NC.validateSchema}});var Nv=hc(),at=Bt(),Ea=ni(),ws=Ga(),ii=xi(),NC=Of(),TC=lf()});var yC=F(xt=>{"use strict";m();T();N();Object.defineProperty(xt,"__esModule",{value:!0});Object.defineProperty(xt,"BREAK",{enumerable:!0,get:function(){return Mf.BREAK}});Object.defineProperty(xt,"DirectiveLocation",{enumerable:!0,get:function(){return e5.DirectiveLocation}});Object.defineProperty(xt,"Kind",{enumerable:!0,get:function(){return HX.Kind}});Object.defineProperty(xt,"Lexer",{enumerable:!0,get:function(){return XX.Lexer}});Object.defineProperty(xt,"Location",{enumerable:!0,get:function(){return Tv.Location}});Object.defineProperty(xt,"OperationTypeNode",{enumerable:!0,get:function(){return Tv.OperationTypeNode}});Object.defineProperty(xt,"Source",{enumerable:!0,get:function(){return JX.Source}});Object.defineProperty(xt,"Token",{enumerable:!0,get:function(){return Tv.Token}});Object.defineProperty(xt,"TokenKind",{enumerable:!0,get:function(){return WX.TokenKind}});Object.defineProperty(xt,"getEnterLeaveForKind",{enumerable:!0,get:function(){return Mf.getEnterLeaveForKind}});Object.defineProperty(xt,"getLocation",{enumerable:!0,get:function(){return zX.getLocation}});Object.defineProperty(xt,"getVisitFn",{enumerable:!0,get:function(){return Mf.getVisitFn}});Object.defineProperty(xt,"isConstValueNode",{enumerable:!0,get:function(){return za.isConstValueNode}});Object.defineProperty(xt,"isDefinitionNode",{enumerable:!0,get:function(){return za.isDefinitionNode}});Object.defineProperty(xt,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return za.isExecutableDefinitionNode}});Object.defineProperty(xt,"isSelectionNode",{enumerable:!0,get:function(){return za.isSelectionNode}});Object.defineProperty(xt,"isTypeDefinitionNode",{enumerable:!0,get:function(){return za.isTypeDefinitionNode}});Object.defineProperty(xt,"isTypeExtensionNode",{enumerable:!0,get:function(){return za.isTypeExtensionNode}});Object.defineProperty(xt,"isTypeNode",{enumerable:!0,get:function(){return za.isTypeNode}});Object.defineProperty(xt,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return za.isTypeSystemDefinitionNode}});Object.defineProperty(xt,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return za.isTypeSystemExtensionNode}});Object.defineProperty(xt,"isValueNode",{enumerable:!0,get:function(){return za.isValueNode}});Object.defineProperty(xt,"parse",{enumerable:!0,get:function(){return oT.parse}});Object.defineProperty(xt,"parseConstValue",{enumerable:!0,get:function(){return oT.parseConstValue}});Object.defineProperty(xt,"parseType",{enumerable:!0,get:function(){return oT.parseType}});Object.defineProperty(xt,"parseValue",{enumerable:!0,get:function(){return oT.parseValue}});Object.defineProperty(xt,"print",{enumerable:!0,get:function(){return ZX.print}});Object.defineProperty(xt,"printLocation",{enumerable:!0,get:function(){return hC.printLocation}});Object.defineProperty(xt,"printSourceLocation",{enumerable:!0,get:function(){return hC.printSourceLocation}});Object.defineProperty(xt,"visit",{enumerable:!0,get:function(){return Mf.visit}});Object.defineProperty(xt,"visitInParallel",{enumerable:!0,get:function(){return Mf.visitInParallel}});var JX=fN(),zX=rN(),hC=fI(),HX=Ut(),WX=tf(),XX=uN(),oT=Ol(),ZX=yi(),Mf=fc(),Tv=ja(),za=Ic(),e5=vl()});var IC=F(Ev=>{"use strict";m();T();N();Object.defineProperty(Ev,"__esModule",{value:!0});Ev.isAsyncIterable=t5;function t5(e){return typeof(e==null?void 0:e[Symbol.asyncIterator])=="function"}});var gC=F(hv=>{"use strict";m();T();N();Object.defineProperty(hv,"__esModule",{value:!0});hv.mapAsyncIterator=n5;function n5(e,t){let n=e[Symbol.asyncIterator]();function r(a){return Ci(this,null,function*(){if(a.done)return a;try{return{value:yield t(a.value),done:!1}}catch(o){if(typeof n.return=="function")try{yield n.return()}catch(u){}throw o}})}return{next(){return Ci(this,null,function*(){return r(yield n.next())})},return(){return Ci(this,null,function*(){return typeof n.return=="function"?r(yield n.return()):{value:void 0,done:!0}})},throw(a){return Ci(this,null,function*(){if(typeof n.throw=="function")return r(yield n.throw(a));throw a})},[Symbol.asyncIterator](){return this}}}});var OC=F(uT=>{"use strict";m();T();N();Object.defineProperty(uT,"__esModule",{value:!0});uT.createSourceEventStream=SC;uT.subscribe=c5;var r5=$r(),i5=nn(),vC=IC(),_C=Af(),yv=Ze(),a5=tT(),s5=WN(),xf=kf(),o5=gC(),u5=Ul();function c5(t){return Ci(this,arguments,function*(e){arguments.length<2||(0,r5.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let n=yield SC(e);if(!(0,vC.isAsyncIterable)(n))return n;let r=i=>(0,xf.execute)($(M({},e),{rootValue:i}));return(0,o5.mapAsyncIterator)(n,r)})}function l5(e){let t=e[0];return t&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}function SC(...e){return Ci(this,null,function*(){let t=l5(e),{schema:n,document:r,variableValues:i}=t;(0,xf.assertValidExecutionArguments)(n,r,i);let a=(0,xf.buildExecutionContext)(t);if(!("schema"in a))return{errors:a};try{let o=yield d5(a);if(!(0,vC.isAsyncIterable)(o))throw new Error(`Subscription field must return Async Iterable. Received: ${(0,i5.inspect)(o)}.`);return o}catch(o){if(o instanceof yv.GraphQLError)return{errors:[o]};throw o}})}function d5(e){return Ci(this,null,function*(){let{schema:t,fragments:n,operation:r,variableValues:i,rootValue:a}=e,o=t.getSubscriptionType();if(o==null)throw new yv.GraphQLError("Schema is not configured to execute subscription operation.",{nodes:r});let u=(0,s5.collectFields)(t,n,i,o,r.selectionSet),[l,d]=[...u.entries()][0],p=(0,xf.getFieldDef)(t,o,d[0]);if(!p){let A=d[0].name.value;throw new yv.GraphQLError(`The subscription field "${A}" is not defined.`,{nodes:d})}let E=(0,_C.addPath)(void 0,l,o.name),h=(0,xf.buildResolveInfo)(e,p,d,o,E);try{var v;let A=(0,u5.getArgumentValues)(p,d[0],i),B=e.contextValue,J=yield((v=p.subscribe)!==null&&v!==void 0?v:e.subscribeFieldResolver)(a,A,B,h);if(J instanceof Error)throw J;return J}catch(A){throw(0,a5.locatedError)(A,d,(0,_C.pathToArray)(E))}})}});var bC=F(Ki=>{"use strict";m();T();N();Object.defineProperty(Ki,"__esModule",{value:!0});Object.defineProperty(Ki,"createSourceEventStream",{enumerable:!0,get:function(){return DC.createSourceEventStream}});Object.defineProperty(Ki,"defaultFieldResolver",{enumerable:!0,get:function(){return cT.defaultFieldResolver}});Object.defineProperty(Ki,"defaultTypeResolver",{enumerable:!0,get:function(){return cT.defaultTypeResolver}});Object.defineProperty(Ki,"execute",{enumerable:!0,get:function(){return cT.execute}});Object.defineProperty(Ki,"executeSync",{enumerable:!0,get:function(){return cT.executeSync}});Object.defineProperty(Ki,"getArgumentValues",{enumerable:!0,get:function(){return Iv.getArgumentValues}});Object.defineProperty(Ki,"getDirectiveValues",{enumerable:!0,get:function(){return Iv.getDirectiveValues}});Object.defineProperty(Ki,"getVariableValues",{enumerable:!0,get:function(){return Iv.getVariableValues}});Object.defineProperty(Ki,"responsePathAsArray",{enumerable:!0,get:function(){return f5.pathToArray}});Object.defineProperty(Ki,"subscribe",{enumerable:!0,get:function(){return DC.subscribe}});var f5=Af(),cT=kf(),DC=OC(),Iv=Ul()});var AC=F(vv=>{"use strict";m();T();N();Object.defineProperty(vv,"__esModule",{value:!0});vv.NoDeprecatedCustomRule=p5;var gv=Fr(),qf=Ze(),_v=Bt();function p5(e){return{Field(t){let n=e.getFieldDef(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){let i=e.getParentType();i!=null||(0,gv.invariant)(!1),e.reportError(new qf.GraphQLError(`The field ${i.name}.${n.name} is deprecated. ${r}`,{nodes:t}))}},Argument(t){let n=e.getArgument(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){let i=e.getDirective();if(i!=null)e.reportError(new qf.GraphQLError(`Directive "@${i.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}));else{let a=e.getParentType(),o=e.getFieldDef();a!=null&&o!=null||(0,gv.invariant)(!1),e.reportError(new qf.GraphQLError(`Field "${a.name}.${o.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}))}}},ObjectField(t){let n=(0,_v.getNamedType)(e.getParentInputType());if((0,_v.isInputObjectType)(n)){let r=n.getFields()[t.name.value],i=r==null?void 0:r.deprecationReason;i!=null&&e.reportError(new qf.GraphQLError(`The input field ${n.name}.${r.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){let n=e.getEnumValue(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){let i=(0,_v.getNamedType)(e.getInputType());i!=null||(0,gv.invariant)(!1),e.reportError(new qf.GraphQLError(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:t}))}}}}});var RC=F(Sv=>{"use strict";m();T();N();Object.defineProperty(Sv,"__esModule",{value:!0});Sv.NoSchemaIntrospectionCustomRule=E5;var m5=Ze(),N5=Bt(),T5=xi();function E5(e){return{Field(t){let n=(0,N5.getNamedType)(e.getType());n&&(0,T5.isIntrospectionType)(n)&&e.reportError(new m5.GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}});var FC=F(mt=>{"use strict";m();T();N();Object.defineProperty(mt,"__esModule",{value:!0});Object.defineProperty(mt,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return I5.ExecutableDefinitionsRule}});Object.defineProperty(mt,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return g5.FieldsOnCorrectTypeRule}});Object.defineProperty(mt,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return _5.FragmentsOnCompositeTypesRule}});Object.defineProperty(mt,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return v5.KnownArgumentNamesRule}});Object.defineProperty(mt,"KnownDirectivesRule",{enumerable:!0,get:function(){return S5.KnownDirectivesRule}});Object.defineProperty(mt,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return O5.KnownFragmentNamesRule}});Object.defineProperty(mt,"KnownTypeNamesRule",{enumerable:!0,get:function(){return D5.KnownTypeNamesRule}});Object.defineProperty(mt,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return b5.LoneAnonymousOperationRule}});Object.defineProperty(mt,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return Y5.LoneSchemaDefinitionRule}});Object.defineProperty(mt,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return Q5.MaxIntrospectionDepthRule}});Object.defineProperty(mt,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return t9.NoDeprecatedCustomRule}});Object.defineProperty(mt,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return A5.NoFragmentCyclesRule}});Object.defineProperty(mt,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return n9.NoSchemaIntrospectionCustomRule}});Object.defineProperty(mt,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return R5.NoUndefinedVariablesRule}});Object.defineProperty(mt,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return P5.NoUnusedFragmentsRule}});Object.defineProperty(mt,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return F5.NoUnusedVariablesRule}});Object.defineProperty(mt,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return w5.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(mt,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return L5.PossibleFragmentSpreadsRule}});Object.defineProperty(mt,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return e9.PossibleTypeExtensionsRule}});Object.defineProperty(mt,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return C5.ProvidedRequiredArgumentsRule}});Object.defineProperty(mt,"ScalarLeafsRule",{enumerable:!0,get:function(){return U5.ScalarLeafsRule}});Object.defineProperty(mt,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return B5.SingleFieldSubscriptionsRule}});Object.defineProperty(mt,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return X5.UniqueArgumentDefinitionNamesRule}});Object.defineProperty(mt,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return k5.UniqueArgumentNamesRule}});Object.defineProperty(mt,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return Z5.UniqueDirectiveNamesRule}});Object.defineProperty(mt,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return M5.UniqueDirectivesPerLocationRule}});Object.defineProperty(mt,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return H5.UniqueEnumValueNamesRule}});Object.defineProperty(mt,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return W5.UniqueFieldDefinitionNamesRule}});Object.defineProperty(mt,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return x5.UniqueFragmentNamesRule}});Object.defineProperty(mt,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return q5.UniqueInputFieldNamesRule}});Object.defineProperty(mt,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return V5.UniqueOperationNamesRule}});Object.defineProperty(mt,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return J5.UniqueOperationTypesRule}});Object.defineProperty(mt,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return z5.UniqueTypeNamesRule}});Object.defineProperty(mt,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return j5.UniqueVariableNamesRule}});Object.defineProperty(mt,"ValidationContext",{enumerable:!0,get:function(){return y5.ValidationContext}});Object.defineProperty(mt,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return K5.ValuesOfCorrectTypeRule}});Object.defineProperty(mt,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return $5.VariablesAreInputTypesRule}});Object.defineProperty(mt,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return G5.VariablesInAllowedPositionRule}});Object.defineProperty(mt,"recommendedRules",{enumerable:!0,get:function(){return PC.recommendedRules}});Object.defineProperty(mt,"specifiedRules",{enumerable:!0,get:function(){return PC.specifiedRules}});Object.defineProperty(mt,"validate",{enumerable:!0,get:function(){return h5.validate}});var h5=kl(),y5=nv(),PC=Z_(),I5=Tg(),g5=hg(),_5=Ig(),v5=gg(),S5=Og(),O5=bg(),D5=Pg(),b5=wg(),A5=Mg(),R5=qg(),P5=jg(),F5=$g(),w5=e_(),L5=r_(),C5=o_(),U5=c_(),B5=h_(),k5=v_(),M5=A_(),x5=U_(),q5=k_(),V5=x_(),j5=G_(),K5=J_(),$5=H_(),G5=X_(),Q5=Bg(),Y5=Cg(),J5=V_(),z5=K_(),H5=P_(),W5=L_(),X5=g_(),Z5=O_(),e9=a_(),t9=AC(),n9=RC()});var wC=F(Oc=>{"use strict";m();T();N();Object.defineProperty(Oc,"__esModule",{value:!0});Object.defineProperty(Oc,"GraphQLError",{enumerable:!0,get:function(){return Ov.GraphQLError}});Object.defineProperty(Oc,"formatError",{enumerable:!0,get:function(){return Ov.formatError}});Object.defineProperty(Oc,"locatedError",{enumerable:!0,get:function(){return i9.locatedError}});Object.defineProperty(Oc,"printError",{enumerable:!0,get:function(){return Ov.printError}});Object.defineProperty(Oc,"syntaxError",{enumerable:!0,get:function(){return r9.syntaxError}});var Ov=Ze(),r9=aN(),i9=tT()});var bv=F(Dv=>{"use strict";m();T();N();Object.defineProperty(Dv,"__esModule",{value:!0});Dv.getIntrospectionQuery=a9;function a9(e){let t=M({descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1},e),n=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"",a=t.schemaDescription?n:"";function o(l){return t.inputValueDeprecation?l:""}let u=t.oneOf?"isOneOf":"";return` +`))}});var fC=F(hv=>{"use strict";m();T();N();Object.defineProperty(hv,"__esModule",{value:!0});hv.memoize3=LX;function LX(e){let t;return function(r,i,a){t===void 0&&(t=new WeakMap);let o=t.get(r);o===void 0&&(o=new WeakMap,t.set(r,o));let u=o.get(i);u===void 0&&(u=new WeakMap,o.set(i,u));let l=u.get(a);return l===void 0&&(l=e(r,i,a),u.set(a,l)),l}}});var mC=F(yv=>{"use strict";m();T();N();Object.defineProperty(yv,"__esModule",{value:!0});yv.promiseForObject=wX;function wX(e){return Promise.all(Object.values(e)).then(t=>{let n=Object.create(null);for(let[r,i]of Object.keys(e).entries())n[i]=t[r];return n})}});var NC=F(Iv=>{"use strict";m();T();N();Object.defineProperty(Iv,"__esModule",{value:!0});Iv.promiseReduce=UX;var CX=TN();function UX(e,t,n){let r=n;for(let i of e)r=(0,CX.isPromise)(r)?r.then(a=>t(a,i)):t(r,i);return r}});var TC=F(_v=>{"use strict";m();T();N();Object.defineProperty(_v,"__esModule",{value:!0});_v.toError=kX;var BX=rn();function kX(e){return e instanceof Error?e:new gv(e)}var gv=class extends Error{constructor(t){super("Unexpected error value: "+(0,BX.inspect)(t)),this.name="NonErrorThrown",this.thrownValue=t}}});var NT=F(vv=>{"use strict";m();T();N();Object.defineProperty(vv,"__esModule",{value:!0});vv.locatedError=qX;var MX=TC(),xX=tt();function qX(e,t,n){var r;let i=(0,MX.toError)(e);return VX(i)?i:new xX.GraphQLError(i.message,{nodes:(r=i.nodes)!==null&&r!==void 0?r:t,source:i.source,positions:i.positions,path:n,originalError:i})}function VX(e){return Array.isArray(e.path)}});var $p=F($i=>{"use strict";m();T();N();Object.defineProperty($i,"__esModule",{value:!0});$i.assertValidExecutionArguments=SC;$i.buildExecutionContext=OC;$i.buildResolveInfo=bC;$i.defaultTypeResolver=$i.defaultFieldResolver=void 0;$i.execute=vC;$i.executeSync=JX;$i.getFieldDef=RC;var Ov=Yr(),Fc=rn(),KX=Cr(),jX=zN(),Av=Ka(),ha=TN(),$X=fC(),Lc=Up(),EC=mC(),GX=NC(),ji=tt(),ET=NT(),Sv=ja(),hC=Mt(),wu=xt(),Yl=Vi(),QX=Lp(),gC=dT(),_C=$l(),YX=(0,$X.memoize3)((e,t,n)=>(0,gC.collectSubfields)(e.schema,e.fragments,e.variableValues,t,n));function vC(e){arguments.length<2||(0,Ov.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,document:n,variableValues:r,rootValue:i}=e;SC(t,n,r);let a=OC(e);if(!("schema"in a))return{errors:a};try{let{operation:o}=a,u=HX(a,o,i);return(0,ha.isPromise)(u)?u.then(l=>TT(l,a.errors),l=>(a.errors.push(l),TT(null,a.errors))):TT(u,a.errors)}catch(o){return a.errors.push(o),TT(null,a.errors)}}function JX(e){let t=vC(e);if((0,ha.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function TT(e,t){return t.length===0?{data:e}:{errors:t,data:e}}function SC(e,t,n){t||(0,Ov.devAssert)(!1,"Must provide document."),(0,QX.assertValidSchema)(e),n==null||(0,Av.isObjectLike)(n)||(0,Ov.devAssert)(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function OC(e){var t,n;let{schema:r,document:i,rootValue:a,contextValue:o,variableValues:u,operationName:l,fieldResolver:d,typeResolver:p,subscribeFieldResolver:E}=e,h,_=Object.create(null);for(let B of i.definitions)switch(B.kind){case hC.Kind.OPERATION_DEFINITION:if(l==null){if(h!==void 0)return[new ji.GraphQLError("Must provide operation name if query contains multiple operations.")];h=B}else((t=B.name)===null||t===void 0?void 0:t.value)===l&&(h=B);break;case hC.Kind.FRAGMENT_DEFINITION:_[B.name.value]=B;break;default:}if(!h)return l!=null?[new ji.GraphQLError(`Unknown operation named "${l}".`)]:[new ji.GraphQLError("Must provide an operation.")];let S=(n=h.variableDefinitions)!==null&&n!==void 0?n:[],k=(0,_C.getVariableValues)(r,S,u!=null?u:{},{maxErrors:50});return k.errors?k.errors:{schema:r,fragments:_,rootValue:a,contextValue:o,operation:h,variableValues:k.coerced,fieldResolver:d!=null?d:bv,typeResolver:p!=null?p:AC,subscribeFieldResolver:E!=null?E:bv,errors:[]}}function HX(e,t,n){let r=e.schema.getRootType(t.operation);if(r==null)throw new ji.GraphQLError(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let i=(0,gC.collectFields)(e.schema,e.fragments,e.variableValues,r,t.selectionSet),a=void 0;switch(t.operation){case Sv.OperationTypeNode.QUERY:return hT(e,r,n,a,i);case Sv.OperationTypeNode.MUTATION:return zX(e,r,n,a,i);case Sv.OperationTypeNode.SUBSCRIPTION:return hT(e,r,n,a,i)}}function zX(e,t,n,r,i){return(0,GX.promiseReduce)(i.entries(),(a,[o,u])=>{let l=(0,Lc.addPath)(r,o,t.name),d=DC(e,t,n,u,l);return d===void 0?a:(0,ha.isPromise)(d)?d.then(p=>(a[o]=p,a)):(a[o]=d,a)},Object.create(null))}function hT(e,t,n,r,i){let a=Object.create(null),o=!1;try{for(let[u,l]of i.entries()){let d=(0,Lc.addPath)(r,u,t.name),p=DC(e,t,n,l,d);p!==void 0&&(a[u]=p,(0,ha.isPromise)(p)&&(o=!0))}}catch(u){if(o)return(0,EC.promiseForObject)(a).finally(()=>{throw u});throw u}return o?(0,EC.promiseForObject)(a):a}function DC(e,t,n,r,i){var a;let o=RC(e.schema,t,r[0]);if(!o)return;let u=o.type,l=(a=o.resolve)!==null&&a!==void 0?a:e.fieldResolver,d=bC(e,o,r,t,i);try{let p=(0,_C.getArgumentValues)(o,r[0],e.variableValues),E=e.contextValue,h=l(n,p,E,d),_;return(0,ha.isPromise)(h)?_=h.then(S=>jp(e,u,r,d,i,S)):_=jp(e,u,r,d,i,h),(0,ha.isPromise)(_)?_.then(void 0,S=>{let k=(0,ET.locatedError)(S,r,(0,Lc.pathToArray)(i));return yT(k,u,e)}):_}catch(p){let E=(0,ET.locatedError)(p,r,(0,Lc.pathToArray)(i));return yT(E,u,e)}}function bC(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function yT(e,t,n){if((0,wu.isNonNullType)(t))throw e;return n.errors.push(e),null}function jp(e,t,n,r,i,a){if(a instanceof Error)throw a;if((0,wu.isNonNullType)(t)){let o=jp(e,t.ofType,n,r,i,a);if(o===null)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return o}if(a==null)return null;if((0,wu.isListType)(t))return WX(e,t,n,r,i,a);if((0,wu.isLeafType)(t))return XX(t,a);if((0,wu.isAbstractType)(t))return ZX(e,t,n,r,i,a);if((0,wu.isObjectType)(t))return Dv(e,t,n,r,i,a);(0,KX.invariant)(!1,"Cannot complete value of unexpected output type: "+(0,Fc.inspect)(t))}function WX(e,t,n,r,i,a){if(!(0,jX.isIterableObject)(a))throw new ji.GraphQLError(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);let o=t.ofType,u=!1,l=Array.from(a,(d,p)=>{let E=(0,Lc.addPath)(i,p,void 0);try{let h;return(0,ha.isPromise)(d)?h=d.then(_=>jp(e,o,n,r,E,_)):h=jp(e,o,n,r,E,d),(0,ha.isPromise)(h)?(u=!0,h.then(void 0,_=>{let S=(0,ET.locatedError)(_,n,(0,Lc.pathToArray)(E));return yT(S,o,e)})):h}catch(h){let _=(0,ET.locatedError)(h,n,(0,Lc.pathToArray)(E));return yT(_,o,e)}});return u?Promise.all(l):l}function XX(e,t){let n=e.serialize(t);if(n==null)throw new Error(`Expected \`${(0,Fc.inspect)(e)}.serialize(${(0,Fc.inspect)(t)})\` to return non-nullable value, returned: ${(0,Fc.inspect)(n)}`);return n}function ZX(e,t,n,r,i,a){var o;let u=(o=t.resolveType)!==null&&o!==void 0?o:e.typeResolver,l=e.contextValue,d=u(a,l,r,t);return(0,ha.isPromise)(d)?d.then(p=>Dv(e,yC(p,e,t,n,r,a),n,r,i,a)):Dv(e,yC(d,e,t,n,r,a),n,r,i,a)}function yC(e,t,n,r,i,a){if(e==null)throw new ji.GraphQLError(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if((0,wu.isObjectType)(e))throw new ji.GraphQLError("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if(typeof e!="string")throw new ji.GraphQLError(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${(0,Fc.inspect)(a)}, received "${(0,Fc.inspect)(e)}".`);let o=t.schema.getType(e);if(o==null)throw new ji.GraphQLError(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!(0,wu.isObjectType)(o))throw new ji.GraphQLError(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,o))throw new ji.GraphQLError(`Runtime Object type "${o.name}" is not a possible type for "${n.name}".`,{nodes:r});return o}function Dv(e,t,n,r,i,a){let o=YX(e,t,n);if(t.isTypeOf){let u=t.isTypeOf(a,e.contextValue,r);if((0,ha.isPromise)(u))return u.then(l=>{if(!l)throw IC(t,a,n);return hT(e,t,a,i,o)});if(!u)throw IC(t,a,n)}return hT(e,t,a,i,o)}function IC(e,t,n){return new ji.GraphQLError(`Expected value of type "${e.name}" but got: ${(0,Fc.inspect)(t)}.`,{nodes:n})}var AC=function(e,t,n,r){if((0,Av.isObjectLike)(e)&&typeof e.__typename=="string")return e.__typename;let i=n.schema.getPossibleTypes(r),a=[];for(let o=0;o{for(let u=0;u{"use strict";m();T();N();Object.defineProperty(IT,"__esModule",{value:!0});IT.graphql=s9;IT.graphqlSync=o9;var e9=Yr(),t9=TN(),n9=Cl(),r9=Lp(),i9=Ql(),a9=$p();function s9(e){return new Promise(t=>t(PC(e)))}function o9(e){let t=PC(e);if((0,t9.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function PC(e){arguments.length<2||(0,e9.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,source:n,rootValue:r,contextValue:i,variableValues:a,operationName:o,fieldResolver:u,typeResolver:l}=e,d=(0,r9.validateSchema)(t);if(d.length>0)return{errors:d};let p;try{p=(0,n9.parse)(n)}catch(h){return{errors:[h]}}let E=(0,i9.validate)(t,p);return E.length>0?{errors:E}:(0,a9.execute)({schema:t,document:p,rootValue:r,contextValue:i,variableValues:a,operationName:o,fieldResolver:u,typeResolver:l})}});var CC=F(_e=>{"use strict";m();T();N();Object.defineProperty(_e,"__esModule",{value:!0});Object.defineProperty(_e,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return ya.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(_e,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return Ls.GRAPHQL_MAX_INT}});Object.defineProperty(_e,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return Ls.GRAPHQL_MIN_INT}});Object.defineProperty(_e,"GraphQLBoolean",{enumerable:!0,get:function(){return Ls.GraphQLBoolean}});Object.defineProperty(_e,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return ya.GraphQLDeprecatedDirective}});Object.defineProperty(_e,"GraphQLDirective",{enumerable:!0,get:function(){return ya.GraphQLDirective}});Object.defineProperty(_e,"GraphQLEnumType",{enumerable:!0,get:function(){return ut.GraphQLEnumType}});Object.defineProperty(_e,"GraphQLFloat",{enumerable:!0,get:function(){return Ls.GraphQLFloat}});Object.defineProperty(_e,"GraphQLID",{enumerable:!0,get:function(){return Ls.GraphQLID}});Object.defineProperty(_e,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return ya.GraphQLIncludeDirective}});Object.defineProperty(_e,"GraphQLInputObjectType",{enumerable:!0,get:function(){return ut.GraphQLInputObjectType}});Object.defineProperty(_e,"GraphQLInt",{enumerable:!0,get:function(){return Ls.GraphQLInt}});Object.defineProperty(_e,"GraphQLInterfaceType",{enumerable:!0,get:function(){return ut.GraphQLInterfaceType}});Object.defineProperty(_e,"GraphQLList",{enumerable:!0,get:function(){return ut.GraphQLList}});Object.defineProperty(_e,"GraphQLNonNull",{enumerable:!0,get:function(){return ut.GraphQLNonNull}});Object.defineProperty(_e,"GraphQLObjectType",{enumerable:!0,get:function(){return ut.GraphQLObjectType}});Object.defineProperty(_e,"GraphQLOneOfDirective",{enumerable:!0,get:function(){return ya.GraphQLOneOfDirective}});Object.defineProperty(_e,"GraphQLScalarType",{enumerable:!0,get:function(){return ut.GraphQLScalarType}});Object.defineProperty(_e,"GraphQLSchema",{enumerable:!0,get:function(){return Rv.GraphQLSchema}});Object.defineProperty(_e,"GraphQLSkipDirective",{enumerable:!0,get:function(){return ya.GraphQLSkipDirective}});Object.defineProperty(_e,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return ya.GraphQLSpecifiedByDirective}});Object.defineProperty(_e,"GraphQLString",{enumerable:!0,get:function(){return Ls.GraphQLString}});Object.defineProperty(_e,"GraphQLUnionType",{enumerable:!0,get:function(){return ut.GraphQLUnionType}});Object.defineProperty(_e,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return ui.SchemaMetaFieldDef}});Object.defineProperty(_e,"TypeKind",{enumerable:!0,get:function(){return ui.TypeKind}});Object.defineProperty(_e,"TypeMetaFieldDef",{enumerable:!0,get:function(){return ui.TypeMetaFieldDef}});Object.defineProperty(_e,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return ui.TypeNameMetaFieldDef}});Object.defineProperty(_e,"__Directive",{enumerable:!0,get:function(){return ui.__Directive}});Object.defineProperty(_e,"__DirectiveLocation",{enumerable:!0,get:function(){return ui.__DirectiveLocation}});Object.defineProperty(_e,"__EnumValue",{enumerable:!0,get:function(){return ui.__EnumValue}});Object.defineProperty(_e,"__Field",{enumerable:!0,get:function(){return ui.__Field}});Object.defineProperty(_e,"__InputValue",{enumerable:!0,get:function(){return ui.__InputValue}});Object.defineProperty(_e,"__Schema",{enumerable:!0,get:function(){return ui.__Schema}});Object.defineProperty(_e,"__Type",{enumerable:!0,get:function(){return ui.__Type}});Object.defineProperty(_e,"__TypeKind",{enumerable:!0,get:function(){return ui.__TypeKind}});Object.defineProperty(_e,"assertAbstractType",{enumerable:!0,get:function(){return ut.assertAbstractType}});Object.defineProperty(_e,"assertCompositeType",{enumerable:!0,get:function(){return ut.assertCompositeType}});Object.defineProperty(_e,"assertDirective",{enumerable:!0,get:function(){return ya.assertDirective}});Object.defineProperty(_e,"assertEnumType",{enumerable:!0,get:function(){return ut.assertEnumType}});Object.defineProperty(_e,"assertEnumValueName",{enumerable:!0,get:function(){return wC.assertEnumValueName}});Object.defineProperty(_e,"assertInputObjectType",{enumerable:!0,get:function(){return ut.assertInputObjectType}});Object.defineProperty(_e,"assertInputType",{enumerable:!0,get:function(){return ut.assertInputType}});Object.defineProperty(_e,"assertInterfaceType",{enumerable:!0,get:function(){return ut.assertInterfaceType}});Object.defineProperty(_e,"assertLeafType",{enumerable:!0,get:function(){return ut.assertLeafType}});Object.defineProperty(_e,"assertListType",{enumerable:!0,get:function(){return ut.assertListType}});Object.defineProperty(_e,"assertName",{enumerable:!0,get:function(){return wC.assertName}});Object.defineProperty(_e,"assertNamedType",{enumerable:!0,get:function(){return ut.assertNamedType}});Object.defineProperty(_e,"assertNonNullType",{enumerable:!0,get:function(){return ut.assertNonNullType}});Object.defineProperty(_e,"assertNullableType",{enumerable:!0,get:function(){return ut.assertNullableType}});Object.defineProperty(_e,"assertObjectType",{enumerable:!0,get:function(){return ut.assertObjectType}});Object.defineProperty(_e,"assertOutputType",{enumerable:!0,get:function(){return ut.assertOutputType}});Object.defineProperty(_e,"assertScalarType",{enumerable:!0,get:function(){return ut.assertScalarType}});Object.defineProperty(_e,"assertSchema",{enumerable:!0,get:function(){return Rv.assertSchema}});Object.defineProperty(_e,"assertType",{enumerable:!0,get:function(){return ut.assertType}});Object.defineProperty(_e,"assertUnionType",{enumerable:!0,get:function(){return ut.assertUnionType}});Object.defineProperty(_e,"assertValidSchema",{enumerable:!0,get:function(){return LC.assertValidSchema}});Object.defineProperty(_e,"assertWrappingType",{enumerable:!0,get:function(){return ut.assertWrappingType}});Object.defineProperty(_e,"getNamedType",{enumerable:!0,get:function(){return ut.getNamedType}});Object.defineProperty(_e,"getNullableType",{enumerable:!0,get:function(){return ut.getNullableType}});Object.defineProperty(_e,"introspectionTypes",{enumerable:!0,get:function(){return ui.introspectionTypes}});Object.defineProperty(_e,"isAbstractType",{enumerable:!0,get:function(){return ut.isAbstractType}});Object.defineProperty(_e,"isCompositeType",{enumerable:!0,get:function(){return ut.isCompositeType}});Object.defineProperty(_e,"isDirective",{enumerable:!0,get:function(){return ya.isDirective}});Object.defineProperty(_e,"isEnumType",{enumerable:!0,get:function(){return ut.isEnumType}});Object.defineProperty(_e,"isInputObjectType",{enumerable:!0,get:function(){return ut.isInputObjectType}});Object.defineProperty(_e,"isInputType",{enumerable:!0,get:function(){return ut.isInputType}});Object.defineProperty(_e,"isInterfaceType",{enumerable:!0,get:function(){return ut.isInterfaceType}});Object.defineProperty(_e,"isIntrospectionType",{enumerable:!0,get:function(){return ui.isIntrospectionType}});Object.defineProperty(_e,"isLeafType",{enumerable:!0,get:function(){return ut.isLeafType}});Object.defineProperty(_e,"isListType",{enumerable:!0,get:function(){return ut.isListType}});Object.defineProperty(_e,"isNamedType",{enumerable:!0,get:function(){return ut.isNamedType}});Object.defineProperty(_e,"isNonNullType",{enumerable:!0,get:function(){return ut.isNonNullType}});Object.defineProperty(_e,"isNullableType",{enumerable:!0,get:function(){return ut.isNullableType}});Object.defineProperty(_e,"isObjectType",{enumerable:!0,get:function(){return ut.isObjectType}});Object.defineProperty(_e,"isOutputType",{enumerable:!0,get:function(){return ut.isOutputType}});Object.defineProperty(_e,"isRequiredArgument",{enumerable:!0,get:function(){return ut.isRequiredArgument}});Object.defineProperty(_e,"isRequiredInputField",{enumerable:!0,get:function(){return ut.isRequiredInputField}});Object.defineProperty(_e,"isScalarType",{enumerable:!0,get:function(){return ut.isScalarType}});Object.defineProperty(_e,"isSchema",{enumerable:!0,get:function(){return Rv.isSchema}});Object.defineProperty(_e,"isSpecifiedDirective",{enumerable:!0,get:function(){return ya.isSpecifiedDirective}});Object.defineProperty(_e,"isSpecifiedScalarType",{enumerable:!0,get:function(){return Ls.isSpecifiedScalarType}});Object.defineProperty(_e,"isType",{enumerable:!0,get:function(){return ut.isType}});Object.defineProperty(_e,"isUnionType",{enumerable:!0,get:function(){return ut.isUnionType}});Object.defineProperty(_e,"isWrappingType",{enumerable:!0,get:function(){return ut.isWrappingType}});Object.defineProperty(_e,"resolveObjMapThunk",{enumerable:!0,get:function(){return ut.resolveObjMapThunk}});Object.defineProperty(_e,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return ut.resolveReadonlyArrayThunk}});Object.defineProperty(_e,"specifiedDirectives",{enumerable:!0,get:function(){return ya.specifiedDirectives}});Object.defineProperty(_e,"specifiedScalarTypes",{enumerable:!0,get:function(){return Ls.specifiedScalarTypes}});Object.defineProperty(_e,"validateSchema",{enumerable:!0,get:function(){return LC.validateSchema}});var Rv=Dc(),ut=xt(),ya=si(),Ls=Qa(),ui=Vi(),LC=Lp(),wC=Ep()});var BC=F(Kt=>{"use strict";m();T();N();Object.defineProperty(Kt,"__esModule",{value:!0});Object.defineProperty(Kt,"BREAK",{enumerable:!0,get:function(){return Gp.BREAK}});Object.defineProperty(Kt,"DirectiveLocation",{enumerable:!0,get:function(){return m9.DirectiveLocation}});Object.defineProperty(Kt,"Kind",{enumerable:!0,get:function(){return l9.Kind}});Object.defineProperty(Kt,"Lexer",{enumerable:!0,get:function(){return p9.Lexer}});Object.defineProperty(Kt,"Location",{enumerable:!0,get:function(){return Pv.Location}});Object.defineProperty(Kt,"OperationTypeNode",{enumerable:!0,get:function(){return Pv.OperationTypeNode}});Object.defineProperty(Kt,"Source",{enumerable:!0,get:function(){return u9.Source}});Object.defineProperty(Kt,"Token",{enumerable:!0,get:function(){return Pv.Token}});Object.defineProperty(Kt,"TokenKind",{enumerable:!0,get:function(){return d9.TokenKind}});Object.defineProperty(Kt,"getEnterLeaveForKind",{enumerable:!0,get:function(){return Gp.getEnterLeaveForKind}});Object.defineProperty(Kt,"getLocation",{enumerable:!0,get:function(){return c9.getLocation}});Object.defineProperty(Kt,"getVisitFn",{enumerable:!0,get:function(){return Gp.getVisitFn}});Object.defineProperty(Kt,"isConstValueNode",{enumerable:!0,get:function(){return za.isConstValueNode}});Object.defineProperty(Kt,"isDefinitionNode",{enumerable:!0,get:function(){return za.isDefinitionNode}});Object.defineProperty(Kt,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return za.isExecutableDefinitionNode}});Object.defineProperty(Kt,"isSelectionNode",{enumerable:!0,get:function(){return za.isSelectionNode}});Object.defineProperty(Kt,"isTypeDefinitionNode",{enumerable:!0,get:function(){return za.isTypeDefinitionNode}});Object.defineProperty(Kt,"isTypeExtensionNode",{enumerable:!0,get:function(){return za.isTypeExtensionNode}});Object.defineProperty(Kt,"isTypeNode",{enumerable:!0,get:function(){return za.isTypeNode}});Object.defineProperty(Kt,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return za.isTypeSystemDefinitionNode}});Object.defineProperty(Kt,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return za.isTypeSystemExtensionNode}});Object.defineProperty(Kt,"isValueNode",{enumerable:!0,get:function(){return za.isValueNode}});Object.defineProperty(Kt,"parse",{enumerable:!0,get:function(){return gT.parse}});Object.defineProperty(Kt,"parseConstValue",{enumerable:!0,get:function(){return gT.parseConstValue}});Object.defineProperty(Kt,"parseType",{enumerable:!0,get:function(){return gT.parseType}});Object.defineProperty(Kt,"parseValue",{enumerable:!0,get:function(){return gT.parseValue}});Object.defineProperty(Kt,"print",{enumerable:!0,get:function(){return f9.print}});Object.defineProperty(Kt,"printLocation",{enumerable:!0,get:function(){return UC.printLocation}});Object.defineProperty(Kt,"printSourceLocation",{enumerable:!0,get:function(){return UC.printSourceLocation}});Object.defineProperty(Kt,"visit",{enumerable:!0,get:function(){return Gp.visit}});Object.defineProperty(Kt,"visitInParallel",{enumerable:!0,get:function(){return Gp.visitInParallel}});var u9=DN(),c9=EN(),UC=DI(),l9=Mt(),d9=cp(),p9=_N(),gT=Cl(),f9=_i(),Gp=Ic(),Pv=ja(),za=Ac(),m9=Ll()});var kC=F(Fv=>{"use strict";m();T();N();Object.defineProperty(Fv,"__esModule",{value:!0});Fv.isAsyncIterable=N9;function N9(e){return typeof(e==null?void 0:e[Symbol.asyncIterator])=="function"}});var MC=F(Lv=>{"use strict";m();T();N();Object.defineProperty(Lv,"__esModule",{value:!0});Lv.mapAsyncIterator=T9;function T9(e,t){let n=e[Symbol.asyncIterator]();function r(a){return Bi(this,null,function*(){if(a.done)return a;try{return{value:yield t(a.value),done:!1}}catch(o){if(typeof n.return=="function")try{yield n.return()}catch(u){}throw o}})}return{next(){return Bi(this,null,function*(){return r(yield n.next())})},return(){return Bi(this,null,function*(){return typeof n.return=="function"?r(yield n.return()):{value:void 0,done:!0}})},throw(a){return Bi(this,null,function*(){if(typeof n.throw=="function")return r(yield n.throw(a));throw a})},[Symbol.asyncIterator](){return this}}}});var KC=F(_T=>{"use strict";m();T();N();Object.defineProperty(_T,"__esModule",{value:!0});_T.createSourceEventStream=VC;_T.subscribe=v9;var E9=Yr(),h9=rn(),qC=kC(),xC=Up(),wv=tt(),y9=NT(),I9=dT(),Qp=$p(),g9=MC(),_9=$l();function v9(t){return Bi(this,arguments,function*(e){arguments.length<2||(0,E9.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let n=yield VC(e);if(!(0,qC.isAsyncIterable)(n))return n;let r=i=>(0,Qp.execute)(W(q({},e),{rootValue:i}));return(0,g9.mapAsyncIterator)(n,r)})}function S9(e){let t=e[0];return t&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}function VC(...e){return Bi(this,null,function*(){let t=S9(e),{schema:n,document:r,variableValues:i}=t;(0,Qp.assertValidExecutionArguments)(n,r,i);let a=(0,Qp.buildExecutionContext)(t);if(!("schema"in a))return{errors:a};try{let o=yield O9(a);if(!(0,qC.isAsyncIterable)(o))throw new Error(`Subscription field must return Async Iterable. Received: ${(0,h9.inspect)(o)}.`);return o}catch(o){if(o instanceof wv.GraphQLError)return{errors:[o]};throw o}})}function O9(e){return Bi(this,null,function*(){let{schema:t,fragments:n,operation:r,variableValues:i,rootValue:a}=e,o=t.getSubscriptionType();if(o==null)throw new wv.GraphQLError("Schema is not configured to execute subscription operation.",{nodes:r});let u=(0,I9.collectFields)(t,n,i,o,r.selectionSet),[l,d]=[...u.entries()][0],p=(0,Qp.getFieldDef)(t,o,d[0]);if(!p){let S=d[0].name.value;throw new wv.GraphQLError(`The subscription field "${S}" is not defined.`,{nodes:d})}let E=(0,xC.addPath)(void 0,l,o.name),h=(0,Qp.buildResolveInfo)(e,p,d,o,E);try{var _;let S=(0,_9.getArgumentValues)(p,d[0],i),k=e.contextValue,K=yield((_=p.subscribe)!==null&&_!==void 0?_:e.subscribeFieldResolver)(a,S,k,h);if(K instanceof Error)throw K;return K}catch(S){throw(0,y9.locatedError)(S,d,(0,xC.pathToArray)(E))}})}});var $C=F(Gi=>{"use strict";m();T();N();Object.defineProperty(Gi,"__esModule",{value:!0});Object.defineProperty(Gi,"createSourceEventStream",{enumerable:!0,get:function(){return jC.createSourceEventStream}});Object.defineProperty(Gi,"defaultFieldResolver",{enumerable:!0,get:function(){return vT.defaultFieldResolver}});Object.defineProperty(Gi,"defaultTypeResolver",{enumerable:!0,get:function(){return vT.defaultTypeResolver}});Object.defineProperty(Gi,"execute",{enumerable:!0,get:function(){return vT.execute}});Object.defineProperty(Gi,"executeSync",{enumerable:!0,get:function(){return vT.executeSync}});Object.defineProperty(Gi,"getArgumentValues",{enumerable:!0,get:function(){return Cv.getArgumentValues}});Object.defineProperty(Gi,"getDirectiveValues",{enumerable:!0,get:function(){return Cv.getDirectiveValues}});Object.defineProperty(Gi,"getVariableValues",{enumerable:!0,get:function(){return Cv.getVariableValues}});Object.defineProperty(Gi,"responsePathAsArray",{enumerable:!0,get:function(){return D9.pathToArray}});Object.defineProperty(Gi,"subscribe",{enumerable:!0,get:function(){return jC.subscribe}});var D9=Up(),vT=$p(),jC=KC(),Cv=$l()});var GC=F(kv=>{"use strict";m();T();N();Object.defineProperty(kv,"__esModule",{value:!0});kv.NoDeprecatedCustomRule=b9;var Uv=Cr(),Yp=tt(),Bv=xt();function b9(e){return{Field(t){let n=e.getFieldDef(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){let i=e.getParentType();i!=null||(0,Uv.invariant)(!1),e.reportError(new Yp.GraphQLError(`The field ${i.name}.${n.name} is deprecated. ${r}`,{nodes:t}))}},Argument(t){let n=e.getArgument(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){let i=e.getDirective();if(i!=null)e.reportError(new Yp.GraphQLError(`Directive "@${i.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}));else{let a=e.getParentType(),o=e.getFieldDef();a!=null&&o!=null||(0,Uv.invariant)(!1),e.reportError(new Yp.GraphQLError(`Field "${a.name}.${o.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}))}}},ObjectField(t){let n=(0,Bv.getNamedType)(e.getParentInputType());if((0,Bv.isInputObjectType)(n)){let r=n.getFields()[t.name.value],i=r==null?void 0:r.deprecationReason;i!=null&&e.reportError(new Yp.GraphQLError(`The input field ${n.name}.${r.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){let n=e.getEnumValue(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){let i=(0,Bv.getNamedType)(e.getInputType());i!=null||(0,Uv.invariant)(!1),e.reportError(new Yp.GraphQLError(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:t}))}}}}});var QC=F(Mv=>{"use strict";m();T();N();Object.defineProperty(Mv,"__esModule",{value:!0});Mv.NoSchemaIntrospectionCustomRule=F9;var A9=tt(),R9=xt(),P9=Vi();function F9(e){return{Field(t){let n=(0,R9.getNamedType)(e.getType());n&&(0,P9.isIntrospectionType)(n)&&e.reportError(new A9.GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}});var JC=F(yt=>{"use strict";m();T();N();Object.defineProperty(yt,"__esModule",{value:!0});Object.defineProperty(yt,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return C9.ExecutableDefinitionsRule}});Object.defineProperty(yt,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return U9.FieldsOnCorrectTypeRule}});Object.defineProperty(yt,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return B9.FragmentsOnCompositeTypesRule}});Object.defineProperty(yt,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return k9.KnownArgumentNamesRule}});Object.defineProperty(yt,"KnownDirectivesRule",{enumerable:!0,get:function(){return M9.KnownDirectivesRule}});Object.defineProperty(yt,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return x9.KnownFragmentNamesRule}});Object.defineProperty(yt,"KnownTypeNamesRule",{enumerable:!0,get:function(){return q9.KnownTypeNamesRule}});Object.defineProperty(yt,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return V9.LoneAnonymousOperationRule}});Object.defineProperty(yt,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return o5.LoneSchemaDefinitionRule}});Object.defineProperty(yt,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return s5.MaxIntrospectionDepthRule}});Object.defineProperty(yt,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return N5.NoDeprecatedCustomRule}});Object.defineProperty(yt,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return K9.NoFragmentCyclesRule}});Object.defineProperty(yt,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return T5.NoSchemaIntrospectionCustomRule}});Object.defineProperty(yt,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return j9.NoUndefinedVariablesRule}});Object.defineProperty(yt,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return $9.NoUnusedFragmentsRule}});Object.defineProperty(yt,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return G9.NoUnusedVariablesRule}});Object.defineProperty(yt,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return Q9.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(yt,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return Y9.PossibleFragmentSpreadsRule}});Object.defineProperty(yt,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return m5.PossibleTypeExtensionsRule}});Object.defineProperty(yt,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return J9.ProvidedRequiredArgumentsRule}});Object.defineProperty(yt,"ScalarLeafsRule",{enumerable:!0,get:function(){return H9.ScalarLeafsRule}});Object.defineProperty(yt,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return z9.SingleFieldSubscriptionsRule}});Object.defineProperty(yt,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return p5.UniqueArgumentDefinitionNamesRule}});Object.defineProperty(yt,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return W9.UniqueArgumentNamesRule}});Object.defineProperty(yt,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return f5.UniqueDirectiveNamesRule}});Object.defineProperty(yt,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return X9.UniqueDirectivesPerLocationRule}});Object.defineProperty(yt,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return l5.UniqueEnumValueNamesRule}});Object.defineProperty(yt,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return d5.UniqueFieldDefinitionNamesRule}});Object.defineProperty(yt,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return Z9.UniqueFragmentNamesRule}});Object.defineProperty(yt,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return e5.UniqueInputFieldNamesRule}});Object.defineProperty(yt,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return t5.UniqueOperationNamesRule}});Object.defineProperty(yt,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return u5.UniqueOperationTypesRule}});Object.defineProperty(yt,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return c5.UniqueTypeNamesRule}});Object.defineProperty(yt,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return n5.UniqueVariableNamesRule}});Object.defineProperty(yt,"ValidationContext",{enumerable:!0,get:function(){return w9.ValidationContext}});Object.defineProperty(yt,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return r5.ValuesOfCorrectTypeRule}});Object.defineProperty(yt,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return i5.VariablesAreInputTypesRule}});Object.defineProperty(yt,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return a5.VariablesInAllowedPositionRule}});Object.defineProperty(yt,"recommendedRules",{enumerable:!0,get:function(){return YC.recommendedRules}});Object.defineProperty(yt,"specifiedRules",{enumerable:!0,get:function(){return YC.specifiedRules}});Object.defineProperty(yt,"validate",{enumerable:!0,get:function(){return L9.validate}});var L9=Ql(),w9=Tv(),YC=fv(),C9=Pg(),U9=Lg(),B9=Cg(),k9=Ug(),M9=xg(),x9=Vg(),q9=$g(),V9=Qg(),K9=Xg(),j9=e_(),$9=n_(),G9=i_(),Q9=m_(),Y9=E_(),J9=g_(),H9=v_(),z9=L_(),W9=k_(),X9=K_(),Z9=H_(),e5=W_(),t5=Z_(),n5=av(),r5=uv(),i5=lv(),a5=pv(),s5=zg(),o5=Jg(),u5=tv(),c5=rv(),l5=$_(),d5=Y_(),p5=U_(),f5=x_(),m5=y_(),N5=GC(),T5=QC()});var HC=F(wc=>{"use strict";m();T();N();Object.defineProperty(wc,"__esModule",{value:!0});Object.defineProperty(wc,"GraphQLError",{enumerable:!0,get:function(){return xv.GraphQLError}});Object.defineProperty(wc,"formatError",{enumerable:!0,get:function(){return xv.formatError}});Object.defineProperty(wc,"locatedError",{enumerable:!0,get:function(){return h5.locatedError}});Object.defineProperty(wc,"printError",{enumerable:!0,get:function(){return xv.printError}});Object.defineProperty(wc,"syntaxError",{enumerable:!0,get:function(){return E5.syntaxError}});var xv=tt(),E5=yN(),h5=NT()});var Vv=F(qv=>{"use strict";m();T();N();Object.defineProperty(qv,"__esModule",{value:!0});qv.getIntrospectionQuery=y5;function y5(e){let t=q({descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1},e),n=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"",a=t.schemaDescription?n:"";function o(l){return t.inputValueDeprecation?l:""}let u=t.oneOf?"isOneOf":"";return` query IntrospectionQuery { __schema { ${a} @@ -177,90 +177,90 @@ In some cases, you need to provide options to alter GraphQL's execution behavior } } } - `}});var LC=F(Av=>{"use strict";m();T();N();Object.defineProperty(Av,"__esModule",{value:!0});Av.getOperationAST=o9;var s9=Ut();function o9(e,t){let n=null;for(let i of e.definitions)if(i.kind===s9.Kind.OPERATION_DEFINITION){var r;if(t==null){if(n)return null;n=i}else if(((r=i.name)===null||r===void 0?void 0:r.value)===t)return i}return n}});var CC=F(Rv=>{"use strict";m();T();N();Object.defineProperty(Rv,"__esModule",{value:!0});Rv.getOperationRootType=u9;var lT=Ze();function u9(e,t){if(t.operation==="query"){let n=e.getQueryType();if(!n)throw new lT.GraphQLError("Schema does not define the required query root type.",{nodes:t});return n}if(t.operation==="mutation"){let n=e.getMutationType();if(!n)throw new lT.GraphQLError("Schema is not configured for mutations.",{nodes:t});return n}if(t.operation==="subscription"){let n=e.getSubscriptionType();if(!n)throw new lT.GraphQLError("Schema is not configured for subscriptions.",{nodes:t});return n}throw new lT.GraphQLError("Can only have query, mutation and subscription operations.",{nodes:t})}});var UC=F(Pv=>{"use strict";m();T();N();Object.defineProperty(Pv,"__esModule",{value:!0});Pv.introspectionFromSchema=p9;var c9=Fr(),l9=Ol(),d9=kf(),f9=bv();function p9(e,t){let n=M({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,oneOf:!0},t),r=(0,l9.parse)((0,f9.getIntrospectionQuery)(n)),i=(0,d9.executeSync)({schema:e,document:r});return!i.errors&&i.data||(0,c9.invariant)(!1),i.data}});var kC=F(Fv=>{"use strict";m();T();N();Object.defineProperty(Fv,"__esModule",{value:!0});Fv.buildClientSchema=I9;var m9=$r(),Ii=nn(),BC=Va(),dT=uf(),N9=Ol(),gi=Bt(),T9=ni(),Ha=xi(),E9=Ga(),h9=hc(),y9=wf();function I9(e,t){(0,BC.isObjectLike)(e)&&(0,BC.isObjectLike)(e.__schema)||(0,m9.devAssert)(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0,Ii.inspect)(e)}.`);let n=e.__schema,r=(0,dT.keyValMap)(n.types,Z=>Z.name,Z=>h(Z));for(let Z of[...E9.specifiedScalarTypes,...Ha.introspectionTypes])r[Z.name]&&(r[Z.name]=Z);let i=n.queryType?p(n.queryType):null,a=n.mutationType?p(n.mutationType):null,o=n.subscriptionType?p(n.subscriptionType):null,u=n.directives?n.directives.map(qe):[];return new h9.GraphQLSchema({description:n.description,query:i,mutation:a,subscription:o,types:Object.values(r),directives:u,assumeValid:t==null?void 0:t.assumeValid});function l(Z){if(Z.kind===Ha.TypeKind.LIST){let ge=Z.ofType;if(!ge)throw new Error("Decorated type deeper than introspection query.");return new gi.GraphQLList(l(ge))}if(Z.kind===Ha.TypeKind.NON_NULL){let ge=Z.ofType;if(!ge)throw new Error("Decorated type deeper than introspection query.");let It=l(ge);return new gi.GraphQLNonNull((0,gi.assertNullableType)(It))}return d(Z)}function d(Z){let ge=Z.name;if(!ge)throw new Error(`Unknown type reference: ${(0,Ii.inspect)(Z)}.`);let It=r[ge];if(!It)throw new Error(`Invalid or incomplete schema, unknown type: ${ge}. Ensure that a full introspection query is used in order to build a client schema.`);return It}function p(Z){return(0,gi.assertObjectType)(d(Z))}function E(Z){return(0,gi.assertInterfaceType)(d(Z))}function h(Z){if(Z!=null&&Z.name!=null&&Z.kind!=null)switch(Z.kind){case Ha.TypeKind.SCALAR:return v(Z);case Ha.TypeKind.OBJECT:return B(Z);case Ha.TypeKind.INTERFACE:return V(Z);case Ha.TypeKind.UNION:return J(Z);case Ha.TypeKind.ENUM:return re(Z);case Ha.TypeKind.INPUT_OBJECT:return ie(Z)}let ge=(0,Ii.inspect)(Z);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${ge}.`)}function v(Z){return new gi.GraphQLScalarType({name:Z.name,description:Z.description,specifiedByURL:Z.specifiedByURL})}function A(Z){if(Z.interfaces===null&&Z.kind===Ha.TypeKind.INTERFACE)return[];if(!Z.interfaces){let ge=(0,Ii.inspect)(Z);throw new Error(`Introspection result missing interfaces: ${ge}.`)}return Z.interfaces.map(E)}function B(Z){return new gi.GraphQLObjectType({name:Z.name,description:Z.description,interfaces:()=>A(Z),fields:()=>Ne(Z)})}function V(Z){return new gi.GraphQLInterfaceType({name:Z.name,description:Z.description,interfaces:()=>A(Z),fields:()=>Ne(Z)})}function J(Z){if(!Z.possibleTypes){let ge=(0,Ii.inspect)(Z);throw new Error(`Introspection result missing possibleTypes: ${ge}.`)}return new gi.GraphQLUnionType({name:Z.name,description:Z.description,types:()=>Z.possibleTypes.map(p)})}function re(Z){if(!Z.enumValues){let ge=(0,Ii.inspect)(Z);throw new Error(`Introspection result missing enumValues: ${ge}.`)}return new gi.GraphQLEnumType({name:Z.name,description:Z.description,values:(0,dT.keyValMap)(Z.enumValues,ge=>ge.name,ge=>({description:ge.description,deprecationReason:ge.deprecationReason}))})}function ie(Z){if(!Z.inputFields){let ge=(0,Ii.inspect)(Z);throw new Error(`Introspection result missing inputFields: ${ge}.`)}return new gi.GraphQLInputObjectType({name:Z.name,description:Z.description,fields:()=>_e(Z.inputFields),isOneOf:Z.isOneOf})}function Ne(Z){if(!Z.fields)throw new Error(`Introspection result missing fields: ${(0,Ii.inspect)(Z)}.`);return(0,dT.keyValMap)(Z.fields,ge=>ge.name,Ee)}function Ee(Z){let ge=l(Z.type);if(!(0,gi.isOutputType)(ge)){let It=(0,Ii.inspect)(ge);throw new Error(`Introspection must provide output type for fields, but received: ${It}.`)}if(!Z.args){let It=(0,Ii.inspect)(Z);throw new Error(`Introspection result missing field args: ${It}.`)}return{description:Z.description,deprecationReason:Z.deprecationReason,type:ge,args:_e(Z.args)}}function _e(Z){return(0,dT.keyValMap)(Z,ge=>ge.name,ye)}function ye(Z){let ge=l(Z.type);if(!(0,gi.isInputType)(ge)){let Zt=(0,Ii.inspect)(ge);throw new Error(`Introspection must provide input type for arguments, but received: ${Zt}.`)}let It=Z.defaultValue!=null?(0,y9.valueFromAST)((0,N9.parseValue)(Z.defaultValue),ge):void 0;return{description:Z.description,type:ge,defaultValue:It,deprecationReason:Z.deprecationReason}}function qe(Z){if(!Z.args){let ge=(0,Ii.inspect)(Z);throw new Error(`Introspection result missing directive args: ${ge}.`)}if(!Z.locations){let ge=(0,Ii.inspect)(Z);throw new Error(`Introspection result missing directive locations: ${ge}.`)}return new T9.GraphQLDirective({name:Z.name,description:Z.description,isRepeatable:Z.isRepeatable,locations:Z.locations.slice(),args:_e(Z.args)})}}});var Lv=F(pT=>{"use strict";m();T();N();Object.defineProperty(pT,"__esModule",{value:!0});pT.extendSchema=D9;pT.extendSchemaImpl=GC;var g9=$r(),_9=nn(),v9=Fr(),S9=yu(),Vf=wI(),$i=Ut(),MC=Ic(),Dn=Bt(),jf=ni(),KC=xi(),$C=Ga(),xC=hc(),O9=kl(),wv=Ul(),qC=wf();function D9(e,t,n){(0,xC.assertSchema)(e),t!=null&&t.kind===$i.Kind.DOCUMENT||(0,g9.devAssert)(!1,"Must provide valid Document AST."),(n==null?void 0:n.assumeValid)!==!0&&(n==null?void 0:n.assumeValidSDL)!==!0&&(0,O9.assertValidSDLExtension)(t,e);let r=e.toConfig(),i=GC(r,t,n);return r===i?e:new xC.GraphQLSchema(i)}function GC(e,t,n){var r,i,a,o;let u=[],l=Object.create(null),d=[],p,E=[];for(let se of t.definitions)if(se.kind===$i.Kind.SCHEMA_DEFINITION)p=se;else if(se.kind===$i.Kind.SCHEMA_EXTENSION)E.push(se);else if((0,MC.isTypeDefinitionNode)(se))u.push(se);else if((0,MC.isTypeExtensionNode)(se)){let Ae=se.name.value,ve=l[Ae];l[Ae]=ve?ve.concat([se]):[se]}else se.kind===$i.Kind.DIRECTIVE_DEFINITION&&d.push(se);if(Object.keys(l).length===0&&u.length===0&&d.length===0&&E.length===0&&p==null)return e;let h=Object.create(null);for(let se of e.types)h[se.name]=re(se);for(let se of u){var v;let Ae=se.name.value;h[Ae]=(v=VC[Ae])!==null&&v!==void 0?v:Ln(se)}let A=M(M({query:e.query&&V(e.query),mutation:e.mutation&&V(e.mutation),subscription:e.subscription&&V(e.subscription)},p&&It([p])),It(E));return $(M({description:(r=p)===null||r===void 0||(i=r.description)===null||i===void 0?void 0:i.value},A),{types:Object.values(h),directives:[...e.directives.map(J),...d.map(Tn)],extensions:Object.create(null),astNode:(a=p)!==null&&a!==void 0?a:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(E),assumeValid:(o=n==null?void 0:n.assumeValid)!==null&&o!==void 0?o:!1});function B(se){return(0,Dn.isListType)(se)?new Dn.GraphQLList(B(se.ofType)):(0,Dn.isNonNullType)(se)?new Dn.GraphQLNonNull(B(se.ofType)):V(se)}function V(se){return h[se.name]}function J(se){let Ae=se.toConfig();return new jf.GraphQLDirective($(M({},Ae),{args:(0,Vf.mapValue)(Ae.args,ge)}))}function re(se){if((0,KC.isIntrospectionType)(se)||(0,$C.isSpecifiedScalarType)(se))return se;if((0,Dn.isScalarType)(se))return Ee(se);if((0,Dn.isObjectType)(se))return _e(se);if((0,Dn.isInterfaceType)(se))return ye(se);if((0,Dn.isUnionType)(se))return qe(se);if((0,Dn.isEnumType)(se))return Ne(se);if((0,Dn.isInputObjectType)(se))return ie(se);(0,v9.invariant)(!1,"Unexpected type: "+(0,_9.inspect)(se))}function ie(se){var Ae;let ve=se.toConfig(),Ce=(Ae=l[ve.name])!==null&&Ae!==void 0?Ae:[];return new Dn.GraphQLInputObjectType($(M({},ve),{fields:()=>M(M({},(0,Vf.mapValue)(ve.fields,bt=>$(M({},bt),{type:B(bt.type)}))),qr(Ce)),extensionASTNodes:ve.extensionASTNodes.concat(Ce)}))}function Ne(se){var Ae;let ve=se.toConfig(),Ce=(Ae=l[se.name])!==null&&Ae!==void 0?Ae:[];return new Dn.GraphQLEnumType($(M({},ve),{values:M(M({},ve.values),rr(Ce)),extensionASTNodes:ve.extensionASTNodes.concat(Ce)}))}function Ee(se){var Ae;let ve=se.toConfig(),Ce=(Ae=l[ve.name])!==null&&Ae!==void 0?Ae:[],bt=ve.specifiedByURL;for(let ae of Ce){var z;bt=(z=jC(ae))!==null&&z!==void 0?z:bt}return new Dn.GraphQLScalarType($(M({},ve),{specifiedByURL:bt,extensionASTNodes:ve.extensionASTNodes.concat(Ce)}))}function _e(se){var Ae;let ve=se.toConfig(),Ce=(Ae=l[ve.name])!==null&&Ae!==void 0?Ae:[];return new Dn.GraphQLObjectType($(M({},ve),{interfaces:()=>[...se.getInterfaces().map(V),...En(Ce)],fields:()=>M(M({},(0,Vf.mapValue)(ve.fields,Z)),Ot(Ce)),extensionASTNodes:ve.extensionASTNodes.concat(Ce)}))}function ye(se){var Ae;let ve=se.toConfig(),Ce=(Ae=l[ve.name])!==null&&Ae!==void 0?Ae:[];return new Dn.GraphQLInterfaceType($(M({},ve),{interfaces:()=>[...se.getInterfaces().map(V),...En(Ce)],fields:()=>M(M({},(0,Vf.mapValue)(ve.fields,Z)),Ot(Ce)),extensionASTNodes:ve.extensionASTNodes.concat(Ce)}))}function qe(se){var Ae;let ve=se.toConfig(),Ce=(Ae=l[ve.name])!==null&&Ae!==void 0?Ae:[];return new Dn.GraphQLUnionType($(M({},ve),{types:()=>[...se.getTypes().map(V),...en(Ce)],extensionASTNodes:ve.extensionASTNodes.concat(Ce)}))}function Z(se){return $(M({},se),{type:B(se.type),args:se.args&&(0,Vf.mapValue)(se.args,ge)})}function ge(se){return $(M({},se),{type:B(se.type)})}function It(se){let Ae={};for(let Ce of se){var ve;let bt=(ve=Ce.operationTypes)!==null&&ve!==void 0?ve:[];for(let z of bt)Ae[z.operation]=Zt(z.type)}return Ae}function Zt(se){var Ae;let ve=se.name.value,Ce=(Ae=VC[ve])!==null&&Ae!==void 0?Ae:h[ve];if(Ce===void 0)throw new Error(`Unknown type: "${ve}".`);return Ce}function In(se){return se.kind===$i.Kind.LIST_TYPE?new Dn.GraphQLList(In(se.type)):se.kind===$i.Kind.NON_NULL_TYPE?new Dn.GraphQLNonNull(In(se.type)):Zt(se)}function Tn(se){var Ae;return new jf.GraphQLDirective({name:se.name.value,description:(Ae=se.description)===null||Ae===void 0?void 0:Ae.value,locations:se.locations.map(({value:ve})=>ve),isRepeatable:se.repeatable,args:Kt(se.arguments),astNode:se})}function Ot(se){let Ae=Object.create(null);for(let bt of se){var ve;let z=(ve=bt.fields)!==null&&ve!==void 0?ve:[];for(let ae of z){var Ce;Ae[ae.name.value]={type:In(ae.type),description:(Ce=ae.description)===null||Ce===void 0?void 0:Ce.value,args:Kt(ae.arguments),deprecationReason:fT(ae),astNode:ae}}}return Ae}function Kt(se){let Ae=se!=null?se:[],ve=Object.create(null);for(let bt of Ae){var Ce;let z=In(bt.type);ve[bt.name.value]={type:z,description:(Ce=bt.description)===null||Ce===void 0?void 0:Ce.value,defaultValue:(0,qC.valueFromAST)(bt.defaultValue,z),deprecationReason:fT(bt),astNode:bt}}return ve}function qr(se){let Ae=Object.create(null);for(let bt of se){var ve;let z=(ve=bt.fields)!==null&&ve!==void 0?ve:[];for(let ae of z){var Ce;let Ke=In(ae.type);Ae[ae.name.value]={type:Ke,description:(Ce=ae.description)===null||Ce===void 0?void 0:Ce.value,defaultValue:(0,qC.valueFromAST)(ae.defaultValue,Ke),deprecationReason:fT(ae),astNode:ae}}}return Ae}function rr(se){let Ae=Object.create(null);for(let bt of se){var ve;let z=(ve=bt.values)!==null&&ve!==void 0?ve:[];for(let ae of z){var Ce;Ae[ae.name.value]={description:(Ce=ae.description)===null||Ce===void 0?void 0:Ce.value,deprecationReason:fT(ae),astNode:ae}}}return Ae}function En(se){return se.flatMap(Ae=>{var ve,Ce;return(ve=(Ce=Ae.interfaces)===null||Ce===void 0?void 0:Ce.map(Zt))!==null&&ve!==void 0?ve:[]})}function en(se){return se.flatMap(Ae=>{var ve,Ce;return(ve=(Ce=Ae.types)===null||Ce===void 0?void 0:Ce.map(Zt))!==null&&ve!==void 0?ve:[]})}function Ln(se){var Ae;let ve=se.name.value,Ce=(Ae=l[ve])!==null&&Ae!==void 0?Ae:[];switch(se.kind){case $i.Kind.OBJECT_TYPE_DEFINITION:{var bt;let it=[se,...Ce];return new Dn.GraphQLObjectType({name:ve,description:(bt=se.description)===null||bt===void 0?void 0:bt.value,interfaces:()=>En(it),fields:()=>Ot(it),astNode:se,extensionASTNodes:Ce})}case $i.Kind.INTERFACE_TYPE_DEFINITION:{var z;let it=[se,...Ce];return new Dn.GraphQLInterfaceType({name:ve,description:(z=se.description)===null||z===void 0?void 0:z.value,interfaces:()=>En(it),fields:()=>Ot(it),astNode:se,extensionASTNodes:Ce})}case $i.Kind.ENUM_TYPE_DEFINITION:{var ae;let it=[se,...Ce];return new Dn.GraphQLEnumType({name:ve,description:(ae=se.description)===null||ae===void 0?void 0:ae.value,values:rr(it),astNode:se,extensionASTNodes:Ce})}case $i.Kind.UNION_TYPE_DEFINITION:{var Ke;let it=[se,...Ce];return new Dn.GraphQLUnionType({name:ve,description:(Ke=se.description)===null||Ke===void 0?void 0:Ke.value,types:()=>en(it),astNode:se,extensionASTNodes:Ce})}case $i.Kind.SCALAR_TYPE_DEFINITION:{var He;return new Dn.GraphQLScalarType({name:ve,description:(He=se.description)===null||He===void 0?void 0:He.value,specifiedByURL:jC(se),astNode:se,extensionASTNodes:Ce})}case $i.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var Mt;let it=[se,...Ce];return new Dn.GraphQLInputObjectType({name:ve,description:(Mt=se.description)===null||Mt===void 0?void 0:Mt.value,fields:()=>qr(it),astNode:se,extensionASTNodes:Ce,isOneOf:b9(se)})}}}}var VC=(0,S9.keyMap)([...$C.specifiedScalarTypes,...KC.introspectionTypes],e=>e.name);function fT(e){let t=(0,wv.getDirectiveValues)(jf.GraphQLDeprecatedDirective,e);return t==null?void 0:t.reason}function jC(e){let t=(0,wv.getDirectiveValues)(jf.GraphQLSpecifiedByDirective,e);return t==null?void 0:t.url}function b9(e){return!!(0,wv.getDirectiveValues)(jf.GraphQLOneOfDirective,e)}});var YC=F(mT=>{"use strict";m();T();N();Object.defineProperty(mT,"__esModule",{value:!0});mT.buildASTSchema=QC;mT.buildSchema=U9;var A9=$r(),R9=Ut(),P9=Ol(),F9=ni(),w9=hc(),L9=kl(),C9=Lv();function QC(e,t){e!=null&&e.kind===R9.Kind.DOCUMENT||(0,A9.devAssert)(!1,"Must provide valid Document AST."),(t==null?void 0:t.assumeValid)!==!0&&(t==null?void 0:t.assumeValidSDL)!==!0&&(0,L9.assertValidSDL)(e);let n={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},r=(0,C9.extendSchemaImpl)(n,e,t);if(r.astNode==null)for(let a of r.types)switch(a.name){case"Query":r.query=a;break;case"Mutation":r.mutation=a;break;case"Subscription":r.subscription=a;break}let i=[...r.directives,...F9.specifiedDirectives.filter(a=>r.directives.every(o=>o.name!==a.name))];return new w9.GraphQLSchema($(M({},r),{directives:i}))}function U9(e,t){let n=(0,P9.parse)(e,{noLocation:t==null?void 0:t.noLocation,allowLegacyFragmentVariables:t==null?void 0:t.allowLegacyFragmentVariables});return QC(n,{assumeValidSDL:t==null?void 0:t.assumeValidSDL,assumeValid:t==null?void 0:t.assumeValid})}});var HC=F(Uv=>{"use strict";m();T();N();Object.defineProperty(Uv,"__esModule",{value:!0});Uv.lexicographicSortSchema=j9;var B9=nn(),k9=Fr(),M9=uf(),JC=cf(),Gr=Bt(),x9=ni(),q9=xi(),V9=hc();function j9(e){let t=e.toConfig(),n=(0,M9.keyValMap)(Cv(t.types),h=>h.name,E);return new V9.GraphQLSchema($(M({},t),{types:Object.values(n),directives:Cv(t.directives).map(o),query:a(t.query),mutation:a(t.mutation),subscription:a(t.subscription)}));function r(h){return(0,Gr.isListType)(h)?new Gr.GraphQLList(r(h.ofType)):(0,Gr.isNonNullType)(h)?new Gr.GraphQLNonNull(r(h.ofType)):i(h)}function i(h){return n[h.name]}function a(h){return h&&i(h)}function o(h){let v=h.toConfig();return new x9.GraphQLDirective($(M({},v),{locations:zC(v.locations,A=>A),args:u(v.args)}))}function u(h){return NT(h,v=>$(M({},v),{type:r(v.type)}))}function l(h){return NT(h,v=>$(M({},v),{type:r(v.type),args:v.args&&u(v.args)}))}function d(h){return NT(h,v=>$(M({},v),{type:r(v.type)}))}function p(h){return Cv(h).map(i)}function E(h){if((0,Gr.isScalarType)(h)||(0,q9.isIntrospectionType)(h))return h;if((0,Gr.isObjectType)(h)){let v=h.toConfig();return new Gr.GraphQLObjectType($(M({},v),{interfaces:()=>p(v.interfaces),fields:()=>l(v.fields)}))}if((0,Gr.isInterfaceType)(h)){let v=h.toConfig();return new Gr.GraphQLInterfaceType($(M({},v),{interfaces:()=>p(v.interfaces),fields:()=>l(v.fields)}))}if((0,Gr.isUnionType)(h)){let v=h.toConfig();return new Gr.GraphQLUnionType($(M({},v),{types:()=>p(v.types)}))}if((0,Gr.isEnumType)(h)){let v=h.toConfig();return new Gr.GraphQLEnumType($(M({},v),{values:NT(v.values,A=>A)}))}if((0,Gr.isInputObjectType)(h)){let v=h.toConfig();return new Gr.GraphQLInputObjectType($(M({},v),{fields:()=>d(v.fields)}))}(0,k9.invariant)(!1,"Unexpected type: "+(0,B9.inspect)(h))}}function NT(e,t){let n=Object.create(null);for(let r of Object.keys(e).sort(JC.naturalCompare))n[r]=t(e[r]);return n}function Cv(e){return zC(e,t=>t.name)}function zC(e,t){return e.slice().sort((n,r)=>{let i=t(n),a=t(r);return(0,JC.naturalCompare)(i,a)})}});var rU=F(Kf=>{"use strict";m();T();N();Object.defineProperty(Kf,"__esModule",{value:!0});Kf.printIntrospectionSchema=z9;Kf.printSchema=J9;Kf.printType=ZC;var K9=nn(),$9=Fr(),G9=Zd(),kv=Ut(),TT=yi(),xl=Bt(),Mv=ni(),WC=xi(),Q9=Ga(),Y9=_f();function J9(e){return XC(e,t=>!(0,Mv.isSpecifiedDirective)(t),H9)}function z9(e){return XC(e,Mv.isSpecifiedDirective,WC.isIntrospectionType)}function H9(e){return!(0,Q9.isSpecifiedScalarType)(e)&&!(0,WC.isIntrospectionType)(e)}function XC(e,t,n){let r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[W9(e),...r.map(a=>a7(a)),...i.map(a=>ZC(a))].filter(Boolean).join(` + `}});var zC=F(Kv=>{"use strict";m();T();N();Object.defineProperty(Kv,"__esModule",{value:!0});Kv.getOperationAST=g5;var I5=Mt();function g5(e,t){let n=null;for(let i of e.definitions)if(i.kind===I5.Kind.OPERATION_DEFINITION){var r;if(t==null){if(n)return null;n=i}else if(((r=i.name)===null||r===void 0?void 0:r.value)===t)return i}return n}});var WC=F(jv=>{"use strict";m();T();N();Object.defineProperty(jv,"__esModule",{value:!0});jv.getOperationRootType=_5;var ST=tt();function _5(e,t){if(t.operation==="query"){let n=e.getQueryType();if(!n)throw new ST.GraphQLError("Schema does not define the required query root type.",{nodes:t});return n}if(t.operation==="mutation"){let n=e.getMutationType();if(!n)throw new ST.GraphQLError("Schema is not configured for mutations.",{nodes:t});return n}if(t.operation==="subscription"){let n=e.getSubscriptionType();if(!n)throw new ST.GraphQLError("Schema is not configured for subscriptions.",{nodes:t});return n}throw new ST.GraphQLError("Can only have query, mutation and subscription operations.",{nodes:t})}});var XC=F($v=>{"use strict";m();T();N();Object.defineProperty($v,"__esModule",{value:!0});$v.introspectionFromSchema=b5;var v5=Cr(),S5=Cl(),O5=$p(),D5=Vv();function b5(e,t){let n=q({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,oneOf:!0},t),r=(0,S5.parse)((0,D5.getIntrospectionQuery)(n)),i=(0,O5.executeSync)({schema:e,document:r});return!i.errors&&i.data||(0,v5.invariant)(!1),i.data}});var eU=F(Gv=>{"use strict";m();T();N();Object.defineProperty(Gv,"__esModule",{value:!0});Gv.buildClientSchema=C5;var A5=Yr(),vi=rn(),ZC=Ka(),OT=Np(),R5=Cl(),Si=xt(),P5=si(),Wa=Vi(),F5=Qa(),L5=Dc(),w5=xp();function C5(e,t){(0,ZC.isObjectLike)(e)&&(0,ZC.isObjectLike)(e.__schema)||(0,A5.devAssert)(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0,vi.inspect)(e)}.`);let n=e.__schema,r=(0,OT.keyValMap)(n.types,H=>H.name,H=>h(H));for(let H of[...F5.specifiedScalarTypes,...Wa.introspectionTypes])r[H.name]&&(r[H.name]=H);let i=n.queryType?p(n.queryType):null,a=n.mutationType?p(n.mutationType):null,o=n.subscriptionType?p(n.subscriptionType):null,u=n.directives?n.directives.map(ge):[];return new L5.GraphQLSchema({description:n.description,query:i,mutation:a,subscription:o,types:Object.values(r),directives:u,assumeValid:t==null?void 0:t.assumeValid});function l(H){if(H.kind===Wa.TypeKind.LIST){let he=H.ofType;if(!he)throw new Error("Decorated type deeper than introspection query.");return new Si.GraphQLList(l(he))}if(H.kind===Wa.TypeKind.NON_NULL){let he=H.ofType;if(!he)throw new Error("Decorated type deeper than introspection query.");let Je=l(he);return new Si.GraphQLNonNull((0,Si.assertNullableType)(Je))}return d(H)}function d(H){let he=H.name;if(!he)throw new Error(`Unknown type reference: ${(0,vi.inspect)(H)}.`);let Je=r[he];if(!Je)throw new Error(`Invalid or incomplete schema, unknown type: ${he}. Ensure that a full introspection query is used in order to build a client schema.`);return Je}function p(H){return(0,Si.assertObjectType)(d(H))}function E(H){return(0,Si.assertInterfaceType)(d(H))}function h(H){if(H!=null&&H.name!=null&&H.kind!=null)switch(H.kind){case Wa.TypeKind.SCALAR:return _(H);case Wa.TypeKind.OBJECT:return k(H);case Wa.TypeKind.INTERFACE:return B(H);case Wa.TypeKind.UNION:return K(H);case Wa.TypeKind.ENUM:return ne(H);case Wa.TypeKind.INPUT_OBJECT:return ee(H)}let he=(0,vi.inspect)(H);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${he}.`)}function _(H){return new Si.GraphQLScalarType({name:H.name,description:H.description,specifiedByURL:H.specifiedByURL})}function S(H){if(H.interfaces===null&&H.kind===Wa.TypeKind.INTERFACE)return[];if(!H.interfaces){let he=(0,vi.inspect)(H);throw new Error(`Introspection result missing interfaces: ${he}.`)}return H.interfaces.map(E)}function k(H){return new Si.GraphQLObjectType({name:H.name,description:H.description,interfaces:()=>S(H),fields:()=>oe(H)})}function B(H){return new Si.GraphQLInterfaceType({name:H.name,description:H.description,interfaces:()=>S(H),fields:()=>oe(H)})}function K(H){if(!H.possibleTypes){let he=(0,vi.inspect)(H);throw new Error(`Introspection result missing possibleTypes: ${he}.`)}return new Si.GraphQLUnionType({name:H.name,description:H.description,types:()=>H.possibleTypes.map(p)})}function ne(H){if(!H.enumValues){let he=(0,vi.inspect)(H);throw new Error(`Introspection result missing enumValues: ${he}.`)}return new Si.GraphQLEnumType({name:H.name,description:H.description,values:(0,OT.keyValMap)(H.enumValues,he=>he.name,he=>({description:he.description,deprecationReason:he.deprecationReason}))})}function ee(H){if(!H.inputFields){let he=(0,vi.inspect)(H);throw new Error(`Introspection result missing inputFields: ${he}.`)}return new Si.GraphQLInputObjectType({name:H.name,description:H.description,fields:()=>me(H.inputFields),isOneOf:H.isOneOf})}function oe(H){if(!H.fields)throw new Error(`Introspection result missing fields: ${(0,vi.inspect)(H)}.`);return(0,OT.keyValMap)(H.fields,he=>he.name,de)}function de(H){let he=l(H.type);if(!(0,Si.isOutputType)(he)){let Je=(0,vi.inspect)(he);throw new Error(`Introspection must provide output type for fields, but received: ${Je}.`)}if(!H.args){let Je=(0,vi.inspect)(H);throw new Error(`Introspection result missing field args: ${Je}.`)}return{description:H.description,deprecationReason:H.deprecationReason,type:he,args:me(H.args)}}function me(H){return(0,OT.keyValMap)(H,he=>he.name,pe)}function pe(H){let he=l(H.type);if(!(0,Si.isInputType)(he)){let Qt=(0,vi.inspect)(he);throw new Error(`Introspection must provide input type for arguments, but received: ${Qt}.`)}let Je=H.defaultValue!=null?(0,w5.valueFromAST)((0,R5.parseValue)(H.defaultValue),he):void 0;return{description:H.description,type:he,defaultValue:Je,deprecationReason:H.deprecationReason}}function ge(H){if(!H.args){let he=(0,vi.inspect)(H);throw new Error(`Introspection result missing directive args: ${he}.`)}if(!H.locations){let he=(0,vi.inspect)(H);throw new Error(`Introspection result missing directive locations: ${he}.`)}return new P5.GraphQLDirective({name:H.name,description:H.description,isRepeatable:H.isRepeatable,locations:H.locations.slice(),args:me(H.args)})}}});var Yv=F(bT=>{"use strict";m();T();N();Object.defineProperty(bT,"__esModule",{value:!0});bT.extendSchema=q5;bT.extendSchemaImpl=uU;var U5=Yr(),B5=rn(),k5=Cr(),M5=Du(),Jp=QI(),Qi=Mt(),tU=Ac(),Pn=xt(),Hp=si(),sU=Vi(),oU=Qa(),nU=Dc(),x5=Ql(),Qv=$l(),rU=xp();function q5(e,t,n){(0,nU.assertSchema)(e),t!=null&&t.kind===Qi.Kind.DOCUMENT||(0,U5.devAssert)(!1,"Must provide valid Document AST."),(n==null?void 0:n.assumeValid)!==!0&&(n==null?void 0:n.assumeValidSDL)!==!0&&(0,x5.assertValidSDLExtension)(t,e);let r=e.toConfig(),i=uU(r,t,n);return r===i?e:new nU.GraphQLSchema(i)}function uU(e,t,n){var r,i,a,o;let u=[],l=Object.create(null),d=[],p,E=[];for(let ce of t.definitions)if(ce.kind===Qi.Kind.SCHEMA_DEFINITION)p=ce;else if(ce.kind===Qi.Kind.SCHEMA_EXTENSION)E.push(ce);else if((0,tU.isTypeDefinitionNode)(ce))u.push(ce);else if((0,tU.isTypeExtensionNode)(ce)){let Le=ce.name.value,Se=l[Le];l[Le]=Se?Se.concat([ce]):[ce]}else ce.kind===Qi.Kind.DIRECTIVE_DEFINITION&&d.push(ce);if(Object.keys(l).length===0&&u.length===0&&d.length===0&&E.length===0&&p==null)return e;let h=Object.create(null);for(let ce of e.types)h[ce.name]=ne(ce);for(let ce of u){var _;let Le=ce.name.value;h[Le]=(_=iU[Le])!==null&&_!==void 0?_:kn(ce)}let S=q(q({query:e.query&&B(e.query),mutation:e.mutation&&B(e.mutation),subscription:e.subscription&&B(e.subscription)},p&&Je([p])),Je(E));return W(q({description:(r=p)===null||r===void 0||(i=r.description)===null||i===void 0?void 0:i.value},S),{types:Object.values(h),directives:[...e.directives.map(K),...d.map(hn)],extensions:Object.create(null),astNode:(a=p)!==null&&a!==void 0?a:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(E),assumeValid:(o=n==null?void 0:n.assumeValid)!==null&&o!==void 0?o:!1});function k(ce){return(0,Pn.isListType)(ce)?new Pn.GraphQLList(k(ce.ofType)):(0,Pn.isNonNullType)(ce)?new Pn.GraphQLNonNull(k(ce.ofType)):B(ce)}function B(ce){return h[ce.name]}function K(ce){let Le=ce.toConfig();return new Hp.GraphQLDirective(W(q({},Le),{args:(0,Jp.mapValue)(Le.args,he)}))}function ne(ce){if((0,sU.isIntrospectionType)(ce)||(0,oU.isSpecifiedScalarType)(ce))return ce;if((0,Pn.isScalarType)(ce))return de(ce);if((0,Pn.isObjectType)(ce))return me(ce);if((0,Pn.isInterfaceType)(ce))return pe(ce);if((0,Pn.isUnionType)(ce))return ge(ce);if((0,Pn.isEnumType)(ce))return oe(ce);if((0,Pn.isInputObjectType)(ce))return ee(ce);(0,k5.invariant)(!1,"Unexpected type: "+(0,B5.inspect)(ce))}function ee(ce){var Le;let Se=ce.toConfig(),Me=(Le=l[Se.name])!==null&&Le!==void 0?Le:[];return new Pn.GraphQLInputObjectType(W(q({},Se),{fields:()=>q(q({},(0,Jp.mapValue)(Se.fields,Pt=>W(q({},Pt),{type:k(Pt.type)}))),jr(Me)),extensionASTNodes:Se.extensionASTNodes.concat(Me)}))}function oe(ce){var Le;let Se=ce.toConfig(),Me=(Le=l[ce.name])!==null&&Le!==void 0?Le:[];return new Pn.GraphQLEnumType(W(q({},Se),{values:q(q({},Se.values),or(Me)),extensionASTNodes:Se.extensionASTNodes.concat(Me)}))}function de(ce){var Le;let Se=ce.toConfig(),Me=(Le=l[Se.name])!==null&&Le!==void 0?Le:[],Pt=Se.specifiedByURL;for(let ue of Me){var Z;Pt=(Z=aU(ue))!==null&&Z!==void 0?Z:Pt}return new Pn.GraphQLScalarType(W(q({},Se),{specifiedByURL:Pt,extensionASTNodes:Se.extensionASTNodes.concat(Me)}))}function me(ce){var Le;let Se=ce.toConfig(),Me=(Le=l[Se.name])!==null&&Le!==void 0?Le:[];return new Pn.GraphQLObjectType(W(q({},Se),{interfaces:()=>[...ce.getInterfaces().map(B),...yn(Me)],fields:()=>q(q({},(0,Jp.mapValue)(Se.fields,H)),bt(Me)),extensionASTNodes:Se.extensionASTNodes.concat(Me)}))}function pe(ce){var Le;let Se=ce.toConfig(),Me=(Le=l[Se.name])!==null&&Le!==void 0?Le:[];return new Pn.GraphQLInterfaceType(W(q({},Se),{interfaces:()=>[...ce.getInterfaces().map(B),...yn(Me)],fields:()=>q(q({},(0,Jp.mapValue)(Se.fields,H)),bt(Me)),extensionASTNodes:Se.extensionASTNodes.concat(Me)}))}function ge(ce){var Le;let Se=ce.toConfig(),Me=(Le=l[Se.name])!==null&&Le!==void 0?Le:[];return new Pn.GraphQLUnionType(W(q({},Se),{types:()=>[...ce.getTypes().map(B),...tn(Me)],extensionASTNodes:Se.extensionASTNodes.concat(Me)}))}function H(ce){return W(q({},ce),{type:k(ce.type),args:ce.args&&(0,Jp.mapValue)(ce.args,he)})}function he(ce){return W(q({},ce),{type:k(ce.type)})}function Je(ce){let Le={};for(let Me of ce){var Se;let Pt=(Se=Me.operationTypes)!==null&&Se!==void 0?Se:[];for(let Z of Pt)Le[Z.operation]=Qt(Z.type)}return Le}function Qt(ce){var Le;let Se=ce.name.value,Me=(Le=iU[Se])!==null&&Le!==void 0?Le:h[Se];if(Me===void 0)throw new Error(`Unknown type: "${Se}".`);return Me}function _n(ce){return ce.kind===Qi.Kind.LIST_TYPE?new Pn.GraphQLList(_n(ce.type)):ce.kind===Qi.Kind.NON_NULL_TYPE?new Pn.GraphQLNonNull(_n(ce.type)):Qt(ce)}function hn(ce){var Le;return new Hp.GraphQLDirective({name:ce.name.value,description:(Le=ce.description)===null||Le===void 0?void 0:Le.value,locations:ce.locations.map(({value:Se})=>Se),isRepeatable:ce.repeatable,args:Yt(ce.arguments),astNode:ce})}function bt(ce){let Le=Object.create(null);for(let Pt of ce){var Se;let Z=(Se=Pt.fields)!==null&&Se!==void 0?Se:[];for(let ue of Z){var Me;Le[ue.name.value]={type:_n(ue.type),description:(Me=ue.description)===null||Me===void 0?void 0:Me.value,args:Yt(ue.arguments),deprecationReason:DT(ue),astNode:ue}}}return Le}function Yt(ce){let Le=ce!=null?ce:[],Se=Object.create(null);for(let Pt of Le){var Me;let Z=_n(Pt.type);Se[Pt.name.value]={type:Z,description:(Me=Pt.description)===null||Me===void 0?void 0:Me.value,defaultValue:(0,rU.valueFromAST)(Pt.defaultValue,Z),deprecationReason:DT(Pt),astNode:Pt}}return Se}function jr(ce){let Le=Object.create(null);for(let Pt of ce){var Se;let Z=(Se=Pt.fields)!==null&&Se!==void 0?Se:[];for(let ue of Z){var Me;let je=_n(ue.type);Le[ue.name.value]={type:je,description:(Me=ue.description)===null||Me===void 0?void 0:Me.value,defaultValue:(0,rU.valueFromAST)(ue.defaultValue,je),deprecationReason:DT(ue),astNode:ue}}}return Le}function or(ce){let Le=Object.create(null);for(let Pt of ce){var Se;let Z=(Se=Pt.values)!==null&&Se!==void 0?Se:[];for(let ue of Z){var Me;Le[ue.name.value]={description:(Me=ue.description)===null||Me===void 0?void 0:Me.value,deprecationReason:DT(ue),astNode:ue}}}return Le}function yn(ce){return ce.flatMap(Le=>{var Se,Me;return(Se=(Me=Le.interfaces)===null||Me===void 0?void 0:Me.map(Qt))!==null&&Se!==void 0?Se:[]})}function tn(ce){return ce.flatMap(Le=>{var Se,Me;return(Se=(Me=Le.types)===null||Me===void 0?void 0:Me.map(Qt))!==null&&Se!==void 0?Se:[]})}function kn(ce){var Le;let Se=ce.name.value,Me=(Le=l[Se])!==null&&Le!==void 0?Le:[];switch(ce.kind){case Qi.Kind.OBJECT_TYPE_DEFINITION:{var Pt;let ot=[ce,...Me];return new Pn.GraphQLObjectType({name:Se,description:(Pt=ce.description)===null||Pt===void 0?void 0:Pt.value,interfaces:()=>yn(ot),fields:()=>bt(ot),astNode:ce,extensionASTNodes:Me})}case Qi.Kind.INTERFACE_TYPE_DEFINITION:{var Z;let ot=[ce,...Me];return new Pn.GraphQLInterfaceType({name:Se,description:(Z=ce.description)===null||Z===void 0?void 0:Z.value,interfaces:()=>yn(ot),fields:()=>bt(ot),astNode:ce,extensionASTNodes:Me})}case Qi.Kind.ENUM_TYPE_DEFINITION:{var ue;let ot=[ce,...Me];return new Pn.GraphQLEnumType({name:Se,description:(ue=ce.description)===null||ue===void 0?void 0:ue.value,values:or(ot),astNode:ce,extensionASTNodes:Me})}case Qi.Kind.UNION_TYPE_DEFINITION:{var je;let ot=[ce,...Me];return new Pn.GraphQLUnionType({name:Se,description:(je=ce.description)===null||je===void 0?void 0:je.value,types:()=>tn(ot),astNode:ce,extensionASTNodes:Me})}case Qi.Kind.SCALAR_TYPE_DEFINITION:{var We;return new Pn.GraphQLScalarType({name:Se,description:(We=ce.description)===null||We===void 0?void 0:We.value,specifiedByURL:aU(ce),astNode:ce,extensionASTNodes:Me})}case Qi.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var Vt;let ot=[ce,...Me];return new Pn.GraphQLInputObjectType({name:Se,description:(Vt=ce.description)===null||Vt===void 0?void 0:Vt.value,fields:()=>jr(ot),astNode:ce,extensionASTNodes:Me,isOneOf:V5(ce)})}}}}var iU=(0,M5.keyMap)([...oU.specifiedScalarTypes,...sU.introspectionTypes],e=>e.name);function DT(e){let t=(0,Qv.getDirectiveValues)(Hp.GraphQLDeprecatedDirective,e);return t==null?void 0:t.reason}function aU(e){let t=(0,Qv.getDirectiveValues)(Hp.GraphQLSpecifiedByDirective,e);return t==null?void 0:t.url}function V5(e){return!!(0,Qv.getDirectiveValues)(Hp.GraphQLOneOfDirective,e)}});var lU=F(AT=>{"use strict";m();T();N();Object.defineProperty(AT,"__esModule",{value:!0});AT.buildASTSchema=cU;AT.buildSchema=H5;var K5=Yr(),j5=Mt(),$5=Cl(),G5=si(),Q5=Dc(),Y5=Ql(),J5=Yv();function cU(e,t){e!=null&&e.kind===j5.Kind.DOCUMENT||(0,K5.devAssert)(!1,"Must provide valid Document AST."),(t==null?void 0:t.assumeValid)!==!0&&(t==null?void 0:t.assumeValidSDL)!==!0&&(0,Y5.assertValidSDL)(e);let n={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},r=(0,J5.extendSchemaImpl)(n,e,t);if(r.astNode==null)for(let a of r.types)switch(a.name){case"Query":r.query=a;break;case"Mutation":r.mutation=a;break;case"Subscription":r.subscription=a;break}let i=[...r.directives,...G5.specifiedDirectives.filter(a=>r.directives.every(o=>o.name!==a.name))];return new Q5.GraphQLSchema(W(q({},r),{directives:i}))}function H5(e,t){let n=(0,$5.parse)(e,{noLocation:t==null?void 0:t.noLocation,allowLegacyFragmentVariables:t==null?void 0:t.allowLegacyFragmentVariables});return cU(n,{assumeValidSDL:t==null?void 0:t.assumeValidSDL,assumeValid:t==null?void 0:t.assumeValid})}});var fU=F(Hv=>{"use strict";m();T();N();Object.defineProperty(Hv,"__esModule",{value:!0});Hv.lexicographicSortSchema=n7;var z5=rn(),W5=Cr(),X5=Np(),dU=Tp(),Jr=xt(),Z5=si(),e7=Vi(),t7=Dc();function n7(e){let t=e.toConfig(),n=(0,X5.keyValMap)(Jv(t.types),h=>h.name,E);return new t7.GraphQLSchema(W(q({},t),{types:Object.values(n),directives:Jv(t.directives).map(o),query:a(t.query),mutation:a(t.mutation),subscription:a(t.subscription)}));function r(h){return(0,Jr.isListType)(h)?new Jr.GraphQLList(r(h.ofType)):(0,Jr.isNonNullType)(h)?new Jr.GraphQLNonNull(r(h.ofType)):i(h)}function i(h){return n[h.name]}function a(h){return h&&i(h)}function o(h){let _=h.toConfig();return new Z5.GraphQLDirective(W(q({},_),{locations:pU(_.locations,S=>S),args:u(_.args)}))}function u(h){return RT(h,_=>W(q({},_),{type:r(_.type)}))}function l(h){return RT(h,_=>W(q({},_),{type:r(_.type),args:_.args&&u(_.args)}))}function d(h){return RT(h,_=>W(q({},_),{type:r(_.type)}))}function p(h){return Jv(h).map(i)}function E(h){if((0,Jr.isScalarType)(h)||(0,e7.isIntrospectionType)(h))return h;if((0,Jr.isObjectType)(h)){let _=h.toConfig();return new Jr.GraphQLObjectType(W(q({},_),{interfaces:()=>p(_.interfaces),fields:()=>l(_.fields)}))}if((0,Jr.isInterfaceType)(h)){let _=h.toConfig();return new Jr.GraphQLInterfaceType(W(q({},_),{interfaces:()=>p(_.interfaces),fields:()=>l(_.fields)}))}if((0,Jr.isUnionType)(h)){let _=h.toConfig();return new Jr.GraphQLUnionType(W(q({},_),{types:()=>p(_.types)}))}if((0,Jr.isEnumType)(h)){let _=h.toConfig();return new Jr.GraphQLEnumType(W(q({},_),{values:RT(_.values,S=>S)}))}if((0,Jr.isInputObjectType)(h)){let _=h.toConfig();return new Jr.GraphQLInputObjectType(W(q({},_),{fields:()=>d(_.fields)}))}(0,W5.invariant)(!1,"Unexpected type: "+(0,z5.inspect)(h))}}function RT(e,t){let n=Object.create(null);for(let r of Object.keys(e).sort(dU.naturalCompare))n[r]=t(e[r]);return n}function Jv(e){return pU(e,t=>t.name)}function pU(e,t){return e.slice().sort((n,r)=>{let i=t(n),a=t(r);return(0,dU.naturalCompare)(i,a)})}});var IU=F(zp=>{"use strict";m();T();N();Object.defineProperty(zp,"__esModule",{value:!0});zp.printIntrospectionSchema=c7;zp.printSchema=u7;zp.printType=TU;var r7=rn(),i7=Cr(),a7=op(),Wv=Mt(),PT=_i(),Jl=xt(),Xv=si(),mU=Vi(),s7=Qa(),o7=Rp();function u7(e){return NU(e,t=>!(0,Xv.isSpecifiedDirective)(t),l7)}function c7(e){return NU(e,Xv.isSpecifiedDirective,mU.isIntrospectionType)}function l7(e){return!(0,s7.isSpecifiedScalarType)(e)&&!(0,mU.isIntrospectionType)(e)}function NU(e,t,n){let r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[d7(e),...r.map(a=>y7(a)),...i.map(a=>TU(a))].filter(Boolean).join(` -`)}function W9(e){if(e.description==null&&X9(e))return;let t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);let r=e.getMutationType();r&&t.push(` mutation: ${r.name}`);let i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),Gi(e)+`schema { +`)}function d7(e){if(e.description==null&&p7(e))return;let t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);let r=e.getMutationType();r&&t.push(` mutation: ${r.name}`);let i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),Yi(e)+`schema { ${t.join(` `)} -}`}function X9(e){let t=e.getQueryType();if(t&&t.name!=="Query")return!1;let n=e.getMutationType();if(n&&n.name!=="Mutation")return!1;let r=e.getSubscriptionType();return!(r&&r.name!=="Subscription")}function ZC(e){if((0,xl.isScalarType)(e))return Z9(e);if((0,xl.isObjectType)(e))return e7(e);if((0,xl.isInterfaceType)(e))return t7(e);if((0,xl.isUnionType)(e))return n7(e);if((0,xl.isEnumType)(e))return r7(e);if((0,xl.isInputObjectType)(e))return i7(e);(0,$9.invariant)(!1,"Unexpected type: "+(0,K9.inspect)(e))}function Z9(e){return Gi(e)+`scalar ${e.name}`+s7(e)}function eU(e){let t=e.getInterfaces();return t.length?" implements "+t.map(n=>n.name).join(" & "):""}function e7(e){return Gi(e)+`type ${e.name}`+eU(e)+tU(e)}function t7(e){return Gi(e)+`interface ${e.name}`+eU(e)+tU(e)}function n7(e){let t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return Gi(e)+"union "+e.name+n}function r7(e){let t=e.getValues().map((n,r)=>Gi(n," ",!r)+" "+n.name+qv(n.deprecationReason));return Gi(e)+`enum ${e.name}`+xv(t)}function i7(e){let t=Object.values(e.getFields()).map((n,r)=>Gi(n," ",!r)+" "+Bv(n));return Gi(e)+`input ${e.name}`+(e.isOneOf?" @oneOf":"")+xv(t)}function tU(e){let t=Object.values(e.getFields()).map((n,r)=>Gi(n," ",!r)+" "+n.name+nU(n.args," ")+": "+String(n.type)+qv(n.deprecationReason));return xv(t)}function xv(e){return e.length!==0?` { +}`}function p7(e){let t=e.getQueryType();if(t&&t.name!=="Query")return!1;let n=e.getMutationType();if(n&&n.name!=="Mutation")return!1;let r=e.getSubscriptionType();return!(r&&r.name!=="Subscription")}function TU(e){if((0,Jl.isScalarType)(e))return f7(e);if((0,Jl.isObjectType)(e))return m7(e);if((0,Jl.isInterfaceType)(e))return N7(e);if((0,Jl.isUnionType)(e))return T7(e);if((0,Jl.isEnumType)(e))return E7(e);if((0,Jl.isInputObjectType)(e))return h7(e);(0,i7.invariant)(!1,"Unexpected type: "+(0,r7.inspect)(e))}function f7(e){return Yi(e)+`scalar ${e.name}`+I7(e)}function EU(e){let t=e.getInterfaces();return t.length?" implements "+t.map(n=>n.name).join(" & "):""}function m7(e){return Yi(e)+`type ${e.name}`+EU(e)+hU(e)}function N7(e){return Yi(e)+`interface ${e.name}`+EU(e)+hU(e)}function T7(e){let t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return Yi(e)+"union "+e.name+n}function E7(e){let t=e.getValues().map((n,r)=>Yi(n," ",!r)+" "+n.name+eS(n.deprecationReason));return Yi(e)+`enum ${e.name}`+Zv(t)}function h7(e){let t=Object.values(e.getFields()).map((n,r)=>Yi(n," ",!r)+" "+zv(n));return Yi(e)+`input ${e.name}`+(e.isOneOf?" @oneOf":"")+Zv(t)}function hU(e){let t=Object.values(e.getFields()).map((n,r)=>Yi(n," ",!r)+" "+n.name+yU(n.args," ")+": "+String(n.type)+eS(n.deprecationReason));return Zv(t)}function Zv(e){return e.length!==0?` { `+e.join(` `)+` -}`:""}function nU(e,t=""){return e.length===0?"":e.every(n=>!n.description)?"("+e.map(Bv).join(", ")+")":`( -`+e.map((n,r)=>Gi(n," "+t,!r)+" "+t+Bv(n)).join(` +}`:""}function yU(e,t=""){return e.length===0?"":e.every(n=>!n.description)?"("+e.map(zv).join(", ")+")":`( +`+e.map((n,r)=>Yi(n," "+t,!r)+" "+t+zv(n)).join(` `)+` -`+t+")"}function Bv(e){let t=(0,Y9.astFromValue)(e.defaultValue,e.type),n=e.name+": "+String(e.type);return t&&(n+=` = ${(0,TT.print)(t)}`),n+qv(e.deprecationReason)}function a7(e){return Gi(e)+"directive @"+e.name+nU(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function qv(e){return e==null?"":e!==Mv.DEFAULT_DEPRECATION_REASON?` @deprecated(reason: ${(0,TT.print)({kind:kv.Kind.STRING,value:e})})`:" @deprecated"}function s7(e){return e.specifiedByURL==null?"":` @specifiedBy(url: ${(0,TT.print)({kind:kv.Kind.STRING,value:e.specifiedByURL})})`}function Gi(e,t="",n=!0){let{description:r}=e;if(r==null)return"";let i=(0,TT.print)({kind:kv.Kind.STRING,value:r,block:(0,G9.isPrintableAsBlockString)(r)});return(t&&!n?` +`+t+")"}function zv(e){let t=(0,o7.astFromValue)(e.defaultValue,e.type),n=e.name+": "+String(e.type);return t&&(n+=` = ${(0,PT.print)(t)}`),n+eS(e.deprecationReason)}function y7(e){return Yi(e)+"directive @"+e.name+yU(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function eS(e){return e==null?"":e!==Xv.DEFAULT_DEPRECATION_REASON?` @deprecated(reason: ${(0,PT.print)({kind:Wv.Kind.STRING,value:e})})`:" @deprecated"}function I7(e){return e.specifiedByURL==null?"":` @specifiedBy(url: ${(0,PT.print)({kind:Wv.Kind.STRING,value:e.specifiedByURL})})`}function Yi(e,t="",n=!0){let{description:r}=e;if(r==null)return"";let i=(0,PT.print)({kind:Wv.Kind.STRING,value:r,block:(0,a7.isPrintableAsBlockString)(r)});return(t&&!n?` `+t:t)+i.replace(/\n/g,` `+t)+` -`}});var iU=F(Vv=>{"use strict";m();T();N();Object.defineProperty(Vv,"__esModule",{value:!0});Vv.concatAST=u7;var o7=Ut();function u7(e){let t=[];for(let n of e)t.push(...n.definitions);return{kind:o7.Kind.DOCUMENT,definitions:t}}});var oU=F(jv=>{"use strict";m();T();N();Object.defineProperty(jv,"__esModule",{value:!0});jv.separateOperations=l7;var ET=Ut(),c7=fc();function l7(e){let t=[],n=Object.create(null);for(let i of e.definitions)switch(i.kind){case ET.Kind.OPERATION_DEFINITION:t.push(i);break;case ET.Kind.FRAGMENT_DEFINITION:n[i.name.value]=aU(i.selectionSet);break;default:}let r=Object.create(null);for(let i of t){let a=new Set;for(let u of aU(i.selectionSet))sU(a,n,u);let o=i.name?i.name.value:"";r[o]={kind:ET.Kind.DOCUMENT,definitions:e.definitions.filter(u=>u===i||u.kind===ET.Kind.FRAGMENT_DEFINITION&&a.has(u.name.value))}}return r}function sU(e,t,n){if(!e.has(n)){e.add(n);let r=t[n];if(r!==void 0)for(let i of r)sU(e,t,i)}}function aU(e){let t=[];return(0,c7.visit)(e,{FragmentSpread(n){t.push(n.name.value)}}),t}});var lU=F($v=>{"use strict";m();T();N();Object.defineProperty($v,"__esModule",{value:!0});$v.stripIgnoredCharacters=f7;var d7=Zd(),uU=uN(),cU=fN(),Kv=tf();function f7(e){let t=(0,cU.isSource)(e)?e:new cU.Source(e),n=t.body,r=new uU.Lexer(t),i="",a=!1;for(;r.advance().kind!==Kv.TokenKind.EOF;){let o=r.token,u=o.kind,l=!(0,uU.isPunctuatorTokenKind)(o.kind);a&&(l||o.kind===Kv.TokenKind.SPREAD)&&(i+=" ");let d=n.slice(o.start,o.end);u===Kv.TokenKind.BLOCK_STRING?i+=(0,d7.printBlockString)(o.value,{minimize:!0}):i+=d,a=l}return i}});var fU=F(hT=>{"use strict";m();T();N();Object.defineProperty(hT,"__esModule",{value:!0});hT.assertValidName=T7;hT.isValidNameError=dU;var p7=$r(),m7=Ze(),N7=lf();function T7(e){let t=dU(e);if(t)throw t;return e}function dU(e){if(typeof e=="string"||(0,p7.devAssert)(!1,"Expected name to be a string."),e.startsWith("__"))return new m7.GraphQLError(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{(0,N7.assertName)(e)}catch(t){return t}}});var IU=F(Wa=>{"use strict";m();T();N();Object.defineProperty(Wa,"__esModule",{value:!0});Wa.DangerousChangeType=Wa.BreakingChangeType=void 0;Wa.findBreakingChanges=_7;Wa.findDangerousChanges=v7;var E7=nn(),hU=Fr(),pU=yu(),h7=yi(),Gt=Bt(),y7=Ga(),I7=_f(),g7=Yg(),Mn;Wa.BreakingChangeType=Mn;(function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"})(Mn||(Wa.BreakingChangeType=Mn={}));var ha;Wa.DangerousChangeType=ha;(function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"})(ha||(Wa.DangerousChangeType=ha={}));function _7(e,t){return yU(e,t).filter(n=>n.type in Mn)}function v7(e,t){return yU(e,t).filter(n=>n.type in ha)}function yU(e,t){return[...O7(e,t),...S7(e,t)]}function S7(e,t){let n=[],r=Ls(e.getDirectives(),t.getDirectives());for(let i of r.removed)n.push({type:Mn.DIRECTIVE_REMOVED,description:`${i.name} was removed.`});for(let[i,a]of r.persisted){let o=Ls(i.args,a.args);for(let u of o.added)(0,Gt.isRequiredArgument)(u)&&n.push({type:Mn.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${u.name} on directive ${i.name} was added.`});for(let u of o.removed)n.push({type:Mn.DIRECTIVE_ARG_REMOVED,description:`${u.name} was removed from ${i.name}.`});i.isRepeatable&&!a.isRepeatable&&n.push({type:Mn.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i.name}.`});for(let u of i.locations)a.locations.includes(u)||n.push({type:Mn.DIRECTIVE_LOCATION_REMOVED,description:`${u} was removed from ${i.name}.`})}return n}function O7(e,t){let n=[],r=Ls(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(let i of r.removed)n.push({type:Mn.TYPE_REMOVED,description:(0,y7.isSpecifiedScalarType)(i)?`Standard scalar ${i.name} was removed because it is not referenced anymore.`:`${i.name} was removed.`});for(let[i,a]of r.persisted)(0,Gt.isEnumType)(i)&&(0,Gt.isEnumType)(a)?n.push(...A7(i,a)):(0,Gt.isUnionType)(i)&&(0,Gt.isUnionType)(a)?n.push(...b7(i,a)):(0,Gt.isInputObjectType)(i)&&(0,Gt.isInputObjectType)(a)?n.push(...D7(i,a)):(0,Gt.isObjectType)(i)&&(0,Gt.isObjectType)(a)?n.push(...NU(i,a),...mU(i,a)):(0,Gt.isInterfaceType)(i)&&(0,Gt.isInterfaceType)(a)?n.push(...NU(i,a),...mU(i,a)):i.constructor!==a.constructor&&n.push({type:Mn.TYPE_CHANGED_KIND,description:`${i.name} changed from ${TU(i)} to ${TU(a)}.`});return n}function D7(e,t){let n=[],r=Ls(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of r.added)(0,Gt.isRequiredInputField)(i)?n.push({type:Mn.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i.name} on input type ${e.name} was added.`}):n.push({type:ha.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${i.name} on input type ${e.name} was added.`});for(let i of r.removed)n.push({type:Mn.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,a]of r.persisted)Gf(i.type,a.type)||n.push({type:Mn.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(a.type)}.`});return n}function b7(e,t){let n=[],r=Ls(e.getTypes(),t.getTypes());for(let i of r.added)n.push({type:ha.TYPE_ADDED_TO_UNION,description:`${i.name} was added to union type ${e.name}.`});for(let i of r.removed)n.push({type:Mn.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${e.name}.`});return n}function A7(e,t){let n=[],r=Ls(e.getValues(),t.getValues());for(let i of r.added)n.push({type:ha.VALUE_ADDED_TO_ENUM,description:`${i.name} was added to enum type ${e.name}.`});for(let i of r.removed)n.push({type:Mn.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${e.name}.`});return n}function mU(e,t){let n=[],r=Ls(e.getInterfaces(),t.getInterfaces());for(let i of r.added)n.push({type:ha.IMPLEMENTED_INTERFACE_ADDED,description:`${i.name} added to interfaces implemented by ${e.name}.`});for(let i of r.removed)n.push({type:Mn.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${i.name}.`});return n}function NU(e,t){let n=[],r=Ls(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of r.removed)n.push({type:Mn.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,a]of r.persisted)n.push(...R7(e,i,a)),$f(i.type,a.type)||n.push({type:Mn.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(a.type)}.`});return n}function R7(e,t,n){let r=[],i=Ls(t.args,n.args);for(let a of i.removed)r.push({type:Mn.ARG_REMOVED,description:`${e.name}.${t.name} arg ${a.name} was removed.`});for(let[a,o]of i.persisted)if(!Gf(a.type,o.type))r.push({type:Mn.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${a.name} has changed type from ${String(a.type)} to ${String(o.type)}.`});else if(a.defaultValue!==void 0)if(o.defaultValue===void 0)r.push({type:ha.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${a.name} defaultValue was removed.`});else{let l=EU(a.defaultValue,a.type),d=EU(o.defaultValue,o.type);l!==d&&r.push({type:ha.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${a.name} has changed defaultValue from ${l} to ${d}.`})}for(let a of i.added)(0,Gt.isRequiredArgument)(a)?r.push({type:Mn.REQUIRED_ARG_ADDED,description:`A required arg ${a.name} on ${e.name}.${t.name} was added.`}):r.push({type:ha.OPTIONAL_ARG_ADDED,description:`An optional arg ${a.name} on ${e.name}.${t.name} was added.`});return r}function $f(e,t){return(0,Gt.isListType)(e)?(0,Gt.isListType)(t)&&$f(e.ofType,t.ofType)||(0,Gt.isNonNullType)(t)&&$f(e,t.ofType):(0,Gt.isNonNullType)(e)?(0,Gt.isNonNullType)(t)&&$f(e.ofType,t.ofType):(0,Gt.isNamedType)(t)&&e.name===t.name||(0,Gt.isNonNullType)(t)&&$f(e,t.ofType)}function Gf(e,t){return(0,Gt.isListType)(e)?(0,Gt.isListType)(t)&&Gf(e.ofType,t.ofType):(0,Gt.isNonNullType)(e)?(0,Gt.isNonNullType)(t)&&Gf(e.ofType,t.ofType)||!(0,Gt.isNonNullType)(t)&&Gf(e.ofType,t):(0,Gt.isNamedType)(t)&&e.name===t.name}function TU(e){if((0,Gt.isScalarType)(e))return"a Scalar type";if((0,Gt.isObjectType)(e))return"an Object type";if((0,Gt.isInterfaceType)(e))return"an Interface type";if((0,Gt.isUnionType)(e))return"a Union type";if((0,Gt.isEnumType)(e))return"an Enum type";if((0,Gt.isInputObjectType)(e))return"an Input type";(0,hU.invariant)(!1,"Unexpected type: "+(0,E7.inspect)(e))}function EU(e,t){let n=(0,I7.astFromValue)(e,t);return n!=null||(0,hU.invariant)(!1),(0,h7.print)((0,g7.sortValueNode)(n))}function Ls(e,t){let n=[],r=[],i=[],a=(0,pU.keyMap)(e,({name:u})=>u),o=(0,pU.keyMap)(t,({name:u})=>u);for(let u of e){let l=o[u.name];l===void 0?r.push(u):i.push([u,l])}for(let u of t)a[u.name]===void 0&&n.push(u);return{added:n,persisted:i,removed:r}}});var SU=F(qt=>{"use strict";m();T();N();Object.defineProperty(qt,"__esModule",{value:!0});Object.defineProperty(qt,"BreakingChangeType",{enumerable:!0,get:function(){return yT.BreakingChangeType}});Object.defineProperty(qt,"DangerousChangeType",{enumerable:!0,get:function(){return yT.DangerousChangeType}});Object.defineProperty(qt,"TypeInfo",{enumerable:!0,get:function(){return _U.TypeInfo}});Object.defineProperty(qt,"assertValidName",{enumerable:!0,get:function(){return vU.assertValidName}});Object.defineProperty(qt,"astFromValue",{enumerable:!0,get:function(){return q7.astFromValue}});Object.defineProperty(qt,"buildASTSchema",{enumerable:!0,get:function(){return gU.buildASTSchema}});Object.defineProperty(qt,"buildClientSchema",{enumerable:!0,get:function(){return C7.buildClientSchema}});Object.defineProperty(qt,"buildSchema",{enumerable:!0,get:function(){return gU.buildSchema}});Object.defineProperty(qt,"coerceInputValue",{enumerable:!0,get:function(){return V7.coerceInputValue}});Object.defineProperty(qt,"concatAST",{enumerable:!0,get:function(){return j7.concatAST}});Object.defineProperty(qt,"doTypesOverlap",{enumerable:!0,get:function(){return Qv.doTypesOverlap}});Object.defineProperty(qt,"extendSchema",{enumerable:!0,get:function(){return U7.extendSchema}});Object.defineProperty(qt,"findBreakingChanges",{enumerable:!0,get:function(){return yT.findBreakingChanges}});Object.defineProperty(qt,"findDangerousChanges",{enumerable:!0,get:function(){return yT.findDangerousChanges}});Object.defineProperty(qt,"getIntrospectionQuery",{enumerable:!0,get:function(){return P7.getIntrospectionQuery}});Object.defineProperty(qt,"getOperationAST",{enumerable:!0,get:function(){return F7.getOperationAST}});Object.defineProperty(qt,"getOperationRootType",{enumerable:!0,get:function(){return w7.getOperationRootType}});Object.defineProperty(qt,"introspectionFromSchema",{enumerable:!0,get:function(){return L7.introspectionFromSchema}});Object.defineProperty(qt,"isEqualType",{enumerable:!0,get:function(){return Qv.isEqualType}});Object.defineProperty(qt,"isTypeSubTypeOf",{enumerable:!0,get:function(){return Qv.isTypeSubTypeOf}});Object.defineProperty(qt,"isValidNameError",{enumerable:!0,get:function(){return vU.isValidNameError}});Object.defineProperty(qt,"lexicographicSortSchema",{enumerable:!0,get:function(){return B7.lexicographicSortSchema}});Object.defineProperty(qt,"printIntrospectionSchema",{enumerable:!0,get:function(){return Gv.printIntrospectionSchema}});Object.defineProperty(qt,"printSchema",{enumerable:!0,get:function(){return Gv.printSchema}});Object.defineProperty(qt,"printType",{enumerable:!0,get:function(){return Gv.printType}});Object.defineProperty(qt,"separateOperations",{enumerable:!0,get:function(){return K7.separateOperations}});Object.defineProperty(qt,"stripIgnoredCharacters",{enumerable:!0,get:function(){return $7.stripIgnoredCharacters}});Object.defineProperty(qt,"typeFromAST",{enumerable:!0,get:function(){return k7.typeFromAST}});Object.defineProperty(qt,"valueFromAST",{enumerable:!0,get:function(){return M7.valueFromAST}});Object.defineProperty(qt,"valueFromASTUntyped",{enumerable:!0,get:function(){return x7.valueFromASTUntyped}});Object.defineProperty(qt,"visitWithTypeInfo",{enumerable:!0,get:function(){return _U.visitWithTypeInfo}});var P7=bv(),F7=LC(),w7=CC(),L7=UC(),C7=kC(),gU=YC(),U7=Lv(),B7=HC(),Gv=rU(),k7=Qa(),M7=wf(),x7=KI(),q7=_f(),_U=qN(),V7=p_(),j7=iU(),K7=oU(),$7=lU(),Qv=Nf(),vU=fU(),yT=IU()});var Se=F(q=>{"use strict";m();T();N();Object.defineProperty(q,"__esModule",{value:!0});Object.defineProperty(q,"BREAK",{enumerable:!0,get:function(){return Wt.BREAK}});Object.defineProperty(q,"BreakingChangeType",{enumerable:!0,get:function(){return Xt.BreakingChangeType}});Object.defineProperty(q,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return Ie.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(q,"DangerousChangeType",{enumerable:!0,get:function(){return Xt.DangerousChangeType}});Object.defineProperty(q,"DirectiveLocation",{enumerable:!0,get:function(){return Wt.DirectiveLocation}});Object.defineProperty(q,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return yt.ExecutableDefinitionsRule}});Object.defineProperty(q,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return yt.FieldsOnCorrectTypeRule}});Object.defineProperty(q,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return yt.FragmentsOnCompositeTypesRule}});Object.defineProperty(q,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return Ie.GRAPHQL_MAX_INT}});Object.defineProperty(q,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return Ie.GRAPHQL_MIN_INT}});Object.defineProperty(q,"GraphQLBoolean",{enumerable:!0,get:function(){return Ie.GraphQLBoolean}});Object.defineProperty(q,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return Ie.GraphQLDeprecatedDirective}});Object.defineProperty(q,"GraphQLDirective",{enumerable:!0,get:function(){return Ie.GraphQLDirective}});Object.defineProperty(q,"GraphQLEnumType",{enumerable:!0,get:function(){return Ie.GraphQLEnumType}});Object.defineProperty(q,"GraphQLError",{enumerable:!0,get:function(){return Qf.GraphQLError}});Object.defineProperty(q,"GraphQLFloat",{enumerable:!0,get:function(){return Ie.GraphQLFloat}});Object.defineProperty(q,"GraphQLID",{enumerable:!0,get:function(){return Ie.GraphQLID}});Object.defineProperty(q,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return Ie.GraphQLIncludeDirective}});Object.defineProperty(q,"GraphQLInputObjectType",{enumerable:!0,get:function(){return Ie.GraphQLInputObjectType}});Object.defineProperty(q,"GraphQLInt",{enumerable:!0,get:function(){return Ie.GraphQLInt}});Object.defineProperty(q,"GraphQLInterfaceType",{enumerable:!0,get:function(){return Ie.GraphQLInterfaceType}});Object.defineProperty(q,"GraphQLList",{enumerable:!0,get:function(){return Ie.GraphQLList}});Object.defineProperty(q,"GraphQLNonNull",{enumerable:!0,get:function(){return Ie.GraphQLNonNull}});Object.defineProperty(q,"GraphQLObjectType",{enumerable:!0,get:function(){return Ie.GraphQLObjectType}});Object.defineProperty(q,"GraphQLOneOfDirective",{enumerable:!0,get:function(){return Ie.GraphQLOneOfDirective}});Object.defineProperty(q,"GraphQLScalarType",{enumerable:!0,get:function(){return Ie.GraphQLScalarType}});Object.defineProperty(q,"GraphQLSchema",{enumerable:!0,get:function(){return Ie.GraphQLSchema}});Object.defineProperty(q,"GraphQLSkipDirective",{enumerable:!0,get:function(){return Ie.GraphQLSkipDirective}});Object.defineProperty(q,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return Ie.GraphQLSpecifiedByDirective}});Object.defineProperty(q,"GraphQLString",{enumerable:!0,get:function(){return Ie.GraphQLString}});Object.defineProperty(q,"GraphQLUnionType",{enumerable:!0,get:function(){return Ie.GraphQLUnionType}});Object.defineProperty(q,"Kind",{enumerable:!0,get:function(){return Wt.Kind}});Object.defineProperty(q,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return yt.KnownArgumentNamesRule}});Object.defineProperty(q,"KnownDirectivesRule",{enumerable:!0,get:function(){return yt.KnownDirectivesRule}});Object.defineProperty(q,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return yt.KnownFragmentNamesRule}});Object.defineProperty(q,"KnownTypeNamesRule",{enumerable:!0,get:function(){return yt.KnownTypeNamesRule}});Object.defineProperty(q,"Lexer",{enumerable:!0,get:function(){return Wt.Lexer}});Object.defineProperty(q,"Location",{enumerable:!0,get:function(){return Wt.Location}});Object.defineProperty(q,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return yt.LoneAnonymousOperationRule}});Object.defineProperty(q,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return yt.LoneSchemaDefinitionRule}});Object.defineProperty(q,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return yt.MaxIntrospectionDepthRule}});Object.defineProperty(q,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return yt.NoDeprecatedCustomRule}});Object.defineProperty(q,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return yt.NoFragmentCyclesRule}});Object.defineProperty(q,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return yt.NoSchemaIntrospectionCustomRule}});Object.defineProperty(q,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return yt.NoUndefinedVariablesRule}});Object.defineProperty(q,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return yt.NoUnusedFragmentsRule}});Object.defineProperty(q,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return yt.NoUnusedVariablesRule}});Object.defineProperty(q,"OperationTypeNode",{enumerable:!0,get:function(){return Wt.OperationTypeNode}});Object.defineProperty(q,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return yt.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(q,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return yt.PossibleFragmentSpreadsRule}});Object.defineProperty(q,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return yt.PossibleTypeExtensionsRule}});Object.defineProperty(q,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return yt.ProvidedRequiredArgumentsRule}});Object.defineProperty(q,"ScalarLeafsRule",{enumerable:!0,get:function(){return yt.ScalarLeafsRule}});Object.defineProperty(q,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return Ie.SchemaMetaFieldDef}});Object.defineProperty(q,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return yt.SingleFieldSubscriptionsRule}});Object.defineProperty(q,"Source",{enumerable:!0,get:function(){return Wt.Source}});Object.defineProperty(q,"Token",{enumerable:!0,get:function(){return Wt.Token}});Object.defineProperty(q,"TokenKind",{enumerable:!0,get:function(){return Wt.TokenKind}});Object.defineProperty(q,"TypeInfo",{enumerable:!0,get:function(){return Xt.TypeInfo}});Object.defineProperty(q,"TypeKind",{enumerable:!0,get:function(){return Ie.TypeKind}});Object.defineProperty(q,"TypeMetaFieldDef",{enumerable:!0,get:function(){return Ie.TypeMetaFieldDef}});Object.defineProperty(q,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return Ie.TypeNameMetaFieldDef}});Object.defineProperty(q,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return yt.UniqueArgumentDefinitionNamesRule}});Object.defineProperty(q,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return yt.UniqueArgumentNamesRule}});Object.defineProperty(q,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return yt.UniqueDirectiveNamesRule}});Object.defineProperty(q,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return yt.UniqueDirectivesPerLocationRule}});Object.defineProperty(q,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return yt.UniqueEnumValueNamesRule}});Object.defineProperty(q,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return yt.UniqueFieldDefinitionNamesRule}});Object.defineProperty(q,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return yt.UniqueFragmentNamesRule}});Object.defineProperty(q,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return yt.UniqueInputFieldNamesRule}});Object.defineProperty(q,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return yt.UniqueOperationNamesRule}});Object.defineProperty(q,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return yt.UniqueOperationTypesRule}});Object.defineProperty(q,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return yt.UniqueTypeNamesRule}});Object.defineProperty(q,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return yt.UniqueVariableNamesRule}});Object.defineProperty(q,"ValidationContext",{enumerable:!0,get:function(){return yt.ValidationContext}});Object.defineProperty(q,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return yt.ValuesOfCorrectTypeRule}});Object.defineProperty(q,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return yt.VariablesAreInputTypesRule}});Object.defineProperty(q,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return yt.VariablesInAllowedPositionRule}});Object.defineProperty(q,"__Directive",{enumerable:!0,get:function(){return Ie.__Directive}});Object.defineProperty(q,"__DirectiveLocation",{enumerable:!0,get:function(){return Ie.__DirectiveLocation}});Object.defineProperty(q,"__EnumValue",{enumerable:!0,get:function(){return Ie.__EnumValue}});Object.defineProperty(q,"__Field",{enumerable:!0,get:function(){return Ie.__Field}});Object.defineProperty(q,"__InputValue",{enumerable:!0,get:function(){return Ie.__InputValue}});Object.defineProperty(q,"__Schema",{enumerable:!0,get:function(){return Ie.__Schema}});Object.defineProperty(q,"__Type",{enumerable:!0,get:function(){return Ie.__Type}});Object.defineProperty(q,"__TypeKind",{enumerable:!0,get:function(){return Ie.__TypeKind}});Object.defineProperty(q,"assertAbstractType",{enumerable:!0,get:function(){return Ie.assertAbstractType}});Object.defineProperty(q,"assertCompositeType",{enumerable:!0,get:function(){return Ie.assertCompositeType}});Object.defineProperty(q,"assertDirective",{enumerable:!0,get:function(){return Ie.assertDirective}});Object.defineProperty(q,"assertEnumType",{enumerable:!0,get:function(){return Ie.assertEnumType}});Object.defineProperty(q,"assertEnumValueName",{enumerable:!0,get:function(){return Ie.assertEnumValueName}});Object.defineProperty(q,"assertInputObjectType",{enumerable:!0,get:function(){return Ie.assertInputObjectType}});Object.defineProperty(q,"assertInputType",{enumerable:!0,get:function(){return Ie.assertInputType}});Object.defineProperty(q,"assertInterfaceType",{enumerable:!0,get:function(){return Ie.assertInterfaceType}});Object.defineProperty(q,"assertLeafType",{enumerable:!0,get:function(){return Ie.assertLeafType}});Object.defineProperty(q,"assertListType",{enumerable:!0,get:function(){return Ie.assertListType}});Object.defineProperty(q,"assertName",{enumerable:!0,get:function(){return Ie.assertName}});Object.defineProperty(q,"assertNamedType",{enumerable:!0,get:function(){return Ie.assertNamedType}});Object.defineProperty(q,"assertNonNullType",{enumerable:!0,get:function(){return Ie.assertNonNullType}});Object.defineProperty(q,"assertNullableType",{enumerable:!0,get:function(){return Ie.assertNullableType}});Object.defineProperty(q,"assertObjectType",{enumerable:!0,get:function(){return Ie.assertObjectType}});Object.defineProperty(q,"assertOutputType",{enumerable:!0,get:function(){return Ie.assertOutputType}});Object.defineProperty(q,"assertScalarType",{enumerable:!0,get:function(){return Ie.assertScalarType}});Object.defineProperty(q,"assertSchema",{enumerable:!0,get:function(){return Ie.assertSchema}});Object.defineProperty(q,"assertType",{enumerable:!0,get:function(){return Ie.assertType}});Object.defineProperty(q,"assertUnionType",{enumerable:!0,get:function(){return Ie.assertUnionType}});Object.defineProperty(q,"assertValidName",{enumerable:!0,get:function(){return Xt.assertValidName}});Object.defineProperty(q,"assertValidSchema",{enumerable:!0,get:function(){return Ie.assertValidSchema}});Object.defineProperty(q,"assertWrappingType",{enumerable:!0,get:function(){return Ie.assertWrappingType}});Object.defineProperty(q,"astFromValue",{enumerable:!0,get:function(){return Xt.astFromValue}});Object.defineProperty(q,"buildASTSchema",{enumerable:!0,get:function(){return Xt.buildASTSchema}});Object.defineProperty(q,"buildClientSchema",{enumerable:!0,get:function(){return Xt.buildClientSchema}});Object.defineProperty(q,"buildSchema",{enumerable:!0,get:function(){return Xt.buildSchema}});Object.defineProperty(q,"coerceInputValue",{enumerable:!0,get:function(){return Xt.coerceInputValue}});Object.defineProperty(q,"concatAST",{enumerable:!0,get:function(){return Xt.concatAST}});Object.defineProperty(q,"createSourceEventStream",{enumerable:!0,get:function(){return Xa.createSourceEventStream}});Object.defineProperty(q,"defaultFieldResolver",{enumerable:!0,get:function(){return Xa.defaultFieldResolver}});Object.defineProperty(q,"defaultTypeResolver",{enumerable:!0,get:function(){return Xa.defaultTypeResolver}});Object.defineProperty(q,"doTypesOverlap",{enumerable:!0,get:function(){return Xt.doTypesOverlap}});Object.defineProperty(q,"execute",{enumerable:!0,get:function(){return Xa.execute}});Object.defineProperty(q,"executeSync",{enumerable:!0,get:function(){return Xa.executeSync}});Object.defineProperty(q,"extendSchema",{enumerable:!0,get:function(){return Xt.extendSchema}});Object.defineProperty(q,"findBreakingChanges",{enumerable:!0,get:function(){return Xt.findBreakingChanges}});Object.defineProperty(q,"findDangerousChanges",{enumerable:!0,get:function(){return Xt.findDangerousChanges}});Object.defineProperty(q,"formatError",{enumerable:!0,get:function(){return Qf.formatError}});Object.defineProperty(q,"getArgumentValues",{enumerable:!0,get:function(){return Xa.getArgumentValues}});Object.defineProperty(q,"getDirectiveValues",{enumerable:!0,get:function(){return Xa.getDirectiveValues}});Object.defineProperty(q,"getEnterLeaveForKind",{enumerable:!0,get:function(){return Wt.getEnterLeaveForKind}});Object.defineProperty(q,"getIntrospectionQuery",{enumerable:!0,get:function(){return Xt.getIntrospectionQuery}});Object.defineProperty(q,"getLocation",{enumerable:!0,get:function(){return Wt.getLocation}});Object.defineProperty(q,"getNamedType",{enumerable:!0,get:function(){return Ie.getNamedType}});Object.defineProperty(q,"getNullableType",{enumerable:!0,get:function(){return Ie.getNullableType}});Object.defineProperty(q,"getOperationAST",{enumerable:!0,get:function(){return Xt.getOperationAST}});Object.defineProperty(q,"getOperationRootType",{enumerable:!0,get:function(){return Xt.getOperationRootType}});Object.defineProperty(q,"getVariableValues",{enumerable:!0,get:function(){return Xa.getVariableValues}});Object.defineProperty(q,"getVisitFn",{enumerable:!0,get:function(){return Wt.getVisitFn}});Object.defineProperty(q,"graphql",{enumerable:!0,get:function(){return DU.graphql}});Object.defineProperty(q,"graphqlSync",{enumerable:!0,get:function(){return DU.graphqlSync}});Object.defineProperty(q,"introspectionFromSchema",{enumerable:!0,get:function(){return Xt.introspectionFromSchema}});Object.defineProperty(q,"introspectionTypes",{enumerable:!0,get:function(){return Ie.introspectionTypes}});Object.defineProperty(q,"isAbstractType",{enumerable:!0,get:function(){return Ie.isAbstractType}});Object.defineProperty(q,"isCompositeType",{enumerable:!0,get:function(){return Ie.isCompositeType}});Object.defineProperty(q,"isConstValueNode",{enumerable:!0,get:function(){return Wt.isConstValueNode}});Object.defineProperty(q,"isDefinitionNode",{enumerable:!0,get:function(){return Wt.isDefinitionNode}});Object.defineProperty(q,"isDirective",{enumerable:!0,get:function(){return Ie.isDirective}});Object.defineProperty(q,"isEnumType",{enumerable:!0,get:function(){return Ie.isEnumType}});Object.defineProperty(q,"isEqualType",{enumerable:!0,get:function(){return Xt.isEqualType}});Object.defineProperty(q,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return Wt.isExecutableDefinitionNode}});Object.defineProperty(q,"isInputObjectType",{enumerable:!0,get:function(){return Ie.isInputObjectType}});Object.defineProperty(q,"isInputType",{enumerable:!0,get:function(){return Ie.isInputType}});Object.defineProperty(q,"isInterfaceType",{enumerable:!0,get:function(){return Ie.isInterfaceType}});Object.defineProperty(q,"isIntrospectionType",{enumerable:!0,get:function(){return Ie.isIntrospectionType}});Object.defineProperty(q,"isLeafType",{enumerable:!0,get:function(){return Ie.isLeafType}});Object.defineProperty(q,"isListType",{enumerable:!0,get:function(){return Ie.isListType}});Object.defineProperty(q,"isNamedType",{enumerable:!0,get:function(){return Ie.isNamedType}});Object.defineProperty(q,"isNonNullType",{enumerable:!0,get:function(){return Ie.isNonNullType}});Object.defineProperty(q,"isNullableType",{enumerable:!0,get:function(){return Ie.isNullableType}});Object.defineProperty(q,"isObjectType",{enumerable:!0,get:function(){return Ie.isObjectType}});Object.defineProperty(q,"isOutputType",{enumerable:!0,get:function(){return Ie.isOutputType}});Object.defineProperty(q,"isRequiredArgument",{enumerable:!0,get:function(){return Ie.isRequiredArgument}});Object.defineProperty(q,"isRequiredInputField",{enumerable:!0,get:function(){return Ie.isRequiredInputField}});Object.defineProperty(q,"isScalarType",{enumerable:!0,get:function(){return Ie.isScalarType}});Object.defineProperty(q,"isSchema",{enumerable:!0,get:function(){return Ie.isSchema}});Object.defineProperty(q,"isSelectionNode",{enumerable:!0,get:function(){return Wt.isSelectionNode}});Object.defineProperty(q,"isSpecifiedDirective",{enumerable:!0,get:function(){return Ie.isSpecifiedDirective}});Object.defineProperty(q,"isSpecifiedScalarType",{enumerable:!0,get:function(){return Ie.isSpecifiedScalarType}});Object.defineProperty(q,"isType",{enumerable:!0,get:function(){return Ie.isType}});Object.defineProperty(q,"isTypeDefinitionNode",{enumerable:!0,get:function(){return Wt.isTypeDefinitionNode}});Object.defineProperty(q,"isTypeExtensionNode",{enumerable:!0,get:function(){return Wt.isTypeExtensionNode}});Object.defineProperty(q,"isTypeNode",{enumerable:!0,get:function(){return Wt.isTypeNode}});Object.defineProperty(q,"isTypeSubTypeOf",{enumerable:!0,get:function(){return Xt.isTypeSubTypeOf}});Object.defineProperty(q,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return Wt.isTypeSystemDefinitionNode}});Object.defineProperty(q,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return Wt.isTypeSystemExtensionNode}});Object.defineProperty(q,"isUnionType",{enumerable:!0,get:function(){return Ie.isUnionType}});Object.defineProperty(q,"isValidNameError",{enumerable:!0,get:function(){return Xt.isValidNameError}});Object.defineProperty(q,"isValueNode",{enumerable:!0,get:function(){return Wt.isValueNode}});Object.defineProperty(q,"isWrappingType",{enumerable:!0,get:function(){return Ie.isWrappingType}});Object.defineProperty(q,"lexicographicSortSchema",{enumerable:!0,get:function(){return Xt.lexicographicSortSchema}});Object.defineProperty(q,"locatedError",{enumerable:!0,get:function(){return Qf.locatedError}});Object.defineProperty(q,"parse",{enumerable:!0,get:function(){return Wt.parse}});Object.defineProperty(q,"parseConstValue",{enumerable:!0,get:function(){return Wt.parseConstValue}});Object.defineProperty(q,"parseType",{enumerable:!0,get:function(){return Wt.parseType}});Object.defineProperty(q,"parseValue",{enumerable:!0,get:function(){return Wt.parseValue}});Object.defineProperty(q,"print",{enumerable:!0,get:function(){return Wt.print}});Object.defineProperty(q,"printError",{enumerable:!0,get:function(){return Qf.printError}});Object.defineProperty(q,"printIntrospectionSchema",{enumerable:!0,get:function(){return Xt.printIntrospectionSchema}});Object.defineProperty(q,"printLocation",{enumerable:!0,get:function(){return Wt.printLocation}});Object.defineProperty(q,"printSchema",{enumerable:!0,get:function(){return Xt.printSchema}});Object.defineProperty(q,"printSourceLocation",{enumerable:!0,get:function(){return Wt.printSourceLocation}});Object.defineProperty(q,"printType",{enumerable:!0,get:function(){return Xt.printType}});Object.defineProperty(q,"recommendedRules",{enumerable:!0,get:function(){return yt.recommendedRules}});Object.defineProperty(q,"resolveObjMapThunk",{enumerable:!0,get:function(){return Ie.resolveObjMapThunk}});Object.defineProperty(q,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return Ie.resolveReadonlyArrayThunk}});Object.defineProperty(q,"responsePathAsArray",{enumerable:!0,get:function(){return Xa.responsePathAsArray}});Object.defineProperty(q,"separateOperations",{enumerable:!0,get:function(){return Xt.separateOperations}});Object.defineProperty(q,"specifiedDirectives",{enumerable:!0,get:function(){return Ie.specifiedDirectives}});Object.defineProperty(q,"specifiedRules",{enumerable:!0,get:function(){return yt.specifiedRules}});Object.defineProperty(q,"specifiedScalarTypes",{enumerable:!0,get:function(){return Ie.specifiedScalarTypes}});Object.defineProperty(q,"stripIgnoredCharacters",{enumerable:!0,get:function(){return Xt.stripIgnoredCharacters}});Object.defineProperty(q,"subscribe",{enumerable:!0,get:function(){return Xa.subscribe}});Object.defineProperty(q,"syntaxError",{enumerable:!0,get:function(){return Qf.syntaxError}});Object.defineProperty(q,"typeFromAST",{enumerable:!0,get:function(){return Xt.typeFromAST}});Object.defineProperty(q,"validate",{enumerable:!0,get:function(){return yt.validate}});Object.defineProperty(q,"validateSchema",{enumerable:!0,get:function(){return Ie.validateSchema}});Object.defineProperty(q,"valueFromAST",{enumerable:!0,get:function(){return Xt.valueFromAST}});Object.defineProperty(q,"valueFromASTUntyped",{enumerable:!0,get:function(){return Xt.valueFromASTUntyped}});Object.defineProperty(q,"version",{enumerable:!0,get:function(){return OU.version}});Object.defineProperty(q,"versionInfo",{enumerable:!0,get:function(){return OU.versionInfo}});Object.defineProperty(q,"visit",{enumerable:!0,get:function(){return Wt.visit}});Object.defineProperty(q,"visitInParallel",{enumerable:!0,get:function(){return Wt.visitInParallel}});Object.defineProperty(q,"visitWithTypeInfo",{enumerable:!0,get:function(){return Xt.visitWithTypeInfo}});var OU=IF(),DU=mC(),Ie=EC(),Wt=yC(),Xa=bC(),yt=FC(),Qf=wC(),Xt=SU()});var Hn=F(R=>{"use strict";m();T();N();Object.defineProperty(R,"__esModule",{value:!0});R.FIELD=R.EXTENSIONS=R.EXTENDS=R.EXTERNAL=R.EXECUTION=R.ENUM_VALUE_UPPER=R.ENUM_VALUE=R.ENUM_UPPER=R.ENUM=R.ENTITY_UNION=R.ENTITIES_FIELD=R.ENTITIES=R.EDFS_REDIS_SUBSCRIBE=R.EDFS_REDIS_PUBLISH=R.EDFS_NATS_STREAM_CONFIGURATION=R.EDFS_PUBLISH_RESULT=R.EDFS_NATS_SUBSCRIBE=R.EDFS_NATS_REQUEST=R.EDFS_NATS_PUBLISH=R.EDFS_KAFKA_SUBSCRIBE=R.EDFS_KAFKA_PUBLISH=R.DIRECTIVE_DEFINITION=R.DESCRIPTION_OVERRIDE=R.DEPRECATED_DEFAULT_ARGUMENT_VALUE=R.DEPRECATED=R.DEFAULT_SUBSCRIPTION=R.DEFAULT_QUERY=R.DEFAULT_MUTATION=R.DEFAULT_EDFS_PROVIDER_ID=R.DEFAULT=R.COST=R.CONTEXT=R.CONNECT_FIELD_RESOLVER=R.CONSUMER_NAME=R.CONSUMER_INACTIVE_THRESHOLD=R.CONFIGURE_CHILD_DESCRIPTIONS=R.CONFIGURE_DESCRIPTION=R.CONDITION=R.COMPOSE_DIRECTIVE=R.CHANNELS=R.CHANNEL=R.BOOLEAN_SCALAR=R.BOOLEAN=R.ARGUMENT_DEFINITION_UPPER=R.AUTHENTICATED=R.ARGUMENT=R.ANY_SCALAR=R.AND_UPPER=R.ASSUMED_SIZE=R.AS=void 0;R.NON_NULLABLE_BOOLEAN=R.NON_NULLABLE_EDFS_PUBLISH_EVENT_RESULT=R.NAME=R.NOT_APPLICABLE=R.PROVIDER_TYPE_REDIS=R.PROVIDER_TYPE_NATS=R.PROVIDER_TYPE_KAFKA=R.PROPAGATE=R.MUTATION_UPPER=R.MUTATION=R.NUMBER=R.LITERAL_PERIOD=R.LITERAL_NEW_LINE=R.LITERAL_SPACE=R.LIST=R.LINK_PURPOSE=R.LINK_IMPORT=R.LIST_SIZE=R.LINK=R.LEVELS=R.LEFT_PARENTHESIS=R.KEY=R.INTERFACE_OBJECT=R.INTERFACE_UPPER=R.INTERFACE=R.INT_SCALAR=R.INPUT_VALUE=R.INPUT_OBJECT_UPPER=R.INPUT_OBJECT=R.INPUT_FIELD_DEFINITION_UPPER=R.INPUT_FIELD=R.INPUT=R.INLINE_FRAGMENT_UPPER=R.INLINE_FRAGMENT=R.INACCESSIBLE=R.IN_UPPER=R.IMPORT=R.ID_SCALAR=R.HYPHEN_JOIN=R.FROM=R.FRAGMENT_SPREAD_UPPER=R.FRAGMENT_DEFINITION_UPPER=R.FOR=R.FLOAT_SCALAR=R.FIRST_ORDINAL=R.FIELD_DEFINITION_UPPER=R.FIELDS=R.FIELD_SET_SCALAR=R.FIELD_UPPER=R.FIELD_PATH=void 0;R.SUBSCRIPTION_FILTER=R.SUBSCRIPTION_FIELD_CONDITION=R.SUBSCRIPTION=R.SUBJECTS=R.SUBJECT=R.STRING_SCALAR=R.STRING=R.STREAM_NAME=R.STREAM_CONFIGURATION=R.SPECIFIED_BY=R.SLICING_ARGUMENTS=R.SIZED_FIELDS=R.SHAREABLE=R.SERVICE_FIELD=R.SERVICE_OBJECT=R.SEMANTIC_NON_NULL=R.SELECTION_REPRESENTATION=R.SECURITY=R.SCOPE_SCALAR=R.SCOPES=R.SCHEMA_UPPER=R.SCHEMA=R.SCALAR_UPPER=R.SCALAR=R.RESOLVABLE=R.REQUIRES_SCOPES=R.REQUIRES=R.REQUIRE_ONE_SLICING_ARGUMENT=R.REQUIRE_FETCH_REASONS=R.REQUEST=R.REASON=R.QUOTATION_JOIN=R.QUERY_UPPER=R.QUERY=R.PUBLISH=R.PROVIDES=R.PROVIDER_ID=R.PARENT_EXTENSION_DATA_MAP=R.PARENT_DEFINITION_DATA_MAP=R.PARENT_DEFINITION_DATA=R.OVERRIDE=R.OR_UPPER=R.OBJECT_UPPER=R.OBJECT=R.OPERATION_TO_DEFAULT=R.ONE_OF=R.NULL=R.NOT_UPPER=R.NON_NULLABLE_STRING=R.NON_NULLABLE_INT=void 0;R.NON_REPEATABLE_PERSISTED_DIRECTIVES=R.INTERFACE_NODE_KINDS=R.OUTPUT_NODE_KINDS=R.INPUT_NODE_KINDS=R.IGNORED_FIELDS=R.INHERITABLE_DIRECTIVE_NAMES=R.PERSISTED_CLIENT_DIRECTIVES=R.AUTHORIZATION_DIRECTIVES=R.ROOT_TYPE_NAMES=R.EXECUTABLE_DIRECTIVE_LOCATIONS=R.WEIGHT=R.VARIABLE_DEFINITION_UPPER=R.VALUES=R.URL_LOWER=R.UNION_UPPER=R.UNION=R.TYPENAME=R.TOPICS=R.TOPIC=R.TAG=R.SUCCESS=R.SUBSCRIPTION_UPPER=R.SUBSCRIBE=R.SUBSCRIPTION_FILTER_VALUE=R.SUBSCRIPTION_FILTER_CONDITION=void 0;var Za=Se();R.AS="as";R.ASSUMED_SIZE="assumedSize";R.AND_UPPER="AND";R.ANY_SCALAR="_Any";R.ARGUMENT="argument";R.AUTHENTICATED="authenticated";R.ARGUMENT_DEFINITION_UPPER="ARGUMENT_DEFINITION";R.BOOLEAN="boolean";R.BOOLEAN_SCALAR="Boolean";R.CHANNEL="channel";R.CHANNELS="channels";R.COMPOSE_DIRECTIVE="composeDirective";R.CONDITION="condition";R.CONFIGURE_DESCRIPTION="openfed__configureDescription";R.CONFIGURE_CHILD_DESCRIPTIONS="openfed__configureChildDescriptions";R.CONSUMER_INACTIVE_THRESHOLD="consumerInactiveThreshold";R.CONSUMER_NAME="consumerName";R.CONNECT_FIELD_RESOLVER="connect__fieldResolver";R.CONTEXT="context";R.COST="cost";R.DEFAULT="default";R.DEFAULT_EDFS_PROVIDER_ID="default";R.DEFAULT_MUTATION="Mutation";R.DEFAULT_QUERY="Query";R.DEFAULT_SUBSCRIPTION="Subscription";R.DEPRECATED="deprecated";R.DEPRECATED_DEFAULT_ARGUMENT_VALUE="No longer supported";R.DESCRIPTION_OVERRIDE="descriptionOverride";R.DIRECTIVE_DEFINITION="directive definition";R.EDFS_KAFKA_PUBLISH="edfs__kafkaPublish";R.EDFS_KAFKA_SUBSCRIBE="edfs__kafkaSubscribe";R.EDFS_NATS_PUBLISH="edfs__natsPublish";R.EDFS_NATS_REQUEST="edfs__natsRequest";R.EDFS_NATS_SUBSCRIBE="edfs__natsSubscribe";R.EDFS_PUBLISH_RESULT="edfs__PublishResult";R.EDFS_NATS_STREAM_CONFIGURATION="edfs__NatsStreamConfiguration";R.EDFS_REDIS_PUBLISH="edfs__redisPublish";R.EDFS_REDIS_SUBSCRIBE="edfs__redisSubscribe";R.ENTITIES="entities";R.ENTITIES_FIELD="_entities";R.ENTITY_UNION="_Entity";R.ENUM="Enum";R.ENUM_UPPER="ENUM";R.ENUM_VALUE="Enum Value";R.ENUM_VALUE_UPPER="ENUM_VALUE";R.EXECUTION="EXECUTION";R.EXTERNAL="external";R.EXTENDS="extends";R.EXTENSIONS="extensions";R.FIELD="field";R.FIELD_PATH="fieldPath";R.FIELD_UPPER="FIELD";R.FIELD_SET_SCALAR="openfed__FieldSet";R.FIELDS="fields";R.FIELD_DEFINITION_UPPER="FIELD_DEFINITION";R.FIRST_ORDINAL="1st";R.FLOAT_SCALAR="Float";R.FOR="for";R.FRAGMENT_DEFINITION_UPPER="FRAGMENT_DEFINITION";R.FRAGMENT_SPREAD_UPPER="FRAGMENT_SPREAD";R.FROM="from";R.HYPHEN_JOIN=` - -`;R.ID_SCALAR="ID";R.IMPORT="import";R.IN_UPPER="IN";R.INACCESSIBLE="inaccessible";R.INLINE_FRAGMENT="inlineFragment";R.INLINE_FRAGMENT_UPPER="INLINE_FRAGMENT";R.INPUT="Input";R.INPUT_FIELD="Input field";R.INPUT_FIELD_DEFINITION_UPPER="INPUT_FIELD_DEFINITION";R.INPUT_OBJECT="Input Object";R.INPUT_OBJECT_UPPER="INPUT_OBJECT";R.INPUT_VALUE="Input Value";R.INT_SCALAR="Int";R.INTERFACE="Interface";R.INTERFACE_UPPER="INTERFACE";R.INTERFACE_OBJECT="interfaceObject";R.KEY="key";R.LEFT_PARENTHESIS="(";R.LEVELS="levels";R.LINK="link";R.LIST_SIZE="listSize";R.LINK_IMPORT="link__Import";R.LINK_PURPOSE="link__Purpose";R.LIST="list";R.LITERAL_SPACE=" ";R.LITERAL_NEW_LINE=` -`;R.LITERAL_PERIOD=".";R.NUMBER="number";R.MUTATION="Mutation";R.MUTATION_UPPER="MUTATION";R.PROPAGATE="propagate";R.PROVIDER_TYPE_KAFKA="kafka";R.PROVIDER_TYPE_NATS="nats";R.PROVIDER_TYPE_REDIS="redis";R.NOT_APPLICABLE="N/A";R.NAME="name";R.NON_NULLABLE_EDFS_PUBLISH_EVENT_RESULT="edfs__PublishResult!";R.NON_NULLABLE_BOOLEAN="Boolean!";R.NON_NULLABLE_INT="Int!";R.NON_NULLABLE_STRING="String!";R.NOT_UPPER="NOT";R.NULL="Null";R.ONE_OF="oneOf";R.OPERATION_TO_DEFAULT="operationTypeNodeToDefaultType";R.OBJECT="Object";R.OBJECT_UPPER="OBJECT";R.OR_UPPER="OR";R.OVERRIDE="override";R.PARENT_DEFINITION_DATA="parentDefinitionDataByTypeName";R.PARENT_DEFINITION_DATA_MAP="parentDefinitionDataByParentTypeName";R.PARENT_EXTENSION_DATA_MAP="parentExtensionDataByParentTypeName";R.PROVIDER_ID="providerId";R.PROVIDES="provides";R.PUBLISH="publish";R.QUERY="Query";R.QUERY_UPPER="QUERY";R.QUOTATION_JOIN='", "';R.REASON="reason";R.REQUEST="request";R.REQUIRE_FETCH_REASONS="openfed__requireFetchReasons";R.REQUIRE_ONE_SLICING_ARGUMENT="requireOneSlicingArgument";R.REQUIRES="requires";R.REQUIRES_SCOPES="requiresScopes";R.RESOLVABLE="resolvable";R.SCALAR="Scalar";R.SCALAR_UPPER="SCALAR";R.SCHEMA="schema";R.SCHEMA_UPPER="SCHEMA";R.SCOPES="scopes";R.SCOPE_SCALAR="openfed__Scope";R.SECURITY="SECURITY";R.SELECTION_REPRESENTATION=" { ... }";R.SEMANTIC_NON_NULL="semanticNonNull";R.SERVICE_OBJECT="_Service";R.SERVICE_FIELD="_service";R.SHAREABLE="shareable";R.SIZED_FIELDS="sizedFields";R.SLICING_ARGUMENTS="slicingArguments";R.SPECIFIED_BY="specifiedBy";R.STREAM_CONFIGURATION="streamConfiguration";R.STREAM_NAME="streamName";R.STRING="string";R.STRING_SCALAR="String";R.SUBJECT="subject";R.SUBJECTS="subjects";R.SUBSCRIPTION="Subscription";R.SUBSCRIPTION_FIELD_CONDITION="openfed__SubscriptionFieldCondition";R.SUBSCRIPTION_FILTER="openfed__subscriptionFilter";R.SUBSCRIPTION_FILTER_CONDITION="openfed__SubscriptionFilterCondition";R.SUBSCRIPTION_FILTER_VALUE="openfed__SubscriptionFilterValue";R.SUBSCRIBE="subscribe";R.SUBSCRIPTION_UPPER="SUBSCRIPTION";R.SUCCESS="success";R.TAG="tag";R.TOPIC="topic";R.TOPICS="topics";R.TYPENAME="__typename";R.UNION="Union";R.UNION_UPPER="UNION";R.URL_LOWER="url";R.VALUES="values";R.VARIABLE_DEFINITION_UPPER="VARIABLE_DEFINITION";R.WEIGHT="weight";R.EXECUTABLE_DIRECTIVE_LOCATIONS=new Set([R.FIELD_UPPER,R.FRAGMENT_DEFINITION_UPPER,R.FRAGMENT_SPREAD_UPPER,R.INLINE_FRAGMENT_UPPER,R.MUTATION_UPPER,R.QUERY_UPPER,R.SUBSCRIPTION_UPPER]);R.ROOT_TYPE_NAMES=new Set([R.MUTATION,R.QUERY,R.SUBSCRIPTION]);R.AUTHORIZATION_DIRECTIVES=new Set([R.AUTHENTICATED,R.REQUIRES_SCOPES]);R.PERSISTED_CLIENT_DIRECTIVES=new Set([R.DEPRECATED,R.ONE_OF,R.SEMANTIC_NON_NULL]);R.INHERITABLE_DIRECTIVE_NAMES=new Set([R.EXTERNAL,R.REQUIRE_FETCH_REASONS,R.SHAREABLE]);R.IGNORED_FIELDS=new Set([R.ENTITIES_FIELD,R.SERVICE_FIELD]);R.INPUT_NODE_KINDS=new Set([Za.Kind.ENUM_TYPE_DEFINITION,Za.Kind.INPUT_OBJECT_TYPE_DEFINITION,Za.Kind.SCALAR_TYPE_DEFINITION]);R.OUTPUT_NODE_KINDS=new Set([Za.Kind.ENUM_TYPE_DEFINITION,Za.Kind.INTERFACE_TYPE_DEFINITION,Za.Kind.OBJECT_TYPE_DEFINITION,Za.Kind.SCALAR_TYPE_DEFINITION,Za.Kind.UNION_TYPE_DEFINITION]);R.INTERFACE_NODE_KINDS=new Set([Za.Kind.INTERFACE_TYPE_DEFINITION,Za.Kind.INTERFACE_TYPE_EXTENSION]);R.NON_REPEATABLE_PERSISTED_DIRECTIVES=new Set([R.INACCESSIBLE,R.ONE_OF,R.SEMANTIC_NON_NULL])});var Cr=F(Wn=>{"use strict";m();T();N();Object.defineProperty(Wn,"__esModule",{value:!0});Wn.operationTypeNodeToDefaultType=void 0;Wn.isObjectLikeNodeEntity=G7;Wn.isNodeInterfaceObject=Q7;Wn.stringToNameNode=gT;Wn.stringArrayToNameNodeArray=Y7;Wn.setToNameNodeArray=J7;Wn.stringToNamedTypeNode=bU;Wn.setToNamedTypeNodeArray=z7;Wn.nodeKindToDirectiveLocation=H7;Wn.isKindAbstract=W7;Wn.extractExecutableDirectiveLocations=X7;Wn.formatDescription=Z7;Wn.lexicographicallySortArgumentNodes=AU;Wn.lexicographicallySortSelectionSetNode=IT;Wn.lexicographicallySortDocumentNode=eZ;Wn.parse=RU;Wn.safeParse=tZ;var Vt=Se(),Rn=Hn();function G7(e){var t;if(!((t=e.directives)!=null&&t.length))return!1;for(let n of e.directives)if(n.name.value===Rn.KEY)return!0;return!1}function Q7(e){var t;if(!((t=e.directives)!=null&&t.length))return!1;for(let n of e.directives)if(n.name.value===Rn.INTERFACE_OBJECT)return!0;return!1}function gT(e){return{kind:Vt.Kind.NAME,value:e}}function Y7(e){let t=[];for(let n of e)t.push(gT(n));return t}function J7(e){let t=[];for(let n of e)t.push(gT(n));return t}function bU(e){return{kind:Vt.Kind.NAMED_TYPE,name:gT(e)}}function z7(e){let t=[];for(let n of e)t.push(bU(n));return t}function H7(e){switch(e){case Vt.Kind.ARGUMENT:return Rn.ARGUMENT_DEFINITION_UPPER;case Vt.Kind.ENUM_TYPE_DEFINITION:case Vt.Kind.ENUM_TYPE_EXTENSION:return Rn.ENUM_UPPER;case Vt.Kind.ENUM_VALUE_DEFINITION:return Rn.ENUM_VALUE_UPPER;case Vt.Kind.FIELD_DEFINITION:return Rn.FIELD_DEFINITION_UPPER;case Vt.Kind.FRAGMENT_DEFINITION:return Rn.FRAGMENT_DEFINITION_UPPER;case Vt.Kind.FRAGMENT_SPREAD:return Rn.FRAGMENT_SPREAD_UPPER;case Vt.Kind.INLINE_FRAGMENT:return Rn.INLINE_FRAGMENT_UPPER;case Vt.Kind.INPUT_VALUE_DEFINITION:return Rn.INPUT_FIELD_DEFINITION_UPPER;case Vt.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Vt.Kind.INPUT_OBJECT_TYPE_EXTENSION:return Rn.INPUT_OBJECT_UPPER;case Vt.Kind.INTERFACE_TYPE_DEFINITION:case Vt.Kind.INTERFACE_TYPE_EXTENSION:return Rn.INTERFACE_UPPER;case Vt.Kind.OBJECT_TYPE_DEFINITION:case Vt.Kind.OBJECT_TYPE_EXTENSION:return Rn.OBJECT_UPPER;case Vt.Kind.SCALAR_TYPE_DEFINITION:case Vt.Kind.SCALAR_TYPE_EXTENSION:return Rn.SCALAR_UPPER;case Vt.Kind.SCHEMA_DEFINITION:case Vt.Kind.SCHEMA_EXTENSION:return Rn.SCHEMA_UPPER;case Vt.Kind.UNION_TYPE_DEFINITION:case Vt.Kind.UNION_TYPE_EXTENSION:return Rn.UNION_UPPER;default:return e}}Wn.operationTypeNodeToDefaultType=new Map([[Vt.OperationTypeNode.MUTATION,Rn.MUTATION],[Vt.OperationTypeNode.QUERY,Rn.QUERY],[Vt.OperationTypeNode.SUBSCRIPTION,Rn.SUBSCRIPTION]]);function W7(e){return e===Vt.Kind.INTERFACE_TYPE_DEFINITION||e===Vt.Kind.UNION_TYPE_DEFINITION}function X7(e,t){for(let n of e){let r=n.value;Rn.EXECUTABLE_DIRECTIVE_LOCATIONS.has(r)&&t.add(r)}return t}function Z7(e){if(!e)return e;let t=e.value;if(e.block){let n=t.split(` +`}});var gU=F(tS=>{"use strict";m();T();N();Object.defineProperty(tS,"__esModule",{value:!0});tS.concatAST=_7;var g7=Mt();function _7(e){let t=[];for(let n of e)t.push(...n.definitions);return{kind:g7.Kind.DOCUMENT,definitions:t}}});var SU=F(nS=>{"use strict";m();T();N();Object.defineProperty(nS,"__esModule",{value:!0});nS.separateOperations=S7;var FT=Mt(),v7=Ic();function S7(e){let t=[],n=Object.create(null);for(let i of e.definitions)switch(i.kind){case FT.Kind.OPERATION_DEFINITION:t.push(i);break;case FT.Kind.FRAGMENT_DEFINITION:n[i.name.value]=_U(i.selectionSet);break;default:}let r=Object.create(null);for(let i of t){let a=new Set;for(let u of _U(i.selectionSet))vU(a,n,u);let o=i.name?i.name.value:"";r[o]={kind:FT.Kind.DOCUMENT,definitions:e.definitions.filter(u=>u===i||u.kind===FT.Kind.FRAGMENT_DEFINITION&&a.has(u.name.value))}}return r}function vU(e,t,n){if(!e.has(n)){e.add(n);let r=t[n];if(r!==void 0)for(let i of r)vU(e,t,i)}}function _U(e){let t=[];return(0,v7.visit)(e,{FragmentSpread(n){t.push(n.name.value)}}),t}});var bU=F(iS=>{"use strict";m();T();N();Object.defineProperty(iS,"__esModule",{value:!0});iS.stripIgnoredCharacters=D7;var O7=op(),OU=_N(),DU=DN(),rS=cp();function D7(e){let t=(0,DU.isSource)(e)?e:new DU.Source(e),n=t.body,r=new OU.Lexer(t),i="",a=!1;for(;r.advance().kind!==rS.TokenKind.EOF;){let o=r.token,u=o.kind,l=!(0,OU.isPunctuatorTokenKind)(o.kind);a&&(l||o.kind===rS.TokenKind.SPREAD)&&(i+=" ");let d=n.slice(o.start,o.end);u===rS.TokenKind.BLOCK_STRING?i+=(0,O7.printBlockString)(o.value,{minimize:!0}):i+=d,a=l}return i}});var RU=F(LT=>{"use strict";m();T();N();Object.defineProperty(LT,"__esModule",{value:!0});LT.assertValidName=P7;LT.isValidNameError=AU;var b7=Yr(),A7=tt(),R7=Ep();function P7(e){let t=AU(e);if(t)throw t;return e}function AU(e){if(typeof e=="string"||(0,b7.devAssert)(!1,"Expected name to be a string."),e.startsWith("__"))return new A7.GraphQLError(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{(0,R7.assertName)(e)}catch(t){return t}}});var kU=F(Xa=>{"use strict";m();T();N();Object.defineProperty(Xa,"__esModule",{value:!0});Xa.DangerousChangeType=Xa.BreakingChangeType=void 0;Xa.findBreakingChanges=B7;Xa.findDangerousChanges=k7;var F7=rn(),UU=Cr(),PU=Du(),L7=_i(),Ht=xt(),w7=Qa(),C7=Rp(),U7=o_(),Kn;Xa.BreakingChangeType=Kn;(function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"})(Kn||(Xa.BreakingChangeType=Kn={}));var Ia;Xa.DangerousChangeType=Ia;(function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"})(Ia||(Xa.DangerousChangeType=Ia={}));function B7(e,t){return BU(e,t).filter(n=>n.type in Kn)}function k7(e,t){return BU(e,t).filter(n=>n.type in Ia)}function BU(e,t){return[...x7(e,t),...M7(e,t)]}function M7(e,t){let n=[],r=ws(e.getDirectives(),t.getDirectives());for(let i of r.removed)n.push({type:Kn.DIRECTIVE_REMOVED,description:`${i.name} was removed.`});for(let[i,a]of r.persisted){let o=ws(i.args,a.args);for(let u of o.added)(0,Ht.isRequiredArgument)(u)&&n.push({type:Kn.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${u.name} on directive ${i.name} was added.`});for(let u of o.removed)n.push({type:Kn.DIRECTIVE_ARG_REMOVED,description:`${u.name} was removed from ${i.name}.`});i.isRepeatable&&!a.isRepeatable&&n.push({type:Kn.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i.name}.`});for(let u of i.locations)a.locations.includes(u)||n.push({type:Kn.DIRECTIVE_LOCATION_REMOVED,description:`${u} was removed from ${i.name}.`})}return n}function x7(e,t){let n=[],r=ws(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(let i of r.removed)n.push({type:Kn.TYPE_REMOVED,description:(0,w7.isSpecifiedScalarType)(i)?`Standard scalar ${i.name} was removed because it is not referenced anymore.`:`${i.name} was removed.`});for(let[i,a]of r.persisted)(0,Ht.isEnumType)(i)&&(0,Ht.isEnumType)(a)?n.push(...K7(i,a)):(0,Ht.isUnionType)(i)&&(0,Ht.isUnionType)(a)?n.push(...V7(i,a)):(0,Ht.isInputObjectType)(i)&&(0,Ht.isInputObjectType)(a)?n.push(...q7(i,a)):(0,Ht.isObjectType)(i)&&(0,Ht.isObjectType)(a)?n.push(...LU(i,a),...FU(i,a)):(0,Ht.isInterfaceType)(i)&&(0,Ht.isInterfaceType)(a)?n.push(...LU(i,a),...FU(i,a)):i.constructor!==a.constructor&&n.push({type:Kn.TYPE_CHANGED_KIND,description:`${i.name} changed from ${wU(i)} to ${wU(a)}.`});return n}function q7(e,t){let n=[],r=ws(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of r.added)(0,Ht.isRequiredInputField)(i)?n.push({type:Kn.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i.name} on input type ${e.name} was added.`}):n.push({type:Ia.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${i.name} on input type ${e.name} was added.`});for(let i of r.removed)n.push({type:Kn.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,a]of r.persisted)Xp(i.type,a.type)||n.push({type:Kn.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(a.type)}.`});return n}function V7(e,t){let n=[],r=ws(e.getTypes(),t.getTypes());for(let i of r.added)n.push({type:Ia.TYPE_ADDED_TO_UNION,description:`${i.name} was added to union type ${e.name}.`});for(let i of r.removed)n.push({type:Kn.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${e.name}.`});return n}function K7(e,t){let n=[],r=ws(e.getValues(),t.getValues());for(let i of r.added)n.push({type:Ia.VALUE_ADDED_TO_ENUM,description:`${i.name} was added to enum type ${e.name}.`});for(let i of r.removed)n.push({type:Kn.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${e.name}.`});return n}function FU(e,t){let n=[],r=ws(e.getInterfaces(),t.getInterfaces());for(let i of r.added)n.push({type:Ia.IMPLEMENTED_INTERFACE_ADDED,description:`${i.name} added to interfaces implemented by ${e.name}.`});for(let i of r.removed)n.push({type:Kn.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${i.name}.`});return n}function LU(e,t){let n=[],r=ws(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of r.removed)n.push({type:Kn.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,a]of r.persisted)n.push(...j7(e,i,a)),Wp(i.type,a.type)||n.push({type:Kn.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(a.type)}.`});return n}function j7(e,t,n){let r=[],i=ws(t.args,n.args);for(let a of i.removed)r.push({type:Kn.ARG_REMOVED,description:`${e.name}.${t.name} arg ${a.name} was removed.`});for(let[a,o]of i.persisted)if(!Xp(a.type,o.type))r.push({type:Kn.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${a.name} has changed type from ${String(a.type)} to ${String(o.type)}.`});else if(a.defaultValue!==void 0)if(o.defaultValue===void 0)r.push({type:Ia.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${a.name} defaultValue was removed.`});else{let l=CU(a.defaultValue,a.type),d=CU(o.defaultValue,o.type);l!==d&&r.push({type:Ia.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${a.name} has changed defaultValue from ${l} to ${d}.`})}for(let a of i.added)(0,Ht.isRequiredArgument)(a)?r.push({type:Kn.REQUIRED_ARG_ADDED,description:`A required arg ${a.name} on ${e.name}.${t.name} was added.`}):r.push({type:Ia.OPTIONAL_ARG_ADDED,description:`An optional arg ${a.name} on ${e.name}.${t.name} was added.`});return r}function Wp(e,t){return(0,Ht.isListType)(e)?(0,Ht.isListType)(t)&&Wp(e.ofType,t.ofType)||(0,Ht.isNonNullType)(t)&&Wp(e,t.ofType):(0,Ht.isNonNullType)(e)?(0,Ht.isNonNullType)(t)&&Wp(e.ofType,t.ofType):(0,Ht.isNamedType)(t)&&e.name===t.name||(0,Ht.isNonNullType)(t)&&Wp(e,t.ofType)}function Xp(e,t){return(0,Ht.isListType)(e)?(0,Ht.isListType)(t)&&Xp(e.ofType,t.ofType):(0,Ht.isNonNullType)(e)?(0,Ht.isNonNullType)(t)&&Xp(e.ofType,t.ofType)||!(0,Ht.isNonNullType)(t)&&Xp(e.ofType,t):(0,Ht.isNamedType)(t)&&e.name===t.name}function wU(e){if((0,Ht.isScalarType)(e))return"a Scalar type";if((0,Ht.isObjectType)(e))return"an Object type";if((0,Ht.isInterfaceType)(e))return"an Interface type";if((0,Ht.isUnionType)(e))return"a Union type";if((0,Ht.isEnumType)(e))return"an Enum type";if((0,Ht.isInputObjectType)(e))return"an Input type";(0,UU.invariant)(!1,"Unexpected type: "+(0,F7.inspect)(e))}function CU(e,t){let n=(0,C7.astFromValue)(e,t);return n!=null||(0,UU.invariant)(!1),(0,L7.print)((0,U7.sortValueNode)(n))}function ws(e,t){let n=[],r=[],i=[],a=(0,PU.keyMap)(e,({name:u})=>u),o=(0,PU.keyMap)(t,({name:u})=>u);for(let u of e){let l=o[u.name];l===void 0?r.push(u):i.push([u,l])}for(let u of t)a[u.name]===void 0&&n.push(u);return{added:n,persisted:i,removed:r}}});var VU=F(jt=>{"use strict";m();T();N();Object.defineProperty(jt,"__esModule",{value:!0});Object.defineProperty(jt,"BreakingChangeType",{enumerable:!0,get:function(){return wT.BreakingChangeType}});Object.defineProperty(jt,"DangerousChangeType",{enumerable:!0,get:function(){return wT.DangerousChangeType}});Object.defineProperty(jt,"TypeInfo",{enumerable:!0,get:function(){return xU.TypeInfo}});Object.defineProperty(jt,"assertValidName",{enumerable:!0,get:function(){return qU.assertValidName}});Object.defineProperty(jt,"astFromValue",{enumerable:!0,get:function(){return eZ.astFromValue}});Object.defineProperty(jt,"buildASTSchema",{enumerable:!0,get:function(){return MU.buildASTSchema}});Object.defineProperty(jt,"buildClientSchema",{enumerable:!0,get:function(){return J7.buildClientSchema}});Object.defineProperty(jt,"buildSchema",{enumerable:!0,get:function(){return MU.buildSchema}});Object.defineProperty(jt,"coerceInputValue",{enumerable:!0,get:function(){return tZ.coerceInputValue}});Object.defineProperty(jt,"concatAST",{enumerable:!0,get:function(){return nZ.concatAST}});Object.defineProperty(jt,"doTypesOverlap",{enumerable:!0,get:function(){return sS.doTypesOverlap}});Object.defineProperty(jt,"extendSchema",{enumerable:!0,get:function(){return H7.extendSchema}});Object.defineProperty(jt,"findBreakingChanges",{enumerable:!0,get:function(){return wT.findBreakingChanges}});Object.defineProperty(jt,"findDangerousChanges",{enumerable:!0,get:function(){return wT.findDangerousChanges}});Object.defineProperty(jt,"getIntrospectionQuery",{enumerable:!0,get:function(){return $7.getIntrospectionQuery}});Object.defineProperty(jt,"getOperationAST",{enumerable:!0,get:function(){return G7.getOperationAST}});Object.defineProperty(jt,"getOperationRootType",{enumerable:!0,get:function(){return Q7.getOperationRootType}});Object.defineProperty(jt,"introspectionFromSchema",{enumerable:!0,get:function(){return Y7.introspectionFromSchema}});Object.defineProperty(jt,"isEqualType",{enumerable:!0,get:function(){return sS.isEqualType}});Object.defineProperty(jt,"isTypeSubTypeOf",{enumerable:!0,get:function(){return sS.isTypeSubTypeOf}});Object.defineProperty(jt,"isValidNameError",{enumerable:!0,get:function(){return qU.isValidNameError}});Object.defineProperty(jt,"lexicographicSortSchema",{enumerable:!0,get:function(){return z7.lexicographicSortSchema}});Object.defineProperty(jt,"printIntrospectionSchema",{enumerable:!0,get:function(){return aS.printIntrospectionSchema}});Object.defineProperty(jt,"printSchema",{enumerable:!0,get:function(){return aS.printSchema}});Object.defineProperty(jt,"printType",{enumerable:!0,get:function(){return aS.printType}});Object.defineProperty(jt,"separateOperations",{enumerable:!0,get:function(){return rZ.separateOperations}});Object.defineProperty(jt,"stripIgnoredCharacters",{enumerable:!0,get:function(){return iZ.stripIgnoredCharacters}});Object.defineProperty(jt,"typeFromAST",{enumerable:!0,get:function(){return W7.typeFromAST}});Object.defineProperty(jt,"valueFromAST",{enumerable:!0,get:function(){return X7.valueFromAST}});Object.defineProperty(jt,"valueFromASTUntyped",{enumerable:!0,get:function(){return Z7.valueFromASTUntyped}});Object.defineProperty(jt,"visitWithTypeInfo",{enumerable:!0,get:function(){return xU.visitWithTypeInfo}});var $7=Vv(),G7=zC(),Q7=WC(),Y7=XC(),J7=eU(),MU=lU(),H7=Yv(),z7=fU(),aS=IU(),W7=Ya(),X7=xp(),Z7=rg(),eZ=Rp(),xU=eT(),tZ=b_(),nZ=gU(),rZ=SU(),iZ=bU(),sS=_p(),qU=RU(),wT=kU()});var Oe=F(G=>{"use strict";m();T();N();Object.defineProperty(G,"__esModule",{value:!0});Object.defineProperty(G,"BREAK",{enumerable:!0,get:function(){return Zt.BREAK}});Object.defineProperty(G,"BreakingChangeType",{enumerable:!0,get:function(){return en.BreakingChangeType}});Object.defineProperty(G,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return ve.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(G,"DangerousChangeType",{enumerable:!0,get:function(){return en.DangerousChangeType}});Object.defineProperty(G,"DirectiveLocation",{enumerable:!0,get:function(){return Zt.DirectiveLocation}});Object.defineProperty(G,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return vt.ExecutableDefinitionsRule}});Object.defineProperty(G,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return vt.FieldsOnCorrectTypeRule}});Object.defineProperty(G,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return vt.FragmentsOnCompositeTypesRule}});Object.defineProperty(G,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return ve.GRAPHQL_MAX_INT}});Object.defineProperty(G,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return ve.GRAPHQL_MIN_INT}});Object.defineProperty(G,"GraphQLBoolean",{enumerable:!0,get:function(){return ve.GraphQLBoolean}});Object.defineProperty(G,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return ve.GraphQLDeprecatedDirective}});Object.defineProperty(G,"GraphQLDirective",{enumerable:!0,get:function(){return ve.GraphQLDirective}});Object.defineProperty(G,"GraphQLEnumType",{enumerable:!0,get:function(){return ve.GraphQLEnumType}});Object.defineProperty(G,"GraphQLError",{enumerable:!0,get:function(){return Zp.GraphQLError}});Object.defineProperty(G,"GraphQLFloat",{enumerable:!0,get:function(){return ve.GraphQLFloat}});Object.defineProperty(G,"GraphQLID",{enumerable:!0,get:function(){return ve.GraphQLID}});Object.defineProperty(G,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return ve.GraphQLIncludeDirective}});Object.defineProperty(G,"GraphQLInputObjectType",{enumerable:!0,get:function(){return ve.GraphQLInputObjectType}});Object.defineProperty(G,"GraphQLInt",{enumerable:!0,get:function(){return ve.GraphQLInt}});Object.defineProperty(G,"GraphQLInterfaceType",{enumerable:!0,get:function(){return ve.GraphQLInterfaceType}});Object.defineProperty(G,"GraphQLList",{enumerable:!0,get:function(){return ve.GraphQLList}});Object.defineProperty(G,"GraphQLNonNull",{enumerable:!0,get:function(){return ve.GraphQLNonNull}});Object.defineProperty(G,"GraphQLObjectType",{enumerable:!0,get:function(){return ve.GraphQLObjectType}});Object.defineProperty(G,"GraphQLOneOfDirective",{enumerable:!0,get:function(){return ve.GraphQLOneOfDirective}});Object.defineProperty(G,"GraphQLScalarType",{enumerable:!0,get:function(){return ve.GraphQLScalarType}});Object.defineProperty(G,"GraphQLSchema",{enumerable:!0,get:function(){return ve.GraphQLSchema}});Object.defineProperty(G,"GraphQLSkipDirective",{enumerable:!0,get:function(){return ve.GraphQLSkipDirective}});Object.defineProperty(G,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return ve.GraphQLSpecifiedByDirective}});Object.defineProperty(G,"GraphQLString",{enumerable:!0,get:function(){return ve.GraphQLString}});Object.defineProperty(G,"GraphQLUnionType",{enumerable:!0,get:function(){return ve.GraphQLUnionType}});Object.defineProperty(G,"Kind",{enumerable:!0,get:function(){return Zt.Kind}});Object.defineProperty(G,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return vt.KnownArgumentNamesRule}});Object.defineProperty(G,"KnownDirectivesRule",{enumerable:!0,get:function(){return vt.KnownDirectivesRule}});Object.defineProperty(G,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return vt.KnownFragmentNamesRule}});Object.defineProperty(G,"KnownTypeNamesRule",{enumerable:!0,get:function(){return vt.KnownTypeNamesRule}});Object.defineProperty(G,"Lexer",{enumerable:!0,get:function(){return Zt.Lexer}});Object.defineProperty(G,"Location",{enumerable:!0,get:function(){return Zt.Location}});Object.defineProperty(G,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return vt.LoneAnonymousOperationRule}});Object.defineProperty(G,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return vt.LoneSchemaDefinitionRule}});Object.defineProperty(G,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return vt.MaxIntrospectionDepthRule}});Object.defineProperty(G,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return vt.NoDeprecatedCustomRule}});Object.defineProperty(G,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return vt.NoFragmentCyclesRule}});Object.defineProperty(G,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return vt.NoSchemaIntrospectionCustomRule}});Object.defineProperty(G,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return vt.NoUndefinedVariablesRule}});Object.defineProperty(G,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return vt.NoUnusedFragmentsRule}});Object.defineProperty(G,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return vt.NoUnusedVariablesRule}});Object.defineProperty(G,"OperationTypeNode",{enumerable:!0,get:function(){return Zt.OperationTypeNode}});Object.defineProperty(G,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return vt.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(G,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return vt.PossibleFragmentSpreadsRule}});Object.defineProperty(G,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return vt.PossibleTypeExtensionsRule}});Object.defineProperty(G,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return vt.ProvidedRequiredArgumentsRule}});Object.defineProperty(G,"ScalarLeafsRule",{enumerable:!0,get:function(){return vt.ScalarLeafsRule}});Object.defineProperty(G,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return ve.SchemaMetaFieldDef}});Object.defineProperty(G,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return vt.SingleFieldSubscriptionsRule}});Object.defineProperty(G,"Source",{enumerable:!0,get:function(){return Zt.Source}});Object.defineProperty(G,"Token",{enumerable:!0,get:function(){return Zt.Token}});Object.defineProperty(G,"TokenKind",{enumerable:!0,get:function(){return Zt.TokenKind}});Object.defineProperty(G,"TypeInfo",{enumerable:!0,get:function(){return en.TypeInfo}});Object.defineProperty(G,"TypeKind",{enumerable:!0,get:function(){return ve.TypeKind}});Object.defineProperty(G,"TypeMetaFieldDef",{enumerable:!0,get:function(){return ve.TypeMetaFieldDef}});Object.defineProperty(G,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return ve.TypeNameMetaFieldDef}});Object.defineProperty(G,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return vt.UniqueArgumentDefinitionNamesRule}});Object.defineProperty(G,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return vt.UniqueArgumentNamesRule}});Object.defineProperty(G,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return vt.UniqueDirectiveNamesRule}});Object.defineProperty(G,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return vt.UniqueDirectivesPerLocationRule}});Object.defineProperty(G,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return vt.UniqueEnumValueNamesRule}});Object.defineProperty(G,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return vt.UniqueFieldDefinitionNamesRule}});Object.defineProperty(G,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return vt.UniqueFragmentNamesRule}});Object.defineProperty(G,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return vt.UniqueInputFieldNamesRule}});Object.defineProperty(G,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return vt.UniqueOperationNamesRule}});Object.defineProperty(G,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return vt.UniqueOperationTypesRule}});Object.defineProperty(G,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return vt.UniqueTypeNamesRule}});Object.defineProperty(G,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return vt.UniqueVariableNamesRule}});Object.defineProperty(G,"ValidationContext",{enumerable:!0,get:function(){return vt.ValidationContext}});Object.defineProperty(G,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return vt.ValuesOfCorrectTypeRule}});Object.defineProperty(G,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return vt.VariablesAreInputTypesRule}});Object.defineProperty(G,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return vt.VariablesInAllowedPositionRule}});Object.defineProperty(G,"__Directive",{enumerable:!0,get:function(){return ve.__Directive}});Object.defineProperty(G,"__DirectiveLocation",{enumerable:!0,get:function(){return ve.__DirectiveLocation}});Object.defineProperty(G,"__EnumValue",{enumerable:!0,get:function(){return ve.__EnumValue}});Object.defineProperty(G,"__Field",{enumerable:!0,get:function(){return ve.__Field}});Object.defineProperty(G,"__InputValue",{enumerable:!0,get:function(){return ve.__InputValue}});Object.defineProperty(G,"__Schema",{enumerable:!0,get:function(){return ve.__Schema}});Object.defineProperty(G,"__Type",{enumerable:!0,get:function(){return ve.__Type}});Object.defineProperty(G,"__TypeKind",{enumerable:!0,get:function(){return ve.__TypeKind}});Object.defineProperty(G,"assertAbstractType",{enumerable:!0,get:function(){return ve.assertAbstractType}});Object.defineProperty(G,"assertCompositeType",{enumerable:!0,get:function(){return ve.assertCompositeType}});Object.defineProperty(G,"assertDirective",{enumerable:!0,get:function(){return ve.assertDirective}});Object.defineProperty(G,"assertEnumType",{enumerable:!0,get:function(){return ve.assertEnumType}});Object.defineProperty(G,"assertEnumValueName",{enumerable:!0,get:function(){return ve.assertEnumValueName}});Object.defineProperty(G,"assertInputObjectType",{enumerable:!0,get:function(){return ve.assertInputObjectType}});Object.defineProperty(G,"assertInputType",{enumerable:!0,get:function(){return ve.assertInputType}});Object.defineProperty(G,"assertInterfaceType",{enumerable:!0,get:function(){return ve.assertInterfaceType}});Object.defineProperty(G,"assertLeafType",{enumerable:!0,get:function(){return ve.assertLeafType}});Object.defineProperty(G,"assertListType",{enumerable:!0,get:function(){return ve.assertListType}});Object.defineProperty(G,"assertName",{enumerable:!0,get:function(){return ve.assertName}});Object.defineProperty(G,"assertNamedType",{enumerable:!0,get:function(){return ve.assertNamedType}});Object.defineProperty(G,"assertNonNullType",{enumerable:!0,get:function(){return ve.assertNonNullType}});Object.defineProperty(G,"assertNullableType",{enumerable:!0,get:function(){return ve.assertNullableType}});Object.defineProperty(G,"assertObjectType",{enumerable:!0,get:function(){return ve.assertObjectType}});Object.defineProperty(G,"assertOutputType",{enumerable:!0,get:function(){return ve.assertOutputType}});Object.defineProperty(G,"assertScalarType",{enumerable:!0,get:function(){return ve.assertScalarType}});Object.defineProperty(G,"assertSchema",{enumerable:!0,get:function(){return ve.assertSchema}});Object.defineProperty(G,"assertType",{enumerable:!0,get:function(){return ve.assertType}});Object.defineProperty(G,"assertUnionType",{enumerable:!0,get:function(){return ve.assertUnionType}});Object.defineProperty(G,"assertValidName",{enumerable:!0,get:function(){return en.assertValidName}});Object.defineProperty(G,"assertValidSchema",{enumerable:!0,get:function(){return ve.assertValidSchema}});Object.defineProperty(G,"assertWrappingType",{enumerable:!0,get:function(){return ve.assertWrappingType}});Object.defineProperty(G,"astFromValue",{enumerable:!0,get:function(){return en.astFromValue}});Object.defineProperty(G,"buildASTSchema",{enumerable:!0,get:function(){return en.buildASTSchema}});Object.defineProperty(G,"buildClientSchema",{enumerable:!0,get:function(){return en.buildClientSchema}});Object.defineProperty(G,"buildSchema",{enumerable:!0,get:function(){return en.buildSchema}});Object.defineProperty(G,"coerceInputValue",{enumerable:!0,get:function(){return en.coerceInputValue}});Object.defineProperty(G,"concatAST",{enumerable:!0,get:function(){return en.concatAST}});Object.defineProperty(G,"createSourceEventStream",{enumerable:!0,get:function(){return Za.createSourceEventStream}});Object.defineProperty(G,"defaultFieldResolver",{enumerable:!0,get:function(){return Za.defaultFieldResolver}});Object.defineProperty(G,"defaultTypeResolver",{enumerable:!0,get:function(){return Za.defaultTypeResolver}});Object.defineProperty(G,"doTypesOverlap",{enumerable:!0,get:function(){return en.doTypesOverlap}});Object.defineProperty(G,"execute",{enumerable:!0,get:function(){return Za.execute}});Object.defineProperty(G,"executeSync",{enumerable:!0,get:function(){return Za.executeSync}});Object.defineProperty(G,"extendSchema",{enumerable:!0,get:function(){return en.extendSchema}});Object.defineProperty(G,"findBreakingChanges",{enumerable:!0,get:function(){return en.findBreakingChanges}});Object.defineProperty(G,"findDangerousChanges",{enumerable:!0,get:function(){return en.findDangerousChanges}});Object.defineProperty(G,"formatError",{enumerable:!0,get:function(){return Zp.formatError}});Object.defineProperty(G,"getArgumentValues",{enumerable:!0,get:function(){return Za.getArgumentValues}});Object.defineProperty(G,"getDirectiveValues",{enumerable:!0,get:function(){return Za.getDirectiveValues}});Object.defineProperty(G,"getEnterLeaveForKind",{enumerable:!0,get:function(){return Zt.getEnterLeaveForKind}});Object.defineProperty(G,"getIntrospectionQuery",{enumerable:!0,get:function(){return en.getIntrospectionQuery}});Object.defineProperty(G,"getLocation",{enumerable:!0,get:function(){return Zt.getLocation}});Object.defineProperty(G,"getNamedType",{enumerable:!0,get:function(){return ve.getNamedType}});Object.defineProperty(G,"getNullableType",{enumerable:!0,get:function(){return ve.getNullableType}});Object.defineProperty(G,"getOperationAST",{enumerable:!0,get:function(){return en.getOperationAST}});Object.defineProperty(G,"getOperationRootType",{enumerable:!0,get:function(){return en.getOperationRootType}});Object.defineProperty(G,"getVariableValues",{enumerable:!0,get:function(){return Za.getVariableValues}});Object.defineProperty(G,"getVisitFn",{enumerable:!0,get:function(){return Zt.getVisitFn}});Object.defineProperty(G,"graphql",{enumerable:!0,get:function(){return jU.graphql}});Object.defineProperty(G,"graphqlSync",{enumerable:!0,get:function(){return jU.graphqlSync}});Object.defineProperty(G,"introspectionFromSchema",{enumerable:!0,get:function(){return en.introspectionFromSchema}});Object.defineProperty(G,"introspectionTypes",{enumerable:!0,get:function(){return ve.introspectionTypes}});Object.defineProperty(G,"isAbstractType",{enumerable:!0,get:function(){return ve.isAbstractType}});Object.defineProperty(G,"isCompositeType",{enumerable:!0,get:function(){return ve.isCompositeType}});Object.defineProperty(G,"isConstValueNode",{enumerable:!0,get:function(){return Zt.isConstValueNode}});Object.defineProperty(G,"isDefinitionNode",{enumerable:!0,get:function(){return Zt.isDefinitionNode}});Object.defineProperty(G,"isDirective",{enumerable:!0,get:function(){return ve.isDirective}});Object.defineProperty(G,"isEnumType",{enumerable:!0,get:function(){return ve.isEnumType}});Object.defineProperty(G,"isEqualType",{enumerable:!0,get:function(){return en.isEqualType}});Object.defineProperty(G,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return Zt.isExecutableDefinitionNode}});Object.defineProperty(G,"isInputObjectType",{enumerable:!0,get:function(){return ve.isInputObjectType}});Object.defineProperty(G,"isInputType",{enumerable:!0,get:function(){return ve.isInputType}});Object.defineProperty(G,"isInterfaceType",{enumerable:!0,get:function(){return ve.isInterfaceType}});Object.defineProperty(G,"isIntrospectionType",{enumerable:!0,get:function(){return ve.isIntrospectionType}});Object.defineProperty(G,"isLeafType",{enumerable:!0,get:function(){return ve.isLeafType}});Object.defineProperty(G,"isListType",{enumerable:!0,get:function(){return ve.isListType}});Object.defineProperty(G,"isNamedType",{enumerable:!0,get:function(){return ve.isNamedType}});Object.defineProperty(G,"isNonNullType",{enumerable:!0,get:function(){return ve.isNonNullType}});Object.defineProperty(G,"isNullableType",{enumerable:!0,get:function(){return ve.isNullableType}});Object.defineProperty(G,"isObjectType",{enumerable:!0,get:function(){return ve.isObjectType}});Object.defineProperty(G,"isOutputType",{enumerable:!0,get:function(){return ve.isOutputType}});Object.defineProperty(G,"isRequiredArgument",{enumerable:!0,get:function(){return ve.isRequiredArgument}});Object.defineProperty(G,"isRequiredInputField",{enumerable:!0,get:function(){return ve.isRequiredInputField}});Object.defineProperty(G,"isScalarType",{enumerable:!0,get:function(){return ve.isScalarType}});Object.defineProperty(G,"isSchema",{enumerable:!0,get:function(){return ve.isSchema}});Object.defineProperty(G,"isSelectionNode",{enumerable:!0,get:function(){return Zt.isSelectionNode}});Object.defineProperty(G,"isSpecifiedDirective",{enumerable:!0,get:function(){return ve.isSpecifiedDirective}});Object.defineProperty(G,"isSpecifiedScalarType",{enumerable:!0,get:function(){return ve.isSpecifiedScalarType}});Object.defineProperty(G,"isType",{enumerable:!0,get:function(){return ve.isType}});Object.defineProperty(G,"isTypeDefinitionNode",{enumerable:!0,get:function(){return Zt.isTypeDefinitionNode}});Object.defineProperty(G,"isTypeExtensionNode",{enumerable:!0,get:function(){return Zt.isTypeExtensionNode}});Object.defineProperty(G,"isTypeNode",{enumerable:!0,get:function(){return Zt.isTypeNode}});Object.defineProperty(G,"isTypeSubTypeOf",{enumerable:!0,get:function(){return en.isTypeSubTypeOf}});Object.defineProperty(G,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return Zt.isTypeSystemDefinitionNode}});Object.defineProperty(G,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return Zt.isTypeSystemExtensionNode}});Object.defineProperty(G,"isUnionType",{enumerable:!0,get:function(){return ve.isUnionType}});Object.defineProperty(G,"isValidNameError",{enumerable:!0,get:function(){return en.isValidNameError}});Object.defineProperty(G,"isValueNode",{enumerable:!0,get:function(){return Zt.isValueNode}});Object.defineProperty(G,"isWrappingType",{enumerable:!0,get:function(){return ve.isWrappingType}});Object.defineProperty(G,"lexicographicSortSchema",{enumerable:!0,get:function(){return en.lexicographicSortSchema}});Object.defineProperty(G,"locatedError",{enumerable:!0,get:function(){return Zp.locatedError}});Object.defineProperty(G,"parse",{enumerable:!0,get:function(){return Zt.parse}});Object.defineProperty(G,"parseConstValue",{enumerable:!0,get:function(){return Zt.parseConstValue}});Object.defineProperty(G,"parseType",{enumerable:!0,get:function(){return Zt.parseType}});Object.defineProperty(G,"parseValue",{enumerable:!0,get:function(){return Zt.parseValue}});Object.defineProperty(G,"print",{enumerable:!0,get:function(){return Zt.print}});Object.defineProperty(G,"printError",{enumerable:!0,get:function(){return Zp.printError}});Object.defineProperty(G,"printIntrospectionSchema",{enumerable:!0,get:function(){return en.printIntrospectionSchema}});Object.defineProperty(G,"printLocation",{enumerable:!0,get:function(){return Zt.printLocation}});Object.defineProperty(G,"printSchema",{enumerable:!0,get:function(){return en.printSchema}});Object.defineProperty(G,"printSourceLocation",{enumerable:!0,get:function(){return Zt.printSourceLocation}});Object.defineProperty(G,"printType",{enumerable:!0,get:function(){return en.printType}});Object.defineProperty(G,"recommendedRules",{enumerable:!0,get:function(){return vt.recommendedRules}});Object.defineProperty(G,"resolveObjMapThunk",{enumerable:!0,get:function(){return ve.resolveObjMapThunk}});Object.defineProperty(G,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return ve.resolveReadonlyArrayThunk}});Object.defineProperty(G,"responsePathAsArray",{enumerable:!0,get:function(){return Za.responsePathAsArray}});Object.defineProperty(G,"separateOperations",{enumerable:!0,get:function(){return en.separateOperations}});Object.defineProperty(G,"specifiedDirectives",{enumerable:!0,get:function(){return ve.specifiedDirectives}});Object.defineProperty(G,"specifiedRules",{enumerable:!0,get:function(){return vt.specifiedRules}});Object.defineProperty(G,"specifiedScalarTypes",{enumerable:!0,get:function(){return ve.specifiedScalarTypes}});Object.defineProperty(G,"stripIgnoredCharacters",{enumerable:!0,get:function(){return en.stripIgnoredCharacters}});Object.defineProperty(G,"subscribe",{enumerable:!0,get:function(){return Za.subscribe}});Object.defineProperty(G,"syntaxError",{enumerable:!0,get:function(){return Zp.syntaxError}});Object.defineProperty(G,"typeFromAST",{enumerable:!0,get:function(){return en.typeFromAST}});Object.defineProperty(G,"validate",{enumerable:!0,get:function(){return vt.validate}});Object.defineProperty(G,"validateSchema",{enumerable:!0,get:function(){return ve.validateSchema}});Object.defineProperty(G,"valueFromAST",{enumerable:!0,get:function(){return en.valueFromAST}});Object.defineProperty(G,"valueFromASTUntyped",{enumerable:!0,get:function(){return en.valueFromASTUntyped}});Object.defineProperty(G,"version",{enumerable:!0,get:function(){return KU.version}});Object.defineProperty(G,"versionInfo",{enumerable:!0,get:function(){return KU.versionInfo}});Object.defineProperty(G,"visit",{enumerable:!0,get:function(){return Zt.visit}});Object.defineProperty(G,"visitInParallel",{enumerable:!0,get:function(){return Zt.visitInParallel}});Object.defineProperty(G,"visitWithTypeInfo",{enumerable:!0,get:function(){return en.visitWithTypeInfo}});var KU=kF(),jU=FC(),ve=CC(),Zt=BC(),Za=$C(),vt=JC(),Zp=HC(),en=VU()});var Zn=F(b=>{"use strict";m();T();N();Object.defineProperty(b,"__esModule",{value:!0});b.EXTERNAL=b.EXECUTION=b.ENUM_VALUE_UPPER=b.ENUM_VALUE=b.ENUM_UPPER=b.ENUM=b.ENTITY_UNION=b.ENTITY_CACHE=b.ENTITIES_FIELD=b.ENTITIES=b.EDFS_REDIS_SUBSCRIBE=b.EDFS_REDIS_PUBLISH=b.EDFS_NATS_STREAM_CONFIGURATION=b.EDFS_PUBLISH_RESULT=b.EDFS_NATS_SUBSCRIBE=b.EDFS_NATS_REQUEST=b.EDFS_NATS_PUBLISH=b.EDFS_KAFKA_SUBSCRIBE=b.EDFS_KAFKA_PUBLISH=b.DIRECTIVE_DEFINITION=b.DESCRIPTION_OVERRIDE=b.DEPRECATED_DEFAULT_ARGUMENT_VALUE=b.DEPRECATED=b.DEFAULT_SUBSCRIPTION=b.DEFAULT_QUERY=b.DEFAULT_MUTATION=b.DEFAULT_EDFS_PROVIDER_ID=b.DEFAULT=b.COST=b.CONTEXT=b.CONNECT_FIELD_RESOLVER=b.CONSUMER_NAME=b.CONSUMER_INACTIVE_THRESHOLD=b.CONFIGURE_CHILD_DESCRIPTIONS=b.CONFIGURE_DESCRIPTION=b.CONDITION=b.COMPOSE_DIRECTIVE=b.CHANNELS=b.CHANNEL=b.CACHE_POPULATE=b.CACHE_INVALIDATE=b.BOOLEAN_SCALAR=b.BOOLEAN=b.ARGUMENT_DEFINITION_UPPER=b.AUTHENTICATED=b.ARGUMENT=b.ANY_SCALAR=b.AND_UPPER=b.ASSUMED_SIZE=b.AS=void 0;b.MUTATION_UPPER=b.MUTATION=b.NUMBER=b.NEGATIVE_CACHE_TTL=b.MAX_AGE=b.LITERAL_PERIOD=b.LITERAL_NEW_LINE=b.LITERAL_SPACE=b.LITERAL_OPEN_BRACE=b.LIST=b.LINK_PURPOSE=b.LINK_IMPORT=b.LIST_SIZE=b.LINK=b.LEVELS=b.LEFT_PARENTHESIS=b.KEY=b.IS=b.INTERFACE_OBJECT=b.INTERFACE_UPPER=b.INTERFACE=b.INT_SCALAR=b.INPUT_VALUE=b.INPUT_OBJECT_UPPER=b.INPUT_OBJECT=b.INPUT_FIELD_DEFINITION_UPPER=b.INPUT_FIELD=b.INPUT=b.INLINE_FRAGMENT_UPPER=b.IN_UPPER=b.INLINE_FRAGMENT=b.INCLUDE_HEADERS=b.INACCESSIBLE=b.IMPORT=b.ID_SCALAR=b.HYPHEN_JOIN=b.FROM=b.FRAGMENT_SPREAD_UPPER=b.FRAGMENT_DEFINITION_UPPER=b.FOR=b.FLOAT_SCALAR=b.FIRST_ORDINAL=b.FIELD_DEFINITION_UPPER=b.FIELDS=b.FIELD_SET_SCALAR=b.FIELD_UPPER=b.FIELD_PATH=b.FIELD=b.EXTENSIONS=b.EXTENDS=void 0;b.SHAREABLE=b.SHADOW_MODE=b.SERVICE_FIELD=b.SERVICE_OBJECT=b.SEMANTIC_NON_NULL=b.SELECTION_REPRESENTATION=b.SECURITY=b.SCOPE_SCALAR=b.SCOPES=b.SCHEMA_UPPER=b.SCHEMA=b.SCALAR_UPPER=b.SCALAR=b.RESOLVABLE=b.REQUIRES_SCOPES=b.REQUIRES=b.REQUIRE_ONE_SLICING_ARGUMENT=b.REQUIRE_FETCH_REASONS=b.REQUEST_SCOPED=b.REQUEST=b.REASON=b.QUOTATION_JOIN=b.QUERY_UPPER=b.QUERY_CACHE=b.QUERY=b.PUBLISH=b.PROVIDES=b.PROVIDER_ID=b.PARTIAL_CACHE_LOAD=b.PARENT_EXTENSION_DATA_MAP=b.PARENT_DEFINITION_DATA_MAP=b.PARENT_DEFINITION_DATA=b.OVERRIDE=b.OR_UPPER=b.OBJECT_UPPER=b.OBJECT=b.OPERATION_TO_DEFAULT=b.ONE_OF=b.NULL=b.NOT_UPPER=b.NON_NULLABLE_STRING=b.NON_NULLABLE_INT=b.NON_NULLABLE_BOOLEAN=b.NON_NULLABLE_EDFS_PUBLISH_EVENT_RESULT=b.NAME=b.NOT_APPLICABLE=b.PROVIDER_TYPE_REDIS=b.PROVIDER_TYPE_NATS=b.PROVIDER_TYPE_KAFKA=b.PROPAGATE=void 0;b.NON_REPEATABLE_PERSISTED_DIRECTIVES=b.INTERFACE_NODE_KINDS=b.OUTPUT_NODE_KINDS=b.INPUT_NODE_KINDS=b.IGNORED_FIELDS=b.INHERITABLE_DIRECTIVE_NAMES=b.PERSISTED_CLIENT_DIRECTIVES=b.AUTHORIZATION_DIRECTIVES=b.ROOT_TYPE_NAMES=b.EXECUTABLE_DIRECTIVE_LOCATIONS=b.WEIGHT=b.VARIABLE_DEFINITION_UPPER=b.VALUES=b.URL_LOWER=b.UNION_UPPER=b.UNION=b.TYPENAME=b.TOPICS=b.TOPIC=b.TAG=b.SUCCESS=b.SUBSCRIPTION_UPPER=b.SUBSCRIBE=b.SUBSCRIPTION_FILTER_VALUE=b.SUBSCRIPTION_FILTER_CONDITION=b.SUBSCRIPTION_FILTER=b.SUBSCRIPTION_FIELD_CONDITION=b.SUBSCRIPTION=b.SUBJECTS=b.SUBJECT=b.STRING_SCALAR=b.STRING=b.STREAM_NAME=b.STREAM_CONFIGURATION=b.SPECIFIED_BY=b.SLICING_ARGUMENTS=b.SIZED_FIELDS=void 0;var es=Oe();b.AS="as";b.ASSUMED_SIZE="assumedSize";b.AND_UPPER="AND";b.ANY_SCALAR="_Any";b.ARGUMENT="argument";b.AUTHENTICATED="authenticated";b.ARGUMENT_DEFINITION_UPPER="ARGUMENT_DEFINITION";b.BOOLEAN="boolean";b.BOOLEAN_SCALAR="Boolean";b.CACHE_INVALIDATE="openfed__cacheInvalidate";b.CACHE_POPULATE="openfed__cachePopulate";b.CHANNEL="channel";b.CHANNELS="channels";b.COMPOSE_DIRECTIVE="composeDirective";b.CONDITION="condition";b.CONFIGURE_DESCRIPTION="openfed__configureDescription";b.CONFIGURE_CHILD_DESCRIPTIONS="openfed__configureChildDescriptions";b.CONSUMER_INACTIVE_THRESHOLD="consumerInactiveThreshold";b.CONSUMER_NAME="consumerName";b.CONNECT_FIELD_RESOLVER="connect__fieldResolver";b.CONTEXT="context";b.COST="cost";b.DEFAULT="default";b.DEFAULT_EDFS_PROVIDER_ID="default";b.DEFAULT_MUTATION="Mutation";b.DEFAULT_QUERY="Query";b.DEFAULT_SUBSCRIPTION="Subscription";b.DEPRECATED="deprecated";b.DEPRECATED_DEFAULT_ARGUMENT_VALUE="No longer supported";b.DESCRIPTION_OVERRIDE="descriptionOverride";b.DIRECTIVE_DEFINITION="directive definition";b.EDFS_KAFKA_PUBLISH="edfs__kafkaPublish";b.EDFS_KAFKA_SUBSCRIBE="edfs__kafkaSubscribe";b.EDFS_NATS_PUBLISH="edfs__natsPublish";b.EDFS_NATS_REQUEST="edfs__natsRequest";b.EDFS_NATS_SUBSCRIBE="edfs__natsSubscribe";b.EDFS_PUBLISH_RESULT="edfs__PublishResult";b.EDFS_NATS_STREAM_CONFIGURATION="edfs__NatsStreamConfiguration";b.EDFS_REDIS_PUBLISH="edfs__redisPublish";b.EDFS_REDIS_SUBSCRIBE="edfs__redisSubscribe";b.ENTITIES="entities";b.ENTITIES_FIELD="_entities";b.ENTITY_CACHE="openfed__entityCache";b.ENTITY_UNION="_Entity";b.ENUM="Enum";b.ENUM_UPPER="ENUM";b.ENUM_VALUE="Enum Value";b.ENUM_VALUE_UPPER="ENUM_VALUE";b.EXECUTION="EXECUTION";b.EXTERNAL="external";b.EXTENDS="extends";b.EXTENSIONS="extensions";b.FIELD="field";b.FIELD_PATH="fieldPath";b.FIELD_UPPER="FIELD";b.FIELD_SET_SCALAR="openfed__FieldSet";b.FIELDS="fields";b.FIELD_DEFINITION_UPPER="FIELD_DEFINITION";b.FIRST_ORDINAL="1st";b.FLOAT_SCALAR="Float";b.FOR="for";b.FRAGMENT_DEFINITION_UPPER="FRAGMENT_DEFINITION";b.FRAGMENT_SPREAD_UPPER="FRAGMENT_SPREAD";b.FROM="from";b.HYPHEN_JOIN=` + -`;b.ID_SCALAR="ID";b.IMPORT="import";b.INACCESSIBLE="inaccessible";b.INCLUDE_HEADERS="includeHeaders";b.INLINE_FRAGMENT="inlineFragment";b.IN_UPPER="IN";b.INLINE_FRAGMENT_UPPER="INLINE_FRAGMENT";b.INPUT="Input";b.INPUT_FIELD="Input field";b.INPUT_FIELD_DEFINITION_UPPER="INPUT_FIELD_DEFINITION";b.INPUT_OBJECT="Input Object";b.INPUT_OBJECT_UPPER="INPUT_OBJECT";b.INPUT_VALUE="Input Value";b.INT_SCALAR="Int";b.INTERFACE="Interface";b.INTERFACE_UPPER="INTERFACE";b.INTERFACE_OBJECT="interfaceObject";b.IS="openfed__is";b.KEY="key";b.LEFT_PARENTHESIS="(";b.LEVELS="levels";b.LINK="link";b.LIST_SIZE="listSize";b.LINK_IMPORT="link__Import";b.LINK_PURPOSE="link__Purpose";b.LIST="list";b.LITERAL_OPEN_BRACE="{";b.LITERAL_SPACE=" ";b.LITERAL_NEW_LINE=` +`;b.LITERAL_PERIOD=".";b.MAX_AGE="maxAge";b.NEGATIVE_CACHE_TTL="negativeCacheTTL";b.NUMBER="number";b.MUTATION="Mutation";b.MUTATION_UPPER="MUTATION";b.PROPAGATE="propagate";b.PROVIDER_TYPE_KAFKA="kafka";b.PROVIDER_TYPE_NATS="nats";b.PROVIDER_TYPE_REDIS="redis";b.NOT_APPLICABLE="N/A";b.NAME="name";b.NON_NULLABLE_EDFS_PUBLISH_EVENT_RESULT="edfs__PublishResult!";b.NON_NULLABLE_BOOLEAN="Boolean!";b.NON_NULLABLE_INT="Int!";b.NON_NULLABLE_STRING="String!";b.NOT_UPPER="NOT";b.NULL="Null";b.ONE_OF="oneOf";b.OPERATION_TO_DEFAULT="operationTypeNodeToDefaultType";b.OBJECT="Object";b.OBJECT_UPPER="OBJECT";b.OR_UPPER="OR";b.OVERRIDE="override";b.PARENT_DEFINITION_DATA="parentDefinitionDataByTypeName";b.PARENT_DEFINITION_DATA_MAP="parentDefinitionDataByParentTypeName";b.PARENT_EXTENSION_DATA_MAP="parentExtensionDataByParentTypeName";b.PARTIAL_CACHE_LOAD="partialCacheLoad";b.PROVIDER_ID="providerId";b.PROVIDES="provides";b.PUBLISH="publish";b.QUERY="Query";b.QUERY_CACHE="openfed__queryCache";b.QUERY_UPPER="QUERY";b.QUOTATION_JOIN='", "';b.REASON="reason";b.REQUEST="request";b.REQUEST_SCOPED="openfed__requestScoped";b.REQUIRE_FETCH_REASONS="openfed__requireFetchReasons";b.REQUIRE_ONE_SLICING_ARGUMENT="requireOneSlicingArgument";b.REQUIRES="requires";b.REQUIRES_SCOPES="requiresScopes";b.RESOLVABLE="resolvable";b.SCALAR="Scalar";b.SCALAR_UPPER="SCALAR";b.SCHEMA="schema";b.SCHEMA_UPPER="SCHEMA";b.SCOPES="scopes";b.SCOPE_SCALAR="openfed__Scope";b.SECURITY="SECURITY";b.SELECTION_REPRESENTATION=" { ... }";b.SEMANTIC_NON_NULL="semanticNonNull";b.SERVICE_OBJECT="_Service";b.SERVICE_FIELD="_service";b.SHADOW_MODE="shadowMode";b.SHAREABLE="shareable";b.SIZED_FIELDS="sizedFields";b.SLICING_ARGUMENTS="slicingArguments";b.SPECIFIED_BY="specifiedBy";b.STREAM_CONFIGURATION="streamConfiguration";b.STREAM_NAME="streamName";b.STRING="string";b.STRING_SCALAR="String";b.SUBJECT="subject";b.SUBJECTS="subjects";b.SUBSCRIPTION="Subscription";b.SUBSCRIPTION_FIELD_CONDITION="openfed__SubscriptionFieldCondition";b.SUBSCRIPTION_FILTER="openfed__subscriptionFilter";b.SUBSCRIPTION_FILTER_CONDITION="openfed__SubscriptionFilterCondition";b.SUBSCRIPTION_FILTER_VALUE="openfed__SubscriptionFilterValue";b.SUBSCRIBE="subscribe";b.SUBSCRIPTION_UPPER="SUBSCRIPTION";b.SUCCESS="success";b.TAG="tag";b.TOPIC="topic";b.TOPICS="topics";b.TYPENAME="__typename";b.UNION="Union";b.UNION_UPPER="UNION";b.URL_LOWER="url";b.VALUES="values";b.VARIABLE_DEFINITION_UPPER="VARIABLE_DEFINITION";b.WEIGHT="weight";b.EXECUTABLE_DIRECTIVE_LOCATIONS=new Set([b.FIELD_UPPER,b.FRAGMENT_DEFINITION_UPPER,b.FRAGMENT_SPREAD_UPPER,b.INLINE_FRAGMENT_UPPER,b.MUTATION_UPPER,b.QUERY_UPPER,b.SUBSCRIPTION_UPPER]);b.ROOT_TYPE_NAMES=new Set([b.MUTATION,b.QUERY,b.SUBSCRIPTION]);b.AUTHORIZATION_DIRECTIVES=new Set([b.AUTHENTICATED,b.REQUIRES_SCOPES]);b.PERSISTED_CLIENT_DIRECTIVES=new Set([b.DEPRECATED,b.ONE_OF,b.SEMANTIC_NON_NULL]);b.INHERITABLE_DIRECTIVE_NAMES=new Set([b.EXTERNAL,b.REQUIRE_FETCH_REASONS,b.SHAREABLE]);b.IGNORED_FIELDS=new Set([b.ENTITIES_FIELD,b.SERVICE_FIELD]);b.INPUT_NODE_KINDS=new Set([es.Kind.ENUM_TYPE_DEFINITION,es.Kind.INPUT_OBJECT_TYPE_DEFINITION,es.Kind.SCALAR_TYPE_DEFINITION]);b.OUTPUT_NODE_KINDS=new Set([es.Kind.ENUM_TYPE_DEFINITION,es.Kind.INTERFACE_TYPE_DEFINITION,es.Kind.OBJECT_TYPE_DEFINITION,es.Kind.SCALAR_TYPE_DEFINITION,es.Kind.UNION_TYPE_DEFINITION]);b.INTERFACE_NODE_KINDS=new Set([es.Kind.INTERFACE_TYPE_DEFINITION,es.Kind.INTERFACE_TYPE_EXTENSION]);b.NON_REPEATABLE_PERSISTED_DIRECTIVES=new Set([b.INACCESSIBLE,b.ONE_OF,b.SEMANTIC_NON_NULL])});var kr=F(er=>{"use strict";m();T();N();Object.defineProperty(er,"__esModule",{value:!0});er.operationTypeNodeToDefaultType=void 0;er.isObjectLikeNodeEntity=aZ;er.isNodeInterfaceObject=sZ;er.stringToNameNode=UT;er.stringArrayToNameNodeArray=oZ;er.setToNameNodeArray=uZ;er.stringToNamedTypeNode=$U;er.setToNamedTypeNodeArray=cZ;er.nodeKindToDirectiveLocation=lZ;er.isKindAbstract=dZ;er.extractExecutableDirectiveLocations=pZ;er.formatDescription=fZ;er.lexicographicallySortArgumentNodes=GU;er.lexicographicallySortSelectionSetNode=CT;er.lexicographicallySortDocumentNode=mZ;er.parse=QU;er.safeParse=NZ;var $t=Oe(),Cn=Zn();function aZ(e){var t;if(!((t=e.directives)!=null&&t.length))return!1;for(let n of e.directives)if(n.name.value===Cn.KEY)return!0;return!1}function sZ(e){var t;if(!((t=e.directives)!=null&&t.length))return!1;for(let n of e.directives)if(n.name.value===Cn.INTERFACE_OBJECT)return!0;return!1}function UT(e){return{kind:$t.Kind.NAME,value:e}}function oZ(e){let t=[];for(let n of e)t.push(UT(n));return t}function uZ(e){let t=[];for(let n of e)t.push(UT(n));return t}function $U(e){return{kind:$t.Kind.NAMED_TYPE,name:UT(e)}}function cZ(e){let t=[];for(let n of e)t.push($U(n));return t}function lZ(e){switch(e){case $t.Kind.ARGUMENT:return Cn.ARGUMENT_DEFINITION_UPPER;case $t.Kind.ENUM_TYPE_DEFINITION:case $t.Kind.ENUM_TYPE_EXTENSION:return Cn.ENUM_UPPER;case $t.Kind.ENUM_VALUE_DEFINITION:return Cn.ENUM_VALUE_UPPER;case $t.Kind.FIELD_DEFINITION:return Cn.FIELD_DEFINITION_UPPER;case $t.Kind.FRAGMENT_DEFINITION:return Cn.FRAGMENT_DEFINITION_UPPER;case $t.Kind.FRAGMENT_SPREAD:return Cn.FRAGMENT_SPREAD_UPPER;case $t.Kind.INLINE_FRAGMENT:return Cn.INLINE_FRAGMENT_UPPER;case $t.Kind.INPUT_VALUE_DEFINITION:return Cn.INPUT_FIELD_DEFINITION_UPPER;case $t.Kind.INPUT_OBJECT_TYPE_DEFINITION:case $t.Kind.INPUT_OBJECT_TYPE_EXTENSION:return Cn.INPUT_OBJECT_UPPER;case $t.Kind.INTERFACE_TYPE_DEFINITION:case $t.Kind.INTERFACE_TYPE_EXTENSION:return Cn.INTERFACE_UPPER;case $t.Kind.OBJECT_TYPE_DEFINITION:case $t.Kind.OBJECT_TYPE_EXTENSION:return Cn.OBJECT_UPPER;case $t.Kind.SCALAR_TYPE_DEFINITION:case $t.Kind.SCALAR_TYPE_EXTENSION:return Cn.SCALAR_UPPER;case $t.Kind.SCHEMA_DEFINITION:case $t.Kind.SCHEMA_EXTENSION:return Cn.SCHEMA_UPPER;case $t.Kind.UNION_TYPE_DEFINITION:case $t.Kind.UNION_TYPE_EXTENSION:return Cn.UNION_UPPER;default:return e}}er.operationTypeNodeToDefaultType=new Map([[$t.OperationTypeNode.MUTATION,Cn.MUTATION],[$t.OperationTypeNode.QUERY,Cn.QUERY],[$t.OperationTypeNode.SUBSCRIPTION,Cn.SUBSCRIPTION]]);function dZ(e){return e===$t.Kind.INTERFACE_TYPE_DEFINITION||e===$t.Kind.UNION_TYPE_DEFINITION}function pZ(e,t){for(let n of e){let r=n.value;Cn.EXECUTABLE_DIRECTIVE_LOCATIONS.has(r)&&t.add(r)}return t}function fZ(e){if(!e)return e;let t=e.value;if(e.block){let n=t.split(` `);n.length>1&&(t=n.map(r=>r.trimStart()).join(` -`))}return $(M({},e),{value:t,block:!0})}function AU(e){return e.arguments?e.arguments.sort((n,r)=>n.name.value.localeCompare(r.name.value)):e.arguments}function IT(e){let t=e.selections;return $(M({},e),{selections:t.sort((n,r)=>{var a,o,u,l;return Rn.NAME in n?Rn.NAME in r?n.name.value.localeCompare(r.name.value):-1:Rn.NAME in r?1:((o=(a=n.typeCondition)==null?void 0:a.name.value)!=null?o:"").localeCompare((l=(u=r.typeCondition)==null?void 0:u.name.value)!=null?l:"")}).map(n=>{switch(n.kind){case Vt.Kind.FIELD:return $(M({},n),{arguments:AU(n),selectionSet:n.selectionSet?IT(n.selectionSet):n.selectionSet});case Vt.Kind.FRAGMENT_SPREAD:return n;case Vt.Kind.INLINE_FRAGMENT:return $(M({},n),{selectionSet:IT(n.selectionSet)})}})})}function eZ(e){return $(M({},e),{definitions:e.definitions.map(t=>t.kind!==Vt.Kind.OPERATION_DEFINITION?t:$(M({},t),{selectionSet:IT(t.selectionSet)}))})}function RU(e,t=!0){return(0,Vt.parse)(e,{noLocation:t})}function tZ(e,t=!0){try{return{documentNode:RU(e,t)}}catch(n){return{error:n}}}});var wU=F(Vl=>{"use strict";m();T();N();Object.defineProperty(Vl,"__esModule",{value:!0});Vl.AccumulatorMap=void 0;Vl.mapValue=ql;Vl.extendSchemaImpl=nZ;var ke=Se(),Cs=class extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(t,n){let r=this.get(t);r===void 0?this.set(t,[n]):r.push(n)}};Vl.AccumulatorMap=Cs;function ql(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}function nZ(e,t,n){var Ae,ve,Ce,bt;let r=[],i=new Cs,a=new Cs,o=new Cs,u=new Cs,l=new Cs,d=new Cs,p=[],E,h=[],v=!1;for(let z of t.definitions){switch(z.kind){case ke.Kind.SCHEMA_DEFINITION:E=z;break;case ke.Kind.SCHEMA_EXTENSION:h.push(z);break;case ke.Kind.DIRECTIVE_DEFINITION:p.push(z);break;case ke.Kind.SCALAR_TYPE_DEFINITION:case ke.Kind.OBJECT_TYPE_DEFINITION:case ke.Kind.INTERFACE_TYPE_DEFINITION:case ke.Kind.UNION_TYPE_DEFINITION:case ke.Kind.ENUM_TYPE_DEFINITION:case ke.Kind.INPUT_OBJECT_TYPE_DEFINITION:r.push(z);break;case ke.Kind.SCALAR_TYPE_EXTENSION:i.add(z.name.value,z);break;case ke.Kind.OBJECT_TYPE_EXTENSION:a.add(z.name.value,z);break;case ke.Kind.INTERFACE_TYPE_EXTENSION:o.add(z.name.value,z);break;case ke.Kind.UNION_TYPE_EXTENSION:u.add(z.name.value,z);break;case ke.Kind.ENUM_TYPE_EXTENSION:l.add(z.name.value,z);break;case ke.Kind.INPUT_OBJECT_TYPE_EXTENSION:d.add(z.name.value,z);break;default:continue}v=!0}if(!v)return e;let A=new Map;for(let z of e.types){let ae=ie(z);ae&&A.set(z.name,ae)}for(let z of r){let ae=z.name.value;A.set(ae,(Ae=PU.get(ae))!=null?Ae:se(z))}for(let[z,ae]of a)A.set(z,new ke.GraphQLObjectType({name:z,interfaces:()=>en(ae),fields:()=>Kt(ae),extensionASTNodes:ae}));if(n!=null&&n.addInvalidExtensionOrphans){for(let[z,ae]of o)A.set(z,new ke.GraphQLInterfaceType({name:z,interfaces:()=>en(ae),fields:()=>Kt(ae),extensionASTNodes:ae}));for(let[z,ae]of l)A.set(z,new ke.GraphQLEnumType({name:z,values:En(ae),extensionASTNodes:ae}));for(let[z,ae]of u)A.set(z,new ke.GraphQLUnionType({name:z,types:()=>Ln(ae),extensionASTNodes:ae}));for(let[z,ae]of i)A.set(z,new ke.GraphQLScalarType({name:z,extensionASTNodes:ae}));for(let[z,ae]of d)A.set(z,new ke.GraphQLInputObjectType({name:z,fields:()=>rr(ae),extensionASTNodes:ae}))}let B=M(M({query:e.query&&J(e.query),mutation:e.mutation&&J(e.mutation),subscription:e.subscription&&J(e.subscription)},E&&Zt([E])),Zt(h));return $(M({description:(Ce=(ve=E==null?void 0:E.description)==null?void 0:ve.value)!=null?Ce:e.description},B),{types:Array.from(A.values()),directives:[...e.directives.map(re),...p.map(Ot)],extensions:e.extensions,astNode:E!=null?E:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(h),assumeValid:(bt=n==null?void 0:n.assumeValid)!=null?bt:!1});function V(z){return(0,ke.isListType)(z)?new ke.GraphQLList(V(z.ofType)):(0,ke.isNonNullType)(z)?new ke.GraphQLNonNull(V(z.ofType)):J(z)}function J(z){return A.get(z.name)}function re(z){if((0,ke.isSpecifiedDirective)(z))return z;let ae=z.toConfig();return new ke.GraphQLDirective($(M({},ae),{args:ql(ae.args,It)}))}function ie(z){if((0,ke.isIntrospectionType)(z)||(0,ke.isSpecifiedScalarType)(z))return z;if((0,ke.isScalarType)(z))return _e(z);if((0,ke.isObjectType)(z))return ye(z);if((0,ke.isInterfaceType)(z))return qe(z);if((0,ke.isUnionType)(z))return Z(z);if((0,ke.isEnumType)(z))return Ee(z);if((0,ke.isInputObjectType)(z))return Ne(z)}function Ne(z){var He;let ae=z.toConfig(),Ke=(He=d.get(ae.name))!=null?He:[];return new ke.GraphQLInputObjectType($(M({},ae),{fields:()=>M(M({},ql(ae.fields,Mt=>$(M({},Mt),{type:V(Mt.type)}))),rr(Ke)),extensionASTNodes:ae.extensionASTNodes.concat(Ke)}))}function Ee(z){var He;let ae=z.toConfig(),Ke=(He=l.get(z.name))!=null?He:[];return new ke.GraphQLEnumType($(M({},ae),{values:M(M({},ae.values),En(Ke)),extensionASTNodes:ae.extensionASTNodes.concat(Ke)}))}function _e(z){var Mt,it;let ae=z.toConfig(),Ke=(Mt=i.get(ae.name))!=null?Mt:[],He=ae.specifiedByURL;for(let Lt of Ke)He=(it=FU(Lt))!=null?it:He;return new ke.GraphQLScalarType($(M({},ae),{specifiedByURL:He,extensionASTNodes:ae.extensionASTNodes.concat(Ke)}))}function ye(z){var He;let ae=z.toConfig(),Ke=(He=a.get(ae.name))!=null?He:[];return new ke.GraphQLObjectType($(M({},ae),{interfaces:()=>[...z.getInterfaces().map(J),...en(Ke)],fields:()=>M(M({},ql(ae.fields,ge)),Kt(Ke)),extensionASTNodes:ae.extensionASTNodes.concat(Ke)}))}function qe(z){var He;let ae=z.toConfig(),Ke=(He=o.get(ae.name))!=null?He:[];return new ke.GraphQLInterfaceType($(M({},ae),{interfaces:()=>[...z.getInterfaces().map(J),...en(Ke)],fields:()=>M(M({},ql(ae.fields,ge)),Kt(Ke)),extensionASTNodes:ae.extensionASTNodes.concat(Ke)}))}function Z(z){var He;let ae=z.toConfig(),Ke=(He=u.get(ae.name))!=null?He:[];return new ke.GraphQLUnionType($(M({},ae),{types:()=>[...z.getTypes().map(J),...Ln(Ke)],extensionASTNodes:ae.extensionASTNodes.concat(Ke)}))}function ge(z){return $(M({},z),{type:V(z.type),args:z.args&&ql(z.args,It)})}function It(z){return $(M({},z),{type:V(z.type)})}function Zt(z){var Ke;let ae={};for(let He of z){let Mt=(Ke=He.operationTypes)!=null?Ke:[];for(let it of Mt)ae[it.operation]=In(it.type)}return ae}function In(z){var He;let ae=z.name.value,Ke=(He=PU.get(ae))!=null?He:A.get(ae);if(Ke===void 0)throw new Error(`Unknown type: "${ae}".`);return Ke}function Tn(z){return z.kind===ke.Kind.LIST_TYPE?new ke.GraphQLList(Tn(z.type)):z.kind===ke.Kind.NON_NULL_TYPE?new ke.GraphQLNonNull(Tn(z.type)):In(z)}function Ot(z){var ae;return new ke.GraphQLDirective({name:z.name.value,description:(ae=z.description)==null?void 0:ae.value,locations:z.locations.map(({value:Ke})=>Ke),isRepeatable:z.repeatable,args:qr(z.arguments),astNode:z})}function Kt(z){var Ke,He;let ae=Object.create(null);for(let Mt of z){let it=(Ke=Mt.fields)!=null?Ke:[];for(let Lt of it)ae[Lt.name.value]={type:Tn(Lt.type),description:(He=Lt.description)==null?void 0:He.value,args:qr(Lt.arguments),deprecationReason:_T(Lt),astNode:Lt}}return ae}function qr(z){var He;let ae=z!=null?z:[],Ke=Object.create(null);for(let Mt of ae){let it=Tn(Mt.type);Ke[Mt.name.value]={type:it,description:(He=Mt.description)==null?void 0:He.value,defaultValue:(0,ke.valueFromAST)(Mt.defaultValue,it),deprecationReason:_T(Mt),astNode:Mt}}return Ke}function rr(z){var Ke,He;let ae=Object.create(null);for(let Mt of z){let it=(Ke=Mt.fields)!=null?Ke:[];for(let Lt of it){let ms=Tn(Lt.type);ae[Lt.name.value]={type:ms,description:(He=Lt.description)==null?void 0:He.value,defaultValue:(0,ke.valueFromAST)(Lt.defaultValue,ms),deprecationReason:_T(Lt),astNode:Lt}}}return ae}function En(z){var Ke,He;let ae=Object.create(null);for(let Mt of z){let it=(Ke=Mt.values)!=null?Ke:[];for(let Lt of it)ae[Lt.name.value]={description:(He=Lt.description)==null?void 0:He.value,deprecationReason:_T(Lt),astNode:Lt}}return ae}function en(z){return z.flatMap(ae=>{var Ke,He;return(He=(Ke=ae.interfaces)==null?void 0:Ke.map(In))!=null?He:[]})}function Ln(z){return z.flatMap(ae=>{var Ke,He;return(He=(Ke=ae.types)==null?void 0:Ke.map(In))!=null?He:[]})}function se(z){var Ke,He,Mt,it,Lt,ms,Wr,Ns,al,Ba,gr,di;let ae=z.name.value;switch(z.kind){case ke.Kind.OBJECT_TYPE_DEFINITION:{let $t=(Ke=a.get(ae))!=null?Ke:[],_r=[z,...$t];return a.delete(ae),new ke.GraphQLObjectType({name:ae,description:(He=z.description)==null?void 0:He.value,interfaces:()=>en(_r),fields:()=>Kt(_r),astNode:z,extensionASTNodes:$t})}case ke.Kind.INTERFACE_TYPE_DEFINITION:{let $t=(Mt=o.get(ae))!=null?Mt:[],_r=[z,...$t];return o.delete(ae),new ke.GraphQLInterfaceType({name:ae,description:(it=z.description)==null?void 0:it.value,interfaces:()=>en(_r),fields:()=>Kt(_r),astNode:z,extensionASTNodes:$t})}case ke.Kind.ENUM_TYPE_DEFINITION:{let $t=(Lt=l.get(ae))!=null?Lt:[],_r=[z,...$t];return l.delete(ae),new ke.GraphQLEnumType({name:ae,description:(ms=z.description)==null?void 0:ms.value,values:En(_r),astNode:z,extensionASTNodes:$t})}case ke.Kind.UNION_TYPE_DEFINITION:{let $t=(Wr=u.get(ae))!=null?Wr:[],_r=[z,...$t];return u.delete(ae),new ke.GraphQLUnionType({name:ae,description:(Ns=z.description)==null?void 0:Ns.value,types:()=>Ln(_r),astNode:z,extensionASTNodes:$t})}case ke.Kind.SCALAR_TYPE_DEFINITION:{let $t=(al=i.get(ae))!=null?al:[];return i.delete(ae),new ke.GraphQLScalarType({name:ae,description:(Ba=z.description)==null?void 0:Ba.value,specifiedByURL:FU(z),astNode:z,extensionASTNodes:$t})}case ke.Kind.INPUT_OBJECT_TYPE_DEFINITION:{let $t=(gr=d.get(ae))!=null?gr:[],_r=[z,...$t];return d.delete(ae),new ke.GraphQLInputObjectType({name:ae,description:(di=z.description)==null?void 0:di.value,fields:()=>rr(_r),astNode:z,extensionASTNodes:$t})}}}}var PU=new Map([...ke.specifiedScalarTypes,...ke.introspectionTypes].map(e=>[e.name,e]));function _T(e){let t=(0,ke.getDirectiveValues)(ke.GraphQLDeprecatedDirective,e);return t==null?void 0:t.reason}function FU(e){let t=(0,ke.getDirectiveValues)(ke.GraphQLSpecifiedByDirective,e);return t==null?void 0:t.url}});var Jv=F(Yv=>{"use strict";m();T();N();Object.defineProperty(Yv,"__esModule",{value:!0});Yv.buildASTSchema=aZ;var LU=Se(),rZ=kl(),iZ=wU();function aZ(e,t){(t==null?void 0:t.assumeValid)!==!0&&(t==null?void 0:t.assumeValidSDL)!==!0&&(0,rZ.assertValidSDL)(e);let n={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},r=(0,iZ.extendSchemaImpl)(n,e,t);if(r.astNode==null)for(let a of r.types)switch(a.name){case"Query":r.query=a;break;case"Mutation":r.mutation=a;break;case"Subscription":r.subscription=a;break}let i=[...r.directives,...LU.specifiedDirectives.filter(a=>r.directives.every(o=>o.name!==a.name))];return new LU.GraphQLSchema($(M({},r),{directives:i}))}});var jl=F(bu=>{"use strict";m();T();N();Object.defineProperty(bu,"__esModule",{value:!0});bu.MAX_INT32=bu.MAX_SUBSCRIPTION_FILTER_DEPTH=bu.MAXIMUM_TYPE_NESTING=void 0;bu.MAXIMUM_TYPE_NESTING=30;bu.MAX_SUBSCRIPTION_FILTER_DEPTH=5;bu.MAX_INT32=cn(2,31)-1});var Ur=F(lr=>{"use strict";m();T();N();Object.defineProperty(lr,"__esModule",{value:!0});lr.getOrThrowError=oZ;lr.getEntriesNotInHashSet=uZ;lr.numberToOrdinal=cZ;lr.addIterableToSet=lZ;lr.addOptionalIterableToSet=dZ;lr.addSets=fZ;lr.kindToNodeType=pZ;lr.getValueOrDefault=mZ;lr.add=NZ;lr.generateSimpleDirective=TZ;lr.generateRequiresScopesDirective=EZ;lr.generateSemanticNonNullDirective=hZ;lr.copyObjectValueMap=yZ;lr.addNewObjectValueMapEntries=IZ;lr.copyArrayValueMap=gZ;lr.addMapEntries=_Z;lr.getFirstEntry=vZ;var Qt=Se(),Tr=Hn(),sZ=Qi(),Yf=Cr();function oZ(e,t,n){let r=e.get(t);if(r===void 0)throw(0,sZ.invalidKeyFatalError)(t,n);return r}function uZ(e,t){let n=[];for(let r of e)t.has(r)||n.push(r);return n}function cZ(e){let t=e.toString();switch(t[t.length-1]){case"1":return`${t}st`;case"2":return`${t}nd`;case"3":return`${t}rd`;default:return`${t}th`}}function lZ({source:e,target:t}){for(let n of e)t.add(n)}function dZ({source:e,target:t}){if(e)for(let n of e)t.add(n)}function fZ(e,t){let n=new Set(e);for(let r of t)n.add(r);return n}function pZ(e){switch(e){case Qt.Kind.BOOLEAN:return Tr.BOOLEAN_SCALAR;case Qt.Kind.ENUM:case Qt.Kind.ENUM_TYPE_DEFINITION:return Tr.ENUM;case Qt.Kind.ENUM_TYPE_EXTENSION:return"Enum extension";case Qt.Kind.ENUM_VALUE_DEFINITION:return Tr.ENUM_VALUE;case Qt.Kind.FIELD_DEFINITION:return Tr.FIELD;case Qt.Kind.FLOAT:return Tr.FLOAT_SCALAR;case Qt.Kind.INPUT_OBJECT_TYPE_DEFINITION:return Tr.INPUT_OBJECT;case Qt.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"Input Object extension";case Qt.Kind.INPUT_VALUE_DEFINITION:return Tr.INPUT_VALUE;case Qt.Kind.INT:return Tr.INT_SCALAR;case Qt.Kind.INTERFACE_TYPE_DEFINITION:return Tr.INTERFACE;case Qt.Kind.INTERFACE_TYPE_EXTENSION:return"Interface extension";case Qt.Kind.NULL:return Tr.NULL;case Qt.Kind.OBJECT:case Qt.Kind.OBJECT_TYPE_DEFINITION:return Tr.OBJECT;case Qt.Kind.OBJECT_TYPE_EXTENSION:return"Object extension";case Qt.Kind.STRING:return Tr.STRING_SCALAR;case Qt.Kind.SCALAR_TYPE_DEFINITION:return Tr.SCALAR;case Qt.Kind.SCALAR_TYPE_EXTENSION:return"Scalar extension";case Qt.Kind.UNION_TYPE_DEFINITION:return Tr.UNION;case Qt.Kind.UNION_TYPE_EXTENSION:return"Union extension";default:return e}}function mZ(e,t,n){let r=e.get(t);if(r)return r;let i=n();return e.set(t,i),i}function NZ(e,t){return e.has(t)?!1:(e.add(t),!0)}function TZ(e){return{kind:Qt.Kind.DIRECTIVE,name:(0,Yf.stringToNameNode)(e)}}function EZ(e){let t=[];for(let n of e){let r=[];for(let i of n)r.push({kind:Qt.Kind.STRING,value:i});t.push({kind:Qt.Kind.LIST,values:r})}return{kind:Qt.Kind.DIRECTIVE,name:(0,Yf.stringToNameNode)(Tr.REQUIRES_SCOPES),arguments:[{kind:Qt.Kind.ARGUMENT,name:(0,Yf.stringToNameNode)(Tr.SCOPES),value:{kind:Qt.Kind.LIST,values:t}}]}}function hZ(e){let t=Array.from(e).sort((r,i)=>r-i),n=new Array;for(let r of t)n.push({kind:Qt.Kind.INT,value:r.toString()});return{kind:Qt.Kind.DIRECTIVE,name:(0,Yf.stringToNameNode)(Tr.SEMANTIC_NON_NULL),arguments:[{kind:Qt.Kind.ARGUMENT,name:(0,Yf.stringToNameNode)(Tr.LEVELS),value:{kind:Qt.Kind.LIST,values:n}}]}}function yZ(e){let t=new Map;for(let[n,r]of e)t.set(n,M({},r));return t}function IZ(e,t){for(let[n,r]of e)t.set(n,M({},r))}function gZ(e){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function _Z({source:e,target:t}){for(let[n,r]of e)t.set(n,r)}function vZ(e){let{value:t,done:n}=e.values().next();if(!n)return t}});var Jf=F(vT=>{"use strict";m();T();N();Object.defineProperty(vT,"__esModule",{value:!0});vT.ExtensionType=void 0;var CU;(function(e){e[e.EXTENDS=0]="EXTENDS",e[e.NONE=1]="NONE",e[e.REAL=2]="REAL"})(CU||(vT.ExtensionType=CU={}))});var Au=F(kr=>{"use strict";m();T();N();Object.defineProperty(kr,"__esModule",{value:!0});kr.getMutableDirectiveDefinitionNode=OZ;kr.getMutableEnumNode=DZ;kr.getMutableEnumValueNode=bZ;kr.getMutableFieldNode=AZ;kr.getMutableInputObjectNode=RZ;kr.getMutableInputValueNode=PZ;kr.getMutableInterfaceNode=FZ;kr.getMutableObjectNode=wZ;kr.getMutableObjectExtensionNode=LZ;kr.getMutableScalarNode=CZ;kr.getMutableTypeNode=zv;kr.getMutableUnionNode=UZ;kr.getTypeNodeNamedTypeName=Hv;kr.getNamedTypeNode=BU;var Br=Se(),Kl=Cr(),UU=Qi(),SZ=jl();function OZ(e){return{arguments:[],kind:e.kind,locations:[],name:M({},e.name),repeatable:e.repeatable,description:(0,Kl.formatDescription)(e.description)}}function DZ(e){return{kind:Br.Kind.ENUM_TYPE_DEFINITION,name:M({},e)}}function bZ(e){return{directives:[],kind:e.kind,name:M({},e.name),description:(0,Kl.formatDescription)(e.description)}}function AZ(e,t,n){return{arguments:[],directives:[],kind:e.kind,name:M({},e.name),type:zv(e.type,t,n),description:(0,Kl.formatDescription)(e.description)}}function RZ(e){return{kind:Br.Kind.INPUT_OBJECT_TYPE_DEFINITION,name:M({},e)}}function PZ(e,t,n){return{directives:[],kind:e.kind,name:M({},e.name),type:zv(e.type,t,n),defaultValue:e.defaultValue,description:(0,Kl.formatDescription)(e.description)}}function FZ(e){return{kind:Br.Kind.INTERFACE_TYPE_DEFINITION,name:M({},e)}}function wZ(e){return{kind:Br.Kind.OBJECT_TYPE_DEFINITION,name:M({},e)}}function LZ(e){let t=e.kind===Br.Kind.OBJECT_TYPE_DEFINITION?e.description:void 0;return{kind:Br.Kind.OBJECT_TYPE_EXTENSION,name:M({},e.name),description:(0,Kl.formatDescription)(t)}}function CZ(e){return{kind:Br.Kind.SCALAR_TYPE_DEFINITION,name:M({},e)}}function zv(e,t,n){let r={kind:e.kind},i=r;for(let a=0;a{"use strict";m();T();N();Object.defineProperty($l,"__esModule",{value:!0});$l.REQUIRED_FIELDSET_TYPE_NODE=$l.REQUIRED_STRING_TYPE_NODE=void 0;var kU=Se(),MU=Cr(),xU=Hn();$l.REQUIRED_STRING_TYPE_NODE={kind:kU.Kind.NON_NULL_TYPE,type:(0,MU.stringToNamedTypeNode)(xU.STRING_SCALAR)};$l.REQUIRED_FIELDSET_TYPE_NODE={kind:kU.Kind.NON_NULL_TYPE,type:(0,MU.stringToNamedTypeNode)(xU.FIELD_SET_SCALAR)}});var zf=F(Me=>{"use strict";m();T();N();Object.defineProperty(Me,"__esModule",{value:!0});Me.TAG_DEFINITION=Me.SUBSCRIPTION_FILTER_DEFINITION=Me.SPECIFIED_BY_DEFINITION=Me.SHAREABLE_DEFINITION=Me.SEMANTIC_NON_NULL_DEFINITION=Me.REQUIRES_SCOPES_DEFINITION=Me.REQUIRES_DEFINITION=Me.REQUIRE_FETCH_REASONS_DEFINITION=Me.PROVIDES_DEFINITION=Me.OVERRIDE_DEFINITION=Me.ONE_OF_DEFINITION=Me.LIST_SIZE_DEFINITION=Me.LINK_DEFINITION=Me.KEY_DEFINITION=Me.INTERFACE_OBJECT_DEFINITION=Me.INACCESSIBLE_DEFINITION=Me.EDFS_REDIS_SUBSCRIBE_DEFINITION=Me.EDFS_REDIS_PUBLISH_DEFINITION=Me.EDFS_NATS_SUBSCRIBE_DEFINITION=Me.EDFS_NATS_REQUEST_DEFINITION=Me.EDFS_NATS_PUBLISH_DEFINITION=Me.EDFS_KAFKA_SUBSCRIBE_DEFINITION=Me.EDFS_KAFKA_PUBLISH_DEFINITION=Me.EXTERNAL_DEFINITION=Me.EXTENDS_DEFINITION=Me.DEPRECATED_DEFINITION=Me.COST_DEFINITION=Me.CONNECT_FIELD_RESOLVER_DEFINITION=Me.CONFIGURE_DESCRIPTION_DEFINITION=Me.CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION=Me.COMPOSE_DIRECTIVE_DEFINITION=Me.AUTHENTICATED_DEFINITION=void 0;var le=Se(),oe=Cr(),G=Hn(),Sr=ST();Me.AUTHENTICATED_DEFINITION={kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.ENUM_UPPER,G.FIELD_DEFINITION_UPPER,G.INTERFACE_UPPER,G.OBJECT_UPPER,G.SCALAR_UPPER]),name:(0,oe.stringToNameNode)(G.AUTHENTICATED),repeatable:!1};Me.COMPOSE_DIRECTIVE_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.NAME),type:Sr.REQUIRED_STRING_TYPE_NODE}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.SCHEMA_UPPER]),name:(0,oe.stringToNameNode)(G.COMPOSE_DIRECTIVE),repeatable:!0};Me.CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.PROPAGATE),type:{kind:le.Kind.NON_NULL_TYPE,type:(0,oe.stringToNamedTypeNode)(G.BOOLEAN_SCALAR)},defaultValue:{kind:le.Kind.BOOLEAN,value:!0}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.ENUM_UPPER,G.INPUT_OBJECT_UPPER,G.INTERFACE_UPPER,G.OBJECT_UPPER]),name:(0,oe.stringToNameNode)(G.CONFIGURE_CHILD_DESCRIPTIONS),repeatable:!1};Me.CONFIGURE_DESCRIPTION_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.PROPAGATE),type:{kind:le.Kind.NON_NULL_TYPE,type:(0,oe.stringToNamedTypeNode)(G.BOOLEAN_SCALAR)},defaultValue:{kind:le.Kind.BOOLEAN,value:!0}},{directives:[],kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.DESCRIPTION_OVERRIDE),type:(0,oe.stringToNamedTypeNode)(G.STRING_SCALAR)}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.ARGUMENT_DEFINITION_UPPER,G.ENUM_UPPER,G.ENUM_VALUE_UPPER,G.FIELD_DEFINITION_UPPER,G.INTERFACE_UPPER,G.INPUT_OBJECT_UPPER,G.INPUT_FIELD_DEFINITION_UPPER,G.OBJECT_UPPER,G.SCALAR_UPPER,G.SCHEMA_UPPER,G.UNION_UPPER]),name:(0,oe.stringToNameNode)(G.CONFIGURE_DESCRIPTION),repeatable:!1};Me.CONNECT_FIELD_RESOLVER_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.CONTEXT),type:Sr.REQUIRED_FIELDSET_TYPE_NODE}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.FIELD_DEFINITION_UPPER]),name:(0,oe.stringToNameNode)(G.CONNECT_FIELD_RESOLVER),repeatable:!1};Me.COST_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.WEIGHT),type:{kind:le.Kind.NON_NULL_TYPE,type:(0,oe.stringToNamedTypeNode)(G.INT_SCALAR)}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.ARGUMENT_DEFINITION_UPPER,G.ENUM_UPPER,G.FIELD_DEFINITION_UPPER,G.INPUT_FIELD_DEFINITION_UPPER,G.OBJECT_UPPER,G.SCALAR_UPPER]),name:(0,oe.stringToNameNode)(G.COST),repeatable:!1};Me.DEPRECATED_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.REASON),type:(0,oe.stringToNamedTypeNode)(G.STRING_SCALAR),defaultValue:{kind:le.Kind.STRING,value:le.DEFAULT_DEPRECATION_REASON}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.ARGUMENT_DEFINITION_UPPER,G.ENUM_VALUE_UPPER,G.FIELD_DEFINITION_UPPER,G.INPUT_FIELD_DEFINITION_UPPER]),name:(0,oe.stringToNameNode)(G.DEPRECATED),repeatable:!1};Me.EXTENDS_DEFINITION={kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.INTERFACE_UPPER,G.OBJECT_UPPER]),name:(0,oe.stringToNameNode)(G.EXTENDS),repeatable:!1};Me.EXTERNAL_DEFINITION={kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.FIELD_DEFINITION_UPPER,G.OBJECT_UPPER]),name:(0,oe.stringToNameNode)(G.EXTERNAL),repeatable:!1};Me.EDFS_KAFKA_PUBLISH_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.TOPIC),type:Sr.REQUIRED_STRING_TYPE_NODE},{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.PROVIDER_ID),type:Sr.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:le.Kind.STRING,value:G.DEFAULT_EDFS_PROVIDER_ID}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:[(0,oe.stringToNameNode)(G.FIELD_DEFINITION_UPPER)],name:(0,oe.stringToNameNode)(G.EDFS_KAFKA_PUBLISH),repeatable:!1};Me.EDFS_KAFKA_SUBSCRIBE_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.TOPICS),type:{kind:le.Kind.NON_NULL_TYPE,type:{kind:le.Kind.LIST_TYPE,type:Sr.REQUIRED_STRING_TYPE_NODE}}},{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.PROVIDER_ID),type:Sr.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:le.Kind.STRING,value:G.DEFAULT_EDFS_PROVIDER_ID}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:[(0,oe.stringToNameNode)(G.FIELD_DEFINITION_UPPER)],name:(0,oe.stringToNameNode)(G.EDFS_KAFKA_SUBSCRIBE),repeatable:!1};Me.EDFS_NATS_PUBLISH_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.SUBJECT),type:Sr.REQUIRED_STRING_TYPE_NODE},{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.PROVIDER_ID),type:{kind:le.Kind.NON_NULL_TYPE,type:(0,oe.stringToNamedTypeNode)(G.STRING_SCALAR)},defaultValue:{kind:le.Kind.STRING,value:G.DEFAULT_EDFS_PROVIDER_ID}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:[(0,oe.stringToNameNode)(G.FIELD_DEFINITION_UPPER)],name:(0,oe.stringToNameNode)(G.EDFS_NATS_PUBLISH),repeatable:!1};Me.EDFS_NATS_REQUEST_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.SUBJECT),type:{kind:le.Kind.NON_NULL_TYPE,type:(0,oe.stringToNamedTypeNode)(G.STRING_SCALAR)}},{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.PROVIDER_ID),type:{kind:le.Kind.NON_NULL_TYPE,type:(0,oe.stringToNamedTypeNode)(G.STRING_SCALAR)},defaultValue:{kind:le.Kind.STRING,value:G.DEFAULT_EDFS_PROVIDER_ID}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:[(0,oe.stringToNameNode)(G.FIELD_DEFINITION_UPPER)],name:(0,oe.stringToNameNode)(G.EDFS_NATS_REQUEST),repeatable:!1};Me.EDFS_NATS_SUBSCRIBE_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.SUBJECTS),type:{kind:le.Kind.NON_NULL_TYPE,type:{kind:le.Kind.LIST_TYPE,type:Sr.REQUIRED_STRING_TYPE_NODE}}},{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.PROVIDER_ID),type:Sr.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:le.Kind.STRING,value:G.DEFAULT_EDFS_PROVIDER_ID}},{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.STREAM_CONFIGURATION),type:(0,oe.stringToNamedTypeNode)(G.EDFS_NATS_STREAM_CONFIGURATION)}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:[(0,oe.stringToNameNode)(G.FIELD_DEFINITION_UPPER)],name:(0,oe.stringToNameNode)(G.EDFS_NATS_SUBSCRIBE),repeatable:!1};Me.EDFS_REDIS_PUBLISH_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.CHANNEL),type:Sr.REQUIRED_STRING_TYPE_NODE},{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.PROVIDER_ID),type:Sr.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:le.Kind.STRING,value:G.DEFAULT_EDFS_PROVIDER_ID}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:[(0,oe.stringToNameNode)(G.FIELD_DEFINITION_UPPER)],name:(0,oe.stringToNameNode)(G.EDFS_REDIS_PUBLISH),repeatable:!1};Me.EDFS_REDIS_SUBSCRIBE_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.CHANNELS),type:{kind:le.Kind.NON_NULL_TYPE,type:{kind:le.Kind.LIST_TYPE,type:Sr.REQUIRED_STRING_TYPE_NODE}}},{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.PROVIDER_ID),type:Sr.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:le.Kind.STRING,value:G.DEFAULT_EDFS_PROVIDER_ID}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:[(0,oe.stringToNameNode)(G.FIELD_DEFINITION_UPPER)],name:(0,oe.stringToNameNode)(G.EDFS_REDIS_SUBSCRIBE),repeatable:!1};Me.INACCESSIBLE_DEFINITION={kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.ARGUMENT_DEFINITION_UPPER,G.ENUM_UPPER,G.ENUM_VALUE_UPPER,G.FIELD_DEFINITION_UPPER,G.INPUT_FIELD_DEFINITION_UPPER,G.INPUT_OBJECT_UPPER,G.INTERFACE_UPPER,G.OBJECT_UPPER,G.SCALAR_UPPER,G.UNION_UPPER]),name:(0,oe.stringToNameNode)(G.INACCESSIBLE),repeatable:!1};Me.INTERFACE_OBJECT_DEFINITION={kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.OBJECT_UPPER]),name:(0,oe.stringToNameNode)(G.INTERFACE_OBJECT),repeatable:!1};Me.KEY_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.FIELDS),type:Sr.REQUIRED_FIELDSET_TYPE_NODE},{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.RESOLVABLE),type:(0,oe.stringToNamedTypeNode)(G.BOOLEAN_SCALAR),defaultValue:{kind:le.Kind.BOOLEAN,value:!0}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.INTERFACE_UPPER,G.OBJECT_UPPER]),name:(0,oe.stringToNameNode)(G.KEY),repeatable:!0};Me.LINK_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.URL_LOWER),type:{kind:le.Kind.NON_NULL_TYPE,type:(0,oe.stringToNamedTypeNode)(G.STRING_SCALAR)}},{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.AS),type:(0,oe.stringToNamedTypeNode)(G.STRING_SCALAR)},{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.FOR),type:(0,oe.stringToNamedTypeNode)(G.LINK_PURPOSE)},{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.IMPORT),type:{kind:le.Kind.LIST_TYPE,type:(0,oe.stringToNamedTypeNode)(G.LINK_IMPORT)}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.SCHEMA_UPPER]),name:(0,oe.stringToNameNode)(G.LINK),repeatable:!0};Me.LIST_SIZE_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.ASSUMED_SIZE),type:(0,oe.stringToNamedTypeNode)(G.INT_SCALAR)},{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.SLICING_ARGUMENTS),type:{kind:le.Kind.LIST_TYPE,type:{kind:le.Kind.NON_NULL_TYPE,type:(0,oe.stringToNamedTypeNode)(G.STRING_SCALAR)}}},{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.SIZED_FIELDS),type:{kind:le.Kind.LIST_TYPE,type:{kind:le.Kind.NON_NULL_TYPE,type:(0,oe.stringToNamedTypeNode)(G.STRING_SCALAR)}}},{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.REQUIRE_ONE_SLICING_ARGUMENT),type:(0,oe.stringToNamedTypeNode)(G.BOOLEAN_SCALAR),defaultValue:{kind:le.Kind.BOOLEAN,value:!0}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.FIELD_DEFINITION_UPPER]),name:(0,oe.stringToNameNode)(G.LIST_SIZE),repeatable:!1};Me.ONE_OF_DEFINITION={kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.INPUT_OBJECT_UPPER]),name:(0,oe.stringToNameNode)(G.ONE_OF),repeatable:!1};Me.OVERRIDE_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.FROM),type:{kind:le.Kind.NON_NULL_TYPE,type:(0,oe.stringToNamedTypeNode)(G.STRING_SCALAR)}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.FIELD_DEFINITION_UPPER]),name:(0,oe.stringToNameNode)(G.OVERRIDE),repeatable:!1};Me.PROVIDES_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.FIELDS),type:Sr.REQUIRED_FIELDSET_TYPE_NODE}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:[(0,oe.stringToNameNode)(G.FIELD_DEFINITION_UPPER)],name:(0,oe.stringToNameNode)(G.PROVIDES),repeatable:!1};Me.REQUIRE_FETCH_REASONS_DEFINITION={kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.FIELD_DEFINITION_UPPER,G.INTERFACE_UPPER,G.OBJECT_UPPER]),name:(0,oe.stringToNameNode)(G.REQUIRE_FETCH_REASONS),repeatable:!0};Me.REQUIRES_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.FIELDS),type:Sr.REQUIRED_FIELDSET_TYPE_NODE}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:[(0,oe.stringToNameNode)(G.FIELD_DEFINITION_UPPER)],name:(0,oe.stringToNameNode)(G.REQUIRES),repeatable:!1};Me.REQUIRES_SCOPES_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.SCOPES),type:{kind:le.Kind.NON_NULL_TYPE,type:{kind:le.Kind.LIST_TYPE,type:{kind:le.Kind.NON_NULL_TYPE,type:{kind:le.Kind.LIST_TYPE,type:{kind:le.Kind.NON_NULL_TYPE,type:(0,oe.stringToNamedTypeNode)(G.SCOPE_SCALAR)}}}}}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.ENUM_UPPER,G.FIELD_DEFINITION_UPPER,G.INTERFACE_UPPER,G.OBJECT_UPPER,G.SCALAR_UPPER]),name:(0,oe.stringToNameNode)(G.REQUIRES_SCOPES),repeatable:!1};Me.SEMANTIC_NON_NULL_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.LEVELS),type:{kind:le.Kind.NON_NULL_TYPE,type:{kind:le.Kind.LIST_TYPE,type:{kind:le.Kind.NON_NULL_TYPE,type:(0,oe.stringToNamedTypeNode)(G.INT_SCALAR)}}},defaultValue:{kind:le.Kind.LIST,values:[{kind:le.Kind.INT,value:"0"}]}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:[(0,oe.stringToNameNode)(G.FIELD_DEFINITION_UPPER)],name:(0,oe.stringToNameNode)(G.SEMANTIC_NON_NULL),repeatable:!1};Me.SHAREABLE_DEFINITION={kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.FIELD_DEFINITION_UPPER,G.OBJECT_UPPER]),name:(0,oe.stringToNameNode)(G.SHAREABLE),repeatable:!0};Me.SPECIFIED_BY_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.URL_LOWER),type:Sr.REQUIRED_STRING_TYPE_NODE}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.SCALAR_UPPER]),name:(0,oe.stringToNameNode)(G.SPECIFIED_BY),repeatable:!1};Me.SUBSCRIPTION_FILTER_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.CONDITION),type:{kind:le.Kind.NON_NULL_TYPE,type:(0,oe.stringToNamedTypeNode)(G.SUBSCRIPTION_FILTER_CONDITION)}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.FIELD_DEFINITION_UPPER]),name:(0,oe.stringToNameNode)(G.SUBSCRIPTION_FILTER),repeatable:!1};Me.TAG_DEFINITION={arguments:[{kind:le.Kind.INPUT_VALUE_DEFINITION,name:(0,oe.stringToNameNode)(G.NAME),type:{kind:le.Kind.NON_NULL_TYPE,type:(0,oe.stringToNamedTypeNode)(G.STRING_SCALAR)}}],kind:le.Kind.DIRECTIVE_DEFINITION,locations:(0,oe.stringArrayToNameNodeArray)([G.ARGUMENT_DEFINITION_UPPER,G.ENUM_UPPER,G.ENUM_VALUE_UPPER,G.FIELD_DEFINITION_UPPER,G.INPUT_FIELD_DEFINITION_UPPER,G.INPUT_OBJECT_UPPER,G.INTERFACE_UPPER,G.OBJECT_UPPER,G.SCALAR_UPPER,G.UNION_UPPER]),name:(0,oe.stringToNameNode)(G.TAG),repeatable:!0}});var Ru=F(Yi=>{"use strict";m();T();N();Object.defineProperty(Yi,"__esModule",{value:!0});Yi.MAX_OR_SCOPES=Yi.EDFS_ARGS_REGEXP=Yi.V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME=Yi.BASE_SCALARS=Yi.DIRECTIVE_DEFINITION_BY_NAME=void 0;var ut=Hn(),_t=zf();Yi.DIRECTIVE_DEFINITION_BY_NAME=new Map([[ut.AUTHENTICATED,_t.AUTHENTICATED_DEFINITION],[ut.COMPOSE_DIRECTIVE,_t.COMPOSE_DIRECTIVE_DEFINITION],[ut.CONFIGURE_DESCRIPTION,_t.CONFIGURE_DESCRIPTION_DEFINITION],[ut.CONFIGURE_CHILD_DESCRIPTIONS,_t.CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION],[ut.CONNECT_FIELD_RESOLVER,_t.CONNECT_FIELD_RESOLVER_DEFINITION],[ut.COST,_t.COST_DEFINITION],[ut.DEPRECATED,_t.DEPRECATED_DEFINITION],[ut.EDFS_KAFKA_PUBLISH,_t.EDFS_KAFKA_PUBLISH_DEFINITION],[ut.EDFS_KAFKA_SUBSCRIBE,_t.EDFS_KAFKA_SUBSCRIBE_DEFINITION],[ut.EDFS_NATS_PUBLISH,_t.EDFS_NATS_PUBLISH_DEFINITION],[ut.EDFS_NATS_REQUEST,_t.EDFS_NATS_REQUEST_DEFINITION],[ut.EDFS_NATS_SUBSCRIBE,_t.EDFS_NATS_SUBSCRIBE_DEFINITION],[ut.EDFS_REDIS_PUBLISH,_t.EDFS_REDIS_PUBLISH_DEFINITION],[ut.EDFS_REDIS_SUBSCRIBE,_t.EDFS_REDIS_SUBSCRIBE_DEFINITION],[ut.EXTENDS,_t.EXTENDS_DEFINITION],[ut.EXTERNAL,_t.EXTERNAL_DEFINITION],[ut.INACCESSIBLE,_t.INACCESSIBLE_DEFINITION],[ut.INTERFACE_OBJECT,_t.INTERFACE_OBJECT_DEFINITION],[ut.KEY,_t.KEY_DEFINITION],[ut.LINK,_t.LINK_DEFINITION],[ut.LIST_SIZE,_t.LIST_SIZE_DEFINITION],[ut.ONE_OF,_t.ONE_OF_DEFINITION],[ut.OVERRIDE,_t.OVERRIDE_DEFINITION],[ut.PROVIDES,_t.PROVIDES_DEFINITION],[ut.REQUIRE_FETCH_REASONS,_t.REQUIRE_FETCH_REASONS_DEFINITION],[ut.REQUIRES,_t.REQUIRES_DEFINITION],[ut.REQUIRES_SCOPES,_t.REQUIRES_SCOPES_DEFINITION],[ut.SEMANTIC_NON_NULL,_t.SEMANTIC_NON_NULL_DEFINITION],[ut.SHAREABLE,_t.SHAREABLE_DEFINITION],[ut.SPECIFIED_BY,_t.SPECIFIED_BY_DEFINITION],[ut.SUBSCRIPTION_FILTER,_t.SUBSCRIPTION_FILTER_DEFINITION],[ut.TAG,_t.TAG_DEFINITION]]);Yi.BASE_SCALARS=new Set(["_Any","_Entities",ut.BOOLEAN_SCALAR,ut.FLOAT_SCALAR,ut.ID_SCALAR,ut.INT_SCALAR,ut.FIELD_SET_SCALAR,ut.SCOPE_SCALAR,ut.STRING_SCALAR]);Yi.V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME=new Map([[ut.AUTHENTICATED,_t.AUTHENTICATED_DEFINITION],[ut.COMPOSE_DIRECTIVE,_t.COMPOSE_DIRECTIVE_DEFINITION],[ut.INACCESSIBLE,_t.INACCESSIBLE_DEFINITION],[ut.INTERFACE_OBJECT,_t.INTERFACE_OBJECT_DEFINITION],[ut.LINK,_t.LINK_DEFINITION],[ut.OVERRIDE,_t.OVERRIDE_DEFINITION],[ut.REQUIRES_SCOPES,_t.REQUIRES_SCOPES_DEFINITION],[ut.SHAREABLE,_t.SHAREABLE_DEFINITION]]);Yi.EDFS_ARGS_REGEXP=/{{\s*args\.([a-zA-Z0-9_]+)\s*}}/g;Yi.MAX_OR_SCOPES=16});var OT=F(Dc=>{"use strict";m();T();N();Object.defineProperty(Dc,"__esModule",{value:!0});Dc.newParentTagData=qZ;Dc.newChildTagData=VZ;Dc.validateImplicitFieldSets=jZ;Dc.newContractTagOptionsFromArrays=KZ;Dc.getDescriptionFromString=$Z;var ai=Se(),BZ=Au(),kZ=Ru(),MZ=Cr(),qU=Ur(),xZ=Hn();function qZ(e){return{childTagDataByChildName:new Map,tagNames:new Set,typeName:e}}function VZ(e){return{name:e,tagNames:new Set,tagNamesByArgumentName:new Map}}function jZ({conditionalFieldDataByCoords:e,currentSubgraphName:t,entityData:n,implicitKeys:r,objectData:i,parentDefinitionDataByTypeName:a,graphNode:o}){let u=(0,qU.getValueOrDefault)(n.keyFieldSetDatasBySubgraphName,t,()=>new Map);for(let[l,d]of n.documentNodeByKeyFieldSet){if(u.has(l))continue;let p=[i],E=[],h=[],v=-1,A=!0,B=!0;(0,ai.visit)(d,{Argument:{enter(){return B=!1,ai.BREAK}},Field:{enter(V){let J=p[v];if(A)return B=!1,ai.BREAK;let re=V.name.value;if(re===xZ.TYPENAME)return;let ie=J.fieldDataByName.get(re);if(!ie||ie.argumentDataByName.size||E[v].has(re))return B=!1,ai.BREAK;let{isUnconditionallyProvided:Ne}=(0,qU.getOrThrowError)(ie.externalFieldDataBySubgraphName,t,`${ie.originalParentTypeName}.${re}.externalFieldDataBySubgraphName`),Ee=e.get(`${ie.renamedParentTypeName}.${re}`);if(Ee){if(Ee.providedBy.length>0)h.push(...Ee.providedBy);else if(Ee.requiredBy.length>0)return B=!1,ai.BREAK}else if(!Ne)return B=!1,ai.BREAK;E[v].add(re);let _e=(0,BZ.getTypeNodeNamedTypeName)(ie.node.type);if(kZ.BASE_SCALARS.has(_e))return;let ye=a.get(_e);if(!ye)return B=!1,ai.BREAK;if(ye.kind===ai.Kind.OBJECT_TYPE_DEFINITION){A=!0,p.push(ye);return}if((0,MZ.isKindAbstract)(ye.kind))return B=!1,ai.BREAK}},InlineFragment:{enter(){return B=!1,ai.BREAK}},SelectionSet:{enter(){if(!A||(v+=1,A=!1,v<0||v>=p.length))return B=!1,ai.BREAK;E.push(new Set)},leave(){if(A)return B=!1,ai.BREAK;v-=1,p.pop(),E.pop()}}}),B&&(r.push($(M({fieldName:"",selectionSet:l},h.length>0?{conditions:h}:{}),{disableEntityResolver:!0})),o&&o.satisfiedFieldSets.add(l))}}function KZ(e,t){return{tagNamesToExclude:new Set(e),tagNamesToInclude:new Set(t)}}function $Z(e){if(e)return{block:!0,kind:ai.Kind.STRING,value:e}}});var Ql=F(lt=>{"use strict";m();T();N();Object.defineProperty(lt,"__esModule",{value:!0});lt.MergeMethod=void 0;lt.newPersistedDirectivesData=QZ;lt.isNodeExternalOrShareable=YZ;lt.isTypeRequired=JZ;lt.isTypeNodeListType=jU;lt.areDefaultValuesCompatible=KU;lt.compareAndValidateInputValueDefaultValues=zZ;lt.setMutualExecutableLocations=HZ;lt.isTypeNameRootType=WZ;lt.getRenamedRootTypeName=XZ;lt.childMapToValueArray=eee;lt.setLongestDescription=tee;lt.isParentDataRootType=$U;lt.isInterfaceDefinitionData=nee;lt.setParentDataExtensionType=ree;lt.upsertDeprecatedDirective=iee;lt.upsertTagDirectives=aee;lt.propagateAuthDirectives=see;lt.propagateFieldAuthDirectives=oee;lt.generateDeprecatedDirective=eS;lt.getClientPersistedDirectiveNodes=Xv;lt.getClientSchemaFieldNodeByFieldData=lee;lt.getNodeWithPersistedDirectivesByInputValueData=GU;lt.addValidPersistedDirectiveDefinitionNodeByData=fee;lt.newInvalidFieldNames=pee;lt.validateExternalAndShareable=mee;lt.isTypeValidImplementation=DT;lt.isNodeDataInaccessible=QU;lt.isLeafKind=Nee;lt.getSubscriptionFilterValue=Tee;lt.getParentTypeName=Eee;lt.newConditionalFieldData=hee;lt.getDefinitionDataCoords=yee;lt.isParentDataCompositeOutputType=Iee;lt.newExternalFieldData=gee;lt.getInitialFederatedDescription=_ee;lt.areKindsEqual=vee;lt.isFieldData=tS;lt.isInputObjectDefinitionData=See;lt.isInputNodeKind=Oee;lt.isOutputNodeKind=Dee;lt.isInterfaceNode=bee;lt.isEnumData=Aee;var Xe=Se(),Wv=Jf(),Gl=Cr(),Zv=Qi(),jt=Hn(),bc=Ur(),GZ=OT();function QZ(){return{deprecatedReason:"",directivesByName:new Map,isDeprecated:!1,tagDirectiveByName:new Map}}function YZ(e,t,n){var i;let r={isExternal:n.has(jt.EXTERNAL),isShareable:t||n.has(jt.SHAREABLE)};if(!((i=e.directives)!=null&&i.length))return r;for(let a of e.directives){let o=a.name.value;if(o===jt.EXTERNAL){r.isExternal=!0;continue}o===jt.SHAREABLE&&(r.isShareable=!0)}return r}function JZ(e){return e.kind===Xe.Kind.NON_NULL_TYPE}function jU(e){switch(e.kind){case Xe.Kind.LIST_TYPE:return!0;case Xe.Kind.NON_NULL_TYPE:return jU(e.type);default:return!1}}function KU(e,t){switch(e.kind){case Xe.Kind.LIST_TYPE:return t.kind===Xe.Kind.LIST||t.kind===Xe.Kind.NULL;case Xe.Kind.NAMED_TYPE:if(t.kind===Xe.Kind.NULL)return!0;switch(e.name.value){case jt.BOOLEAN_SCALAR:return t.kind===Xe.Kind.BOOLEAN;case jt.FLOAT_SCALAR:return t.kind===Xe.Kind.INT||t.kind===Xe.Kind.FLOAT;case jt.INT_SCALAR:return t.kind===Xe.Kind.INT;case jt.STRING_SCALAR:return t.kind===Xe.Kind.STRING;default:return!0}case Xe.Kind.NON_NULL_TYPE:return t.kind===Xe.Kind.NULL?!1:KU(e.type,t)}}function zZ(e,t,n){if(!e.defaultValue)return;if(!t.defaultValue){e.includeDefaultValue=!1;return}let r=(0,Xe.print)(e.defaultValue),i=(0,Xe.print)(t.defaultValue);if(r!==i){n.push((0,Zv.incompatibleInputValueDefaultValuesError)(`${e.isArgument?jt.ARGUMENT:jt.INPUT_FIELD} "${e.name}"`,e.originalCoords,[...t.subgraphNames],r,i));return}}function HZ(e,t){let n=new Set;for(let r of t)e.executableLocations.has(r)&&n.add(r);e.executableLocations=n}function WZ(e,t){return jt.ROOT_TYPE_NAMES.has(e)||t.has(e)}function XZ(e,t){let n=t.get(e);if(!n)return e;switch(n){case Xe.OperationTypeNode.MUTATION:return jt.MUTATION;case Xe.OperationTypeNode.SUBSCRIPTION:return jt.SUBSCRIPTION;default:return jt.QUERY}}function ZZ(e){for(let t of e.argumentDataByName.values()){for(let n of t.directivesByName.values())t.node.directives.push(...n);e.node.arguments.push(t.node)}}function eee(e){var n;let t=[];for(let r of e.values()){tS(r)&&ZZ(r);for(let[i,a]of r.directivesByName){if(i===jt.DEPRECATED){let o=a[0];if(!o)continue;if((n=o.arguments)!=null&&n.length){r.node.directives.push(o);continue}r.node.directives.push($(M({},o),{arguments:[{kind:Xe.Kind.ARGUMENT,value:{kind:Xe.Kind.STRING,value:Xe.DEFAULT_DEPRECATION_REASON},name:(0,Gl.stringToNameNode)(jt.REASON)}]}));continue}r.node.directives.push(...a)}t.push(r.node)}return t}function tee(e,t){if(t.description){if("configureDescriptionDataBySubgraphName"in t){for(let{propagate:n}of t.configureDescriptionDataBySubgraphName.values())if(!n)return}(!e.description||e.description.value.length0&&e.persistedDirectivesData.directivesByName.set(jt.REQUIRES_SCOPES,[(0,bc.generateRequiresScopesDirective)(t.requiredScopes)]))}function oee(e,t){if(!t)return;let n=t.fieldAuthDataByFieldName.get(e.name);n&&(n.originalData.requiresAuthentication&&e.persistedDirectivesData.directivesByName.set(jt.AUTHENTICATED,[(0,bc.generateSimpleDirective)(jt.AUTHENTICATED)]),n.originalData.requiredScopes.length>0&&e.persistedDirectivesData.directivesByName.set(jt.REQUIRES_SCOPES,[(0,bc.generateRequiresScopesDirective)(n.originalData.requiredScopes)]))}function eS(e){return{kind:Xe.Kind.DIRECTIVE,name:(0,Gl.stringToNameNode)(jt.DEPRECATED),arguments:[{kind:Xe.Kind.ARGUMENT,name:(0,Gl.stringToNameNode)(jt.REASON),value:{kind:Xe.Kind.STRING,value:e||jt.DEPRECATED_DEFAULT_ARGUMENT_VALUE}}]}}function uee(e,t,n,r){let i=[];for(let[a,o]of e){let u=t.get(a);if(u){if(o.length<2){i.push(...o);continue}if(!u.repeatable){r.push((0,Zv.invalidRepeatedFederatedDirectiveErrorMessage)(a,n));continue}i.push(...o)}}return i}function cee(e,t,n){let r=[...e.persistedDirectivesData.tagDirectiveByName.values()];return e.persistedDirectivesData.isDeprecated&&r.push(eS(e.persistedDirectivesData.deprecatedReason)),r.push(...uee(e.persistedDirectivesData.directivesByName,t,e.name,n)),r}function Xv(e){var n;let t=[];e.persistedDirectivesData.isDeprecated&&t.push(eS(e.persistedDirectivesData.deprecatedReason));for(let[r,i]of e.persistedDirectivesData.directivesByName){if(r===jt.SEMANTIC_NON_NULL&&tS(e)){t.push((0,bc.generateSemanticNonNullDirective)((n=(0,bc.getFirstEntry)(e.nullLevelsBySubgraphName))!=null?n:new Set([0])));continue}jt.PERSISTED_CLIENT_DIRECTIVES.has(r)&&t.push(i[0])}return t}function lee(e){let t=Xv(e),n=[];for(let r of e.argumentDataByName.values())QU(r)||n.push($(M({},r.node),{directives:Xv(r)}));return $(M({},e.node),{directives:t,arguments:n})}function GU(e,t,n){return e.node.name=(0,Gl.stringToNameNode)(e.name),e.node.type=e.type,e.node.description=e.description,e.node.directives=cee(e,t,n),e.includeDefaultValue&&(e.node.defaultValue=e.defaultValue),e.node}function dee(e,t,n,r,i){let a=[];for(let[o,u]of t.argumentDataByName){let l=(0,bc.getEntriesNotInHashSet)(t.subgraphNames,u.subgraphNames);if(l.length>0){u.requiredSubgraphNames.size>0&&a.push({inputValueName:o,missingSubgraphs:l,requiredSubgraphs:[...u.requiredSubgraphNames]});continue}e.push(GU(u,n,r)),i&&i.add(o)}return a.length>0?(r.push((0,Zv.invalidRequiredInputValueError)(jt.DIRECTIVE_DEFINITION,`@${t.name}`,a)),!1):!0}function fee(e,t,n,r){let i=[];dee(i,t,n,r)&&e.push({arguments:i,kind:Xe.Kind.DIRECTIVE_DEFINITION,locations:(0,Gl.setToNameNodeArray)(t.executableLocations),name:(0,Gl.stringToNameNode)(t.name),repeatable:t.repeatable,description:t.description})}function pee(){return{byShareable:new Set,subgraphNamesByExternalFieldName:new Map}}function mee(e,t){let n=e.isShareableBySubgraphName.size,r=new Array,i=0;for(let[a,o]of e.isShareableBySubgraphName){let u=e.externalFieldDataBySubgraphName.get(a);if(u&&!u.isUnconditionallyProvided){r.push(a);continue}o||(i+=1)}switch(i){case 0:n===r.length&&t.subgraphNamesByExternalFieldName.set(e.name,r);return;case 1:if(n===1)return;n-r.length!==1&&t.byShareable.add(e.name);return;default:t.byShareable.add(e.name)}}var VU;(function(e){e[e.UNION=0]="UNION",e[e.INTERSECTION=1]="INTERSECTION",e[e.CONSISTENT=2]="CONSISTENT"})(VU||(lt.MergeMethod=VU={}));function DT({concreteTypeNamesByAbstractTypeName:e,implementationType:t,interfaceImplementationTypeNamesByInterfaceTypeName:n,originalType:r}){if(r.kind===Xe.Kind.NON_NULL_TYPE)return t.kind!==Xe.Kind.NON_NULL_TYPE?!1:DT({concreteTypeNamesByAbstractTypeName:e,implementationType:t.type,interfaceImplementationTypeNamesByInterfaceTypeName:n,originalType:r.type});if(t.kind===Xe.Kind.NON_NULL_TYPE)return DT({concreteTypeNamesByAbstractTypeName:e,implementationType:t.type,interfaceImplementationTypeNamesByInterfaceTypeName:n,originalType:r});switch(r.kind){case Xe.Kind.NAMED_TYPE:if(t.kind===Xe.Kind.NAMED_TYPE){let i=r.name.value,a=t.name.value;if(i===a)return!0;let o=n.get(i),u=e.get(i);return!!(u!=null&&u.has(a)||o!=null&&o.has(a))}return!1;default:return t.kind===Xe.Kind.LIST_TYPE?DT({concreteTypeNamesByAbstractTypeName:e,implementationType:t.type,interfaceImplementationTypeNamesByInterfaceTypeName:n,originalType:r.type}):!1}}function QU(e){return e.persistedDirectivesData.directivesByName.has(jt.INACCESSIBLE)||e.directivesByName.has(jt.INACCESSIBLE)}function Nee(e){return e===Xe.Kind.SCALAR_TYPE_DEFINITION||e===Xe.Kind.ENUM_TYPE_DEFINITION}function Tee(e){switch(e.kind){case Xe.Kind.BOOLEAN:return e.value;case Xe.Kind.ENUM:case Xe.Kind.STRING:return e.value;case Xe.Kind.FLOAT:case Xe.Kind.INT:try{return parseFloat(e.value)}catch(t){return"NaN"}case Xe.Kind.NULL:return null}}function Eee(e){return e.kind===Xe.Kind.OBJECT_TYPE_DEFINITION&&e.renamedTypeName||e.name}function hee(){return{providedBy:[],requiredBy:[]}}function yee(e,t){switch(e.kind){case Xe.Kind.ENUM_VALUE_DEFINITION:return`${e.parentTypeName}.${e.name}`;case Xe.Kind.FIELD_DEFINITION:return`${t?e.renamedParentTypeName:e.originalParentTypeName}.${e.name}`;case Xe.Kind.ARGUMENT:case Xe.Kind.INPUT_VALUE_DEFINITION:return t?e.federatedCoords:e.originalCoords;case Xe.Kind.OBJECT_TYPE_DEFINITION:return t?e.renamedTypeName:e.name;default:return e.name}}function Iee(e){return e.kind===Xe.Kind.OBJECT_TYPE_DEFINITION||e.kind===Xe.Kind.INTERFACE_TYPE_DEFINITION}function gee(e){return{isDefinedExternal:e,isUnconditionallyProvided:!e}}function _ee(e){let{value:t,done:n}=e.configureDescriptionDataBySubgraphName.values().next();if(n)return e.description;if(t.propagate)return(0,GZ.getDescriptionFromString)(t.description)||e.description}function vee(e,t){return e.kind===t.kind}function tS(e){return e.kind===Xe.Kind.FIELD_DEFINITION}function See(e){return e.kind===Xe.Kind.INPUT_OBJECT_TYPE_DEFINITION}function Oee(e){return jt.INPUT_NODE_KINDS.has(e)}function Dee(e){return jt.OUTPUT_NODE_KINDS.has(e)}function bee(e){return jt.INTERFACE_NODE_KINDS.has(e.kind)}function Aee(e){return e.kind===Xe.Kind.ENUM_TYPE_DEFINITION}});var iS={};Hm(iS,{__addDisposableResource:()=>pB,__assign:()=>bT,__asyncDelegator:()=>aB,__asyncGenerator:()=>iB,__asyncValues:()=>sB,__await:()=>Yl,__awaiter:()=>XU,__classPrivateFieldGet:()=>lB,__classPrivateFieldIn:()=>fB,__classPrivateFieldSet:()=>dB,__createBinding:()=>RT,__decorate:()=>zU,__disposeResources:()=>mB,__esDecorate:()=>Ree,__exportStar:()=>eB,__extends:()=>YU,__generator:()=>ZU,__importDefault:()=>cB,__importStar:()=>uB,__makeTemplateObject:()=>oB,__metadata:()=>WU,__param:()=>HU,__propKey:()=>Fee,__read:()=>rS,__rest:()=>JU,__runInitializers:()=>Pee,__setFunctionName:()=>wee,__spread:()=>tB,__spreadArray:()=>rB,__spreadArrays:()=>nB,__values:()=>AT,default:()=>Uee});function YU(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");nS(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function JU(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function HU(e,t){return function(n,r){t(n,r,e)}}function Ree(e,t,n,r,i,a){function o(J){if(J!==void 0&&typeof J!="function")throw new TypeError("Function expected");return J}for(var u=r.kind,l=u==="getter"?"get":u==="setter"?"set":"value",d=!t&&e?r.static?e:e.prototype:null,p=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),E,h=!1,v=n.length-1;v>=0;v--){var A={};for(var B in r)A[B]=B==="access"?{}:r[B];for(var B in r.access)A.access[B]=r.access[B];A.addInitializer=function(J){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(J||null))};var V=(0,n[v])(u==="accessor"?{get:p.get,set:p.set}:p[l],A);if(u==="accessor"){if(V===void 0)continue;if(V===null||typeof V!="object")throw new TypeError("Object expected");(E=o(V.get))&&(p.get=E),(E=o(V.set))&&(p.set=E),(E=o(V.init))&&i.unshift(E)}else(E=o(V))&&(u==="field"?i.unshift(E):p[l]=E)}d&&Object.defineProperty(d,r.name,p),h=!0}function Pee(e,t,n){for(var r=arguments.length>2,i=0;i0&&a[a.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function rS(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function tB(){for(var e=[],t=0;t1||u(h,v)})})}function u(h,v){try{l(r[h](v))}catch(A){E(a[0][3],A)}}function l(h){h.value instanceof Yl?Promise.resolve(h.value.v).then(d,p):E(a[0][2],h)}function d(h){u("next",h)}function p(h){u("throw",h)}function E(h,v){h(v),a.shift(),a.length&&u(a[0][0],a[0][1])}}function aB(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,a){t[i]=e[i]?function(o){return(n=!n)?{value:Yl(e[i](o)),done:!1}:a?a(o):o}:a}}function sB(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof AT=="function"?AT(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(o){return new Promise(function(u,l){o=e[a](o),i(u,l,o.done,o.value)})}}function i(a,o,u,l){Promise.resolve(l).then(function(d){a({value:d,done:u})},o)}}function oB(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function uB(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&RT(t,e,n);return Lee(t,e),t}function cB(e){return e&&e.__esModule?e:{default:e}}function lB(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function dB(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n}function fB(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function pB(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose]}if(typeof r!="function")throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}function mB(e){function t(r){e.error=e.hasError?new Cee(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}function n(){for(;e.stack.length;){var r=e.stack.pop();try{var i=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(i).then(n,function(a){return t(a),n()})}catch(a){t(a)}}if(e.hasError)throw e.error}return n()}var nS,bT,RT,Lee,Cee,Uee,aS=nc(()=>{"use strict";m();T();N();nS=function(e,t){return nS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},nS(e,t)};bT=function(){return bT=Object.assign||function(t){for(var n,r=1,i=arguments.length;rxB,__assign:()=>PT,__asyncDelegator:()=>FB,__asyncGenerator:()=>PB,__asyncValues:()=>wB,__await:()=>Jl,__awaiter:()=>SB,__classPrivateFieldGet:()=>BB,__classPrivateFieldIn:()=>MB,__classPrivateFieldSet:()=>kB,__createBinding:()=>wT,__decorate:()=>EB,__disposeResources:()=>qB,__esDecorate:()=>yB,__exportStar:()=>DB,__extends:()=>NB,__generator:()=>OB,__importDefault:()=>UB,__importStar:()=>CB,__makeTemplateObject:()=>LB,__metadata:()=>vB,__param:()=>hB,__propKey:()=>gB,__read:()=>uS,__rest:()=>TB,__rewriteRelativeImportExtension:()=>VB,__runInitializers:()=>IB,__setFunctionName:()=>_B,__spread:()=>bB,__spreadArray:()=>RB,__spreadArrays:()=>AB,__values:()=>FT,default:()=>Mee});function NB(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");sS(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function TB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function hB(e,t){return function(n,r){t(n,r,e)}}function yB(e,t,n,r,i,a){function o(J){if(J!==void 0&&typeof J!="function")throw new TypeError("Function expected");return J}for(var u=r.kind,l=u==="getter"?"get":u==="setter"?"set":"value",d=!t&&e?r.static?e:e.prototype:null,p=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),E,h=!1,v=n.length-1;v>=0;v--){var A={};for(var B in r)A[B]=B==="access"?{}:r[B];for(var B in r.access)A.access[B]=r.access[B];A.addInitializer=function(J){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(J||null))};var V=(0,n[v])(u==="accessor"?{get:p.get,set:p.set}:p[l],A);if(u==="accessor"){if(V===void 0)continue;if(V===null||typeof V!="object")throw new TypeError("Object expected");(E=o(V.get))&&(p.get=E),(E=o(V.set))&&(p.set=E),(E=o(V.init))&&i.unshift(E)}else(E=o(V))&&(u==="field"?i.unshift(E):p[l]=E)}d&&Object.defineProperty(d,r.name,p),h=!0}function IB(e,t,n){for(var r=arguments.length>2,i=0;i0&&a[a.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function uS(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function bB(){for(var e=[],t=0;t1||l(v,B)})},A&&(i[v]=A(i[v])))}function l(v,A){try{d(r[v](A))}catch(B){h(a[0][3],B)}}function d(v){v.value instanceof Jl?Promise.resolve(v.value.v).then(p,E):h(a[0][2],v)}function p(v){l("next",v)}function E(v){l("throw",v)}function h(v,A){v(A),a.shift(),a.length&&l(a[0][0],a[0][1])}}function FB(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,a){t[i]=e[i]?function(o){return(n=!n)?{value:Jl(e[i](o)),done:!1}:a?a(o):o}:a}}function wB(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof FT=="function"?FT(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(o){return new Promise(function(u,l){o=e[a](o),i(u,l,o.done,o.value)})}}function i(a,o,u,l){Promise.resolve(l).then(function(d){a({value:d,done:u})},o)}}function LB(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function CB(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=oS(e),r=0;r{"use strict";m();T();N();sS=function(e,t){return sS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},sS(e,t)};PT=function(){return PT=Object.assign||function(t){for(var n,r=1,i=arguments.length;r{"use strict";m();T();N()});var zl=F(Ji=>{"use strict";m();T();N();Object.defineProperty(Ji,"__esModule",{value:!0});Ji.asArray=void 0;Ji.isUrl=GB;Ji.isDocumentString=Kee;Ji.isValidPath=Gee;Ji.compareStrings=QB;Ji.nodeToString=cS;Ji.compareNodes=Qee;Ji.isSome=Yee;Ji.assertSome=Jee;var xee=Se(),qee=/^(https?|wss?|file):\/\//;function GB(e){if(typeof e!="string"||!qee.test(e))return!1;if(URL.canParse)return URL.canParse(e);try{return!!new URL(e)}catch(t){return!1}}var Vee=e=>Array.isArray(e)?e:e?[e]:[];Ji.asArray=Vee;var jee=/\.[a-z0-9]+$/i;function Kee(e){if(typeof e!="string"||jee.test(e)||GB(e))return!1;try{return(0,xee.parse)(e),!0}catch(t){if(!t.message.includes("EOF")&&e.replace(/(\#[^*]*)/g,"").trim()!==""&&e.includes(" "))throw new Error(`Failed to parse the GraphQL document. ${t.message} -${e}`)}return!1}var $ee=/[‘“!%^<>`\n]/;function Gee(e){return typeof e=="string"&&!$ee.test(e)}function QB(e,t){return String(e)String(t)?1:0}function cS(e){var n,r;let t;return"alias"in e&&(t=(n=e.alias)==null?void 0:n.value),t==null&&"name"in e&&(t=(r=e.name)==null?void 0:r.value),t==null&&(t=e.kind),t}function Qee(e,t,n){let r=cS(e),i=cS(t);return typeof n=="function"?n(r,i):QB(r,i)}function Yee(e){return e!=null}function Jee(e,t="Value should be something"){if(e==null)throw new Error(t)}});var Hf=F(CT=>{"use strict";m();T();N();Object.defineProperty(CT,"__esModule",{value:!0});CT.inspect=void 0;var zB=3;function zee(e){return LT(e,[])}CT.inspect=zee;function LT(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return Hee(e,t);default:return String(e)}}function YB(e){return(e.name="GraphQLError")?e.toString():`${e.name}: ${e.message}; - ${e.stack}`}function Hee(e,t){if(e===null)return"null";if(e instanceof Error)return e.name==="AggregateError"?YB(e)+` -`+JB(e.errors,t):YB(e);if(t.includes(e))return"[Circular]";let n=[...t,e];if(Wee(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:LT(r,n)}else if(Array.isArray(e))return JB(e,n);return Xee(e,n)}function Wee(e){return typeof e.toJSON=="function"}function Xee(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>zB?"["+Zee(e)+"]":"{ "+n.map(([i,a])=>i+": "+LT(a,t)).join(", ")+" }"}function JB(e,t){if(e.length===0)return"[]";if(t.length>zB)return"[Array]";let n=e.length,r=[];for(let i=0;i{"use strict";m();T();N();Object.defineProperty(UT,"__esModule",{value:!0});UT.createGraphQLError=dS;UT.relocatedError=nte;var lS=Se(),ete=["message","locations","path","nodes","source","positions","originalError","name","stack","extensions"];function tte(e){return e!=null&&typeof e=="object"&&Object.keys(e).every(t=>ete.includes(t))}function dS(e,t){return t!=null&&t.originalError&&!(t.originalError instanceof Error)&&tte(t.originalError)&&(t.originalError=dS(t.originalError.message,t.originalError)),lS.versionInfo.major>=17?new lS.GraphQLError(e,t):new lS.GraphQLError(e,t==null?void 0:t.nodes,t==null?void 0:t.source,t==null?void 0:t.positions,t==null?void 0:t.path,t==null?void 0:t.originalError,t==null?void 0:t.extensions)}function nte(e,t){return dS(e.message,{nodes:e.nodes,source:e.source,positions:e.positions,path:t==null?e.path:t,originalError:e,extensions:e.extensions})}});var Wf=F(si=>{"use strict";m();T();N();Object.defineProperty(si,"__esModule",{value:!0});si.isPromise=kT;si.isActualPromise=WB;si.handleMaybePromise=Pu;si.fakePromise=es;si.createDeferredPromise=rte;si.iterateAsync=XB;si.iterateAsyncVoid=XB;si.fakeRejectPromise=Ac;si.mapMaybePromise=ite;si.mapAsyncIterator=ate;si.promiseLikeFinally=ZB;si.unfakePromise=ek;var MT=Symbol.for("@whatwg-node/promise-helpers/FakePromise");function kT(e){return(e==null?void 0:e.then)!=null}function WB(e){let t=e;return t&&t.then&&t.catch&&t.finally}function Pu(e,t,n,r){let i=es().then(e).then(t,n);return r&&(i=i.finally(r)),ek(i)}function es(e){return e&&WB(e)?e:kT(e)?{then:(t,n)=>es(e.then(t,n)),catch:t=>es(e.then(n=>n,t)),finally:t=>es(t?ZB(e,t):e),[Symbol.toStringTag]:"Promise"}:{then(t){if(t)try{return es(t(e))}catch(n){return Ac(n)}return this},catch(){return this},finally(t){if(t)try{return es(t()).then(()=>e,()=>e)}catch(n){return Ac(n)}return this},[Symbol.toStringTag]:"Promise",__fakePromiseValue:e,[MT]:"resolved"}}function rte(){if(Promise.withResolvers)return Promise.withResolvers();let e,t;return{promise:new Promise(function(i,a){e=i,t=a}),get resolve(){return e},get reject(){return t}}}function XB(e,t,n){if((e==null?void 0:e.length)===0)return;let r=e[Symbol.iterator](),i=0;function a(){let{done:o,value:u}=r.next();if(o)return;let l=!1;function d(){l=!0}return Pu(function(){return t(u,d,i++)},function(E){if(E&&(n==null||n.push(E)),!l)return a()})}return a()}function Ac(e){return{then(t,n){if(n)try{return es(n(e))}catch(r){return Ac(r)}return this},catch(t){if(t)try{return es(t(e))}catch(n){return Ac(n)}return this},finally(t){if(t)try{t()}catch(n){return Ac(n)}return this},__fakeRejectError:e,[Symbol.toStringTag]:"Promise",[MT]:"rejected"}}function ite(e,t,n){return Pu(()=>e,t,n)}function ate(e,t,n,r){Symbol.asyncIterator in e&&(e=e[Symbol.asyncIterator]());let i,a,o;if(r){let d;o=p=>(d||(d=Pu(r,()=>p,()=>p)),d)}typeof e.return=="function"&&(i=e.return,a=d=>{let p=()=>{throw d};return i.call(e).then(p,p)});function u(d){return d.done?o?o(d):d:Pu(()=>d.value,p=>Pu(()=>t(p),HB,a))}let l;if(n){let d,p=n;l=E=>(d||(d=Pu(()=>E,h=>Pu(()=>p(h),HB,a))),d)}return{next(){return e.next().then(u,l)},return(){let d=i?i.call(e).then(u,l):es({value:void 0,done:!0});return o?d.then(o):d},throw(d){return typeof e.throw=="function"?e.throw(d).then(u,l):a?a(d):Ac(d)},[Symbol.asyncIterator](){return this}}}function HB(e){return{value:e,done:!1}}function ste(e){return(e==null?void 0:e[MT])==="resolved"}function ote(e){return(e==null?void 0:e[MT])==="rejected"}function ZB(e,t){return"finally"in e?e.finally(t):e.then(n=>{let r=t();return kT(r)?r.then(()=>n):n},n=>{let r=t();if(kT(r))return r.then(()=>{throw n});throw n})}function ek(e){if(ste(e))return e.__fakePromiseValue;if(ote(e))throw e.__fakeRejectError;return e}});var xT=F(Fu=>{"use strict";m();T();N();Object.defineProperty(Fu,"__esModule",{value:!0});Fu.isPromise=void 0;Fu.isIterableObject=ute;Fu.isObjectLike=cte;Fu.promiseReduce=lte;Fu.hasOwnProperty=dte;var tk=Wf();Object.defineProperty(Fu,"isPromise",{enumerable:!0,get:function(){return tk.isPromise}});function ute(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e}function cte(e){return typeof e=="object"&&e!==null}function lte(e,t,n){let r=n;for(let i of e)r=(0,tk.handleMaybePromise)(()=>r,a=>t(a,i));return r}function dte(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var mS=F(pS=>{"use strict";m();T();N();Object.defineProperty(pS,"__esModule",{value:!0});pS.getArgumentValues=pte;var fS=Hf(),Rc=Se(),qT=BT(),fte=xT();function pte(e,t,n={}){var o;let r={},a=((o=t.arguments)!=null?o:[]).reduce((u,l)=>$(M({},u),{[l.name.value]:l}),{});for(let{name:u,type:l,defaultValue:d}of e.args){let p=a[u];if(!p){if(d!==void 0)r[u]=d;else if((0,Rc.isNonNullType)(l))throw(0,qT.createGraphQLError)(`Argument "${u}" of required type "${(0,fS.inspect)(l)}" was not provided.`,{nodes:[t]});continue}let E=p.value,h=E.kind===Rc.Kind.NULL;if(E.kind===Rc.Kind.VARIABLE){let A=E.name.value;if(n==null||!(0,fte.hasOwnProperty)(n,A)){if(d!==void 0)r[u]=d;else if((0,Rc.isNonNullType)(l))throw(0,qT.createGraphQLError)(`Argument "${u}" of required type "${(0,fS.inspect)(l)}" was provided the variable "$${A}" which was not provided a runtime value.`,{nodes:[E]});continue}h=n[A]==null}if(h&&(0,Rc.isNonNullType)(l))throw(0,qT.createGraphQLError)(`Argument "${u}" of non-null type "${(0,fS.inspect)(l)}" must not be null.`,{nodes:[E]});let v=(0,Rc.valueFromAST)(E,l,n);if(v===void 0)throw(0,qT.createGraphQLError)(`Argument "${u}" has invalid value ${(0,Rc.print)(E)}.`,{nodes:[E]});r[u]=v}return r}});var wu=F(Us=>{"use strict";m();T();N();Object.defineProperty(Us,"__esModule",{value:!0});Us.memoize1=mte;Us.memoize2=Nte;Us.memoize3=Tte;Us.memoize4=Ete;Us.memoize5=hte;Us.memoize2of4=yte;Us.memoize2of5=Ite;function mte(e){let t=new WeakMap;return function(r){let i=t.get(r);if(i===void 0){let a=e(r);return t.set(r,a),a}return i}}function Nte(e){let t=new WeakMap;return function(r,i){let a=t.get(r);if(!a){a=new WeakMap,t.set(r,a);let u=e(r,i);return a.set(i,u),u}let o=a.get(i);if(o===void 0){let u=e(r,i);return a.set(i,u),u}return o}}function Tte(e){let t=new WeakMap;return function(r,i,a){let o=t.get(r);if(!o){o=new WeakMap,t.set(r,o);let d=new WeakMap;o.set(i,d);let p=e(r,i,a);return d.set(a,p),p}let u=o.get(i);if(!u){u=new WeakMap,o.set(i,u);let d=e(r,i,a);return u.set(a,d),d}let l=u.get(a);if(l===void 0){let d=e(r,i,a);return u.set(a,d),d}return l}}function Ete(e){let t=new WeakMap;return function(r,i,a,o){let u=t.get(r);if(!u){u=new WeakMap,t.set(r,u);let E=new WeakMap;u.set(i,E);let h=new WeakMap;E.set(a,h);let v=e(r,i,a,o);return h.set(o,v),v}let l=u.get(i);if(!l){l=new WeakMap,u.set(i,l);let E=new WeakMap;l.set(a,E);let h=e(r,i,a,o);return E.set(o,h),h}let d=l.get(a);if(!d){let E=new WeakMap;l.set(a,E);let h=e(r,i,a,o);return E.set(o,h),h}let p=d.get(o);if(p===void 0){let E=e(r,i,a,o);return d.set(o,E),E}return p}}function hte(e){let t=new WeakMap;return function(r,i,a,o,u){let l=t.get(r);if(!l){l=new WeakMap,t.set(r,l);let v=new WeakMap;l.set(i,v);let A=new WeakMap;v.set(a,A);let B=new WeakMap;A.set(o,B);let V=e(r,i,a,o,u);return B.set(u,V),V}let d=l.get(i);if(!d){d=new WeakMap,l.set(i,d);let v=new WeakMap;d.set(a,v);let A=new WeakMap;v.set(o,A);let B=e(r,i,a,o,u);return A.set(u,B),B}let p=d.get(a);if(!p){p=new WeakMap,d.set(a,p);let v=new WeakMap;p.set(o,v);let A=e(r,i,a,o,u);return v.set(u,A),A}let E=p.get(o);if(!E){E=new WeakMap,p.set(o,E);let v=e(r,i,a,o,u);return E.set(u,v),v}let h=E.get(u);if(h===void 0){let v=e(r,i,a,o,u);return E.set(u,v),v}return h}}function yte(e){let t=new WeakMap;return function(r,i,a,o){let u=t.get(r);if(!u){u=new WeakMap,t.set(r,u);let d=e(r,i,a,o);return u.set(i,d),d}let l=u.get(i);if(l===void 0){let d=e(r,i,a,o);return u.set(i,d),d}return l}}function Ite(e){let t=new WeakMap;return function(r,i,a,o,u){let l=t.get(r);if(!l){l=new WeakMap,t.set(r,l);let p=e(r,i,a,o,u);return l.set(i,p),p}let d=l.get(i);if(d===void 0){let p=e(r,i,a,o,u);return l.set(i,p),p}return d}}});var TS=F(NS=>{"use strict";m();T();N();Object.defineProperty(NS,"__esModule",{value:!0});NS.getDirectiveExtensions=vte;var nk=Se(),gte=mS(),_te=wu();function vte(e,t,n=["directives"]){var o;let r={};if(e.extensions){let u=e.extensions;for(let l of n)u=u==null?void 0:u[l];if(u!=null)for(let l in u){let d=u[l],p=l;if(Array.isArray(d))for(let E of d){let h=r[p];h||(h=[],r[p]=h),h.push(E)}else{let E=r[p];E||(E=[],r[p]=E),E.push(d)}}}let i=(0,_te.memoize1)(u=>JSON.stringify(u)),a=[];e.astNode&&a.push(e.astNode),e.extensionASTNodes&&a.push(...e.extensionASTNodes);for(let u of a)if((o=u.directives)!=null&&o.length)for(let l of u.directives){let d=l.name.value,p=r[d];p||(p=[],r[d]=p);let E=t==null?void 0:t.getDirective(d),h={};if(E&&(h=(0,gte.getArgumentValues)(E,l)),l.arguments)for(let v of l.arguments){let A=v.name.value;if(h[A]==null){let B=E==null?void 0:E.args.find(V=>V.name===A);B&&(h[A]=(0,nk.valueFromAST)(v.value,B.type))}h[A]==null&&(h[A]=(0,nk.valueFromASTUntyped)(v.value))}if(a.length>0&&p.length>0){let v=i(h);if(p.some(A=>i(A)===v))continue}p.push(h)}return r}});var ES=F(Hl=>{"use strict";m();T();N();Object.defineProperty(Hl,"__esModule",{value:!0});Hl.getDirectivesInExtensions=Ste;Hl.getDirectiveInExtensions=Ote;Hl.getDirectives=Dte;Hl.getDirective=bte;var VT=TS();function Ste(e,t=["directives"]){let n=(0,VT.getDirectiveExtensions)(e,void 0,t);return Object.entries(n).map(([r,i])=>i==null?void 0:i.map(a=>({name:r,args:a}))).flat(1/0).filter(Boolean)}function Ote(e,t,n=["directives"]){return(0,VT.getDirectiveExtensions)(e,void 0,n)[t]}function Dte(e,t,n=["directives"]){let r=(0,VT.getDirectiveExtensions)(t,e,n);return Object.entries(r).map(([i,a])=>a==null?void 0:a.map(o=>({name:i,args:o}))).flat(1/0).filter(Boolean)}function bte(e,t,n,r=["directives"]){return(0,VT.getDirectiveExtensions)(t,e,r)[n]}});var yS=F(hS=>{"use strict";m();T();N();Object.defineProperty(hS,"__esModule",{value:!0});hS.getFieldsWithDirectives=Rte;var Ate=Se();function Rte(e,t={}){let n={},r=["ObjectTypeDefinition","ObjectTypeExtension"];t.includeInputTypes&&(r=[...r,"InputObjectTypeDefinition","InputObjectTypeExtension"]);let i=e.definitions.filter(a=>r.includes(a.kind));for(let a of i){let o=a.name.value;if(a.fields!=null){for(let u of a.fields)if(u.directives&&u.directives.length>0){let l=u.name.value,d=`${o}.${l}`,p=u.directives.map(E=>({name:E.name.value,args:(E.arguments||[]).reduce((h,v)=>$(M({},h),{[v.name.value]:(0,Ate.valueFromASTUntyped)(v.value)}),{})}));n[d]=p}}}return n}});var rk=F(gS=>{"use strict";m();T();N();Object.defineProperty(gS,"__esModule",{value:!0});gS.getArgumentsWithDirectives=Fte;var IS=Se();function Pte(e){return e.kind===IS.Kind.OBJECT_TYPE_DEFINITION||e.kind===IS.Kind.OBJECT_TYPE_EXTENSION}function Fte(e){var r;let t={},n=e.definitions.filter(Pte);for(let i of n)if(i.fields!=null)for(let a of i.fields){let o=(r=a.arguments)==null?void 0:r.filter(l=>{var d;return(d=l.directives)==null?void 0:d.length});if(!(o!=null&&o.length))continue;let u=t[`${i.name.value}.${a.name.value}`]={};for(let l of o){let d=l.directives.map(p=>({name:p.name.value,args:(p.arguments||[]).reduce((E,h)=>$(M({},E),{[h.name.value]:(0,IS.valueFromASTUntyped)(h.value)}),{})}));u[l.name.value]=d}}return t}});var vS=F(_S=>{"use strict";m();T();N();Object.defineProperty(_S,"__esModule",{value:!0});_S.getImplementingTypes=wte;function wte(e,t){let n=t.getTypeMap(),r=[];for(let i in n){let a=n[i];"getInterfaces"in a&&a.getInterfaces().find(u=>u.name===e)&&r.push(a.name)}return r}});var jT=F(OS=>{"use strict";m();T();N();Object.defineProperty(OS,"__esModule",{value:!0});OS.astFromType=SS;var Lte=Hf(),Pc=Se();function SS(e){if((0,Pc.isNonNullType)(e)){let t=SS(e.ofType);if(t.kind===Pc.Kind.NON_NULL_TYPE)throw new Error(`Invalid type node ${(0,Lte.inspect)(e)}. Inner type of non-null type cannot be a non-null type.`);return{kind:Pc.Kind.NON_NULL_TYPE,type:t}}else if((0,Pc.isListType)(e))return{kind:Pc.Kind.LIST_TYPE,type:SS(e.ofType)};return{kind:Pc.Kind.NAMED_TYPE,name:{kind:Pc.Kind.NAME,value:e.name}}}});var Xf=F(DS=>{"use strict";m();T();N();Object.defineProperty(DS,"__esModule",{value:!0});DS.astFromValueUntyped=KT;var ts=Se();function KT(e){if(e===null)return{kind:ts.Kind.NULL};if(e===void 0)return null;if(Array.isArray(e)){let t=[];for(let n of e){let r=KT(n);r!=null&&t.push(r)}return{kind:ts.Kind.LIST,values:t}}if(typeof e=="object"){if(e!=null&&e.toJSON)return KT(e.toJSON());let t=[];for(let n in e){let r=e[n],i=KT(r);i&&t.push({kind:ts.Kind.OBJECT_FIELD,name:{kind:ts.Kind.NAME,value:n},value:i})}return{kind:ts.Kind.OBJECT,fields:t}}if(typeof e=="boolean")return{kind:ts.Kind.BOOLEAN,value:e};if(typeof e=="bigint")return{kind:ts.Kind.INT,value:String(e)};if(typeof e=="number"&&isFinite(e)){let t=String(e);return Cte.test(t)?{kind:ts.Kind.INT,value:t}:{kind:ts.Kind.FLOAT,value:t}}if(typeof e=="string")return{kind:ts.Kind.STRING,value:e};throw new TypeError(`Cannot convert value to AST: ${e}.`)}var Cte=/^-?(?:0|[1-9][0-9]*)$/});var ak=F(bS=>{"use strict";m();T();N();Object.defineProperty(bS,"__esModule",{value:!0});bS.astFromValue=Zf;var Ute=Hf(),_i=Se(),Bte=Xf(),ik=xT();function Zf(e,t){if((0,_i.isNonNullType)(t)){let n=Zf(e,t.ofType);return(n==null?void 0:n.kind)===_i.Kind.NULL?null:n}if(e===null)return{kind:_i.Kind.NULL};if(e===void 0)return null;if((0,_i.isListType)(t)){let n=t.ofType;if((0,ik.isIterableObject)(e)){let r=[];for(let i of e){let a=Zf(i,n);a!=null&&r.push(a)}return{kind:_i.Kind.LIST,values:r}}return Zf(e,n)}if((0,_i.isInputObjectType)(t)){if(!(0,ik.isObjectLike)(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=Zf(e[r.name],r.type);i&&n.push({kind:_i.Kind.OBJECT_FIELD,name:{kind:_i.Kind.NAME,value:r.name},value:i})}return{kind:_i.Kind.OBJECT,fields:n}}if((0,_i.isLeafType)(t)){let n=t.serialize(e);return n==null?null:(0,_i.isEnumType)(t)?{kind:_i.Kind.ENUM,value:n}:t.name==="ID"&&typeof n=="string"&&kte.test(n)?{kind:_i.Kind.INT,value:n}:(0,Bte.astFromValueUntyped)(n)}console.assert(!1,"Unexpected input type: "+(0,Ute.inspect)(t))}var kte=/^-?(?:0|[1-9][0-9]*)$/});var sk=F(AS=>{"use strict";m();T();N();Object.defineProperty(AS,"__esModule",{value:!0});AS.getDescriptionNode=xte;var Mte=Se();function xte(e){var t;if((t=e.astNode)!=null&&t.description)return $(M({},e.astNode.description),{block:!0});if(e.description)return{kind:Mte.Kind.STRING,value:e.description,block:!0}}});var ep=F(zi=>{"use strict";m();T();N();Object.defineProperty(zi,"__esModule",{value:!0});zi.getRootTypeMap=zi.getRootTypes=zi.getRootTypeNames=void 0;zi.getDefinedRootType=Vte;var qte=BT(),RS=wu();function Vte(e,t,n){let i=(0,zi.getRootTypeMap)(e).get(t);if(i==null)throw(0,qte.createGraphQLError)(`Schema is not configured to execute ${t} operation.`,{nodes:n});return i}zi.getRootTypeNames=(0,RS.memoize1)(function(t){let n=(0,zi.getRootTypes)(t);return new Set([...n].map(r=>r.name))});zi.getRootTypes=(0,RS.memoize1)(function(t){let n=(0,zi.getRootTypeMap)(t);return new Set(n.values())});zi.getRootTypeMap=(0,RS.memoize1)(function(t){let n=new Map,r=t.getQueryType();r&&n.set("query",r);let i=t.getMutationType();i&&n.set("mutation",i);let a=t.getSubscriptionType();return a&&n.set("subscription",a),n})});var CS=F(Xn=>{"use strict";m();T();N();Object.defineProperty(Xn,"__esModule",{value:!0});Xn.getDocumentNodeFromSchema=uk;Xn.printSchemaWithDirectives=Gte;Xn.astFromSchema=ck;Xn.astFromDirective=lk;Xn.getDirectiveNodes=ya;Xn.astFromArg=FS;Xn.astFromObjectType=dk;Xn.astFromInterfaceType=fk;Xn.astFromUnionType=pk;Xn.astFromInputObjectType=mk;Xn.astFromEnumType=Nk;Xn.astFromScalarType=Tk;Xn.astFromField=wS;Xn.astFromInputField=Ek;Xn.astFromEnumValue=hk;Xn.makeDeprecatedDirective=yk;Xn.makeDirectiveNode=Wl;Xn.makeDirectiveNodes=LS;var Nt=Se(),Fc=jT(),PS=ak(),jte=Xf(),Hi=sk(),ok=ES(),Kte=zl(),$te=ep();function uk(e,t={}){let n=t.pathToDirectivesInExtensions,r=e.getTypeMap(),i=ck(e,n),a=i!=null?[i]:[],o=e.getDirectives();for(let u of o)(0,Nt.isSpecifiedDirective)(u)||a.push(lk(u,e,n));for(let u in r){let l=r[u],d=(0,Nt.isSpecifiedScalarType)(l),p=(0,Nt.isIntrospectionType)(l);if(!(d||p))if((0,Nt.isObjectType)(l))a.push(dk(l,e,n));else if((0,Nt.isInterfaceType)(l))a.push(fk(l,e,n));else if((0,Nt.isUnionType)(l))a.push(pk(l,e,n));else if((0,Nt.isInputObjectType)(l))a.push(mk(l,e,n));else if((0,Nt.isEnumType)(l))a.push(Nk(l,e,n));else if((0,Nt.isScalarType)(l))a.push(Tk(l,e,n));else throw new Error(`Unknown type ${l}.`)}return{kind:Nt.Kind.DOCUMENT,definitions:a}}function Gte(e,t={}){let n=uk(e,t);return(0,Nt.print)(n)}function ck(e,t){let n=new Map([["query",void 0],["mutation",void 0],["subscription",void 0]]),r=[];if(e.astNode!=null&&r.push(e.astNode),e.extensionASTNodes!=null)for(let d of e.extensionASTNodes)r.push(d);for(let d of r)if(d.operationTypes)for(let p of d.operationTypes)n.set(p.operation,p);let i=(0,$te.getRootTypeMap)(e);for(let[d,p]of n){let E=i.get(d);if(E!=null){let h=(0,Fc.astFromType)(E);p!=null?p.type=h:n.set(d,{kind:Nt.Kind.OPERATION_TYPE_DEFINITION,operation:d,type:h})}}let a=[...n.values()].filter(Kte.isSome),o=ya(e,e,t);if(!a.length&&!o.length)return null;let u={kind:a.length?Nt.Kind.SCHEMA_DEFINITION:Nt.Kind.SCHEMA_EXTENSION,operationTypes:a,directives:o},l=(0,Hi.getDescriptionNode)(e);return l&&(u.description=l),u}function lk(e,t,n){var r,i;return{kind:Nt.Kind.DIRECTIVE_DEFINITION,description:(0,Hi.getDescriptionNode)(e),name:{kind:Nt.Kind.NAME,value:e.name},arguments:(r=e.args)==null?void 0:r.map(a=>FS(a,t,n)),repeatable:e.isRepeatable,locations:((i=e.locations)==null?void 0:i.map(a=>({kind:Nt.Kind.NAME,value:a})))||[]}}function ya(e,t,n){let r=[],i=(0,ok.getDirectivesInExtensions)(e,n),a;i!=null&&(a=LS(t,i));let o=null,u=null,l=null;if(a!=null&&(r=a.filter(d=>Nt.specifiedDirectives.every(p=>p.name!==d.name.value)),o=a.find(d=>d.name.value==="deprecated"),u=a.find(d=>d.name.value==="specifiedBy"),l=a.find(d=>d.name.value==="oneOf")),e.deprecationReason!=null&&o==null&&(o=yk(e.deprecationReason)),e.specifiedByUrl!=null||e.specifiedByURL!=null&&u==null){let p={url:e.specifiedByUrl||e.specifiedByURL};u=Wl("specifiedBy",p)}return e.isOneOf&&l==null&&(l=Wl("oneOf")),o!=null&&r.push(o),u!=null&&r.push(u),l!=null&&r.push(l),r}function FS(e,t,n){var r;return{kind:Nt.Kind.INPUT_VALUE_DEFINITION,description:(0,Hi.getDescriptionNode)(e),name:{kind:Nt.Kind.NAME,value:e.name},type:(0,Fc.astFromType)(e.type),defaultValue:e.defaultValue!==void 0&&(r=(0,PS.astFromValue)(e.defaultValue,e.type))!=null?r:void 0,directives:ya(e,t,n)}}function dk(e,t,n){return{kind:Nt.Kind.OBJECT_TYPE_DEFINITION,description:(0,Hi.getDescriptionNode)(e),name:{kind:Nt.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(r=>wS(r,t,n)),interfaces:Object.values(e.getInterfaces()).map(r=>(0,Fc.astFromType)(r)),directives:ya(e,t,n)}}function fk(e,t,n){let r={kind:Nt.Kind.INTERFACE_TYPE_DEFINITION,description:(0,Hi.getDescriptionNode)(e),name:{kind:Nt.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(i=>wS(i,t,n)),directives:ya(e,t,n)};return"getInterfaces"in e&&(r.interfaces=Object.values(e.getInterfaces()).map(i=>(0,Fc.astFromType)(i))),r}function pk(e,t,n){return{kind:Nt.Kind.UNION_TYPE_DEFINITION,description:(0,Hi.getDescriptionNode)(e),name:{kind:Nt.Kind.NAME,value:e.name},directives:ya(e,t,n),types:e.getTypes().map(r=>(0,Fc.astFromType)(r))}}function mk(e,t,n){return{kind:Nt.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:(0,Hi.getDescriptionNode)(e),name:{kind:Nt.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(r=>Ek(r,t,n)),directives:ya(e,t,n)}}function Nk(e,t,n){return{kind:Nt.Kind.ENUM_TYPE_DEFINITION,description:(0,Hi.getDescriptionNode)(e),name:{kind:Nt.Kind.NAME,value:e.name},values:Object.values(e.getValues()).map(r=>hk(r,t,n)),directives:ya(e,t,n)}}function Tk(e,t,n){let r=(0,ok.getDirectivesInExtensions)(e,n),i=LS(t,r),a=e.specifiedByUrl||e.specifiedByURL;if(a&&!i.some(o=>o.name.value==="specifiedBy")){let o={url:a};i.push(Wl("specifiedBy",o))}return{kind:Nt.Kind.SCALAR_TYPE_DEFINITION,description:(0,Hi.getDescriptionNode)(e),name:{kind:Nt.Kind.NAME,value:e.name},directives:i}}function wS(e,t,n){return{kind:Nt.Kind.FIELD_DEFINITION,description:(0,Hi.getDescriptionNode)(e),name:{kind:Nt.Kind.NAME,value:e.name},arguments:e.args.map(r=>FS(r,t,n)),type:(0,Fc.astFromType)(e.type),directives:ya(e,t,n)}}function Ek(e,t,n){var r;return{kind:Nt.Kind.INPUT_VALUE_DEFINITION,description:(0,Hi.getDescriptionNode)(e),name:{kind:Nt.Kind.NAME,value:e.name},type:(0,Fc.astFromType)(e.type),directives:ya(e,t,n),defaultValue:(r=(0,PS.astFromValue)(e.defaultValue,e.type))!=null?r:void 0}}function hk(e,t,n){return{kind:Nt.Kind.ENUM_VALUE_DEFINITION,description:(0,Hi.getDescriptionNode)(e),name:{kind:Nt.Kind.NAME,value:e.name},directives:ya(e,t,n)}}function yk(e){return Wl("deprecated",{reason:e},Nt.GraphQLDeprecatedDirective)}function Wl(e,t,n){let r=[];for(let i in t){let a=t[i],o;if(n!=null){let u=n.args.find(l=>l.name===i);u&&(o=(0,PS.astFromValue)(a,u.type))}o==null&&(o=(0,jte.astFromValueUntyped)(a)),o!=null&&r.push({kind:Nt.Kind.ARGUMENT,name:{kind:Nt.Kind.NAME,value:i},value:o})}return{kind:Nt.Kind.DIRECTIVE,name:{kind:Nt.Kind.NAME,value:e},arguments:r}}function LS(e,t){let n=[];for(let{name:r,args:i}of t){let a=e==null?void 0:e.getDirective(r);n.push(Wl(r,i,a))}return n}});var gk=F($T=>{"use strict";m();T();N();Object.defineProperty($T,"__esModule",{value:!0});$T.validateGraphQlDocuments=Qte;$T.createDefaultRules=Ik;var tp=Se();function Qte(e,t,n=Ik()){var u;let r=new Set,i=new Map;for(let l of t)for(let d of l.definitions)d.kind===tp.Kind.FRAGMENT_DEFINITION?i.set(d.name.value,d):r.add(d);let a={kind:tp.Kind.DOCUMENT,definitions:Array.from([...r,...i.values()])},o=(0,tp.validate)(e,a,n);for(let l of o)if(l.stack=l.message,l.locations)for(let d of l.locations)l.stack+=` - at ${(u=l.source)==null?void 0:u.name}:${d.line}:${d.column}`;return o}function Ik(){let e=["NoUnusedFragmentsRule","NoUnusedVariablesRule","KnownDirectivesRule"];return tp.versionInfo.major<15&&(e=e.map(t=>t.replace(/Rule$/,""))),tp.specifiedRules.filter(t=>!e.includes(t.name))}});var _k=F(US=>{"use strict";m();T();N();Object.defineProperty(US,"__esModule",{value:!0});US.parseGraphQLJSON=Hte;var Yte=Se();function Jte(e){return e=e.toString(),e.charCodeAt(0)===65279&&(e=e.slice(1)),e}function zte(e){return JSON.parse(Jte(e))}function Hte(e,t,n){let r=zte(t);if(r.data&&(r=r.data),r.kind==="Document")return{location:e,document:r};if(r.__schema){let i=(0,Yte.buildClientSchema)(r,n);return{location:e,schema:i}}else if(typeof r=="string")return{location:e,rawSDL:r};throw new Error("Not valid JSON content")}});var kS=F(Wi=>{"use strict";m();T();N();Object.defineProperty(Wi,"__esModule",{value:!0});Wi.resetComments=Xte;Wi.collectComment=Zte;Wi.pushComment=np;Wi.printComment=bk;Wi.printWithComments=rne;Wi.getDescription=ane;Wi.getComment=BS;Wi.getLeadingCommentBlock=Ak;Wi.dedentBlockStringValue=Rk;Wi.getBlockStringIndentation=Pk;var Dk=Se(),Wte=80,Xl={};function Xte(){Xl={}}function Zte(e){var n;let t=(n=e.name)==null?void 0:n.value;if(t!=null)switch(np(e,t),e.kind){case"EnumTypeDefinition":if(e.values)for(let r of e.values)np(r,t,r.name.value);break;case"ObjectTypeDefinition":case"InputObjectTypeDefinition":case"InterfaceTypeDefinition":if(e.fields){for(let r of e.fields)if(np(r,t,r.name.value),ine(r)&&r.arguments)for(let i of r.arguments)np(i,t,r.name.value,i.name.value)}break}}function np(e,t,n,r){let i=BS(e);if(typeof i!="string"||i.length===0)return;let a=[t];n&&(a.push(n),r&&a.push(r));let o=a.join(".");Xl[o]||(Xl[o]=[]),Xl[o].push(i)}function bk(e){return` +`))}return W(q({},e),{value:t,block:!0})}function GU(e){return e.arguments?e.arguments.sort((n,r)=>n.name.value.localeCompare(r.name.value)):e.arguments}function CT(e){let t=e.selections;return W(q({},e),{selections:t.sort((n,r)=>{var a,o,u,l;return Cn.NAME in n?Cn.NAME in r?n.name.value.localeCompare(r.name.value):-1:Cn.NAME in r?1:((o=(a=n.typeCondition)==null?void 0:a.name.value)!=null?o:"").localeCompare((l=(u=r.typeCondition)==null?void 0:u.name.value)!=null?l:"")}).map(n=>{switch(n.kind){case $t.Kind.FIELD:return W(q({},n),{arguments:GU(n),selectionSet:n.selectionSet?CT(n.selectionSet):n.selectionSet});case $t.Kind.FRAGMENT_SPREAD:return n;case $t.Kind.INLINE_FRAGMENT:return W(q({},n),{selectionSet:CT(n.selectionSet)})}})})}function mZ(e){return W(q({},e),{definitions:e.definitions.map(t=>t.kind!==$t.Kind.OPERATION_DEFINITION?t:W(q({},t),{selectionSet:CT(t.selectionSet)}))})}function QU(e,t=!0){return(0,$t.parse)(e,{noLocation:t})}function NZ(e,t=!0){try{return{documentNode:QU(e,t)}}catch(n){return{error:n}}}});var HU=F(zl=>{"use strict";m();T();N();Object.defineProperty(zl,"__esModule",{value:!0});zl.AccumulatorMap=void 0;zl.mapValue=Hl;zl.extendSchemaImpl=TZ;var qe=Oe(),Cs=class extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(t,n){let r=this.get(t);r===void 0?this.set(t,[n]):r.push(n)}};zl.AccumulatorMap=Cs;function Hl(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}function TZ(e,t,n){var Le,Se,Me,Pt;let r=[],i=new Cs,a=new Cs,o=new Cs,u=new Cs,l=new Cs,d=new Cs,p=[],E,h=[],_=!1;for(let Z of t.definitions){switch(Z.kind){case qe.Kind.SCHEMA_DEFINITION:E=Z;break;case qe.Kind.SCHEMA_EXTENSION:h.push(Z);break;case qe.Kind.DIRECTIVE_DEFINITION:p.push(Z);break;case qe.Kind.SCALAR_TYPE_DEFINITION:case qe.Kind.OBJECT_TYPE_DEFINITION:case qe.Kind.INTERFACE_TYPE_DEFINITION:case qe.Kind.UNION_TYPE_DEFINITION:case qe.Kind.ENUM_TYPE_DEFINITION:case qe.Kind.INPUT_OBJECT_TYPE_DEFINITION:r.push(Z);break;case qe.Kind.SCALAR_TYPE_EXTENSION:i.add(Z.name.value,Z);break;case qe.Kind.OBJECT_TYPE_EXTENSION:a.add(Z.name.value,Z);break;case qe.Kind.INTERFACE_TYPE_EXTENSION:o.add(Z.name.value,Z);break;case qe.Kind.UNION_TYPE_EXTENSION:u.add(Z.name.value,Z);break;case qe.Kind.ENUM_TYPE_EXTENSION:l.add(Z.name.value,Z);break;case qe.Kind.INPUT_OBJECT_TYPE_EXTENSION:d.add(Z.name.value,Z);break;default:continue}_=!0}if(!_)return e;let S=new Map;for(let Z of e.types){let ue=ee(Z);ue&&S.set(Z.name,ue)}for(let Z of r){let ue=Z.name.value;S.set(ue,(Le=YU.get(ue))!=null?Le:ce(Z))}for(let[Z,ue]of a)S.set(Z,new qe.GraphQLObjectType({name:Z,interfaces:()=>tn(ue),fields:()=>Yt(ue),extensionASTNodes:ue}));if(n!=null&&n.addInvalidExtensionOrphans){for(let[Z,ue]of o)S.set(Z,new qe.GraphQLInterfaceType({name:Z,interfaces:()=>tn(ue),fields:()=>Yt(ue),extensionASTNodes:ue}));for(let[Z,ue]of l)S.set(Z,new qe.GraphQLEnumType({name:Z,values:yn(ue),extensionASTNodes:ue}));for(let[Z,ue]of u)S.set(Z,new qe.GraphQLUnionType({name:Z,types:()=>kn(ue),extensionASTNodes:ue}));for(let[Z,ue]of i)S.set(Z,new qe.GraphQLScalarType({name:Z,extensionASTNodes:ue}));for(let[Z,ue]of d)S.set(Z,new qe.GraphQLInputObjectType({name:Z,fields:()=>or(ue),extensionASTNodes:ue}))}let k=q(q({query:e.query&&K(e.query),mutation:e.mutation&&K(e.mutation),subscription:e.subscription&&K(e.subscription)},E&&Qt([E])),Qt(h));return W(q({description:(Me=(Se=E==null?void 0:E.description)==null?void 0:Se.value)!=null?Me:e.description},k),{types:Array.from(S.values()),directives:[...e.directives.map(ne),...p.map(bt)],extensions:e.extensions,astNode:E!=null?E:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(h),assumeValid:(Pt=n==null?void 0:n.assumeValid)!=null?Pt:!1});function B(Z){return(0,qe.isListType)(Z)?new qe.GraphQLList(B(Z.ofType)):(0,qe.isNonNullType)(Z)?new qe.GraphQLNonNull(B(Z.ofType)):K(Z)}function K(Z){return S.get(Z.name)}function ne(Z){if((0,qe.isSpecifiedDirective)(Z))return Z;let ue=Z.toConfig();return new qe.GraphQLDirective(W(q({},ue),{args:Hl(ue.args,Je)}))}function ee(Z){if((0,qe.isIntrospectionType)(Z)||(0,qe.isSpecifiedScalarType)(Z))return Z;if((0,qe.isScalarType)(Z))return me(Z);if((0,qe.isObjectType)(Z))return pe(Z);if((0,qe.isInterfaceType)(Z))return ge(Z);if((0,qe.isUnionType)(Z))return H(Z);if((0,qe.isEnumType)(Z))return de(Z);if((0,qe.isInputObjectType)(Z))return oe(Z)}function oe(Z){var We;let ue=Z.toConfig(),je=(We=d.get(ue.name))!=null?We:[];return new qe.GraphQLInputObjectType(W(q({},ue),{fields:()=>q(q({},Hl(ue.fields,Vt=>W(q({},Vt),{type:B(Vt.type)}))),or(je)),extensionASTNodes:ue.extensionASTNodes.concat(je)}))}function de(Z){var We;let ue=Z.toConfig(),je=(We=l.get(Z.name))!=null?We:[];return new qe.GraphQLEnumType(W(q({},ue),{values:q(q({},ue.values),yn(je)),extensionASTNodes:ue.extensionASTNodes.concat(je)}))}function me(Z){var Vt,ot;let ue=Z.toConfig(),je=(Vt=i.get(ue.name))!=null?Vt:[],We=ue.specifiedByURL;for(let Bt of je)We=(ot=JU(Bt))!=null?ot:We;return new qe.GraphQLScalarType(W(q({},ue),{specifiedByURL:We,extensionASTNodes:ue.extensionASTNodes.concat(je)}))}function pe(Z){var We;let ue=Z.toConfig(),je=(We=a.get(ue.name))!=null?We:[];return new qe.GraphQLObjectType(W(q({},ue),{interfaces:()=>[...Z.getInterfaces().map(K),...tn(je)],fields:()=>q(q({},Hl(ue.fields,he)),Yt(je)),extensionASTNodes:ue.extensionASTNodes.concat(je)}))}function ge(Z){var We;let ue=Z.toConfig(),je=(We=o.get(ue.name))!=null?We:[];return new qe.GraphQLInterfaceType(W(q({},ue),{interfaces:()=>[...Z.getInterfaces().map(K),...tn(je)],fields:()=>q(q({},Hl(ue.fields,he)),Yt(je)),extensionASTNodes:ue.extensionASTNodes.concat(je)}))}function H(Z){var We;let ue=Z.toConfig(),je=(We=u.get(ue.name))!=null?We:[];return new qe.GraphQLUnionType(W(q({},ue),{types:()=>[...Z.getTypes().map(K),...kn(je)],extensionASTNodes:ue.extensionASTNodes.concat(je)}))}function he(Z){return W(q({},Z),{type:B(Z.type),args:Z.args&&Hl(Z.args,Je)})}function Je(Z){return W(q({},Z),{type:B(Z.type)})}function Qt(Z){var je;let ue={};for(let We of Z){let Vt=(je=We.operationTypes)!=null?je:[];for(let ot of Vt)ue[ot.operation]=_n(ot.type)}return ue}function _n(Z){var We;let ue=Z.name.value,je=(We=YU.get(ue))!=null?We:S.get(ue);if(je===void 0)throw new Error(`Unknown type: "${ue}".`);return je}function hn(Z){return Z.kind===qe.Kind.LIST_TYPE?new qe.GraphQLList(hn(Z.type)):Z.kind===qe.Kind.NON_NULL_TYPE?new qe.GraphQLNonNull(hn(Z.type)):_n(Z)}function bt(Z){var ue;return new qe.GraphQLDirective({name:Z.name.value,description:(ue=Z.description)==null?void 0:ue.value,locations:Z.locations.map(({value:je})=>je),isRepeatable:Z.repeatable,args:jr(Z.arguments),astNode:Z})}function Yt(Z){var je,We;let ue=Object.create(null);for(let Vt of Z){let ot=(je=Vt.fields)!=null?je:[];for(let Bt of ot)ue[Bt.name.value]={type:hn(Bt.type),description:(We=Bt.description)==null?void 0:We.value,args:jr(Bt.arguments),deprecationReason:BT(Bt),astNode:Bt}}return ue}function jr(Z){var We;let ue=Z!=null?Z:[],je=Object.create(null);for(let Vt of ue){let ot=hn(Vt.type);je[Vt.name.value]={type:ot,description:(We=Vt.description)==null?void 0:We.value,defaultValue:(0,qe.valueFromAST)(Vt.defaultValue,ot),deprecationReason:BT(Vt),astNode:Vt}}return je}function or(Z){var je,We;let ue=Object.create(null);for(let Vt of Z){let ot=(je=Vt.fields)!=null?je:[];for(let Bt of ot){let ms=hn(Bt.type);ue[Bt.name.value]={type:ms,description:(We=Bt.description)==null?void 0:We.value,defaultValue:(0,qe.valueFromAST)(Bt.defaultValue,ms),deprecationReason:BT(Bt),astNode:Bt}}}return ue}function yn(Z){var je,We;let ue=Object.create(null);for(let Vt of Z){let ot=(je=Vt.values)!=null?je:[];for(let Bt of ot)ue[Bt.name.value]={description:(We=Bt.description)==null?void 0:We.value,deprecationReason:BT(Bt),astNode:Bt}}return ue}function tn(Z){return Z.flatMap(ue=>{var je,We;return(We=(je=ue.interfaces)==null?void 0:je.map(_n))!=null?We:[]})}function kn(Z){return Z.flatMap(ue=>{var je,We;return(We=(je=ue.types)==null?void 0:je.map(_n))!=null?We:[]})}function ce(Z){var je,We,Vt,ot,Bt,ms,ti,Ns,ml,ka,Dr,mi;let ue=Z.name.value;switch(Z.kind){case qe.Kind.OBJECT_TYPE_DEFINITION:{let Jt=(je=a.get(ue))!=null?je:[],br=[Z,...Jt];return a.delete(ue),new qe.GraphQLObjectType({name:ue,description:(We=Z.description)==null?void 0:We.value,interfaces:()=>tn(br),fields:()=>Yt(br),astNode:Z,extensionASTNodes:Jt})}case qe.Kind.INTERFACE_TYPE_DEFINITION:{let Jt=(Vt=o.get(ue))!=null?Vt:[],br=[Z,...Jt];return o.delete(ue),new qe.GraphQLInterfaceType({name:ue,description:(ot=Z.description)==null?void 0:ot.value,interfaces:()=>tn(br),fields:()=>Yt(br),astNode:Z,extensionASTNodes:Jt})}case qe.Kind.ENUM_TYPE_DEFINITION:{let Jt=(Bt=l.get(ue))!=null?Bt:[],br=[Z,...Jt];return l.delete(ue),new qe.GraphQLEnumType({name:ue,description:(ms=Z.description)==null?void 0:ms.value,values:yn(br),astNode:Z,extensionASTNodes:Jt})}case qe.Kind.UNION_TYPE_DEFINITION:{let Jt=(ti=u.get(ue))!=null?ti:[],br=[Z,...Jt];return u.delete(ue),new qe.GraphQLUnionType({name:ue,description:(Ns=Z.description)==null?void 0:Ns.value,types:()=>kn(br),astNode:Z,extensionASTNodes:Jt})}case qe.Kind.SCALAR_TYPE_DEFINITION:{let Jt=(ml=i.get(ue))!=null?ml:[];return i.delete(ue),new qe.GraphQLScalarType({name:ue,description:(ka=Z.description)==null?void 0:ka.value,specifiedByURL:JU(Z),astNode:Z,extensionASTNodes:Jt})}case qe.Kind.INPUT_OBJECT_TYPE_DEFINITION:{let Jt=(Dr=d.get(ue))!=null?Dr:[],br=[Z,...Jt];return d.delete(ue),new qe.GraphQLInputObjectType({name:ue,description:(mi=Z.description)==null?void 0:mi.value,fields:()=>or(br),astNode:Z,extensionASTNodes:Jt})}}}}var YU=new Map([...qe.specifiedScalarTypes,...qe.introspectionTypes].map(e=>[e.name,e]));function BT(e){let t=(0,qe.getDirectiveValues)(qe.GraphQLDeprecatedDirective,e);return t==null?void 0:t.reason}function JU(e){let t=(0,qe.getDirectiveValues)(qe.GraphQLSpecifiedByDirective,e);return t==null?void 0:t.url}});var uS=F(oS=>{"use strict";m();T();N();Object.defineProperty(oS,"__esModule",{value:!0});oS.buildASTSchema=yZ;var zU=Oe(),EZ=Ql(),hZ=HU();function yZ(e,t){(t==null?void 0:t.assumeValid)!==!0&&(t==null?void 0:t.assumeValidSDL)!==!0&&(0,EZ.assertValidSDL)(e);let n={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},r=(0,hZ.extendSchemaImpl)(n,e,t);if(r.astNode==null)for(let a of r.types)switch(a.name){case"Query":r.query=a;break;case"Mutation":r.mutation=a;break;case"Subscription":r.subscription=a;break}let i=[...r.directives,...zU.specifiedDirectives.filter(a=>r.directives.every(o=>o.name!==a.name))];return new zU.GraphQLSchema(W(q({},r),{directives:i}))}});var Wl=F(Cu=>{"use strict";m();T();N();Object.defineProperty(Cu,"__esModule",{value:!0});Cu.MAX_INT32=Cu.MAX_SUBSCRIPTION_FILTER_DEPTH=Cu.MAXIMUM_TYPE_NESTING=void 0;Cu.MAXIMUM_TYPE_NESTING=30;Cu.MAX_SUBSCRIPTION_FILTER_DEPTH=5;Cu.MAX_INT32=ln(2,31)-1});var Mr=F(mr=>{"use strict";m();T();N();Object.defineProperty(mr,"__esModule",{value:!0});mr.getOrThrowError=gZ;mr.getEntriesNotInHashSet=_Z;mr.numberToOrdinal=vZ;mr.addIterableToSet=SZ;mr.addOptionalIterableToSet=OZ;mr.addSets=DZ;mr.kindToNodeType=bZ;mr.getValueOrDefault=AZ;mr.add=RZ;mr.generateSimpleDirective=PZ;mr.generateRequiresScopesDirective=FZ;mr.generateSemanticNonNullDirective=LZ;mr.copyObjectValueMap=wZ;mr.addNewObjectValueMapEntries=CZ;mr.copyArrayValueMap=UZ;mr.addMapEntries=BZ;mr.getFirstEntry=kZ;var zt=Oe(),Ir=Zn(),IZ=Ji(),ef=kr();function gZ(e,t,n){let r=e.get(t);if(r===void 0)throw(0,IZ.invalidKeyFatalError)(t,n);return r}function _Z(e,t){let n=[];for(let r of e)t.has(r)||n.push(r);return n}function vZ(e){let t=e.toString();switch(t[t.length-1]){case"1":return`${t}st`;case"2":return`${t}nd`;case"3":return`${t}rd`;default:return`${t}th`}}function SZ({source:e,target:t}){for(let n of e)t.add(n)}function OZ({source:e,target:t}){if(e)for(let n of e)t.add(n)}function DZ(e,t){let n=new Set(e);for(let r of t)n.add(r);return n}function bZ(e){switch(e){case zt.Kind.BOOLEAN:return Ir.BOOLEAN_SCALAR;case zt.Kind.ENUM:case zt.Kind.ENUM_TYPE_DEFINITION:return Ir.ENUM;case zt.Kind.ENUM_TYPE_EXTENSION:return"Enum extension";case zt.Kind.ENUM_VALUE_DEFINITION:return Ir.ENUM_VALUE;case zt.Kind.FIELD_DEFINITION:return Ir.FIELD;case zt.Kind.FLOAT:return Ir.FLOAT_SCALAR;case zt.Kind.INPUT_OBJECT_TYPE_DEFINITION:return Ir.INPUT_OBJECT;case zt.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"Input Object extension";case zt.Kind.INPUT_VALUE_DEFINITION:return Ir.INPUT_VALUE;case zt.Kind.INT:return Ir.INT_SCALAR;case zt.Kind.INTERFACE_TYPE_DEFINITION:return Ir.INTERFACE;case zt.Kind.INTERFACE_TYPE_EXTENSION:return"Interface extension";case zt.Kind.NULL:return Ir.NULL;case zt.Kind.OBJECT:case zt.Kind.OBJECT_TYPE_DEFINITION:return Ir.OBJECT;case zt.Kind.OBJECT_TYPE_EXTENSION:return"Object extension";case zt.Kind.STRING:return Ir.STRING_SCALAR;case zt.Kind.SCALAR_TYPE_DEFINITION:return Ir.SCALAR;case zt.Kind.SCALAR_TYPE_EXTENSION:return"Scalar extension";case zt.Kind.UNION_TYPE_DEFINITION:return Ir.UNION;case zt.Kind.UNION_TYPE_EXTENSION:return"Union extension";default:return e}}function AZ(e,t,n){let r=e.get(t);if(r)return r;let i=n();return e.set(t,i),i}function RZ(e,t){return e.has(t)?!1:(e.add(t),!0)}function PZ(e){return{kind:zt.Kind.DIRECTIVE,name:(0,ef.stringToNameNode)(e)}}function FZ(e){let t=[];for(let n of e){let r=[];for(let i of n)r.push({kind:zt.Kind.STRING,value:i});t.push({kind:zt.Kind.LIST,values:r})}return{kind:zt.Kind.DIRECTIVE,name:(0,ef.stringToNameNode)(Ir.REQUIRES_SCOPES),arguments:[{kind:zt.Kind.ARGUMENT,name:(0,ef.stringToNameNode)(Ir.SCOPES),value:{kind:zt.Kind.LIST,values:t}}]}}function LZ(e){let t=Array.from(e).sort((r,i)=>r-i),n=new Array;for(let r of t)n.push({kind:zt.Kind.INT,value:r.toString()});return{kind:zt.Kind.DIRECTIVE,name:(0,ef.stringToNameNode)(Ir.SEMANTIC_NON_NULL),arguments:[{kind:zt.Kind.ARGUMENT,name:(0,ef.stringToNameNode)(Ir.LEVELS),value:{kind:zt.Kind.LIST,values:n}}]}}function wZ(e){let t=new Map;for(let[n,r]of e)t.set(n,q({},r));return t}function CZ(e,t){for(let[n,r]of e)t.set(n,q({},r))}function UZ(e){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function BZ({source:e,target:t}){for(let[n,r]of e)t.set(n,r)}function kZ(e){let{value:t,done:n}=e.values().next();if(!n)return t}});var tf=F(kT=>{"use strict";m();T();N();Object.defineProperty(kT,"__esModule",{value:!0});kT.ExtensionType=void 0;var WU;(function(e){e[e.EXTENDS=0]="EXTENDS",e[e.NONE=1]="NONE",e[e.REAL=2]="REAL"})(WU||(kT.ExtensionType=WU={}))});var Uu=F(qr=>{"use strict";m();T();N();Object.defineProperty(qr,"__esModule",{value:!0});qr.getMutableDirectiveDefinitionNode=xZ;qr.getMutableEnumNode=qZ;qr.getMutableEnumValueNode=VZ;qr.getMutableFieldNode=KZ;qr.getMutableInputObjectNode=jZ;qr.getMutableInputValueNode=$Z;qr.getMutableInterfaceNode=GZ;qr.getMutableObjectNode=QZ;qr.getMutableObjectExtensionNode=YZ;qr.getMutableScalarNode=JZ;qr.getMutableTypeNode=cS;qr.getMutableUnionNode=HZ;qr.getTypeNodeNamedTypeName=lS;qr.getNamedTypeNode=ZU;var xr=Oe(),Xl=kr(),XU=Ji(),MZ=Wl();function xZ(e){return{arguments:[],kind:e.kind,locations:[],name:q({},e.name),repeatable:e.repeatable,description:(0,Xl.formatDescription)(e.description)}}function qZ(e){return{kind:xr.Kind.ENUM_TYPE_DEFINITION,name:q({},e)}}function VZ(e){return{directives:[],kind:e.kind,name:q({},e.name),description:(0,Xl.formatDescription)(e.description)}}function KZ(e,t,n){return{arguments:[],directives:[],kind:e.kind,name:q({},e.name),type:cS(e.type,t,n),description:(0,Xl.formatDescription)(e.description)}}function jZ(e){return{kind:xr.Kind.INPUT_OBJECT_TYPE_DEFINITION,name:q({},e)}}function $Z(e,t,n){return{directives:[],kind:e.kind,name:q({},e.name),type:cS(e.type,t,n),defaultValue:e.defaultValue,description:(0,Xl.formatDescription)(e.description)}}function GZ(e){return{kind:xr.Kind.INTERFACE_TYPE_DEFINITION,name:q({},e)}}function QZ(e){return{kind:xr.Kind.OBJECT_TYPE_DEFINITION,name:q({},e)}}function YZ(e){let t=e.kind===xr.Kind.OBJECT_TYPE_DEFINITION?e.description:void 0;return{kind:xr.Kind.OBJECT_TYPE_EXTENSION,name:q({},e.name),description:(0,Xl.formatDescription)(t)}}function JZ(e){return{kind:xr.Kind.SCALAR_TYPE_DEFINITION,name:q({},e)}}function cS(e,t,n){let r={kind:e.kind},i=r;for(let a=0;a{"use strict";m();T();N();Object.defineProperty(Bu,"__esModule",{value:!0});Bu.REQUIRED_FIELDSET_TYPE_NODE=Bu.REQUIRED_INT_TYPE_NODE=Bu.REQUIRED_STRING_TYPE_NODE=void 0;var dS=Oe(),pS=kr(),fS=Zn();Bu.REQUIRED_STRING_TYPE_NODE={kind:dS.Kind.NON_NULL_TYPE,type:(0,pS.stringToNamedTypeNode)(fS.STRING_SCALAR)};Bu.REQUIRED_INT_TYPE_NODE={kind:dS.Kind.NON_NULL_TYPE,type:(0,pS.stringToNamedTypeNode)(fS.INT_SCALAR)};Bu.REQUIRED_FIELDSET_TYPE_NODE={kind:dS.Kind.NON_NULL_TYPE,type:(0,pS.stringToNamedTypeNode)(fS.FIELD_SET_SCALAR)}});var nf=F(Re=>{"use strict";m();T();N();Object.defineProperty(Re,"__esModule",{value:!0});Re.TAG_DEFINITION=Re.SUBSCRIPTION_FILTER_DEFINITION=Re.SPECIFIED_BY_DEFINITION=Re.SHAREABLE_DEFINITION=Re.SEMANTIC_NON_NULL_DEFINITION=Re.REQUIRES_SCOPES_DEFINITION=Re.REQUIRES_DEFINITION=Re.REQUIRE_FETCH_REASONS_DEFINITION=Re.REQUEST_SCOPED_DEFINITION=Re.QUERY_CACHE_DEFINITION=Re.PROVIDES_DEFINITION=Re.OVERRIDE_DEFINITION=Re.ONE_OF_DEFINITION=Re.LIST_SIZE_DEFINITION=Re.LINK_DEFINITION=Re.KEY_DEFINITION=Re.IS_DEFINITION=Re.INTERFACE_OBJECT_DEFINITION=Re.INACCESSIBLE_DEFINITION=Re.EDFS_REDIS_SUBSCRIBE_DEFINITION=Re.EDFS_REDIS_PUBLISH_DEFINITION=Re.EDFS_NATS_SUBSCRIBE_DEFINITION=Re.EDFS_NATS_REQUEST_DEFINITION=Re.EDFS_NATS_PUBLISH_DEFINITION=Re.EDFS_KAFKA_SUBSCRIBE_DEFINITION=Re.EDFS_KAFKA_PUBLISH_DEFINITION=Re.EXTERNAL_DEFINITION=Re.EXTENDS_DEFINITION=Re.ENTITY_CACHE_DEFINITION=Re.DEPRECATED_DEFINITION=Re.COST_DEFINITION=Re.CONNECT_FIELD_RESOLVER_DEFINITION=Re.CONFIGURE_DESCRIPTION_DEFINITION=Re.CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION=Re.COMPOSE_DIRECTIVE_DEFINITION=Re.CACHE_POPULATE_DEFINITION=Re.CACHE_INVALIDATE_DEFINITION=Re.AUTHENTICATED_DEFINITION=void 0;var se=Oe(),re=kr(),j=Zn(),tr=MT();Re.AUTHENTICATED_DEFINITION={kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.ENUM_UPPER,j.FIELD_DEFINITION_UPPER,j.INTERFACE_UPPER,j.OBJECT_UPPER,j.SCALAR_UPPER]),name:(0,re.stringToNameNode)(j.AUTHENTICATED),repeatable:!1};Re.CACHE_INVALIDATE_DEFINITION={kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.FIELD_DEFINITION_UPPER]),name:(0,re.stringToNameNode)(j.CACHE_INVALIDATE),repeatable:!1};Re.CACHE_POPULATE_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.MAX_AGE),type:(0,re.stringToNamedTypeNode)(j.INT_SCALAR)}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.FIELD_DEFINITION_UPPER]),name:(0,re.stringToNameNode)(j.CACHE_POPULATE),repeatable:!1};Re.COMPOSE_DIRECTIVE_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.NAME),type:tr.REQUIRED_STRING_TYPE_NODE}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.SCHEMA_UPPER]),name:(0,re.stringToNameNode)(j.COMPOSE_DIRECTIVE),repeatable:!0};Re.CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.PROPAGATE),type:{kind:se.Kind.NON_NULL_TYPE,type:(0,re.stringToNamedTypeNode)(j.BOOLEAN_SCALAR)},defaultValue:{kind:se.Kind.BOOLEAN,value:!0}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.ENUM_UPPER,j.INPUT_OBJECT_UPPER,j.INTERFACE_UPPER,j.OBJECT_UPPER]),name:(0,re.stringToNameNode)(j.CONFIGURE_CHILD_DESCRIPTIONS),repeatable:!1};Re.CONFIGURE_DESCRIPTION_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.PROPAGATE),type:{kind:se.Kind.NON_NULL_TYPE,type:(0,re.stringToNamedTypeNode)(j.BOOLEAN_SCALAR)},defaultValue:{kind:se.Kind.BOOLEAN,value:!0}},{directives:[],kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.DESCRIPTION_OVERRIDE),type:(0,re.stringToNamedTypeNode)(j.STRING_SCALAR)}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.ARGUMENT_DEFINITION_UPPER,j.ENUM_UPPER,j.ENUM_VALUE_UPPER,j.FIELD_DEFINITION_UPPER,j.INTERFACE_UPPER,j.INPUT_OBJECT_UPPER,j.INPUT_FIELD_DEFINITION_UPPER,j.OBJECT_UPPER,j.SCALAR_UPPER,j.SCHEMA_UPPER,j.UNION_UPPER]),name:(0,re.stringToNameNode)(j.CONFIGURE_DESCRIPTION),repeatable:!1};Re.CONNECT_FIELD_RESOLVER_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.CONTEXT),type:tr.REQUIRED_FIELDSET_TYPE_NODE}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.FIELD_DEFINITION_UPPER]),name:(0,re.stringToNameNode)(j.CONNECT_FIELD_RESOLVER),repeatable:!1};Re.COST_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.WEIGHT),type:{kind:se.Kind.NON_NULL_TYPE,type:(0,re.stringToNamedTypeNode)(j.INT_SCALAR)}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.ARGUMENT_DEFINITION_UPPER,j.ENUM_UPPER,j.FIELD_DEFINITION_UPPER,j.INPUT_FIELD_DEFINITION_UPPER,j.OBJECT_UPPER,j.SCALAR_UPPER]),name:(0,re.stringToNameNode)(j.COST),repeatable:!1};Re.DEPRECATED_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.REASON),type:(0,re.stringToNamedTypeNode)(j.STRING_SCALAR),defaultValue:{kind:se.Kind.STRING,value:se.DEFAULT_DEPRECATION_REASON}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.ARGUMENT_DEFINITION_UPPER,j.ENUM_VALUE_UPPER,j.FIELD_DEFINITION_UPPER,j.INPUT_FIELD_DEFINITION_UPPER]),name:(0,re.stringToNameNode)(j.DEPRECATED),repeatable:!1};Re.ENTITY_CACHE_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.MAX_AGE),type:tr.REQUIRED_INT_TYPE_NODE},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.NEGATIVE_CACHE_TTL),type:(0,re.stringToNamedTypeNode)(j.INT_SCALAR),defaultValue:{kind:se.Kind.INT,value:"0"}},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.INCLUDE_HEADERS),type:(0,re.stringToNamedTypeNode)(j.BOOLEAN_SCALAR),defaultValue:{kind:se.Kind.BOOLEAN,value:!1}},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.PARTIAL_CACHE_LOAD),type:(0,re.stringToNamedTypeNode)(j.BOOLEAN_SCALAR),defaultValue:{kind:se.Kind.BOOLEAN,value:!1}},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.SHADOW_MODE),type:(0,re.stringToNamedTypeNode)(j.BOOLEAN_SCALAR),defaultValue:{kind:se.Kind.BOOLEAN,value:!1}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.OBJECT_UPPER]),name:(0,re.stringToNameNode)(j.ENTITY_CACHE),repeatable:!1};Re.EXTENDS_DEFINITION={kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.INTERFACE_UPPER,j.OBJECT_UPPER]),name:(0,re.stringToNameNode)(j.EXTENDS),repeatable:!1};Re.EXTERNAL_DEFINITION={kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.FIELD_DEFINITION_UPPER,j.OBJECT_UPPER]),name:(0,re.stringToNameNode)(j.EXTERNAL),repeatable:!1};Re.EDFS_KAFKA_PUBLISH_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.TOPIC),type:tr.REQUIRED_STRING_TYPE_NODE},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.PROVIDER_ID),type:tr.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:se.Kind.STRING,value:j.DEFAULT_EDFS_PROVIDER_ID}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:[(0,re.stringToNameNode)(j.FIELD_DEFINITION_UPPER)],name:(0,re.stringToNameNode)(j.EDFS_KAFKA_PUBLISH),repeatable:!1};Re.EDFS_KAFKA_SUBSCRIBE_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.TOPICS),type:{kind:se.Kind.NON_NULL_TYPE,type:{kind:se.Kind.LIST_TYPE,type:tr.REQUIRED_STRING_TYPE_NODE}}},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.PROVIDER_ID),type:tr.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:se.Kind.STRING,value:j.DEFAULT_EDFS_PROVIDER_ID}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:[(0,re.stringToNameNode)(j.FIELD_DEFINITION_UPPER)],name:(0,re.stringToNameNode)(j.EDFS_KAFKA_SUBSCRIBE),repeatable:!1};Re.EDFS_NATS_PUBLISH_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.SUBJECT),type:tr.REQUIRED_STRING_TYPE_NODE},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.PROVIDER_ID),type:{kind:se.Kind.NON_NULL_TYPE,type:(0,re.stringToNamedTypeNode)(j.STRING_SCALAR)},defaultValue:{kind:se.Kind.STRING,value:j.DEFAULT_EDFS_PROVIDER_ID}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:[(0,re.stringToNameNode)(j.FIELD_DEFINITION_UPPER)],name:(0,re.stringToNameNode)(j.EDFS_NATS_PUBLISH),repeatable:!1};Re.EDFS_NATS_REQUEST_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.SUBJECT),type:{kind:se.Kind.NON_NULL_TYPE,type:(0,re.stringToNamedTypeNode)(j.STRING_SCALAR)}},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.PROVIDER_ID),type:{kind:se.Kind.NON_NULL_TYPE,type:(0,re.stringToNamedTypeNode)(j.STRING_SCALAR)},defaultValue:{kind:se.Kind.STRING,value:j.DEFAULT_EDFS_PROVIDER_ID}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:[(0,re.stringToNameNode)(j.FIELD_DEFINITION_UPPER)],name:(0,re.stringToNameNode)(j.EDFS_NATS_REQUEST),repeatable:!1};Re.EDFS_NATS_SUBSCRIBE_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.SUBJECTS),type:{kind:se.Kind.NON_NULL_TYPE,type:{kind:se.Kind.LIST_TYPE,type:tr.REQUIRED_STRING_TYPE_NODE}}},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.PROVIDER_ID),type:tr.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:se.Kind.STRING,value:j.DEFAULT_EDFS_PROVIDER_ID}},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.STREAM_CONFIGURATION),type:(0,re.stringToNamedTypeNode)(j.EDFS_NATS_STREAM_CONFIGURATION)}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:[(0,re.stringToNameNode)(j.FIELD_DEFINITION_UPPER)],name:(0,re.stringToNameNode)(j.EDFS_NATS_SUBSCRIBE),repeatable:!1};Re.EDFS_REDIS_PUBLISH_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.CHANNEL),type:tr.REQUIRED_STRING_TYPE_NODE},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.PROVIDER_ID),type:tr.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:se.Kind.STRING,value:j.DEFAULT_EDFS_PROVIDER_ID}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:[(0,re.stringToNameNode)(j.FIELD_DEFINITION_UPPER)],name:(0,re.stringToNameNode)(j.EDFS_REDIS_PUBLISH),repeatable:!1};Re.EDFS_REDIS_SUBSCRIBE_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.CHANNELS),type:{kind:se.Kind.NON_NULL_TYPE,type:{kind:se.Kind.LIST_TYPE,type:tr.REQUIRED_STRING_TYPE_NODE}}},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.PROVIDER_ID),type:tr.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:se.Kind.STRING,value:j.DEFAULT_EDFS_PROVIDER_ID}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:[(0,re.stringToNameNode)(j.FIELD_DEFINITION_UPPER)],name:(0,re.stringToNameNode)(j.EDFS_REDIS_SUBSCRIBE),repeatable:!1};Re.INACCESSIBLE_DEFINITION={kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.ARGUMENT_DEFINITION_UPPER,j.ENUM_UPPER,j.ENUM_VALUE_UPPER,j.FIELD_DEFINITION_UPPER,j.INPUT_FIELD_DEFINITION_UPPER,j.INPUT_OBJECT_UPPER,j.INTERFACE_UPPER,j.OBJECT_UPPER,j.SCALAR_UPPER,j.UNION_UPPER]),name:(0,re.stringToNameNode)(j.INACCESSIBLE),repeatable:!1};Re.INTERFACE_OBJECT_DEFINITION={kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.OBJECT_UPPER]),name:(0,re.stringToNameNode)(j.INTERFACE_OBJECT),repeatable:!1};Re.IS_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.FIELDS),type:tr.REQUIRED_STRING_TYPE_NODE}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.ARGUMENT_DEFINITION_UPPER]),name:(0,re.stringToNameNode)(j.IS),repeatable:!1};Re.KEY_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.FIELDS),type:tr.REQUIRED_FIELDSET_TYPE_NODE},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.RESOLVABLE),type:(0,re.stringToNamedTypeNode)(j.BOOLEAN_SCALAR),defaultValue:{kind:se.Kind.BOOLEAN,value:!0}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.INTERFACE_UPPER,j.OBJECT_UPPER]),name:(0,re.stringToNameNode)(j.KEY),repeatable:!0};Re.LINK_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.URL_LOWER),type:{kind:se.Kind.NON_NULL_TYPE,type:(0,re.stringToNamedTypeNode)(j.STRING_SCALAR)}},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.AS),type:(0,re.stringToNamedTypeNode)(j.STRING_SCALAR)},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.FOR),type:(0,re.stringToNamedTypeNode)(j.LINK_PURPOSE)},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.IMPORT),type:{kind:se.Kind.LIST_TYPE,type:(0,re.stringToNamedTypeNode)(j.LINK_IMPORT)}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.SCHEMA_UPPER]),name:(0,re.stringToNameNode)(j.LINK),repeatable:!0};Re.LIST_SIZE_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.ASSUMED_SIZE),type:(0,re.stringToNamedTypeNode)(j.INT_SCALAR)},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.SLICING_ARGUMENTS),type:{kind:se.Kind.LIST_TYPE,type:{kind:se.Kind.NON_NULL_TYPE,type:(0,re.stringToNamedTypeNode)(j.STRING_SCALAR)}}},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.SIZED_FIELDS),type:{kind:se.Kind.LIST_TYPE,type:{kind:se.Kind.NON_NULL_TYPE,type:(0,re.stringToNamedTypeNode)(j.STRING_SCALAR)}}},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.REQUIRE_ONE_SLICING_ARGUMENT),type:(0,re.stringToNamedTypeNode)(j.BOOLEAN_SCALAR),defaultValue:{kind:se.Kind.BOOLEAN,value:!0}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.FIELD_DEFINITION_UPPER]),name:(0,re.stringToNameNode)(j.LIST_SIZE),repeatable:!1};Re.ONE_OF_DEFINITION={kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.INPUT_OBJECT_UPPER]),name:(0,re.stringToNameNode)(j.ONE_OF),repeatable:!1};Re.OVERRIDE_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.FROM),type:{kind:se.Kind.NON_NULL_TYPE,type:(0,re.stringToNamedTypeNode)(j.STRING_SCALAR)}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.FIELD_DEFINITION_UPPER]),name:(0,re.stringToNameNode)(j.OVERRIDE),repeatable:!1};Re.PROVIDES_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.FIELDS),type:tr.REQUIRED_FIELDSET_TYPE_NODE}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:[(0,re.stringToNameNode)(j.FIELD_DEFINITION_UPPER)],name:(0,re.stringToNameNode)(j.PROVIDES),repeatable:!1};Re.QUERY_CACHE_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.MAX_AGE),type:tr.REQUIRED_INT_TYPE_NODE},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.INCLUDE_HEADERS),type:(0,re.stringToNamedTypeNode)(j.BOOLEAN_SCALAR),defaultValue:{kind:se.Kind.BOOLEAN,value:!1}},{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.SHADOW_MODE),type:(0,re.stringToNamedTypeNode)(j.BOOLEAN_SCALAR),defaultValue:{kind:se.Kind.BOOLEAN,value:!1}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.FIELD_DEFINITION_UPPER]),name:(0,re.stringToNameNode)(j.QUERY_CACHE),repeatable:!1};Re.REQUEST_SCOPED_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.KEY),type:{kind:se.Kind.NON_NULL_TYPE,type:(0,re.stringToNamedTypeNode)(j.STRING_SCALAR)}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.FIELD_DEFINITION_UPPER]),name:(0,re.stringToNameNode)(j.REQUEST_SCOPED),repeatable:!1};Re.REQUIRE_FETCH_REASONS_DEFINITION={kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.FIELD_DEFINITION_UPPER,j.INTERFACE_UPPER,j.OBJECT_UPPER]),name:(0,re.stringToNameNode)(j.REQUIRE_FETCH_REASONS),repeatable:!0};Re.REQUIRES_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.FIELDS),type:tr.REQUIRED_FIELDSET_TYPE_NODE}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:[(0,re.stringToNameNode)(j.FIELD_DEFINITION_UPPER)],name:(0,re.stringToNameNode)(j.REQUIRES),repeatable:!1};Re.REQUIRES_SCOPES_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.SCOPES),type:{kind:se.Kind.NON_NULL_TYPE,type:{kind:se.Kind.LIST_TYPE,type:{kind:se.Kind.NON_NULL_TYPE,type:{kind:se.Kind.LIST_TYPE,type:{kind:se.Kind.NON_NULL_TYPE,type:(0,re.stringToNamedTypeNode)(j.SCOPE_SCALAR)}}}}}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.ENUM_UPPER,j.FIELD_DEFINITION_UPPER,j.INTERFACE_UPPER,j.OBJECT_UPPER,j.SCALAR_UPPER]),name:(0,re.stringToNameNode)(j.REQUIRES_SCOPES),repeatable:!1};Re.SEMANTIC_NON_NULL_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.LEVELS),type:{kind:se.Kind.NON_NULL_TYPE,type:{kind:se.Kind.LIST_TYPE,type:{kind:se.Kind.NON_NULL_TYPE,type:(0,re.stringToNamedTypeNode)(j.INT_SCALAR)}}},defaultValue:{kind:se.Kind.LIST,values:[{kind:se.Kind.INT,value:"0"}]}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:[(0,re.stringToNameNode)(j.FIELD_DEFINITION_UPPER)],name:(0,re.stringToNameNode)(j.SEMANTIC_NON_NULL),repeatable:!1};Re.SHAREABLE_DEFINITION={kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.FIELD_DEFINITION_UPPER,j.OBJECT_UPPER]),name:(0,re.stringToNameNode)(j.SHAREABLE),repeatable:!0};Re.SPECIFIED_BY_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.URL_LOWER),type:tr.REQUIRED_STRING_TYPE_NODE}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.SCALAR_UPPER]),name:(0,re.stringToNameNode)(j.SPECIFIED_BY),repeatable:!1};Re.SUBSCRIPTION_FILTER_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.CONDITION),type:{kind:se.Kind.NON_NULL_TYPE,type:(0,re.stringToNamedTypeNode)(j.SUBSCRIPTION_FILTER_CONDITION)}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.FIELD_DEFINITION_UPPER]),name:(0,re.stringToNameNode)(j.SUBSCRIPTION_FILTER),repeatable:!1};Re.TAG_DEFINITION={arguments:[{kind:se.Kind.INPUT_VALUE_DEFINITION,name:(0,re.stringToNameNode)(j.NAME),type:{kind:se.Kind.NON_NULL_TYPE,type:(0,re.stringToNamedTypeNode)(j.STRING_SCALAR)}}],kind:se.Kind.DIRECTIVE_DEFINITION,locations:(0,re.stringArrayToNameNodeArray)([j.ARGUMENT_DEFINITION_UPPER,j.ENUM_UPPER,j.ENUM_VALUE_UPPER,j.FIELD_DEFINITION_UPPER,j.INPUT_FIELD_DEFINITION_UPPER,j.INPUT_OBJECT_UPPER,j.INTERFACE_UPPER,j.OBJECT_UPPER,j.SCALAR_UPPER,j.UNION_UPPER]),name:(0,re.stringToNameNode)(j.TAG),repeatable:!0}});var ku=F(Hi=>{"use strict";m();T();N();Object.defineProperty(Hi,"__esModule",{value:!0});Hi.MAX_OR_SCOPES=Hi.EDFS_ARGS_REGEXP=Hi.V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME=Hi.BASE_SCALARS=Hi.DIRECTIVE_DEFINITION_BY_NAME=void 0;var Ze=Zn(),ft=nf();Hi.DIRECTIVE_DEFINITION_BY_NAME=new Map([[Ze.AUTHENTICATED,ft.AUTHENTICATED_DEFINITION],[Ze.CACHE_INVALIDATE,ft.CACHE_INVALIDATE_DEFINITION],[Ze.CACHE_POPULATE,ft.CACHE_POPULATE_DEFINITION],[Ze.COMPOSE_DIRECTIVE,ft.COMPOSE_DIRECTIVE_DEFINITION],[Ze.CONFIGURE_DESCRIPTION,ft.CONFIGURE_DESCRIPTION_DEFINITION],[Ze.CONFIGURE_CHILD_DESCRIPTIONS,ft.CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION],[Ze.CONNECT_FIELD_RESOLVER,ft.CONNECT_FIELD_RESOLVER_DEFINITION],[Ze.COST,ft.COST_DEFINITION],[Ze.DEPRECATED,ft.DEPRECATED_DEFINITION],[Ze.EDFS_KAFKA_PUBLISH,ft.EDFS_KAFKA_PUBLISH_DEFINITION],[Ze.EDFS_KAFKA_SUBSCRIBE,ft.EDFS_KAFKA_SUBSCRIBE_DEFINITION],[Ze.EDFS_NATS_PUBLISH,ft.EDFS_NATS_PUBLISH_DEFINITION],[Ze.EDFS_NATS_REQUEST,ft.EDFS_NATS_REQUEST_DEFINITION],[Ze.EDFS_NATS_SUBSCRIBE,ft.EDFS_NATS_SUBSCRIBE_DEFINITION],[Ze.EDFS_REDIS_PUBLISH,ft.EDFS_REDIS_PUBLISH_DEFINITION],[Ze.EDFS_REDIS_SUBSCRIBE,ft.EDFS_REDIS_SUBSCRIBE_DEFINITION],[Ze.ENTITY_CACHE,ft.ENTITY_CACHE_DEFINITION],[Ze.EXTENDS,ft.EXTENDS_DEFINITION],[Ze.EXTERNAL,ft.EXTERNAL_DEFINITION],[Ze.INACCESSIBLE,ft.INACCESSIBLE_DEFINITION],[Ze.INTERFACE_OBJECT,ft.INTERFACE_OBJECT_DEFINITION],[Ze.IS,ft.IS_DEFINITION],[Ze.KEY,ft.KEY_DEFINITION],[Ze.LINK,ft.LINK_DEFINITION],[Ze.LIST_SIZE,ft.LIST_SIZE_DEFINITION],[Ze.ONE_OF,ft.ONE_OF_DEFINITION],[Ze.OVERRIDE,ft.OVERRIDE_DEFINITION],[Ze.PROVIDES,ft.PROVIDES_DEFINITION],[Ze.QUERY_CACHE,ft.QUERY_CACHE_DEFINITION],[Ze.REQUEST_SCOPED,ft.REQUEST_SCOPED_DEFINITION],[Ze.REQUIRE_FETCH_REASONS,ft.REQUIRE_FETCH_REASONS_DEFINITION],[Ze.REQUIRES,ft.REQUIRES_DEFINITION],[Ze.REQUIRES_SCOPES,ft.REQUIRES_SCOPES_DEFINITION],[Ze.SEMANTIC_NON_NULL,ft.SEMANTIC_NON_NULL_DEFINITION],[Ze.SHAREABLE,ft.SHAREABLE_DEFINITION],[Ze.SPECIFIED_BY,ft.SPECIFIED_BY_DEFINITION],[Ze.SUBSCRIPTION_FILTER,ft.SUBSCRIPTION_FILTER_DEFINITION],[Ze.TAG,ft.TAG_DEFINITION]]);Hi.BASE_SCALARS=new Set(["_Any","_Entities",Ze.BOOLEAN_SCALAR,Ze.FLOAT_SCALAR,Ze.ID_SCALAR,Ze.INT_SCALAR,Ze.FIELD_SET_SCALAR,Ze.SCOPE_SCALAR,Ze.STRING_SCALAR]);Hi.V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME=new Map([[Ze.AUTHENTICATED,ft.AUTHENTICATED_DEFINITION],[Ze.COMPOSE_DIRECTIVE,ft.COMPOSE_DIRECTIVE_DEFINITION],[Ze.INACCESSIBLE,ft.INACCESSIBLE_DEFINITION],[Ze.INTERFACE_OBJECT,ft.INTERFACE_OBJECT_DEFINITION],[Ze.LINK,ft.LINK_DEFINITION],[Ze.OVERRIDE,ft.OVERRIDE_DEFINITION],[Ze.REQUIRES_SCOPES,ft.REQUIRES_SCOPES_DEFINITION],[Ze.SHAREABLE,ft.SHAREABLE_DEFINITION]]);Hi.EDFS_ARGS_REGEXP=/{{\s*args\.([a-zA-Z0-9_]+)\s*}}/g;Hi.MAX_OR_SCOPES=16});var xT=F(Cc=>{"use strict";m();T();N();Object.defineProperty(Cc,"__esModule",{value:!0});Cc.newParentTagData=eee;Cc.newChildTagData=tee;Cc.validateImplicitFieldSets=nee;Cc.newContractTagOptionsFromArrays=ree;Cc.getDescriptionFromString=iee;var ci=Oe(),zZ=Uu(),WZ=ku(),XZ=kr(),eB=Mr(),ZZ=Zn();function eee(e){return{childTagDataByChildName:new Map,tagNames:new Set,typeName:e}}function tee(e){return{name:e,tagNames:new Set,tagNamesByArgumentName:new Map}}function nee({conditionalFieldDataByCoords:e,currentSubgraphName:t,entityData:n,implicitKeys:r,objectData:i,parentDefinitionDataByTypeName:a,graphNode:o}){let u=(0,eB.getValueOrDefault)(n.keyFieldSetDatasBySubgraphName,t,()=>new Map);for(let[l,d]of n.documentNodeByKeyFieldSet){if(u.has(l))continue;let p=[i],E=[],h=[],_=-1,S=!0,k=!0;(0,ci.visit)(d,{Argument:{enter(){return k=!1,ci.BREAK}},Field:{enter(B){let K=p[_];if(S)return k=!1,ci.BREAK;let ne=B.name.value;if(ne===ZZ.TYPENAME)return;let ee=K.fieldDataByName.get(ne);if(!ee||ee.argumentDataByName.size||E[_].has(ne))return k=!1,ci.BREAK;let{isUnconditionallyProvided:oe}=(0,eB.getOrThrowError)(ee.externalFieldDataBySubgraphName,t,`${ee.originalParentTypeName}.${ne}.externalFieldDataBySubgraphName`),de=e.get(`${ee.renamedParentTypeName}.${ne}`);if(de){if(de.providedBy.length>0)h.push(...de.providedBy);else if(de.requiredBy.length>0)return k=!1,ci.BREAK}else if(!oe)return k=!1,ci.BREAK;E[_].add(ne);let me=(0,zZ.getTypeNodeNamedTypeName)(ee.node.type);if(WZ.BASE_SCALARS.has(me))return;let pe=a.get(me);if(!pe)return k=!1,ci.BREAK;if(pe.kind===ci.Kind.OBJECT_TYPE_DEFINITION){S=!0,p.push(pe);return}if((0,XZ.isKindAbstract)(pe.kind))return k=!1,ci.BREAK}},InlineFragment:{enter(){return k=!1,ci.BREAK}},SelectionSet:{enter(){if(!S||(_+=1,S=!1,_<0||_>=p.length))return k=!1,ci.BREAK;E.push(new Set)},leave(){if(S)return k=!1,ci.BREAK;_-=1,p.pop(),E.pop()}}}),k&&(r.push(W(q({fieldName:"",selectionSet:l},h.length>0?{conditions:h}:{}),{disableEntityResolver:!0})),o&&o.satisfiedFieldSets.add(l))}}function ree(e,t){return{tagNamesToExclude:new Set(e),tagNamesToInclude:new Set(t)}}function iee(e){if(e)return{block:!0,kind:ci.Kind.STRING,value:e}}});var ed=F(mt=>{"use strict";m();T();N();Object.defineProperty(mt,"__esModule",{value:!0});mt.MergeMethod=void 0;mt.newPersistedDirectivesData=see;mt.isNodeExternalOrShareable=oee;mt.isTypeRequired=uee;mt.isTypeNodeListType=nB;mt.areDefaultValuesCompatible=rB;mt.compareAndValidateInputValueDefaultValues=cee;mt.setMutualExecutableLocations=lee;mt.isTypeNameRootType=dee;mt.getRenamedRootTypeName=pee;mt.childMapToValueArray=mee;mt.setLongestDescription=Nee;mt.isParentDataRootType=iB;mt.isInterfaceDefinitionData=Tee;mt.setParentDataExtensionType=Eee;mt.upsertDeprecatedDirective=hee;mt.upsertTagDirectives=yee;mt.propagateAuthDirectives=Iee;mt.propagateFieldAuthDirectives=gee;mt.generateDeprecatedDirective=ES;mt.getClientPersistedDirectiveNodes=NS;mt.getClientSchemaFieldNodeByFieldData=See;mt.getNodeWithPersistedDirectivesByInputValueData=aB;mt.addValidPersistedDirectiveDefinitionNodeByData=Dee;mt.newInvalidFieldNames=bee;mt.validateExternalAndShareable=Aee;mt.isTypeValidImplementation=qT;mt.isNodeDataInaccessible=sB;mt.isLeafKind=Ree;mt.getSubscriptionFilterValue=Pee;mt.getParentTypeName=Fee;mt.newConditionalFieldData=Lee;mt.getDefinitionDataCoords=wee;mt.isParentDataCompositeOutputType=Cee;mt.newExternalFieldData=Uee;mt.getInitialFederatedDescription=Bee;mt.areKindsEqual=kee;mt.isFieldData=hS;mt.isInputObjectDefinitionData=Mee;mt.isInputNodeKind=xee;mt.isOutputNodeKind=qee;mt.isInterfaceNode=Vee;mt.isEnumData=Kee;var et=Oe(),mS=tf(),Zl=kr(),TS=Ji(),Gt=Zn(),Uc=Mr(),aee=xT();function see(){return{deprecatedReason:"",directivesByName:new Map,isDeprecated:!1,tagDirectiveByName:new Map}}function oee(e,t,n){var i;let r={isExternal:n.has(Gt.EXTERNAL),isShareable:t||n.has(Gt.SHAREABLE)};if(!((i=e.directives)!=null&&i.length))return r;for(let a of e.directives){let o=a.name.value;if(o===Gt.EXTERNAL){r.isExternal=!0;continue}o===Gt.SHAREABLE&&(r.isShareable=!0)}return r}function uee(e){return e.kind===et.Kind.NON_NULL_TYPE}function nB(e){switch(e.kind){case et.Kind.LIST_TYPE:return!0;case et.Kind.NON_NULL_TYPE:return nB(e.type);default:return!1}}function rB(e,t){switch(e.kind){case et.Kind.LIST_TYPE:return t.kind===et.Kind.LIST||t.kind===et.Kind.NULL;case et.Kind.NAMED_TYPE:if(t.kind===et.Kind.NULL)return!0;switch(e.name.value){case Gt.BOOLEAN_SCALAR:return t.kind===et.Kind.BOOLEAN;case Gt.FLOAT_SCALAR:return t.kind===et.Kind.INT||t.kind===et.Kind.FLOAT;case Gt.INT_SCALAR:return t.kind===et.Kind.INT;case Gt.STRING_SCALAR:return t.kind===et.Kind.STRING;default:return!0}case et.Kind.NON_NULL_TYPE:return t.kind===et.Kind.NULL?!1:rB(e.type,t)}}function cee(e,t,n){if(!e.defaultValue)return;if(!t.defaultValue){e.includeDefaultValue=!1;return}let r=(0,et.print)(e.defaultValue),i=(0,et.print)(t.defaultValue);if(r!==i){n.push((0,TS.incompatibleInputValueDefaultValuesError)(`${e.isArgument?Gt.ARGUMENT:Gt.INPUT_FIELD} "${e.name}"`,e.originalCoords,[...t.subgraphNames],r,i));return}}function lee(e,t){let n=new Set;for(let r of t)e.executableLocations.has(r)&&n.add(r);e.executableLocations=n}function dee(e,t){return Gt.ROOT_TYPE_NAMES.has(e)||t.has(e)}function pee(e,t){let n=t.get(e);if(!n)return e;switch(n){case et.OperationTypeNode.MUTATION:return Gt.MUTATION;case et.OperationTypeNode.SUBSCRIPTION:return Gt.SUBSCRIPTION;default:return Gt.QUERY}}function fee(e){for(let t of e.argumentDataByName.values()){for(let n of t.directivesByName.values())t.node.directives.push(...n);e.node.arguments.push(t.node)}}function mee(e){var n;let t=[];for(let r of e.values()){hS(r)&&fee(r);for(let[i,a]of r.directivesByName){if(i===Gt.DEPRECATED){let o=a[0];if(!o)continue;if((n=o.arguments)!=null&&n.length){r.node.directives.push(o);continue}r.node.directives.push(W(q({},o),{arguments:[{kind:et.Kind.ARGUMENT,value:{kind:et.Kind.STRING,value:et.DEFAULT_DEPRECATION_REASON},name:(0,Zl.stringToNameNode)(Gt.REASON)}]}));continue}r.node.directives.push(...a)}t.push(r.node)}return t}function Nee(e,t){if(t.description){if("configureDescriptionDataBySubgraphName"in t){for(let{propagate:n}of t.configureDescriptionDataBySubgraphName.values())if(!n)return}(!e.description||e.description.value.length0&&e.persistedDirectivesData.directivesByName.set(Gt.REQUIRES_SCOPES,[(0,Uc.generateRequiresScopesDirective)(t.requiredScopes)]))}function gee(e,t){if(!t)return;let n=t.fieldAuthDataByFieldName.get(e.name);n&&(n.originalData.requiresAuthentication&&e.persistedDirectivesData.directivesByName.set(Gt.AUTHENTICATED,[(0,Uc.generateSimpleDirective)(Gt.AUTHENTICATED)]),n.originalData.requiredScopes.length>0&&e.persistedDirectivesData.directivesByName.set(Gt.REQUIRES_SCOPES,[(0,Uc.generateRequiresScopesDirective)(n.originalData.requiredScopes)]))}function ES(e){return{kind:et.Kind.DIRECTIVE,name:(0,Zl.stringToNameNode)(Gt.DEPRECATED),arguments:[{kind:et.Kind.ARGUMENT,name:(0,Zl.stringToNameNode)(Gt.REASON),value:{kind:et.Kind.STRING,value:e||Gt.DEPRECATED_DEFAULT_ARGUMENT_VALUE}}]}}function _ee(e,t,n,r){let i=[];for(let[a,o]of e){let u=t.get(a);if(u){if(o.length<2){i.push(...o);continue}if(!u.repeatable){r.push((0,TS.invalidRepeatedFederatedDirectiveErrorMessage)(a,n));continue}i.push(...o)}}return i}function vee(e,t,n){let r=[...e.persistedDirectivesData.tagDirectiveByName.values()];return e.persistedDirectivesData.isDeprecated&&r.push(ES(e.persistedDirectivesData.deprecatedReason)),r.push(..._ee(e.persistedDirectivesData.directivesByName,t,e.name,n)),r}function NS(e){var n;let t=[];e.persistedDirectivesData.isDeprecated&&t.push(ES(e.persistedDirectivesData.deprecatedReason));for(let[r,i]of e.persistedDirectivesData.directivesByName){if(r===Gt.SEMANTIC_NON_NULL&&hS(e)){t.push((0,Uc.generateSemanticNonNullDirective)((n=(0,Uc.getFirstEntry)(e.nullLevelsBySubgraphName))!=null?n:new Set([0])));continue}Gt.PERSISTED_CLIENT_DIRECTIVES.has(r)&&t.push(i[0])}return t}function See(e){let t=NS(e),n=[];for(let r of e.argumentDataByName.values())sB(r)||n.push(W(q({},r.node),{directives:NS(r)}));return W(q({},e.node),{directives:t,arguments:n})}function aB(e,t,n){return e.node.name=(0,Zl.stringToNameNode)(e.name),e.node.type=e.type,e.node.description=e.description,e.node.directives=vee(e,t,n),e.includeDefaultValue&&(e.node.defaultValue=e.defaultValue),e.node}function Oee(e,t,n,r,i){let a=[];for(let[o,u]of t.argumentDataByName){let l=(0,Uc.getEntriesNotInHashSet)(t.subgraphNames,u.subgraphNames);if(l.length>0){u.requiredSubgraphNames.size>0&&a.push({inputValueName:o,missingSubgraphs:l,requiredSubgraphs:[...u.requiredSubgraphNames]});continue}e.push(aB(u,n,r)),i&&i.add(o)}return a.length>0?(r.push((0,TS.invalidRequiredInputValueError)(Gt.DIRECTIVE_DEFINITION,`@${t.name}`,a)),!1):!0}function Dee(e,t,n,r){let i=[];Oee(i,t,n,r)&&e.push({arguments:i,kind:et.Kind.DIRECTIVE_DEFINITION,locations:(0,Zl.setToNameNodeArray)(t.executableLocations),name:(0,Zl.stringToNameNode)(t.name),repeatable:t.repeatable,description:t.description})}function bee(){return{byShareable:new Set,subgraphNamesByExternalFieldName:new Map}}function Aee(e,t){let n=e.isShareableBySubgraphName.size,r=new Array,i=0;for(let[a,o]of e.isShareableBySubgraphName){let u=e.externalFieldDataBySubgraphName.get(a);if(u&&!u.isUnconditionallyProvided){r.push(a);continue}o||(i+=1)}switch(i){case 0:n===r.length&&t.subgraphNamesByExternalFieldName.set(e.name,r);return;case 1:if(n===1)return;n-r.length!==1&&t.byShareable.add(e.name);return;default:t.byShareable.add(e.name)}}var tB;(function(e){e[e.UNION=0]="UNION",e[e.INTERSECTION=1]="INTERSECTION",e[e.CONSISTENT=2]="CONSISTENT"})(tB||(mt.MergeMethod=tB={}));function qT({concreteTypeNamesByAbstractTypeName:e,implementationType:t,interfaceImplementationTypeNamesByInterfaceTypeName:n,originalType:r}){if(r.kind===et.Kind.NON_NULL_TYPE)return t.kind!==et.Kind.NON_NULL_TYPE?!1:qT({concreteTypeNamesByAbstractTypeName:e,implementationType:t.type,interfaceImplementationTypeNamesByInterfaceTypeName:n,originalType:r.type});if(t.kind===et.Kind.NON_NULL_TYPE)return qT({concreteTypeNamesByAbstractTypeName:e,implementationType:t.type,interfaceImplementationTypeNamesByInterfaceTypeName:n,originalType:r});switch(r.kind){case et.Kind.NAMED_TYPE:if(t.kind===et.Kind.NAMED_TYPE){let i=r.name.value,a=t.name.value;if(i===a)return!0;let o=n.get(i),u=e.get(i);return!!(u!=null&&u.has(a)||o!=null&&o.has(a))}return!1;default:return t.kind===et.Kind.LIST_TYPE?qT({concreteTypeNamesByAbstractTypeName:e,implementationType:t.type,interfaceImplementationTypeNamesByInterfaceTypeName:n,originalType:r.type}):!1}}function sB(e){return e.persistedDirectivesData.directivesByName.has(Gt.INACCESSIBLE)||e.directivesByName.has(Gt.INACCESSIBLE)}function Ree(e){return e===et.Kind.SCALAR_TYPE_DEFINITION||e===et.Kind.ENUM_TYPE_DEFINITION}function Pee(e){switch(e.kind){case et.Kind.BOOLEAN:return e.value;case et.Kind.ENUM:case et.Kind.STRING:return e.value;case et.Kind.FLOAT:case et.Kind.INT:try{return parseFloat(e.value)}catch(t){return"NaN"}case et.Kind.NULL:return null}}function Fee(e){return e.kind===et.Kind.OBJECT_TYPE_DEFINITION&&e.renamedTypeName||e.name}function Lee(){return{providedBy:[],requiredBy:[]}}function wee(e,t){switch(e.kind){case et.Kind.ENUM_VALUE_DEFINITION:return`${e.parentTypeName}.${e.name}`;case et.Kind.FIELD_DEFINITION:return`${t?e.renamedParentTypeName:e.originalParentTypeName}.${e.name}`;case et.Kind.ARGUMENT:case et.Kind.INPUT_VALUE_DEFINITION:return t?e.federatedCoords:e.originalCoords;case et.Kind.OBJECT_TYPE_DEFINITION:return t?e.renamedTypeName:e.name;default:return e.name}}function Cee(e){return e.kind===et.Kind.OBJECT_TYPE_DEFINITION||e.kind===et.Kind.INTERFACE_TYPE_DEFINITION}function Uee(e){return{isDefinedExternal:e,isUnconditionallyProvided:!e}}function Bee(e){let{value:t,done:n}=e.configureDescriptionDataBySubgraphName.values().next();if(n)return e.description;if(t.propagate)return(0,aee.getDescriptionFromString)(t.description)||e.description}function kee(e,t){return e.kind===t.kind}function hS(e){return e.kind===et.Kind.FIELD_DEFINITION}function Mee(e){return e.kind===et.Kind.INPUT_OBJECT_TYPE_DEFINITION}function xee(e){return Gt.INPUT_NODE_KINDS.has(e)}function qee(e){return Gt.OUTPUT_NODE_KINDS.has(e)}function Vee(e){return Gt.INTERFACE_NODE_KINDS.has(e.kind)}function Kee(e){return e.kind===et.Kind.ENUM_TYPE_DEFINITION}});var gS={};lN(gS,{__addDisposableResource:()=>bB,__assign:()=>VT,__asyncDelegator:()=>yB,__asyncGenerator:()=>hB,__asyncValues:()=>IB,__await:()=>td,__awaiter:()=>pB,__classPrivateFieldGet:()=>SB,__classPrivateFieldIn:()=>DB,__classPrivateFieldSet:()=>OB,__createBinding:()=>jT,__decorate:()=>cB,__disposeResources:()=>AB,__esDecorate:()=>jee,__exportStar:()=>mB,__extends:()=>oB,__generator:()=>fB,__importDefault:()=>vB,__importStar:()=>_B,__makeTemplateObject:()=>gB,__metadata:()=>dB,__param:()=>lB,__propKey:()=>Gee,__read:()=>IS,__rest:()=>uB,__runInitializers:()=>$ee,__setFunctionName:()=>Qee,__spread:()=>NB,__spreadArray:()=>EB,__spreadArrays:()=>TB,__values:()=>KT,default:()=>Hee});function oB(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");yS(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function uB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function lB(e,t){return function(n,r){t(n,r,e)}}function jee(e,t,n,r,i,a){function o(K){if(K!==void 0&&typeof K!="function")throw new TypeError("Function expected");return K}for(var u=r.kind,l=u==="getter"?"get":u==="setter"?"set":"value",d=!t&&e?r.static?e:e.prototype:null,p=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),E,h=!1,_=n.length-1;_>=0;_--){var S={};for(var k in r)S[k]=k==="access"?{}:r[k];for(var k in r.access)S.access[k]=r.access[k];S.addInitializer=function(K){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(K||null))};var B=(0,n[_])(u==="accessor"?{get:p.get,set:p.set}:p[l],S);if(u==="accessor"){if(B===void 0)continue;if(B===null||typeof B!="object")throw new TypeError("Object expected");(E=o(B.get))&&(p.get=E),(E=o(B.set))&&(p.set=E),(E=o(B.init))&&i.unshift(E)}else(E=o(B))&&(u==="field"?i.unshift(E):p[l]=E)}d&&Object.defineProperty(d,r.name,p),h=!0}function $ee(e,t,n){for(var r=arguments.length>2,i=0;i0&&a[a.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function IS(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function NB(){for(var e=[],t=0;t1||u(h,_)})})}function u(h,_){try{l(r[h](_))}catch(S){E(a[0][3],S)}}function l(h){h.value instanceof td?Promise.resolve(h.value.v).then(d,p):E(a[0][2],h)}function d(h){u("next",h)}function p(h){u("throw",h)}function E(h,_){h(_),a.shift(),a.length&&u(a[0][0],a[0][1])}}function yB(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,a){t[i]=e[i]?function(o){return(n=!n)?{value:td(e[i](o)),done:!1}:a?a(o):o}:a}}function IB(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof KT=="function"?KT(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(o){return new Promise(function(u,l){o=e[a](o),i(u,l,o.done,o.value)})}}function i(a,o,u,l){Promise.resolve(l).then(function(d){a({value:d,done:u})},o)}}function gB(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function _B(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&jT(t,e,n);return Yee(t,e),t}function vB(e){return e&&e.__esModule?e:{default:e}}function SB(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function OB(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n}function DB(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function bB(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose]}if(typeof r!="function")throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}function AB(e){function t(r){e.error=e.hasError?new Jee(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}function n(){for(;e.stack.length;){var r=e.stack.pop();try{var i=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(i).then(n,function(a){return t(a),n()})}catch(a){t(a)}}if(e.hasError)throw e.error}return n()}var yS,VT,jT,Yee,Jee,Hee,_S=lc(()=>{"use strict";m();T();N();yS=function(e,t){return yS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},yS(e,t)};VT=function(){return VT=Object.assign||function(t){for(var n,r=1,i=arguments.length;rZB,__assign:()=>$T,__asyncDelegator:()=>GB,__asyncGenerator:()=>$B,__asyncValues:()=>QB,__await:()=>nd,__awaiter:()=>MB,__classPrivateFieldGet:()=>zB,__classPrivateFieldIn:()=>XB,__classPrivateFieldSet:()=>WB,__createBinding:()=>QT,__decorate:()=>FB,__disposeResources:()=>ek,__esDecorate:()=>wB,__exportStar:()=>qB,__extends:()=>RB,__generator:()=>xB,__importDefault:()=>HB,__importStar:()=>JB,__makeTemplateObject:()=>YB,__metadata:()=>kB,__param:()=>LB,__propKey:()=>UB,__read:()=>OS,__rest:()=>PB,__rewriteRelativeImportExtension:()=>tk,__runInitializers:()=>CB,__setFunctionName:()=>BB,__spread:()=>VB,__spreadArray:()=>jB,__spreadArrays:()=>KB,__values:()=>GT,default:()=>Xee});function RB(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");vS(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function PB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function LB(e,t){return function(n,r){t(n,r,e)}}function wB(e,t,n,r,i,a){function o(K){if(K!==void 0&&typeof K!="function")throw new TypeError("Function expected");return K}for(var u=r.kind,l=u==="getter"?"get":u==="setter"?"set":"value",d=!t&&e?r.static?e:e.prototype:null,p=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),E,h=!1,_=n.length-1;_>=0;_--){var S={};for(var k in r)S[k]=k==="access"?{}:r[k];for(var k in r.access)S.access[k]=r.access[k];S.addInitializer=function(K){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(K||null))};var B=(0,n[_])(u==="accessor"?{get:p.get,set:p.set}:p[l],S);if(u==="accessor"){if(B===void 0)continue;if(B===null||typeof B!="object")throw new TypeError("Object expected");(E=o(B.get))&&(p.get=E),(E=o(B.set))&&(p.set=E),(E=o(B.init))&&i.unshift(E)}else(E=o(B))&&(u==="field"?i.unshift(E):p[l]=E)}d&&Object.defineProperty(d,r.name,p),h=!0}function CB(e,t,n){for(var r=arguments.length>2,i=0;i0&&a[a.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function OS(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function VB(){for(var e=[],t=0;t1||l(_,k)})},S&&(i[_]=S(i[_])))}function l(_,S){try{d(r[_](S))}catch(k){h(a[0][3],k)}}function d(_){_.value instanceof nd?Promise.resolve(_.value.v).then(p,E):h(a[0][2],_)}function p(_){l("next",_)}function E(_){l("throw",_)}function h(_,S){_(S),a.shift(),a.length&&l(a[0][0],a[0][1])}}function GB(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,a){t[i]=e[i]?function(o){return(n=!n)?{value:nd(e[i](o)),done:!1}:a?a(o):o}:a}}function QB(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof GT=="function"?GT(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(o){return new Promise(function(u,l){o=e[a](o),i(u,l,o.done,o.value)})}}function i(a,o,u,l){Promise.resolve(l).then(function(d){a({value:d,done:u})},o)}}function YB(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function JB(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=SS(e),r=0;r{"use strict";m();T();N();vS=function(e,t){return vS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},vS(e,t)};$T=function(){return $T=Object.assign||function(t){for(var n,r=1,i=arguments.length;r{"use strict";m();T();N()});var rd=F(zi=>{"use strict";m();T();N();Object.defineProperty(zi,"__esModule",{value:!0});zi.asArray=void 0;zi.isUrl=ak;zi.isDocumentString=rte;zi.isValidPath=ate;zi.compareStrings=sk;zi.nodeToString=DS;zi.compareNodes=ste;zi.isSome=ote;zi.assertSome=ute;var Zee=Oe(),ete=/^(https?|wss?|file):\/\//;function ak(e){if(typeof e!="string"||!ete.test(e))return!1;if(URL.canParse)return URL.canParse(e);try{return!!new URL(e)}catch(t){return!1}}var tte=e=>Array.isArray(e)?e:e?[e]:[];zi.asArray=tte;var nte=/\.[a-z0-9]+$/i;function rte(e){if(typeof e!="string"||nte.test(e)||ak(e))return!1;try{return(0,Zee.parse)(e),!0}catch(t){if(!t.message.includes("EOF")&&e.replace(/(\#[^*]*)/g,"").trim()!==""&&e.includes(" "))throw new Error(`Failed to parse the GraphQL document. ${t.message} +${e}`)}return!1}var ite=/[‘“!%^<>`\n]/;function ate(e){return typeof e=="string"&&!ite.test(e)}function sk(e,t){return String(e)String(t)?1:0}function DS(e){var n,r;let t;return"alias"in e&&(t=(n=e.alias)==null?void 0:n.value),t==null&&"name"in e&&(t=(r=e.name)==null?void 0:r.value),t==null&&(t=e.kind),t}function ste(e,t,n){let r=DS(e),i=DS(t);return typeof n=="function"?n(r,i):sk(r,i)}function ote(e){return e!=null}function ute(e,t="Value should be something"){if(e==null)throw new Error(t)}});var rf=F(JT=>{"use strict";m();T();N();Object.defineProperty(JT,"__esModule",{value:!0});JT.inspect=void 0;var ck=3;function cte(e){return YT(e,[])}JT.inspect=cte;function YT(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return lte(e,t);default:return String(e)}}function ok(e){return(e.name="GraphQLError")?e.toString():`${e.name}: ${e.message}; + ${e.stack}`}function lte(e,t){if(e===null)return"null";if(e instanceof Error)return e.name==="AggregateError"?ok(e)+` +`+uk(e.errors,t):ok(e);if(t.includes(e))return"[Circular]";let n=[...t,e];if(dte(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:YT(r,n)}else if(Array.isArray(e))return uk(e,n);return pte(e,n)}function dte(e){return typeof e.toJSON=="function"}function pte(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>ck?"["+fte(e)+"]":"{ "+n.map(([i,a])=>i+": "+YT(a,t)).join(", ")+" }"}function uk(e,t){if(e.length===0)return"[]";if(t.length>ck)return"[Array]";let n=e.length,r=[];for(let i=0;i{"use strict";m();T();N();Object.defineProperty(HT,"__esModule",{value:!0});HT.createGraphQLError=AS;HT.relocatedError=Tte;var bS=Oe(),mte=["message","locations","path","nodes","source","positions","originalError","name","stack","extensions"];function Nte(e){return e!=null&&typeof e=="object"&&Object.keys(e).every(t=>mte.includes(t))}function AS(e,t){return t!=null&&t.originalError&&!(t.originalError instanceof Error)&&Nte(t.originalError)&&(t.originalError=AS(t.originalError.message,t.originalError)),bS.versionInfo.major>=17?new bS.GraphQLError(e,t):new bS.GraphQLError(e,t==null?void 0:t.nodes,t==null?void 0:t.source,t==null?void 0:t.positions,t==null?void 0:t.path,t==null?void 0:t.originalError,t==null?void 0:t.extensions)}function Tte(e,t){return AS(e.message,{nodes:e.nodes,source:e.source,positions:e.positions,path:t==null?e.path:t,originalError:e,extensions:e.extensions})}});var af=F(li=>{"use strict";m();T();N();Object.defineProperty(li,"__esModule",{value:!0});li.isPromise=WT;li.isActualPromise=dk;li.handleMaybePromise=Mu;li.fakePromise=ts;li.createDeferredPromise=Ete;li.iterateAsync=pk;li.iterateAsyncVoid=pk;li.fakeRejectPromise=Bc;li.mapMaybePromise=hte;li.mapAsyncIterator=yte;li.promiseLikeFinally=fk;li.unfakePromise=mk;var XT=Symbol.for("@whatwg-node/promise-helpers/FakePromise");function WT(e){return(e==null?void 0:e.then)!=null}function dk(e){let t=e;return t&&t.then&&t.catch&&t.finally}function Mu(e,t,n,r){let i=ts().then(e).then(t,n);return r&&(i=i.finally(r)),mk(i)}function ts(e){return e&&dk(e)?e:WT(e)?{then:(t,n)=>ts(e.then(t,n)),catch:t=>ts(e.then(n=>n,t)),finally:t=>ts(t?fk(e,t):e),[Symbol.toStringTag]:"Promise"}:{then(t){if(t)try{return ts(t(e))}catch(n){return Bc(n)}return this},catch(){return this},finally(t){if(t)try{return ts(t()).then(()=>e,()=>e)}catch(n){return Bc(n)}return this},[Symbol.toStringTag]:"Promise",__fakePromiseValue:e,[XT]:"resolved"}}function Ete(){if(Promise.withResolvers)return Promise.withResolvers();let e,t;return{promise:new Promise(function(i,a){e=i,t=a}),get resolve(){return e},get reject(){return t}}}function pk(e,t,n){if((e==null?void 0:e.length)===0)return;let r=e[Symbol.iterator](),i=0;function a(){let{done:o,value:u}=r.next();if(o)return;let l=!1;function d(){l=!0}return Mu(function(){return t(u,d,i++)},function(E){if(E&&(n==null||n.push(E)),!l)return a()})}return a()}function Bc(e){return{then(t,n){if(n)try{return ts(n(e))}catch(r){return Bc(r)}return this},catch(t){if(t)try{return ts(t(e))}catch(n){return Bc(n)}return this},finally(t){if(t)try{t()}catch(n){return Bc(n)}return this},__fakeRejectError:e,[Symbol.toStringTag]:"Promise",[XT]:"rejected"}}function hte(e,t,n){return Mu(()=>e,t,n)}function yte(e,t,n,r){Symbol.asyncIterator in e&&(e=e[Symbol.asyncIterator]());let i,a,o;if(r){let d;o=p=>(d||(d=Mu(r,()=>p,()=>p)),d)}typeof e.return=="function"&&(i=e.return,a=d=>{let p=()=>{throw d};return i.call(e).then(p,p)});function u(d){return d.done?o?o(d):d:Mu(()=>d.value,p=>Mu(()=>t(p),lk,a))}let l;if(n){let d,p=n;l=E=>(d||(d=Mu(()=>E,h=>Mu(()=>p(h),lk,a))),d)}return{next(){return e.next().then(u,l)},return(){let d=i?i.call(e).then(u,l):ts({value:void 0,done:!0});return o?d.then(o):d},throw(d){return typeof e.throw=="function"?e.throw(d).then(u,l):a?a(d):Bc(d)},[Symbol.asyncIterator](){return this}}}function lk(e){return{value:e,done:!1}}function Ite(e){return(e==null?void 0:e[XT])==="resolved"}function gte(e){return(e==null?void 0:e[XT])==="rejected"}function fk(e,t){return"finally"in e?e.finally(t):e.then(n=>{let r=t();return WT(r)?r.then(()=>n):n},n=>{let r=t();if(WT(r))return r.then(()=>{throw n});throw n})}function mk(e){if(Ite(e))return e.__fakePromiseValue;if(gte(e))throw e.__fakeRejectError;return e}});var ZT=F(xu=>{"use strict";m();T();N();Object.defineProperty(xu,"__esModule",{value:!0});xu.isPromise=void 0;xu.isIterableObject=_te;xu.isObjectLike=vte;xu.promiseReduce=Ste;xu.hasOwnProperty=Ote;var Nk=af();Object.defineProperty(xu,"isPromise",{enumerable:!0,get:function(){return Nk.isPromise}});function _te(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e}function vte(e){return typeof e=="object"&&e!==null}function Ste(e,t,n){let r=n;for(let i of e)r=(0,Nk.handleMaybePromise)(()=>r,a=>t(a,i));return r}function Ote(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var FS=F(PS=>{"use strict";m();T();N();Object.defineProperty(PS,"__esModule",{value:!0});PS.getArgumentValues=bte;var RS=rf(),kc=Oe(),eE=zT(),Dte=ZT();function bte(e,t,n={}){var o;let r={},a=((o=t.arguments)!=null?o:[]).reduce((u,l)=>W(q({},u),{[l.name.value]:l}),{});for(let{name:u,type:l,defaultValue:d}of e.args){let p=a[u];if(!p){if(d!==void 0)r[u]=d;else if((0,kc.isNonNullType)(l))throw(0,eE.createGraphQLError)(`Argument "${u}" of required type "${(0,RS.inspect)(l)}" was not provided.`,{nodes:[t]});continue}let E=p.value,h=E.kind===kc.Kind.NULL;if(E.kind===kc.Kind.VARIABLE){let S=E.name.value;if(n==null||!(0,Dte.hasOwnProperty)(n,S)){if(d!==void 0)r[u]=d;else if((0,kc.isNonNullType)(l))throw(0,eE.createGraphQLError)(`Argument "${u}" of required type "${(0,RS.inspect)(l)}" was provided the variable "$${S}" which was not provided a runtime value.`,{nodes:[E]});continue}h=n[S]==null}if(h&&(0,kc.isNonNullType)(l))throw(0,eE.createGraphQLError)(`Argument "${u}" of non-null type "${(0,RS.inspect)(l)}" must not be null.`,{nodes:[E]});let _=(0,kc.valueFromAST)(E,l,n);if(_===void 0)throw(0,eE.createGraphQLError)(`Argument "${u}" has invalid value ${(0,kc.print)(E)}.`,{nodes:[E]});r[u]=_}return r}});var qu=F(Us=>{"use strict";m();T();N();Object.defineProperty(Us,"__esModule",{value:!0});Us.memoize1=Ate;Us.memoize2=Rte;Us.memoize3=Pte;Us.memoize4=Fte;Us.memoize5=Lte;Us.memoize2of4=wte;Us.memoize2of5=Cte;function Ate(e){let t=new WeakMap;return function(r){let i=t.get(r);if(i===void 0){let a=e(r);return t.set(r,a),a}return i}}function Rte(e){let t=new WeakMap;return function(r,i){let a=t.get(r);if(!a){a=new WeakMap,t.set(r,a);let u=e(r,i);return a.set(i,u),u}let o=a.get(i);if(o===void 0){let u=e(r,i);return a.set(i,u),u}return o}}function Pte(e){let t=new WeakMap;return function(r,i,a){let o=t.get(r);if(!o){o=new WeakMap,t.set(r,o);let d=new WeakMap;o.set(i,d);let p=e(r,i,a);return d.set(a,p),p}let u=o.get(i);if(!u){u=new WeakMap,o.set(i,u);let d=e(r,i,a);return u.set(a,d),d}let l=u.get(a);if(l===void 0){let d=e(r,i,a);return u.set(a,d),d}return l}}function Fte(e){let t=new WeakMap;return function(r,i,a,o){let u=t.get(r);if(!u){u=new WeakMap,t.set(r,u);let E=new WeakMap;u.set(i,E);let h=new WeakMap;E.set(a,h);let _=e(r,i,a,o);return h.set(o,_),_}let l=u.get(i);if(!l){l=new WeakMap,u.set(i,l);let E=new WeakMap;l.set(a,E);let h=e(r,i,a,o);return E.set(o,h),h}let d=l.get(a);if(!d){let E=new WeakMap;l.set(a,E);let h=e(r,i,a,o);return E.set(o,h),h}let p=d.get(o);if(p===void 0){let E=e(r,i,a,o);return d.set(o,E),E}return p}}function Lte(e){let t=new WeakMap;return function(r,i,a,o,u){let l=t.get(r);if(!l){l=new WeakMap,t.set(r,l);let _=new WeakMap;l.set(i,_);let S=new WeakMap;_.set(a,S);let k=new WeakMap;S.set(o,k);let B=e(r,i,a,o,u);return k.set(u,B),B}let d=l.get(i);if(!d){d=new WeakMap,l.set(i,d);let _=new WeakMap;d.set(a,_);let S=new WeakMap;_.set(o,S);let k=e(r,i,a,o,u);return S.set(u,k),k}let p=d.get(a);if(!p){p=new WeakMap,d.set(a,p);let _=new WeakMap;p.set(o,_);let S=e(r,i,a,o,u);return _.set(u,S),S}let E=p.get(o);if(!E){E=new WeakMap,p.set(o,E);let _=e(r,i,a,o,u);return E.set(u,_),_}let h=E.get(u);if(h===void 0){let _=e(r,i,a,o,u);return E.set(u,_),_}return h}}function wte(e){let t=new WeakMap;return function(r,i,a,o){let u=t.get(r);if(!u){u=new WeakMap,t.set(r,u);let d=e(r,i,a,o);return u.set(i,d),d}let l=u.get(i);if(l===void 0){let d=e(r,i,a,o);return u.set(i,d),d}return l}}function Cte(e){let t=new WeakMap;return function(r,i,a,o,u){let l=t.get(r);if(!l){l=new WeakMap,t.set(r,l);let p=e(r,i,a,o,u);return l.set(i,p),p}let d=l.get(i);if(d===void 0){let p=e(r,i,a,o,u);return l.set(i,p),p}return d}}});var wS=F(LS=>{"use strict";m();T();N();Object.defineProperty(LS,"__esModule",{value:!0});LS.getDirectiveExtensions=kte;var Tk=Oe(),Ute=FS(),Bte=qu();function kte(e,t,n=["directives"]){var o;let r={};if(e.extensions){let u=e.extensions;for(let l of n)u=u==null?void 0:u[l];if(u!=null)for(let l in u){let d=u[l],p=l;if(Array.isArray(d))for(let E of d){let h=r[p];h||(h=[],r[p]=h),h.push(E)}else{let E=r[p];E||(E=[],r[p]=E),E.push(d)}}}let i=(0,Bte.memoize1)(u=>JSON.stringify(u)),a=[];e.astNode&&a.push(e.astNode),e.extensionASTNodes&&a.push(...e.extensionASTNodes);for(let u of a)if((o=u.directives)!=null&&o.length)for(let l of u.directives){let d=l.name.value,p=r[d];p||(p=[],r[d]=p);let E=t==null?void 0:t.getDirective(d),h={};if(E&&(h=(0,Ute.getArgumentValues)(E,l)),l.arguments)for(let _ of l.arguments){let S=_.name.value;if(h[S]==null){let k=E==null?void 0:E.args.find(B=>B.name===S);k&&(h[S]=(0,Tk.valueFromAST)(_.value,k.type))}h[S]==null&&(h[S]=(0,Tk.valueFromASTUntyped)(_.value))}if(a.length>0&&p.length>0){let _=i(h);if(p.some(S=>i(S)===_))continue}p.push(h)}return r}});var CS=F(id=>{"use strict";m();T();N();Object.defineProperty(id,"__esModule",{value:!0});id.getDirectivesInExtensions=Mte;id.getDirectiveInExtensions=xte;id.getDirectives=qte;id.getDirective=Vte;var tE=wS();function Mte(e,t=["directives"]){let n=(0,tE.getDirectiveExtensions)(e,void 0,t);return Object.entries(n).map(([r,i])=>i==null?void 0:i.map(a=>({name:r,args:a}))).flat(1/0).filter(Boolean)}function xte(e,t,n=["directives"]){return(0,tE.getDirectiveExtensions)(e,void 0,n)[t]}function qte(e,t,n=["directives"]){let r=(0,tE.getDirectiveExtensions)(t,e,n);return Object.entries(r).map(([i,a])=>a==null?void 0:a.map(o=>({name:i,args:o}))).flat(1/0).filter(Boolean)}function Vte(e,t,n,r=["directives"]){return(0,tE.getDirectiveExtensions)(t,e,r)[n]}});var BS=F(US=>{"use strict";m();T();N();Object.defineProperty(US,"__esModule",{value:!0});US.getFieldsWithDirectives=jte;var Kte=Oe();function jte(e,t={}){let n={},r=["ObjectTypeDefinition","ObjectTypeExtension"];t.includeInputTypes&&(r=[...r,"InputObjectTypeDefinition","InputObjectTypeExtension"]);let i=e.definitions.filter(a=>r.includes(a.kind));for(let a of i){let o=a.name.value;if(a.fields!=null){for(let u of a.fields)if(u.directives&&u.directives.length>0){let l=u.name.value,d=`${o}.${l}`,p=u.directives.map(E=>({name:E.name.value,args:(E.arguments||[]).reduce((h,_)=>W(q({},h),{[_.name.value]:(0,Kte.valueFromASTUntyped)(_.value)}),{})}));n[d]=p}}}return n}});var Ek=F(MS=>{"use strict";m();T();N();Object.defineProperty(MS,"__esModule",{value:!0});MS.getArgumentsWithDirectives=Gte;var kS=Oe();function $te(e){return e.kind===kS.Kind.OBJECT_TYPE_DEFINITION||e.kind===kS.Kind.OBJECT_TYPE_EXTENSION}function Gte(e){var r;let t={},n=e.definitions.filter($te);for(let i of n)if(i.fields!=null)for(let a of i.fields){let o=(r=a.arguments)==null?void 0:r.filter(l=>{var d;return(d=l.directives)==null?void 0:d.length});if(!(o!=null&&o.length))continue;let u=t[`${i.name.value}.${a.name.value}`]={};for(let l of o){let d=l.directives.map(p=>({name:p.name.value,args:(p.arguments||[]).reduce((E,h)=>W(q({},E),{[h.name.value]:(0,kS.valueFromASTUntyped)(h.value)}),{})}));u[l.name.value]=d}}return t}});var qS=F(xS=>{"use strict";m();T();N();Object.defineProperty(xS,"__esModule",{value:!0});xS.getImplementingTypes=Qte;function Qte(e,t){let n=t.getTypeMap(),r=[];for(let i in n){let a=n[i];"getInterfaces"in a&&a.getInterfaces().find(u=>u.name===e)&&r.push(a.name)}return r}});var nE=F(KS=>{"use strict";m();T();N();Object.defineProperty(KS,"__esModule",{value:!0});KS.astFromType=VS;var Yte=rf(),Mc=Oe();function VS(e){if((0,Mc.isNonNullType)(e)){let t=VS(e.ofType);if(t.kind===Mc.Kind.NON_NULL_TYPE)throw new Error(`Invalid type node ${(0,Yte.inspect)(e)}. Inner type of non-null type cannot be a non-null type.`);return{kind:Mc.Kind.NON_NULL_TYPE,type:t}}else if((0,Mc.isListType)(e))return{kind:Mc.Kind.LIST_TYPE,type:VS(e.ofType)};return{kind:Mc.Kind.NAMED_TYPE,name:{kind:Mc.Kind.NAME,value:e.name}}}});var sf=F(jS=>{"use strict";m();T();N();Object.defineProperty(jS,"__esModule",{value:!0});jS.astFromValueUntyped=rE;var ns=Oe();function rE(e){if(e===null)return{kind:ns.Kind.NULL};if(e===void 0)return null;if(Array.isArray(e)){let t=[];for(let n of e){let r=rE(n);r!=null&&t.push(r)}return{kind:ns.Kind.LIST,values:t}}if(typeof e=="object"){if(e!=null&&e.toJSON)return rE(e.toJSON());let t=[];for(let n in e){let r=e[n],i=rE(r);i&&t.push({kind:ns.Kind.OBJECT_FIELD,name:{kind:ns.Kind.NAME,value:n},value:i})}return{kind:ns.Kind.OBJECT,fields:t}}if(typeof e=="boolean")return{kind:ns.Kind.BOOLEAN,value:e};if(typeof e=="bigint")return{kind:ns.Kind.INT,value:String(e)};if(typeof e=="number"&&isFinite(e)){let t=String(e);return Jte.test(t)?{kind:ns.Kind.INT,value:t}:{kind:ns.Kind.FLOAT,value:t}}if(typeof e=="string")return{kind:ns.Kind.STRING,value:e};throw new TypeError(`Cannot convert value to AST: ${e}.`)}var Jte=/^-?(?:0|[1-9][0-9]*)$/});var yk=F($S=>{"use strict";m();T();N();Object.defineProperty($S,"__esModule",{value:!0});$S.astFromValue=of;var Hte=rf(),Oi=Oe(),zte=sf(),hk=ZT();function of(e,t){if((0,Oi.isNonNullType)(t)){let n=of(e,t.ofType);return(n==null?void 0:n.kind)===Oi.Kind.NULL?null:n}if(e===null)return{kind:Oi.Kind.NULL};if(e===void 0)return null;if((0,Oi.isListType)(t)){let n=t.ofType;if((0,hk.isIterableObject)(e)){let r=[];for(let i of e){let a=of(i,n);a!=null&&r.push(a)}return{kind:Oi.Kind.LIST,values:r}}return of(e,n)}if((0,Oi.isInputObjectType)(t)){if(!(0,hk.isObjectLike)(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=of(e[r.name],r.type);i&&n.push({kind:Oi.Kind.OBJECT_FIELD,name:{kind:Oi.Kind.NAME,value:r.name},value:i})}return{kind:Oi.Kind.OBJECT,fields:n}}if((0,Oi.isLeafType)(t)){let n=t.serialize(e);return n==null?null:(0,Oi.isEnumType)(t)?{kind:Oi.Kind.ENUM,value:n}:t.name==="ID"&&typeof n=="string"&&Wte.test(n)?{kind:Oi.Kind.INT,value:n}:(0,zte.astFromValueUntyped)(n)}console.assert(!1,"Unexpected input type: "+(0,Hte.inspect)(t))}var Wte=/^-?(?:0|[1-9][0-9]*)$/});var Ik=F(GS=>{"use strict";m();T();N();Object.defineProperty(GS,"__esModule",{value:!0});GS.getDescriptionNode=Zte;var Xte=Oe();function Zte(e){var t;if((t=e.astNode)!=null&&t.description)return W(q({},e.astNode.description),{block:!0});if(e.description)return{kind:Xte.Kind.STRING,value:e.description,block:!0}}});var uf=F(Wi=>{"use strict";m();T();N();Object.defineProperty(Wi,"__esModule",{value:!0});Wi.getRootTypeMap=Wi.getRootTypes=Wi.getRootTypeNames=void 0;Wi.getDefinedRootType=tne;var ene=zT(),QS=qu();function tne(e,t,n){let i=(0,Wi.getRootTypeMap)(e).get(t);if(i==null)throw(0,ene.createGraphQLError)(`Schema is not configured to execute ${t} operation.`,{nodes:n});return i}Wi.getRootTypeNames=(0,QS.memoize1)(function(t){let n=(0,Wi.getRootTypes)(t);return new Set([...n].map(r=>r.name))});Wi.getRootTypes=(0,QS.memoize1)(function(t){let n=(0,Wi.getRootTypeMap)(t);return new Set(n.values())});Wi.getRootTypeMap=(0,QS.memoize1)(function(t){let n=new Map,r=t.getQueryType();r&&n.set("query",r);let i=t.getMutationType();i&&n.set("mutation",i);let a=t.getSubscriptionType();return a&&n.set("subscription",a),n})});var WS=F(nr=>{"use strict";m();T();N();Object.defineProperty(nr,"__esModule",{value:!0});nr.getDocumentNodeFromSchema=_k;nr.printSchemaWithDirectives=ane;nr.astFromSchema=vk;nr.astFromDirective=Sk;nr.getDirectiveNodes=ga;nr.astFromArg=JS;nr.astFromObjectType=Ok;nr.astFromInterfaceType=Dk;nr.astFromUnionType=bk;nr.astFromInputObjectType=Ak;nr.astFromEnumType=Rk;nr.astFromScalarType=Pk;nr.astFromField=HS;nr.astFromInputField=Fk;nr.astFromEnumValue=Lk;nr.makeDeprecatedDirective=wk;nr.makeDirectiveNode=ad;nr.makeDirectiveNodes=zS;var It=Oe(),xc=nE(),YS=yk(),nne=sf(),Xi=Ik(),gk=CS(),rne=rd(),ine=uf();function _k(e,t={}){let n=t.pathToDirectivesInExtensions,r=e.getTypeMap(),i=vk(e,n),a=i!=null?[i]:[],o=e.getDirectives();for(let u of o)(0,It.isSpecifiedDirective)(u)||a.push(Sk(u,e,n));for(let u in r){let l=r[u],d=(0,It.isSpecifiedScalarType)(l),p=(0,It.isIntrospectionType)(l);if(!(d||p))if((0,It.isObjectType)(l))a.push(Ok(l,e,n));else if((0,It.isInterfaceType)(l))a.push(Dk(l,e,n));else if((0,It.isUnionType)(l))a.push(bk(l,e,n));else if((0,It.isInputObjectType)(l))a.push(Ak(l,e,n));else if((0,It.isEnumType)(l))a.push(Rk(l,e,n));else if((0,It.isScalarType)(l))a.push(Pk(l,e,n));else throw new Error(`Unknown type ${l}.`)}return{kind:It.Kind.DOCUMENT,definitions:a}}function ane(e,t={}){let n=_k(e,t);return(0,It.print)(n)}function vk(e,t){let n=new Map([["query",void 0],["mutation",void 0],["subscription",void 0]]),r=[];if(e.astNode!=null&&r.push(e.astNode),e.extensionASTNodes!=null)for(let d of e.extensionASTNodes)r.push(d);for(let d of r)if(d.operationTypes)for(let p of d.operationTypes)n.set(p.operation,p);let i=(0,ine.getRootTypeMap)(e);for(let[d,p]of n){let E=i.get(d);if(E!=null){let h=(0,xc.astFromType)(E);p!=null?p.type=h:n.set(d,{kind:It.Kind.OPERATION_TYPE_DEFINITION,operation:d,type:h})}}let a=[...n.values()].filter(rne.isSome),o=ga(e,e,t);if(!a.length&&!o.length)return null;let u={kind:a.length?It.Kind.SCHEMA_DEFINITION:It.Kind.SCHEMA_EXTENSION,operationTypes:a,directives:o},l=(0,Xi.getDescriptionNode)(e);return l&&(u.description=l),u}function Sk(e,t,n){var r,i;return{kind:It.Kind.DIRECTIVE_DEFINITION,description:(0,Xi.getDescriptionNode)(e),name:{kind:It.Kind.NAME,value:e.name},arguments:(r=e.args)==null?void 0:r.map(a=>JS(a,t,n)),repeatable:e.isRepeatable,locations:((i=e.locations)==null?void 0:i.map(a=>({kind:It.Kind.NAME,value:a})))||[]}}function ga(e,t,n){let r=[],i=(0,gk.getDirectivesInExtensions)(e,n),a;i!=null&&(a=zS(t,i));let o=null,u=null,l=null;if(a!=null&&(r=a.filter(d=>It.specifiedDirectives.every(p=>p.name!==d.name.value)),o=a.find(d=>d.name.value==="deprecated"),u=a.find(d=>d.name.value==="specifiedBy"),l=a.find(d=>d.name.value==="oneOf")),e.deprecationReason!=null&&o==null&&(o=wk(e.deprecationReason)),e.specifiedByUrl!=null||e.specifiedByURL!=null&&u==null){let p={url:e.specifiedByUrl||e.specifiedByURL};u=ad("specifiedBy",p)}return e.isOneOf&&l==null&&(l=ad("oneOf")),o!=null&&r.push(o),u!=null&&r.push(u),l!=null&&r.push(l),r}function JS(e,t,n){var r;return{kind:It.Kind.INPUT_VALUE_DEFINITION,description:(0,Xi.getDescriptionNode)(e),name:{kind:It.Kind.NAME,value:e.name},type:(0,xc.astFromType)(e.type),defaultValue:e.defaultValue!==void 0&&(r=(0,YS.astFromValue)(e.defaultValue,e.type))!=null?r:void 0,directives:ga(e,t,n)}}function Ok(e,t,n){return{kind:It.Kind.OBJECT_TYPE_DEFINITION,description:(0,Xi.getDescriptionNode)(e),name:{kind:It.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(r=>HS(r,t,n)),interfaces:Object.values(e.getInterfaces()).map(r=>(0,xc.astFromType)(r)),directives:ga(e,t,n)}}function Dk(e,t,n){let r={kind:It.Kind.INTERFACE_TYPE_DEFINITION,description:(0,Xi.getDescriptionNode)(e),name:{kind:It.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(i=>HS(i,t,n)),directives:ga(e,t,n)};return"getInterfaces"in e&&(r.interfaces=Object.values(e.getInterfaces()).map(i=>(0,xc.astFromType)(i))),r}function bk(e,t,n){return{kind:It.Kind.UNION_TYPE_DEFINITION,description:(0,Xi.getDescriptionNode)(e),name:{kind:It.Kind.NAME,value:e.name},directives:ga(e,t,n),types:e.getTypes().map(r=>(0,xc.astFromType)(r))}}function Ak(e,t,n){return{kind:It.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:(0,Xi.getDescriptionNode)(e),name:{kind:It.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(r=>Fk(r,t,n)),directives:ga(e,t,n)}}function Rk(e,t,n){return{kind:It.Kind.ENUM_TYPE_DEFINITION,description:(0,Xi.getDescriptionNode)(e),name:{kind:It.Kind.NAME,value:e.name},values:Object.values(e.getValues()).map(r=>Lk(r,t,n)),directives:ga(e,t,n)}}function Pk(e,t,n){let r=(0,gk.getDirectivesInExtensions)(e,n),i=zS(t,r),a=e.specifiedByUrl||e.specifiedByURL;if(a&&!i.some(o=>o.name.value==="specifiedBy")){let o={url:a};i.push(ad("specifiedBy",o))}return{kind:It.Kind.SCALAR_TYPE_DEFINITION,description:(0,Xi.getDescriptionNode)(e),name:{kind:It.Kind.NAME,value:e.name},directives:i}}function HS(e,t,n){return{kind:It.Kind.FIELD_DEFINITION,description:(0,Xi.getDescriptionNode)(e),name:{kind:It.Kind.NAME,value:e.name},arguments:e.args.map(r=>JS(r,t,n)),type:(0,xc.astFromType)(e.type),directives:ga(e,t,n)}}function Fk(e,t,n){var r;return{kind:It.Kind.INPUT_VALUE_DEFINITION,description:(0,Xi.getDescriptionNode)(e),name:{kind:It.Kind.NAME,value:e.name},type:(0,xc.astFromType)(e.type),directives:ga(e,t,n),defaultValue:(r=(0,YS.astFromValue)(e.defaultValue,e.type))!=null?r:void 0}}function Lk(e,t,n){return{kind:It.Kind.ENUM_VALUE_DEFINITION,description:(0,Xi.getDescriptionNode)(e),name:{kind:It.Kind.NAME,value:e.name},directives:ga(e,t,n)}}function wk(e){return ad("deprecated",{reason:e},It.GraphQLDeprecatedDirective)}function ad(e,t,n){let r=[];for(let i in t){let a=t[i],o;if(n!=null){let u=n.args.find(l=>l.name===i);u&&(o=(0,YS.astFromValue)(a,u.type))}o==null&&(o=(0,nne.astFromValueUntyped)(a)),o!=null&&r.push({kind:It.Kind.ARGUMENT,name:{kind:It.Kind.NAME,value:i},value:o})}return{kind:It.Kind.DIRECTIVE,name:{kind:It.Kind.NAME,value:e},arguments:r}}function zS(e,t){let n=[];for(let{name:r,args:i}of t){let a=e==null?void 0:e.getDirective(r);n.push(ad(r,i,a))}return n}});var Uk=F(iE=>{"use strict";m();T();N();Object.defineProperty(iE,"__esModule",{value:!0});iE.validateGraphQlDocuments=sne;iE.createDefaultRules=Ck;var cf=Oe();function sne(e,t,n=Ck()){var u;let r=new Set,i=new Map;for(let l of t)for(let d of l.definitions)d.kind===cf.Kind.FRAGMENT_DEFINITION?i.set(d.name.value,d):r.add(d);let a={kind:cf.Kind.DOCUMENT,definitions:Array.from([...r,...i.values()])},o=(0,cf.validate)(e,a,n);for(let l of o)if(l.stack=l.message,l.locations)for(let d of l.locations)l.stack+=` + at ${(u=l.source)==null?void 0:u.name}:${d.line}:${d.column}`;return o}function Ck(){let e=["NoUnusedFragmentsRule","NoUnusedVariablesRule","KnownDirectivesRule"];return cf.versionInfo.major<15&&(e=e.map(t=>t.replace(/Rule$/,""))),cf.specifiedRules.filter(t=>!e.includes(t.name))}});var Bk=F(XS=>{"use strict";m();T();N();Object.defineProperty(XS,"__esModule",{value:!0});XS.parseGraphQLJSON=lne;var one=Oe();function une(e){return e=e.toString(),e.charCodeAt(0)===65279&&(e=e.slice(1)),e}function cne(e){return JSON.parse(une(e))}function lne(e,t,n){let r=cne(t);if(r.data&&(r=r.data),r.kind==="Document")return{location:e,document:r};if(r.__schema){let i=(0,one.buildClientSchema)(r,n);return{location:e,schema:i}}else if(typeof r=="string")return{location:e,rawSDL:r};throw new Error("Not valid JSON content")}});var eO=F(Zi=>{"use strict";m();T();N();Object.defineProperty(Zi,"__esModule",{value:!0});Zi.resetComments=pne;Zi.collectComment=fne;Zi.pushComment=lf;Zi.printComment=Vk;Zi.printWithComments=Ene;Zi.getDescription=yne;Zi.getComment=ZS;Zi.getLeadingCommentBlock=Kk;Zi.dedentBlockStringValue=jk;Zi.getBlockStringIndentation=$k;var qk=Oe(),dne=80,sd={};function pne(){sd={}}function fne(e){var n;let t=(n=e.name)==null?void 0:n.value;if(t!=null)switch(lf(e,t),e.kind){case"EnumTypeDefinition":if(e.values)for(let r of e.values)lf(r,t,r.name.value);break;case"ObjectTypeDefinition":case"InputObjectTypeDefinition":case"InterfaceTypeDefinition":if(e.fields){for(let r of e.fields)if(lf(r,t,r.name.value),hne(r)&&r.arguments)for(let i of r.arguments)lf(i,t,r.name.value,i.name.value)}break}}function lf(e,t,n,r){let i=ZS(e);if(typeof i!="string"||i.length===0)return;let a=[t];n&&(a.push(n),r&&a.push(r));let o=a.join(".");sd[o]||(sd[o]=[]),sd[o].push(i)}function Vk(e){return` # `+e.replace(/\n/g,` -# `)}function je(e,t){return e?e.filter(n=>n).join(t||""):""}function vk(e){var t;return(t=e==null?void 0:e.some(n=>n.includes(` -`)))!=null?t:!1}function ene(e){return(t,n,r,i,a)=>{var p;let o=[],u=i.reduce((E,h)=>(["fields","arguments","values"].includes(h)&&E.name&&o.push(E.name.value),E[h]),a[0]),l=[...o,(p=u==null?void 0:u.name)==null?void 0:p.value].filter(Boolean).join("."),d=[];return t.kind.includes("Definition")&&Xl[l]&&d.push(...Xl[l]),je([...d.map(bk),t.description,e(t,n,r,i,a)],` -`)}}function rp(e){return e&&` ${e.replace(/\n/g,` - `)}`}function Ia(e){return e&&e.length!==0?`{ -${rp(je(e,` +# `)}function Ke(e,t){return e?e.filter(n=>n).join(t||""):""}function kk(e){var t;return(t=e==null?void 0:e.some(n=>n.includes(` +`)))!=null?t:!1}function mne(e){return(t,n,r,i,a)=>{var p;let o=[],u=i.reduce((E,h)=>(["fields","arguments","values"].includes(h)&&E.name&&o.push(E.name.value),E[h]),a[0]),l=[...o,(p=u==null?void 0:u.name)==null?void 0:p.value].filter(Boolean).join("."),d=[];return t.kind.includes("Definition")&&sd[l]&&d.push(...sd[l]),Ke([...d.map(Vk),t.description,e(t,n,r,i,a)],` +`)}}function df(e){return e&&` ${e.replace(/\n/g,` + `)}`}function _a(e){return e&&e.length!==0?`{ +${df(Ke(e,` `))} -}`:""}function Pn(e,t,n){return t?e+t+(n||""):""}function tne(e,t=!1){let n=e.replace(/\\/g,"\\\\").replace(/"""/g,'\\"""');return(e[0]===" "||e[0]===" ")&&e.indexOf(` +}`:""}function Un(e,t,n){return t?e+t+(n||""):""}function Nne(e,t=!1){let n=e.replace(/\\/g,"\\\\").replace(/"""/g,'\\"""');return(e[0]===" "||e[0]===" ")&&e.indexOf(` `)===-1?`"""${n.replace(/"$/,`" `)}"""`:`""" -${t?n:rp(n)} -"""`}var Sk={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>je(e.definitions,` +${t?n:df(n)} +"""`}var Mk={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Ke(e.definitions,` -`)},OperationDefinition:{leave:e=>{let t=Pn("(",je(e.variableDefinitions,", "),")");return je([e.operation,je([e.name,t]),je(e.directives," ")]," ")+" "+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Pn(" = ",n)+Pn(" ",je(r," "))},SelectionSet:{leave:({selections:e})=>Ia(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let a=Pn("",e,": ")+t,o=a+Pn("(",je(n,", "),")");return o.length>Wte&&(o=a+Pn(`( -`,rp(je(n,` +`)},OperationDefinition:{leave:e=>{let t=Un("(",Ke(e.variableDefinitions,", "),")");return Ke([e.operation,Ke([e.name,t]),Ke(e.directives," ")]," ")+" "+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Un(" = ",n)+Un(" ",Ke(r," "))},SelectionSet:{leave:({selections:e})=>_a(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let a=Un("",e,": ")+t,o=a+Un("(",Ke(n,", "),")");return o.length>dne&&(o=a+Un(`( +`,df(Ke(n,` `)),` -)`)),je([o,je(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Pn(" ",je(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>je(["...",Pn("on ",e),je(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Pn("(",je(n,", "),")")} on ${t} ${Pn("",je(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?tne(e):JSON.stringify(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+je(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+je(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Pn("(",je(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({directives:e,operationTypes:t})=>je(["schema",je(e," "),Ia(t)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({name:e,directives:t})=>je(["scalar",e,je(t," ")]," ")},ObjectTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>je(["type",e,Pn("implements ",je(t," & ")),je(n," "),Ia(r)]," ")},FieldDefinition:{leave:({name:e,arguments:t,type:n,directives:r})=>e+(vk(t)?Pn(`( -`,rp(je(t,` +)`)),Ke([o,Ke(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Un(" ",Ke(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>Ke(["...",Un("on ",e),Ke(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Un("(",Ke(n,", "),")")} on ${t} ${Un("",Ke(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Nne(e):JSON.stringify(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+Ke(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+Ke(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Un("(",Ke(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({directives:e,operationTypes:t})=>Ke(["schema",Ke(e," "),_a(t)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({name:e,directives:t})=>Ke(["scalar",e,Ke(t," ")]," ")},ObjectTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ke(["type",e,Un("implements ",Ke(t," & ")),Ke(n," "),_a(r)]," ")},FieldDefinition:{leave:({name:e,arguments:t,type:n,directives:r})=>e+(kk(t)?Un(`( +`,df(Ke(t,` `)),` -)`):Pn("(",je(t,", "),")"))+": "+n+Pn(" ",je(r," "))},InputValueDefinition:{leave:({name:e,type:t,defaultValue:n,directives:r})=>je([e+": "+t,Pn("= ",n),je(r," ")]," ")},InterfaceTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>je(["interface",e,Pn("implements ",je(t," & ")),je(n," "),Ia(r)]," ")},UnionTypeDefinition:{leave:({name:e,directives:t,types:n})=>je(["union",e,je(t," "),Pn("= ",je(n," | "))]," ")},EnumTypeDefinition:{leave:({name:e,directives:t,values:n})=>je(["enum",e,je(t," "),Ia(n)]," ")},EnumValueDefinition:{leave:({name:e,directives:t})=>je([e,je(t," ")]," ")},InputObjectTypeDefinition:{leave:({name:e,directives:t,fields:n})=>je(["input",e,je(t," "),Ia(n)]," ")},DirectiveDefinition:{leave:({name:e,arguments:t,repeatable:n,locations:r})=>"directive @"+e+(vk(t)?Pn(`( -`,rp(je(t,` +)`):Un("(",Ke(t,", "),")"))+": "+n+Un(" ",Ke(r," "))},InputValueDefinition:{leave:({name:e,type:t,defaultValue:n,directives:r})=>Ke([e+": "+t,Un("= ",n),Ke(r," ")]," ")},InterfaceTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ke(["interface",e,Un("implements ",Ke(t," & ")),Ke(n," "),_a(r)]," ")},UnionTypeDefinition:{leave:({name:e,directives:t,types:n})=>Ke(["union",e,Ke(t," "),Un("= ",Ke(n," | "))]," ")},EnumTypeDefinition:{leave:({name:e,directives:t,values:n})=>Ke(["enum",e,Ke(t," "),_a(n)]," ")},EnumValueDefinition:{leave:({name:e,directives:t})=>Ke([e,Ke(t," ")]," ")},InputObjectTypeDefinition:{leave:({name:e,directives:t,fields:n})=>Ke(["input",e,Ke(t," "),_a(n)]," ")},DirectiveDefinition:{leave:({name:e,arguments:t,repeatable:n,locations:r})=>"directive @"+e+(kk(t)?Un(`( +`,df(Ke(t,` `)),` -)`):Pn("(",je(t,", "),")"))+(n?" repeatable":"")+" on "+je(r," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>je(["extend schema",je(e," "),Ia(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>je(["extend scalar",e,je(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>je(["extend type",e,Pn("implements ",je(t," & ")),je(n," "),Ia(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>je(["extend interface",e,Pn("implements ",je(t," & ")),je(n," "),Ia(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>je(["extend union",e,je(t," "),Pn("= ",je(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>je(["extend enum",e,je(t," "),Ia(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>je(["extend input",e,je(t," "),Ia(n)]," ")}},nne=Object.keys(Sk).reduce((e,t)=>$(M({},e),{[t]:{leave:ene(Sk[t].leave)}}),{});function rne(e){return(0,Dk.visit)(e,nne)}function ine(e){return e.kind==="FieldDefinition"}function ane(e,t){if(e.description!=null)return e.description.value;if(t!=null&&t.commentDescriptions)return BS(e)}function BS(e){let t=Ak(e);if(t!==void 0)return Rk(` -${t}`)}function Ak(e){let t=e.loc;if(!t)return;let n=[],r=t.startToken.prev;for(;r!=null&&r.kind===Dk.TokenKind.COMMENT&&r.next!=null&&r.prev!=null&&r.line+1===r.next.line&&r.line!==r.prev.line;){let i=String(r.value);n.push(i),r=r.prev}return n.length>0?n.reverse().join(` -`):void 0}function Rk(e){let t=e.split(/\r\n|[\n\r]/g),n=Pk(t);if(n!==0)for(let r=1;r0&&Ok(t[0]);)t.shift();for(;t.length>0&&Ok(t[t.length-1]);)t.pop();return t.join(` -`)}function Pk(e){let t=null;for(let n=1;n{"use strict";m();T();N();Object.defineProperty(ip,"__esModule",{value:!0});ip.parseGraphQLSDL=sne;ip.transformCommentsToDescriptions=Lk;ip.isDescribable=Ck;var Xi=Se(),wk=kS();function sne(e,t,n={}){let r;try{n.commentDescriptions&&t.includes("#")?(r=Lk(t,n),n.noLocation&&(r=(0,Xi.parse)((0,Xi.print)(r),n))):r=(0,Xi.parse)(new Xi.Source(t,e),n)}catch(i){if(i.message.includes("EOF")&&t.replace(/(\#[^*]*)/g,"").trim()==="")r={kind:Xi.Kind.DOCUMENT,definitions:[]};else throw i}return{location:e,document:r}}function Lk(e,t={}){let n=(0,Xi.parse)(e,$(M({},t),{noLocation:!1}));return(0,Xi.visit)(n,{leave:i=>{if(Ck(i)){let a=(0,wk.getLeadingCommentBlock)(i);if(a!==void 0){let o=(0,wk.dedentBlockStringValue)(` +)`):Un("(",Ke(t,", "),")"))+(n?" repeatable":"")+" on "+Ke(r," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>Ke(["extend schema",Ke(e," "),_a(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>Ke(["extend scalar",e,Ke(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ke(["extend type",e,Un("implements ",Ke(t," & ")),Ke(n," "),_a(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ke(["extend interface",e,Un("implements ",Ke(t," & ")),Ke(n," "),_a(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>Ke(["extend union",e,Ke(t," "),Un("= ",Ke(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>Ke(["extend enum",e,Ke(t," "),_a(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>Ke(["extend input",e,Ke(t," "),_a(n)]," ")}},Tne=Object.keys(Mk).reduce((e,t)=>W(q({},e),{[t]:{leave:mne(Mk[t].leave)}}),{});function Ene(e){return(0,qk.visit)(e,Tne)}function hne(e){return e.kind==="FieldDefinition"}function yne(e,t){if(e.description!=null)return e.description.value;if(t!=null&&t.commentDescriptions)return ZS(e)}function ZS(e){let t=Kk(e);if(t!==void 0)return jk(` +${t}`)}function Kk(e){let t=e.loc;if(!t)return;let n=[],r=t.startToken.prev;for(;r!=null&&r.kind===qk.TokenKind.COMMENT&&r.next!=null&&r.prev!=null&&r.line+1===r.next.line&&r.line!==r.prev.line;){let i=String(r.value);n.push(i),r=r.prev}return n.length>0?n.reverse().join(` +`):void 0}function jk(e){let t=e.split(/\r\n|[\n\r]/g),n=$k(t);if(n!==0)for(let r=1;r0&&xk(t[0]);)t.shift();for(;t.length>0&&xk(t[t.length-1]);)t.pop();return t.join(` +`)}function $k(e){let t=null;for(let n=1;n{"use strict";m();T();N();Object.defineProperty(pf,"__esModule",{value:!0});pf.parseGraphQLSDL=Ine;pf.transformCommentsToDescriptions=Yk;pf.isDescribable=Jk;var ea=Oe(),Qk=eO();function Ine(e,t,n={}){let r;try{n.commentDescriptions&&t.includes("#")?(r=Yk(t,n),n.noLocation&&(r=(0,ea.parse)((0,ea.print)(r),n))):r=(0,ea.parse)(new ea.Source(t,e),n)}catch(i){if(i.message.includes("EOF")&&t.replace(/(\#[^*]*)/g,"").trim()==="")r={kind:ea.Kind.DOCUMENT,definitions:[]};else throw i}return{location:e,document:r}}function Yk(e,t={}){let n=(0,ea.parse)(e,W(q({},t),{noLocation:!1}));return(0,ea.visit)(n,{leave:i=>{if(Jk(i)){let a=(0,Qk.getLeadingCommentBlock)(i);if(a!==void 0){let o=(0,Qk.dedentBlockStringValue)(` `+a),u=o.includes(` -`);return i.description?$(M({},i),{description:$(M({},i.description),{value:i.description.value+` -`+o,block:!0})}):$(M({},i),{description:{kind:Xi.Kind.STRING,value:o,block:u}})}}}})}function Ck(e){return(0,Xi.isTypeSystemDefinitionNode)(e)||e.kind===Xi.Kind.FIELD_DEFINITION||e.kind===Xi.Kind.INPUT_VALUE_DEFINITION||e.kind===Xi.Kind.ENUM_VALUE_DEFINITION}});var Kk=F(VS=>{"use strict";m();T();N();Object.defineProperty(VS,"__esModule",{value:!0});VS.buildOperationNodeForField=une;var dt=Se(),one=Xf(),xk=ep(),qS=[],GT=new Map;function qk(e){qS.push(e)}function Bk(){qS=[]}function kk(){GT=new Map}function une({schema:e,kind:t,field:n,models:r,ignore:i=[],depthLimit:a,circularReferenceDepth:o,argNames:u,selectedFields:l=!0}){Bk(),kk();let d=(0,xk.getRootTypeNames)(e),p=cne({schema:e,fieldName:n,kind:t,models:r||[],ignore:i,depthLimit:a||1/0,circularReferenceDepth:o||1,argNames:u,selectedFields:l,rootTypeNames:d});return p.variableDefinitions=[...qS],Bk(),kk(),p}function cne({schema:e,fieldName:t,kind:n,models:r,ignore:i,depthLimit:a,circularReferenceDepth:o,argNames:u,selectedFields:l,rootTypeNames:d}){let p=(0,xk.getDefinedRootType)(e,n),E=p.getFields()[t],h=`${t}_${n}`;if(E.args)for(let v of E.args){let A=v.name;(!u||u.includes(A))&&qk(Vk(v,A))}return{kind:dt.Kind.OPERATION_DEFINITION,operation:n,name:{kind:dt.Kind.NAME,value:h},variableDefinitions:[],selectionSet:{kind:dt.Kind.SELECTION_SET,selections:[jk({type:p,field:E,models:r,firstCall:!0,path:[],ancestors:[],ignore:i,depthLimit:a,circularReferenceDepth:o,schema:e,depth:0,argNames:u,selectedFields:l,rootTypeNames:d})]}}}function xS({parent:e,type:t,models:n,firstCall:r,path:i,ancestors:a,ignore:o,depthLimit:u,circularReferenceDepth:l,schema:d,depth:p,argNames:E,selectedFields:h,rootTypeNames:v}){if(!(typeof h=="boolean"&&p>u)){if((0,dt.isUnionType)(t)){let A=t.getTypes();return{kind:dt.Kind.SELECTION_SET,selections:A.filter(B=>!MS([...a,B],{depth:l})).map(B=>({kind:dt.Kind.INLINE_FRAGMENT,typeCondition:{kind:dt.Kind.NAMED_TYPE,name:{kind:dt.Kind.NAME,value:B.name}},selectionSet:xS({parent:t,type:B,models:n,path:i,ancestors:a,ignore:o,depthLimit:u,circularReferenceDepth:l,schema:d,depth:p,argNames:E,selectedFields:h,rootTypeNames:v})})).filter(B=>{var V,J;return((J=(V=B==null?void 0:B.selectionSet)==null?void 0:V.selections)==null?void 0:J.length)>0})}}if((0,dt.isInterfaceType)(t)){let A=Object.values(d.getTypeMap()).filter(B=>(0,dt.isObjectType)(B)&&B.getInterfaces().includes(t));return{kind:dt.Kind.SELECTION_SET,selections:A.filter(B=>!MS([...a,B],{depth:l})).map(B=>({kind:dt.Kind.INLINE_FRAGMENT,typeCondition:{kind:dt.Kind.NAMED_TYPE,name:{kind:dt.Kind.NAME,value:B.name}},selectionSet:xS({parent:t,type:B,models:n,path:i,ancestors:a,ignore:o,depthLimit:u,circularReferenceDepth:l,schema:d,depth:p,argNames:E,selectedFields:h,rootTypeNames:v})})).filter(B=>{var V,J;return((J=(V=B==null?void 0:B.selectionSet)==null?void 0:V.selections)==null?void 0:J.length)>0})}}if((0,dt.isObjectType)(t)&&!v.has(t.name)){let A=o.includes(t.name)||o.includes(`${e.name}.${i[i.length-1]}`),B=n.includes(t.name);if(!r&&B&&!A)return{kind:dt.Kind.SELECTION_SET,selections:[{kind:dt.Kind.FIELD,name:{kind:dt.Kind.NAME,value:"id"}}]};let V=t.getFields();return{kind:dt.Kind.SELECTION_SET,selections:Object.keys(V).filter(J=>!MS([...a,(0,dt.getNamedType)(V[J].type)],{depth:l})).map(J=>{let re=typeof h=="object"?h[J]:!0;return re?jk({type:t,field:V[J],models:n,path:[...i,J],ancestors:a,ignore:o,depthLimit:u,circularReferenceDepth:l,schema:d,depth:p,argNames:E,selectedFields:re,rootTypeNames:v}):null}).filter(J=>{var re,ie;return J==null?!1:"selectionSet"in J?!!((ie=(re=J.selectionSet)==null?void 0:re.selections)!=null&&ie.length):!0})}}}}function Vk(e,t){function n(i){return(0,dt.isListType)(i)?{kind:dt.Kind.LIST_TYPE,type:n(i.ofType)}:(0,dt.isNonNullType)(i)?{kind:dt.Kind.NON_NULL_TYPE,type:n(i.ofType)}:{kind:dt.Kind.NAMED_TYPE,name:{kind:dt.Kind.NAME,value:i.name}}}let r;try{let i=(0,dt.astFromValue)(e.defaultValue,e.type);i==null?r=void 0:r=i}catch(i){let a=(0,one.astFromValueUntyped)(e.defaultValue);a==null?r=void 0:r=a}return{kind:dt.Kind.VARIABLE_DEFINITION,variable:{kind:dt.Kind.VARIABLE,name:{kind:dt.Kind.NAME,value:t||e.name}},type:n(e.type),defaultValue:r}}function Mk(e,t){return[...t,e].join("_")}function jk({type:e,field:t,models:n,firstCall:r,path:i,ancestors:a,ignore:o,depthLimit:u,circularReferenceDepth:l,schema:d,depth:p,argNames:E,selectedFields:h,rootTypeNames:v}){let A=(0,dt.getNamedType)(t.type),B=[],V=!1;if(t.args&&t.args.length&&(B=t.args.map(Ne=>{let Ee=Mk(Ne.name,i);return E&&!E.includes(Ee)?((0,dt.isNonNullType)(Ne.type)&&(V=!0),null):(r||qk(Vk(Ne,Ee)),{kind:dt.Kind.ARGUMENT,name:{kind:dt.Kind.NAME,value:Ne.name},value:{kind:dt.Kind.VARIABLE,name:{kind:dt.Kind.NAME,value:Mk(Ne.name,i)}}})}).filter(Boolean)),V)return null;let J=[...i,t.name],re=J.join("."),ie=t.name;return GT.has(re)&>.get(re)!==t.type.toString()&&(ie+=t.type.toString().replace(/!/g,"NonNull").replace(/\[/g,"List").replace(/\]/g,"")),GT.set(re,t.type.toString()),!(0,dt.isScalarType)(A)&&!(0,dt.isEnumType)(A)?$(M({kind:dt.Kind.FIELD,name:{kind:dt.Kind.NAME,value:t.name}},ie!==t.name&&{alias:{kind:dt.Kind.NAME,value:ie}}),{selectionSet:xS({parent:e,type:A,models:n,firstCall:r,path:J,ancestors:[...a,e],ignore:o,depthLimit:u,circularReferenceDepth:l,schema:d,depth:p+1,argNames:E,selectedFields:h,rootTypeNames:v})||void 0,arguments:B}):$(M({kind:dt.Kind.FIELD,name:{kind:dt.Kind.NAME,value:t.name}},ie!==t.name&&{alias:{kind:dt.Kind.NAME,value:ie}}),{arguments:B})}function MS(e,t={depth:1}){let n=e[e.length-1];return(0,dt.isScalarType)(n)?!1:e.filter(i=>i.name===n.name).length>t.depth}});var Gk=F(QT=>{"use strict";m();T();N();Object.defineProperty(QT,"__esModule",{value:!0});QT.DirectiveLocation=void 0;var $k;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})($k||(QT.DirectiveLocation=$k={}))});var wc=F(YT=>{"use strict";m();T();N();Object.defineProperty(YT,"__esModule",{value:!0});YT.MapperKind=void 0;var Qk;(function(e){e.TYPE="MapperKind.TYPE",e.SCALAR_TYPE="MapperKind.SCALAR_TYPE",e.ENUM_TYPE="MapperKind.ENUM_TYPE",e.COMPOSITE_TYPE="MapperKind.COMPOSITE_TYPE",e.OBJECT_TYPE="MapperKind.OBJECT_TYPE",e.INPUT_OBJECT_TYPE="MapperKind.INPUT_OBJECT_TYPE",e.ABSTRACT_TYPE="MapperKind.ABSTRACT_TYPE",e.UNION_TYPE="MapperKind.UNION_TYPE",e.INTERFACE_TYPE="MapperKind.INTERFACE_TYPE",e.ROOT_OBJECT="MapperKind.ROOT_OBJECT",e.QUERY="MapperKind.QUERY",e.MUTATION="MapperKind.MUTATION",e.SUBSCRIPTION="MapperKind.SUBSCRIPTION",e.DIRECTIVE="MapperKind.DIRECTIVE",e.FIELD="MapperKind.FIELD",e.COMPOSITE_FIELD="MapperKind.COMPOSITE_FIELD",e.OBJECT_FIELD="MapperKind.OBJECT_FIELD",e.ROOT_FIELD="MapperKind.ROOT_FIELD",e.QUERY_ROOT_FIELD="MapperKind.QUERY_ROOT_FIELD",e.MUTATION_ROOT_FIELD="MapperKind.MUTATION_ROOT_FIELD",e.SUBSCRIPTION_ROOT_FIELD="MapperKind.SUBSCRIPTION_ROOT_FIELD",e.INTERFACE_FIELD="MapperKind.INTERFACE_FIELD",e.INPUT_OBJECT_FIELD="MapperKind.INPUT_OBJECT_FIELD",e.ARGUMENT="MapperKind.ARGUMENT",e.ENUM_VALUE="MapperKind.ENUM_VALUE"})(Qk||(YT.MapperKind=Qk={}))});var KS=F(jS=>{"use strict";m();T();N();Object.defineProperty(jS,"__esModule",{value:!0});jS.getObjectTypeFromTypeMap=dne;var lne=Se();function dne(e,t){if(t){let n=e[t.name];if((0,lne.isObjectType)(n))return n}}});var QS=F(Zl=>{"use strict";m();T();N();Object.defineProperty(Zl,"__esModule",{value:!0});Zl.createNamedStub=$S;Zl.createStub=GS;Zl.isNamedStub=fne;Zl.getBuiltInForStub=pne;var Er=Se();function $S(e,t){let n;return t==="object"?n=Er.GraphQLObjectType:t==="interface"?n=Er.GraphQLInterfaceType:n=Er.GraphQLInputObjectType,new n({name:e,fields:{_fake:{type:Er.GraphQLString}}})}function GS(e,t){switch(e.kind){case Er.Kind.LIST_TYPE:return new Er.GraphQLList(GS(e.type,t));case Er.Kind.NON_NULL_TYPE:return new Er.GraphQLNonNull(GS(e.type,t));default:return t==="output"?$S(e.name.value,"object"):$S(e.name.value,"input")}}function fne(e){if("getFields"in e){let t=e.getFields();for(let n in t)return t[n].name==="_fake"}return!1}function pne(e){switch(e.name){case Er.GraphQLInt.name:return Er.GraphQLInt;case Er.GraphQLFloat.name:return Er.GraphQLFloat;case Er.GraphQLString.name:return Er.GraphQLString;case Er.GraphQLBoolean.name:return Er.GraphQLBoolean;case Er.GraphQLID.name:return Er.GraphQLID;default:return e}}});var JT=F(YS=>{"use strict";m();T();N();Object.defineProperty(YS,"__esModule",{value:!0});YS.rewireTypes=mne;var Zn=Se(),Yk=QS();function mne(e,t){let n=Object.create(null);for(let h in e)n[h]=e[h];let r=Object.create(null);for(let h in n){let v=n[h];if(v==null||h.startsWith("__"))continue;let A=v.name;if(!A.startsWith("__")){if(r[A]!=null){console.warn(`Duplicate schema type name ${A} found; keeping the existing one found in the schema`);continue}r[A]=v}}for(let h in r)r[h]=u(r[h]);let i=t.map(h=>a(h));return{typeMap:r,directives:i};function a(h){if((0,Zn.isSpecifiedDirective)(h))return h;let v=h.toConfig();return v.args=o(v.args),new Zn.GraphQLDirective(v)}function o(h){let v={};for(let A in h){let B=h[A],V=E(B.type);V!=null&&(B.type=V,v[A]=B)}return v}function u(h){if((0,Zn.isObjectType)(h)){let v=h.toConfig(),A=$(M({},v),{fields:()=>l(v.fields),interfaces:()=>p(v.interfaces)});return new Zn.GraphQLObjectType(A)}else if((0,Zn.isInterfaceType)(h)){let v=h.toConfig(),A=$(M({},v),{fields:()=>l(v.fields)});return"interfaces"in A&&(A.interfaces=()=>p(v.interfaces)),new Zn.GraphQLInterfaceType(A)}else if((0,Zn.isUnionType)(h)){let v=h.toConfig(),A=$(M({},v),{types:()=>p(v.types)});return new Zn.GraphQLUnionType(A)}else if((0,Zn.isInputObjectType)(h)){let v=h.toConfig(),A=$(M({},v),{fields:()=>d(v.fields)});return new Zn.GraphQLInputObjectType(A)}else if((0,Zn.isEnumType)(h)){let v=h.toConfig();return new Zn.GraphQLEnumType(v)}else if((0,Zn.isScalarType)(h)){if((0,Zn.isSpecifiedScalarType)(h))return h;let v=h.toConfig();return new Zn.GraphQLScalarType(v)}throw new Error(`Unexpected schema type: ${h}`)}function l(h){let v={};for(let A in h){let B=h[A],V=E(B.type);V!=null&&B.args&&(B.type=V,B.args=o(B.args),v[A]=B)}return v}function d(h){let v={};for(let A in h){let B=h[A],V=E(B.type);V!=null&&(B.type=V,v[A]=B)}return v}function p(h){let v=[];for(let A of h){let B=E(A);B!=null&&v.push(B)}return v}function E(h){if((0,Zn.isListType)(h)){let v=E(h.ofType);return v!=null?new Zn.GraphQLList(v):null}else if((0,Zn.isNonNullType)(h)){let v=E(h.ofType);return v!=null?new Zn.GraphQLNonNull(v):null}else if((0,Zn.isNamedType)(h)){let v=n[h.name];return v===void 0&&(v=(0,Yk.isNamedStub)(h)?(0,Yk.getBuiltInForStub)(h):u(h),r[v.name]=n[h.name]=v),v!=null?r[v.name]:null}return null}}});var JS=F(td=>{"use strict";m();T();N();Object.defineProperty(td,"__esModule",{value:!0});td.transformInputValue=ed;td.serializeInputValue=Tne;td.parseInputValue=Ene;td.parseInputValueLiteral=hne;var zT=Se(),Nne=zl();function ed(e,t,n=null,r=null){if(t==null)return t;let i=(0,zT.getNullableType)(e);if((0,zT.isLeafType)(i))return n!=null?n(i,t):t;if((0,zT.isListType)(i))return(0,Nne.asArray)(t).map(a=>ed(i.ofType,a,n,r));if((0,zT.isInputObjectType)(i)){let a=i.getFields(),o={};for(let u in t){let l=a[u];l!=null&&(o[u]=ed(l.type,t[u],n,r))}return r!=null?r(i,o):o}}function Tne(e,t){return ed(e,t,(n,r)=>{try{return n.serialize(r)}catch(i){return r}})}function Ene(e,t){return ed(e,t,(n,r)=>{try{return n.parseValue(r)}catch(i){return r}})}function hne(e,t){return ed(e,t,(n,r)=>n.parseLiteral(r,{}))}});var rd=F(WT=>{"use strict";m();T();N();Object.defineProperty(WT,"__esModule",{value:!0});WT.mapSchema=Ine;WT.correctASTNodes=ap;var st=Se(),nd=KS(),wt=wc(),yne=JT(),Jk=JS();function Ine(e,t={}){let n=Wk(Hk(zS(zk(_ne(zS(zk(e.getTypeMap(),e,Jk.serializeInputValue),e,t,u=>(0,st.isLeafType)(u)),e,t),e,Jk.parseInputValue),e,t,u=>!(0,st.isLeafType)(u)),e,t),e,t),r=e.getDirectives(),i=vne(r,e,t),{typeMap:a,directives:o}=(0,yne.rewireTypes)(n,i);return new st.GraphQLSchema($(M({},e.toConfig()),{query:(0,nd.getObjectTypeFromTypeMap)(a,(0,nd.getObjectTypeFromTypeMap)(n,e.getQueryType())),mutation:(0,nd.getObjectTypeFromTypeMap)(a,(0,nd.getObjectTypeFromTypeMap)(n,e.getMutationType())),subscription:(0,nd.getObjectTypeFromTypeMap)(a,(0,nd.getObjectTypeFromTypeMap)(n,e.getSubscriptionType())),types:Object.values(a),directives:o}))}var gne=["String","ID","Int","Float","Boolean"];function zS(e,t,n,r=()=>!0){let i={};for(let a in e)if(!a.startsWith("__")&&!gne.includes(a)){let o=e[a];if(o==null||!r(o)){i[a]=o;continue}let u=One(t,n,a);if(u==null){i[a]=o;continue}let l=u(o,t);if(l===void 0){i[a]=o;continue}i[a]=l}return i}function _ne(e,t,n){let r=Pne(n);return r?zS(e,t,{[wt.MapperKind.ENUM_TYPE]:i=>{let a=i.toConfig(),o=a.values,u={};for(let l in o){let d=o[l],p=r(d,i.name,t,l);if(p===void 0)u[l]=d;else if(Array.isArray(p)){let[E,h]=p;u[E]=h===void 0?d:h}else p!==null&&(u[l]=p)}return ap(new st.GraphQLEnumType($(M({},a),{values:u})))}},i=>(0,st.isEnumType)(i)):e}function zk(e,t,n){let r=Wk(e,t,{[wt.MapperKind.ARGUMENT]:i=>{if(i.defaultValue===void 0)return i;let a=HT(e,i.type);if(a!=null)return $(M({},i),{defaultValue:n(a,i.defaultValue)})}});return Hk(r,t,{[wt.MapperKind.INPUT_OBJECT_FIELD]:i=>{if(i.defaultValue===void 0)return i;let a=HT(r,i.type);if(a!=null)return $(M({},i),{defaultValue:n(a,i.defaultValue)})}})}function HT(e,t){if((0,st.isListType)(t)){let n=HT(e,t.ofType);return n!=null?new st.GraphQLList(n):null}else if((0,st.isNonNullType)(t)){let n=HT(e,t.ofType);return n!=null?new st.GraphQLNonNull(n):null}else if((0,st.isNamedType)(t)){let n=e[t.name];return n!=null?n:null}return null}function Hk(e,t,n){let r={};for(let i in e)if(!i.startsWith("__")){let a=e[i];if(!(0,st.isObjectType)(a)&&!(0,st.isInterfaceType)(a)&&!(0,st.isInputObjectType)(a)){r[i]=a;continue}let o=bne(t,n,i);if(o==null){r[i]=a;continue}let u=a.toConfig(),l=u.fields,d={};for(let p in l){let E=l[p],h=o(E,p,i,t);if(h===void 0)d[p]=E;else if(Array.isArray(h)){let[v,A]=h;A.astNode!=null&&(A.astNode=$(M({},A.astNode),{name:$(M({},A.astNode.name),{value:v})})),d[v]=A===void 0?E:A}else h!==null&&(d[p]=h)}(0,st.isObjectType)(a)?r[i]=ap(new st.GraphQLObjectType($(M({},u),{fields:d}))):(0,st.isInterfaceType)(a)?r[i]=ap(new st.GraphQLInterfaceType($(M({},u),{fields:d}))):r[i]=ap(new st.GraphQLInputObjectType($(M({},u),{fields:d})))}return r}function Wk(e,t,n){let r={};for(let i in e)if(!i.startsWith("__")){let a=e[i];if(!(0,st.isObjectType)(a)&&!(0,st.isInterfaceType)(a)){r[i]=a;continue}let o=Ane(n);if(o==null){r[i]=a;continue}let u=a.toConfig(),l=u.fields,d={};for(let p in l){let E=l[p],h=E.args;if(h==null){d[p]=E;continue}let v=Object.keys(h);if(!v.length){d[p]=E;continue}let A={};for(let B of v){let V=h[B],J=o(V,p,i,t);if(J===void 0)A[B]=V;else if(Array.isArray(J)){let[re,ie]=J;A[re]=ie}else J!==null&&(A[B]=J)}d[p]=$(M({},E),{args:A})}(0,st.isObjectType)(a)?r[i]=new st.GraphQLObjectType($(M({},u),{fields:d})):(0,st.isInterfaceType)(a)?r[i]=new st.GraphQLInterfaceType($(M({},u),{fields:d})):r[i]=new st.GraphQLInputObjectType($(M({},u),{fields:d}))}return r}function vne(e,t,n){let r=Rne(n);if(r==null)return e.slice();let i=[];for(let a of e){let o=r(a,t);o===void 0?i.push(a):o!==null&&i.push(o)}return i}function Sne(e,t){var i,a,o;let n=e.getType(t),r=[wt.MapperKind.TYPE];return(0,st.isObjectType)(n)?(r.push(wt.MapperKind.COMPOSITE_TYPE,wt.MapperKind.OBJECT_TYPE),t===((i=e.getQueryType())==null?void 0:i.name)?r.push(wt.MapperKind.ROOT_OBJECT,wt.MapperKind.QUERY):t===((a=e.getMutationType())==null?void 0:a.name)?r.push(wt.MapperKind.ROOT_OBJECT,wt.MapperKind.MUTATION):t===((o=e.getSubscriptionType())==null?void 0:o.name)&&r.push(wt.MapperKind.ROOT_OBJECT,wt.MapperKind.SUBSCRIPTION)):(0,st.isInputObjectType)(n)?r.push(wt.MapperKind.INPUT_OBJECT_TYPE):(0,st.isInterfaceType)(n)?r.push(wt.MapperKind.COMPOSITE_TYPE,wt.MapperKind.ABSTRACT_TYPE,wt.MapperKind.INTERFACE_TYPE):(0,st.isUnionType)(n)?r.push(wt.MapperKind.COMPOSITE_TYPE,wt.MapperKind.ABSTRACT_TYPE,wt.MapperKind.UNION_TYPE):(0,st.isEnumType)(n)?r.push(wt.MapperKind.ENUM_TYPE):(0,st.isScalarType)(n)&&r.push(wt.MapperKind.SCALAR_TYPE),r}function One(e,t,n){let r=Sne(e,n),i,a=[...r];for(;!i&&a.length>0;){let o=a.pop();i=t[o]}return i!=null?i:null}function Dne(e,t){var i,a,o;let n=e.getType(t),r=[wt.MapperKind.FIELD];return(0,st.isObjectType)(n)?(r.push(wt.MapperKind.COMPOSITE_FIELD,wt.MapperKind.OBJECT_FIELD),t===((i=e.getQueryType())==null?void 0:i.name)?r.push(wt.MapperKind.ROOT_FIELD,wt.MapperKind.QUERY_ROOT_FIELD):t===((a=e.getMutationType())==null?void 0:a.name)?r.push(wt.MapperKind.ROOT_FIELD,wt.MapperKind.MUTATION_ROOT_FIELD):t===((o=e.getSubscriptionType())==null?void 0:o.name)&&r.push(wt.MapperKind.ROOT_FIELD,wt.MapperKind.SUBSCRIPTION_ROOT_FIELD)):(0,st.isInterfaceType)(n)?r.push(wt.MapperKind.COMPOSITE_FIELD,wt.MapperKind.INTERFACE_FIELD):(0,st.isInputObjectType)(n)&&r.push(wt.MapperKind.INPUT_OBJECT_FIELD),r}function bne(e,t,n){let r=Dne(e,n),i,a=[...r];for(;!i&&a.length>0;){let o=a.pop();i=t[o]}return i!=null?i:null}function Ane(e){let t=e[wt.MapperKind.ARGUMENT];return t!=null?t:null}function Rne(e){let t=e[wt.MapperKind.DIRECTIVE];return t!=null?t:null}function Pne(e){let t=e[wt.MapperKind.ENUM_VALUE];return t!=null?t:null}function ap(e){if((0,st.isObjectType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=$(M({},t.astNode),{kind:st.Kind.OBJECT_TYPE_DEFINITION,fields:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>$(M({},n),{kind:st.Kind.OBJECT_TYPE_EXTENSION,fields:void 0}))),new st.GraphQLObjectType(t)}else if((0,st.isInterfaceType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=$(M({},t.astNode),{kind:st.Kind.INTERFACE_TYPE_DEFINITION,fields:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>$(M({},n),{kind:st.Kind.INTERFACE_TYPE_EXTENSION,fields:void 0}))),new st.GraphQLInterfaceType(t)}else if((0,st.isInputObjectType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=$(M({},t.astNode),{kind:st.Kind.INPUT_OBJECT_TYPE_DEFINITION,fields:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>$(M({},n),{kind:st.Kind.INPUT_OBJECT_TYPE_EXTENSION,fields:void 0}))),new st.GraphQLInputObjectType(t)}else if((0,st.isEnumType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.values){let i=t.values[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=$(M({},t.astNode),{values:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>$(M({},n),{values:void 0}))),new st.GraphQLEnumType(t)}else return e}});var Xk=F(XS=>{"use strict";m();T();N();Object.defineProperty(XS,"__esModule",{value:!0});XS.filterSchema=wne;var XT=Se(),ga=wc(),Fne=rd();function wne({schema:e,typeFilter:t=()=>!0,fieldFilter:n=void 0,rootFieldFilter:r=void 0,objectFieldFilter:i=void 0,interfaceFieldFilter:a=void 0,inputObjectFieldFilter:o=void 0,argumentFilter:u=void 0,directiveFilter:l=void 0,enumValueFilter:d=void 0}){return(0,Fne.mapSchema)(e,{[ga.MapperKind.QUERY]:E=>HS(E,"Query",r,u),[ga.MapperKind.MUTATION]:E=>HS(E,"Mutation",r,u),[ga.MapperKind.SUBSCRIPTION]:E=>HS(E,"Subscription",r,u),[ga.MapperKind.OBJECT_TYPE]:E=>t(E.name,E)?WS(XT.GraphQLObjectType,E,i||n,u):null,[ga.MapperKind.INTERFACE_TYPE]:E=>t(E.name,E)?WS(XT.GraphQLInterfaceType,E,a||n,u):null,[ga.MapperKind.INPUT_OBJECT_TYPE]:E=>t(E.name,E)?WS(XT.GraphQLInputObjectType,E,o||n):null,[ga.MapperKind.UNION_TYPE]:E=>t(E.name,E)?void 0:null,[ga.MapperKind.ENUM_TYPE]:E=>t(E.name,E)?void 0:null,[ga.MapperKind.SCALAR_TYPE]:E=>t(E.name,E)?void 0:null,[ga.MapperKind.DIRECTIVE]:E=>l&&!l(E.name,E)?null:void 0,[ga.MapperKind.ENUM_VALUE]:(E,h,v,A)=>d&&!d(h,A,E)?null:void 0})}function HS(e,t,n,r){if(n||r){let i=e.toConfig();for(let a in i.fields){let o=i.fields[a];if(n&&!n(t,a,i.fields[a]))delete i.fields[a];else if(r&&o.args)for(let u in o.args)r(e.name,a,u,o.args[u])||delete o.args[u]}return new XT.GraphQLObjectType(i)}return e}function WS(e,t,n,r){if(n||r){let i=t.toConfig();for(let a in i.fields){let o=i.fields[a];if(n&&!n(t.name,a,i.fields[a]))delete i.fields[a];else if(r&&"args"in o)for(let u in o.args)r(t.name,a,u,o.args[u])||delete o.args[u]}return new e(i)}}});var eM=F(ZT=>{"use strict";m();T();N();Object.defineProperty(ZT,"__esModule",{value:!0});ZT.healSchema=Lne;ZT.healTypes=Zk;var ns=Se();function Lne(e){return Zk(e.getTypeMap(),e.getDirectives()),e}function Zk(e,t){let n=Object.create(null);for(let d in e){let p=e[d];if(p==null||d.startsWith("__"))continue;let E=p.name;if(!E.startsWith("__")){if(n[E]!=null){console.warn(`Duplicate schema type name ${E} found; keeping the existing one found in the schema`);continue}n[E]=p}}for(let d in n){let p=n[d];e[d]=p}for(let d of t)d.args=d.args.filter(p=>(p.type=l(p.type),p.type!==null));for(let d in e){let p=e[d];!d.startsWith("__")&&d in n&&p!=null&&r(p)}for(let d in e)!d.startsWith("__")&&!(d in n)&&delete e[d];function r(d){if((0,ns.isObjectType)(d)){i(d),a(d);return}else if((0,ns.isInterfaceType)(d)){i(d),"getInterfaces"in d&&a(d);return}else if((0,ns.isUnionType)(d)){u(d);return}else if((0,ns.isInputObjectType)(d)){o(d);return}else if((0,ns.isLeafType)(d))return;throw new Error(`Unexpected schema type: ${d}`)}function i(d){let p=d.getFields();for(let[E,h]of Object.entries(p))h.args.map(v=>(v.type=l(v.type),v.type===null?null:v)).filter(Boolean),h.type=l(h.type),h.type===null&&delete p[E]}function a(d){if("getInterfaces"in d){let p=d.getInterfaces();p.push(...p.splice(0).map(E=>l(E)).filter(Boolean))}}function o(d){let p=d.getFields();for(let[E,h]of Object.entries(p))h.type=l(h.type),h.type===null&&delete p[E]}function u(d){let p=d.getTypes();p.push(...p.splice(0).map(E=>l(E)).filter(Boolean))}function l(d){if((0,ns.isListType)(d)){let p=l(d.ofType);return p!=null?new ns.GraphQLList(p):null}else if((0,ns.isNonNullType)(d)){let p=l(d.ofType);return p!=null?new ns.GraphQLNonNull(p):null}else if((0,ns.isNamedType)(d)){let p=e[d.name];if(p&&d!==p)return p}return d}}});var tM=F(ZS=>{"use strict";m();T();N();Object.defineProperty(ZS,"__esModule",{value:!0});ZS.getResolversFromSchema=Cne;var Lc=Se();function Cne(e,t){var i,a;let n=Object.create(null),r=e.getTypeMap();for(let o in r)if(!o.startsWith("__")){let u=r[o];if((0,Lc.isScalarType)(u)){if(!(0,Lc.isSpecifiedScalarType)(u)){let l=u.toConfig();delete l.astNode,n[o]=new Lc.GraphQLScalarType(l)}}else if((0,Lc.isEnumType)(u)){n[o]={};let l=u.getValues();for(let d of l)n[o][d.name]=d.value}else if((0,Lc.isInterfaceType)(u))u.resolveType!=null&&(n[o]={__resolveType:u.resolveType});else if((0,Lc.isUnionType)(u))u.resolveType!=null&&(n[o]={__resolveType:u.resolveType});else if((0,Lc.isObjectType)(u)){n[o]={},u.isTypeOf!=null&&(n[o].__isTypeOf=u.isTypeOf);let l=u.getFields();for(let d in l){let p=l[d];if(p.subscribe!=null&&(n[o][d]=n[o][d]||{},n[o][d].subscribe=p.subscribe),p.resolve!=null&&((i=p.resolve)==null?void 0:i.name)!=="defaultFieldResolver"){switch((a=p.resolve)==null?void 0:a.name){case"defaultMergedResolver":if(!t)continue;break;case"defaultFieldResolver":continue}n[o][d]=n[o][d]||{},n[o][d].resolve=p.resolve}}}}return n}});var rM=F(eO=>{"use strict";m();T();N();Object.defineProperty(eO,"__esModule",{value:!0});eO.forEachField=Une;var nM=Se();function Une(e,t){let n=e.getTypeMap();for(let r in n){let i=n[r];if(!(0,nM.getNamedType)(i).name.startsWith("__")&&(0,nM.isObjectType)(i)){let a=i.getFields();for(let o in a){let u=a[o];t(u,r,o)}}}}});var iM=F(nO=>{"use strict";m();T();N();Object.defineProperty(nO,"__esModule",{value:!0});nO.forEachDefaultValue=Bne;var tO=Se();function Bne(e,t){let n=e.getTypeMap();for(let r in n){let i=n[r];if(!(0,tO.getNamedType)(i).name.startsWith("__")){if((0,tO.isObjectType)(i)){let a=i.getFields();for(let o in a){let u=a[o];for(let l of u.args)l.defaultValue=t(l.type,l.defaultValue)}}else if((0,tO.isInputObjectType)(i)){let a=i.getFields();for(let o in a){let u=a[o];u.defaultValue=t(u.type,u.defaultValue)}}}}}});var sO=F(aO=>{"use strict";m();T();N();Object.defineProperty(aO,"__esModule",{value:!0});aO.addTypes=Mne;var rO=Se(),iO=KS(),kne=JT();function Mne(e,t){let n=e.toConfig(),r={};for(let u of n.types)r[u.name]=u;let i={};for(let u of n.directives)i[u.name]=u;for(let u of t)(0,rO.isNamedType)(u)?r[u.name]=u:(0,rO.isDirective)(u)&&(i[u.name]=u);let{typeMap:a,directives:o}=(0,kne.rewireTypes)(r,Object.values(i));return new rO.GraphQLSchema($(M({},n),{query:(0,iO.getObjectTypeFromTypeMap)(a,e.getQueryType()),mutation:(0,iO.getObjectTypeFromTypeMap)(a,e.getMutationType()),subscription:(0,iO.getObjectTypeFromTypeMap)(a,e.getSubscriptionType()),types:Object.values(a),directives:o}))}});var sM=F(oO=>{"use strict";m();T();N();Object.defineProperty(oO,"__esModule",{value:!0});oO.pruneSchema=Kne;var er=Se(),xne=vS(),qne=wc(),Vne=rd(),jne=ep();function Kne(e,t={}){let{skipEmptyCompositeTypePruning:n,skipEmptyUnionPruning:r,skipPruning:i,skipUnimplementedInterfacesPruning:a,skipUnusedTypesPruning:o}=t,u=[],l=e;do{let d=$ne(l);if(i){let p=[];for(let E in l.getTypeMap()){if(E.startsWith("__"))continue;let h=l.getType(E);h&&i(h)&&p.push(E)}d=aM(p,l,d)}u=[],l=(0,Vne.mapSchema)(l,{[qne.MapperKind.TYPE]:p=>!d.has(p.name)&&!(0,er.isSpecifiedScalarType)(p)?((0,er.isUnionType)(p)||(0,er.isInputObjectType)(p)||(0,er.isInterfaceType)(p)||(0,er.isObjectType)(p)||(0,er.isScalarType)(p))&&(o||(0,er.isUnionType)(p)&&r&&!Object.keys(p.getTypes()).length||((0,er.isInputObjectType)(p)||(0,er.isInterfaceType)(p)||(0,er.isObjectType)(p))&&n&&!Object.keys(p.getFields()).length||(0,er.isInterfaceType)(p)&&a)?p:(u.push(p.name),d.delete(p.name),null):p})}while(u.length);return l}function $ne(e){let t=[];for(let n of(0,jne.getRootTypes)(e))t.push(n.name);return aM(t,e)}function aM(e,t,n=new Set){let r=new Map;for(;e.length;){let i=e.pop();if(n.has(i)&&r[i]!==!0)continue;let a=t.getType(i);if(a){if((0,er.isUnionType)(a)&&e.push(...a.getTypes().map(o=>o.name)),(0,er.isInterfaceType)(a)&&r[i]===!0&&(e.push(...(0,xne.getImplementingTypes)(a.name,t)),r[i]=!1),(0,er.isEnumType)(a)&&e.push(...a.getValues().flatMap(o=>eE(t,o))),"getInterfaces"in a&&e.push(...a.getInterfaces().map(o=>o.name)),"getFields"in a){let o=a.getFields(),u=Object.entries(o);if(!u.length)continue;for(let[,l]of u){(0,er.isObjectType)(a)&&e.push(...l.args.flatMap(p=>{let E=[(0,er.getNamedType)(p.type).name];return E.push(...eE(t,p)),E}));let d=(0,er.getNamedType)(l.type);e.push(d.name),e.push(...eE(t,l)),(0,er.isInterfaceType)(d)&&!(d.name in r)&&(r[d.name]=!0)}}e.push(...eE(t,a)),n.add(i)}}return n}function eE(e,t){var r,i;let n=new Set;if((r=t.astNode)!=null&&r.directives)for(let a of t.astNode.directives){let o=e.getDirective(a.name.value);if(o!=null&&o.args)for(let u of o.args){let l=(0,er.getNamedType)(u.type);n.add(l.name)}}if((i=t.extensions)!=null&&i.directives)for(let a in t.extensions.directives){let o=e.getDirective(a);if(o!=null&&o.args)for(let u of o.args){let l=(0,er.getNamedType)(u.type);n.add(l.name)}}return[...n]}});var cO=F(uO=>{"use strict";m();T();N();Object.defineProperty(uO,"__esModule",{value:!0});uO.mergeDeep=tE;var Gne=zl();function tE(e,t=!1,n=!1,r=!1){if(e.length===0)return;if(e.length===1)return e[0];let i,a=!0,o=e.every(d=>{if(Array.isArray(d)){if(i===void 0)return i=d.length,!0;if(i===d.length)return!0}else a=!1;return!1});if(r&&o)return new Array(i).fill(null).map((d,p)=>tE(e.map(E=>E[p]),t,n,r));if(a)return e.flat(1);let u,l;t&&(l=e.find(d=>oM(d)),l&&(u==null&&(u={}),Object.setPrototypeOf(u,Object.create(Object.getPrototypeOf(l)))));for(let d of e)if(d!=null)if(oM(d)){if(l){let p=Object.getPrototypeOf(u),E=Object.getPrototypeOf(d);if(E)for(let h of Object.getOwnPropertyNames(E)){let v=Object.getOwnPropertyDescriptor(E,h);(0,Gne.isSome)(v)&&Object.defineProperty(p,h,v)}}for(let p in d)u==null&&(u={}),p in u?u[p]=tE([u[p],d[p]],t,n,r):u[p]=d[p]}else Array.isArray(d)&&Array.isArray(u)?u=tE([u,d],t,n,r):u=d;return u}function oM(e){return e&&typeof e=="object"&&!Array.isArray(e)}});var uM=F(lO=>{"use strict";m();T();N();Object.defineProperty(lO,"__esModule",{value:!0});lO.parseSelectionSet=Yne;var Qne=Se();function Yne(e,t){return(0,Qne.parse)(e,t).definitions[0].selectionSet}});var cM=F(dO=>{"use strict";m();T();N();Object.defineProperty(dO,"__esModule",{value:!0});dO.getResponseKeyFromInfo=Jne;function Jne(e){return e.fieldNodes[0].alias!=null?e.fieldNodes[0].alias.value:e.fieldName}});var lM=F(id=>{"use strict";m();T();N();Object.defineProperty(id,"__esModule",{value:!0});id.appendObjectFields=Hne;id.removeObjectFields=Wne;id.selectObjectFields=Xne;id.modifyObjectFields=Zne;var nE=Se(),zne=sO(),rE=wc(),Cc=rd();function Hne(e,t,n){return e.getType(t)==null?(0,zne.addTypes)(e,[new nE.GraphQLObjectType({name:t,fields:n})]):(0,Cc.mapSchema)(e,{[rE.MapperKind.OBJECT_TYPE]:r=>{if(r.name===t){let i=r.toConfig(),a=i.fields,o={};for(let u in a)o[u]=a[u];for(let u in n)o[u]=n[u];return(0,Cc.correctASTNodes)(new nE.GraphQLObjectType($(M({},i),{fields:o})))}}})}function Wne(e,t,n){let r={};return[(0,Cc.mapSchema)(e,{[rE.MapperKind.OBJECT_TYPE]:a=>{if(a.name===t){let o=a.toConfig(),u=o.fields,l={};for(let d in u){let p=u[d];n(d,p)?r[d]=p:l[d]=p}return(0,Cc.correctASTNodes)(new nE.GraphQLObjectType($(M({},o),{fields:l})))}}}),r]}function Xne(e,t,n){let r={};return(0,Cc.mapSchema)(e,{[rE.MapperKind.OBJECT_TYPE]:i=>{if(i.name===t){let o=i.toConfig().fields;for(let u in o){let l=o[u];n(u,l)&&(r[u]=l)}}}}),r}function Zne(e,t,n,r){let i={};return[(0,Cc.mapSchema)(e,{[rE.MapperKind.OBJECT_TYPE]:o=>{if(o.name===t){let u=o.toConfig(),l=u.fields,d={};for(let p in l){let E=l[p];n(p,E)?i[p]=E:d[p]=E}for(let p in r){let E=r[p];d[p]=E}return(0,Cc.correctASTNodes)(new nE.GraphQLObjectType($(M({},u),{fields:d})))}}}),i]}});var dM=F(fO=>{"use strict";m();T();N();Object.defineProperty(fO,"__esModule",{value:!0});fO.renameType=ere;var Zi=Se();function ere(e,t){if((0,Zi.isObjectType)(e))return new Zi.GraphQLObjectType($(M({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:$(M({},e.astNode),{name:$(M({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>$(M({},n),{name:$(M({},n.name),{value:t})}))}));if((0,Zi.isInterfaceType)(e))return new Zi.GraphQLInterfaceType($(M({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:$(M({},e.astNode),{name:$(M({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>$(M({},n),{name:$(M({},n.name),{value:t})}))}));if((0,Zi.isUnionType)(e))return new Zi.GraphQLUnionType($(M({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:$(M({},e.astNode),{name:$(M({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>$(M({},n),{name:$(M({},n.name),{value:t})}))}));if((0,Zi.isInputObjectType)(e))return new Zi.GraphQLInputObjectType($(M({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:$(M({},e.astNode),{name:$(M({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>$(M({},n),{name:$(M({},n.name),{value:t})}))}));if((0,Zi.isEnumType)(e))return new Zi.GraphQLEnumType($(M({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:$(M({},e.astNode),{name:$(M({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>$(M({},n),{name:$(M({},n.name),{value:t})}))}));if((0,Zi.isScalarType)(e))return new Zi.GraphQLScalarType($(M({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:$(M({},e.astNode),{name:$(M({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>$(M({},n),{name:$(M({},n.name),{value:t})}))}));throw new Error(`Unknown type ${e}.`)}});var fM=F(iE=>{"use strict";m();T();N();Object.defineProperty(iE,"__esModule",{value:!0});iE.updateArgument=nre;iE.createVariableNameGenerator=rre;var Uc=Se(),tre=jT();function nre(e,t,n,r,i,a,o){if(e[r]={kind:Uc.Kind.ARGUMENT,name:{kind:Uc.Kind.NAME,value:r},value:{kind:Uc.Kind.VARIABLE,name:{kind:Uc.Kind.NAME,value:i}}},t[i]={kind:Uc.Kind.VARIABLE_DEFINITION,variable:{kind:Uc.Kind.VARIABLE,name:{kind:Uc.Kind.NAME,value:i}},type:(0,tre.astFromType)(a)},o!==void 0){n[i]=o;return}i in n&&delete n[i]}function rre(e){let t=0;return n=>{let r;do r=t===0?n:`_v${t.toString()}_${n}`,t++;while(r in e);return r}}});var pM=F(mO=>{"use strict";m();T();N();Object.defineProperty(mO,"__esModule",{value:!0});mO.implementsAbstractType=ire;var pO=Se();function ire(e,t,n){return n==null||t==null?!1:t===n?!0:(0,pO.isCompositeType)(t)&&(0,pO.isCompositeType)(n)?(0,pO.doTypesOverlap)(e,t,n):!1}});var NM=F(NO=>{"use strict";m();T();N();Object.defineProperty(NO,"__esModule",{value:!0});NO.observableToAsyncIterable=are;var mM=Wf();function are(e){let t=[],n=[],r=!0,i=p=>{t.length!==0?t.shift()({value:p,done:!1}):n.push({value:p,done:!1})},a=p=>{t.length!==0?t.shift()({value:{errors:[p]},done:!1}):n.push({value:{errors:[p]},done:!1})},o=()=>{t.length!==0?t.shift()({done:!0}):n.push({done:!0})},u=()=>new Promise(p=>{if(n.length!==0){let E=n.shift();p(E)}else t.push(p)}),l=e.subscribe({next(p){return i(p)},error(p){return a(p)},complete(){return o()}}),d=()=>{if(r){r=!1,l.unsubscribe();for(let p of t)p({value:void 0,done:!0});t.length=0,n.length=0}};return{next(){return r?u():this.return()},return(){return d(),(0,mM.fakePromise)({value:void 0,done:!0})},throw(p){return d(),(0,mM.fakeRejectPromise)(p)},[Symbol.asyncIterator](){return this}}}});var TM=F(aE=>{"use strict";m();T();N();Object.defineProperty(aE,"__esModule",{value:!0});aE.AccumulatorMap=void 0;var TO=class extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(t,n){let r=this.get(t);r===void 0?this.set(t,[n]):r.push(n)}};aE.AccumulatorMap=TO});var EO=F(ad=>{"use strict";m();T();N();Object.defineProperty(ad,"__esModule",{value:!0});ad.GraphQLStreamDirective=ad.GraphQLDeferDirective=void 0;var ea=Se();ad.GraphQLDeferDirective=new ea.GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[ea.DirectiveLocation.FRAGMENT_SPREAD,ea.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new ea.GraphQLNonNull(ea.GraphQLBoolean),description:"Deferred when true or undefined.",defaultValue:!0},label:{type:ea.GraphQLString,description:"Unique name"}}});ad.GraphQLStreamDirective=new ea.GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[ea.DirectiveLocation.FIELD],args:{if:{type:new ea.GraphQLNonNull(ea.GraphQLBoolean),description:"Stream when true or undefined.",defaultValue:!0},label:{type:ea.GraphQLString,description:"Unique name"},initialCount:{defaultValue:0,type:ea.GraphQLInt,description:"Number of items to return immediately"}}})});var IO=F(Bs=>{"use strict";m();T();N();Object.defineProperty(Bs,"__esModule",{value:!0});Bs.collectSubFields=void 0;Bs.collectFields=ure;Bs.shouldIncludeNode=sE;Bs.doesFragmentConditionMatch=hO;Bs.getFieldEntryKey=EM;Bs.getDeferValues=yO;var rs=Se(),oE=TM(),sre=EO(),ore=wu();function sd(e,t,n,r,i,a,o,u){for(let l of i.selections)switch(l.kind){case rs.Kind.FIELD:{if(!sE(n,l))continue;a.add(EM(l),l);break}case rs.Kind.INLINE_FRAGMENT:{if(!sE(n,l)||!hO(e,l,r))continue;let d=yO(n,l);if(d){let p=new oE.AccumulatorMap;sd(e,t,n,r,l.selectionSet,p,o,u),o.push({label:d.label,fields:p})}else sd(e,t,n,r,l.selectionSet,a,o,u);break}case rs.Kind.FRAGMENT_SPREAD:{let d=l.name.value;if(!sE(n,l))continue;let p=yO(n,l);if(u.has(d)&&!p)continue;let E=t[d];if(!E||!hO(e,E,r))continue;if(p||u.add(d),p){let h=new oE.AccumulatorMap;sd(e,t,n,r,E.selectionSet,h,o,u),o.push({label:p.label,fields:h})}else sd(e,t,n,r,E.selectionSet,a,o,u);break}}}function ure(e,t,n,r,i){let a=new oE.AccumulatorMap,o=[];return sd(e,t,n,r,i,a,o,new Set),{fields:a,patches:o}}function sE(e,t){let n=(0,rs.getDirectiveValues)(rs.GraphQLSkipDirective,t,e);if((n==null?void 0:n.if)===!0)return!1;let r=(0,rs.getDirectiveValues)(rs.GraphQLIncludeDirective,t,e);return(r==null?void 0:r.if)!==!1}function hO(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=(0,rs.typeFromAST)(e,r);return i===n?!0:(0,rs.isAbstractType)(i)?e.getPossibleTypes(i).includes(n):!1}function EM(e){return e.alias?e.alias.value:e.name.value}function yO(e,t){let n=(0,rs.getDirectiveValues)(sre.GraphQLDeferDirective,t,e);if(n&&n.if!==!1)return{label:typeof n.label=="string"?n.label:void 0}}Bs.collectSubFields=(0,ore.memoize5)(function(t,n,r,i,a){let o=new oE.AccumulatorMap,u=new Set,l=[],d={fields:o,patches:l};for(let p of a)p.selectionSet&&sd(t,n,r,i,p.selectionSet,o,l,u);return d})});var gO=F(sp=>{"use strict";m();T();N();Object.defineProperty(sp,"__esModule",{value:!0});sp.getOperationASTFromRequest=void 0;sp.getOperationASTFromDocument=hM;var cre=Se(),lre=wu();function hM(e,t){let n=(0,cre.getOperationAST)(e,t);if(!n)throw new Error(`Cannot infer operation ${t||""}`);return n}sp.getOperationASTFromRequest=(0,lre.memoize1)(function(t){return hM(t.document,t.operationName)})});var gM=F(op=>{"use strict";m();T();N();Object.defineProperty(op,"__esModule",{value:!0});op.visitData=vO;op.visitErrors=fre;op.visitResult=pre;var Lu=Se(),_O=IO(),dre=gO();function vO(e,t,n){if(Array.isArray(e))return e.map(r=>vO(r,t,n));if(typeof e=="object"){let r=t!=null?t(e):e;if(r!=null)for(let i in r){let a=r[i];Object.defineProperty(r,i,{value:vO(a,t,n)})}return n!=null?n(r):r}return e}function fre(e,t){return e.map(n=>t(n))}function pre(e,t,n,r,i){let a=t.document.definitions.reduce((h,v)=>(v.kind===Lu.Kind.FRAGMENT_DEFINITION&&(h[v.name.value]=v),h),{}),o=t.variables||{},u={segmentInfoMap:new Map,unpathedErrors:new Set},l=e.data,d=e.errors,p=d!=null&&i!=null,E=(0,dre.getOperationASTFromRequest)(t);return l!=null&&E!=null&&(e.data=Tre(l,E,n,a,o,r,p?d:void 0,u)),d!=null&&i&&(e.errors=mre(d,i,u)),e}function mre(e,t,n){let r=n.segmentInfoMap,i=n.unpathedErrors,a=t.__unpathed;return e.map(o=>{let u=r.get(o),l=u==null?o:u.reduceRight((d,p)=>{let E=p.type.name,h=t[E];if(h==null)return d;let v=h[p.fieldName];return v==null?d:v(d,p.pathIndex)},o);return a&&i.has(o)?a(l):l})}function Nre(e,t){switch(t.operation){case"query":return e.getQueryType();case"mutation":return e.getMutationType();case"subscription":return e.getSubscriptionType()}}function Tre(e,t,n,r,i,a,o,u){let l=Nre(n,t),{fields:d}=(0,_O.collectFields)(n,r,i,l,t.selectionSet);return SO(e,l,d,n,r,i,a,0,o,u)}function SO(e,t,n,r,i,a,o,u,l,d){var re;let p=t.getFields(),E=o==null?void 0:o[t.name],h=E==null?void 0:E.__enter,v=h!=null?h(e):e,A,B=null;if(l!=null){A=hre(l,u),B=A.errorMap;for(let ie of A.unpathedErrors)d.unpathedErrors.add(ie)}for(let[ie,Ne]of n){let Ee=Ne[0].name.value,_e=(re=p[Ee])==null?void 0:re.type;if(_e==null)switch(Ee){case"__typename":_e=Lu.TypeNameMetaFieldDef.type;break;case"__schema":_e=Lu.SchemaMetaFieldDef.type;break;case"__type":_e=Lu.TypeMetaFieldDef.type;break}let ye=u+1,qe;B&&(qe=B[ie],qe!=null&&delete B[ie],yre(t,Ee,ye,qe,d));let Z=IM(e[ie],_e,Ne,r,i,a,o,ye,qe,d);yM(v,ie,Z,E,Ee)}let V=v.__typename;if(V!=null&&yM(v,"__typename",V,E,"__typename"),B)for(let ie in B){let Ne=B[ie];for(let Ee of Ne)d.unpathedErrors.add(Ee)}let J=E==null?void 0:E.__leave;return J!=null?J(v):v}function yM(e,t,n,r,i){if(r==null){e[t]=n;return}let a=r[i];if(a==null){e[t]=n;return}let o=a(n);if(o===void 0){delete e[t];return}e[t]=o}function Ere(e,t,n,r,i,a,o,u,l,d){return e.map(p=>IM(p,t,n,r,i,a,o,u+1,l,d))}function IM(e,t,n,r,i,a,o,u,l=[],d){if(e==null)return e;let p=(0,Lu.getNullableType)(t);if((0,Lu.isListType)(p))return Ere(e,p.ofType,n,r,i,a,o,u,l,d);if((0,Lu.isAbstractType)(p)){let v=r.getType(e.__typename),{fields:A,patches:B}=(0,_O.collectSubFields)(r,i,a,v,n);if(B.length){A=new Map(A);for(let V of B)for(let[J,re]of V.fields){let ie=A.get(J);ie?ie.push(...re):A.set(J,re)}}return SO(e,v,A,r,i,a,o,u,l,d)}else if((0,Lu.isObjectType)(p)){let{fields:v,patches:A}=(0,_O.collectSubFields)(r,i,a,p,n);if(A.length){v=new Map(v);for(let B of A)for(let[V,J]of B.fields){let re=v.get(V);re?re.push(...J):v.set(V,J)}}return SO(e,p,v,r,i,a,o,u,l,d)}let E=o==null?void 0:o[p.name];if(E==null)return e;let h=E(e);return h===void 0?e:h}function hre(e,t){var i;let n=Object.create(null),r=new Set;for(let a of e){let o=(i=a.path)==null?void 0:i[t];if(o==null){r.add(a);continue}o in n?n[o].push(a):n[o]=[a]}return{errorMap:n,unpathedErrors:r}}function yre(e,t,n,r=[],i){for(let a of r){let o={type:e,fieldName:t,pathIndex:n},u=i.segmentInfoMap.get(a);u==null?i.segmentInfoMap.set(a,[o]):u.push(o)}}});var _M=F(DO=>{"use strict";m();T();N();Object.defineProperty(DO,"__esModule",{value:!0});DO.valueMatchesCriteria=OO;function OO(e,t){return e==null?e===t:Array.isArray(e)?Array.isArray(t)&&e.every((n,r)=>OO(n,t[r])):typeof e=="object"?typeof t=="object"&&t&&Object.keys(t).every(n=>OO(e[n],t[n])):t instanceof RegExp?t.test(e):e===t}});var vM=F(bO=>{"use strict";m();T();N();Object.defineProperty(bO,"__esModule",{value:!0});bO.isAsyncIterable=Ire;function Ire(e){return(e==null?void 0:e[Symbol.asyncIterator])!=null}});var SM=F(AO=>{"use strict";m();T();N();Object.defineProperty(AO,"__esModule",{value:!0});AO.isDocumentNode=_re;var gre=Se();function _re(e){return e&&typeof e=="object"&&"kind"in e&&e.kind===gre.Kind.DOCUMENT}});var OM=F(()=>{"use strict";m();T();N()});var RM=F(up=>{"use strict";m();T();N();Object.defineProperty(up,"__esModule",{value:!0});up.getAsyncIteratorWithCancel=bM;up.getAsyncIterableWithCancel=AM;up.withCancel=AM;var vre=wu();function Sre(e){return Ci(this,null,function*(){return{value:e,done:!0}})}var DM=(0,vre.memoize2)(function(t,n){return function(...i){return Reflect.apply(n,t,i)}});function bM(e,t){return new Proxy(e,{has(n,r){return r==="return"?!0:Reflect.has(n,r)},get(n,r,i){let a=Reflect.get(n,r,i);if(r==="return"){let o=a||Sre;return function(l){return Ci(this,null,function*(){let d=yield t(l);return Reflect.apply(o,n,[d])})}}else if(typeof a=="function")return DM(n,a);return a}})}function AM(e,t){return new Proxy(e,{get(n,r,i){let a=Reflect.get(n,r,i);return Symbol.asyncIterator===r?function(){let u=Reflect.apply(a,n,[]);return bM(u,t)}:typeof a=="function"?DM(n,a):a}})}});var PM=F(RO=>{"use strict";m();T();N();Object.defineProperty(RO,"__esModule",{value:!0});RO.fixSchemaAst=Are;var Ore=Se(),Dre=CS();function bre(e,t){let n=(0,Dre.getDocumentNodeFromSchema)(e);return(0,Ore.buildASTSchema)(n,M({},t||{}))}function Are(e,t){let n;return(!e.astNode||!e.extensionASTNodes)&&(n=bre(e,t)),!e.astNode&&(n!=null&&n.astNode)&&(e.astNode=n.astNode),!e.extensionASTNodes&&(n!=null&&n.astNode)&&(e.extensionASTNodes=n.extensionASTNodes),e}});var FM=F(PO=>{"use strict";m();T();N();Object.defineProperty(PO,"__esModule",{value:!0});PO.extractExtensionsFromSchema=Fre;var Rre=zl(),ks=wc(),Pre=rd();function _a(e,t){e=e||{};let a=e,{directives:n}=a,r=XR(a,["directives"]),i=M({},r);if(!t&&n!=null){let o={};for(let u in n)o[u]=[...(0,Rre.asArray)(n[u])];i.directives=o}return i}function Fre(e,t=!1){let n={schemaExtensions:_a(e.extensions,t),types:{}};return(0,Pre.mapSchema)(e,{[ks.MapperKind.OBJECT_TYPE]:r=>(n.types[r.name]={fields:{},type:"object",extensions:_a(r.extensions,t)},r),[ks.MapperKind.INTERFACE_TYPE]:r=>(n.types[r.name]={fields:{},type:"interface",extensions:_a(r.extensions,t)},r),[ks.MapperKind.FIELD]:(r,i,a)=>{n.types[a].fields[i]={arguments:{},extensions:_a(r.extensions,t)};let o=r.args;if(o!=null)for(let u in o)n.types[a].fields[i].arguments[u]=_a(o[u].extensions,t);return r},[ks.MapperKind.ENUM_TYPE]:r=>(n.types[r.name]={values:{},type:"enum",extensions:_a(r.extensions,t)},r),[ks.MapperKind.ENUM_VALUE]:(r,i,a,o)=>(n.types[i].values[o]=_a(r.extensions,t),r),[ks.MapperKind.SCALAR_TYPE]:r=>(n.types[r.name]={type:"scalar",extensions:_a(r.extensions,t)},r),[ks.MapperKind.UNION_TYPE]:r=>(n.types[r.name]={type:"union",extensions:_a(r.extensions,t)},r),[ks.MapperKind.INPUT_OBJECT_TYPE]:r=>(n.types[r.name]={fields:{},type:"input",extensions:_a(r.extensions,t)},r),[ks.MapperKind.INPUT_OBJECT_FIELD]:(r,i,a)=>(n.types[a].fields[i]={extensions:_a(r.extensions,t)},r)}),n}});var wM=F(cp=>{"use strict";m();T();N();Object.defineProperty(cp,"__esModule",{value:!0});cp.addPath=wre;cp.pathToArray=Lre;cp.printPathArray=Cre;function wre(e,t,n){return{prev:e,key:t,typename:n}}function Lre(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function Cre(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}});var CM=F(wO=>{"use strict";m();T();N();Object.defineProperty(wO,"__esModule",{value:!0});wO.mergeIncrementalResult=LM;var Ure=cO();function LM({incrementalResult:e,executionResult:t}){var r;let n=["data",...(r=e.path)!=null?r:[]];if(e.items)for(let i of e.items)FO(t,n,i),n[n.length-1]++;e.data&&FO(t,n,e.data),e.errors&&(t.errors=t.errors||[],t.errors.push(...e.errors)),e.extensions&&FO(t,["extensions"],e.extensions),e.incremental&&e.incremental.forEach(i=>{LM({incrementalResult:i,executionResult:t})})}function FO(e,t,n){let r=e,i;for(i=0;i{"use strict";m();T();N();Object.defineProperty(uE,"__esModule",{value:!0});uE.debugTimerStart=Bre;uE.debugTimerEnd=kre;var UM=new Set;function Bre(e){var n,r;let t=((r=(n=globalThis.process)==null?void 0:n.env)==null?void 0:r.DEBUG)||globalThis.DEBUG;(t==="1"||t!=null&&t.includes(e))&&(UM.add(e),console.time(e))}function kre(e){UM.has(e)&&console.timeEnd(e)}});var xM=F(lp=>{"use strict";m();T();N();Object.defineProperty(lp,"__esModule",{value:!0});lp.getAbortPromise=void 0;lp.registerAbortSignalListener=MM;var Mre=Wf(),kM=wu(),xre=(0,kM.memoize1)(function(t){let n=new Set;return t.addEventListener("abort",r=>{for(let i of n)i(r)},{once:!0}),n});function MM(e,t){if(e.aborted){t();return}xre(e).add(t)}lp.getAbortPromise=(0,kM.memoize1)(function(t){return t.aborted?(0,Mre.fakeRejectPromise)(t.reason):new Promise((n,r)=>{if(t.aborted){r(t.reason);return}MM(t,()=>{r(t.reason)})})})});var va=F(Le=>{"use strict";m();T();N();Object.defineProperty(Le,"__esModule",{value:!0});Le.createDeferred=Le.fakePromise=Le.mapMaybePromise=Le.mapAsyncIterator=Le.inspect=void 0;var Ye=(KB(),Wm(jB));Ye.__exportStar($B(),Le);Ye.__exportStar(zl(),Le);Ye.__exportStar(ES(),Le);Ye.__exportStar(yS(),Le);Ye.__exportStar(rk(),Le);Ye.__exportStar(vS(),Le);Ye.__exportStar(CS(),Le);Ye.__exportStar(yS(),Le);Ye.__exportStar(gk(),Le);Ye.__exportStar(_k(),Le);Ye.__exportStar(Uk(),Le);Ye.__exportStar(Kk(),Le);Ye.__exportStar(Gk(),Le);Ye.__exportStar(Xk(),Le);Ye.__exportStar(eM(),Le);Ye.__exportStar(tM(),Le);Ye.__exportStar(rM(),Le);Ye.__exportStar(iM(),Le);Ye.__exportStar(rd(),Le);Ye.__exportStar(sO(),Le);Ye.__exportStar(JT(),Le);Ye.__exportStar(sM(),Le);Ye.__exportStar(cO(),Le);Ye.__exportStar(wc(),Le);Ye.__exportStar(QS(),Le);Ye.__exportStar(uM(),Le);Ye.__exportStar(cM(),Le);Ye.__exportStar(lM(),Le);Ye.__exportStar(dM(),Le);Ye.__exportStar(JS(),Le);Ye.__exportStar(fM(),Le);Ye.__exportStar(jT(),Le);Ye.__exportStar(pM(),Le);Ye.__exportStar(BT(),Le);Ye.__exportStar(NM(),Le);Ye.__exportStar(gM(),Le);Ye.__exportStar(mS(),Le);Ye.__exportStar(_M(),Le);Ye.__exportStar(vM(),Le);Ye.__exportStar(SM(),Le);Ye.__exportStar(Xf(),Le);Ye.__exportStar(OM(),Le);Ye.__exportStar(RM(),Le);Ye.__exportStar(ep(),Le);Ye.__exportStar(kS(),Le);Ye.__exportStar(IO(),Le);var qre=Hf();Object.defineProperty(Le,"inspect",{enumerable:!0,get:function(){return qre.inspect}});Ye.__exportStar(wu(),Le);Ye.__exportStar(PM(),Le);Ye.__exportStar(gO(),Le);Ye.__exportStar(FM(),Le);Ye.__exportStar(wM(),Le);Ye.__exportStar(xT(),Le);Ye.__exportStar(EO(),Le);Ye.__exportStar(CM(),Le);Ye.__exportStar(BM(),Le);Ye.__exportStar(TS(),Le);var cE=Wf();Object.defineProperty(Le,"mapAsyncIterator",{enumerable:!0,get:function(){return cE.mapAsyncIterator}});Object.defineProperty(Le,"mapMaybePromise",{enumerable:!0,get:function(){return cE.mapMaybePromise}});Object.defineProperty(Le,"fakePromise",{enumerable:!0,get:function(){return cE.fakePromise}});Object.defineProperty(Le,"createDeferred",{enumerable:!0,get:function(){return cE.createDeferredPromise}});Ye.__exportStar(xM(),Le)});var VM=F(lE=>{"use strict";m();T();N();Object.defineProperty(lE,"__esModule",{value:!0});lE.mergeResolvers=void 0;var Vre=va();function qM(e,t){if(!e||Array.isArray(e)&&e.length===0)return{};if(!Array.isArray(e))return e;if(e.length===1)return e[0]||{};let n=new Array;for(let i of e)Array.isArray(i)&&(i=qM(i)),typeof i=="object"&&i&&n.push(i);let r=(0,Vre.mergeDeep)(n,!0);if(t!=null&&t.exclusions)for(let i of t.exclusions){let[a,o]=i.split(".");!o||o==="*"?delete r[a]:r[a]&&delete r[a][o]}return r}lE.mergeResolvers=qM});var LO=F(dE=>{"use strict";m();T();N();Object.defineProperty(dE,"__esModule",{value:!0});dE.mergeArguments=void 0;var jM=va();function jre(e,t,n){let r=Kre([...t,...e].filter(jM.isSome),n);return n&&n.sort&&r.sort(jM.compareNodes),r}dE.mergeArguments=jre;function Kre(e,t){return e.reduce((n,r)=>{let i=n.findIndex(a=>a.name.value===r.name.value);return i===-1?n.concat([r]):(t!=null&&t.reverseArguments||(n[i]=r),n)},[])}});var ta=F(od=>{"use strict";m();T();N();Object.defineProperty(od,"__esModule",{value:!0});od.mergeDirective=od.mergeDirectives=void 0;var KM=Se(),$re=va();function Gre(e,t){return!!e.find(n=>n.name.value===t.name.value)}function $M(e,t){var n;return!!((n=t==null?void 0:t[e.name.value])!=null&&n.repeatable)}function Qre(e,t){return t.some(({value:n})=>n===e.value)}function GM(e,t){let n=[...t];for(let r of e){let i=n.findIndex(a=>a.name.value===r.name.value);if(i>-1){let a=n[i];if(a.value.kind==="ListValue"){let o=a.value.values,u=r.value.values;a.value.values=Wre(o,u,(l,d)=>{let p=l.value;return!p||!d.some(E=>E.value===p)})}else a.value=r.value}else n.push(r)}return n}function Yre(e,t){return e.map((n,r,i)=>{let a=i.findIndex(o=>o.name.value===n.name.value);if(a!==r&&!$M(n,t)){let o=i[a];return n.arguments=GM(n.arguments,o.arguments),null}return n}).filter($re.isSome)}function Jre(e=[],t=[],n,r){let i=n&&n.reverseDirectives,a=i?e:t,o=i?t:e,u=Yre([...a],r);for(let l of o)if(Gre(u,l)&&!$M(l,r)){let d=u.findIndex(E=>E.name.value===l.name.value),p=u[d];u[d].arguments=GM(l.arguments||[],p.arguments||[])}else u.push(l);return u}od.mergeDirectives=Jre;function zre(e,t){let n=(0,KM.print)($(M({},e),{description:void 0})),r=(0,KM.print)($(M({},t),{description:void 0})),i=new RegExp("(directive @w*d*)|( on .*$)","g");if(!(n.replace(i,"")===r.replace(i,"")))throw new Error(`Unable to merge GraphQL directive "${e.name.value}". +`);return i.description?W(q({},i),{description:W(q({},i.description),{value:i.description.value+` +`+o,block:!0})}):W(q({},i),{description:{kind:ea.Kind.STRING,value:o,block:u}})}}}})}function Jk(e){return(0,ea.isTypeSystemDefinitionNode)(e)||e.kind===ea.Kind.FIELD_DEFINITION||e.kind===ea.Kind.INPUT_VALUE_DEFINITION||e.kind===ea.Kind.ENUM_VALUE_DEFINITION}});var rM=F(iO=>{"use strict";m();T();N();Object.defineProperty(iO,"__esModule",{value:!0});iO.buildOperationNodeForField=_ne;var Nt=Oe(),gne=sf(),Zk=uf(),rO=[],aE=new Map;function eM(e){rO.push(e)}function zk(){rO=[]}function Wk(){aE=new Map}function _ne({schema:e,kind:t,field:n,models:r,ignore:i=[],depthLimit:a,circularReferenceDepth:o,argNames:u,selectedFields:l=!0}){zk(),Wk();let d=(0,Zk.getRootTypeNames)(e),p=vne({schema:e,fieldName:n,kind:t,models:r||[],ignore:i,depthLimit:a||1/0,circularReferenceDepth:o||1,argNames:u,selectedFields:l,rootTypeNames:d});return p.variableDefinitions=[...rO],zk(),Wk(),p}function vne({schema:e,fieldName:t,kind:n,models:r,ignore:i,depthLimit:a,circularReferenceDepth:o,argNames:u,selectedFields:l,rootTypeNames:d}){let p=(0,Zk.getDefinedRootType)(e,n),E=p.getFields()[t],h=`${t}_${n}`;if(E.args)for(let _ of E.args){let S=_.name;(!u||u.includes(S))&&eM(tM(_,S))}return{kind:Nt.Kind.OPERATION_DEFINITION,operation:n,name:{kind:Nt.Kind.NAME,value:h},variableDefinitions:[],selectionSet:{kind:Nt.Kind.SELECTION_SET,selections:[nM({type:p,field:E,models:r,firstCall:!0,path:[],ancestors:[],ignore:i,depthLimit:a,circularReferenceDepth:o,schema:e,depth:0,argNames:u,selectedFields:l,rootTypeNames:d})]}}}function nO({parent:e,type:t,models:n,firstCall:r,path:i,ancestors:a,ignore:o,depthLimit:u,circularReferenceDepth:l,schema:d,depth:p,argNames:E,selectedFields:h,rootTypeNames:_}){if(!(typeof h=="boolean"&&p>u)){if((0,Nt.isUnionType)(t)){let S=t.getTypes();return{kind:Nt.Kind.SELECTION_SET,selections:S.filter(k=>!tO([...a,k],{depth:l})).map(k=>({kind:Nt.Kind.INLINE_FRAGMENT,typeCondition:{kind:Nt.Kind.NAMED_TYPE,name:{kind:Nt.Kind.NAME,value:k.name}},selectionSet:nO({parent:t,type:k,models:n,path:i,ancestors:a,ignore:o,depthLimit:u,circularReferenceDepth:l,schema:d,depth:p,argNames:E,selectedFields:h,rootTypeNames:_})})).filter(k=>{var B,K;return((K=(B=k==null?void 0:k.selectionSet)==null?void 0:B.selections)==null?void 0:K.length)>0})}}if((0,Nt.isInterfaceType)(t)){let S=Object.values(d.getTypeMap()).filter(k=>(0,Nt.isObjectType)(k)&&k.getInterfaces().includes(t));return{kind:Nt.Kind.SELECTION_SET,selections:S.filter(k=>!tO([...a,k],{depth:l})).map(k=>({kind:Nt.Kind.INLINE_FRAGMENT,typeCondition:{kind:Nt.Kind.NAMED_TYPE,name:{kind:Nt.Kind.NAME,value:k.name}},selectionSet:nO({parent:t,type:k,models:n,path:i,ancestors:a,ignore:o,depthLimit:u,circularReferenceDepth:l,schema:d,depth:p,argNames:E,selectedFields:h,rootTypeNames:_})})).filter(k=>{var B,K;return((K=(B=k==null?void 0:k.selectionSet)==null?void 0:B.selections)==null?void 0:K.length)>0})}}if((0,Nt.isObjectType)(t)&&!_.has(t.name)){let S=o.includes(t.name)||o.includes(`${e.name}.${i[i.length-1]}`),k=n.includes(t.name);if(!r&&k&&!S)return{kind:Nt.Kind.SELECTION_SET,selections:[{kind:Nt.Kind.FIELD,name:{kind:Nt.Kind.NAME,value:"id"}}]};let B=t.getFields();return{kind:Nt.Kind.SELECTION_SET,selections:Object.keys(B).filter(K=>!tO([...a,(0,Nt.getNamedType)(B[K].type)],{depth:l})).map(K=>{let ne=typeof h=="object"?h[K]:!0;return ne?nM({type:t,field:B[K],models:n,path:[...i,K],ancestors:a,ignore:o,depthLimit:u,circularReferenceDepth:l,schema:d,depth:p,argNames:E,selectedFields:ne,rootTypeNames:_}):null}).filter(K=>{var ne,ee;return K==null?!1:"selectionSet"in K?!!((ee=(ne=K.selectionSet)==null?void 0:ne.selections)!=null&&ee.length):!0})}}}}function tM(e,t){function n(i){return(0,Nt.isListType)(i)?{kind:Nt.Kind.LIST_TYPE,type:n(i.ofType)}:(0,Nt.isNonNullType)(i)?{kind:Nt.Kind.NON_NULL_TYPE,type:n(i.ofType)}:{kind:Nt.Kind.NAMED_TYPE,name:{kind:Nt.Kind.NAME,value:i.name}}}let r;try{let i=(0,Nt.astFromValue)(e.defaultValue,e.type);i==null?r=void 0:r=i}catch(i){let a=(0,gne.astFromValueUntyped)(e.defaultValue);a==null?r=void 0:r=a}return{kind:Nt.Kind.VARIABLE_DEFINITION,variable:{kind:Nt.Kind.VARIABLE,name:{kind:Nt.Kind.NAME,value:t||e.name}},type:n(e.type),defaultValue:r}}function Xk(e,t){return[...t,e].join("_")}function nM({type:e,field:t,models:n,firstCall:r,path:i,ancestors:a,ignore:o,depthLimit:u,circularReferenceDepth:l,schema:d,depth:p,argNames:E,selectedFields:h,rootTypeNames:_}){let S=(0,Nt.getNamedType)(t.type),k=[],B=!1;if(t.args&&t.args.length&&(k=t.args.map(oe=>{let de=Xk(oe.name,i);return E&&!E.includes(de)?((0,Nt.isNonNullType)(oe.type)&&(B=!0),null):(r||eM(tM(oe,de)),{kind:Nt.Kind.ARGUMENT,name:{kind:Nt.Kind.NAME,value:oe.name},value:{kind:Nt.Kind.VARIABLE,name:{kind:Nt.Kind.NAME,value:Xk(oe.name,i)}}})}).filter(Boolean)),B)return null;let K=[...i,t.name],ne=K.join("."),ee=t.name;return aE.has(ne)&&aE.get(ne)!==t.type.toString()&&(ee+=t.type.toString().replace(/!/g,"NonNull").replace(/\[/g,"List").replace(/\]/g,"")),aE.set(ne,t.type.toString()),!(0,Nt.isScalarType)(S)&&!(0,Nt.isEnumType)(S)?W(q({kind:Nt.Kind.FIELD,name:{kind:Nt.Kind.NAME,value:t.name}},ee!==t.name&&{alias:{kind:Nt.Kind.NAME,value:ee}}),{selectionSet:nO({parent:e,type:S,models:n,firstCall:r,path:K,ancestors:[...a,e],ignore:o,depthLimit:u,circularReferenceDepth:l,schema:d,depth:p+1,argNames:E,selectedFields:h,rootTypeNames:_})||void 0,arguments:k}):W(q({kind:Nt.Kind.FIELD,name:{kind:Nt.Kind.NAME,value:t.name}},ee!==t.name&&{alias:{kind:Nt.Kind.NAME,value:ee}}),{arguments:k})}function tO(e,t={depth:1}){let n=e[e.length-1];return(0,Nt.isScalarType)(n)?!1:e.filter(i=>i.name===n.name).length>t.depth}});var aM=F(sE=>{"use strict";m();T();N();Object.defineProperty(sE,"__esModule",{value:!0});sE.DirectiveLocation=void 0;var iM;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(iM||(sE.DirectiveLocation=iM={}))});var qc=F(oE=>{"use strict";m();T();N();Object.defineProperty(oE,"__esModule",{value:!0});oE.MapperKind=void 0;var sM;(function(e){e.TYPE="MapperKind.TYPE",e.SCALAR_TYPE="MapperKind.SCALAR_TYPE",e.ENUM_TYPE="MapperKind.ENUM_TYPE",e.COMPOSITE_TYPE="MapperKind.COMPOSITE_TYPE",e.OBJECT_TYPE="MapperKind.OBJECT_TYPE",e.INPUT_OBJECT_TYPE="MapperKind.INPUT_OBJECT_TYPE",e.ABSTRACT_TYPE="MapperKind.ABSTRACT_TYPE",e.UNION_TYPE="MapperKind.UNION_TYPE",e.INTERFACE_TYPE="MapperKind.INTERFACE_TYPE",e.ROOT_OBJECT="MapperKind.ROOT_OBJECT",e.QUERY="MapperKind.QUERY",e.MUTATION="MapperKind.MUTATION",e.SUBSCRIPTION="MapperKind.SUBSCRIPTION",e.DIRECTIVE="MapperKind.DIRECTIVE",e.FIELD="MapperKind.FIELD",e.COMPOSITE_FIELD="MapperKind.COMPOSITE_FIELD",e.OBJECT_FIELD="MapperKind.OBJECT_FIELD",e.ROOT_FIELD="MapperKind.ROOT_FIELD",e.QUERY_ROOT_FIELD="MapperKind.QUERY_ROOT_FIELD",e.MUTATION_ROOT_FIELD="MapperKind.MUTATION_ROOT_FIELD",e.SUBSCRIPTION_ROOT_FIELD="MapperKind.SUBSCRIPTION_ROOT_FIELD",e.INTERFACE_FIELD="MapperKind.INTERFACE_FIELD",e.INPUT_OBJECT_FIELD="MapperKind.INPUT_OBJECT_FIELD",e.ARGUMENT="MapperKind.ARGUMENT",e.ENUM_VALUE="MapperKind.ENUM_VALUE"})(sM||(oE.MapperKind=sM={}))});var sO=F(aO=>{"use strict";m();T();N();Object.defineProperty(aO,"__esModule",{value:!0});aO.getObjectTypeFromTypeMap=One;var Sne=Oe();function One(e,t){if(t){let n=e[t.name];if((0,Sne.isObjectType)(n))return n}}});var cO=F(od=>{"use strict";m();T();N();Object.defineProperty(od,"__esModule",{value:!0});od.createNamedStub=oO;od.createStub=uO;od.isNamedStub=Dne;od.getBuiltInForStub=bne;var gr=Oe();function oO(e,t){let n;return t==="object"?n=gr.GraphQLObjectType:t==="interface"?n=gr.GraphQLInterfaceType:n=gr.GraphQLInputObjectType,new n({name:e,fields:{_fake:{type:gr.GraphQLString}}})}function uO(e,t){switch(e.kind){case gr.Kind.LIST_TYPE:return new gr.GraphQLList(uO(e.type,t));case gr.Kind.NON_NULL_TYPE:return new gr.GraphQLNonNull(uO(e.type,t));default:return t==="output"?oO(e.name.value,"object"):oO(e.name.value,"input")}}function Dne(e){if("getFields"in e){let t=e.getFields();for(let n in t)return t[n].name==="_fake"}return!1}function bne(e){switch(e.name){case gr.GraphQLInt.name:return gr.GraphQLInt;case gr.GraphQLFloat.name:return gr.GraphQLFloat;case gr.GraphQLString.name:return gr.GraphQLString;case gr.GraphQLBoolean.name:return gr.GraphQLBoolean;case gr.GraphQLID.name:return gr.GraphQLID;default:return e}}});var uE=F(lO=>{"use strict";m();T();N();Object.defineProperty(lO,"__esModule",{value:!0});lO.rewireTypes=Ane;var rr=Oe(),oM=cO();function Ane(e,t){let n=Object.create(null);for(let h in e)n[h]=e[h];let r=Object.create(null);for(let h in n){let _=n[h];if(_==null||h.startsWith("__"))continue;let S=_.name;if(!S.startsWith("__")){if(r[S]!=null){console.warn(`Duplicate schema type name ${S} found; keeping the existing one found in the schema`);continue}r[S]=_}}for(let h in r)r[h]=u(r[h]);let i=t.map(h=>a(h));return{typeMap:r,directives:i};function a(h){if((0,rr.isSpecifiedDirective)(h))return h;let _=h.toConfig();return _.args=o(_.args),new rr.GraphQLDirective(_)}function o(h){let _={};for(let S in h){let k=h[S],B=E(k.type);B!=null&&(k.type=B,_[S]=k)}return _}function u(h){if((0,rr.isObjectType)(h)){let _=h.toConfig(),S=W(q({},_),{fields:()=>l(_.fields),interfaces:()=>p(_.interfaces)});return new rr.GraphQLObjectType(S)}else if((0,rr.isInterfaceType)(h)){let _=h.toConfig(),S=W(q({},_),{fields:()=>l(_.fields)});return"interfaces"in S&&(S.interfaces=()=>p(_.interfaces)),new rr.GraphQLInterfaceType(S)}else if((0,rr.isUnionType)(h)){let _=h.toConfig(),S=W(q({},_),{types:()=>p(_.types)});return new rr.GraphQLUnionType(S)}else if((0,rr.isInputObjectType)(h)){let _=h.toConfig(),S=W(q({},_),{fields:()=>d(_.fields)});return new rr.GraphQLInputObjectType(S)}else if((0,rr.isEnumType)(h)){let _=h.toConfig();return new rr.GraphQLEnumType(_)}else if((0,rr.isScalarType)(h)){if((0,rr.isSpecifiedScalarType)(h))return h;let _=h.toConfig();return new rr.GraphQLScalarType(_)}throw new Error(`Unexpected schema type: ${h}`)}function l(h){let _={};for(let S in h){let k=h[S],B=E(k.type);B!=null&&k.args&&(k.type=B,k.args=o(k.args),_[S]=k)}return _}function d(h){let _={};for(let S in h){let k=h[S],B=E(k.type);B!=null&&(k.type=B,_[S]=k)}return _}function p(h){let _=[];for(let S of h){let k=E(S);k!=null&&_.push(k)}return _}function E(h){if((0,rr.isListType)(h)){let _=E(h.ofType);return _!=null?new rr.GraphQLList(_):null}else if((0,rr.isNonNullType)(h)){let _=E(h.ofType);return _!=null?new rr.GraphQLNonNull(_):null}else if((0,rr.isNamedType)(h)){let _=n[h.name];return _===void 0&&(_=(0,oM.isNamedStub)(h)?(0,oM.getBuiltInForStub)(h):u(h),r[_.name]=n[h.name]=_),_!=null?r[_.name]:null}return null}}});var dO=F(cd=>{"use strict";m();T();N();Object.defineProperty(cd,"__esModule",{value:!0});cd.transformInputValue=ud;cd.serializeInputValue=Pne;cd.parseInputValue=Fne;cd.parseInputValueLiteral=Lne;var cE=Oe(),Rne=rd();function ud(e,t,n=null,r=null){if(t==null)return t;let i=(0,cE.getNullableType)(e);if((0,cE.isLeafType)(i))return n!=null?n(i,t):t;if((0,cE.isListType)(i))return(0,Rne.asArray)(t).map(a=>ud(i.ofType,a,n,r));if((0,cE.isInputObjectType)(i)){let a=i.getFields(),o={};for(let u in t){let l=a[u];l!=null&&(o[u]=ud(l.type,t[u],n,r))}return r!=null?r(i,o):o}}function Pne(e,t){return ud(e,t,(n,r)=>{try{return n.serialize(r)}catch(i){return r}})}function Fne(e,t){return ud(e,t,(n,r)=>{try{return n.parseValue(r)}catch(i){return r}})}function Lne(e,t){return ud(e,t,(n,r)=>n.parseLiteral(r,{}))}});var dd=F(dE=>{"use strict";m();T();N();Object.defineProperty(dE,"__esModule",{value:!0});dE.mapSchema=Cne;dE.correctASTNodes=ff;var ct=Oe(),ld=sO(),Ut=qc(),wne=uE(),uM=dO();function Cne(e,t={}){let n=dM(lM(pO(cM(Bne(pO(cM(e.getTypeMap(),e,uM.serializeInputValue),e,t,u=>(0,ct.isLeafType)(u)),e,t),e,uM.parseInputValue),e,t,u=>!(0,ct.isLeafType)(u)),e,t),e,t),r=e.getDirectives(),i=kne(r,e,t),{typeMap:a,directives:o}=(0,wne.rewireTypes)(n,i);return new ct.GraphQLSchema(W(q({},e.toConfig()),{query:(0,ld.getObjectTypeFromTypeMap)(a,(0,ld.getObjectTypeFromTypeMap)(n,e.getQueryType())),mutation:(0,ld.getObjectTypeFromTypeMap)(a,(0,ld.getObjectTypeFromTypeMap)(n,e.getMutationType())),subscription:(0,ld.getObjectTypeFromTypeMap)(a,(0,ld.getObjectTypeFromTypeMap)(n,e.getSubscriptionType())),types:Object.values(a),directives:o}))}var Une=["String","ID","Int","Float","Boolean"];function pO(e,t,n,r=()=>!0){let i={};for(let a in e)if(!a.startsWith("__")&&!Une.includes(a)){let o=e[a];if(o==null||!r(o)){i[a]=o;continue}let u=xne(t,n,a);if(u==null){i[a]=o;continue}let l=u(o,t);if(l===void 0){i[a]=o;continue}i[a]=l}return i}function Bne(e,t,n){let r=$ne(n);return r?pO(e,t,{[Ut.MapperKind.ENUM_TYPE]:i=>{let a=i.toConfig(),o=a.values,u={};for(let l in o){let d=o[l],p=r(d,i.name,t,l);if(p===void 0)u[l]=d;else if(Array.isArray(p)){let[E,h]=p;u[E]=h===void 0?d:h}else p!==null&&(u[l]=p)}return ff(new ct.GraphQLEnumType(W(q({},a),{values:u})))}},i=>(0,ct.isEnumType)(i)):e}function cM(e,t,n){let r=dM(e,t,{[Ut.MapperKind.ARGUMENT]:i=>{if(i.defaultValue===void 0)return i;let a=lE(e,i.type);if(a!=null)return W(q({},i),{defaultValue:n(a,i.defaultValue)})}});return lM(r,t,{[Ut.MapperKind.INPUT_OBJECT_FIELD]:i=>{if(i.defaultValue===void 0)return i;let a=lE(r,i.type);if(a!=null)return W(q({},i),{defaultValue:n(a,i.defaultValue)})}})}function lE(e,t){if((0,ct.isListType)(t)){let n=lE(e,t.ofType);return n!=null?new ct.GraphQLList(n):null}else if((0,ct.isNonNullType)(t)){let n=lE(e,t.ofType);return n!=null?new ct.GraphQLNonNull(n):null}else if((0,ct.isNamedType)(t)){let n=e[t.name];return n!=null?n:null}return null}function lM(e,t,n){let r={};for(let i in e)if(!i.startsWith("__")){let a=e[i];if(!(0,ct.isObjectType)(a)&&!(0,ct.isInterfaceType)(a)&&!(0,ct.isInputObjectType)(a)){r[i]=a;continue}let o=Vne(t,n,i);if(o==null){r[i]=a;continue}let u=a.toConfig(),l=u.fields,d={};for(let p in l){let E=l[p],h=o(E,p,i,t);if(h===void 0)d[p]=E;else if(Array.isArray(h)){let[_,S]=h;S.astNode!=null&&(S.astNode=W(q({},S.astNode),{name:W(q({},S.astNode.name),{value:_})})),d[_]=S===void 0?E:S}else h!==null&&(d[p]=h)}(0,ct.isObjectType)(a)?r[i]=ff(new ct.GraphQLObjectType(W(q({},u),{fields:d}))):(0,ct.isInterfaceType)(a)?r[i]=ff(new ct.GraphQLInterfaceType(W(q({},u),{fields:d}))):r[i]=ff(new ct.GraphQLInputObjectType(W(q({},u),{fields:d})))}return r}function dM(e,t,n){let r={};for(let i in e)if(!i.startsWith("__")){let a=e[i];if(!(0,ct.isObjectType)(a)&&!(0,ct.isInterfaceType)(a)){r[i]=a;continue}let o=Kne(n);if(o==null){r[i]=a;continue}let u=a.toConfig(),l=u.fields,d={};for(let p in l){let E=l[p],h=E.args;if(h==null){d[p]=E;continue}let _=Object.keys(h);if(!_.length){d[p]=E;continue}let S={};for(let k of _){let B=h[k],K=o(B,p,i,t);if(K===void 0)S[k]=B;else if(Array.isArray(K)){let[ne,ee]=K;S[ne]=ee}else K!==null&&(S[k]=K)}d[p]=W(q({},E),{args:S})}(0,ct.isObjectType)(a)?r[i]=new ct.GraphQLObjectType(W(q({},u),{fields:d})):(0,ct.isInterfaceType)(a)?r[i]=new ct.GraphQLInterfaceType(W(q({},u),{fields:d})):r[i]=new ct.GraphQLInputObjectType(W(q({},u),{fields:d}))}return r}function kne(e,t,n){let r=jne(n);if(r==null)return e.slice();let i=[];for(let a of e){let o=r(a,t);o===void 0?i.push(a):o!==null&&i.push(o)}return i}function Mne(e,t){var i,a,o;let n=e.getType(t),r=[Ut.MapperKind.TYPE];return(0,ct.isObjectType)(n)?(r.push(Ut.MapperKind.COMPOSITE_TYPE,Ut.MapperKind.OBJECT_TYPE),t===((i=e.getQueryType())==null?void 0:i.name)?r.push(Ut.MapperKind.ROOT_OBJECT,Ut.MapperKind.QUERY):t===((a=e.getMutationType())==null?void 0:a.name)?r.push(Ut.MapperKind.ROOT_OBJECT,Ut.MapperKind.MUTATION):t===((o=e.getSubscriptionType())==null?void 0:o.name)&&r.push(Ut.MapperKind.ROOT_OBJECT,Ut.MapperKind.SUBSCRIPTION)):(0,ct.isInputObjectType)(n)?r.push(Ut.MapperKind.INPUT_OBJECT_TYPE):(0,ct.isInterfaceType)(n)?r.push(Ut.MapperKind.COMPOSITE_TYPE,Ut.MapperKind.ABSTRACT_TYPE,Ut.MapperKind.INTERFACE_TYPE):(0,ct.isUnionType)(n)?r.push(Ut.MapperKind.COMPOSITE_TYPE,Ut.MapperKind.ABSTRACT_TYPE,Ut.MapperKind.UNION_TYPE):(0,ct.isEnumType)(n)?r.push(Ut.MapperKind.ENUM_TYPE):(0,ct.isScalarType)(n)&&r.push(Ut.MapperKind.SCALAR_TYPE),r}function xne(e,t,n){let r=Mne(e,n),i,a=[...r];for(;!i&&a.length>0;){let o=a.pop();i=t[o]}return i!=null?i:null}function qne(e,t){var i,a,o;let n=e.getType(t),r=[Ut.MapperKind.FIELD];return(0,ct.isObjectType)(n)?(r.push(Ut.MapperKind.COMPOSITE_FIELD,Ut.MapperKind.OBJECT_FIELD),t===((i=e.getQueryType())==null?void 0:i.name)?r.push(Ut.MapperKind.ROOT_FIELD,Ut.MapperKind.QUERY_ROOT_FIELD):t===((a=e.getMutationType())==null?void 0:a.name)?r.push(Ut.MapperKind.ROOT_FIELD,Ut.MapperKind.MUTATION_ROOT_FIELD):t===((o=e.getSubscriptionType())==null?void 0:o.name)&&r.push(Ut.MapperKind.ROOT_FIELD,Ut.MapperKind.SUBSCRIPTION_ROOT_FIELD)):(0,ct.isInterfaceType)(n)?r.push(Ut.MapperKind.COMPOSITE_FIELD,Ut.MapperKind.INTERFACE_FIELD):(0,ct.isInputObjectType)(n)&&r.push(Ut.MapperKind.INPUT_OBJECT_FIELD),r}function Vne(e,t,n){let r=qne(e,n),i,a=[...r];for(;!i&&a.length>0;){let o=a.pop();i=t[o]}return i!=null?i:null}function Kne(e){let t=e[Ut.MapperKind.ARGUMENT];return t!=null?t:null}function jne(e){let t=e[Ut.MapperKind.DIRECTIVE];return t!=null?t:null}function $ne(e){let t=e[Ut.MapperKind.ENUM_VALUE];return t!=null?t:null}function ff(e){if((0,ct.isObjectType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=W(q({},t.astNode),{kind:ct.Kind.OBJECT_TYPE_DEFINITION,fields:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>W(q({},n),{kind:ct.Kind.OBJECT_TYPE_EXTENSION,fields:void 0}))),new ct.GraphQLObjectType(t)}else if((0,ct.isInterfaceType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=W(q({},t.astNode),{kind:ct.Kind.INTERFACE_TYPE_DEFINITION,fields:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>W(q({},n),{kind:ct.Kind.INTERFACE_TYPE_EXTENSION,fields:void 0}))),new ct.GraphQLInterfaceType(t)}else if((0,ct.isInputObjectType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=W(q({},t.astNode),{kind:ct.Kind.INPUT_OBJECT_TYPE_DEFINITION,fields:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>W(q({},n),{kind:ct.Kind.INPUT_OBJECT_TYPE_EXTENSION,fields:void 0}))),new ct.GraphQLInputObjectType(t)}else if((0,ct.isEnumType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.values){let i=t.values[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=W(q({},t.astNode),{values:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>W(q({},n),{values:void 0}))),new ct.GraphQLEnumType(t)}else return e}});var pM=F(NO=>{"use strict";m();T();N();Object.defineProperty(NO,"__esModule",{value:!0});NO.filterSchema=Qne;var pE=Oe(),va=qc(),Gne=dd();function Qne({schema:e,typeFilter:t=()=>!0,fieldFilter:n=void 0,rootFieldFilter:r=void 0,objectFieldFilter:i=void 0,interfaceFieldFilter:a=void 0,inputObjectFieldFilter:o=void 0,argumentFilter:u=void 0,directiveFilter:l=void 0,enumValueFilter:d=void 0}){return(0,Gne.mapSchema)(e,{[va.MapperKind.QUERY]:E=>fO(E,"Query",r,u),[va.MapperKind.MUTATION]:E=>fO(E,"Mutation",r,u),[va.MapperKind.SUBSCRIPTION]:E=>fO(E,"Subscription",r,u),[va.MapperKind.OBJECT_TYPE]:E=>t(E.name,E)?mO(pE.GraphQLObjectType,E,i||n,u):null,[va.MapperKind.INTERFACE_TYPE]:E=>t(E.name,E)?mO(pE.GraphQLInterfaceType,E,a||n,u):null,[va.MapperKind.INPUT_OBJECT_TYPE]:E=>t(E.name,E)?mO(pE.GraphQLInputObjectType,E,o||n):null,[va.MapperKind.UNION_TYPE]:E=>t(E.name,E)?void 0:null,[va.MapperKind.ENUM_TYPE]:E=>t(E.name,E)?void 0:null,[va.MapperKind.SCALAR_TYPE]:E=>t(E.name,E)?void 0:null,[va.MapperKind.DIRECTIVE]:E=>l&&!l(E.name,E)?null:void 0,[va.MapperKind.ENUM_VALUE]:(E,h,_,S)=>d&&!d(h,S,E)?null:void 0})}function fO(e,t,n,r){if(n||r){let i=e.toConfig();for(let a in i.fields){let o=i.fields[a];if(n&&!n(t,a,i.fields[a]))delete i.fields[a];else if(r&&o.args)for(let u in o.args)r(e.name,a,u,o.args[u])||delete o.args[u]}return new pE.GraphQLObjectType(i)}return e}function mO(e,t,n,r){if(n||r){let i=t.toConfig();for(let a in i.fields){let o=i.fields[a];if(n&&!n(t.name,a,i.fields[a]))delete i.fields[a];else if(r&&"args"in o)for(let u in o.args)r(t.name,a,u,o.args[u])||delete o.args[u]}return new e(i)}}});var mM=F(fE=>{"use strict";m();T();N();Object.defineProperty(fE,"__esModule",{value:!0});fE.healSchema=Yne;fE.healTypes=fM;var rs=Oe();function Yne(e){return fM(e.getTypeMap(),e.getDirectives()),e}function fM(e,t){let n=Object.create(null);for(let d in e){let p=e[d];if(p==null||d.startsWith("__"))continue;let E=p.name;if(!E.startsWith("__")){if(n[E]!=null){console.warn(`Duplicate schema type name ${E} found; keeping the existing one found in the schema`);continue}n[E]=p}}for(let d in n){let p=n[d];e[d]=p}for(let d of t)d.args=d.args.filter(p=>(p.type=l(p.type),p.type!==null));for(let d in e){let p=e[d];!d.startsWith("__")&&d in n&&p!=null&&r(p)}for(let d in e)!d.startsWith("__")&&!(d in n)&&delete e[d];function r(d){if((0,rs.isObjectType)(d)){i(d),a(d);return}else if((0,rs.isInterfaceType)(d)){i(d),"getInterfaces"in d&&a(d);return}else if((0,rs.isUnionType)(d)){u(d);return}else if((0,rs.isInputObjectType)(d)){o(d);return}else if((0,rs.isLeafType)(d))return;throw new Error(`Unexpected schema type: ${d}`)}function i(d){let p=d.getFields();for(let[E,h]of Object.entries(p))h.args.map(_=>(_.type=l(_.type),_.type===null?null:_)).filter(Boolean),h.type=l(h.type),h.type===null&&delete p[E]}function a(d){if("getInterfaces"in d){let p=d.getInterfaces();p.push(...p.splice(0).map(E=>l(E)).filter(Boolean))}}function o(d){let p=d.getFields();for(let[E,h]of Object.entries(p))h.type=l(h.type),h.type===null&&delete p[E]}function u(d){let p=d.getTypes();p.push(...p.splice(0).map(E=>l(E)).filter(Boolean))}function l(d){if((0,rs.isListType)(d)){let p=l(d.ofType);return p!=null?new rs.GraphQLList(p):null}else if((0,rs.isNonNullType)(d)){let p=l(d.ofType);return p!=null?new rs.GraphQLNonNull(p):null}else if((0,rs.isNamedType)(d)){let p=e[d.name];if(p&&d!==p)return p}return d}}});var NM=F(TO=>{"use strict";m();T();N();Object.defineProperty(TO,"__esModule",{value:!0});TO.getResolversFromSchema=Jne;var Vc=Oe();function Jne(e,t){var i,a;let n=Object.create(null),r=e.getTypeMap();for(let o in r)if(!o.startsWith("__")){let u=r[o];if((0,Vc.isScalarType)(u)){if(!(0,Vc.isSpecifiedScalarType)(u)){let l=u.toConfig();delete l.astNode,n[o]=new Vc.GraphQLScalarType(l)}}else if((0,Vc.isEnumType)(u)){n[o]={};let l=u.getValues();for(let d of l)n[o][d.name]=d.value}else if((0,Vc.isInterfaceType)(u))u.resolveType!=null&&(n[o]={__resolveType:u.resolveType});else if((0,Vc.isUnionType)(u))u.resolveType!=null&&(n[o]={__resolveType:u.resolveType});else if((0,Vc.isObjectType)(u)){n[o]={},u.isTypeOf!=null&&(n[o].__isTypeOf=u.isTypeOf);let l=u.getFields();for(let d in l){let p=l[d];if(p.subscribe!=null&&(n[o][d]=n[o][d]||{},n[o][d].subscribe=p.subscribe),p.resolve!=null&&((i=p.resolve)==null?void 0:i.name)!=="defaultFieldResolver"){switch((a=p.resolve)==null?void 0:a.name){case"defaultMergedResolver":if(!t)continue;break;case"defaultFieldResolver":continue}n[o][d]=n[o][d]||{},n[o][d].resolve=p.resolve}}}}return n}});var EM=F(EO=>{"use strict";m();T();N();Object.defineProperty(EO,"__esModule",{value:!0});EO.forEachField=Hne;var TM=Oe();function Hne(e,t){let n=e.getTypeMap();for(let r in n){let i=n[r];if(!(0,TM.getNamedType)(i).name.startsWith("__")&&(0,TM.isObjectType)(i)){let a=i.getFields();for(let o in a){let u=a[o];t(u,r,o)}}}}});var hM=F(yO=>{"use strict";m();T();N();Object.defineProperty(yO,"__esModule",{value:!0});yO.forEachDefaultValue=zne;var hO=Oe();function zne(e,t){let n=e.getTypeMap();for(let r in n){let i=n[r];if(!(0,hO.getNamedType)(i).name.startsWith("__")){if((0,hO.isObjectType)(i)){let a=i.getFields();for(let o in a){let u=a[o];for(let l of u.args)l.defaultValue=t(l.type,l.defaultValue)}}else if((0,hO.isInputObjectType)(i)){let a=i.getFields();for(let o in a){let u=a[o];u.defaultValue=t(u.type,u.defaultValue)}}}}}});var vO=F(_O=>{"use strict";m();T();N();Object.defineProperty(_O,"__esModule",{value:!0});_O.addTypes=Xne;var IO=Oe(),gO=sO(),Wne=uE();function Xne(e,t){let n=e.toConfig(),r={};for(let u of n.types)r[u.name]=u;let i={};for(let u of n.directives)i[u.name]=u;for(let u of t)(0,IO.isNamedType)(u)?r[u.name]=u:(0,IO.isDirective)(u)&&(i[u.name]=u);let{typeMap:a,directives:o}=(0,Wne.rewireTypes)(r,Object.values(i));return new IO.GraphQLSchema(W(q({},n),{query:(0,gO.getObjectTypeFromTypeMap)(a,e.getQueryType()),mutation:(0,gO.getObjectTypeFromTypeMap)(a,e.getMutationType()),subscription:(0,gO.getObjectTypeFromTypeMap)(a,e.getSubscriptionType()),types:Object.values(a),directives:o}))}});var IM=F(SO=>{"use strict";m();T();N();Object.defineProperty(SO,"__esModule",{value:!0});SO.pruneSchema=rre;var ir=Oe(),Zne=qS(),ere=qc(),tre=dd(),nre=uf();function rre(e,t={}){let{skipEmptyCompositeTypePruning:n,skipEmptyUnionPruning:r,skipPruning:i,skipUnimplementedInterfacesPruning:a,skipUnusedTypesPruning:o}=t,u=[],l=e;do{let d=ire(l);if(i){let p=[];for(let E in l.getTypeMap()){if(E.startsWith("__"))continue;let h=l.getType(E);h&&i(h)&&p.push(E)}d=yM(p,l,d)}u=[],l=(0,tre.mapSchema)(l,{[ere.MapperKind.TYPE]:p=>!d.has(p.name)&&!(0,ir.isSpecifiedScalarType)(p)?((0,ir.isUnionType)(p)||(0,ir.isInputObjectType)(p)||(0,ir.isInterfaceType)(p)||(0,ir.isObjectType)(p)||(0,ir.isScalarType)(p))&&(o||(0,ir.isUnionType)(p)&&r&&!Object.keys(p.getTypes()).length||((0,ir.isInputObjectType)(p)||(0,ir.isInterfaceType)(p)||(0,ir.isObjectType)(p))&&n&&!Object.keys(p.getFields()).length||(0,ir.isInterfaceType)(p)&&a)?p:(u.push(p.name),d.delete(p.name),null):p})}while(u.length);return l}function ire(e){let t=[];for(let n of(0,nre.getRootTypes)(e))t.push(n.name);return yM(t,e)}function yM(e,t,n=new Set){let r=new Map;for(;e.length;){let i=e.pop();if(n.has(i)&&r[i]!==!0)continue;let a=t.getType(i);if(a){if((0,ir.isUnionType)(a)&&e.push(...a.getTypes().map(o=>o.name)),(0,ir.isInterfaceType)(a)&&r[i]===!0&&(e.push(...(0,Zne.getImplementingTypes)(a.name,t)),r[i]=!1),(0,ir.isEnumType)(a)&&e.push(...a.getValues().flatMap(o=>mE(t,o))),"getInterfaces"in a&&e.push(...a.getInterfaces().map(o=>o.name)),"getFields"in a){let o=a.getFields(),u=Object.entries(o);if(!u.length)continue;for(let[,l]of u){(0,ir.isObjectType)(a)&&e.push(...l.args.flatMap(p=>{let E=[(0,ir.getNamedType)(p.type).name];return E.push(...mE(t,p)),E}));let d=(0,ir.getNamedType)(l.type);e.push(d.name),e.push(...mE(t,l)),(0,ir.isInterfaceType)(d)&&!(d.name in r)&&(r[d.name]=!0)}}e.push(...mE(t,a)),n.add(i)}}return n}function mE(e,t){var r,i;let n=new Set;if((r=t.astNode)!=null&&r.directives)for(let a of t.astNode.directives){let o=e.getDirective(a.name.value);if(o!=null&&o.args)for(let u of o.args){let l=(0,ir.getNamedType)(u.type);n.add(l.name)}}if((i=t.extensions)!=null&&i.directives)for(let a in t.extensions.directives){let o=e.getDirective(a);if(o!=null&&o.args)for(let u of o.args){let l=(0,ir.getNamedType)(u.type);n.add(l.name)}}return[...n]}});var DO=F(OO=>{"use strict";m();T();N();Object.defineProperty(OO,"__esModule",{value:!0});OO.mergeDeep=NE;var are=rd();function NE(e,t=!1,n=!1,r=!1){if(e.length===0)return;if(e.length===1)return e[0];let i,a=!0,o=e.every(d=>{if(Array.isArray(d)){if(i===void 0)return i=d.length,!0;if(i===d.length)return!0}else a=!1;return!1});if(r&&o)return new Array(i).fill(null).map((d,p)=>NE(e.map(E=>E[p]),t,n,r));if(a)return e.flat(1);let u,l;t&&(l=e.find(d=>gM(d)),l&&(u==null&&(u={}),Object.setPrototypeOf(u,Object.create(Object.getPrototypeOf(l)))));for(let d of e)if(d!=null)if(gM(d)){if(l){let p=Object.getPrototypeOf(u),E=Object.getPrototypeOf(d);if(E)for(let h of Object.getOwnPropertyNames(E)){let _=Object.getOwnPropertyDescriptor(E,h);(0,are.isSome)(_)&&Object.defineProperty(p,h,_)}}for(let p in d)u==null&&(u={}),p in u?u[p]=NE([u[p],d[p]],t,n,r):u[p]=d[p]}else Array.isArray(d)&&Array.isArray(u)?u=NE([u,d],t,n,r):u=d;return u}function gM(e){return e&&typeof e=="object"&&!Array.isArray(e)}});var _M=F(bO=>{"use strict";m();T();N();Object.defineProperty(bO,"__esModule",{value:!0});bO.parseSelectionSet=ore;var sre=Oe();function ore(e,t){return(0,sre.parse)(e,t).definitions[0].selectionSet}});var vM=F(AO=>{"use strict";m();T();N();Object.defineProperty(AO,"__esModule",{value:!0});AO.getResponseKeyFromInfo=ure;function ure(e){return e.fieldNodes[0].alias!=null?e.fieldNodes[0].alias.value:e.fieldName}});var SM=F(pd=>{"use strict";m();T();N();Object.defineProperty(pd,"__esModule",{value:!0});pd.appendObjectFields=lre;pd.removeObjectFields=dre;pd.selectObjectFields=pre;pd.modifyObjectFields=fre;var TE=Oe(),cre=vO(),EE=qc(),Kc=dd();function lre(e,t,n){return e.getType(t)==null?(0,cre.addTypes)(e,[new TE.GraphQLObjectType({name:t,fields:n})]):(0,Kc.mapSchema)(e,{[EE.MapperKind.OBJECT_TYPE]:r=>{if(r.name===t){let i=r.toConfig(),a=i.fields,o={};for(let u in a)o[u]=a[u];for(let u in n)o[u]=n[u];return(0,Kc.correctASTNodes)(new TE.GraphQLObjectType(W(q({},i),{fields:o})))}}})}function dre(e,t,n){let r={};return[(0,Kc.mapSchema)(e,{[EE.MapperKind.OBJECT_TYPE]:a=>{if(a.name===t){let o=a.toConfig(),u=o.fields,l={};for(let d in u){let p=u[d];n(d,p)?r[d]=p:l[d]=p}return(0,Kc.correctASTNodes)(new TE.GraphQLObjectType(W(q({},o),{fields:l})))}}}),r]}function pre(e,t,n){let r={};return(0,Kc.mapSchema)(e,{[EE.MapperKind.OBJECT_TYPE]:i=>{if(i.name===t){let o=i.toConfig().fields;for(let u in o){let l=o[u];n(u,l)&&(r[u]=l)}}}}),r}function fre(e,t,n,r){let i={};return[(0,Kc.mapSchema)(e,{[EE.MapperKind.OBJECT_TYPE]:o=>{if(o.name===t){let u=o.toConfig(),l=u.fields,d={};for(let p in l){let E=l[p];n(p,E)?i[p]=E:d[p]=E}for(let p in r){let E=r[p];d[p]=E}return(0,Kc.correctASTNodes)(new TE.GraphQLObjectType(W(q({},u),{fields:d})))}}}),i]}});var OM=F(RO=>{"use strict";m();T();N();Object.defineProperty(RO,"__esModule",{value:!0});RO.renameType=mre;var ta=Oe();function mre(e,t){if((0,ta.isObjectType)(e))return new ta.GraphQLObjectType(W(q({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:W(q({},e.astNode),{name:W(q({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>W(q({},n),{name:W(q({},n.name),{value:t})}))}));if((0,ta.isInterfaceType)(e))return new ta.GraphQLInterfaceType(W(q({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:W(q({},e.astNode),{name:W(q({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>W(q({},n),{name:W(q({},n.name),{value:t})}))}));if((0,ta.isUnionType)(e))return new ta.GraphQLUnionType(W(q({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:W(q({},e.astNode),{name:W(q({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>W(q({},n),{name:W(q({},n.name),{value:t})}))}));if((0,ta.isInputObjectType)(e))return new ta.GraphQLInputObjectType(W(q({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:W(q({},e.astNode),{name:W(q({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>W(q({},n),{name:W(q({},n.name),{value:t})}))}));if((0,ta.isEnumType)(e))return new ta.GraphQLEnumType(W(q({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:W(q({},e.astNode),{name:W(q({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>W(q({},n),{name:W(q({},n.name),{value:t})}))}));if((0,ta.isScalarType)(e))return new ta.GraphQLScalarType(W(q({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:W(q({},e.astNode),{name:W(q({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>W(q({},n),{name:W(q({},n.name),{value:t})}))}));throw new Error(`Unknown type ${e}.`)}});var DM=F(hE=>{"use strict";m();T();N();Object.defineProperty(hE,"__esModule",{value:!0});hE.updateArgument=Tre;hE.createVariableNameGenerator=Ere;var jc=Oe(),Nre=nE();function Tre(e,t,n,r,i,a,o){if(e[r]={kind:jc.Kind.ARGUMENT,name:{kind:jc.Kind.NAME,value:r},value:{kind:jc.Kind.VARIABLE,name:{kind:jc.Kind.NAME,value:i}}},t[i]={kind:jc.Kind.VARIABLE_DEFINITION,variable:{kind:jc.Kind.VARIABLE,name:{kind:jc.Kind.NAME,value:i}},type:(0,Nre.astFromType)(a)},o!==void 0){n[i]=o;return}i in n&&delete n[i]}function Ere(e){let t=0;return n=>{let r;do r=t===0?n:`_v${t.toString()}_${n}`,t++;while(r in e);return r}}});var bM=F(FO=>{"use strict";m();T();N();Object.defineProperty(FO,"__esModule",{value:!0});FO.implementsAbstractType=hre;var PO=Oe();function hre(e,t,n){return n==null||t==null?!1:t===n?!0:(0,PO.isCompositeType)(t)&&(0,PO.isCompositeType)(n)?(0,PO.doTypesOverlap)(e,t,n):!1}});var RM=F(LO=>{"use strict";m();T();N();Object.defineProperty(LO,"__esModule",{value:!0});LO.observableToAsyncIterable=yre;var AM=af();function yre(e){let t=[],n=[],r=!0,i=p=>{t.length!==0?t.shift()({value:p,done:!1}):n.push({value:p,done:!1})},a=p=>{t.length!==0?t.shift()({value:{errors:[p]},done:!1}):n.push({value:{errors:[p]},done:!1})},o=()=>{t.length!==0?t.shift()({done:!0}):n.push({done:!0})},u=()=>new Promise(p=>{if(n.length!==0){let E=n.shift();p(E)}else t.push(p)}),l=e.subscribe({next(p){return i(p)},error(p){return a(p)},complete(){return o()}}),d=()=>{if(r){r=!1,l.unsubscribe();for(let p of t)p({value:void 0,done:!0});t.length=0,n.length=0}};return{next(){return r?u():this.return()},return(){return d(),(0,AM.fakePromise)({value:void 0,done:!0})},throw(p){return d(),(0,AM.fakeRejectPromise)(p)},[Symbol.asyncIterator](){return this}}}});var PM=F(yE=>{"use strict";m();T();N();Object.defineProperty(yE,"__esModule",{value:!0});yE.AccumulatorMap=void 0;var wO=class extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(t,n){let r=this.get(t);r===void 0?this.set(t,[n]):r.push(n)}};yE.AccumulatorMap=wO});var CO=F(fd=>{"use strict";m();T();N();Object.defineProperty(fd,"__esModule",{value:!0});fd.GraphQLStreamDirective=fd.GraphQLDeferDirective=void 0;var na=Oe();fd.GraphQLDeferDirective=new na.GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[na.DirectiveLocation.FRAGMENT_SPREAD,na.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new na.GraphQLNonNull(na.GraphQLBoolean),description:"Deferred when true or undefined.",defaultValue:!0},label:{type:na.GraphQLString,description:"Unique name"}}});fd.GraphQLStreamDirective=new na.GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[na.DirectiveLocation.FIELD],args:{if:{type:new na.GraphQLNonNull(na.GraphQLBoolean),description:"Stream when true or undefined.",defaultValue:!0},label:{type:na.GraphQLString,description:"Unique name"},initialCount:{defaultValue:0,type:na.GraphQLInt,description:"Number of items to return immediately"}}})});var kO=F(Bs=>{"use strict";m();T();N();Object.defineProperty(Bs,"__esModule",{value:!0});Bs.collectSubFields=void 0;Bs.collectFields=_re;Bs.shouldIncludeNode=IE;Bs.doesFragmentConditionMatch=UO;Bs.getFieldEntryKey=FM;Bs.getDeferValues=BO;var is=Oe(),gE=PM(),Ire=CO(),gre=qu();function md(e,t,n,r,i,a,o,u){for(let l of i.selections)switch(l.kind){case is.Kind.FIELD:{if(!IE(n,l))continue;a.add(FM(l),l);break}case is.Kind.INLINE_FRAGMENT:{if(!IE(n,l)||!UO(e,l,r))continue;let d=BO(n,l);if(d){let p=new gE.AccumulatorMap;md(e,t,n,r,l.selectionSet,p,o,u),o.push({label:d.label,fields:p})}else md(e,t,n,r,l.selectionSet,a,o,u);break}case is.Kind.FRAGMENT_SPREAD:{let d=l.name.value;if(!IE(n,l))continue;let p=BO(n,l);if(u.has(d)&&!p)continue;let E=t[d];if(!E||!UO(e,E,r))continue;if(p||u.add(d),p){let h=new gE.AccumulatorMap;md(e,t,n,r,E.selectionSet,h,o,u),o.push({label:p.label,fields:h})}else md(e,t,n,r,E.selectionSet,a,o,u);break}}}function _re(e,t,n,r,i){let a=new gE.AccumulatorMap,o=[];return md(e,t,n,r,i,a,o,new Set),{fields:a,patches:o}}function IE(e,t){let n=(0,is.getDirectiveValues)(is.GraphQLSkipDirective,t,e);if((n==null?void 0:n.if)===!0)return!1;let r=(0,is.getDirectiveValues)(is.GraphQLIncludeDirective,t,e);return(r==null?void 0:r.if)!==!1}function UO(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=(0,is.typeFromAST)(e,r);return i===n?!0:(0,is.isAbstractType)(i)?e.getPossibleTypes(i).includes(n):!1}function FM(e){return e.alias?e.alias.value:e.name.value}function BO(e,t){let n=(0,is.getDirectiveValues)(Ire.GraphQLDeferDirective,t,e);if(n&&n.if!==!1)return{label:typeof n.label=="string"?n.label:void 0}}Bs.collectSubFields=(0,gre.memoize5)(function(t,n,r,i,a){let o=new gE.AccumulatorMap,u=new Set,l=[],d={fields:o,patches:l};for(let p of a)p.selectionSet&&md(t,n,r,i,p.selectionSet,o,l,u);return d})});var MO=F(mf=>{"use strict";m();T();N();Object.defineProperty(mf,"__esModule",{value:!0});mf.getOperationASTFromRequest=void 0;mf.getOperationASTFromDocument=LM;var vre=Oe(),Sre=qu();function LM(e,t){let n=(0,vre.getOperationAST)(e,t);if(!n)throw new Error(`Cannot infer operation ${t||""}`);return n}mf.getOperationASTFromRequest=(0,Sre.memoize1)(function(t){return LM(t.document,t.operationName)})});var UM=F(Nf=>{"use strict";m();T();N();Object.defineProperty(Nf,"__esModule",{value:!0});Nf.visitData=qO;Nf.visitErrors=Dre;Nf.visitResult=bre;var Vu=Oe(),xO=kO(),Ore=MO();function qO(e,t,n){if(Array.isArray(e))return e.map(r=>qO(r,t,n));if(typeof e=="object"){let r=t!=null?t(e):e;if(r!=null)for(let i in r){let a=r[i];Object.defineProperty(r,i,{value:qO(a,t,n)})}return n!=null?n(r):r}return e}function Dre(e,t){return e.map(n=>t(n))}function bre(e,t,n,r,i){let a=t.document.definitions.reduce((h,_)=>(_.kind===Vu.Kind.FRAGMENT_DEFINITION&&(h[_.name.value]=_),h),{}),o=t.variables||{},u={segmentInfoMap:new Map,unpathedErrors:new Set},l=e.data,d=e.errors,p=d!=null&&i!=null,E=(0,Ore.getOperationASTFromRequest)(t);return l!=null&&E!=null&&(e.data=Pre(l,E,n,a,o,r,p?d:void 0,u)),d!=null&&i&&(e.errors=Are(d,i,u)),e}function Are(e,t,n){let r=n.segmentInfoMap,i=n.unpathedErrors,a=t.__unpathed;return e.map(o=>{let u=r.get(o),l=u==null?o:u.reduceRight((d,p)=>{let E=p.type.name,h=t[E];if(h==null)return d;let _=h[p.fieldName];return _==null?d:_(d,p.pathIndex)},o);return a&&i.has(o)?a(l):l})}function Rre(e,t){switch(t.operation){case"query":return e.getQueryType();case"mutation":return e.getMutationType();case"subscription":return e.getSubscriptionType()}}function Pre(e,t,n,r,i,a,o,u){let l=Rre(n,t),{fields:d}=(0,xO.collectFields)(n,r,i,l,t.selectionSet);return VO(e,l,d,n,r,i,a,0,o,u)}function VO(e,t,n,r,i,a,o,u,l,d){var ne;let p=t.getFields(),E=o==null?void 0:o[t.name],h=E==null?void 0:E.__enter,_=h!=null?h(e):e,S,k=null;if(l!=null){S=Lre(l,u),k=S.errorMap;for(let ee of S.unpathedErrors)d.unpathedErrors.add(ee)}for(let[ee,oe]of n){let de=oe[0].name.value,me=(ne=p[de])==null?void 0:ne.type;if(me==null)switch(de){case"__typename":me=Vu.TypeNameMetaFieldDef.type;break;case"__schema":me=Vu.SchemaMetaFieldDef.type;break;case"__type":me=Vu.TypeMetaFieldDef.type;break}let pe=u+1,ge;k&&(ge=k[ee],ge!=null&&delete k[ee],wre(t,de,pe,ge,d));let H=CM(e[ee],me,oe,r,i,a,o,pe,ge,d);wM(_,ee,H,E,de)}let B=_.__typename;if(B!=null&&wM(_,"__typename",B,E,"__typename"),k)for(let ee in k){let oe=k[ee];for(let de of oe)d.unpathedErrors.add(de)}let K=E==null?void 0:E.__leave;return K!=null?K(_):_}function wM(e,t,n,r,i){if(r==null){e[t]=n;return}let a=r[i];if(a==null){e[t]=n;return}let o=a(n);if(o===void 0){delete e[t];return}e[t]=o}function Fre(e,t,n,r,i,a,o,u,l,d){return e.map(p=>CM(p,t,n,r,i,a,o,u+1,l,d))}function CM(e,t,n,r,i,a,o,u,l=[],d){if(e==null)return e;let p=(0,Vu.getNullableType)(t);if((0,Vu.isListType)(p))return Fre(e,p.ofType,n,r,i,a,o,u,l,d);if((0,Vu.isAbstractType)(p)){let _=r.getType(e.__typename),{fields:S,patches:k}=(0,xO.collectSubFields)(r,i,a,_,n);if(k.length){S=new Map(S);for(let B of k)for(let[K,ne]of B.fields){let ee=S.get(K);ee?ee.push(...ne):S.set(K,ne)}}return VO(e,_,S,r,i,a,o,u,l,d)}else if((0,Vu.isObjectType)(p)){let{fields:_,patches:S}=(0,xO.collectSubFields)(r,i,a,p,n);if(S.length){_=new Map(_);for(let k of S)for(let[B,K]of k.fields){let ne=_.get(B);ne?ne.push(...K):_.set(B,K)}}return VO(e,p,_,r,i,a,o,u,l,d)}let E=o==null?void 0:o[p.name];if(E==null)return e;let h=E(e);return h===void 0?e:h}function Lre(e,t){var i;let n=Object.create(null),r=new Set;for(let a of e){let o=(i=a.path)==null?void 0:i[t];if(o==null){r.add(a);continue}o in n?n[o].push(a):n[o]=[a]}return{errorMap:n,unpathedErrors:r}}function wre(e,t,n,r=[],i){for(let a of r){let o={type:e,fieldName:t,pathIndex:n},u=i.segmentInfoMap.get(a);u==null?i.segmentInfoMap.set(a,[o]):u.push(o)}}});var BM=F(jO=>{"use strict";m();T();N();Object.defineProperty(jO,"__esModule",{value:!0});jO.valueMatchesCriteria=KO;function KO(e,t){return e==null?e===t:Array.isArray(e)?Array.isArray(t)&&e.every((n,r)=>KO(n,t[r])):typeof e=="object"?typeof t=="object"&&t&&Object.keys(t).every(n=>KO(e[n],t[n])):t instanceof RegExp?t.test(e):e===t}});var kM=F($O=>{"use strict";m();T();N();Object.defineProperty($O,"__esModule",{value:!0});$O.isAsyncIterable=Cre;function Cre(e){return(e==null?void 0:e[Symbol.asyncIterator])!=null}});var MM=F(GO=>{"use strict";m();T();N();Object.defineProperty(GO,"__esModule",{value:!0});GO.isDocumentNode=Bre;var Ure=Oe();function Bre(e){return e&&typeof e=="object"&&"kind"in e&&e.kind===Ure.Kind.DOCUMENT}});var xM=F(()=>{"use strict";m();T();N()});var jM=F(Tf=>{"use strict";m();T();N();Object.defineProperty(Tf,"__esModule",{value:!0});Tf.getAsyncIteratorWithCancel=VM;Tf.getAsyncIterableWithCancel=KM;Tf.withCancel=KM;var kre=qu();function Mre(e){return Bi(this,null,function*(){return{value:e,done:!0}})}var qM=(0,kre.memoize2)(function(t,n){return function(...i){return Reflect.apply(n,t,i)}});function VM(e,t){return new Proxy(e,{has(n,r){return r==="return"?!0:Reflect.has(n,r)},get(n,r,i){let a=Reflect.get(n,r,i);if(r==="return"){let o=a||Mre;return function(l){return Bi(this,null,function*(){let d=yield t(l);return Reflect.apply(o,n,[d])})}}else if(typeof a=="function")return qM(n,a);return a}})}function KM(e,t){return new Proxy(e,{get(n,r,i){let a=Reflect.get(n,r,i);return Symbol.asyncIterator===r?function(){let u=Reflect.apply(a,n,[]);return VM(u,t)}:typeof a=="function"?qM(n,a):a}})}});var $M=F(QO=>{"use strict";m();T();N();Object.defineProperty(QO,"__esModule",{value:!0});QO.fixSchemaAst=Kre;var xre=Oe(),qre=WS();function Vre(e,t){let n=(0,qre.getDocumentNodeFromSchema)(e);return(0,xre.buildASTSchema)(n,q({},t||{}))}function Kre(e,t){let n;return(!e.astNode||!e.extensionASTNodes)&&(n=Vre(e,t)),!e.astNode&&(n!=null&&n.astNode)&&(e.astNode=n.astNode),!e.extensionASTNodes&&(n!=null&&n.astNode)&&(e.extensionASTNodes=n.extensionASTNodes),e}});var GM=F(YO=>{"use strict";m();T();N();Object.defineProperty(YO,"__esModule",{value:!0});YO.extractExtensionsFromSchema=Gre;var jre=rd(),ks=qc(),$re=dd();function Sa(e,t){e=e||{};let a=e,{directives:n}=a,r=NP(a,["directives"]),i=q({},r);if(!t&&n!=null){let o={};for(let u in n)o[u]=[...(0,jre.asArray)(n[u])];i.directives=o}return i}function Gre(e,t=!1){let n={schemaExtensions:Sa(e.extensions,t),types:{}};return(0,$re.mapSchema)(e,{[ks.MapperKind.OBJECT_TYPE]:r=>(n.types[r.name]={fields:{},type:"object",extensions:Sa(r.extensions,t)},r),[ks.MapperKind.INTERFACE_TYPE]:r=>(n.types[r.name]={fields:{},type:"interface",extensions:Sa(r.extensions,t)},r),[ks.MapperKind.FIELD]:(r,i,a)=>{n.types[a].fields[i]={arguments:{},extensions:Sa(r.extensions,t)};let o=r.args;if(o!=null)for(let u in o)n.types[a].fields[i].arguments[u]=Sa(o[u].extensions,t);return r},[ks.MapperKind.ENUM_TYPE]:r=>(n.types[r.name]={values:{},type:"enum",extensions:Sa(r.extensions,t)},r),[ks.MapperKind.ENUM_VALUE]:(r,i,a,o)=>(n.types[i].values[o]=Sa(r.extensions,t),r),[ks.MapperKind.SCALAR_TYPE]:r=>(n.types[r.name]={type:"scalar",extensions:Sa(r.extensions,t)},r),[ks.MapperKind.UNION_TYPE]:r=>(n.types[r.name]={type:"union",extensions:Sa(r.extensions,t)},r),[ks.MapperKind.INPUT_OBJECT_TYPE]:r=>(n.types[r.name]={fields:{},type:"input",extensions:Sa(r.extensions,t)},r),[ks.MapperKind.INPUT_OBJECT_FIELD]:(r,i,a)=>(n.types[a].fields[i]={extensions:Sa(r.extensions,t)},r)}),n}});var QM=F(Ef=>{"use strict";m();T();N();Object.defineProperty(Ef,"__esModule",{value:!0});Ef.addPath=Qre;Ef.pathToArray=Yre;Ef.printPathArray=Jre;function Qre(e,t,n){return{prev:e,key:t,typename:n}}function Yre(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function Jre(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}});var JM=F(HO=>{"use strict";m();T();N();Object.defineProperty(HO,"__esModule",{value:!0});HO.mergeIncrementalResult=YM;var Hre=DO();function YM({incrementalResult:e,executionResult:t}){var r;let n=["data",...(r=e.path)!=null?r:[]];if(e.items)for(let i of e.items)JO(t,n,i),n[n.length-1]++;e.data&&JO(t,n,e.data),e.errors&&(t.errors=t.errors||[],t.errors.push(...e.errors)),e.extensions&&JO(t,["extensions"],e.extensions),e.incremental&&e.incremental.forEach(i=>{YM({incrementalResult:i,executionResult:t})})}function JO(e,t,n){let r=e,i;for(i=0;i{"use strict";m();T();N();Object.defineProperty(_E,"__esModule",{value:!0});_E.debugTimerStart=zre;_E.debugTimerEnd=Wre;var HM=new Set;function zre(e){var n,r;let t=((r=(n=globalThis.process)==null?void 0:n.env)==null?void 0:r.DEBUG)||globalThis.DEBUG;(t==="1"||t!=null&&t.includes(e))&&(HM.add(e),console.time(e))}function Wre(e){HM.has(e)&&console.timeEnd(e)}});var ZM=F(hf=>{"use strict";m();T();N();Object.defineProperty(hf,"__esModule",{value:!0});hf.getAbortPromise=void 0;hf.registerAbortSignalListener=XM;var Xre=af(),WM=qu(),Zre=(0,WM.memoize1)(function(t){let n=new Set;return t.addEventListener("abort",r=>{for(let i of n)i(r)},{once:!0}),n});function XM(e,t){if(e.aborted){t();return}Zre(e).add(t)}hf.getAbortPromise=(0,WM.memoize1)(function(t){return t.aborted?(0,Xre.fakeRejectPromise)(t.reason):new Promise((n,r)=>{if(t.aborted){r(t.reason);return}XM(t,()=>{r(t.reason)})})})});var Oa=F(ke=>{"use strict";m();T();N();Object.defineProperty(ke,"__esModule",{value:!0});ke.createDeferred=ke.fakePromise=ke.mapMaybePromise=ke.mapAsyncIterator=ke.inspect=void 0;var Ye=(rk(),dN(nk));Ye.__exportStar(ik(),ke);Ye.__exportStar(rd(),ke);Ye.__exportStar(CS(),ke);Ye.__exportStar(BS(),ke);Ye.__exportStar(Ek(),ke);Ye.__exportStar(qS(),ke);Ye.__exportStar(WS(),ke);Ye.__exportStar(BS(),ke);Ye.__exportStar(Uk(),ke);Ye.__exportStar(Bk(),ke);Ye.__exportStar(Hk(),ke);Ye.__exportStar(rM(),ke);Ye.__exportStar(aM(),ke);Ye.__exportStar(pM(),ke);Ye.__exportStar(mM(),ke);Ye.__exportStar(NM(),ke);Ye.__exportStar(EM(),ke);Ye.__exportStar(hM(),ke);Ye.__exportStar(dd(),ke);Ye.__exportStar(vO(),ke);Ye.__exportStar(uE(),ke);Ye.__exportStar(IM(),ke);Ye.__exportStar(DO(),ke);Ye.__exportStar(qc(),ke);Ye.__exportStar(cO(),ke);Ye.__exportStar(_M(),ke);Ye.__exportStar(vM(),ke);Ye.__exportStar(SM(),ke);Ye.__exportStar(OM(),ke);Ye.__exportStar(dO(),ke);Ye.__exportStar(DM(),ke);Ye.__exportStar(nE(),ke);Ye.__exportStar(bM(),ke);Ye.__exportStar(zT(),ke);Ye.__exportStar(RM(),ke);Ye.__exportStar(UM(),ke);Ye.__exportStar(FS(),ke);Ye.__exportStar(BM(),ke);Ye.__exportStar(kM(),ke);Ye.__exportStar(MM(),ke);Ye.__exportStar(sf(),ke);Ye.__exportStar(xM(),ke);Ye.__exportStar(jM(),ke);Ye.__exportStar(uf(),ke);Ye.__exportStar(eO(),ke);Ye.__exportStar(kO(),ke);var eie=rf();Object.defineProperty(ke,"inspect",{enumerable:!0,get:function(){return eie.inspect}});Ye.__exportStar(qu(),ke);Ye.__exportStar($M(),ke);Ye.__exportStar(MO(),ke);Ye.__exportStar(GM(),ke);Ye.__exportStar(QM(),ke);Ye.__exportStar(ZT(),ke);Ye.__exportStar(CO(),ke);Ye.__exportStar(JM(),ke);Ye.__exportStar(zM(),ke);Ye.__exportStar(wS(),ke);var vE=af();Object.defineProperty(ke,"mapAsyncIterator",{enumerable:!0,get:function(){return vE.mapAsyncIterator}});Object.defineProperty(ke,"mapMaybePromise",{enumerable:!0,get:function(){return vE.mapMaybePromise}});Object.defineProperty(ke,"fakePromise",{enumerable:!0,get:function(){return vE.fakePromise}});Object.defineProperty(ke,"createDeferred",{enumerable:!0,get:function(){return vE.createDeferredPromise}});Ye.__exportStar(ZM(),ke)});var tx=F(SE=>{"use strict";m();T();N();Object.defineProperty(SE,"__esModule",{value:!0});SE.mergeResolvers=void 0;var tie=Oa();function ex(e,t){if(!e||Array.isArray(e)&&e.length===0)return{};if(!Array.isArray(e))return e;if(e.length===1)return e[0]||{};let n=new Array;for(let i of e)Array.isArray(i)&&(i=ex(i)),typeof i=="object"&&i&&n.push(i);let r=(0,tie.mergeDeep)(n,!0);if(t!=null&&t.exclusions)for(let i of t.exclusions){let[a,o]=i.split(".");!o||o==="*"?delete r[a]:r[a]&&delete r[a][o]}return r}SE.mergeResolvers=ex});var zO=F(OE=>{"use strict";m();T();N();Object.defineProperty(OE,"__esModule",{value:!0});OE.mergeArguments=void 0;var nx=Oa();function nie(e,t,n){let r=rie([...t,...e].filter(nx.isSome),n);return n&&n.sort&&r.sort(nx.compareNodes),r}OE.mergeArguments=nie;function rie(e,t){return e.reduce((n,r)=>{let i=n.findIndex(a=>a.name.value===r.name.value);return i===-1?n.concat([r]):(t!=null&&t.reverseArguments||(n[i]=r),n)},[])}});var ra=F(Nd=>{"use strict";m();T();N();Object.defineProperty(Nd,"__esModule",{value:!0});Nd.mergeDirective=Nd.mergeDirectives=void 0;var rx=Oe(),iie=Oa();function aie(e,t){return!!e.find(n=>n.name.value===t.name.value)}function ix(e,t){var n;return!!((n=t==null?void 0:t[e.name.value])!=null&&n.repeatable)}function sie(e,t){return t.some(({value:n})=>n===e.value)}function ax(e,t){let n=[...t];for(let r of e){let i=n.findIndex(a=>a.name.value===r.name.value);if(i>-1){let a=n[i];if(a.value.kind==="ListValue"){let o=a.value.values,u=r.value.values;a.value.values=die(o,u,(l,d)=>{let p=l.value;return!p||!d.some(E=>E.value===p)})}else a.value=r.value}else n.push(r)}return n}function oie(e,t){return e.map((n,r,i)=>{let a=i.findIndex(o=>o.name.value===n.name.value);if(a!==r&&!ix(n,t)){let o=i[a];return n.arguments=ax(n.arguments,o.arguments),null}return n}).filter(iie.isSome)}function uie(e=[],t=[],n,r){let i=n&&n.reverseDirectives,a=i?e:t,o=i?t:e,u=oie([...a],r);for(let l of o)if(aie(u,l)&&!ix(l,r)){let d=u.findIndex(E=>E.name.value===l.name.value),p=u[d];u[d].arguments=ax(l.arguments||[],p.arguments||[])}else u.push(l);return u}Nd.mergeDirectives=uie;function cie(e,t){let n=(0,rx.print)(W(q({},e),{description:void 0})),r=(0,rx.print)(W(q({},t),{description:void 0})),i=new RegExp("(directive @w*d*)|( on .*$)","g");if(!(n.replace(i,"")===r.replace(i,"")))throw new Error(`Unable to merge GraphQL directive "${e.name.value}". Existing directive: ${r} Received directive: - ${n}`)}function Hre(e,t){return t?(zre(e,t),$(M({},e),{locations:[...t.locations,...e.locations.filter(n=>!Qre(n,t.locations))]})):e}od.mergeDirective=Hre;function Wre(e,t,n){return e.concat(t.filter(r=>n(r,e)))}});var CO=F(fE=>{"use strict";m();T();N();Object.defineProperty(fE,"__esModule",{value:!0});fE.mergeEnumValues=void 0;var Xre=ta(),Zre=va();function eie(e,t,n,r){if(n!=null&&n.consistentEnumMerge){let o=[];e&&o.push(...e),e=t,t=o}let i=new Map;if(e)for(let o of e)i.set(o.name.value,o);if(t)for(let o of t){let u=o.name.value;if(i.has(u)){let l=i.get(u);l.description=o.description||l.description,l.directives=(0,Xre.mergeDirectives)(o.directives,l.directives,r)}else i.set(u,o)}let a=[...i.values()];return n&&n.sort&&a.sort(Zre.compareNodes),a}fE.mergeEnumValues=eie});var UO=F(pE=>{"use strict";m();T();N();Object.defineProperty(pE,"__esModule",{value:!0});pE.mergeEnum=void 0;var tie=Se(),nie=ta(),rie=CO();function iie(e,t,n,r){return t?{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="EnumTypeDefinition"||t.kind==="EnumTypeDefinition"?"EnumTypeDefinition":"EnumTypeExtension",loc:e.loc,directives:(0,nie.mergeDirectives)(e.directives,t.directives,n,r),values:(0,rie.mergeEnumValues)(e.values,t.values,n)}:n!=null&&n.convertExtensions?$(M({},e),{kind:tie.Kind.ENUM_TYPE_DEFINITION}):e}pE.mergeEnum=iie});var mE=F(Kn=>{"use strict";m();T();N();Object.defineProperty(Kn,"__esModule",{value:!0});Kn.defaultStringComparator=Kn.CompareVal=Kn.printTypeNode=Kn.isNonNullTypeNode=Kn.isListTypeNode=Kn.isWrappingTypeNode=Kn.extractType=Kn.isSourceTypes=Kn.isStringTypes=void 0;var dp=Se();function aie(e){return typeof e=="string"}Kn.isStringTypes=aie;function sie(e){return e instanceof dp.Source}Kn.isSourceTypes=sie;function oie(e){let t=e;for(;t.kind===dp.Kind.LIST_TYPE||t.kind==="NonNullType";)t=t.type;return t}Kn.extractType=oie;function uie(e){return e.kind!==dp.Kind.NAMED_TYPE}Kn.isWrappingTypeNode=uie;function QM(e){return e.kind===dp.Kind.LIST_TYPE}Kn.isListTypeNode=QM;function YM(e){return e.kind===dp.Kind.NON_NULL_TYPE}Kn.isNonNullTypeNode=YM;function BO(e){return QM(e)?`[${BO(e.type)}]`:YM(e)?`${BO(e.type)}!`:e.name.value}Kn.printTypeNode=BO;var Bc;(function(e){e[e.A_SMALLER_THAN_B=-1]="A_SMALLER_THAN_B",e[e.A_EQUALS_B=0]="A_EQUALS_B",e[e.A_GREATER_THAN_B=1]="A_GREATER_THAN_B"})(Bc=Kn.CompareVal||(Kn.CompareVal={}));function cie(e,t){return e==null&&t==null?Bc.A_EQUALS_B:e==null?Bc.A_SMALLER_THAN_B:t==null?Bc.A_GREATER_THAN_B:et?Bc.A_GREATER_THAN_B:Bc.A_EQUALS_B}Kn.defaultStringComparator=cie});var pp=F(NE=>{"use strict";m();T();N();Object.defineProperty(NE,"__esModule",{value:!0});NE.mergeFields=void 0;var oi=mE(),lie=ta(),die=va(),fie=LO();function pie(e,t){let n=e.findIndex(r=>r.name.value===t.name.value);return[n>-1?e[n]:null,n]}function mie(e,t,n,r,i){let a=[];if(n!=null&&a.push(...n),t!=null)for(let o of t){let[u,l]=pie(a,o);if(u&&!(r!=null&&r.ignoreFieldConflicts)){let d=(r==null?void 0:r.onFieldTypeConflict)&&r.onFieldTypeConflict(u,o,e,r==null?void 0:r.throwOnConflict)||Nie(e,u,o,r==null?void 0:r.throwOnConflict);d.arguments=(0,fie.mergeArguments)(o.arguments||[],u.arguments||[],r),d.directives=(0,lie.mergeDirectives)(o.directives,u.directives,r,i),d.description=o.description||u.description,a[l]=d}else a.push(o)}if(r&&r.sort&&a.sort(die.compareNodes),r&&r.exclusions){let o=r.exclusions;return a.filter(u=>!o.includes(`${e.name.value}.${u.name.value}`))}return a}NE.mergeFields=mie;function Nie(e,t,n,r=!1){let i=(0,oi.printTypeNode)(t.type),a=(0,oi.printTypeNode)(n.type);if(i!==a){let o=(0,oi.extractType)(t.type),u=(0,oi.extractType)(n.type);if(o.name.value!==u.name.value)throw new Error(`Field "${n.name.value}" already defined with a different type. Declared as "${o.name.value}", but you tried to override with "${u.name.value}"`);if(!fp(t.type,n.type,!r))throw new Error(`Field '${e.name.value}.${t.name.value}' changed type from '${i}' to '${a}'`)}return(0,oi.isNonNullTypeNode)(n.type)&&!(0,oi.isNonNullTypeNode)(t.type)&&(t.type=n.type),t}function fp(e,t,n=!1){if(!(0,oi.isWrappingTypeNode)(e)&&!(0,oi.isWrappingTypeNode)(t))return e.toString()===t.toString();if((0,oi.isNonNullTypeNode)(t)){let r=(0,oi.isNonNullTypeNode)(e)?e.type:e;return fp(r,t.type)}return(0,oi.isNonNullTypeNode)(e)?fp(t,e,n):(0,oi.isListTypeNode)(e)?(0,oi.isListTypeNode)(t)&&fp(e.type,t.type)||(0,oi.isNonNullTypeNode)(t)&&fp(e,t.type):!1}});var kO=F(TE=>{"use strict";m();T();N();Object.defineProperty(TE,"__esModule",{value:!0});TE.mergeInputType=void 0;var Tie=Se(),Eie=pp(),hie=ta();function yie(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="InputObjectTypeDefinition"||t.kind==="InputObjectTypeDefinition"?"InputObjectTypeDefinition":"InputObjectTypeExtension",loc:e.loc,fields:(0,Eie.mergeFields)(e,e.fields,t.fields,n),directives:(0,hie.mergeDirectives)(e.directives,t.directives,n,r)}}catch(i){throw new Error(`Unable to merge GraphQL input type "${e.name.value}": ${i.message}`)}return n!=null&&n.convertExtensions?$(M({},e),{kind:Tie.Kind.INPUT_OBJECT_TYPE_DEFINITION}):e}TE.mergeInputType=yie});var mp=F(EE=>{"use strict";m();T();N();Object.defineProperty(EE,"__esModule",{value:!0});EE.mergeNamedTypeArray=void 0;var Iie=va();function gie(e,t){return!!e.find(n=>n.name.value===t.name.value)}function _ie(e=[],t=[],n={}){let r=[...t,...e.filter(i=>!gie(t,i))];return n&&n.sort&&r.sort(Iie.compareNodes),r}EE.mergeNamedTypeArray=_ie});var MO=F(hE=>{"use strict";m();T();N();Object.defineProperty(hE,"__esModule",{value:!0});hE.mergeInterface=void 0;var vie=Se(),Sie=pp(),Oie=ta(),Die=mp();function bie(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="InterfaceTypeDefinition"||t.kind==="InterfaceTypeDefinition"?"InterfaceTypeDefinition":"InterfaceTypeExtension",loc:e.loc,fields:(0,Sie.mergeFields)(e,e.fields,t.fields,n),directives:(0,Oie.mergeDirectives)(e.directives,t.directives,n,r),interfaces:e.interfaces?(0,Die.mergeNamedTypeArray)(e.interfaces,t.interfaces,n):void 0}}catch(i){throw new Error(`Unable to merge GraphQL interface "${e.name.value}": ${i.message}`)}return n!=null&&n.convertExtensions?$(M({},e),{kind:vie.Kind.INTERFACE_TYPE_DEFINITION}):e}hE.mergeInterface=bie});var xO=F(yE=>{"use strict";m();T();N();Object.defineProperty(yE,"__esModule",{value:!0});yE.mergeType=void 0;var Aie=Se(),Rie=pp(),Pie=ta(),Fie=mp();function wie(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="ObjectTypeDefinition"||t.kind==="ObjectTypeDefinition"?"ObjectTypeDefinition":"ObjectTypeExtension",loc:e.loc,fields:(0,Rie.mergeFields)(e,e.fields,t.fields,n),directives:(0,Pie.mergeDirectives)(e.directives,t.directives,n,r),interfaces:(0,Fie.mergeNamedTypeArray)(e.interfaces,t.interfaces,n)}}catch(i){throw new Error(`Unable to merge GraphQL type "${e.name.value}": ${i.message}`)}return n!=null&&n.convertExtensions?$(M({},e),{kind:Aie.Kind.OBJECT_TYPE_DEFINITION}):e}yE.mergeType=wie});var qO=F(IE=>{"use strict";m();T();N();Object.defineProperty(IE,"__esModule",{value:!0});IE.mergeScalar=void 0;var Lie=Se(),Cie=ta();function Uie(e,t,n,r){return t?{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="ScalarTypeDefinition"||t.kind==="ScalarTypeDefinition"?"ScalarTypeDefinition":"ScalarTypeExtension",loc:e.loc,directives:(0,Cie.mergeDirectives)(e.directives,t.directives,n,r)}:n!=null&&n.convertExtensions?$(M({},e),{kind:Lie.Kind.SCALAR_TYPE_DEFINITION}):e}IE.mergeScalar=Uie});var jO=F(gE=>{"use strict";m();T();N();Object.defineProperty(gE,"__esModule",{value:!0});gE.mergeUnion=void 0;var VO=Se(),Bie=ta(),kie=mp();function Mie(e,t,n,r){return t?{name:e.name,description:e.description||t.description,directives:(0,Bie.mergeDirectives)(e.directives,t.directives,n,r),kind:n!=null&&n.convertExtensions||e.kind==="UnionTypeDefinition"||t.kind==="UnionTypeDefinition"?VO.Kind.UNION_TYPE_DEFINITION:VO.Kind.UNION_TYPE_EXTENSION,loc:e.loc,types:(0,kie.mergeNamedTypeArray)(e.types,t.types,n)}:n!=null&&n.convertExtensions?$(M({},e),{kind:VO.Kind.UNION_TYPE_DEFINITION}):e}gE.mergeUnion=Mie});var KO=F(kc=>{"use strict";m();T();N();Object.defineProperty(kc,"__esModule",{value:!0});kc.mergeSchemaDefs=kc.DEFAULT_OPERATION_TYPE_NAME_MAP=void 0;var Np=Se(),xie=ta();kc.DEFAULT_OPERATION_TYPE_NAME_MAP={query:"Query",mutation:"Mutation",subscription:"Subscription"};function qie(e=[],t=[]){let n=[];for(let r in kc.DEFAULT_OPERATION_TYPE_NAME_MAP){let i=e.find(a=>a.operation===r)||t.find(a=>a.operation===r);i&&n.push(i)}return n}function Vie(e,t,n,r){return t?{kind:e.kind===Np.Kind.SCHEMA_DEFINITION||t.kind===Np.Kind.SCHEMA_DEFINITION?Np.Kind.SCHEMA_DEFINITION:Np.Kind.SCHEMA_EXTENSION,description:e.description||t.description,directives:(0,xie.mergeDirectives)(e.directives,t.directives,n,r),operationTypes:qie(e.operationTypes,t.operationTypes)}:n!=null&&n.convertExtensions?$(M({},e),{kind:Np.Kind.SCHEMA_DEFINITION}):e}kc.mergeSchemaDefs=Vie});var $O=F(is=>{"use strict";m();T();N();Object.defineProperty(is,"__esModule",{value:!0});is.mergeGraphQLNodes=is.isNamedDefinitionNode=is.schemaDefSymbol=void 0;var Qr=Se(),jie=xO(),Kie=UO(),$ie=qO(),Gie=jO(),Qie=kO(),Yie=MO(),Jie=ta(),zie=KO(),Hie=va();is.schemaDefSymbol="SCHEMA_DEF_SYMBOL";function JM(e){return"name"in e}is.isNamedDefinitionNode=JM;function Wie(e,t,n={}){var i,a,o;let r=n;for(let u of e)if(JM(u)){let l=(i=u.name)==null?void 0:i.value;if(t!=null&&t.commentDescriptions&&(0,Hie.collectComment)(u),l==null)continue;if((a=t==null?void 0:t.exclusions)!=null&&a.includes(l+".*")||(o=t==null?void 0:t.exclusions)!=null&&o.includes(l))delete r[l];else switch(u.kind){case Qr.Kind.OBJECT_TYPE_DEFINITION:case Qr.Kind.OBJECT_TYPE_EXTENSION:r[l]=(0,jie.mergeType)(u,r[l],t,n);break;case Qr.Kind.ENUM_TYPE_DEFINITION:case Qr.Kind.ENUM_TYPE_EXTENSION:r[l]=(0,Kie.mergeEnum)(u,r[l],t,n);break;case Qr.Kind.UNION_TYPE_DEFINITION:case Qr.Kind.UNION_TYPE_EXTENSION:r[l]=(0,Gie.mergeUnion)(u,r[l],t,n);break;case Qr.Kind.SCALAR_TYPE_DEFINITION:case Qr.Kind.SCALAR_TYPE_EXTENSION:r[l]=(0,$ie.mergeScalar)(u,r[l],t,n);break;case Qr.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Qr.Kind.INPUT_OBJECT_TYPE_EXTENSION:r[l]=(0,Qie.mergeInputType)(u,r[l],t,n);break;case Qr.Kind.INTERFACE_TYPE_DEFINITION:case Qr.Kind.INTERFACE_TYPE_EXTENSION:r[l]=(0,Yie.mergeInterface)(u,r[l],t,n);break;case Qr.Kind.DIRECTIVE_DEFINITION:r[l]=(0,Jie.mergeDirective)(u,r[l]);break}}else(u.kind===Qr.Kind.SCHEMA_DEFINITION||u.kind===Qr.Kind.SCHEMA_EXTENSION)&&(r[is.schemaDefSymbol]=(0,zie.mergeSchemaDefs)(u,r[is.schemaDefSymbol],t));return r}is.mergeGraphQLNodes=Wie});var WM=F(dd=>{"use strict";m();T();N();Object.defineProperty(dd,"__esModule",{value:!0});dd.mergeGraphQLTypes=dd.mergeTypeDefs=void 0;var na=Se(),GO=mE(),ud=$O(),ld=va(),zM=KO();function Xie(e,t){(0,ld.resetComments)();let n={kind:na.Kind.DOCUMENT,definitions:HM(e,M({useSchemaDefinition:!0,forceSchemaDefinition:!1,throwOnConflict:!1,commentDescriptions:!1},t))},r;return t!=null&&t.commentDescriptions?r=(0,ld.printWithComments)(n):r=n,(0,ld.resetComments)(),r}dd.mergeTypeDefs=Xie;function cd(e,t,n=[],r=[],i=new Set){if(e&&!i.has(e))if(i.add(e),typeof e=="function")cd(e(),t,n,r,i);else if(Array.isArray(e))for(let a of e)cd(a,t,n,r,i);else if((0,na.isSchema)(e)){let a=(0,ld.getDocumentNodeFromSchema)(e,t);cd(a.definitions,t,n,r,i)}else if((0,GO.isStringTypes)(e)||(0,GO.isSourceTypes)(e)){let a=(0,na.parse)(e,t);cd(a.definitions,t,n,r,i)}else if(typeof e=="object"&&(0,na.isDefinitionNode)(e))e.kind===na.Kind.DIRECTIVE_DEFINITION?n.push(e):r.push(e);else if((0,ld.isDocumentNode)(e))cd(e.definitions,t,n,r,i);else throw new Error(`typeDefs must contain only strings, documents, schemas, or functions, got ${typeof e}`);return{allDirectives:n,allNodes:r}}function HM(e,t){var u,l,d;(0,ld.resetComments)();let{allDirectives:n,allNodes:r}=cd(e,t),i=(0,ud.mergeGraphQLNodes)(n,t),a=(0,ud.mergeGraphQLNodes)(r,t,i);if(t!=null&&t.useSchemaDefinition){let p=a[ud.schemaDefSymbol]||{kind:na.Kind.SCHEMA_DEFINITION,operationTypes:[]},E=p.operationTypes;for(let h in zM.DEFAULT_OPERATION_TYPE_NAME_MAP)if(!E.find(A=>A.operation===h)){let A=zM.DEFAULT_OPERATION_TYPE_NAME_MAP[h],B=a[A];B!=null&&B.name!=null&&E.push({kind:na.Kind.OPERATION_TYPE_DEFINITION,type:{kind:na.Kind.NAMED_TYPE,name:B.name},operation:h})}((u=p==null?void 0:p.operationTypes)==null?void 0:u.length)!=null&&p.operationTypes.length>0&&(a[ud.schemaDefSymbol]=p)}t!=null&&t.forceSchemaDefinition&&!((d=(l=a[ud.schemaDefSymbol])==null?void 0:l.operationTypes)!=null&&d.length)&&(a[ud.schemaDefSymbol]={kind:na.Kind.SCHEMA_DEFINITION,operationTypes:[{kind:na.Kind.OPERATION_TYPE_DEFINITION,operation:"query",type:{kind:na.Kind.NAMED_TYPE,name:{kind:na.Kind.NAME,value:"Query"}}}]});let o=Object.values(a);if(t!=null&&t.sort){let p=typeof t.sort=="function"?t.sort:GO.defaultStringComparator;o.sort((E,h)=>{var v,A;return p((v=E.name)==null?void 0:v.value,(A=h.name)==null?void 0:A.value)})}return o}dd.mergeGraphQLTypes=HM});var XM=F(Mr=>{"use strict";m();T();N();Object.defineProperty(Mr,"__esModule",{value:!0});var ui=(aS(),Wm(iS));ui.__exportStar(LO(),Mr);ui.__exportStar(ta(),Mr);ui.__exportStar(CO(),Mr);ui.__exportStar(UO(),Mr);ui.__exportStar(pp(),Mr);ui.__exportStar(kO(),Mr);ui.__exportStar(MO(),Mr);ui.__exportStar(mp(),Mr);ui.__exportStar($O(),Mr);ui.__exportStar(WM(),Mr);ui.__exportStar(qO(),Mr);ui.__exportStar(xO(),Mr);ui.__exportStar(jO(),Mr);ui.__exportStar(mE(),Mr)});var ex=F(Cu=>{"use strict";m();T();N();Object.defineProperty(Cu,"__esModule",{value:!0});Cu.applyExtensions=Cu.mergeExtensions=Cu.extractExtensionsFromSchema=void 0;var ZM=va(),Zie=va();Object.defineProperty(Cu,"extractExtensionsFromSchema",{enumerable:!0,get:function(){return Zie.extractExtensionsFromSchema}});function eae(e){return(0,ZM.mergeDeep)(e)}Cu.mergeExtensions=eae;function fd(e,t){e&&(e.extensions=(0,ZM.mergeDeep)([e.extensions||{},t||{}]))}function tae(e,t){fd(e,t.schemaExtensions);for(let[n,r]of Object.entries(t.types||{})){let i=e.getType(n);if(i){if(fd(i,r.extensions),r.type==="object"||r.type==="interface")for(let[a,o]of Object.entries(r.fields)){let u=i.getFields()[a];if(u){fd(u,o.extensions);for(let[l,d]of Object.entries(o.arguments))fd(u.args.find(p=>p.name===l),d)}}else if(r.type==="input")for(let[a,o]of Object.entries(r.fields)){let u=i.getFields()[a];fd(u,o.extensions)}else if(r.type==="enum")for(let[a,o]of Object.entries(r.values)){let u=i.getValue(a);fd(u,o)}}}return e}Cu.applyExtensions=tae});var _E=F(Tp=>{"use strict";m();T();N();Object.defineProperty(Tp,"__esModule",{value:!0});var QO=(aS(),Wm(iS));QO.__exportStar(VM(),Tp);QO.__exportStar(XM(),Tp);QO.__exportStar(ex(),Tp)});var Qi=F(X=>{"use strict";m();T();N();Object.defineProperty(X,"__esModule",{value:!0});X.semanticNonNullArgumentErrorMessage=X.invalidEventProviderIdErrorMessage=X.invalidNatsStreamConfigurationDefinitionErrorMessage=X.invalidEdfsPublishResultObjectErrorMessage=X.invalidNatsStreamInputErrorMessage=X.inlineFragmentInFieldSetErrorMessage=X.inaccessibleQueryRootTypeError=X.subgraphValidationFailureError=X.minimumSubgraphRequirementError=void 0;X.multipleNamedTypeDefinitionError=iae;X.incompatibleInputValueDefaultValueTypeError=aae;X.incompatibleMergedTypesError=sae;X.incompatibleInputValueDefaultValuesError=oae;X.incompatibleSharedEnumError=uae;X.invalidSubgraphNamesError=cae;X.duplicateDirectiveDefinitionError=lae;X.duplicateEnumValueDefinitionError=dae;X.duplicateFieldDefinitionError=fae;X.duplicateInputFieldDefinitionError=pae;X.duplicateImplementedInterfaceError=mae;X.duplicateUnionMemberDefinitionError=Nae;X.duplicateTypeDefinitionError=Tae;X.duplicateOperationTypeDefinitionError=Eae;X.noBaseDefinitionForExtensionError=hae;X.noBaseScalarDefinitionError=yae;X.noDefinedUnionMembersError=Iae;X.noDefinedEnumValuesError=gae;X.operationDefinitionError=_ae;X.invalidFieldShareabilityError=vae;X.undefinedDirectiveError=Sae;X.undefinedTypeError=Oae;X.invalidRepeatedDirectiveErrorMessage=Dae;X.invalidDirectiveError=bae;X.invalidRepeatedFederatedDirectiveErrorMessage=Aae;X.invalidDirectiveLocationErrorMessage=Rae;X.undefinedRequiredArgumentsErrorMessage=Pae;X.unexpectedDirectiveArgumentErrorMessage=Fae;X.duplicateDirectiveArgumentDefinitionsErrorMessage=wae;X.invalidArgumentValueErrorMessage=Lae;X.maximumTypeNestingExceededError=Cae;X.unexpectedKindFatalError=Uae;X.incompatibleParentKindFatalError=Bae;X.unexpectedEdgeFatalError=kae;X.incompatibleParentTypeMergeError=xae;X.unexpectedTypeNodeKindFatalError=qae;X.invalidKeyFatalError=Vae;X.unexpectedParentKindForChildError=jae;X.subgraphValidationError=Kae;X.invalidSubgraphNameErrorMessage=$ae;X.invalidOperationTypeDefinitionError=Gae;X.invalidRootTypeDefinitionError=Qae;X.subgraphInvalidSyntaxError=Yae;X.invalidInterfaceImplementationError=Jae;X.invalidRequiredInputValueError=zae;X.duplicateArgumentsError=Hae;X.noQueryRootTypeError=Wae;X.expectedEntityError=Xae;X.abstractTypeInKeyFieldSetErrorMessage=Zae;X.unknownTypeInFieldSetErrorMessage=ese;X.invalidSelectionSetErrorMessage=tse;X.invalidSelectionSetDefinitionErrorMessage=nse;X.undefinedFieldInFieldSetErrorMessage=rse;X.unparsableFieldSetErrorMessage=ise;X.unparsableFieldSetSelectionErrorMessage=ase;X.undefinedCompositeOutputTypeError=sse;X.unexpectedArgumentErrorMessage=ose;X.argumentsInKeyFieldSetErrorMessage=use;X.invalidProvidesOrRequiresDirectivesError=cse;X.duplicateFieldInFieldSetErrorMessage=lse;X.invalidConfigurationDataErrorMessage=dse;X.incompatibleTypeWithProvidesErrorMessage=fse;X.invalidInlineFragmentTypeErrorMessage=pse;X.inlineFragmentWithoutTypeConditionErrorMessage=mse;X.unknownInlineFragmentTypeConditionErrorMessage=Nse;X.invalidInlineFragmentTypeConditionTypeErrorMessage=Tse;X.invalidInlineFragmentTypeConditionErrorMessage=Ese;X.invalidSelectionOnUnionErrorMessage=hse;X.duplicateOverriddenFieldErrorMessage=yse;X.duplicateOverriddenFieldsError=Ise;X.noFieldDefinitionsError=gse;X.noInputValueDefinitionsError=_se;X.allChildDefinitionsAreInaccessibleError=vse;X.equivalentSourceAndTargetOverrideErrorMessage=Sse;X.undefinedEntityInterfaceImplementationsError=Ose;X.orScopesLimitError=Dse;X.invalidEventDrivenGraphError=bse;X.invalidRootTypeFieldEventsDirectivesErrorMessage=Ase;X.invalidEventDrivenMutationResponseTypeErrorMessage=Rse;X.invalidRootTypeFieldResponseTypesEventDrivenErrorMessage=Pse;X.invalidNatsStreamInputFieldsErrorMessage=Fse;X.invalidKeyFieldSetsEventDrivenErrorMessage=wse;X.nonExternalKeyFieldNamesEventDrivenErrorMessage=Lse;X.nonKeyFieldNamesEventDrivenErrorMessage=Cse;X.nonEntityObjectExtensionsEventDrivenErrorMessage=Use;X.nonKeyComposingObjectTypeNamesEventDrivenErrorMessage=Bse;X.invalidEdfsDirectiveName=kse;X.invalidImplementedTypeError=Mse;X.selfImplementationError=xse;X.invalidEventSubjectErrorMessage=qse;X.invalidEventSubjectsErrorMessage=Vse;X.invalidEventSubjectsItemErrorMessage=jse;X.invalidEventSubjectsArgumentErrorMessage=Kse;X.undefinedEventSubjectsArgumentErrorMessage=$se;X.invalidEventDirectiveError=Gse;X.invalidReferencesOfInaccessibleTypeError=Qse;X.inaccessibleRequiredInputValueError=Yse;X.invalidUnionMemberTypeError=Jse;X.invalidRootTypeError=zse;X.invalidSubscriptionFilterLocationError=Hse;X.invalidSubscriptionFilterDirectiveError=Wse;X.subscriptionFilterNamedTypeErrorMessage=Xse;X.subscriptionFilterConditionDepthExceededErrorMessage=Zse;X.subscriptionFilterConditionInvalidInputFieldNumberErrorMessage=eoe;X.subscriptionFilterConditionInvalidInputFieldErrorMessage=toe;X.subscriptionFilterConditionInvalidInputFieldTypeErrorMessage=noe;X.subscriptionFilterArrayConditionInvalidItemTypeErrorMessage=roe;X.subscriptionFilterArrayConditionInvalidLengthErrorMessage=ioe;X.invalidInputFieldTypeErrorMessage=aoe;X.subscriptionFieldConditionInvalidInputFieldErrorMessage=soe;X.subscriptionFieldConditionInvalidValuesArrayErrorMessage=ooe;X.subscriptionFieldConditionEmptyValuesArrayErrorMessage=uoe;X.unknownFieldSubgraphNameError=coe;X.invalidSubscriptionFieldConditionFieldPathErrorMessage=loe;X.invalidSubscriptionFieldConditionFieldPathParentErrorMessage=doe;X.undefinedSubscriptionFieldConditionFieldPathFieldErrorMessage=foe;X.invalidSubscriptionFieldConditionFieldPathFieldErrorMessage=poe;X.inaccessibleSubscriptionFieldConditionFieldPathFieldErrorMessage=moe;X.nonLeafSubscriptionFieldConditionFieldPathFinalFieldErrorMessage=Noe;X.unresolvablePathError=Toe;X.allExternalFieldInstancesError=Eoe;X.externalInterfaceFieldsError=hoe;X.nonExternalConditionalFieldError=yoe;X.incompatibleFederatedFieldNamedTypeError=Ioe;X.unknownNamedTypeErrorMessage=sx;X.unknownNamedTypeError=goe;X.unknownFieldDataError=_oe;X.unexpectedNonCompositeOutputTypeError=voe;X.invalidExternalDirectiveError=Soe;X.configureDescriptionNoDescriptionError=Ooe;X.configureDescriptionPropagationError=Doe;X.duplicateDirectiveDefinitionArgumentErrorMessage=boe;X.duplicateDirectiveDefinitionLocationErrorMessage=Aoe;X.invalidDirectiveDefinitionLocationErrorMessage=Roe;X.invalidDirectiveDefinitionError=Poe;X.typeNameAlreadyProvidedErrorMessage=Foe;X.fieldAlreadyProvidedErrorMessage=woe;X.invalidInterfaceObjectImplementationDefinitionsError=Loe;X.invalidNamedTypeError=Coe;X.semanticNonNullLevelsNaNIndexErrorMessage=Uoe;X.semanticNonNullLevelsIndexOutOfBoundsErrorMessage=Boe;X.semanticNonNullLevelsNonNullErrorMessage=koe;X.semanticNonNullInconsistentLevelsError=Moe;X.oneOfRequiredFieldsError=xoe;X.listSizeInvalidSlicingArgumentErrorMessage=qoe;X.listSizeSlicingArgumentNotIntErrorMessage=Voe;X.listSizeSizedFieldNotFoundErrorMessage=joe;X.listSizeSizedFieldNotListErrorMessage=Koe;X.listSizeFieldMustReturnListOrUseSizedFieldsErrorMessage=$oe;X.listSizeSizedFieldsInvalidReturnTypeErrorMessage=Goe;X.listSizeSizedFieldsOnListsErrorMessage=Qoe;X.listSizeAssumedSizeWithRequiredSlicingArgumentErrorMessage=Yoe;X.listSizeAssumedSizeSlicingArgDefaultErrorMessage=Joe;X.costOnInterfaceFieldErrorMessage=zoe;var tx=Se(),Je=Hn(),nx=jl(),Mc=Ur(),nae=Ql(),rae=_E();X.minimumSubgraphRequirementError=new Error("At least one subgraph is required for federation.");function iae(e,t,n){return new Error(`The named type "${e}" is defined as both types "${t}" and "${n}". -However, there must be only one type named "${e}".`)}function aae(e,t,n,r){return new Error(`The ${e} of type "${n}" defined on path "${t}" is incompatible with the default value of "${r}".`)}function sae({actualType:e,coords:t,expectedType:n,isArgument:r}){return new Error(`Incompatible types when merging two instances of ${r?"field argument":Je.FIELD} "${t}": - Expected type "${n}" but received "${e}".`)}function oae(e,t,n,r,i){return new Error(`Expected the ${e} defined on path "${t}" to define the default value "${r}". + ${n}`)}function lie(e,t){return t?(cie(e,t),W(q({},e),{locations:[...t.locations,...e.locations.filter(n=>!sie(n,t.locations))]})):e}Nd.mergeDirective=lie;function die(e,t,n){return e.concat(t.filter(r=>n(r,e)))}});var WO=F(DE=>{"use strict";m();T();N();Object.defineProperty(DE,"__esModule",{value:!0});DE.mergeEnumValues=void 0;var pie=ra(),fie=Oa();function mie(e,t,n,r){if(n!=null&&n.consistentEnumMerge){let o=[];e&&o.push(...e),e=t,t=o}let i=new Map;if(e)for(let o of e)i.set(o.name.value,o);if(t)for(let o of t){let u=o.name.value;if(i.has(u)){let l=i.get(u);l.description=o.description||l.description,l.directives=(0,pie.mergeDirectives)(o.directives,l.directives,r)}else i.set(u,o)}let a=[...i.values()];return n&&n.sort&&a.sort(fie.compareNodes),a}DE.mergeEnumValues=mie});var XO=F(bE=>{"use strict";m();T();N();Object.defineProperty(bE,"__esModule",{value:!0});bE.mergeEnum=void 0;var Nie=Oe(),Tie=ra(),Eie=WO();function hie(e,t,n,r){return t?{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="EnumTypeDefinition"||t.kind==="EnumTypeDefinition"?"EnumTypeDefinition":"EnumTypeExtension",loc:e.loc,directives:(0,Tie.mergeDirectives)(e.directives,t.directives,n,r),values:(0,Eie.mergeEnumValues)(e.values,t.values,n)}:n!=null&&n.convertExtensions?W(q({},e),{kind:Nie.Kind.ENUM_TYPE_DEFINITION}):e}bE.mergeEnum=hie});var AE=F(Yn=>{"use strict";m();T();N();Object.defineProperty(Yn,"__esModule",{value:!0});Yn.defaultStringComparator=Yn.CompareVal=Yn.printTypeNode=Yn.isNonNullTypeNode=Yn.isListTypeNode=Yn.isWrappingTypeNode=Yn.extractType=Yn.isSourceTypes=Yn.isStringTypes=void 0;var yf=Oe();function yie(e){return typeof e=="string"}Yn.isStringTypes=yie;function Iie(e){return e instanceof yf.Source}Yn.isSourceTypes=Iie;function gie(e){let t=e;for(;t.kind===yf.Kind.LIST_TYPE||t.kind==="NonNullType";)t=t.type;return t}Yn.extractType=gie;function _ie(e){return e.kind!==yf.Kind.NAMED_TYPE}Yn.isWrappingTypeNode=_ie;function sx(e){return e.kind===yf.Kind.LIST_TYPE}Yn.isListTypeNode=sx;function ox(e){return e.kind===yf.Kind.NON_NULL_TYPE}Yn.isNonNullTypeNode=ox;function ZO(e){return sx(e)?`[${ZO(e.type)}]`:ox(e)?`${ZO(e.type)}!`:e.name.value}Yn.printTypeNode=ZO;var $c;(function(e){e[e.A_SMALLER_THAN_B=-1]="A_SMALLER_THAN_B",e[e.A_EQUALS_B=0]="A_EQUALS_B",e[e.A_GREATER_THAN_B=1]="A_GREATER_THAN_B"})($c=Yn.CompareVal||(Yn.CompareVal={}));function vie(e,t){return e==null&&t==null?$c.A_EQUALS_B:e==null?$c.A_SMALLER_THAN_B:t==null?$c.A_GREATER_THAN_B:et?$c.A_GREATER_THAN_B:$c.A_EQUALS_B}Yn.defaultStringComparator=vie});var gf=F(RE=>{"use strict";m();T();N();Object.defineProperty(RE,"__esModule",{value:!0});RE.mergeFields=void 0;var di=AE(),Sie=ra(),Oie=Oa(),Die=zO();function bie(e,t){let n=e.findIndex(r=>r.name.value===t.name.value);return[n>-1?e[n]:null,n]}function Aie(e,t,n,r,i){let a=[];if(n!=null&&a.push(...n),t!=null)for(let o of t){let[u,l]=bie(a,o);if(u&&!(r!=null&&r.ignoreFieldConflicts)){let d=(r==null?void 0:r.onFieldTypeConflict)&&r.onFieldTypeConflict(u,o,e,r==null?void 0:r.throwOnConflict)||Rie(e,u,o,r==null?void 0:r.throwOnConflict);d.arguments=(0,Die.mergeArguments)(o.arguments||[],u.arguments||[],r),d.directives=(0,Sie.mergeDirectives)(o.directives,u.directives,r,i),d.description=o.description||u.description,a[l]=d}else a.push(o)}if(r&&r.sort&&a.sort(Oie.compareNodes),r&&r.exclusions){let o=r.exclusions;return a.filter(u=>!o.includes(`${e.name.value}.${u.name.value}`))}return a}RE.mergeFields=Aie;function Rie(e,t,n,r=!1){let i=(0,di.printTypeNode)(t.type),a=(0,di.printTypeNode)(n.type);if(i!==a){let o=(0,di.extractType)(t.type),u=(0,di.extractType)(n.type);if(o.name.value!==u.name.value)throw new Error(`Field "${n.name.value}" already defined with a different type. Declared as "${o.name.value}", but you tried to override with "${u.name.value}"`);if(!If(t.type,n.type,!r))throw new Error(`Field '${e.name.value}.${t.name.value}' changed type from '${i}' to '${a}'`)}return(0,di.isNonNullTypeNode)(n.type)&&!(0,di.isNonNullTypeNode)(t.type)&&(t.type=n.type),t}function If(e,t,n=!1){if(!(0,di.isWrappingTypeNode)(e)&&!(0,di.isWrappingTypeNode)(t))return e.toString()===t.toString();if((0,di.isNonNullTypeNode)(t)){let r=(0,di.isNonNullTypeNode)(e)?e.type:e;return If(r,t.type)}return(0,di.isNonNullTypeNode)(e)?If(t,e,n):(0,di.isListTypeNode)(e)?(0,di.isListTypeNode)(t)&&If(e.type,t.type)||(0,di.isNonNullTypeNode)(t)&&If(e,t.type):!1}});var eD=F(PE=>{"use strict";m();T();N();Object.defineProperty(PE,"__esModule",{value:!0});PE.mergeInputType=void 0;var Pie=Oe(),Fie=gf(),Lie=ra();function wie(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="InputObjectTypeDefinition"||t.kind==="InputObjectTypeDefinition"?"InputObjectTypeDefinition":"InputObjectTypeExtension",loc:e.loc,fields:(0,Fie.mergeFields)(e,e.fields,t.fields,n),directives:(0,Lie.mergeDirectives)(e.directives,t.directives,n,r)}}catch(i){throw new Error(`Unable to merge GraphQL input type "${e.name.value}": ${i.message}`)}return n!=null&&n.convertExtensions?W(q({},e),{kind:Pie.Kind.INPUT_OBJECT_TYPE_DEFINITION}):e}PE.mergeInputType=wie});var _f=F(FE=>{"use strict";m();T();N();Object.defineProperty(FE,"__esModule",{value:!0});FE.mergeNamedTypeArray=void 0;var Cie=Oa();function Uie(e,t){return!!e.find(n=>n.name.value===t.name.value)}function Bie(e=[],t=[],n={}){let r=[...t,...e.filter(i=>!Uie(t,i))];return n&&n.sort&&r.sort(Cie.compareNodes),r}FE.mergeNamedTypeArray=Bie});var tD=F(LE=>{"use strict";m();T();N();Object.defineProperty(LE,"__esModule",{value:!0});LE.mergeInterface=void 0;var kie=Oe(),Mie=gf(),xie=ra(),qie=_f();function Vie(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="InterfaceTypeDefinition"||t.kind==="InterfaceTypeDefinition"?"InterfaceTypeDefinition":"InterfaceTypeExtension",loc:e.loc,fields:(0,Mie.mergeFields)(e,e.fields,t.fields,n),directives:(0,xie.mergeDirectives)(e.directives,t.directives,n,r),interfaces:e.interfaces?(0,qie.mergeNamedTypeArray)(e.interfaces,t.interfaces,n):void 0}}catch(i){throw new Error(`Unable to merge GraphQL interface "${e.name.value}": ${i.message}`)}return n!=null&&n.convertExtensions?W(q({},e),{kind:kie.Kind.INTERFACE_TYPE_DEFINITION}):e}LE.mergeInterface=Vie});var nD=F(wE=>{"use strict";m();T();N();Object.defineProperty(wE,"__esModule",{value:!0});wE.mergeType=void 0;var Kie=Oe(),jie=gf(),$ie=ra(),Gie=_f();function Qie(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="ObjectTypeDefinition"||t.kind==="ObjectTypeDefinition"?"ObjectTypeDefinition":"ObjectTypeExtension",loc:e.loc,fields:(0,jie.mergeFields)(e,e.fields,t.fields,n),directives:(0,$ie.mergeDirectives)(e.directives,t.directives,n,r),interfaces:(0,Gie.mergeNamedTypeArray)(e.interfaces,t.interfaces,n)}}catch(i){throw new Error(`Unable to merge GraphQL type "${e.name.value}": ${i.message}`)}return n!=null&&n.convertExtensions?W(q({},e),{kind:Kie.Kind.OBJECT_TYPE_DEFINITION}):e}wE.mergeType=Qie});var rD=F(CE=>{"use strict";m();T();N();Object.defineProperty(CE,"__esModule",{value:!0});CE.mergeScalar=void 0;var Yie=Oe(),Jie=ra();function Hie(e,t,n,r){return t?{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="ScalarTypeDefinition"||t.kind==="ScalarTypeDefinition"?"ScalarTypeDefinition":"ScalarTypeExtension",loc:e.loc,directives:(0,Jie.mergeDirectives)(e.directives,t.directives,n,r)}:n!=null&&n.convertExtensions?W(q({},e),{kind:Yie.Kind.SCALAR_TYPE_DEFINITION}):e}CE.mergeScalar=Hie});var aD=F(UE=>{"use strict";m();T();N();Object.defineProperty(UE,"__esModule",{value:!0});UE.mergeUnion=void 0;var iD=Oe(),zie=ra(),Wie=_f();function Xie(e,t,n,r){return t?{name:e.name,description:e.description||t.description,directives:(0,zie.mergeDirectives)(e.directives,t.directives,n,r),kind:n!=null&&n.convertExtensions||e.kind==="UnionTypeDefinition"||t.kind==="UnionTypeDefinition"?iD.Kind.UNION_TYPE_DEFINITION:iD.Kind.UNION_TYPE_EXTENSION,loc:e.loc,types:(0,Wie.mergeNamedTypeArray)(e.types,t.types,n)}:n!=null&&n.convertExtensions?W(q({},e),{kind:iD.Kind.UNION_TYPE_DEFINITION}):e}UE.mergeUnion=Xie});var sD=F(Gc=>{"use strict";m();T();N();Object.defineProperty(Gc,"__esModule",{value:!0});Gc.mergeSchemaDefs=Gc.DEFAULT_OPERATION_TYPE_NAME_MAP=void 0;var vf=Oe(),Zie=ra();Gc.DEFAULT_OPERATION_TYPE_NAME_MAP={query:"Query",mutation:"Mutation",subscription:"Subscription"};function eae(e=[],t=[]){let n=[];for(let r in Gc.DEFAULT_OPERATION_TYPE_NAME_MAP){let i=e.find(a=>a.operation===r)||t.find(a=>a.operation===r);i&&n.push(i)}return n}function tae(e,t,n,r){return t?{kind:e.kind===vf.Kind.SCHEMA_DEFINITION||t.kind===vf.Kind.SCHEMA_DEFINITION?vf.Kind.SCHEMA_DEFINITION:vf.Kind.SCHEMA_EXTENSION,description:e.description||t.description,directives:(0,Zie.mergeDirectives)(e.directives,t.directives,n,r),operationTypes:eae(e.operationTypes,t.operationTypes)}:n!=null&&n.convertExtensions?W(q({},e),{kind:vf.Kind.SCHEMA_DEFINITION}):e}Gc.mergeSchemaDefs=tae});var oD=F(as=>{"use strict";m();T();N();Object.defineProperty(as,"__esModule",{value:!0});as.mergeGraphQLNodes=as.isNamedDefinitionNode=as.schemaDefSymbol=void 0;var Hr=Oe(),nae=nD(),rae=XO(),iae=rD(),aae=aD(),sae=eD(),oae=tD(),uae=ra(),cae=sD(),lae=Oa();as.schemaDefSymbol="SCHEMA_DEF_SYMBOL";function ux(e){return"name"in e}as.isNamedDefinitionNode=ux;function dae(e,t,n={}){var i,a,o;let r=n;for(let u of e)if(ux(u)){let l=(i=u.name)==null?void 0:i.value;if(t!=null&&t.commentDescriptions&&(0,lae.collectComment)(u),l==null)continue;if((a=t==null?void 0:t.exclusions)!=null&&a.includes(l+".*")||(o=t==null?void 0:t.exclusions)!=null&&o.includes(l))delete r[l];else switch(u.kind){case Hr.Kind.OBJECT_TYPE_DEFINITION:case Hr.Kind.OBJECT_TYPE_EXTENSION:r[l]=(0,nae.mergeType)(u,r[l],t,n);break;case Hr.Kind.ENUM_TYPE_DEFINITION:case Hr.Kind.ENUM_TYPE_EXTENSION:r[l]=(0,rae.mergeEnum)(u,r[l],t,n);break;case Hr.Kind.UNION_TYPE_DEFINITION:case Hr.Kind.UNION_TYPE_EXTENSION:r[l]=(0,aae.mergeUnion)(u,r[l],t,n);break;case Hr.Kind.SCALAR_TYPE_DEFINITION:case Hr.Kind.SCALAR_TYPE_EXTENSION:r[l]=(0,iae.mergeScalar)(u,r[l],t,n);break;case Hr.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Hr.Kind.INPUT_OBJECT_TYPE_EXTENSION:r[l]=(0,sae.mergeInputType)(u,r[l],t,n);break;case Hr.Kind.INTERFACE_TYPE_DEFINITION:case Hr.Kind.INTERFACE_TYPE_EXTENSION:r[l]=(0,oae.mergeInterface)(u,r[l],t,n);break;case Hr.Kind.DIRECTIVE_DEFINITION:r[l]=(0,uae.mergeDirective)(u,r[l]);break}}else(u.kind===Hr.Kind.SCHEMA_DEFINITION||u.kind===Hr.Kind.SCHEMA_EXTENSION)&&(r[as.schemaDefSymbol]=(0,cae.mergeSchemaDefs)(u,r[as.schemaDefSymbol],t));return r}as.mergeGraphQLNodes=dae});var dx=F(yd=>{"use strict";m();T();N();Object.defineProperty(yd,"__esModule",{value:!0});yd.mergeGraphQLTypes=yd.mergeTypeDefs=void 0;var ia=Oe(),uD=AE(),Td=oD(),hd=Oa(),cx=sD();function pae(e,t){(0,hd.resetComments)();let n={kind:ia.Kind.DOCUMENT,definitions:lx(e,q({useSchemaDefinition:!0,forceSchemaDefinition:!1,throwOnConflict:!1,commentDescriptions:!1},t))},r;return t!=null&&t.commentDescriptions?r=(0,hd.printWithComments)(n):r=n,(0,hd.resetComments)(),r}yd.mergeTypeDefs=pae;function Ed(e,t,n=[],r=[],i=new Set){if(e&&!i.has(e))if(i.add(e),typeof e=="function")Ed(e(),t,n,r,i);else if(Array.isArray(e))for(let a of e)Ed(a,t,n,r,i);else if((0,ia.isSchema)(e)){let a=(0,hd.getDocumentNodeFromSchema)(e,t);Ed(a.definitions,t,n,r,i)}else if((0,uD.isStringTypes)(e)||(0,uD.isSourceTypes)(e)){let a=(0,ia.parse)(e,t);Ed(a.definitions,t,n,r,i)}else if(typeof e=="object"&&(0,ia.isDefinitionNode)(e))e.kind===ia.Kind.DIRECTIVE_DEFINITION?n.push(e):r.push(e);else if((0,hd.isDocumentNode)(e))Ed(e.definitions,t,n,r,i);else throw new Error(`typeDefs must contain only strings, documents, schemas, or functions, got ${typeof e}`);return{allDirectives:n,allNodes:r}}function lx(e,t){var u,l,d;(0,hd.resetComments)();let{allDirectives:n,allNodes:r}=Ed(e,t),i=(0,Td.mergeGraphQLNodes)(n,t),a=(0,Td.mergeGraphQLNodes)(r,t,i);if(t!=null&&t.useSchemaDefinition){let p=a[Td.schemaDefSymbol]||{kind:ia.Kind.SCHEMA_DEFINITION,operationTypes:[]},E=p.operationTypes;for(let h in cx.DEFAULT_OPERATION_TYPE_NAME_MAP)if(!E.find(S=>S.operation===h)){let S=cx.DEFAULT_OPERATION_TYPE_NAME_MAP[h],k=a[S];k!=null&&k.name!=null&&E.push({kind:ia.Kind.OPERATION_TYPE_DEFINITION,type:{kind:ia.Kind.NAMED_TYPE,name:k.name},operation:h})}((u=p==null?void 0:p.operationTypes)==null?void 0:u.length)!=null&&p.operationTypes.length>0&&(a[Td.schemaDefSymbol]=p)}t!=null&&t.forceSchemaDefinition&&!((d=(l=a[Td.schemaDefSymbol])==null?void 0:l.operationTypes)!=null&&d.length)&&(a[Td.schemaDefSymbol]={kind:ia.Kind.SCHEMA_DEFINITION,operationTypes:[{kind:ia.Kind.OPERATION_TYPE_DEFINITION,operation:"query",type:{kind:ia.Kind.NAMED_TYPE,name:{kind:ia.Kind.NAME,value:"Query"}}}]});let o=Object.values(a);if(t!=null&&t.sort){let p=typeof t.sort=="function"?t.sort:uD.defaultStringComparator;o.sort((E,h)=>{var _,S;return p((_=E.name)==null?void 0:_.value,(S=h.name)==null?void 0:S.value)})}return o}yd.mergeGraphQLTypes=lx});var px=F(Vr=>{"use strict";m();T();N();Object.defineProperty(Vr,"__esModule",{value:!0});var pi=(_S(),dN(gS));pi.__exportStar(zO(),Vr);pi.__exportStar(ra(),Vr);pi.__exportStar(WO(),Vr);pi.__exportStar(XO(),Vr);pi.__exportStar(gf(),Vr);pi.__exportStar(eD(),Vr);pi.__exportStar(tD(),Vr);pi.__exportStar(_f(),Vr);pi.__exportStar(oD(),Vr);pi.__exportStar(dx(),Vr);pi.__exportStar(rD(),Vr);pi.__exportStar(nD(),Vr);pi.__exportStar(aD(),Vr);pi.__exportStar(AE(),Vr)});var mx=F(Ku=>{"use strict";m();T();N();Object.defineProperty(Ku,"__esModule",{value:!0});Ku.applyExtensions=Ku.mergeExtensions=Ku.extractExtensionsFromSchema=void 0;var fx=Oa(),fae=Oa();Object.defineProperty(Ku,"extractExtensionsFromSchema",{enumerable:!0,get:function(){return fae.extractExtensionsFromSchema}});function mae(e){return(0,fx.mergeDeep)(e)}Ku.mergeExtensions=mae;function Id(e,t){e&&(e.extensions=(0,fx.mergeDeep)([e.extensions||{},t||{}]))}function Nae(e,t){Id(e,t.schemaExtensions);for(let[n,r]of Object.entries(t.types||{})){let i=e.getType(n);if(i){if(Id(i,r.extensions),r.type==="object"||r.type==="interface")for(let[a,o]of Object.entries(r.fields)){let u=i.getFields()[a];if(u){Id(u,o.extensions);for(let[l,d]of Object.entries(o.arguments))Id(u.args.find(p=>p.name===l),d)}}else if(r.type==="input")for(let[a,o]of Object.entries(r.fields)){let u=i.getFields()[a];Id(u,o.extensions)}else if(r.type==="enum")for(let[a,o]of Object.entries(r.values)){let u=i.getValue(a);Id(u,o)}}}return e}Ku.applyExtensions=Nae});var BE=F(Sf=>{"use strict";m();T();N();Object.defineProperty(Sf,"__esModule",{value:!0});var cD=(_S(),dN(gS));cD.__exportStar(tx(),Sf);cD.__exportStar(px(),Sf);cD.__exportStar(mx(),Sf)});var Ji=F(J=>{"use strict";m();T();N();Object.defineProperty(J,"__esModule",{value:!0});J.semanticNonNullArgumentErrorMessage=J.invalidEventProviderIdErrorMessage=J.invalidNatsStreamConfigurationDefinitionErrorMessage=J.invalidEdfsPublishResultObjectErrorMessage=J.invalidNatsStreamInputErrorMessage=J.inlineFragmentInFieldSetErrorMessage=J.inaccessibleQueryRootTypeError=J.subgraphValidationFailureError=J.minimumSubgraphRequirementError=void 0;J.multipleNamedTypeDefinitionError=hae;J.incompatibleInputValueDefaultValueTypeError=yae;J.incompatibleMergedTypesError=Iae;J.incompatibleInputValueDefaultValuesError=gae;J.incompatibleSharedEnumError=_ae;J.invalidSubgraphNamesError=vae;J.duplicateDirectiveDefinitionError=Sae;J.duplicateEnumValueDefinitionError=Oae;J.duplicateFieldDefinitionError=Dae;J.duplicateInputFieldDefinitionError=bae;J.duplicateImplementedInterfaceError=Aae;J.duplicateUnionMemberDefinitionError=Rae;J.duplicateTypeDefinitionError=Pae;J.duplicateOperationTypeDefinitionError=Fae;J.noBaseDefinitionForExtensionError=Lae;J.noBaseScalarDefinitionError=wae;J.noDefinedUnionMembersError=Cae;J.noDefinedEnumValuesError=Uae;J.operationDefinitionError=Bae;J.invalidFieldShareabilityError=kae;J.undefinedDirectiveError=Mae;J.undefinedTypeError=xae;J.invalidRepeatedDirectiveErrorMessage=qae;J.invalidDirectiveError=Vae;J.invalidRepeatedFederatedDirectiveErrorMessage=Kae;J.invalidDirectiveLocationErrorMessage=jae;J.undefinedRequiredArgumentsErrorMessage=$ae;J.unexpectedDirectiveArgumentErrorMessage=Gae;J.duplicateDirectiveArgumentDefinitionsErrorMessage=Qae;J.invalidArgumentValueErrorMessage=Yae;J.maximumTypeNestingExceededError=Jae;J.unexpectedKindFatalError=Hae;J.incompatibleParentKindFatalError=zae;J.unexpectedEdgeFatalError=Wae;J.incompatibleParentTypeMergeError=Zae;J.unexpectedTypeNodeKindFatalError=ese;J.invalidKeyFatalError=tse;J.unexpectedParentKindForChildError=nse;J.subgraphValidationError=rse;J.invalidSubgraphNameErrorMessage=ise;J.invalidOperationTypeDefinitionError=ase;J.invalidRootTypeDefinitionError=sse;J.subgraphInvalidSyntaxError=ose;J.invalidInterfaceImplementationError=use;J.invalidRequiredInputValueError=cse;J.duplicateArgumentsError=lse;J.noQueryRootTypeError=dse;J.expectedEntityError=pse;J.abstractTypeInKeyFieldSetErrorMessage=fse;J.unknownTypeInFieldSetErrorMessage=mse;J.invalidSelectionSetErrorMessage=Nse;J.invalidSelectionSetDefinitionErrorMessage=Tse;J.undefinedFieldInFieldSetErrorMessage=Ese;J.unparsableFieldSetErrorMessage=hse;J.unparsableFieldSetSelectionErrorMessage=yse;J.undefinedCompositeOutputTypeError=Ise;J.unexpectedArgumentErrorMessage=gse;J.argumentsInKeyFieldSetErrorMessage=_se;J.invalidProvidesOrRequiresDirectivesError=vse;J.duplicateFieldInFieldSetErrorMessage=Sse;J.invalidConfigurationDataErrorMessage=Ose;J.incompatibleTypeWithProvidesErrorMessage=Dse;J.invalidInlineFragmentTypeErrorMessage=bse;J.inlineFragmentWithoutTypeConditionErrorMessage=Ase;J.unknownInlineFragmentTypeConditionErrorMessage=Rse;J.invalidInlineFragmentTypeConditionTypeErrorMessage=Pse;J.invalidInlineFragmentTypeConditionErrorMessage=Fse;J.invalidSelectionOnUnionErrorMessage=Lse;J.duplicateOverriddenFieldErrorMessage=wse;J.duplicateOverriddenFieldsError=Cse;J.noFieldDefinitionsError=Use;J.noInputValueDefinitionsError=Bse;J.allChildDefinitionsAreInaccessibleError=kse;J.equivalentSourceAndTargetOverrideErrorMessage=Mse;J.undefinedEntityInterfaceImplementationsError=xse;J.orScopesLimitError=qse;J.invalidEventDrivenGraphError=Vse;J.invalidRootTypeFieldEventsDirectivesErrorMessage=Kse;J.invalidEventDrivenMutationResponseTypeErrorMessage=jse;J.invalidRootTypeFieldResponseTypesEventDrivenErrorMessage=$se;J.invalidNatsStreamInputFieldsErrorMessage=Gse;J.invalidKeyFieldSetsEventDrivenErrorMessage=Qse;J.nonExternalKeyFieldNamesEventDrivenErrorMessage=Yse;J.nonKeyFieldNamesEventDrivenErrorMessage=Jse;J.nonEntityObjectExtensionsEventDrivenErrorMessage=Hse;J.nonKeyComposingObjectTypeNamesEventDrivenErrorMessage=zse;J.invalidEdfsDirectiveName=Wse;J.invalidImplementedTypeError=Xse;J.selfImplementationError=Zse;J.invalidEventSubjectErrorMessage=eoe;J.invalidEventSubjectsErrorMessage=toe;J.invalidEventSubjectsItemErrorMessage=noe;J.invalidEventSubjectsArgumentErrorMessage=roe;J.undefinedEventSubjectsArgumentErrorMessage=ioe;J.invalidEventDirectiveError=aoe;J.invalidReferencesOfInaccessibleTypeError=soe;J.inaccessibleRequiredInputValueError=ooe;J.invalidUnionMemberTypeError=uoe;J.invalidRootTypeError=coe;J.invalidSubscriptionFilterLocationError=loe;J.invalidSubscriptionFilterDirectiveError=doe;J.subscriptionFilterNamedTypeErrorMessage=poe;J.subscriptionFilterConditionDepthExceededErrorMessage=foe;J.subscriptionFilterConditionInvalidInputFieldNumberErrorMessage=moe;J.subscriptionFilterConditionInvalidInputFieldErrorMessage=Noe;J.subscriptionFilterConditionInvalidInputFieldTypeErrorMessage=Toe;J.subscriptionFilterArrayConditionInvalidItemTypeErrorMessage=Eoe;J.subscriptionFilterArrayConditionInvalidLengthErrorMessage=hoe;J.invalidInputFieldTypeErrorMessage=yoe;J.subscriptionFieldConditionInvalidInputFieldErrorMessage=Ioe;J.subscriptionFieldConditionInvalidValuesArrayErrorMessage=goe;J.subscriptionFieldConditionEmptyValuesArrayErrorMessage=_oe;J.unknownFieldSubgraphNameError=voe;J.invalidSubscriptionFieldConditionFieldPathErrorMessage=Soe;J.invalidSubscriptionFieldConditionFieldPathParentErrorMessage=Ooe;J.undefinedSubscriptionFieldConditionFieldPathFieldErrorMessage=Doe;J.invalidSubscriptionFieldConditionFieldPathFieldErrorMessage=boe;J.inaccessibleSubscriptionFieldConditionFieldPathFieldErrorMessage=Aoe;J.nonLeafSubscriptionFieldConditionFieldPathFinalFieldErrorMessage=Roe;J.unresolvablePathError=Poe;J.allExternalFieldInstancesError=Foe;J.externalInterfaceFieldsError=Loe;J.nonExternalConditionalFieldError=woe;J.incompatibleFederatedFieldNamedTypeError=Coe;J.unknownNamedTypeErrorMessage=Ix;J.unknownNamedTypeError=Uoe;J.unknownFieldDataError=Boe;J.unexpectedNonCompositeOutputTypeError=koe;J.invalidExternalDirectiveError=Moe;J.configureDescriptionNoDescriptionError=xoe;J.configureDescriptionPropagationError=qoe;J.duplicateDirectiveDefinitionArgumentErrorMessage=Voe;J.duplicateDirectiveDefinitionLocationErrorMessage=Koe;J.invalidDirectiveDefinitionLocationErrorMessage=joe;J.invalidDirectiveDefinitionError=$oe;J.typeNameAlreadyProvidedErrorMessage=Goe;J.fieldAlreadyProvidedErrorMessage=Qoe;J.invalidInterfaceObjectImplementationDefinitionsError=Yoe;J.invalidNamedTypeError=Joe;J.semanticNonNullLevelsNaNIndexErrorMessage=Hoe;J.semanticNonNullLevelsIndexOutOfBoundsErrorMessage=zoe;J.semanticNonNullLevelsNonNullErrorMessage=Woe;J.semanticNonNullInconsistentLevelsError=Xoe;J.oneOfRequiredFieldsError=Zoe;J.entityCacheWithoutKeyErrorMessage=eue;J.queryCacheOnNonQueryFieldErrorMessage=tue;J.queryCacheOnNonEntityReturnTypeErrorMessage=nue;J.maxAgeNotPositiveIntegerErrorMessage=rue;J.negativeCacheTTLNotNonNegativeIntegerErrorMessage=iue;J.isWithoutQueryCacheErrorMessage=aue;J.isReferencesUnknownKeyFieldErrorMessage=sue;J.duplicateKeyFieldMappingErrorMessage=oue;J.cacheInvalidateOnNonMutationSubscriptionFieldErrorMessage=uue;J.cacheInvalidateOnNonEntityReturnTypeErrorMessage=cue;J.cachePopulateOnNonMutationSubscriptionFieldErrorMessage=lue;J.cachePopulateOnNonEntityReturnTypeErrorMessage=due;J.cacheInvalidateAndPopulateMutualExclusionErrorMessage=pue;J.explicitTypeMismatchErrorMessage=fue;J.nonKeyFieldSpecErrorMessage=mue;J.listArgumentToScalarKeySpecErrorMessage=Nue;J.scalarArgumentToListKeySpecErrorMessage=Tue;J.explicitIncompleteCompositeKeyErrorMessage=Eue;J.explicitSingularAdditionalNonKeyArgumentErrorMessage=hue;J.explicitCompositeAdditionalNonKeyArgumentErrorMessage=yue;J.batchListValuedKeyRequiresNestedListsErrorMessage=Iue;J.explicitBatchAdditionalNonKeyArgumentErrorMessage=gue;J.explicitScalarArgumentsCannotEstablishBatchMappingErrorMessage=_ue;J.multipleListArgumentsBatchFactoryMessage=vue;J.inputObjectCompositeTypeMismatchErrorMessage=Sue;J.inputObjectCompositeMissingFieldErrorMessage=Oue;J.nestedInputObjectTypeMismatchErrorMessage=Due;J.nestedInputObjectMissingFieldErrorMessage=bue;J.nonInputArgumentCannotTargetCompositeKeyErrorMessage=Aue;J.listSizeInvalidSlicingArgumentErrorMessage=Rue;J.listSizeSlicingArgumentNotIntErrorMessage=Pue;J.listSizeSizedFieldNotFoundErrorMessage=Fue;J.listSizeSizedFieldNotListErrorMessage=Lue;J.listSizeFieldMustReturnListOrUseSizedFieldsErrorMessage=wue;J.listSizeSizedFieldsInvalidReturnTypeErrorMessage=Cue;J.listSizeSizedFieldsOnListsErrorMessage=Uue;J.listSizeAssumedSizeWithRequiredSlicingArgumentErrorMessage=Bue;J.listSizeAssumedSizeSlicingArgDefaultErrorMessage=kue;J.costOnInterfaceFieldErrorMessage=Mue;var Nx=Oe(),He=Zn(),Tx=Wl(),Qc=Mr(),Tae=ed(),Eae=BE();J.minimumSubgraphRequirementError=new Error("At least one subgraph is required for federation.");function hae(e,t,n){return new Error(`The named type "${e}" is defined as both types "${t}" and "${n}". +However, there must be only one type named "${e}".`)}function yae(e,t,n,r){return new Error(`The ${e} of type "${n}" defined on path "${t}" is incompatible with the default value of "${r}".`)}function Iae({actualType:e,coords:t,expectedType:n,isArgument:r}){return new Error(`Incompatible types when merging two instances of ${r?"field argument":He.FIELD} "${t}": + Expected type "${n}" but received "${e}".`)}function gae(e,t,n,r,i){return new Error(`Expected the ${e} defined on path "${t}" to define the default value "${r}". "However, the default value "${i}" is defined in the following subgraph`+(n.length>1?"s":"")+`: - "`+n.join(Je.QUOTATION_JOIN)+`" -If an instance defines a default value, that default value must be consistently defined across all subgraphs.`)}function uae(e){return new Error(`Enum "${e}" was used as both an input and output but was inconsistently defined across inclusive subgraphs. To update an Enum used as both an input and output, add any new Enum values with the @inaccessible directive in the origin subgraph. Next, add those new Enum values to all other subgraphs that define the Enum\u2014this time without the @inaccessible directive. Finally, once all subgraphs have been updated, remove @inaccessible from the Enum values in the origin subgraph.`)}function cae(e,t){let n="Subgraphs to be federated must each have a unique, non-empty name.";e.length>0&&(n+=` + "`+n.join(He.QUOTATION_JOIN)+`" +If an instance defines a default value, that default value must be consistently defined across all subgraphs.`)}function _ae(e){return new Error(`Enum "${e}" was used as both an input and output but was inconsistently defined across inclusive subgraphs. To update an Enum used as both an input and output, add any new Enum values with the @inaccessible directive in the origin subgraph. Next, add those new Enum values to all other subgraphs that define the Enum\u2014this time without the @inaccessible directive. Finally, once all subgraphs have been updated, remove @inaccessible from the Enum values in the origin subgraph.`)}function vae(e,t){let n="Subgraphs to be federated must each have a unique, non-empty name.";e.length>0&&(n+=` The following subgraph names are not unique: "`+e.join('", "')+'"');for(let r of t)n+=` - ${r}`;return new Error(n)}function lae(e){return new Error(`The directive "${e}" must only be defined once.`)}function dae(e,t){return new Error(`The Enum "${e}" must only define the Enum value definition "${t}" once.`)}function fae(e,t,n){return new Error(`The ${e} "${t}" must only define the field definition "${n}" once.`)}function pae(e,t){return new Error(`The Input Object "${e}" must only define the Input field definition "${t}" once.`)}function mae(e,t,n){return new Error(`The ${e} "${t}" must only implement the Interface "${n}" once.`)}function Nae(e,t){return new Error(`The Union "${e}" must only define the Union member "${t}" once.`)}function Tae(e,t){return new Error(`The ${e} "${t}" must only be defined once.`)}function Eae(e,t,n){return new Error(`The operation type "${e}" cannot be defined as "${t}" because it has already been defined as "${n}".`)}function hae(e,t){return new Error(`The ${e} "${t}" is an extension, but no base ${e} definition of "${t}" is defined in any subgraph.`)}function yae(e){return new Error(`The Scalar extension "${e}" is invalid because no base Scalar definition of "${e} is defined in the subgraph.`)}function Iae(e){return new Error(`The Union "${e}" must define at least one Union member.`)}function gae(e){return new Error(`The Enum "${e}" must define at least one Enum value.`)}function _ae(e,t,n){return new Error(`Expected the response type "${e}" for operation "${t}" to be type Object but received "${n}.`)}function vae(e,t){let n=e.name,r=[];for(let[i,a]of e.fieldDataByName){if(!t.has(i))continue;let o=[],u=[];for(let[l,d]of a.isShareableBySubgraphName)d?o.push(l):u.push(l);o.length<1?r.push(` + ${r}`;return new Error(n)}function Sae(e){return new Error(`The directive "${e}" must only be defined once.`)}function Oae(e,t){return new Error(`The Enum "${e}" must only define the Enum value definition "${t}" once.`)}function Dae(e,t,n){return new Error(`The ${e} "${t}" must only define the field definition "${n}" once.`)}function bae(e,t){return new Error(`The Input Object "${e}" must only define the Input field definition "${t}" once.`)}function Aae(e,t,n){return new Error(`The ${e} "${t}" must only implement the Interface "${n}" once.`)}function Rae(e,t){return new Error(`The Union "${e}" must only define the Union member "${t}" once.`)}function Pae(e,t){return new Error(`The ${e} "${t}" must only be defined once.`)}function Fae(e,t,n){return new Error(`The operation type "${e}" cannot be defined as "${t}" because it has already been defined as "${n}".`)}function Lae(e,t){return new Error(`The ${e} "${t}" is an extension, but no base ${e} definition of "${t}" is defined in any subgraph.`)}function wae(e){return new Error(`The Scalar extension "${e}" is invalid because no base Scalar definition of "${e} is defined in the subgraph.`)}function Cae(e){return new Error(`The Union "${e}" must define at least one Union member.`)}function Uae(e){return new Error(`The Enum "${e}" must define at least one Enum value.`)}function Bae(e,t,n){return new Error(`Expected the response type "${e}" for operation "${t}" to be type Object but received "${n}.`)}function kae(e,t){let n=e.name,r=[];for(let[i,a]of e.fieldDataByName){if(!t.has(i))continue;let o=[],u=[];for(let[l,d]of a.isShareableBySubgraphName)d?o.push(l):u.push(l);o.length<1?r.push(` The field "${i}" is defined in the following subgraphs: "${[...a.subgraphNames].join('", "')}". However, it is not declared "@shareable" in any of them.`):r.push(` - The field "${i}" is defined and declared "@shareable" in the following subgraph`+(o.length>1?"s":"")+': "'+o.join(Je.QUOTATION_JOIN)+`". - However, it is not declared "@shareable" in the following subgraph`+(u.length>1?"s":"")+`: "${u.join(Je.QUOTATION_JOIN)}".`)}return new Error(`The Object "${n}" defines the same fields in multiple subgraphs without the "@shareable" directive:${r.join(` -`)}`)}function Sae(e,t){return new Error(`The directive "@${e}" declared on coordinates "${t}" is not defined in the schema.`)}function Oae(e){return new Error(` The type "${e}" was referenced in the schema, but it was never defined.`)}function Dae(e){return`The definition for the directive "@${e}" does not define it as repeatable, but it is declared more than once on these coordinates.`}function bae(e,t,n,r){return new Error(`The ${n} instance of the directive "@${e}" declared on coordinates "${t}" is invalid for the following reason`+(r.length>1?`s: + The field "${i}" is defined and declared "@shareable" in the following subgraph`+(o.length>1?"s":"")+': "'+o.join(He.QUOTATION_JOIN)+`". + However, it is not declared "@shareable" in the following subgraph`+(u.length>1?"s":"")+`: "${u.join(He.QUOTATION_JOIN)}".`)}return new Error(`The Object "${n}" defines the same fields in multiple subgraphs without the "@shareable" directive:${r.join(` +`)}`)}function Mae(e,t){return new Error(`The directive "@${e}" declared on coordinates "${t}" is not defined in the schema.`)}function xae(e){return new Error(` The type "${e}" was referenced in the schema, but it was never defined.`)}function qae(e){return`The definition for the directive "@${e}" does not define it as repeatable, but it is declared more than once on these coordinates.`}function Vae(e,t,n,r){return new Error(`The ${n} instance of the directive "@${e}" declared on coordinates "${t}" is invalid for the following reason`+(r.length>1?`s: `:`: `)+r.join(` -`))}function Aae(e,t){return new Error(`The definition for the directive "@${e}" does not define it as repeatable, but the directive has been declared on more than one instance of the type "${t}".`)}function Rae(e,t){return` The definition for "@${e}" does not define "${t}" as a valid location.`}function Pae(e,t,n){let r=` The definition for "@${e}" defines the following `+t.length+" required argument"+(t.length>1?"s: ":": ")+'"'+t.join('", "')+`". - However,`;return n.length<1?r+" no arguments are defined on this instance.":r+" the following required argument"+(n.length>1?"s are":" is")+' not defined on this instance: "'+n.join(Je.QUOTATION_JOIN)+'".'}function Fae(e,t){return` The definition for "@${e}" does not define the following argument`+(t.length>1?"s that are":" that is")+' provided: "'+t.join(Je.QUOTATION_JOIN)+'".'}function wae(e){return" The following argument"+(e.length>1?"s are":" is")+' defined more than once: "'+e.join(Je.QUOTATION_JOIN)+'"'}function Lae(e,t,n,r){return` The value "${e}" provided to argument "${t}(${n}: ...)" is not a valid "${r}" type.`}function Cae(e){return new Error(` The type defined at path "${e}" has more than ${nx.MAXIMUM_TYPE_NESTING} layers of nesting, or there is a cyclical error.`)}function Uae(e){return new Error(`Fatal: Unexpected type for "${e}"`)}function Bae(e,t,n){return new Error(`Fatal: Expected "${e}" to be type ${(0,Mc.kindToNodeType)(t)} but received "${(0,Mc.kindToNodeType)(n)}".`)}function kae(e,t){return new Error(`Fatal: The type "${e}" visited the following unexpected edge`+(t.length>1?"s":"")+`: - "${t.join(Je.QUOTATION_JOIN)}".`)}var Mae='"Interface Object" (an "Object" type that also defines the "@interfaceObject" directive)';function xae({existingData:e,incomingNodeType:t,incomingSubgraphName:n}){let r=[...e.subgraphNames],i=t?`"${t}"`:Mae;return new Error(` "${e.name}" is defined using incompatible types across subgraphs. It is defined as type "${(0,Mc.kindToNodeType)(e.kind)}" in subgraph`+(r.length>1?"s":"")+` "${r.join(Je.QUOTATION_JOIN)}" but type ${i} in subgraph "${n}".`)}function qae(e){return new Error(`Fatal: Expected all constituent types at path "${e}" to be one of the following: "LIST_TYPE", "NAMED_TYPE", or "NON_NULL_TYPE".`)}function Vae(e,t){return new Error(`Fatal: Expected key "${e}" to exist in the map "${t}".`)}X.subgraphValidationFailureError=new Error(" Fatal: Subgraph validation did not return a valid AST.");function jae(e,t,n,r,i){return new Error(` Expected "${e}" to be type "${t}" but received "${n}" when handling child "${r}" of type "${i}".`)}function Kae(e,t){return new Error(`The subgraph "${e}" could not be federated for the following reason`+(t.length>1?"s":"")+`: +`))}function Kae(e,t){return new Error(`The definition for the directive "@${e}" does not define it as repeatable, but the directive has been declared on more than one instance of the type "${t}".`)}function jae(e,t){return` The definition for "@${e}" does not define "${t}" as a valid location.`}function $ae(e,t,n){let r=` The definition for "@${e}" defines the following `+t.length+" required argument"+(t.length>1?"s: ":": ")+'"'+t.join('", "')+`". + However,`;return n.length<1?r+" no arguments are defined on this instance.":r+" the following required argument"+(n.length>1?"s are":" is")+' not defined on this instance: "'+n.join(He.QUOTATION_JOIN)+'".'}function Gae(e,t){return` The definition for "@${e}" does not define the following argument`+(t.length>1?"s that are":" that is")+' provided: "'+t.join(He.QUOTATION_JOIN)+'".'}function Qae(e){return" The following argument"+(e.length>1?"s are":" is")+' defined more than once: "'+e.join(He.QUOTATION_JOIN)+'"'}function Yae(e,t,n,r){return` The value "${e}" provided to argument "${t}(${n}: ...)" is not a valid "${r}" type.`}function Jae(e){return new Error(` The type defined at path "${e}" has more than ${Tx.MAXIMUM_TYPE_NESTING} layers of nesting, or there is a cyclical error.`)}function Hae(e){return new Error(`Fatal: Unexpected type for "${e}"`)}function zae(e,t,n){return new Error(`Fatal: Expected "${e}" to be type ${(0,Qc.kindToNodeType)(t)} but received "${(0,Qc.kindToNodeType)(n)}".`)}function Wae(e,t){return new Error(`Fatal: The type "${e}" visited the following unexpected edge`+(t.length>1?"s":"")+`: + "${t.join(He.QUOTATION_JOIN)}".`)}var Xae='"Interface Object" (an "Object" type that also defines the "@interfaceObject" directive)';function Zae({existingData:e,incomingNodeType:t,incomingSubgraphName:n}){let r=[...e.subgraphNames],i=t?`"${t}"`:Xae;return new Error(` "${e.name}" is defined using incompatible types across subgraphs. It is defined as type "${(0,Qc.kindToNodeType)(e.kind)}" in subgraph`+(r.length>1?"s":"")+` "${r.join(He.QUOTATION_JOIN)}" but type ${i} in subgraph "${n}".`)}function ese(e){return new Error(`Fatal: Expected all constituent types at path "${e}" to be one of the following: "LIST_TYPE", "NAMED_TYPE", or "NON_NULL_TYPE".`)}function tse(e,t){return new Error(`Fatal: Expected key "${e}" to exist in the map "${t}".`)}J.subgraphValidationFailureError=new Error(" Fatal: Subgraph validation did not return a valid AST.");function nse(e,t,n,r,i){return new Error(` Expected "${e}" to be type "${t}" but received "${n}" when handling child "${r}" of type "${i}".`)}function rse(e,t){return new Error(`The subgraph "${e}" could not be federated for the following reason`+(t.length>1?"s":"")+`: `+t.map(n=>n.message).join(` -`))}function $ae(e,t){return`The ${(0,Mc.numberToOrdinal)(e+1)} subgraph in the array did not define a name. Consequently, any further errors will temporarily identify this subgraph as "${t}".`}function Gae(e,t,n){return new Error(`The schema definition defines the "${e}" operation as type "${t}". However, "${t}" was also used for the "${n}" operation. - If explicitly defined, each operation type must be a unique and valid Object type.`)}function Qae(e,t,n){return new Error(`The schema definition defines the "${e}" operation as type "${t}". However, the schema also defines another type named "${n}", which is the default (root) type name for the "${e}" operation. -For federation, it is only possible to use the default root types names ("Mutation", "Query", "Subscription") as operation definitions. No other definitions with these default root type names are valid.`)}function Yae(e){let t="The subgraph has syntax errors and could not be parsed.";return e&&(t+=` - The reason provided was: `+e.message),new Error(t)}function Jae(e,t,n){let r=[];for(let[i,a]of n){let o=` The implementation of Interface "${i}" by "${e}" is invalid because: +`))}function ise(e,t){return`The ${(0,Qc.numberToOrdinal)(e+1)} subgraph in the array did not define a name. Consequently, any further errors will temporarily identify this subgraph as "${t}".`}function ase(e,t,n){return new Error(`The schema definition defines the "${e}" operation as type "${t}". However, "${t}" was also used for the "${n}" operation. + If explicitly defined, each operation type must be a unique and valid Object type.`)}function sse(e,t,n){return new Error(`The schema definition defines the "${e}" operation as type "${t}". However, the schema also defines another type named "${n}", which is the default (root) type name for the "${e}" operation. +For federation, it is only possible to use the default root types names ("Mutation", "Query", "Subscription") as operation definitions. No other definitions with these default root type names are valid.`)}function ose(e){let t="The subgraph has syntax errors and could not be parsed.";return e&&(t+=` + The reason provided was: `+e.message),new Error(t)}function use(e,t,n){let r=[];for(let[i,a]of n){let o=` The implementation of Interface "${i}" by "${e}" is invalid because: `,u=a.unimplementedFields.length;u&&(o+=` The following field${u>1?"s are":" is"} not implemented: "`+a.unimplementedFields.join('", "')+`" `);for(let[l,d]of a.invalidFieldImplementations){let p=d.unimplementedArguments.size,E=d.invalidImplementedArguments.length,h=d.invalidAdditionalArguments.size;if(o+=` The field "${l}" is invalid because: `,p&&(o+=` The following argument${p>1?"s are":" is"} not implemented: "`+[...d.unimplementedArguments].join('", "')+`" `),E){o+=` The following implemented argument${E>1?"s are":" is"} invalid: -`;for(let v of d.invalidImplementedArguments)o+=` The argument "${v.argumentName}" must define type "`+v.expectedType+`" and not "${v.actualType}" +`;for(let _ of d.invalidImplementedArguments)o+=` The argument "${_.argumentName}" must define type "`+_.expectedType+`" and not "${_.actualType}" `}h&&(o+=` If a field from an Interface is implemented, any additional Arguments that were not defined on the original Interface field must be optional (nullable). `,o+=" The following additional argument"+(d.invalidAdditionalArguments.size>1?"s are":" is")+' not defined as optional: "'+[...d.invalidAdditionalArguments].join('", "')+`" `),d.implementedResponseType&&(o+=` The implemented response type "${d.implementedResponseType}" is not a valid subtype (equally or more restrictive) of the response type "`+d.originalResponseType+`" for "${i}.${l}". @@ -268,216 +268,216 @@ For federation, it is only possible to use the default root types names ("Mutati Consequently, the Interface implementation cannot be satisfied. `)}r.push(o)}return new Error(`The ${t} "${e}" has the following Interface implementation errors: `+r.join(` -`))}function zae(e,t,n,r=!0){let i=r?Je.ARGUMENT:Je.INPUT_FIELD,a=`The ${e} "${t}" could not be federated because: +`))}function cse(e,t,n,r=!0){let i=r?He.ARGUMENT:He.INPUT_FIELD,a=`The ${e} "${t}" could not be federated because: `;for(let o of n)a+=` The ${i} "${o.inputValueName}" is required in the following subgraph`+(o.requiredSubgraphs.length>1?"s":"")+': "'+o.requiredSubgraphs.join('", "')+`" However, the ${i} "${o.inputValueName}" is not defined in the following subgraph`+(o.missingSubgraphs.length>1?"s":"")+': "'+o.missingSubgraphs.join('", "')+`" If an ${i} is required on a ${e} in any one subgraph, it must be at least defined as optional on all other definitions of that ${e} in all other subgraphs. -`;return new Error(a)}function Hae(e,t){return new Error(`The field "${e}" is invalid because: - The following argument`+(t.length>1?"s are":" is")+' defined more than once: "'+t.join(Je.QUOTATION_JOIN)+`" -`)}function Wae(e=!0){return new Error(`The ${e?"router":"client"} schema does not define at least one accessible query root type field after federation was completed, which is necessary for a federated graph to be valid. +`;return new Error(a)}function lse(e,t){return new Error(`The field "${e}" is invalid because: + The following argument`+(t.length>1?"s are":" is")+' defined more than once: "'+t.join(He.QUOTATION_JOIN)+`" +`)}function dse(e=!0){return new Error(`The ${e?"router":"client"} schema does not define at least one accessible query root type field after federation was completed, which is necessary for a federated graph to be valid. For example: type Query { dummy: String - }`)}X.inaccessibleQueryRootTypeError=new Error('The root query type "Query" must be present in the client schema; consequently, it must not be declared "@inaccessible".');function Xae(e){return new Error(`Expected object "${e}" to define a "key" directive, but it defines no directives.`)}X.inlineFragmentInFieldSetErrorMessage=" Inline fragments are not currently supported within a field set argument.";function Zae(e,t,n,r){return` The following field set is invalid: + }`)}J.inaccessibleQueryRootTypeError=new Error('The root query type "Query" must be present in the client schema; consequently, it must not be declared "@inaccessible".');function pse(e){return new Error(`Expected object "${e}" to define a "key" directive, but it defines no directives.`)}J.inlineFragmentInFieldSetErrorMessage=" Inline fragments are not currently supported within a field set argument.";function fse(e,t,n,r){return` The following field set is invalid: "${e}" This is because "${t}" returns "${n}", which is type "${r}". - Fields that return abstract types (Interfaces and Unions) cannot be included in the field set of "@key" directives.`}function ese(e,t,n){return` The following field set is invalid: + Fields that return abstract types (Interfaces and Unions) cannot be included in the field set of "@key" directives.`}function mse(e,t,n){return` The following field set is invalid: "${e}" - This is because "${t}" returns the unknown type "${n}".`}function tse(e,t,n,r){return` The following field set is invalid: + This is because "${t}" returns the unknown type "${n}".`}function Nse(e,t,n,r){return` The following field set is invalid: "${e}" - This is because of the selection set corresponding to the `+vE(t,n,r)+` Composite types such as "${r}" types must define a selection set with at least one field selection.`}function nse(e,t,n,r){return` The following field set is invalid: + This is because of the selection set corresponding to the `+kE(t,n,r)+` Composite types such as "${r}" types must define a selection set with at least one field selection.`}function Tse(e,t,n,r){return` The following field set is invalid: "${e}" - This is because of the selection set corresponding to the `+vE(t,n,r)+` Non-composite types such as "${r}" cannot define a selection set.`}function rse(e,t,n){return` The following field set is invalid: + This is because of the selection set corresponding to the `+kE(t,n,r)+` Non-composite types such as "${r}" cannot define a selection set.`}function Ese(e,t,n){return` The following field set is invalid: "${e}" This is because of the selection set corresponding to the field coordinates "${t}.${n}". - The type "${t}" does not define a field named "${n}".`}function ise(e,t){let n=` The following field set is invalid: + The type "${t}" does not define a field named "${n}".`}function hse(e,t){let n=` The following field set is invalid: "${e}" The field set could not be parsed.`;return t&&(n+=` - The reason provided was: `+t.message),n}function ase(e,t){return` The following field set is invalid: + The reason provided was: `+t.message),n}function yse(e,t){return` The following field set is invalid: "${e}" - This is because the selection set defined on "${t}" could not be parsed.`}function sse(e){return new Error(` Expected an object/interface or object/interface extension named "${e}" to exist.`)}function ose(e,t,n){return` The following field set is invalid: + This is because the selection set defined on "${t}" could not be parsed.`}function Ise(e){return new Error(` Expected an object/interface or object/interface extension named "${e}" to exist.`)}function gse(e,t,n){return` The following field set is invalid: "${e}" - This is because "${t}" does not define an argument named "${n}".`}function use(e,t){return` The following field set is invalid: + This is because "${t}" does not define an argument named "${n}".`}function _se(e,t){return` The following field set is invalid: "${e}" This is because "${t}" defines arguments. - Fields that define arguments cannot be included in the field set of @key directives.`}function cse(e,t){return new Error(`The following "${e}" directive`+(t.length>1?"s are":" is")+` invalid: + Fields that define arguments cannot be included in the field set of @key directives.`}function vse(e,t){return new Error(`The following "${e}" directive`+(t.length>1?"s are":" is")+` invalid: `+t.join(` -`))}function lse(e,t){return` The following field set is invalid: +`))}function Sse(e,t){return` The following field set is invalid: "${e}" - This is because "${t}" was included in the field set more than once.`}function dse(e,t,n){return` Expected ConfigurationData to exist for type "${e}" when adding field "${t}" while validating field set "${n}".`}function fse({fieldCoords:e,responseType:t,subgraphName:n}){return` A "@provides" directive is declared on field "${e}" in subgraph "${n}". - However, the response type "${t}" is not an Object nor Interface.`}function YO(e,t,n=!1){return e.length<1?`enclosing type name "${t}". + This is because "${t}" was included in the field set more than once.`}function Ose(e,t,n){return` Expected ConfigurationData to exist for type "${e}" when adding field "${t}" while validating field set "${n}".`}function Dse({fieldCoords:e,responseType:t,subgraphName:n}){return` A "@provides" directive is declared on field "${e}" in subgraph "${n}". + However, the response type "${t}" is not an Object nor Interface.`}function lD(e,t,n=!1){return e.length<1?`enclosing type name "${t}". `:`field coordinates "${e[e.length-1]}"`+(n?` that returns "${t}"`:"")+`. -`}function vE(e,t,n){return e.length<1?`enclosing type name "${t}", which is type "${n}". +`}function kE(e,t,n){return e.length<1?`enclosing type name "${t}", which is type "${n}". `:`field coordinates "${e[e.length-1]}" that returns "${t}", which is type "${n}". -`}function pse(e,t,n,r){return` The following field set is invalid: +`}function bse(e,t,n,r){return` The following field set is invalid: "${e}" - This is because an inline fragment with the type condition "${n}" is defined on the selection set corresponding to the `+YO(t,r,!0)+` However, "${r}" is not an abstract (Interface or Union) type. - Consequently, the only valid type condition at this selection set would be "${r}".`}function mse(e,t){return` The following field set is invalid: + This is because an inline fragment with the type condition "${n}" is defined on the selection set corresponding to the `+lD(t,r,!0)+` However, "${r}" is not an abstract (Interface or Union) type. + Consequently, the only valid type condition at this selection set would be "${r}".`}function Ase(e,t){return` The following field set is invalid: "${e}" - This is because "${t}" defines an inline fragment without a type condition.`}function Nse(e,t,n,r){return` The following field set is invalid: + This is because "${t}" defines an inline fragment without a type condition.`}function Rse(e,t,n,r){return` The following field set is invalid: "${e}" - This is because an inline fragment with the unknown type condition "${r}" is defined on the selection set corresponding to the `+YO(t,n)}function Tse(e,t,n,r,i){return` The following field set is invalid: + This is because an inline fragment with the unknown type condition "${r}" is defined on the selection set corresponding to the `+lD(t,n)}function Pse(e,t,n,r,i){return` The following field set is invalid: "${e}" - This is because an inline fragment with the type condition "${r}" is defined on the selection set corresponding to the `+YO(t,n)+` However, "${r}" is type "${i}" when types "Interface" or "Object" would be expected.`}function Ese(e,t,n,r,i){let a=` The following field set is invalid: + This is because an inline fragment with the type condition "${r}" is defined on the selection set corresponding to the `+lD(t,n)+` However, "${r}" is type "${i}" when types "Interface" or "Object" would be expected.`}function Fse(e,t,n,r,i){let a=` The following field set is invalid: "${e}" - This is because an inline fragment with the type condition "${n}" is defined on the selection set corresponding to the `+vE(t,i,r);return r===Je.INTERFACE?a+` However, "${n}" does not implement "${i}"`:a+` However, "${n}" is not a member of "${i}".`}function hse(e,t,n){return` The following field set is invalid: + This is because an inline fragment with the type condition "${n}" is defined on the selection set corresponding to the `+kE(t,i,r);return r===He.INTERFACE?a+` However, "${n}" does not implement "${i}"`:a+` However, "${n}" is not a member of "${i}".`}function Lse(e,t,n){return` The following field set is invalid: "${e}" - This is because of the selection set corresponding to the `+vE(t,n,Je.UNION)+` Union types such as "${n}" must define field selections (besides "__typename") on an inline fragment whose type condition corresponds to a constituent union member.`}function yse(e,t){return` The field "${e}" declares an @override directive in the following subgraphs: "`+t.join(Je.QUOTATION_JOIN)+'".'}function Ise(e){return new Error('The "@override" directive must only be declared on one single instance of a field. However, an "@override" directive was declared on more than one instance of the following field'+(e.length>1?"s":"")+': "'+e.join(Je.QUOTATION_JOIN)+`". -`)}function gse(e,t){return new Error(`The ${e} "${t}" is invalid because it does not define any fields.`)}function _se(e){return new Error(`The Input Object "${e}" is invalid because it does not define any input values.`)}function vse(e,t,n){return new Error(`The ${e} "${t}" is invalid because all its ${n} definitions are declared "@inaccessible".`)}function Sse(e,t){return`Cannot override field "${t}" because the source and target subgraph names are both "${e}"`}function Ose(e,t){let n=`Federation was unsuccessful because any one subgraph that defines a specific entity Interface must also define each and every entity Object that implements that entity Interface. + This is because of the selection set corresponding to the `+kE(t,n,He.UNION)+` Union types such as "${n}" must define field selections (besides "__typename") on an inline fragment whose type condition corresponds to a constituent union member.`}function wse(e,t){return` The field "${e}" declares an @override directive in the following subgraphs: "`+t.join(He.QUOTATION_JOIN)+'".'}function Cse(e){return new Error('The "@override" directive must only be declared on one single instance of a field. However, an "@override" directive was declared on more than one instance of the following field'+(e.length>1?"s":"")+': "'+e.join(He.QUOTATION_JOIN)+`". +`)}function Use(e,t){return new Error(`The ${e} "${t}" is invalid because it does not define any fields.`)}function Bse(e){return new Error(`The Input Object "${e}" is invalid because it does not define any input values.`)}function kse(e,t,n){return new Error(`The ${e} "${t}" is invalid because all its ${n} definitions are declared "@inaccessible".`)}function Mse(e,t){return`Cannot override field "${t}" because the source and target subgraph names are both "${e}"`}function xse(e,t){let n=`Federation was unsuccessful because any one subgraph that defines a specific entity Interface must also define each and every entity Object that implements that entity Interface. Each entity Object must also explicitly define its implementation of the entity Interface. -`;for(let[r,i]of e){let o=(0,Mc.getOrThrowError)(t,r,"entityInterfaceFederationDataByTypeName").concreteTypeNames;n+=` Across all subgraphs, the entity interface "${r}" is implemented by the following entit`+(o.size>1?"ies":"y")+`: - "`+Array.from(o).join(Je.QUOTATION_JOIN)+`" +`;for(let[r,i]of e){let o=(0,Qc.getOrThrowError)(t,r,"entityInterfaceFederationDataByTypeName").concreteTypeNames;n+=` Across all subgraphs, the entity interface "${r}" is implemented by the following entit`+(o.size>1?"ies":"y")+`: + "`+Array.from(o).join(He.QUOTATION_JOIN)+`" However, the definition of at least one of these implementations is missing in a subgraph that defines the entity interface "${r}": -`;for(let{subgraphName:u,definedConcreteTypeNames:l}of i){let d=(0,Mc.getEntriesNotInHashSet)(o,l);n+=` Subgraph "${u}" does not define the following implementations: "`+d.join(Je.QUOTATION_JOIN)+`" -`}}return new Error(n)}function Dse(e,t){return new Error(`The maximum number of OR scopes that can be defined by @requiresScopes on a single field is ${e}. However, the following coordinates attempt to define more: - "`+t.join(Je.QUOTATION_JOIN)+`" -If you require more, please contact support.`)}function bse(e){return new Error(`An "Event Driven" graph\u2014a subgraph that defines event driven directives\u2014must not define any resolvers. +`;for(let{subgraphName:u,definedConcreteTypeNames:l}of i){let d=(0,Qc.getEntriesNotInHashSet)(o,l);n+=` Subgraph "${u}" does not define the following implementations: "`+d.join(He.QUOTATION_JOIN)+`" +`}}return new Error(n)}function qse(e,t){return new Error(`The maximum number of OR scopes that can be defined by @requiresScopes on a single field is ${e}. However, the following coordinates attempt to define more: + "`+t.join(He.QUOTATION_JOIN)+`" +If you require more, please contact support.`)}function Vse(e){return new Error(`An "Event Driven" graph\u2014a subgraph that defines event driven directives\u2014must not define any resolvers. Consequently, any "@key" definitions must also include the "resolvable: false" argument. Moreover, only fields that compose part of an entity's (composite) key and are declared "@external" are permitted. `+e.join(` -`))}function Ase(e){let t=` Root type fields defined in an Event Driven graph must define a valid events directive: +`))}function Kse(e){let t=` Root type fields defined in an Event Driven graph must define a valid events directive: Mutation type fields must define either a edfs publish or request directive." Query type fields must define "@edfs__natsRequest" Subscription type fields must define an edfs subscribe directive The following root field path`+(e.size>1?"s are":" is")+` invalid: `;for(let[n,r]of e)r.definesDirectives?t+=` The root field path "${n}" defines the following invalid events directive`+(r.invalidDirectiveNames.length>1?"s":"")+': "@'+r.invalidDirectiveNames.join('", "@')+`" `:t+=` The root field path "${n}" does not define any valid events directives. -`;return t}function Rse(e){let t=` Mutation type fields defined in an Event Driven graph must return the non-nullable type "edfs__PublishResult!", which has the following definition: +`;return t}function jse(e){let t=` Mutation type fields defined in an Event Driven graph must return the non-nullable type "edfs__PublishResult!", which has the following definition: type edfs__PublishResult { success: Boolean! } However, the following mutation field path`+(e.size>1?"s are":" is")+` invalid: `;for(let[n,r]of e)t+=` The mutation field path "${n}" returns "${r}". -`;return t}function Pse(e){let t=` The named response type of root type fields defined in an Event Driven graph must be a non-nullable, non-list named type that is either an entity, an interface implemented by an entity, or a union of which an entity is a member. +`;return t}function $se(e){let t=` The named response type of root type fields defined in an Event Driven graph must be a non-nullable, non-list named type that is either an entity, an interface implemented by an entity, or a union of which an entity is a member. Consequently, the following root field path`+(e.size>1?"s are":" is")+` invalid: `;for(let[n,r]of e)t+=` The root field path "${n}", which returns the invalid type "${r}" -`;return t}X.invalidNatsStreamInputErrorMessage=`The "streamConfiguration" argument must be a valid input object with the following form: +`;return t}J.invalidNatsStreamInputErrorMessage=`The "streamConfiguration" argument must be a valid input object with the following form: input edfs__NatsStreamConfiguration { consumerInactiveThreshold: Int! = 30 consumerName: String! streamName: String! - }`;function Fse(e,t,n,r){let i=X.invalidNatsStreamInputErrorMessage,a=[];return e.length>0&&a.push("The following required field"+(e.length>1?"s were":" was")+' not defined: "'+e.join(Je.QUOTATION_JOIN)+'".'),t.length>0&&a.push("The following required field"+(t.length>1?"s were":" was")+' defined more than once: "'+t.join(Je.QUOTATION_JOIN)+'".'),n.length>0&&a.push("The following required field"+(n.length>1?"s were":" was")+' not type "String!" with a minimum length of 1: "'+n.join(Je.QUOTATION_JOIN)+'".'),r.length>0&&a.push("The following field"+(r.length>1?"s are":" is")+' not part of a valid "edfs__NatsStreamConfiguration" input definition: "'+r.join(Je.QUOTATION_JOIN)+'".'),i+=` + }`;function Gse(e,t,n,r){let i=J.invalidNatsStreamInputErrorMessage,a=[];return e.length>0&&a.push("The following required field"+(e.length>1?"s were":" was")+' not defined: "'+e.join(He.QUOTATION_JOIN)+'".'),t.length>0&&a.push("The following required field"+(t.length>1?"s were":" was")+' defined more than once: "'+t.join(He.QUOTATION_JOIN)+'".'),n.length>0&&a.push("The following required field"+(n.length>1?"s were":" was")+' not type "String!" with a minimum length of 1: "'+n.join(He.QUOTATION_JOIN)+'".'),r.length>0&&a.push("The following field"+(r.length>1?"s are":" is")+' not part of a valid "edfs__NatsStreamConfiguration" input definition: "'+r.join(He.QUOTATION_JOIN)+'".'),i+=` However, the provided input was invalid for the following reason`+(a.length>1?"s":"")+`: `+a.join(` - `),i}function wse(e=new Map){let t="";for(let[n,r]of e)t+=' The following "@key" field set'+(r.length>1?"s are":" is")+` defined on the entity "${n}" without a "resolvable: false" argument: - "`+r.join(Je.QUOTATION_JOIN)+`" -`;return t}function Lse(e){let t=" The following field"+(e.size>1?"s are referenced":" is referenced")+` within an entity "@key" field without an "@external" declaration: + `),i}function Qse(e=new Map){let t="";for(let[n,r]of e)t+=' The following "@key" field set'+(r.length>1?"s are":" is")+` defined on the entity "${n}" without a "resolvable: false" argument: + "`+r.join(He.QUOTATION_JOIN)+`" +`;return t}function Yse(e){let t=" The following field"+(e.size>1?"s are referenced":" is referenced")+` within an entity "@key" field without an "@external" declaration: `;for(let[n,r]of e)t+=` field "${r}" defined on path "${n}" -`;return t}function Cse(e){let t=" The following field"+(e.size>1?"s are":" is")+` defined despite not composing part of a "@key" directive field set: +`;return t}function Jse(e){let t=" The following field"+(e.size>1?"s are":" is")+` defined despite not composing part of a "@key" directive field set: `;for(let[n,r]of e)t+=` Field "${r}" defined on path "${n}" -`;return t}function Use(e){return`Only root types and entities (objects that define one or more primary keys with the "@key" directive) may be defined as object extensions in an Event Driven graph. +`;return t}function Hse(e){return`Only root types and entities (objects that define one or more primary keys with the "@key" directive) may be defined as object extensions in an Event Driven graph. Consequently, the following object extension definition`+(e.length>1?"s are":" is")+` invalid: - "`+e.join(Je.QUOTATION_JOIN)+`" -`}function Bse(e){return` Only object definitions whose fields compose part of a "@key" directive's field set may be defined in an Event Driven graph. Consequently, the following object type definition`+(e.length>1?"s are":" is")+` invalid: - "`+e.join(Je.QUOTATION_JOIN)+`" -`}X.invalidEdfsPublishResultObjectErrorMessage=` The object "edfs__PublishResult" that was defined in the Event Driven graph is invalid and must instead have the following definition: + "`+e.join(He.QUOTATION_JOIN)+`" +`}function zse(e){return` Only object definitions whose fields compose part of a "@key" directive's field set may be defined in an Event Driven graph. Consequently, the following object type definition`+(e.length>1?"s are":" is")+` invalid: + "`+e.join(He.QUOTATION_JOIN)+`" +`}J.invalidEdfsPublishResultObjectErrorMessage=` The object "edfs__PublishResult" that was defined in the Event Driven graph is invalid and must instead have the following definition: type edfs__PublishResult { success: Boolean! - }`;X.invalidNatsStreamConfigurationDefinitionErrorMessage=` The input object "edfs__NatsStreamConfiguration" that was defined in the Event Driven graph is invalid and must instead have the following definition: + }`;J.invalidNatsStreamConfigurationDefinitionErrorMessage=` The input object "edfs__NatsStreamConfiguration" that was defined in the Event Driven graph is invalid and must instead have the following definition: input edfs__NatsStreamConfiguration { consumerInactiveThreshold: Int! = 30 consumerName: String! streamName: String! - }`;function kse(e){return new Error(`Could not retrieve definition for Event-Driven Federated Subscription directive "${e}".`)}function Mse(e,t){let n=` Only interfaces can be implemented. However, the type "${e}" attempts to implement the following invalid type`+(t.size>1?"s":"")+`: + }`;function Wse(e){return new Error(`Could not retrieve definition for Event-Driven Federated Subscription directive "${e}".`)}function Xse(e,t){let n=` Only interfaces can be implemented. However, the type "${e}" attempts to implement the following invalid type`+(t.size>1?"s":"")+`: `;for(let[r,i]of t)n+=` "${r}", which is type "${i}" -`;return new Error(n)}function xse(e){return new Error(` The interface "${e}" must not implement itself.`)}function qse(e){return`The "${e}" argument must be string with a minimum length of one.`}function Vse(e){return`The "${e}" argument must be a list of strings.`}function jse(e){return`Each item in the "${e}" argument list must be a string with a minimum length of one. However, at least one value provided in the list was invalid.`}function Kse(e){return`An argument template references the invalid argument "${e}".`}function $se(e){return`An argument template references the undefined argument "${e}".`}X.invalidEventProviderIdErrorMessage='If explicitly defined, the "providerId" argument must be a string with a minimum length of one.';function Gse(e,t,n){return new Error(`The event directive "${e}" declared on "${t}" is invalid for the following reason`+(n.length>1?"s":"")+`: +`;return new Error(n)}function Zse(e){return new Error(` The interface "${e}" must not implement itself.`)}function eoe(e){return`The "${e}" argument must be string with a minimum length of one.`}function toe(e){return`The "${e}" argument must be a list of strings.`}function noe(e){return`Each item in the "${e}" argument list must be a string with a minimum length of one. However, at least one value provided in the list was invalid.`}function roe(e){return`An argument template references the invalid argument "${e}".`}function ioe(e){return`An argument template references the undefined argument "${e}".`}J.invalidEventProviderIdErrorMessage='If explicitly defined, the "providerId" argument must be a string with a minimum length of one.';function aoe(e,t,n){return new Error(`The event directive "${e}" declared on "${t}" is invalid for the following reason`+(n.length>1?"s":"")+`: `+n.join(` - `))}function Qse(e,t,n){return new Error(`The ${e} "${t}" is declared "@inaccessible"; however, the ${e} is still referenced at the following paths: - "`+n.join(Je.QUOTATION_JOIN)+`" -`)}function Yse(e,t){return new Error(`The ${e.kind===tx.Kind.ARGUMENT?"argument":"Input field"} "${e.name}" defined at coordinates "${e.federatedCoords}" is declared "@inaccessible"; however, it is a required ${e.kind===tx.Kind.ARGUMENT?"argument of field":"field of Input Object"} "${t}".`)}function Jse(e,t){return new Error(` The union "${e}" defines the following member`+(t.length>1?"s that are not object types":" that is not an object type")+`: + `))}function soe(e,t,n){return new Error(`The ${e} "${t}" is declared "@inaccessible"; however, the ${e} is still referenced at the following paths: + "`+n.join(He.QUOTATION_JOIN)+`" +`)}function ooe(e,t){return new Error(`The ${e.kind===Nx.Kind.ARGUMENT?"argument":"Input field"} "${e.name}" defined at coordinates "${e.federatedCoords}" is declared "@inaccessible"; however, it is a required ${e.kind===Nx.Kind.ARGUMENT?"argument of field":"field of Input Object"} "${t}".`)}function uoe(e,t){return new Error(` The union "${e}" defines the following member`+(t.length>1?"s that are not object types":" that is not an object type")+`: `+t.join(` - `))}function zse(e){return new Error(`Expected type "${e}" to be a root type but could not find its respective OperationTypeNode.`)}function Hse(e){return new Error(`The "@${Je.SUBSCRIPTION_FILTER}" directive must only be defined on a subscription root field, but it was defined on the path "${e}".`)}function Wse(e,t){return new Error(`The "@${Je.SUBSCRIPTION_FILTER}" directive defined on path "${e}" is invalid for the following reason`+(t.length>1?"s":"")+`: + `))}function coe(e){return new Error(`Expected type "${e}" to be a root type but could not find its respective OperationTypeNode.`)}function loe(e){return new Error(`The "@${He.SUBSCRIPTION_FILTER}" directive must only be defined on a subscription root field, but it was defined on the path "${e}".`)}function doe(e,t){return new Error(`The "@${He.SUBSCRIPTION_FILTER}" directive defined on path "${e}" is invalid for the following reason`+(t.length>1?"s":"")+`: `+t.join(` -`))}function Xse(e){return` Unknown type "${e}".`}function Zse(e){return` The input path "${e}" exceeds the maximum depth of ${nx.MAX_SUBSCRIPTION_FILTER_DEPTH} for any one filter condition. - If you require a larger maximum depth, please contact support.`}var rx=` Each "${Je.SUBSCRIPTION_FILTER_CONDITION}" input object must define exactly one of the following input value fields: "${Je.AND_UPPER}", "${Je.IN_UPPER}", "${Je.NOT_UPPER}", or "${Je.OR_UPPER}". -`;function eoe(e,t){return rx+` However, input path "${e}" defines ${t} fields.`}function toe(e,t){return rx+` However, input path "${e}" defines the invalid input value field "${t}".`}function noe(e,t,n){return` Expected the value of input path "${e}" to be type "${t}" but received type "${n}"`}var ix=` An AND or OR input field defined on a "${Je.SUBSCRIPTION_FILTER_CONDITION}" should define a list of 1\u20135 nested conditions. -`;function roe(e,t){let n=t.length>1;return ix+" However, the following "+(n?"indices":"index")+` defined on input path "${e}" `+(n?"are":"is")+' not type "object": '+t.join(", ")}function ioe(e,t){return ix+` However, the list defined on input path "${e}" has a length of ${t}.`}function aoe(e,t,n){return` Expected the input path "${e}" to be type "${t}" but received "${n}".`}function soe(e,t,n,r,i){let a=` Each "${Je.SUBSCRIPTION_FIELD_CONDITION}" input object must only define the following two input value fields: "${Je.FIELD_PATH}" and "${Je.VALUES}". +`))}function poe(e){return` Unknown type "${e}".`}function foe(e){return` The input path "${e}" exceeds the maximum depth of ${Tx.MAX_SUBSCRIPTION_FILTER_DEPTH} for any one filter condition. + If you require a larger maximum depth, please contact support.`}var Ex=` Each "${He.SUBSCRIPTION_FILTER_CONDITION}" input object must define exactly one of the following input value fields: "${He.AND_UPPER}", "${He.IN_UPPER}", "${He.NOT_UPPER}", or "${He.OR_UPPER}". +`;function moe(e,t){return Ex+` However, input path "${e}" defines ${t} fields.`}function Noe(e,t){return Ex+` However, input path "${e}" defines the invalid input value field "${t}".`}function Toe(e,t,n){return` Expected the value of input path "${e}" to be type "${t}" but received type "${n}"`}var hx=` An AND or OR input field defined on a "${He.SUBSCRIPTION_FILTER_CONDITION}" should define a list of 1\u20135 nested conditions. +`;function Eoe(e,t){let n=t.length>1;return hx+" However, the following "+(n?"indices":"index")+` defined on input path "${e}" `+(n?"are":"is")+' not type "object": '+t.join(", ")}function hoe(e,t){return hx+` However, the list defined on input path "${e}" has a length of ${t}.`}function yoe(e,t,n){return` Expected the input path "${e}" to be type "${t}" but received "${n}".`}function Ioe(e,t,n,r,i){let a=` Each "${He.SUBSCRIPTION_FIELD_CONDITION}" input object must only define the following two input value fields: "${He.FIELD_PATH}" and "${He.VALUES}". However, input path "${e}" is invalid because:`;return t.length>0&&(a+=` The following required field`+(t.length>1?"s are":" is")+` not defined: - "`+t.join(Je.QUOTATION_JOIN)+'"'),n.length>0&&(a+=` + "`+t.join(He.QUOTATION_JOIN)+'"'),n.length>0&&(a+=` The following required field`+(n.length>1?"s are":" is")+` defined more than once: - "`+n.join(Je.QUOTATION_JOIN)+'"'),r.length>0&&(a+=` + "`+n.join(He.QUOTATION_JOIN)+'"'),r.length>0&&(a+=` The following invalid field`+(r.length>1?"s are":" is")+` defined: - "`+r.join(Je.QUOTATION_JOIN)+'"'),i.length>0&&(a+=` + "`+r.join(He.QUOTATION_JOIN)+'"'),i.length>0&&(a+=` `+i.join(` - `)),a}var ax=` A "${Je.SUBSCRIPTION_FIELD_CONDITION}" input object must define a "values" input value field with a list of at least one valid "${Je.SUBSCRIPTION_FILTER_VALUE}" kind (boolean, enum, float, int, null, or string). -`;function ooe(e,t){let n=t.length>1;return ax+" However, the following "+(n?"indices":"index")+` defined on input path "${e}" `+(n?"are":"is")+` not a valid "${Je.SUBSCRIPTION_FILTER_VALUE}": `+t.join(", ")}function uoe(e){return ax+` However, the list defined on input path "${e}" is empty.`}function coe(e){return new Error(` Field "${e}" defined no subgraph names.`)}function loe(e,t){return` Input path "${e}" defines the value "${t}", which is not a period (.) delimited field path.`}function doe(e,t,n){return` Input path "${e}" defines the value "${t}". - However, "${n}" is not type "object"`}function foe(e,t,n,r,i){return` Input path "${e}" defines the value "${t}". - However, the path "${n}" is invalid because no field named "${r}" exists on type "${i}".`}function poe(e,t,n,r,i){return`Input path "${e}" defines the value "${t}". - However, only fields that are defined in the same graph as the "@${Je.SUBSCRIPTION_FILTER}" directive can compose part of an "IN" condition's "fieldPath" input value field. - Consequently, the path "${n}" is invalid because field "${r}" is not defined in subgraph "${i}".`}function moe(e,t,n,r){return` Input path "${e}" defines the value "${t}". - The path segment "${n}" is invalid because it refers to "${r}", which is declared "@inaccessible".`}function Noe(e,t,n,r,i){return` Input path "${e}" defines the value "${t}". - However, the final field "${n}" is ${r} "${i}", which is not a leaf type; therefore, it requires further selections.`}function Toe({fieldName:e,selectionSet:t},n){let r=`The field "${e}" is unresolvable at the following path: + `)),a}var yx=` A "${He.SUBSCRIPTION_FIELD_CONDITION}" input object must define a "values" input value field with a list of at least one valid "${He.SUBSCRIPTION_FILTER_VALUE}" kind (boolean, enum, float, int, null, or string). +`;function goe(e,t){let n=t.length>1;return yx+" However, the following "+(n?"indices":"index")+` defined on input path "${e}" `+(n?"are":"is")+` not a valid "${He.SUBSCRIPTION_FILTER_VALUE}": `+t.join(", ")}function _oe(e){return yx+` However, the list defined on input path "${e}" is empty.`}function voe(e){return new Error(` Field "${e}" defined no subgraph names.`)}function Soe(e,t){return` Input path "${e}" defines the value "${t}", which is not a period (.) delimited field path.`}function Ooe(e,t,n){return` Input path "${e}" defines the value "${t}". + However, "${n}" is not type "object"`}function Doe(e,t,n,r,i){return` Input path "${e}" defines the value "${t}". + However, the path "${n}" is invalid because no field named "${r}" exists on type "${i}".`}function boe(e,t,n,r,i){return`Input path "${e}" defines the value "${t}". + However, only fields that are defined in the same graph as the "@${He.SUBSCRIPTION_FILTER}" directive can compose part of an "IN" condition's "fieldPath" input value field. + Consequently, the path "${n}" is invalid because field "${r}" is not defined in subgraph "${i}".`}function Aoe(e,t,n,r){return` Input path "${e}" defines the value "${t}". + The path segment "${n}" is invalid because it refers to "${r}", which is declared "@inaccessible".`}function Roe(e,t,n,r,i){return` Input path "${e}" defines the value "${t}". + However, the final field "${n}" is ${r} "${i}", which is not a leaf type; therefore, it requires further selections.`}function Poe({fieldName:e,selectionSet:t},n){let r=`The field "${e}" is unresolvable at the following path: ${t} This is because: - `+n.join(` - - `);return new Error(r)}function Eoe(e,t){let n=`The Object "${e}" is invalid because the following field definition`+(t.size>1?"s are":" is")+` declared "@external" on all instances of that field: -`;for(let[r,i]of t)n+=` "${r}" in subgraph`+(i.length>1?"s":"")+' "'+i.join(Je.QUOTATION_JOIN)+`" -`;return n+='At least one instance of a field definition must always be resolvable (and therefore not declared "@external").',new Error(n)}function hoe(e,t){return new Error(`The interface "${e}" is invalid because the following field definition`+(t.length>1?"s are":" is")+` declared "@external": - "`+t.join(Je.QUOTATION_JOIN)+`" -Interface fields should not be declared "@external". This is because interface fields do not resolve directly, but the "@external" directive relates to whether a field instance can be resolved by the subgraph in which it is defined.`)}function yoe({directiveCoords:e,fieldSet:t,directiveName:n,subgraphName:r,targetCoords:i}){let a=i.split(Je.LITERAL_PERIOD),o=a[a.length-1]===Je.TYPENAME;return new Error(`The field "${e}" in subgraph "${r}" defines a "@${n}" directive with the following field set: + - `);return new Error(r)}function Foe(e,t){let n=`The Object "${e}" is invalid because the following field definition`+(t.size>1?"s are":" is")+` declared "@external" on all instances of that field: +`;for(let[r,i]of t)n+=` "${r}" in subgraph`+(i.length>1?"s":"")+' "'+i.join(He.QUOTATION_JOIN)+`" +`;return n+='At least one instance of a field definition must always be resolvable (and therefore not declared "@external").',new Error(n)}function Loe(e,t){return new Error(`The interface "${e}" is invalid because the following field definition`+(t.length>1?"s are":" is")+` declared "@external": + "`+t.join(He.QUOTATION_JOIN)+`" +Interface fields should not be declared "@external". This is because interface fields do not resolve directly, but the "@external" directive relates to whether a field instance can be resolved by the subgraph in which it is defined.`)}function woe({directiveCoords:e,fieldSet:t,directiveName:n,subgraphName:r,targetCoords:i}){let a=i.split(He.LITERAL_PERIOD),o=a[a.length-1]===He.TYPENAME;return new Error(`The field "${e}" in subgraph "${r}" defines a "@${n}" directive with the following field set: "${t}".`+(o?` However, none of the field set ancestors of "__typename" is declared "@external".`:` However, neither the field "${i}" nor any of its field set ancestors are declared "@external".`)+` -Consequently, "${i}" is already provided by subgraph "${r}" and should not form part of a "@${n}" directive field set.`)}function Ioe(e,t){let n=[];for(let[r,i]of t){let a=[...i];n.push(` The named type "${r}" is returned by the following subgraph`+(a.length>1?"s":"")+': "'+a.join(Je.QUOTATION_JOIN)+'".')}return new Error(`Each instance of a shared field must resolve identically across subgraphs. +Consequently, "${i}" is already provided by subgraph "${r}" and should not form part of a "@${n}" directive field set.`)}function Coe(e,t){let n=[];for(let[r,i]of t){let a=[...i];n.push(` The named type "${r}" is returned by the following subgraph`+(a.length>1?"s":"")+': "'+a.join(He.QUOTATION_JOIN)+'".')}return new Error(`Each instance of a shared field must resolve identically across subgraphs. The field "${e}" could not be federated due to incompatible types across subgraphs. The discrepancies are as follows: `+n.join(` -`))}function sx(e,t){return`The field "${e}" returns the unknown named type "${t}".`}function goe(e,t){return new Error(sx(e,t))}function _oe(e){return new Error(`Could not find FieldData for field "${e}" -.This should never happen. Please report this issue on GitHub.`)}function voe(e,t){return new Error(`Expected named type "${e}" to be a composite output type (Object or Interface) but received "${t}". -This should never happen. Please report this issue on GitHub.`)}function Soe(e){return new Error(`The Object field "${e}" is invalidly declared "@external". An Object field should only be declared "@external" if it is part of a "@key", "@provides", or "@requires" field set, or the field is necessary to satisfy an Interface implementation. In the case that none of these conditions is true, the "@external" directive should be removed.`)}function Ooe(e,t){return new Error(`The "@openfed__configureDescription" directive defined on ${e} "${t}" is invalid because neither a description nor the "descriptionOverride" argument is defined.`)}function Doe(e,t){return new Error(`The coordinates "${e}" declare "@openfed__configureDescription(propagate: true)" in the following subgraphs: - "`+t.join(Je.QUOTATION_JOIN)+`" -A federated graph only supports a single description; consequently, only one subgraph may define argument "propagate" as true (this is the default value).`)}function boe(e){return"- The following argument"+(e.length>1?"s are":" is")+` defined more than once: - "`+e.join(Je.QUOTATION_JOIN)+'"'}function Aoe(e){return`- The location "${e}" is defined multiple times.`}function Roe(e){return`- "${e}" is not a valid directive location.`}function Poe(e,t){return new Error(`The directive definition for "@${e}" is invalid for the following reason`+(t.length>1?"s":"")+`: -`+t.join(Je.LITERAL_NEW_LINE)+'"')}function Foe(e,t){return` The field "${e}" is unconditionally provided by subgraph "${t}" and should not form part of any "@provides" field set.`}function woe(e,t,n){return` The field "${e}" is unconditionally provided by subgraph "${t}" and should not form part of any "@${n}" field set. Although "${e}" is declared "@external", it is part of a "@key" directive on an extension type. Such fields are only declared "@external" for legacy syntactical reasons and are not internally considered "@external".`}function Loe(e,t,n){return new Error(`The subgraph that defines an entity Interface Object (using "@interfaceObject") must not define any implementation types of that interface. However, the subgraph "${t}" defines the entity Interface "${e}" as an Interface Object alongside the following implementation type`+(n.length>1?"s":"")+` of "${e}": - "`+n.join(Je.QUOTATION_JOIN)+'"')}function Coe({data:e,namedTypeData:t,nodeType:n}){let r=(0,nae.isFieldData)(e),i=r?`${e.originalParentTypeName}.${e.name}`:e.originalCoords;return new Error(`The ${n} "${i}" is invalid because it defines type `+(0,rae.printTypeNode)(e.type)+`; however, ${(0,Mc.kindToNodeType)(t.kind)} "${t.name}" is not a valid `+(r?"output":"input")+" type.")}function Uoe(e){return`Index "${e}" is not a valid integer.`}function Boe({maxIndex:e,typeString:t,value:n}){return`Index "${n}" is out of bounds for type ${t}; `+(e>0?`valid indices are 0-${e} inclusive.`:"the only valid index is 0.")}function koe({typeString:e,value:t}){return`Index "${t}" of type ${e} is non-null but must be nullable.`}X.semanticNonNullArgumentErrorMessage=`Argument "${Je.LEVELS}" validation error.`;function Moe(e){let t=`${e.renamedParentTypeName}.${e.name}`,n=`The "@semanticNonNull" directive defined on field "${t}" is invalid due to inconsistent values provided to the "levels" argument across the following subgraphs: +`))}function Ix(e,t){return`The field "${e}" returns the unknown named type "${t}".`}function Uoe(e,t){return new Error(Ix(e,t))}function Boe(e){return new Error(`Could not find FieldData for field "${e}" +.This should never happen. Please report this issue on GitHub.`)}function koe(e,t){return new Error(`Expected named type "${e}" to be a composite output type (Object or Interface) but received "${t}". +This should never happen. Please report this issue on GitHub.`)}function Moe(e){return new Error(`The Object field "${e}" is invalidly declared "@external". An Object field should only be declared "@external" if it is part of a "@key", "@provides", or "@requires" field set, or the field is necessary to satisfy an Interface implementation. In the case that none of these conditions is true, the "@external" directive should be removed.`)}function xoe(e,t){return new Error(`The "@openfed__configureDescription" directive defined on ${e} "${t}" is invalid because neither a description nor the "descriptionOverride" argument is defined.`)}function qoe(e,t){return new Error(`The coordinates "${e}" declare "@openfed__configureDescription(propagate: true)" in the following subgraphs: + "`+t.join(He.QUOTATION_JOIN)+`" +A federated graph only supports a single description; consequently, only one subgraph may define argument "propagate" as true (this is the default value).`)}function Voe(e){return"- The following argument"+(e.length>1?"s are":" is")+` defined more than once: + "`+e.join(He.QUOTATION_JOIN)+'"'}function Koe(e){return`- The location "${e}" is defined multiple times.`}function joe(e){return`- "${e}" is not a valid directive location.`}function $oe(e,t){return new Error(`The directive definition for "@${e}" is invalid for the following reason`+(t.length>1?"s":"")+`: +`+t.join(He.LITERAL_NEW_LINE)+'"')}function Goe(e,t){return` The field "${e}" is unconditionally provided by subgraph "${t}" and should not form part of any "@provides" field set.`}function Qoe(e,t,n){return` The field "${e}" is unconditionally provided by subgraph "${t}" and should not form part of any "@${n}" field set. Although "${e}" is declared "@external", it is part of a "@key" directive on an extension type. Such fields are only declared "@external" for legacy syntactical reasons and are not internally considered "@external".`}function Yoe(e,t,n){return new Error(`The subgraph that defines an entity Interface Object (using "@interfaceObject") must not define any implementation types of that interface. However, the subgraph "${t}" defines the entity Interface "${e}" as an Interface Object alongside the following implementation type`+(n.length>1?"s":"")+` of "${e}": + "`+n.join(He.QUOTATION_JOIN)+'"')}function Joe({data:e,namedTypeData:t,nodeType:n}){let r=(0,Tae.isFieldData)(e),i=r?`${e.originalParentTypeName}.${e.name}`:e.originalCoords;return new Error(`The ${n} "${i}" is invalid because it defines type `+(0,Eae.printTypeNode)(e.type)+`; however, ${(0,Qc.kindToNodeType)(t.kind)} "${t.name}" is not a valid `+(r?"output":"input")+" type.")}function Hoe(e){return`Index "${e}" is not a valid integer.`}function zoe({maxIndex:e,typeString:t,value:n}){return`Index "${n}" is out of bounds for type ${t}; `+(e>0?`valid indices are 0-${e} inclusive.`:"the only valid index is 0.")}function Woe({typeString:e,value:t}){return`Index "${t}" of type ${e} is non-null but must be nullable.`}J.semanticNonNullArgumentErrorMessage=`Argument "${He.LEVELS}" validation error.`;function Xoe(e){let t=`${e.renamedParentTypeName}.${e.name}`,n=`The "@semanticNonNull" directive defined on field "${t}" is invalid due to inconsistent values provided to the "levels" argument across the following subgraphs: `;for(let[r,i]of e.nullLevelsBySubgraphName)n+=` Subgraph "${r}" defines levels ${Array.from(i).sort((a,o)=>a-o)}. -`;return n+=`The list value provided to the "levels" argument must be consistently defined across all subgraphs that define "@semanticNonNull" on field "${t}".`,new Error(n)}function xoe({requiredFieldNames:e,typeName:t}){return new Error(`The "@oneOf" directive defined on Input Object "${t}" is invalid because all Input fields must be optional (nullable); however, the following Input field`+(e.length>1?"s are":" is")+' required (non-nullable): "'+e.join(Je.QUOTATION_JOIN)+'".')}function qoe(e,t){return` The "slicingArguments" value "${t}" on "${e}" does not reference a defined argument on this field.`}function Voe(e,t,n){return` The "slicingArguments" value "${t}" on "${e}" references an argument of type "${n}", but slicing arguments must be of type "Int" or "Int!".`}function joe(e,t,n){return` The "sizedFields" value "${t}" on "${e}" does not reference a defined field on the return type "${n}".`}function Koe(e,t,n,r){return` The "sizedFields" value "${t}" on "${e}" references field "${n}.${t}", which returns type "${r}". Sized fields must return a list type.`}function $oe(e,t){return` The "@listSize" directive on "${e}" is invalid because the field returns type "${t}", which is not a list type, and no "sizedFields" argument is provided.`}function Goe(e,t){return` The "sizedFields" argument on "${e}" is invalid because the return type "${t}" is not an object or interface type.`}function Qoe(e,t){return` The "sizedFields" argument on "${e}" is invalid because the return type "${t}" must not be a list.`}function Yoe(e){return` The "@listSize" directive on "${e}" defines both "assumedSize" and "slicingArguments". When both are used, "requireOneSlicingArgument" must be set to false.`}function Joe(e,t){return` The "@listSize" directive on "${e}" defines both "assumedSize" and "slicingArguments", but slicing argument "${t}" has a default value. When "assumedSize" is used as a fallback for missing slicing arguments, none of the slicing arguments may have default values.`}function zoe(e){return` The "@cost" directive at "${e}" is not permitted on fields or arguments of an Interface type. The cost of an interface field is derived from the costs of the corresponding fields on the concrete types that implement the interface.`}});var ux=F(ox=>{"use strict";m();T();N();Object.defineProperty(ox,"__esModule",{value:!0})});var OE=F(SE=>{"use strict";m();T();N();Object.defineProperty(SE,"__esModule",{value:!0});SE.DEFAULT_CONSUMER_INACTIVE_THRESHOLD=void 0;SE.DEFAULT_CONSUMER_INACTIVE_THRESHOLD=30});var DE=F(hr=>{"use strict";m();T();N();Object.defineProperty(hr,"__esModule",{value:!0});hr.SUBSCRIPTION_FILTER_VALUE_DEFINITION=hr.SUBSCRIPTION_FILTER_CONDITION_DEFINITION=hr.SUBSCRIPTION_FIELD_CONDITION_DEFINITION=hr.SCOPE_SCALAR_DEFINITION=hr.LINK_PURPOSE_DEFINITION=hr.LINK_IMPORT_DEFINITION=hr.FIELD_SET_SCALAR_DEFINITION=hr.EDFS_NATS_STREAM_CONFIGURATION_DEFINITION=void 0;var an=Se(),dn=Cr(),fn=Hn(),Hoe=OE();hr.EDFS_NATS_STREAM_CONFIGURATION_DEFINITION={kind:an.Kind.INPUT_OBJECT_TYPE_DEFINITION,name:(0,dn.stringToNameNode)(fn.EDFS_NATS_STREAM_CONFIGURATION),fields:[{kind:an.Kind.INPUT_VALUE_DEFINITION,name:(0,dn.stringToNameNode)(fn.CONSUMER_INACTIVE_THRESHOLD),type:{kind:an.Kind.NON_NULL_TYPE,type:(0,dn.stringToNamedTypeNode)(fn.INT_SCALAR)},defaultValue:{kind:an.Kind.INT,value:Hoe.DEFAULT_CONSUMER_INACTIVE_THRESHOLD.toString()}},{kind:an.Kind.INPUT_VALUE_DEFINITION,name:(0,dn.stringToNameNode)(fn.CONSUMER_NAME),type:{kind:an.Kind.NON_NULL_TYPE,type:(0,dn.stringToNamedTypeNode)(fn.STRING_SCALAR)}},{kind:an.Kind.INPUT_VALUE_DEFINITION,name:(0,dn.stringToNameNode)(fn.STREAM_NAME),type:{kind:an.Kind.NON_NULL_TYPE,type:(0,dn.stringToNamedTypeNode)(fn.STRING_SCALAR)}}]};hr.FIELD_SET_SCALAR_DEFINITION={kind:an.Kind.SCALAR_TYPE_DEFINITION,name:(0,dn.stringToNameNode)(fn.FIELD_SET_SCALAR)};hr.LINK_IMPORT_DEFINITION={kind:an.Kind.SCALAR_TYPE_DEFINITION,name:(0,dn.stringToNameNode)(fn.LINK_IMPORT)};hr.LINK_PURPOSE_DEFINITION={kind:an.Kind.ENUM_TYPE_DEFINITION,name:(0,dn.stringToNameNode)(fn.LINK_PURPOSE),values:[{directives:[],kind:an.Kind.ENUM_VALUE_DEFINITION,name:(0,dn.stringToNameNode)(fn.EXECUTION)},{directives:[],kind:an.Kind.ENUM_VALUE_DEFINITION,name:(0,dn.stringToNameNode)(fn.SECURITY)}]};hr.SCOPE_SCALAR_DEFINITION={kind:an.Kind.SCALAR_TYPE_DEFINITION,name:(0,dn.stringToNameNode)(fn.SCOPE_SCALAR)};hr.SUBSCRIPTION_FIELD_CONDITION_DEFINITION={fields:[{kind:an.Kind.INPUT_VALUE_DEFINITION,name:(0,dn.stringToNameNode)(fn.FIELD_PATH),type:{kind:an.Kind.NON_NULL_TYPE,type:(0,dn.stringToNamedTypeNode)(fn.STRING_SCALAR)}},{kind:an.Kind.INPUT_VALUE_DEFINITION,name:(0,dn.stringToNameNode)(fn.VALUES),type:{kind:an.Kind.NON_NULL_TYPE,type:{kind:an.Kind.LIST_TYPE,type:(0,dn.stringToNamedTypeNode)(fn.SUBSCRIPTION_FILTER_VALUE)}}}],kind:an.Kind.INPUT_OBJECT_TYPE_DEFINITION,name:(0,dn.stringToNameNode)(fn.SUBSCRIPTION_FIELD_CONDITION)};hr.SUBSCRIPTION_FILTER_CONDITION_DEFINITION={fields:[{kind:an.Kind.INPUT_VALUE_DEFINITION,name:(0,dn.stringToNameNode)(fn.AND_UPPER),type:{kind:an.Kind.LIST_TYPE,type:{kind:an.Kind.NON_NULL_TYPE,type:(0,dn.stringToNamedTypeNode)(fn.SUBSCRIPTION_FILTER_CONDITION)}}},{kind:an.Kind.INPUT_VALUE_DEFINITION,name:(0,dn.stringToNameNode)(fn.IN_UPPER),type:(0,dn.stringToNamedTypeNode)(fn.SUBSCRIPTION_FIELD_CONDITION)},{kind:an.Kind.INPUT_VALUE_DEFINITION,name:(0,dn.stringToNameNode)(fn.OR_UPPER),type:{kind:an.Kind.LIST_TYPE,type:{kind:an.Kind.NON_NULL_TYPE,type:(0,dn.stringToNamedTypeNode)(fn.SUBSCRIPTION_FILTER_CONDITION)}}},{kind:an.Kind.INPUT_VALUE_DEFINITION,name:(0,dn.stringToNameNode)(fn.NOT_UPPER),type:(0,dn.stringToNamedTypeNode)(fn.SUBSCRIPTION_FILTER_CONDITION)}],kind:an.Kind.INPUT_OBJECT_TYPE_DEFINITION,name:(0,dn.stringToNameNode)(fn.SUBSCRIPTION_FILTER_CONDITION)};hr.SUBSCRIPTION_FILTER_VALUE_DEFINITION={kind:an.Kind.SCALAR_TYPE_DEFINITION,name:(0,dn.stringToNameNode)(fn.SUBSCRIPTION_FILTER_VALUE)}});var pd=F(tr=>{"use strict";m();T();N();Object.defineProperty(tr,"__esModule",{value:!0});tr.CLIENT_PERSISTED_DIRECTIVE_NAMES=tr.IGNORED_FEDERATED_TYPE_NAMES=tr.DEPENDENCIES_BY_DIRECTIVE_NAME=tr.COMPOSITE_OUTPUT_NODE_KINDS=tr.SUBSCRIPTION_FILTER_LIST_INPUT_NAMES=tr.SUBSCRIPTION_FILTER_INPUT_NAMES=tr.STREAM_CONFIGURATION_FIELD_NAMES=tr.EVENT_DIRECTIVE_NAMES=tr.TYPE_SYSTEM_DIRECTIVE_LOCATIONS=void 0;var rt=Hn(),bE=Se(),Sa=DE();tr.TYPE_SYSTEM_DIRECTIVE_LOCATIONS=new Set([rt.ARGUMENT_DEFINITION_UPPER,rt.ENUM_UPPER,rt.ENUM_VALUE_UPPER,rt.FIELD_DEFINITION_UPPER,rt.INPUT_FIELD_DEFINITION_UPPER,rt.INPUT_OBJECT_UPPER,rt.INTERFACE_UPPER,rt.OBJECT_UPPER,rt.SCALAR_UPPER,rt.SCHEMA_UPPER,rt.UNION_UPPER]);tr.EVENT_DIRECTIVE_NAMES=new Set([rt.EDFS_KAFKA_PUBLISH,rt.EDFS_KAFKA_SUBSCRIBE,rt.EDFS_NATS_PUBLISH,rt.EDFS_NATS_REQUEST,rt.EDFS_NATS_SUBSCRIBE,rt.EDFS_REDIS_PUBLISH,rt.EDFS_REDIS_SUBSCRIBE]);tr.STREAM_CONFIGURATION_FIELD_NAMES=new Set([rt.CONSUMER_INACTIVE_THRESHOLD,rt.CONSUMER_NAME,rt.STREAM_NAME]);tr.SUBSCRIPTION_FILTER_INPUT_NAMES=new Set([rt.AND_UPPER,rt.IN_UPPER,rt.NOT_UPPER,rt.OR_UPPER]);tr.SUBSCRIPTION_FILTER_LIST_INPUT_NAMES=new Set([rt.AND_UPPER,rt.OR_UPPER]);tr.COMPOSITE_OUTPUT_NODE_KINDS=new Set([bE.Kind.INTERFACE_TYPE_DEFINITION,bE.Kind.INTERFACE_TYPE_EXTENSION,bE.Kind.OBJECT_TYPE_DEFINITION,bE.Kind.OBJECT_TYPE_EXTENSION]);tr.DEPENDENCIES_BY_DIRECTIVE_NAME=new Map([[rt.CONNECT_FIELD_RESOLVER,[Sa.FIELD_SET_SCALAR_DEFINITION]],[rt.EDFS_NATS_SUBSCRIBE,[Sa.EDFS_NATS_STREAM_CONFIGURATION_DEFINITION]],[rt.KEY,[Sa.FIELD_SET_SCALAR_DEFINITION]],[rt.LINK,[Sa.LINK_IMPORT_DEFINITION,Sa.LINK_PURPOSE_DEFINITION]],[rt.PROVIDES,[Sa.FIELD_SET_SCALAR_DEFINITION]],[rt.REQUIRES,[Sa.FIELD_SET_SCALAR_DEFINITION]],[rt.REQUIRES_SCOPES,[Sa.SCOPE_SCALAR_DEFINITION]],[rt.SUBSCRIPTION_FILTER,[Sa.SUBSCRIPTION_FIELD_CONDITION_DEFINITION,Sa.SUBSCRIPTION_FILTER_CONDITION_DEFINITION,Sa.SUBSCRIPTION_FILTER_VALUE_DEFINITION]]]);tr.IGNORED_FEDERATED_TYPE_NAMES=new Set([rt.BOOLEAN_SCALAR,rt.EDFS_NATS_STREAM_CONFIGURATION,rt.FIELD_SET_SCALAR,rt.ID_SCALAR,rt.INT_SCALAR,rt.FLOAT_SCALAR,rt.LINK_IMPORT,rt.LINK_PURPOSE,rt.STRING_SCALAR,rt.SUBSCRIPTION_FIELD_CONDITION,rt.SUBSCRIPTION_FILTER_CONDITION,rt.SUBSCRIPTION_FILTER_VALUE]);tr.CLIENT_PERSISTED_DIRECTIVE_NAMES=new Set([rt.DEPRECATED,rt.ONE_OF,rt.SEMANTIC_NON_NULL])});var ra=F((JO,cx)=>{"use strict";m();T();N();var Ep=function(e){return e&&e.Math===Math&&e};cx.exports=Ep(typeof globalThis=="object"&&globalThis)||Ep(typeof window=="object"&&window)||Ep(typeof self=="object"&&self)||Ep(typeof global=="object"&&global)||Ep(typeof JO=="object"&&JO)||function(){return this}()||Function("return this")()});var Ms=F((iFe,lx)=>{"use strict";m();T();N();lx.exports=function(e){try{return!!e()}catch(t){return!0}}});var Uu=F((uFe,dx)=>{"use strict";m();T();N();var Woe=Ms();dx.exports=!Woe(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var zO=F((fFe,fx)=>{"use strict";m();T();N();var Xoe=Ms();fx.exports=!Xoe(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")})});var xc=F((TFe,px)=>{"use strict";m();T();N();var Zoe=zO(),AE=Function.prototype.call;px.exports=Zoe?AE.bind(AE):function(){return AE.apply(AE,arguments)}});var Ex=F(Tx=>{"use strict";m();T();N();var mx={}.propertyIsEnumerable,Nx=Object.getOwnPropertyDescriptor,eue=Nx&&!mx.call({1:2},1);Tx.f=eue?function(t){var n=Nx(this,t);return!!n&&n.enumerable}:mx});var HO=F((SFe,hx)=>{"use strict";m();T();N();hx.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}});var vi=F((AFe,gx)=>{"use strict";m();T();N();var yx=zO(),Ix=Function.prototype,WO=Ix.call,tue=yx&&Ix.bind.bind(WO,WO);gx.exports=yx?tue:function(e){return function(){return WO.apply(e,arguments)}}});var Sx=F((wFe,vx)=>{"use strict";m();T();N();var _x=vi(),nue=_x({}.toString),rue=_x("".slice);vx.exports=function(e){return rue(nue(e),8,-1)}});var Dx=F((BFe,Ox)=>{"use strict";m();T();N();var iue=vi(),aue=Ms(),sue=Sx(),XO=Object,oue=iue("".split);Ox.exports=aue(function(){return!XO("z").propertyIsEnumerable(0)})?function(e){return sue(e)==="String"?oue(e,""):XO(e)}:XO});var ZO=F((qFe,bx)=>{"use strict";m();T();N();bx.exports=function(e){return e==null}});var eD=F(($Fe,Ax)=>{"use strict";m();T();N();var uue=ZO(),cue=TypeError;Ax.exports=function(e){if(uue(e))throw new cue("Can't call method on "+e);return e}});var RE=F((JFe,Rx)=>{"use strict";m();T();N();var lue=Dx(),due=eD();Rx.exports=function(e){return lue(due(e))}});var Oa=F((XFe,Px)=>{"use strict";m();T();N();var tD=typeof document=="object"&&document.all;Px.exports=typeof tD=="undefined"&&tD!==void 0?function(e){return typeof e=="function"||e===tD}:function(e){return typeof e=="function"}});var md=F((nwe,Fx)=>{"use strict";m();T();N();var fue=Oa();Fx.exports=function(e){return typeof e=="object"?e!==null:fue(e)}});var PE=F((swe,wx)=>{"use strict";m();T();N();var nD=ra(),pue=Oa(),mue=function(e){return pue(e)?e:void 0};wx.exports=function(e,t){return arguments.length<2?mue(nD[e]):nD[e]&&nD[e][t]}});var Cx=F((lwe,Lx)=>{"use strict";m();T();N();var Nue=vi();Lx.exports=Nue({}.isPrototypeOf)});var Mx=F((mwe,kx)=>{"use strict";m();T();N();var Tue=ra(),Ux=Tue.navigator,Bx=Ux&&Ux.userAgent;kx.exports=Bx?String(Bx):""});var Gx=F((hwe,$x)=>{"use strict";m();T();N();var Kx=ra(),rD=Mx(),xx=Kx.process,qx=Kx.Deno,Vx=xx&&xx.versions||qx&&qx.version,jx=Vx&&Vx.v8,Da,FE;jx&&(Da=jx.split("."),FE=Da[0]>0&&Da[0]<4?1:+(Da[0]+Da[1]));!FE&&rD&&(Da=rD.match(/Edge\/(\d+)/),(!Da||Da[1]>=74)&&(Da=rD.match(/Chrome\/(\d+)/),Da&&(FE=+Da[1])));$x.exports=FE});var iD=F((_we,Yx)=>{"use strict";m();T();N();var Qx=Gx(),Eue=Ms(),hue=ra(),yue=hue.String;Yx.exports=!!Object.getOwnPropertySymbols&&!Eue(function(){var e=Symbol("symbol detection");return!yue(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Qx&&Qx<41})});var aD=F((Dwe,Jx)=>{"use strict";m();T();N();var Iue=iD();Jx.exports=Iue&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var sD=F((Pwe,zx)=>{"use strict";m();T();N();var gue=PE(),_ue=Oa(),vue=Cx(),Sue=aD(),Oue=Object;zx.exports=Sue?function(e){return typeof e=="symbol"}:function(e){var t=gue("Symbol");return _ue(t)&&vue(t.prototype,Oue(e))}});var Wx=F((Cwe,Hx)=>{"use strict";m();T();N();var Due=String;Hx.exports=function(e){try{return Due(e)}catch(t){return"Object"}}});var wE=F((Mwe,Xx)=>{"use strict";m();T();N();var bue=Oa(),Aue=Wx(),Rue=TypeError;Xx.exports=function(e){if(bue(e))return e;throw new Rue(Aue(e)+" is not a function")}});var oD=F((jwe,Zx)=>{"use strict";m();T();N();var Pue=wE(),Fue=ZO();Zx.exports=function(e,t){var n=e[t];return Fue(n)?void 0:Pue(n)}});var tq=F((Qwe,eq)=>{"use strict";m();T();N();var uD=xc(),cD=Oa(),lD=md(),wue=TypeError;eq.exports=function(e,t){var n,r;if(t==="string"&&cD(n=e.toString)&&!lD(r=uD(n,e))||cD(n=e.valueOf)&&!lD(r=uD(n,e))||t!=="string"&&cD(n=e.toString)&&!lD(r=uD(n,e)))return r;throw new wue("Can't convert object to primitive value")}});var rq=F((Hwe,nq)=>{"use strict";m();T();N();nq.exports=!1});var LE=F((eLe,aq)=>{"use strict";m();T();N();var iq=ra(),Lue=Object.defineProperty;aq.exports=function(e,t){try{Lue(iq,e,{value:t,configurable:!0,writable:!0})}catch(n){iq[e]=t}return t}});var CE=F((iLe,uq)=>{"use strict";m();T();N();var Cue=rq(),Uue=ra(),Bue=LE(),sq="__core-js_shared__",oq=uq.exports=Uue[sq]||Bue(sq,{});(oq.versions||(oq.versions=[])).push({version:"3.41.0",mode:Cue?"pure":"global",copyright:"\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var dD=F((uLe,lq)=>{"use strict";m();T();N();var cq=CE();lq.exports=function(e,t){return cq[e]||(cq[e]=t||{})}});var fq=F((fLe,dq)=>{"use strict";m();T();N();var kue=eD(),Mue=Object;dq.exports=function(e){return Mue(kue(e))}});var Bu=F((TLe,pq)=>{"use strict";m();T();N();var xue=vi(),que=fq(),Vue=xue({}.hasOwnProperty);pq.exports=Object.hasOwn||function(t,n){return Vue(que(t),n)}});var fD=F((ILe,mq)=>{"use strict";m();T();N();var jue=vi(),Kue=0,$ue=Math.random(),Gue=jue(1 .toString);mq.exports=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Gue(++Kue+$ue,36)}});var Eq=F((SLe,Tq)=>{"use strict";m();T();N();var Que=ra(),Yue=dD(),Nq=Bu(),Jue=fD(),zue=iD(),Hue=aD(),Nd=Que.Symbol,pD=Yue("wks"),Wue=Hue?Nd.for||Nd:Nd&&Nd.withoutSetter||Jue;Tq.exports=function(e){return Nq(pD,e)||(pD[e]=zue&&Nq(Nd,e)?Nd[e]:Wue("Symbol."+e)),pD[e]}});var gq=F((ALe,Iq)=>{"use strict";m();T();N();var Xue=xc(),hq=md(),yq=sD(),Zue=oD(),ece=tq(),tce=Eq(),nce=TypeError,rce=tce("toPrimitive");Iq.exports=function(e,t){if(!hq(e)||yq(e))return e;var n=Zue(e,rce),r;if(n){if(t===void 0&&(t="default"),r=Xue(n,e,t),!hq(r)||yq(r))return r;throw new nce("Can't convert object to primitive value")}return t===void 0&&(t="number"),ece(e,t)}});var mD=F((wLe,_q)=>{"use strict";m();T();N();var ice=gq(),ace=sD();_q.exports=function(e){var t=ice(e,"string");return ace(t)?t:t+""}});var Oq=F((BLe,Sq)=>{"use strict";m();T();N();var sce=ra(),vq=md(),ND=sce.document,oce=vq(ND)&&vq(ND.createElement);Sq.exports=function(e){return oce?ND.createElement(e):{}}});var TD=F((qLe,Dq)=>{"use strict";m();T();N();var uce=Uu(),cce=Ms(),lce=Oq();Dq.exports=!uce&&!cce(function(){return Object.defineProperty(lce("div"),"a",{get:function(){return 7}}).a!==7})});var ED=F(Aq=>{"use strict";m();T();N();var dce=Uu(),fce=xc(),pce=Ex(),mce=HO(),Nce=RE(),Tce=mD(),Ece=Bu(),hce=TD(),bq=Object.getOwnPropertyDescriptor;Aq.f=dce?bq:function(t,n){if(t=Nce(t),n=Tce(n),hce)try{return bq(t,n)}catch(r){}if(Ece(t,n))return mce(!fce(pce.f,t,n),t[n])}});var Pq=F((JLe,Rq)=>{"use strict";m();T();N();var yce=Uu(),Ice=Ms();Rq.exports=yce&&Ice(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var hp=F((XLe,Fq)=>{"use strict";m();T();N();var gce=md(),_ce=String,vce=TypeError;Fq.exports=function(e){if(gce(e))return e;throw new vce(_ce(e)+" is not an object")}});var BE=F(Lq=>{"use strict";m();T();N();var Sce=Uu(),Oce=TD(),Dce=Pq(),UE=hp(),wq=mD(),bce=TypeError,hD=Object.defineProperty,Ace=Object.getOwnPropertyDescriptor,yD="enumerable",ID="configurable",gD="writable";Lq.f=Sce?Dce?function(t,n,r){if(UE(t),n=wq(n),UE(r),typeof t=="function"&&n==="prototype"&&"value"in r&&gD in r&&!r[gD]){var i=Ace(t,n);i&&i[gD]&&(t[n]=r.value,r={configurable:ID in r?r[ID]:i[ID],enumerable:yD in r?r[yD]:i[yD],writable:!1})}return hD(t,n,r)}:hD:function(t,n,r){if(UE(t),n=wq(n),UE(r),Oce)try{return hD(t,n,r)}catch(i){}if("get"in r||"set"in r)throw new bce("Accessors not supported");return"value"in r&&(t[n]=r.value),t}});var _D=F((sCe,Cq)=>{"use strict";m();T();N();var Rce=Uu(),Pce=BE(),Fce=HO();Cq.exports=Rce?function(e,t,n){return Pce.f(e,t,Fce(1,n))}:function(e,t,n){return e[t]=n,e}});var kq=F((lCe,Bq)=>{"use strict";m();T();N();var vD=Uu(),wce=Bu(),Uq=Function.prototype,Lce=vD&&Object.getOwnPropertyDescriptor,SD=wce(Uq,"name"),Cce=SD&&function(){}.name==="something",Uce=SD&&(!vD||vD&&Lce(Uq,"name").configurable);Bq.exports={EXISTS:SD,PROPER:Cce,CONFIGURABLE:Uce}});var xq=F((mCe,Mq)=>{"use strict";m();T();N();var Bce=vi(),kce=Oa(),OD=CE(),Mce=Bce(Function.toString);kce(OD.inspectSource)||(OD.inspectSource=function(e){return Mce(e)});Mq.exports=OD.inspectSource});var jq=F((hCe,Vq)=>{"use strict";m();T();N();var xce=ra(),qce=Oa(),qq=xce.WeakMap;Vq.exports=qce(qq)&&/native code/.test(String(qq))});var Gq=F((_Ce,$q)=>{"use strict";m();T();N();var Vce=dD(),jce=fD(),Kq=Vce("keys");$q.exports=function(e){return Kq[e]||(Kq[e]=jce(e))}});var DD=F((DCe,Qq)=>{"use strict";m();T();N();Qq.exports={}});var Hq=F((PCe,zq)=>{"use strict";m();T();N();var Kce=jq(),Jq=ra(),$ce=md(),Gce=_D(),bD=Bu(),AD=CE(),Qce=Gq(),Yce=DD(),Yq="Object already initialized",RD=Jq.TypeError,Jce=Jq.WeakMap,kE,yp,ME,zce=function(e){return ME(e)?yp(e):kE(e,{})},Hce=function(e){return function(t){var n;if(!$ce(t)||(n=yp(t)).type!==e)throw new RD("Incompatible receiver, "+e+" required");return n}};Kce||AD.state?(ba=AD.state||(AD.state=new Jce),ba.get=ba.get,ba.has=ba.has,ba.set=ba.set,kE=function(e,t){if(ba.has(e))throw new RD(Yq);return t.facade=e,ba.set(e,t),t},yp=function(e){return ba.get(e)||{}},ME=function(e){return ba.has(e)}):(qc=Qce("state"),Yce[qc]=!0,kE=function(e,t){if(bD(e,qc))throw new RD(Yq);return t.facade=e,Gce(e,qc,t),t},yp=function(e){return bD(e,qc)?e[qc]:{}},ME=function(e){return bD(e,qc)});var ba,qc;zq.exports={set:kE,get:yp,has:ME,enforce:zce,getterFor:Hce}});var e1=F((CCe,Zq)=>{"use strict";m();T();N();var FD=vi(),Wce=Ms(),Xce=Oa(),xE=Bu(),PD=Uu(),Zce=kq().CONFIGURABLE,ele=xq(),Xq=Hq(),tle=Xq.enforce,nle=Xq.get,Wq=String,qE=Object.defineProperty,rle=FD("".slice),ile=FD("".replace),ale=FD([].join),sle=PD&&!Wce(function(){return qE(function(){},"length",{value:8}).length!==8}),ole=String(String).split("String"),ule=Zq.exports=function(e,t,n){rle(Wq(t),0,7)==="Symbol("&&(t="["+ile(Wq(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!xE(e,"name")||Zce&&e.name!==t)&&(PD?qE(e,"name",{value:t,configurable:!0}):e.name=t),sle&&n&&xE(n,"arity")&&e.length!==n.arity&&qE(e,"length",{value:n.arity});try{n&&xE(n,"constructor")&&n.constructor?PD&&qE(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(i){}var r=tle(e);return xE(r,"source")||(r.source=ale(ole,typeof t=="string"?t:"")),e};Function.prototype.toString=ule(function(){return Xce(this)&&nle(this).source||ele(this)},"toString")});var n1=F((MCe,t1)=>{"use strict";m();T();N();var cle=Oa(),lle=BE(),dle=e1(),fle=LE();t1.exports=function(e,t,n,r){r||(r={});var i=r.enumerable,a=r.name!==void 0?r.name:t;if(cle(n)&&dle(n,a,r),r.global)i?e[t]=n:fle(t,n);else{try{r.unsafe?e[t]&&(i=!0):delete e[t]}catch(o){}i?e[t]=n:lle.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e}});var i1=F((jCe,r1)=>{"use strict";m();T();N();var ple=Math.ceil,mle=Math.floor;r1.exports=Math.trunc||function(t){var n=+t;return(n>0?mle:ple)(n)}});var VE=F((QCe,a1)=>{"use strict";m();T();N();var Nle=i1();a1.exports=function(e){var t=+e;return t!==t||t===0?0:Nle(t)}});var o1=F((HCe,s1)=>{"use strict";m();T();N();var Tle=VE(),Ele=Math.max,hle=Math.min;s1.exports=function(e,t){var n=Tle(e);return n<0?Ele(n+t,0):hle(n,t)}});var c1=F((eUe,u1)=>{"use strict";m();T();N();var yle=VE(),Ile=Math.min;u1.exports=function(e){var t=yle(e);return t>0?Ile(t,9007199254740991):0}});var d1=F((iUe,l1)=>{"use strict";m();T();N();var gle=c1();l1.exports=function(e){return gle(e.length)}});var m1=F((uUe,p1)=>{"use strict";m();T();N();var _le=RE(),vle=o1(),Sle=d1(),f1=function(e){return function(t,n,r){var i=_le(t),a=Sle(i);if(a===0)return!e&&-1;var o=vle(r,a),u;if(e&&n!==n){for(;a>o;)if(u=i[o++],u!==u)return!0}else for(;a>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}};p1.exports={includes:f1(!0),indexOf:f1(!1)}});var E1=F((fUe,T1)=>{"use strict";m();T();N();var Ole=vi(),wD=Bu(),Dle=RE(),ble=m1().indexOf,Ale=DD(),N1=Ole([].push);T1.exports=function(e,t){var n=Dle(e),r=0,i=[],a;for(a in n)!wD(Ale,a)&&wD(n,a)&&N1(i,a);for(;t.length>r;)wD(n,a=t[r++])&&(~ble(i,a)||N1(i,a));return i}});var y1=F((TUe,h1)=>{"use strict";m();T();N();h1.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var g1=F(I1=>{"use strict";m();T();N();var Rle=E1(),Ple=y1(),Fle=Ple.concat("length","prototype");I1.f=Object.getOwnPropertyNames||function(t){return Rle(t,Fle)}});var v1=F(_1=>{"use strict";m();T();N();_1.f=Object.getOwnPropertySymbols});var O1=F((AUe,S1)=>{"use strict";m();T();N();var wle=PE(),Lle=vi(),Cle=g1(),Ule=v1(),Ble=hp(),kle=Lle([].concat);S1.exports=wle("Reflect","ownKeys")||function(t){var n=Cle.f(Ble(t)),r=Ule.f;return r?kle(n,r(t)):n}});var A1=F((wUe,b1)=>{"use strict";m();T();N();var D1=Bu(),Mle=O1(),xle=ED(),qle=BE();b1.exports=function(e,t,n){for(var r=Mle(t),i=qle.f,a=xle.f,o=0;o{"use strict";m();T();N();var Vle=Ms(),jle=Oa(),Kle=/#|\.prototype\./,Ip=function(e,t){var n=Gle[$le(e)];return n===Yle?!0:n===Qle?!1:jle(t)?Vle(t):!!t},$le=Ip.normalize=function(e){return String(e).replace(Kle,".").toLowerCase()},Gle=Ip.data={},Qle=Ip.NATIVE="N",Yle=Ip.POLYFILL="P";R1.exports=Ip});var LD=F((qUe,F1)=>{"use strict";m();T();N();var jE=ra(),Jle=ED().f,zle=_D(),Hle=n1(),Wle=LE(),Xle=A1(),Zle=P1();F1.exports=function(e,t){var n=e.target,r=e.global,i=e.stat,a,o,u,l,d,p;if(r?o=jE:i?o=jE[n]||Wle(n,{}):o=jE[n]&&jE[n].prototype,o)for(u in t){if(d=t[u],e.dontCallGetSet?(p=Jle(o,u),l=p&&p.value):l=o[u],a=Zle(r?u:n+(i?".":"#")+u,e.forced),!a&&l!==void 0){if(typeof d==typeof l)continue;Xle(d,l)}(e.sham||l&&l.sham)&&zle(d,"sham",!0),Hle(o,u,d,e)}}});var gp=F(($Ue,w1)=>{"use strict";m();T();N();var CD=vi(),KE=Set.prototype;w1.exports={Set,add:CD(KE.add),has:CD(KE.has),remove:CD(KE.delete),proto:KE}});var UD=F((JUe,L1)=>{"use strict";m();T();N();var ede=gp().has;L1.exports=function(e){return ede(e),e}});var U1=F((XUe,C1)=>{"use strict";m();T();N();var tde=vi(),nde=wE();C1.exports=function(e,t,n){try{return tde(nde(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(r){}}});var BD=F((nBe,B1)=>{"use strict";m();T();N();var rde=U1(),ide=gp();B1.exports=rde(ide.proto,"size","get")||function(e){return e.size}});var kD=F((sBe,k1)=>{"use strict";m();T();N();var ade=xc();k1.exports=function(e,t,n){for(var r=n?e:e.iterator,i=e.next,a,o;!(a=ade(i,r)).done;)if(o=t(a.value),o!==void 0)return o}});var K1=F((lBe,j1)=>{"use strict";m();T();N();var M1=vi(),sde=kD(),x1=gp(),ode=x1.Set,q1=x1.proto,ude=M1(q1.forEach),V1=M1(q1.keys),cde=V1(new ode).next;j1.exports=function(e,t,n){return n?sde({iterator:V1(e),next:cde},t):ude(e,t)}});var G1=F((mBe,$1)=>{"use strict";m();T();N();$1.exports=function(e){return{iterator:e,next:e.next,done:!1}}});var MD=F((hBe,W1)=>{"use strict";m();T();N();var Q1=wE(),z1=hp(),Y1=xc(),lde=VE(),dde=G1(),J1="Invalid size",fde=RangeError,pde=TypeError,mde=Math.max,H1=function(e,t){this.set=e,this.size=mde(t,0),this.has=Q1(e.has),this.keys=Q1(e.keys)};H1.prototype={getIterator:function(){return dde(z1(Y1(this.keys,this.set)))},includes:function(e){return Y1(this.has,this.set,e)}};W1.exports=function(e){z1(e);var t=+e.size;if(t!==t)throw new pde(J1);var n=lde(t);if(n<0)throw new fde(J1);return new H1(e,n)}});var Z1=F((_Be,X1)=>{"use strict";m();T();N();var Nde=UD(),Tde=BD(),Ede=K1(),hde=MD();X1.exports=function(t){var n=Nde(this),r=hde(t);return Tde(n)>r.size?!1:Ede(n,function(i){if(!r.includes(i))return!1},!0)!==!1}});var xD=F((DBe,nV)=>{"use strict";m();T();N();var yde=PE(),eV=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},tV=function(e){return{size:e,has:function(){return!0},keys:function(){throw new Error("e")}}};nV.exports=function(e,t){var n=yde("Set");try{new n()[e](eV(0));try{return new n()[e](eV(-1)),!1}catch(i){if(!t)return!0;try{return new n()[e](tV(-1/0)),!1}catch(a){var r=new n;return r.add(1),r.add(2),t(r[e](tV(1/0)))}}}catch(i){return!1}}});var rV=F(()=>{"use strict";m();T();N();var Ide=LD(),gde=Z1(),_de=xD(),vde=!_de("isSubsetOf",function(e){return e});Ide({target:"Set",proto:!0,real:!0,forced:vde},{isSubsetOf:gde})});var iV=F(()=>{"use strict";m();T();N();rV()});var oV=F((qBe,sV)=>{"use strict";m();T();N();var Sde=xc(),aV=hp(),Ode=oD();sV.exports=function(e,t,n){var r,i;aV(e);try{if(r=Ode(e,"return"),!r){if(t==="throw")throw n;return n}r=Sde(r,e)}catch(a){i=!0,r=a}if(t==="throw")throw n;if(i)throw r;return aV(r),n}});var cV=F(($Be,uV)=>{"use strict";m();T();N();var Dde=UD(),bde=gp().has,Ade=BD(),Rde=MD(),Pde=kD(),Fde=oV();uV.exports=function(t){var n=Dde(this),r=Rde(t);if(Ade(n){"use strict";m();T();N();var wde=LD(),Lde=cV(),Cde=xD(),Ude=!Cde("isSupersetOf",function(e){return!e});wde({target:"Set",proto:!0,real:!0,forced:Ude},{isSupersetOf:Lde})});var dV=F(()=>{"use strict";m();T();N();lV()});var _p=F(Fn=>{"use strict";m();T();N();Object.defineProperty(Fn,"__esModule",{value:!0});Fn.subtractSet=kde;Fn.mapToArrayOfValues=Mde;Fn.kindToConvertedTypeString=xde;Fn.fieldDatasToSimpleFieldDatas=qde;Fn.isNodeLeaf=Vde;Fn.newEntityInterfaceFederationData=jde;Fn.upsertEntityInterfaceFederationData=Kde;Fn.upsertEntityData=Gde;Fn.updateEntityData=fV;Fn.newFieldAuthorizationData=Qde;Fn.newAuthorizationData=Yde;Fn.addScopes=qD;Fn.mergeRequiredScopesByAND=QE;Fn.mergeRequiredScopesByOR=VD;Fn.upsertFieldAuthorizationData=pV;Fn.upsertAuthorizationData=Hde;Fn.upsertAuthorizationConfiguration=Wde;Fn.isObjectNodeKind=Xde;Fn.isCompositeOutputNodeKind=Zde;Fn.isObjectDefinitionData=efe;Fn.getNodeCoords=tfe;var Yt=Se(),ci=Hn(),$E=Ur(),GE=Ru();iV();dV();var Bde=pd();function kde(e,t){for(let n of e)t.delete(n)}function Mde(e){let t=[];for(let n of e.values())t.push(n);return t}function xde(e){switch(e){case Yt.Kind.BOOLEAN:return ci.BOOLEAN_SCALAR;case Yt.Kind.ENUM:case Yt.Kind.ENUM_TYPE_DEFINITION:case Yt.Kind.ENUM_TYPE_EXTENSION:return ci.ENUM;case Yt.Kind.ENUM_VALUE_DEFINITION:return ci.ENUM_VALUE;case Yt.Kind.FIELD_DEFINITION:return ci.FIELD;case Yt.Kind.FLOAT:return ci.FLOAT_SCALAR;case Yt.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Yt.Kind.INPUT_OBJECT_TYPE_EXTENSION:return ci.INPUT_OBJECT;case Yt.Kind.INPUT_VALUE_DEFINITION:return ci.INPUT_VALUE;case Yt.Kind.INT:return ci.INT_SCALAR;case Yt.Kind.INTERFACE_TYPE_DEFINITION:case Yt.Kind.INTERFACE_TYPE_EXTENSION:return ci.INTERFACE;case Yt.Kind.NULL:return ci.NULL;case Yt.Kind.OBJECT:case Yt.Kind.OBJECT_TYPE_DEFINITION:case Yt.Kind.OBJECT_TYPE_EXTENSION:return ci.OBJECT;case Yt.Kind.STRING:return ci.STRING_SCALAR;case Yt.Kind.SCALAR_TYPE_DEFINITION:case Yt.Kind.SCALAR_TYPE_EXTENSION:return ci.SCALAR;case Yt.Kind.UNION_TYPE_DEFINITION:case Yt.Kind.UNION_TYPE_EXTENSION:return ci.UNION;default:return e}}function qde(e){let t=[];for(let{name:n,namedTypeName:r}of e)t.push({name:n,namedTypeName:r});return t}function Vde(e){if(!e)return!0;switch(e){case Yt.Kind.OBJECT_TYPE_DEFINITION:case Yt.Kind.INTERFACE_TYPE_DEFINITION:case Yt.Kind.UNION_TYPE_DEFINITION:return!1;default:return!0}}function jde(e,t){return{concreteTypeNames:new Set(e.concreteTypeNames),fieldDatasBySubgraphName:new Map([[t,e.fieldDatas]]),interfaceFieldNames:new Set(e.interfaceFieldNames),interfaceObjectFieldNames:new Set(e.interfaceObjectFieldNames),interfaceObjectSubgraphNames:new Set(e.isInterfaceObject?[t]:[]),subgraphDataByTypeName:new Map([[t,e]]),typeName:e.typeName}}function Kde(e,t,n){(0,$E.addIterableToSet)({source:t.concreteTypeNames,target:e.concreteTypeNames}),e.subgraphDataByTypeName.set(n,t),e.fieldDatasBySubgraphName.set(n,t.fieldDatas),(0,$E.addIterableToSet)({source:t.interfaceFieldNames,target:e.interfaceFieldNames}),(0,$E.addIterableToSet)({source:t.interfaceObjectFieldNames,target:e.interfaceObjectFieldNames}),t.isInterfaceObject&&e.interfaceObjectSubgraphNames.add(n)}function $de({keyFieldSetDataByFieldSet:e,subgraphName:t,typeName:n}){let r=new Map([[t,e]]),i=new Map;for(let[a,{documentNode:o,isUnresolvable:u}]of e)u||i.set(a,o);return{keyFieldSetDatasBySubgraphName:r,documentNodeByKeyFieldSet:i,keyFieldSets:new Set,subgraphNames:new Set([t]),typeName:n}}function Gde({entityDataByTypeName:e,keyFieldSetDataByFieldSet:t,subgraphName:n,typeName:r}){let i=e.get(r);i?fV({entityData:i,keyFieldSetDataByFieldSet:t,subgraphName:n}):e.set(r,$de({keyFieldSetDataByFieldSet:t,subgraphName:n,typeName:r}))}function fV({entityData:e,keyFieldSetDataByFieldSet:t,subgraphName:n}){e.subgraphNames.add(n);let r=e.keyFieldSetDatasBySubgraphName.get(n);if(!r){e.keyFieldSetDatasBySubgraphName.set(n,t);for(let[i,{documentNode:a,isUnresolvable:o}]of t)o||e.documentNodeByKeyFieldSet.set(i,a);return}for(let[i,a]of t){a.isUnresolvable||e.documentNodeByKeyFieldSet.set(i,a.documentNode);let o=r.get(i);if(o){o.isUnresolvable||(o.isUnresolvable=a.isUnresolvable);continue}r.set(i,a)}}function Qde(e){return{fieldName:e,inheritedData:{requiredScopes:[],requiredScopesByOR:[],requiresAuthentication:!1},originalData:{requiredScopes:[],requiresAuthentication:!1}}}function Yde(e){return{fieldAuthDataByFieldName:new Map,requiredScopes:[],requiredScopesByOR:[],requiresAuthentication:!1,typeName:e}}function qD(e,t){for(let n=e.length-1;n>-1;n--){if(e[n].isSubsetOf(t))return;e[n].isSupersetOf(t)&&e.splice(n,1)}e.push(t)}function QE(e,t){if(e.length<1||t.length<1){for(let r of t)e.push(new Set(r));return e}let n=[];for(let r of t)for(let i of e){let a=(0,$E.addSets)(r,i);qD(n,a)}return n}function VD(e,t){for(let n of t)qD(e,n);return e.length<=GE.MAX_OR_SCOPES}function pV(e,t){var i,a;let n=t.fieldName,r=e.get(n);return r?((i=r.inheritedData).requiresAuthentication||(i.requiresAuthentication=t.inheritedData.requiresAuthentication),(a=r.originalData).requiresAuthentication||(a.requiresAuthentication=t.originalData.requiresAuthentication),!VD(r.inheritedData.requiredScopesByOR,t.inheritedData.requiredScopes)||r.inheritedData.requiredScopes.length*t.inheritedData.requiredScopes.length>GE.MAX_OR_SCOPES||r.originalData.requiredScopes.length*t.originalData.requiredScopes.length>GE.MAX_OR_SCOPES?!1:(r.inheritedData.requiredScopes=QE(r.inheritedData.requiredScopes,t.inheritedData.requiredScopes),r.originalData.requiredScopes=QE(r.originalData.requiredScopes,t.originalData.requiredScopes),!0)):(e.set(n,mV(t)),!0)}function Jde(e){let t=new Map;for(let[n,r]of e)t.set(n,mV(r));return t}function mV(e){return{fieldName:e.fieldName,inheritedData:{requiredScopes:[...e.inheritedData.requiredScopes],requiredScopesByOR:[...e.inheritedData.requiredScopes],requiresAuthentication:e.inheritedData.requiresAuthentication},originalData:{requiredScopes:[...e.originalData.requiredScopes],requiresAuthentication:e.originalData.requiresAuthentication}}}function zde(e){return{fieldAuthDataByFieldName:Jde(e.fieldAuthDataByFieldName),requiredScopes:[...e.requiredScopes],requiredScopesByOR:[...e.requiredScopes],requiresAuthentication:e.requiresAuthentication,typeName:e.typeName}}function Hde(e,t,n){let r=e.get(t.typeName);if(!r){e.set(t.typeName,zde(t));return}r.requiresAuthentication||(r.requiresAuthentication=t.requiresAuthentication),!VD(r.requiredScopesByOR,t.requiredScopes)||r.requiredScopes.length*t.requiredScopes.length>GE.MAX_OR_SCOPES?n.add(t.typeName):r.requiredScopes=QE(r.requiredScopes,t.requiredScopes);for(let[i,a]of t.fieldAuthDataByFieldName)pV(r.fieldAuthDataByFieldName,a)||n.add(`${t.typeName}.${i}`)}function Wde(e,t){let n=t.typeName;for(let[r,i]of t.fieldAuthDataByFieldName){let a=`${n}.${r}`,o=e.get(a);o?(o.requiresAuthentication=i.inheritedData.requiresAuthentication,o.requiredScopes=i.inheritedData.requiredScopes.map(u=>[...u]),o.requiredScopesByOR=i.inheritedData.requiredScopesByOR.map(u=>[...u])):e.set(a,{argumentNames:[],typeName:n,fieldName:r,requiresAuthentication:i.inheritedData.requiresAuthentication,requiredScopes:i.inheritedData.requiredScopes.map(u=>[...u]),requiredScopesByOR:i.inheritedData.requiredScopesByOR.map(u=>[...u])})}}function Xde(e){return e===Yt.Kind.OBJECT_TYPE_DEFINITION||e===Yt.Kind.OBJECT_TYPE_EXTENSION}function Zde(e){return Bde.COMPOSITE_OUTPUT_NODE_KINDS.has(e)}function efe(e){return e?e.kind===Yt.Kind.OBJECT_TYPE_DEFINITION:!1}function tfe(e){switch(e.kind){case Yt.Kind.ARGUMENT:case Yt.Kind.FIELD_DEFINITION:case Yt.Kind.INPUT_VALUE_DEFINITION:case Yt.Kind.ENUM_VALUE_DEFINITION:return e.federatedCoords;default:return e.name}}});var jD=F(xe=>{"use strict";m();T();N();Object.defineProperty(xe,"__esModule",{value:!0});xe.TAG_DEFINITION_DATA=xe.SUBSCRIPTION_FILTER_DEFINITION_DATA=xe.SHAREABLE_DEFINITION_DATA=xe.SPECIFIED_BY_DEFINITION_DATA=xe.SEMANTIC_NON_NULL_DATA=xe.REQUIRES_SCOPES_DEFINITION_DATA=xe.REQUIRE_FETCH_REASONS_DEFINITION_DATA=xe.REDIS_SUBSCRIBE_DEFINITION_DATA=xe.REDIS_PUBLISH_DEFINITION_DATA=xe.REQUIRES_DEFINITION_DATA=xe.PROVIDES_DEFINITION_DATA=xe.LIST_SIZE_DEFINITION_DATA=xe.LINK_DEFINITION_DATA=xe.KEY_DEFINITION_DATA=xe.OVERRIDE_DEFINITION_DATA=xe.ONE_OF_DEFINITION_DATA=xe.NATS_SUBSCRIBE_DEFINITION_DATA=xe.NATS_REQUEST_DEFINITION_DATA=xe.NATS_PUBLISH_DEFINITION_DATA=xe.KAFKA_SUBSCRIBE_DEFINITION_DATA=xe.KAFKA_PUBLISH_DEFINITION_DATA=xe.INTERFACE_OBJECT_DEFINITION_DATA=xe.INACCESSIBLE_DEFINITION_DATA=xe.EXTERNAL_DEFINITION_DATA=xe.EXTENDS_DEFINITION_DATA=xe.DEPRECATED_DEFINITION_DATA=xe.COST_DEFINITION_DATA=xe.CONNECT_FIELD_RESOLVER_DEFINITION_DATA=xe.CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION_DATA=xe.CONFIGURE_DESCRIPTION_DEFINITION_DATA=xe.COMPOSE_DIRECTIVE_DEFINITION_DATA=xe.AUTHENTICATED_DEFINITION_DATA=void 0;var Or=Cr(),Dt=Se(),k=Hn(),Jt=zf(),wn=ST();xe.AUTHENTICATED_DEFINITION_DATA={argumentTypeNodeByName:new Map([]),isRepeatable:!1,locations:new Set([k.ENUM_UPPER,k.FIELD_DEFINITION_UPPER,k.INTERFACE_UPPER,k.OBJECT_UPPER,k.SCALAR_UPPER]),name:k.AUTHENTICATED,node:Jt.AUTHENTICATED_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};xe.COMPOSE_DIRECTIVE_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.NAME,{name:k.NAME,typeNode:wn.REQUIRED_STRING_TYPE_NODE}]]),isRepeatable:!0,locations:new Set([k.SCHEMA_UPPER]),name:k.COMPOSE_DIRECTIVE,node:Jt.COMPOSE_DIRECTIVE_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([k.NAME])};xe.CONFIGURE_DESCRIPTION_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.PROPAGATE,{name:k.PROPAGATE,typeNode:{kind:Dt.Kind.NON_NULL_TYPE,type:(0,Or.stringToNamedTypeNode)(k.BOOLEAN_SCALAR)},defaultValue:{kind:Dt.Kind.BOOLEAN,value:!0}}],[k.DESCRIPTION_OVERRIDE,{name:k.DESCRIPTION_OVERRIDE,typeNode:(0,Or.stringToNamedTypeNode)(k.STRING_SCALAR)}]]),isRepeatable:!1,locations:new Set([k.ARGUMENT_DEFINITION_UPPER,k.ENUM_UPPER,k.ENUM_VALUE_UPPER,k.FIELD_DEFINITION_UPPER,k.INTERFACE_UPPER,k.INPUT_OBJECT_UPPER,k.INPUT_FIELD_DEFINITION_UPPER,k.OBJECT_UPPER,k.SCALAR_UPPER,k.SCHEMA_UPPER,k.UNION_UPPER]),name:k.CONFIGURE_DESCRIPTION,node:Jt.CONFIGURE_DESCRIPTION_DEFINITION,optionalArgumentNames:new Set([k.PROPAGATE,k.DESCRIPTION_OVERRIDE]),requiredArgumentNames:new Set};xe.CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.PROPAGATE,{name:k.PROPAGATE,typeNode:{kind:Dt.Kind.NON_NULL_TYPE,type:(0,Or.stringToNamedTypeNode)(k.BOOLEAN_SCALAR)},defaultValue:{kind:Dt.Kind.BOOLEAN,value:!0}}]]),isRepeatable:!1,locations:new Set([k.ENUM_UPPER,k.INPUT_OBJECT_UPPER,k.INTERFACE_UPPER,k.OBJECT_UPPER]),name:k.CONFIGURE_CHILD_DESCRIPTIONS,node:Jt.CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION,optionalArgumentNames:new Set([k.PROPAGATE]),requiredArgumentNames:new Set};xe.CONNECT_FIELD_RESOLVER_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.CONTEXT,{name:k.CONTEXT,typeNode:wn.REQUIRED_FIELDSET_TYPE_NODE}]]),isRepeatable:!1,locations:new Set([k.FIELD_DEFINITION_UPPER]),name:k.CONNECT_FIELD_RESOLVER,node:Jt.CONNECT_FIELD_RESOLVER_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([k.CONTEXT])};xe.COST_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.WEIGHT,{name:k.WEIGHT,typeNode:{kind:Dt.Kind.NON_NULL_TYPE,type:(0,Or.stringToNamedTypeNode)(k.INT_SCALAR)}}]]),isRepeatable:!1,locations:new Set([k.ARGUMENT_DEFINITION_UPPER,k.ENUM_UPPER,k.FIELD_DEFINITION_UPPER,k.INPUT_FIELD_DEFINITION_UPPER,k.OBJECT_UPPER,k.SCALAR_UPPER]),name:k.COST,node:Jt.COST_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([k.WEIGHT])};xe.DEPRECATED_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.REASON,{name:k.REASON,typeNode:(0,Or.stringToNamedTypeNode)(k.STRING_SCALAR),defaultValue:{kind:Dt.Kind.STRING,value:Dt.DEFAULT_DEPRECATION_REASON}}]]),isRepeatable:!1,locations:new Set([k.ARGUMENT_DEFINITION_UPPER,k.ENUM_VALUE_UPPER,k.FIELD_DEFINITION_UPPER,k.INPUT_FIELD_DEFINITION_UPPER]),name:k.DEPRECATED,node:Jt.DEPRECATED_DEFINITION,optionalArgumentNames:new Set([k.REASON]),requiredArgumentNames:new Set};xe.EXTENDS_DEFINITION_DATA={argumentTypeNodeByName:new Map,isRepeatable:!1,locations:new Set([k.INTERFACE_UPPER,k.OBJECT_UPPER]),name:k.EXTENDS,node:Jt.EXTENDS_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};xe.EXTERNAL_DEFINITION_DATA={argumentTypeNodeByName:new Map,isRepeatable:!1,locations:new Set([k.FIELD_DEFINITION_UPPER,k.OBJECT_UPPER]),name:k.EXTERNAL,node:Jt.EXTERNAL_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};xe.INACCESSIBLE_DEFINITION_DATA={argumentTypeNodeByName:new Map,isRepeatable:!1,locations:new Set([k.ARGUMENT_DEFINITION_UPPER,k.ENUM_UPPER,k.ENUM_VALUE_UPPER,k.FIELD_DEFINITION_UPPER,k.INPUT_FIELD_DEFINITION_UPPER,k.INPUT_OBJECT_UPPER,k.INTERFACE_UPPER,k.OBJECT_UPPER,k.SCALAR_UPPER,k.UNION_UPPER]),name:k.INACCESSIBLE,node:Jt.INACCESSIBLE_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};xe.INTERFACE_OBJECT_DEFINITION_DATA={argumentTypeNodeByName:new Map,isRepeatable:!1,locations:new Set([k.OBJECT_UPPER]),name:k.INTERFACE_OBJECT,node:Jt.INTERFACE_OBJECT_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};xe.KAFKA_PUBLISH_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.TOPIC,{name:k.TOPIC,typeNode:wn.REQUIRED_STRING_TYPE_NODE}],[k.PROVIDER_ID,{name:k.PROVIDER_ID,typeNode:wn.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:Dt.Kind.STRING,value:k.DEFAULT_EDFS_PROVIDER_ID}}]]),isRepeatable:!1,locations:new Set([k.FIELD_DEFINITION_UPPER]),name:k.EDFS_KAFKA_PUBLISH,node:Jt.EDFS_KAFKA_PUBLISH_DEFINITION,optionalArgumentNames:new Set([k.PROVIDER_ID]),requiredArgumentNames:new Set([k.TOPIC])};xe.KAFKA_SUBSCRIBE_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.TOPICS,{name:k.TOPICS,typeNode:{kind:Dt.Kind.NON_NULL_TYPE,type:{kind:Dt.Kind.LIST_TYPE,type:wn.REQUIRED_STRING_TYPE_NODE}}}],[k.PROVIDER_ID,{name:k.PROVIDER_ID,typeNode:wn.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:Dt.Kind.STRING,value:k.DEFAULT_EDFS_PROVIDER_ID}}]]),isRepeatable:!1,locations:new Set([k.FIELD_DEFINITION_UPPER]),name:k.EDFS_KAFKA_SUBSCRIBE,node:Jt.EDFS_KAFKA_SUBSCRIBE_DEFINITION,optionalArgumentNames:new Set([k.PROVIDER_ID]),requiredArgumentNames:new Set([k.TOPICS])};xe.NATS_PUBLISH_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.SUBJECT,{name:k.SUBJECT,typeNode:wn.REQUIRED_STRING_TYPE_NODE}],[k.PROVIDER_ID,{name:k.PROVIDER_ID,typeNode:wn.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:Dt.Kind.STRING,value:k.DEFAULT_EDFS_PROVIDER_ID}}]]),isRepeatable:!1,locations:new Set([k.FIELD_DEFINITION_UPPER]),name:k.EDFS_NATS_PUBLISH,node:Jt.EDFS_NATS_PUBLISH_DEFINITION,optionalArgumentNames:new Set([k.PROVIDER_ID]),requiredArgumentNames:new Set([k.SUBJECT])};xe.NATS_REQUEST_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.SUBJECT,{name:k.SUBJECT,typeNode:wn.REQUIRED_STRING_TYPE_NODE}],[k.PROVIDER_ID,{name:k.PROVIDER_ID,typeNode:wn.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:Dt.Kind.STRING,value:k.DEFAULT_EDFS_PROVIDER_ID}}]]),isRepeatable:!1,locations:new Set([k.FIELD_DEFINITION_UPPER]),name:k.EDFS_NATS_REQUEST,node:Jt.EDFS_NATS_REQUEST_DEFINITION,optionalArgumentNames:new Set([k.PROVIDER_ID]),requiredArgumentNames:new Set([k.SUBJECT])};xe.NATS_SUBSCRIBE_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.SUBJECTS,{name:k.SUBJECTS,typeNode:{kind:Dt.Kind.NON_NULL_TYPE,type:{kind:Dt.Kind.LIST_TYPE,type:wn.REQUIRED_STRING_TYPE_NODE}}}],[k.PROVIDER_ID,{name:k.PROVIDER_ID,typeNode:wn.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:Dt.Kind.STRING,value:k.DEFAULT_EDFS_PROVIDER_ID}}],[k.STREAM_CONFIGURATION,{name:k.STREAM_CONFIGURATION,typeNode:(0,Or.stringToNamedTypeNode)(k.EDFS_NATS_STREAM_CONFIGURATION)}]]),isRepeatable:!1,locations:new Set([k.FIELD_DEFINITION_UPPER]),name:k.EDFS_NATS_SUBSCRIBE,node:Jt.EDFS_NATS_SUBSCRIBE_DEFINITION,optionalArgumentNames:new Set([k.PROVIDER_ID,k.STREAM_CONFIGURATION]),requiredArgumentNames:new Set([k.SUBJECTS])};xe.ONE_OF_DEFINITION_DATA={argumentTypeNodeByName:new Map([]),isRepeatable:!1,locations:new Set([k.INPUT_OBJECT_UPPER]),name:k.ONE_OF,node:Jt.ONE_OF_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};xe.OVERRIDE_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.FROM,{name:k.FROM,typeNode:wn.REQUIRED_STRING_TYPE_NODE}]]),isRepeatable:!1,locations:new Set([k.FIELD_DEFINITION_UPPER]),name:k.OVERRIDE,node:Jt.OVERRIDE_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([k.FROM])};xe.KEY_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.FIELDS,{name:k.FIELDS,typeNode:wn.REQUIRED_FIELDSET_TYPE_NODE}],[k.RESOLVABLE,{name:k.RESOLVABLE,typeNode:(0,Or.stringToNamedTypeNode)(k.BOOLEAN_SCALAR),defaultValue:{kind:Dt.Kind.BOOLEAN,value:!0}}]]),isRepeatable:!0,locations:new Set([k.INTERFACE_UPPER,k.OBJECT_UPPER]),name:k.KEY,node:Jt.KEY_DEFINITION,optionalArgumentNames:new Set([k.RESOLVABLE]),requiredArgumentNames:new Set([k.FIELDS])};xe.LINK_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.URL_LOWER,{name:k.URL_LOWER,typeNode:wn.REQUIRED_STRING_TYPE_NODE}],[k.AS,{name:k.AS,typeNode:(0,Or.stringToNamedTypeNode)(k.STRING_SCALAR)}],[k.FOR,{name:k.FOR,typeNode:(0,Or.stringToNamedTypeNode)(k.LINK_PURPOSE)}],[k.IMPORT,{name:k.IMPORT,typeNode:{kind:Dt.Kind.LIST_TYPE,type:(0,Or.stringToNamedTypeNode)(k.LINK_IMPORT)}}]]),isRepeatable:!0,locations:new Set([k.SCHEMA_UPPER]),name:k.LINK,node:Jt.LINK_DEFINITION,optionalArgumentNames:new Set([k.AS,k.FOR,k.IMPORT]),requiredArgumentNames:new Set([k.URL_LOWER])};xe.LIST_SIZE_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.ASSUMED_SIZE,{name:k.ASSUMED_SIZE,typeNode:(0,Or.stringToNamedTypeNode)(k.INT_SCALAR)}],[k.SLICING_ARGUMENTS,{name:k.SLICING_ARGUMENTS,typeNode:{kind:Dt.Kind.LIST_TYPE,type:{kind:Dt.Kind.NON_NULL_TYPE,type:(0,Or.stringToNamedTypeNode)(k.STRING_SCALAR)}}}],[k.SIZED_FIELDS,{name:k.SIZED_FIELDS,typeNode:{kind:Dt.Kind.LIST_TYPE,type:{kind:Dt.Kind.NON_NULL_TYPE,type:(0,Or.stringToNamedTypeNode)(k.STRING_SCALAR)}}}],[k.REQUIRE_ONE_SLICING_ARGUMENT,{name:k.REQUIRE_ONE_SLICING_ARGUMENT,typeNode:(0,Or.stringToNamedTypeNode)(k.BOOLEAN_SCALAR),defaultValue:{kind:Dt.Kind.BOOLEAN,value:!0}}]]),isRepeatable:!1,locations:new Set([k.FIELD_DEFINITION_UPPER]),name:k.LIST_SIZE,node:Jt.LIST_SIZE_DEFINITION,optionalArgumentNames:new Set([k.ASSUMED_SIZE,k.SLICING_ARGUMENTS,k.SIZED_FIELDS,k.REQUIRE_ONE_SLICING_ARGUMENT]),requiredArgumentNames:new Set};xe.PROVIDES_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.FIELDS,{name:k.FIELDS,typeNode:wn.REQUIRED_FIELDSET_TYPE_NODE}]]),isRepeatable:!1,locations:new Set([k.FIELD_DEFINITION_UPPER]),name:k.PROVIDES,node:Jt.PROVIDES_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([k.FIELDS])};xe.REQUIRES_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.FIELDS,{name:k.FIELDS,typeNode:wn.REQUIRED_FIELDSET_TYPE_NODE}]]),isRepeatable:!1,locations:new Set([k.FIELD_DEFINITION_UPPER]),name:k.REQUIRES,node:Jt.REQUIRES_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([k.FIELDS])};xe.REDIS_PUBLISH_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.CHANNEL,{name:k.CHANNEL,typeNode:wn.REQUIRED_STRING_TYPE_NODE}],[k.PROVIDER_ID,{name:k.PROVIDER_ID,typeNode:wn.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:Dt.Kind.STRING,value:k.DEFAULT_EDFS_PROVIDER_ID}}]]),isRepeatable:!1,locations:new Set([k.FIELD_DEFINITION_UPPER]),name:k.EDFS_REDIS_PUBLISH,node:Jt.EDFS_REDIS_PUBLISH_DEFINITION,optionalArgumentNames:new Set([k.PROVIDER_ID]),requiredArgumentNames:new Set([k.CHANNEL])};xe.REDIS_SUBSCRIBE_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.CHANNELS,{name:k.CHANNELS,typeNode:{kind:Dt.Kind.NON_NULL_TYPE,type:{kind:Dt.Kind.LIST_TYPE,type:wn.REQUIRED_STRING_TYPE_NODE}}}],[k.PROVIDER_ID,{name:k.PROVIDER_ID,typeNode:wn.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:Dt.Kind.STRING,value:k.DEFAULT_EDFS_PROVIDER_ID}}]]),isRepeatable:!1,locations:new Set([k.FIELD_DEFINITION_UPPER]),name:k.EDFS_REDIS_SUBSCRIBE,node:Jt.EDFS_REDIS_SUBSCRIBE_DEFINITION,optionalArgumentNames:new Set([k.PROVIDER_ID]),requiredArgumentNames:new Set([k.CHANNELS])};xe.REQUIRE_FETCH_REASONS_DEFINITION_DATA={argumentTypeNodeByName:new Map,isRepeatable:!0,locations:new Set([k.FIELD_DEFINITION_UPPER,k.INTERFACE_UPPER,k.OBJECT_UPPER]),name:k.REQUIRE_FETCH_REASONS,node:Jt.REQUIRE_FETCH_REASONS_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};xe.REQUIRES_SCOPES_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.SCOPES,{name:k.SCOPES,typeNode:{kind:Dt.Kind.NON_NULL_TYPE,type:{kind:Dt.Kind.LIST_TYPE,type:{kind:Dt.Kind.NON_NULL_TYPE,type:{kind:Dt.Kind.LIST_TYPE,type:{kind:Dt.Kind.NON_NULL_TYPE,type:(0,Or.stringToNamedTypeNode)(k.SCOPE_SCALAR)}}}}}}]]),isRepeatable:!1,locations:new Set([k.ENUM_UPPER,k.FIELD_DEFINITION_UPPER,k.INTERFACE_UPPER,k.OBJECT_UPPER,k.SCALAR_UPPER]),name:k.REQUIRES_SCOPES,node:Jt.REQUIRES_SCOPES_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([k.SCOPES])};xe.SEMANTIC_NON_NULL_DATA={argumentTypeNodeByName:new Map([[k.LEVELS,{name:k.LEVELS,typeNode:{kind:Dt.Kind.NON_NULL_TYPE,type:{kind:Dt.Kind.LIST_TYPE,type:{kind:Dt.Kind.NON_NULL_TYPE,type:(0,Or.stringToNamedTypeNode)(k.INT_SCALAR)}}},defaultValue:{kind:Dt.Kind.LIST,values:[{kind:Dt.Kind.INT,value:"0"}]}}]]),isRepeatable:!1,locations:new Set([k.FIELD_DEFINITION_UPPER]),name:k.SEMANTIC_NON_NULL,node:Jt.SEMANTIC_NON_NULL_DEFINITION,optionalArgumentNames:new Set([k.LEVELS]),requiredArgumentNames:new Set};xe.SPECIFIED_BY_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.URL_LOWER,{name:k.URL_LOWER,typeNode:wn.REQUIRED_STRING_TYPE_NODE}]]),isRepeatable:!1,locations:new Set([k.SCALAR_UPPER]),name:k.SPECIFIED_BY,node:Jt.SPECIFIED_BY_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([k.URL_LOWER])};xe.SHAREABLE_DEFINITION_DATA={argumentTypeNodeByName:new Map,isRepeatable:!0,locations:new Set([k.FIELD_DEFINITION_UPPER,k.OBJECT_UPPER]),name:k.SHAREABLE,node:Jt.SHAREABLE_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};xe.SUBSCRIPTION_FILTER_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.CONDITION,{name:k.CONDITION,typeNode:{kind:Dt.Kind.NON_NULL_TYPE,type:(0,Or.stringToNamedTypeNode)(k.SUBSCRIPTION_FILTER_CONDITION)}}]]),isRepeatable:!1,locations:new Set([k.FIELD_DEFINITION_UPPER]),name:k.SUBSCRIPTION_FILTER,node:Jt.SUBSCRIPTION_FILTER_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([k.CONDITION])};xe.TAG_DEFINITION_DATA={argumentTypeNodeByName:new Map([[k.NAME,{name:k.NAME,typeNode:wn.REQUIRED_STRING_TYPE_NODE}]]),isRepeatable:!0,locations:new Set([k.ARGUMENT_DEFINITION_UPPER,k.ENUM_UPPER,k.ENUM_VALUE_UPPER,k.FIELD_DEFINITION_UPPER,k.INPUT_FIELD_DEFINITION_UPPER,k.INPUT_OBJECT_UPPER,k.INTERFACE_UPPER,k.OBJECT_UPPER,k.SCALAR_UPPER,k.UNION_UPPER]),name:k.TAG,node:Jt.TAG_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([k.NAME])}});var vp=F(Aa=>{"use strict";m();T();N();Object.defineProperty(Aa,"__esModule",{value:!0});Aa.newFieldSetData=nfe;Aa.extractFieldSetValue=rfe;Aa.getNormalizedFieldSet=ife;Aa.getInitialFieldCoordsPath=afe;Aa.validateKeyFieldSets=sfe;Aa.getConditionalFieldSetDirectiveName=ofe;Aa.isNodeQuery=ufe;Aa.validateArgumentTemplateReferences=cfe;Aa.initializeDirectiveDefinitionDatas=lfe;var $n=Se(),NV=Cr(),Dr=Qi(),TV=Ru(),KD=Au(),zt=jD(),Et=Hn(),xs=Ur();function nfe(){return{provides:new Map,requires:new Map}}function rfe(e,t,n){if(!n||n.length>1)return;let r=n[0].arguments;if(!r||r.length!==1)return;let i=r[0];i.name.value!==Et.FIELDS||i.value.kind!==$n.Kind.STRING||t.set(e,i.value.value)}function ife(e){return(0,$n.print)((0,NV.lexicographicallySortDocumentNode)(e)).replaceAll(/\s+/g," ").slice(2,-2)}function afe(e,t){return e?[t]:[]}function sfe(e,t,n){let r=e.entityInterfaceDataByTypeName.get(t.name),i=t.name,a=[],o=r?void 0:e.internalGraph.addEntityDataNode(t.name),u=e.internalGraph.addOrUpdateNode(t.name),l=0;for(let[d,{documentNode:p,isUnresolvable:E,rawFieldSet:h}]of n){r&&(r.resolvable||(r.resolvable=!E)),l+=1;let v=[],A=[t],B=[],V=[],J=new Set,re=-1,ie=!0,Ne="",Ee=!1;if((0,$n.visit)(p,{Argument:{enter(_e){return v.push((0,Dr.unexpectedArgumentErrorMessage)(h,`${A[re].name}.${Ne}`,_e.name.value)),$n.BREAK}},Field:{enter(_e){let ye=A[re],qe=ye.name;if(ie){let Ot=`${qe}.${Ne}`,Kt=ye.fieldDataByName.get(Ne);if(!Kt)return v.push((0,Dr.undefinedFieldInFieldSetErrorMessage)(h,Ot,Ne)),$n.BREAK;let qr=(0,KD.getTypeNodeNamedTypeName)(Kt.node.type),rr=e.parentDefinitionDataByTypeName.get(qr),En=rr?rr.kind:$n.Kind.SCALAR_TYPE_DEFINITION;return v.push((0,Dr.invalidSelectionSetErrorMessage)(h,[Ot],qr,(0,xs.kindToNodeType)(En))),$n.BREAK}let Z=_e.name.value,ge=`${qe}.${Z}`;if(Ne=Z,Z===Et.TYPENAME)return;let It=ye.fieldDataByName.get(Z);if(!It)return v.push((0,Dr.undefinedFieldInFieldSetErrorMessage)(h,qe,Z)),$n.BREAK;if(It.argumentDataByName.size)return v.push((0,Dr.argumentsInKeyFieldSetErrorMessage)(h,ge)),$n.BREAK;if(B[re].has(Z))return v.push((0,Dr.duplicateFieldInFieldSetErrorMessage)(h,ge)),$n.BREAK;let Zt=It.externalFieldDataBySubgraphName.get(e.subgraphName);if(!e.isSubgraphEventDrivenGraph&&(Zt!=null&&Zt.isDefinedExternal)&&!Zt.isUnconditionallyProvided&&!e.conditionalFieldDataByCoords.get(ge)&&!e.options.ignoreExternalKeys){Ee=!0;let Kt=u.headToTailEdges.get(Z);Kt&&(Kt.isExternal=!0)}(0,xs.getValueOrDefault)((0,xs.getValueOrDefault)(e.keyFieldSetsByEntityTypeNameByFieldCoords,ge,()=>new Map),i,()=>new Set).add(d),V.push(Z),It.isShareableBySubgraphName.set(e.subgraphName,!0),B[re].add(Z),(0,xs.getValueOrDefault)(e.keyFieldNamesByParentTypeName,qe,()=>new Set).add(Z);let In=(0,KD.getTypeNodeNamedTypeName)(It.node.type);if(TV.BASE_SCALARS.has(In)){J.add(V.join(Et.LITERAL_PERIOD)),V.pop();return}let Tn=e.parentDefinitionDataByTypeName.get(In);if(!Tn)return v.push((0,Dr.unknownTypeInFieldSetErrorMessage)(h,ge,In)),$n.BREAK;if(Tn.kind===$n.Kind.OBJECT_TYPE_DEFINITION){ie=!0,A.push(Tn);return}if((0,NV.isKindAbstract)(Tn.kind))return v.push((0,Dr.abstractTypeInKeyFieldSetErrorMessage)(h,ge,In,(0,xs.kindToNodeType)(Tn.kind))),$n.BREAK;J.add(V.join(Et.LITERAL_PERIOD)),V.pop()}},InlineFragment:{enter(){return v.push(Dr.inlineFragmentInFieldSetErrorMessage),$n.BREAK}},SelectionSet:{enter(){if(!ie){let _e=A[re],qe=`${_e.name}.${Ne}`;if(Ne===Et.TYPENAME)return v.push((0,Dr.invalidSelectionSetDefinitionErrorMessage)(h,[qe],Et.STRING_SCALAR,(0,xs.kindToNodeType)($n.Kind.SCALAR_TYPE_DEFINITION))),$n.BREAK;let Z=_e.fieldDataByName.get(Ne);if(!Z)return v.push((0,Dr.undefinedFieldInFieldSetErrorMessage)(h,qe,Ne)),$n.BREAK;let ge=(0,KD.getTypeNodeNamedTypeName)(Z.node.type),It=e.parentDefinitionDataByTypeName.get(ge),Zt=It?It.kind:$n.Kind.SCALAR_TYPE_DEFINITION;return v.push((0,Dr.invalidSelectionSetDefinitionErrorMessage)(h,[qe],ge,(0,xs.kindToNodeType)(Zt))),$n.BREAK}if(re+=1,ie=!1,re<0||re>=A.length)return v.push((0,Dr.unparsableFieldSetSelectionErrorMessage)(h,Ne)),$n.BREAK;B.push(new Set)},leave(){if(ie){let ye=A[re].name,qe=A[re+1],Z=`${ye}.${Ne}`;v.push((0,Dr.invalidSelectionSetErrorMessage)(h,[Z],qe.name,(0,xs.kindToNodeType)(qe.kind))),ie=!1}re-=1,A.pop(),B.pop()}}}),v.length>0){e.errors.push((0,Dr.invalidDirectiveError)(Et.KEY,i,(0,xs.numberToOrdinal)(l),v));continue}a.push(M({fieldName:"",selectionSet:d},E?{disableEntityResolver:!0}:{})),u.satisfiedFieldSets.add(d),Ee&&u.externalFieldSets.add(d),!E&&(o==null||o.addTargetSubgraphByFieldSet(d,e.subgraphName))}if(a.length>0)return a}function ofe(e){return e?Et.PROVIDES:Et.REQUIRES}function ufe(e,t){return e===Et.QUERY||t===$n.OperationTypeNode.QUERY}function cfe(e,t,n){let r=e.matchAll(TV.EDFS_ARGS_REGEXP),i=new Set,a=new Set;for(let o of r){if(o.length<2){a.add(o[0]);continue}t.has(o[1])||i.add(o[1])}for(let o of i)n.push((0,Dr.undefinedEventSubjectsArgumentErrorMessage)(o));for(let o of a)n.push((0,Dr.invalidEventSubjectsArgumentErrorMessage)(o))}function lfe(){return new Map([[Et.AUTHENTICATED,zt.AUTHENTICATED_DEFINITION_DATA],[Et.COMPOSE_DIRECTIVE,zt.COMPOSE_DIRECTIVE_DEFINITION_DATA],[Et.CONFIGURE_DESCRIPTION,zt.CONFIGURE_DESCRIPTION_DEFINITION_DATA],[Et.CONFIGURE_CHILD_DESCRIPTIONS,zt.CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION_DATA],[Et.CONNECT_FIELD_RESOLVER,zt.CONNECT_FIELD_RESOLVER_DEFINITION_DATA],[Et.COST,zt.COST_DEFINITION_DATA],[Et.DEPRECATED,zt.DEPRECATED_DEFINITION_DATA],[Et.EDFS_KAFKA_PUBLISH,zt.KAFKA_PUBLISH_DEFINITION_DATA],[Et.EDFS_KAFKA_SUBSCRIBE,zt.KAFKA_SUBSCRIBE_DEFINITION_DATA],[Et.EDFS_NATS_PUBLISH,zt.NATS_PUBLISH_DEFINITION_DATA],[Et.EDFS_NATS_REQUEST,zt.NATS_REQUEST_DEFINITION_DATA],[Et.EDFS_NATS_SUBSCRIBE,zt.NATS_SUBSCRIBE_DEFINITION_DATA],[Et.EDFS_REDIS_PUBLISH,zt.REDIS_PUBLISH_DEFINITION_DATA],[Et.EDFS_REDIS_SUBSCRIBE,zt.REDIS_SUBSCRIBE_DEFINITION_DATA],[Et.EXTENDS,zt.EXTENDS_DEFINITION_DATA],[Et.EXTERNAL,zt.EXTERNAL_DEFINITION_DATA],[Et.INACCESSIBLE,zt.INACCESSIBLE_DEFINITION_DATA],[Et.INTERFACE_OBJECT,zt.INTERFACE_OBJECT_DEFINITION_DATA],[Et.KEY,zt.KEY_DEFINITION_DATA],[Et.LINK,zt.LINK_DEFINITION_DATA],[Et.LIST_SIZE,zt.LIST_SIZE_DEFINITION_DATA],[Et.ONE_OF,zt.ONE_OF_DEFINITION_DATA],[Et.OVERRIDE,zt.OVERRIDE_DEFINITION_DATA],[Et.PROVIDES,zt.PROVIDES_DEFINITION_DATA],[Et.REQUIRE_FETCH_REASONS,zt.REQUIRE_FETCH_REASONS_DEFINITION_DATA],[Et.REQUIRES,zt.REQUIRES_DEFINITION_DATA],[Et.REQUIRES_SCOPES,zt.REQUIRES_SCOPES_DEFINITION_DATA],[Et.SEMANTIC_NON_NULL,zt.SEMANTIC_NON_NULL_DATA],[Et.SHAREABLE,zt.SHAREABLE_DEFINITION_DATA],[Et.SPECIFIED_BY,zt.SPECIFIED_BY_DEFINITION_DATA],[Et.SUBSCRIPTION_FILTER,zt.SUBSCRIPTION_FILTER_DEFINITION_DATA],[Et.TAG,zt.TAG_DEFINITION_DATA]])}});var GD=F($D=>{"use strict";m();T();N();Object.defineProperty($D,"__esModule",{value:!0});$D.recordSubgraphName=dfe;function dfe(e,t,n){if(!t.has(e)){t.add(e);return}n.add(e)}});var YD=F(YE=>{"use strict";m();T();N();Object.defineProperty(YE,"__esModule",{value:!0});YE.Warning=void 0;var QD=class extends Error{constructor(n){super(n.message);g(this,"subgraph");this.name="Warning",this.subgraph=n.subgraph}};YE.Warning=QD});var Sp=F(Si=>{"use strict";m();T();N();Object.defineProperty(Si,"__esModule",{value:!0});Si.invalidOverrideTargetSubgraphNameWarning=ffe;Si.externalInterfaceFieldsWarning=pfe;Si.nonExternalConditionalFieldWarning=mfe;Si.unimplementedInterfaceOutputTypeWarning=Nfe;Si.invalidExternalFieldWarning=Tfe;Si.requiresDefinedOnNonEntityFieldWarning=Efe;Si.consumerInactiveThresholdInvalidValueWarning=hfe;Si.externalEntityExtensionKeyFieldWarning=yfe;Si.fieldAlreadyProvidedWarning=Ife;Si.singleSubgraphInputFieldOneOfWarning=gfe;Si.singleFederatedInputFieldOneOfWarning=_fe;var Ra=YD(),JD=Hn();function ffe(e,t,n,r){return new Ra.Warning({message:`The Object type "${t}" defines the directive "@override(from: "${e}")" on the following field`+(n.length>1?"s":"")+': "'+n.join(JD.QUOTATION_JOIN)+`". +`;return n+=`The list value provided to the "levels" argument must be consistently defined across all subgraphs that define "@semanticNonNull" on field "${t}".`,new Error(n)}function Zoe({requiredFieldNames:e,typeName:t}){return new Error(`The "@oneOf" directive defined on Input Object "${t}" is invalid because all Input fields must be optional (nullable); however, the following Input field`+(e.length>1?"s are":" is")+' required (non-nullable): "'+e.join(He.QUOTATION_JOIN)+'".')}function eue(e){return`Type "${e}" has @openfed__entityCache but no @key directive.`}function tue(e){return`@openfed__queryCache must only be defined on fields of the root query type; found on "${e}". Use @openfed__cachePopulate or @openfed__cacheInvalidate on mutation or subscription fields.`}function nue(e,t){return`Field "${e}" has @openfed__queryCache but returns non-entity type "${t}". @openfed__queryCache requires the return type to be an entity with @key.`}function rue(e,t){return`@${e} maxAge must be a positive integer, got "${t}".`}function iue(e,t){return`@${e} negativeCacheTTL must be a non-negative integer, got "${t}".`}function aue(e,t){return`@openfed__is on argument "${e}" of field "${t}" has no effect without @openfed__queryCache.`}function sue(e,t,n,r){return`@openfed__is(fields: "${e}") on argument "${t}" of field "${n}" references unknown @key field "${e}" on type "${r}".`}function oue(e,t){return`Multiple arguments on field "${e}" map to @key field "${t}".`}function uue(e){return`@openfed__cacheInvalidate is only valid on Mutation or Subscription fields, found on "${e}".`}function cue(e,t){return`Field "${e}" has @openfed__cacheInvalidate but returns non-entity type "${t}".`}function lue(e){return`@openfed__cachePopulate is only valid on Mutation or Subscription fields, found on "${e}".`}function due(e,t){return`Field "${e}" has @openfed__cachePopulate but returns non-entity type "${t}".`}function pue(e){return`Field "${e}" has both @openfed__cacheInvalidate and @openfed__cachePopulate. A field must use one or the other, not both.`}function fue(e,t,n,r,i,a){return`Argument "${e}" on field "${t}" has type "${n}" but @openfed__is(fields: "${r}") targets @key field "${r}" of type "${a}" on entity "${i}".`}function mue(e,t,n,r){return`Argument "${e}" on field "${t}" uses @openfed__is(fields: "${n}"), but "${n}" is not a @key field on entity "${r}". @openfed__is can only target fields that are part of a @key.`}function Nue(e,t,n,r,i,a){return`Argument "${e}" on field "${t}" has type "${n}" but @openfed__is(fields: "${r}") targets @key field "${r}" of type "${a}" on entity "${i}". List arguments can only map to scalar key fields when the field returns a list of entities, or to list key fields when the key field itself is a list type.`}function Tue(e,t,n,r,i,a){return`Argument "${e}" on field "${t}" has type "${n}" but @openfed__is(fields: "${r}") targets @key field "${r}" of type "${a}" on entity "${i}". A scalar argument cannot map to a list key field.`}function Eue(e,t,n,r,i,a){return`Field "${e}" has argument "${t}" with @openfed__is mapping to @key field "${n}" on entity "${r}", but composite @key "${i}" is incomplete because no argument maps to required key field "${a}".`}function hue(e,t,n,r,i){return`Field "${e}" has argument "${t}" with @openfed__is mapping to @key field "${n}" on entity "${r}", but also has additional argument "${i}" which is not mapped to a key field. All arguments must be key arguments \u2014 additional arguments may filter the response, making the cache key incomplete.`}function yue(e,t,n,r,i,a){return`Field "${e}" has arguments "${t}" and "${n}" with @openfed__is mappings covering composite @key "${r}" on entity "${i}", but also has additional argument "${a}" which is not mapped to a key field. All arguments must be key arguments \u2014 additional arguments may filter the response, making the cache key incomplete.`}function Iue(e,t,n,r){return`Field "${e}" returns a list of entities, so cache lookup is a batch lookup and requires one key value per entity. Because @openfed__is(fields: "${t}") targets list-valued @key field "${t}" on entity "${n}", the argument must provide a list of tag lists (e.g., "[[String!]!]!"), not ${r}.`}function gue(e,t,n,r,i){return`Field "${e}" returns a list of entities, so cache lookup is a batch lookup and requires a single key input that determines the returned entities. Argument "${t}" uses @openfed__is to map to @key field "${n}" on entity "${r}", but additional argument "${i}" is not mapped to a key field and may filter the response, so the batch key would be incomplete.`}function _ue(e,t){return`Field "${e}" returns a list of entities, so cache lookup is a batch lookup and requires one key value per entity. Scalar arguments with @openfed__is mapping to @key fields on entity "${t}" cannot provide a batch of keys, so they cannot establish cache key mappings for this field. Use list arguments for batch cache lookups.`}function vue(e,t){return`Field "${e}" has multiple list arguments mapping to @key fields on entity "${t}". Batch cache lookups require a single list argument. For composite keys, use a single list of input objects instead.`}function Sue(e,t,n,r,i,a,o,u,l){return`Argument "${e}" on field "${t}" uses @openfed__is(fields: "${n}") mapping to composite @key on entity "${r}", but input type "${i}" field "${a}" has type "${o}" which does not match key field "${u}" of type "${l}".`}function Oue(e,t,n,r,i,a){return`Argument "${e}" on field "${t}" uses @openfed__is(fields: "${n}") mapping to composite @key on entity "${r}", but input type "${i}" is missing required key field "${a}".`}function Due(e,t,n,r,i,a,o,u,l){return`Argument "${e}" on field "${t}" maps to nested @key "${n}" on entity "${r}", but input type "${i}" field "${a}" has type "${o}" which does not match key field "${u}" of type "${l}".`}function bue(e,t,n,r,i,a){return`Argument "${e}" on field "${t}" maps to nested @key "${n}" on entity "${r}", but input type "${i}" is missing required key field "${a}".`}function Aue(e,t,n,r,i){return`Argument "${e}" on field "${t}" uses @openfed__is(fields: "${n}") targeting composite @key on entity "${r}", but argument type "${i}" does not provide nested fields for each key field. Use separate arguments or an input object that matches the composite key shape.`}function Rue(e,t){return` The "slicingArguments" value "${t}" on "${e}" does not reference a defined argument on this field.`}function Pue(e,t,n){return` The "slicingArguments" value "${t}" on "${e}" references an argument of type "${n}", but slicing arguments must be of type "Int" or "Int!".`}function Fue(e,t,n){return` The "sizedFields" value "${t}" on "${e}" does not reference a defined field on the return type "${n}".`}function Lue(e,t,n,r){return` The "sizedFields" value "${t}" on "${e}" references field "${n}.${t}", which returns type "${r}". Sized fields must return a list type.`}function wue(e,t){return` The "@listSize" directive on "${e}" is invalid because the field returns type "${t}", which is not a list type, and no "sizedFields" argument is provided.`}function Cue(e,t){return` The "sizedFields" argument on "${e}" is invalid because the return type "${t}" is not an object or interface type.`}function Uue(e,t){return` The "sizedFields" argument on "${e}" is invalid because the return type "${t}" must not be a list.`}function Bue(e){return` The "@listSize" directive on "${e}" defines both "assumedSize" and "slicingArguments". When both are used, "requireOneSlicingArgument" must be set to false.`}function kue(e,t){return` The "@listSize" directive on "${e}" defines both "assumedSize" and "slicingArguments", but slicing argument "${t}" has a default value. When "assumedSize" is used as a fallback for missing slicing arguments, none of the slicing arguments may have default values.`}function Mue(e){return` The "@cost" directive at "${e}" is not permitted on fields or arguments of an Interface type. The cost of an interface field is derived from the costs of the corresponding fields on the concrete types that implement the interface.`}});var _x=F(gx=>{"use strict";m();T();N();Object.defineProperty(gx,"__esModule",{value:!0})});var xE=F(ME=>{"use strict";m();T();N();Object.defineProperty(ME,"__esModule",{value:!0});ME.DEFAULT_CONSUMER_INACTIVE_THRESHOLD=void 0;ME.DEFAULT_CONSUMER_INACTIVE_THRESHOLD=30});var qE=F(_r=>{"use strict";m();T();N();Object.defineProperty(_r,"__esModule",{value:!0});_r.SUBSCRIPTION_FILTER_VALUE_DEFINITION=_r.SUBSCRIPTION_FILTER_CONDITION_DEFINITION=_r.SUBSCRIPTION_FIELD_CONDITION_DEFINITION=_r.SCOPE_SCALAR_DEFINITION=_r.LINK_PURPOSE_DEFINITION=_r.LINK_IMPORT_DEFINITION=_r.FIELD_SET_SCALAR_DEFINITION=_r.EDFS_NATS_STREAM_CONFIGURATION_DEFINITION=void 0;var sn=Oe(),pn=kr(),fn=Zn(),xue=xE();_r.EDFS_NATS_STREAM_CONFIGURATION_DEFINITION={kind:sn.Kind.INPUT_OBJECT_TYPE_DEFINITION,name:(0,pn.stringToNameNode)(fn.EDFS_NATS_STREAM_CONFIGURATION),fields:[{kind:sn.Kind.INPUT_VALUE_DEFINITION,name:(0,pn.stringToNameNode)(fn.CONSUMER_INACTIVE_THRESHOLD),type:{kind:sn.Kind.NON_NULL_TYPE,type:(0,pn.stringToNamedTypeNode)(fn.INT_SCALAR)},defaultValue:{kind:sn.Kind.INT,value:xue.DEFAULT_CONSUMER_INACTIVE_THRESHOLD.toString()}},{kind:sn.Kind.INPUT_VALUE_DEFINITION,name:(0,pn.stringToNameNode)(fn.CONSUMER_NAME),type:{kind:sn.Kind.NON_NULL_TYPE,type:(0,pn.stringToNamedTypeNode)(fn.STRING_SCALAR)}},{kind:sn.Kind.INPUT_VALUE_DEFINITION,name:(0,pn.stringToNameNode)(fn.STREAM_NAME),type:{kind:sn.Kind.NON_NULL_TYPE,type:(0,pn.stringToNamedTypeNode)(fn.STRING_SCALAR)}}]};_r.FIELD_SET_SCALAR_DEFINITION={kind:sn.Kind.SCALAR_TYPE_DEFINITION,name:(0,pn.stringToNameNode)(fn.FIELD_SET_SCALAR)};_r.LINK_IMPORT_DEFINITION={kind:sn.Kind.SCALAR_TYPE_DEFINITION,name:(0,pn.stringToNameNode)(fn.LINK_IMPORT)};_r.LINK_PURPOSE_DEFINITION={kind:sn.Kind.ENUM_TYPE_DEFINITION,name:(0,pn.stringToNameNode)(fn.LINK_PURPOSE),values:[{directives:[],kind:sn.Kind.ENUM_VALUE_DEFINITION,name:(0,pn.stringToNameNode)(fn.EXECUTION)},{directives:[],kind:sn.Kind.ENUM_VALUE_DEFINITION,name:(0,pn.stringToNameNode)(fn.SECURITY)}]};_r.SCOPE_SCALAR_DEFINITION={kind:sn.Kind.SCALAR_TYPE_DEFINITION,name:(0,pn.stringToNameNode)(fn.SCOPE_SCALAR)};_r.SUBSCRIPTION_FIELD_CONDITION_DEFINITION={fields:[{kind:sn.Kind.INPUT_VALUE_DEFINITION,name:(0,pn.stringToNameNode)(fn.FIELD_PATH),type:{kind:sn.Kind.NON_NULL_TYPE,type:(0,pn.stringToNamedTypeNode)(fn.STRING_SCALAR)}},{kind:sn.Kind.INPUT_VALUE_DEFINITION,name:(0,pn.stringToNameNode)(fn.VALUES),type:{kind:sn.Kind.NON_NULL_TYPE,type:{kind:sn.Kind.LIST_TYPE,type:(0,pn.stringToNamedTypeNode)(fn.SUBSCRIPTION_FILTER_VALUE)}}}],kind:sn.Kind.INPUT_OBJECT_TYPE_DEFINITION,name:(0,pn.stringToNameNode)(fn.SUBSCRIPTION_FIELD_CONDITION)};_r.SUBSCRIPTION_FILTER_CONDITION_DEFINITION={fields:[{kind:sn.Kind.INPUT_VALUE_DEFINITION,name:(0,pn.stringToNameNode)(fn.AND_UPPER),type:{kind:sn.Kind.LIST_TYPE,type:{kind:sn.Kind.NON_NULL_TYPE,type:(0,pn.stringToNamedTypeNode)(fn.SUBSCRIPTION_FILTER_CONDITION)}}},{kind:sn.Kind.INPUT_VALUE_DEFINITION,name:(0,pn.stringToNameNode)(fn.IN_UPPER),type:(0,pn.stringToNamedTypeNode)(fn.SUBSCRIPTION_FIELD_CONDITION)},{kind:sn.Kind.INPUT_VALUE_DEFINITION,name:(0,pn.stringToNameNode)(fn.OR_UPPER),type:{kind:sn.Kind.LIST_TYPE,type:{kind:sn.Kind.NON_NULL_TYPE,type:(0,pn.stringToNamedTypeNode)(fn.SUBSCRIPTION_FILTER_CONDITION)}}},{kind:sn.Kind.INPUT_VALUE_DEFINITION,name:(0,pn.stringToNameNode)(fn.NOT_UPPER),type:(0,pn.stringToNamedTypeNode)(fn.SUBSCRIPTION_FILTER_CONDITION)}],kind:sn.Kind.INPUT_OBJECT_TYPE_DEFINITION,name:(0,pn.stringToNameNode)(fn.SUBSCRIPTION_FILTER_CONDITION)};_r.SUBSCRIPTION_FILTER_VALUE_DEFINITION={kind:sn.Kind.SCALAR_TYPE_DEFINITION,name:(0,pn.stringToNameNode)(fn.SUBSCRIPTION_FILTER_VALUE)}});var gd=F(ar=>{"use strict";m();T();N();Object.defineProperty(ar,"__esModule",{value:!0});ar.CLIENT_PERSISTED_DIRECTIVE_NAMES=ar.IGNORED_FEDERATED_TYPE_NAMES=ar.DEPENDENCIES_BY_DIRECTIVE_NAME=ar.COMPOSITE_OUTPUT_NODE_KINDS=ar.SUBSCRIPTION_FILTER_LIST_INPUT_NAMES=ar.SUBSCRIPTION_FILTER_INPUT_NAMES=ar.STREAM_CONFIGURATION_FIELD_NAMES=ar.EVENT_DIRECTIVE_NAMES=ar.TYPE_SYSTEM_DIRECTIVE_LOCATIONS=void 0;var at=Zn(),VE=Oe(),Da=qE();ar.TYPE_SYSTEM_DIRECTIVE_LOCATIONS=new Set([at.ARGUMENT_DEFINITION_UPPER,at.ENUM_UPPER,at.ENUM_VALUE_UPPER,at.FIELD_DEFINITION_UPPER,at.INPUT_FIELD_DEFINITION_UPPER,at.INPUT_OBJECT_UPPER,at.INTERFACE_UPPER,at.OBJECT_UPPER,at.SCALAR_UPPER,at.SCHEMA_UPPER,at.UNION_UPPER]);ar.EVENT_DIRECTIVE_NAMES=new Set([at.EDFS_KAFKA_PUBLISH,at.EDFS_KAFKA_SUBSCRIBE,at.EDFS_NATS_PUBLISH,at.EDFS_NATS_REQUEST,at.EDFS_NATS_SUBSCRIBE,at.EDFS_REDIS_PUBLISH,at.EDFS_REDIS_SUBSCRIBE]);ar.STREAM_CONFIGURATION_FIELD_NAMES=new Set([at.CONSUMER_INACTIVE_THRESHOLD,at.CONSUMER_NAME,at.STREAM_NAME]);ar.SUBSCRIPTION_FILTER_INPUT_NAMES=new Set([at.AND_UPPER,at.IN_UPPER,at.NOT_UPPER,at.OR_UPPER]);ar.SUBSCRIPTION_FILTER_LIST_INPUT_NAMES=new Set([at.AND_UPPER,at.OR_UPPER]);ar.COMPOSITE_OUTPUT_NODE_KINDS=new Set([VE.Kind.INTERFACE_TYPE_DEFINITION,VE.Kind.INTERFACE_TYPE_EXTENSION,VE.Kind.OBJECT_TYPE_DEFINITION,VE.Kind.OBJECT_TYPE_EXTENSION]);ar.DEPENDENCIES_BY_DIRECTIVE_NAME=new Map([[at.CONNECT_FIELD_RESOLVER,[Da.FIELD_SET_SCALAR_DEFINITION]],[at.EDFS_NATS_SUBSCRIBE,[Da.EDFS_NATS_STREAM_CONFIGURATION_DEFINITION]],[at.KEY,[Da.FIELD_SET_SCALAR_DEFINITION]],[at.LINK,[Da.LINK_IMPORT_DEFINITION,Da.LINK_PURPOSE_DEFINITION]],[at.PROVIDES,[Da.FIELD_SET_SCALAR_DEFINITION]],[at.REQUIRES,[Da.FIELD_SET_SCALAR_DEFINITION]],[at.REQUIRES_SCOPES,[Da.SCOPE_SCALAR_DEFINITION]],[at.SUBSCRIPTION_FILTER,[Da.SUBSCRIPTION_FIELD_CONDITION_DEFINITION,Da.SUBSCRIPTION_FILTER_CONDITION_DEFINITION,Da.SUBSCRIPTION_FILTER_VALUE_DEFINITION]]]);ar.IGNORED_FEDERATED_TYPE_NAMES=new Set([at.BOOLEAN_SCALAR,at.EDFS_NATS_STREAM_CONFIGURATION,at.FIELD_SET_SCALAR,at.ID_SCALAR,at.INT_SCALAR,at.FLOAT_SCALAR,at.LINK_IMPORT,at.LINK_PURPOSE,at.STRING_SCALAR,at.SUBSCRIPTION_FIELD_CONDITION,at.SUBSCRIPTION_FILTER_CONDITION,at.SUBSCRIPTION_FILTER_VALUE]);ar.CLIENT_PERSISTED_DIRECTIVE_NAMES=new Set([at.DEPRECATED,at.ONE_OF,at.SEMANTIC_NON_NULL])});var aa=F((dD,vx)=>{"use strict";m();T();N();var Of=function(e){return e&&e.Math===Math&&e};vx.exports=Of(typeof globalThis=="object"&&globalThis)||Of(typeof window=="object"&&window)||Of(typeof self=="object"&&self)||Of(typeof global=="object"&&global)||Of(typeof dD=="object"&&dD)||function(){return this}()||Function("return this")()});var Ms=F((eLe,Sx)=>{"use strict";m();T();N();Sx.exports=function(e){try{return!!e()}catch(t){return!0}}});var ju=F((iLe,Ox)=>{"use strict";m();T();N();var que=Ms();Ox.exports=!que(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var pD=F((uLe,Dx)=>{"use strict";m();T();N();var Vue=Ms();Dx.exports=!Vue(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")})});var Yc=F((pLe,bx)=>{"use strict";m();T();N();var Kue=pD(),KE=Function.prototype.call;bx.exports=Kue?KE.bind(KE):function(){return KE.apply(KE,arguments)}});var Fx=F(Px=>{"use strict";m();T();N();var Ax={}.propertyIsEnumerable,Rx=Object.getOwnPropertyDescriptor,jue=Rx&&!Ax.call({1:2},1);Px.f=jue?function(t){var n=Rx(this,t);return!!n&&n.enumerable}:Ax});var fD=F((ILe,Lx)=>{"use strict";m();T();N();Lx.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}});var Di=F((SLe,Ux)=>{"use strict";m();T();N();var wx=pD(),Cx=Function.prototype,mD=Cx.call,$ue=wx&&Cx.bind.bind(mD,mD);Ux.exports=wx?$ue:function(e){return function(){return mD.apply(e,arguments)}}});var Mx=F((ALe,kx)=>{"use strict";m();T();N();var Bx=Di(),Gue=Bx({}.toString),Que=Bx("".slice);kx.exports=function(e){return Que(Gue(e),8,-1)}});var qx=F((LLe,xx)=>{"use strict";m();T();N();var Yue=Di(),Jue=Ms(),Hue=Mx(),ND=Object,zue=Yue("".split);xx.exports=Jue(function(){return!ND("z").propertyIsEnumerable(0)})?function(e){return Hue(e)==="String"?zue(e,""):ND(e)}:ND});var TD=F((BLe,Vx)=>{"use strict";m();T();N();Vx.exports=function(e){return e==null}});var ED=F((qLe,Kx)=>{"use strict";m();T();N();var Wue=TD(),Xue=TypeError;Kx.exports=function(e){if(Wue(e))throw new Xue("Can't call method on "+e);return e}});var jE=F(($Le,jx)=>{"use strict";m();T();N();var Zue=qx(),ece=ED();jx.exports=function(e){return Zue(ece(e))}});var ba=F((JLe,$x)=>{"use strict";m();T();N();var hD=typeof document=="object"&&document.all;$x.exports=typeof hD=="undefined"&&hD!==void 0?function(e){return typeof e=="function"||e===hD}:function(e){return typeof e=="function"}});var _d=F((XLe,Gx)=>{"use strict";m();T();N();var tce=ba();Gx.exports=function(e){return typeof e=="object"?e!==null:tce(e)}});var $E=F((nwe,Qx)=>{"use strict";m();T();N();var yD=aa(),nce=ba(),rce=function(e){return nce(e)?e:void 0};Qx.exports=function(e,t){return arguments.length<2?rce(yD[e]):yD[e]&&yD[e][t]}});var Jx=F((swe,Yx)=>{"use strict";m();T();N();var ice=Di();Yx.exports=ice({}.isPrototypeOf)});var Xx=F((lwe,Wx)=>{"use strict";m();T();N();var ace=aa(),Hx=ace.navigator,zx=Hx&&Hx.userAgent;Wx.exports=zx?String(zx):""});var aq=F((mwe,iq)=>{"use strict";m();T();N();var rq=aa(),ID=Xx(),Zx=rq.process,eq=rq.Deno,tq=Zx&&Zx.versions||eq&&eq.version,nq=tq&&tq.v8,Aa,GE;nq&&(Aa=nq.split("."),GE=Aa[0]>0&&Aa[0]<4?1:+(Aa[0]+Aa[1]));!GE&&ID&&(Aa=ID.match(/Edge\/(\d+)/),(!Aa||Aa[1]>=74)&&(Aa=ID.match(/Chrome\/(\d+)/),Aa&&(GE=+Aa[1])));iq.exports=GE});var gD=F((hwe,oq)=>{"use strict";m();T();N();var sq=aq(),sce=Ms(),oce=aa(),uce=oce.String;oq.exports=!!Object.getOwnPropertySymbols&&!sce(function(){var e=Symbol("symbol detection");return!uce(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&sq&&sq<41})});var _D=F((_we,uq)=>{"use strict";m();T();N();var cce=gD();uq.exports=cce&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var vD=F((Dwe,cq)=>{"use strict";m();T();N();var lce=$E(),dce=ba(),pce=Jx(),fce=_D(),mce=Object;cq.exports=fce?function(e){return typeof e=="symbol"}:function(e){var t=lce("Symbol");return dce(t)&&pce(t.prototype,mce(e))}});var dq=F((Pwe,lq)=>{"use strict";m();T();N();var Nce=String;lq.exports=function(e){try{return Nce(e)}catch(t){return"Object"}}});var QE=F((Cwe,pq)=>{"use strict";m();T();N();var Tce=ba(),Ece=dq(),hce=TypeError;pq.exports=function(e){if(Tce(e))return e;throw new hce(Ece(e)+" is not a function")}});var SD=F((Mwe,fq)=>{"use strict";m();T();N();var yce=QE(),Ice=TD();fq.exports=function(e,t){var n=e[t];return Ice(n)?void 0:yce(n)}});var Nq=F((Kwe,mq)=>{"use strict";m();T();N();var OD=Yc(),DD=ba(),bD=_d(),gce=TypeError;mq.exports=function(e,t){var n,r;if(t==="string"&&DD(n=e.toString)&&!bD(r=OD(n,e))||DD(n=e.valueOf)&&!bD(r=OD(n,e))||t!=="string"&&DD(n=e.toString)&&!bD(r=OD(n,e)))return r;throw new gce("Can't convert object to primitive value")}});var Eq=F((Qwe,Tq)=>{"use strict";m();T();N();Tq.exports=!1});var YE=F((zwe,yq)=>{"use strict";m();T();N();var hq=aa(),_ce=Object.defineProperty;yq.exports=function(e,t){try{_ce(hq,e,{value:t,configurable:!0,writable:!0})}catch(n){hq[e]=t}return t}});var JE=F((eCe,_q)=>{"use strict";m();T();N();var vce=Eq(),Sce=aa(),Oce=YE(),Iq="__core-js_shared__",gq=_q.exports=Sce[Iq]||Oce(Iq,{});(gq.versions||(gq.versions=[])).push({version:"3.41.0",mode:vce?"pure":"global",copyright:"\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var AD=F((iCe,Sq)=>{"use strict";m();T();N();var vq=JE();Sq.exports=function(e,t){return vq[e]||(vq[e]=t||{})}});var Dq=F((uCe,Oq)=>{"use strict";m();T();N();var Dce=ED(),bce=Object;Oq.exports=function(e){return bce(Dce(e))}});var $u=F((pCe,bq)=>{"use strict";m();T();N();var Ace=Di(),Rce=Dq(),Pce=Ace({}.hasOwnProperty);bq.exports=Object.hasOwn||function(t,n){return Pce(Rce(t),n)}});var RD=F((TCe,Aq)=>{"use strict";m();T();N();var Fce=Di(),Lce=0,wce=Math.random(),Cce=Fce(1 .toString);Aq.exports=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Cce(++Lce+wce,36)}});var Fq=F((ICe,Pq)=>{"use strict";m();T();N();var Uce=aa(),Bce=AD(),Rq=$u(),kce=RD(),Mce=gD(),xce=_D(),vd=Uce.Symbol,PD=Bce("wks"),qce=xce?vd.for||vd:vd&&vd.withoutSetter||kce;Pq.exports=function(e){return Rq(PD,e)||(PD[e]=Mce&&Rq(vd,e)?vd[e]:qce("Symbol."+e)),PD[e]}});var Uq=F((SCe,Cq)=>{"use strict";m();T();N();var Vce=Yc(),Lq=_d(),wq=vD(),Kce=SD(),jce=Nq(),$ce=Fq(),Gce=TypeError,Qce=$ce("toPrimitive");Cq.exports=function(e,t){if(!Lq(e)||wq(e))return e;var n=Kce(e,Qce),r;if(n){if(t===void 0&&(t="default"),r=Vce(n,e,t),!Lq(r)||wq(r))return r;throw new Gce("Can't convert object to primitive value")}return t===void 0&&(t="number"),jce(e,t)}});var FD=F((ACe,Bq)=>{"use strict";m();T();N();var Yce=Uq(),Jce=vD();Bq.exports=function(e){var t=Yce(e,"string");return Jce(t)?t:t+""}});var xq=F((LCe,Mq)=>{"use strict";m();T();N();var Hce=aa(),kq=_d(),LD=Hce.document,zce=kq(LD)&&kq(LD.createElement);Mq.exports=function(e){return zce?LD.createElement(e):{}}});var wD=F((BCe,qq)=>{"use strict";m();T();N();var Wce=ju(),Xce=Ms(),Zce=xq();qq.exports=!Wce&&!Xce(function(){return Object.defineProperty(Zce("div"),"a",{get:function(){return 7}}).a!==7})});var CD=F(Kq=>{"use strict";m();T();N();var ele=ju(),tle=Yc(),nle=Fx(),rle=fD(),ile=jE(),ale=FD(),sle=$u(),ole=wD(),Vq=Object.getOwnPropertyDescriptor;Kq.f=ele?Vq:function(t,n){if(t=ile(t),n=ale(n),ole)try{return Vq(t,n)}catch(r){}if(sle(t,n))return rle(!tle(nle.f,t,n),t[n])}});var $q=F(($Ce,jq)=>{"use strict";m();T();N();var ule=ju(),cle=Ms();jq.exports=ule&&cle(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var Df=F((JCe,Gq)=>{"use strict";m();T();N();var lle=_d(),dle=String,ple=TypeError;Gq.exports=function(e){if(lle(e))return e;throw new ple(dle(e)+" is not an object")}});var zE=F(Yq=>{"use strict";m();T();N();var fle=ju(),mle=wD(),Nle=$q(),HE=Df(),Qq=FD(),Tle=TypeError,UD=Object.defineProperty,Ele=Object.getOwnPropertyDescriptor,BD="enumerable",kD="configurable",MD="writable";Yq.f=fle?Nle?function(t,n,r){if(HE(t),n=Qq(n),HE(r),typeof t=="function"&&n==="prototype"&&"value"in r&&MD in r&&!r[MD]){var i=Ele(t,n);i&&i[MD]&&(t[n]=r.value,r={configurable:kD in r?r[kD]:i[kD],enumerable:BD in r?r[BD]:i[BD],writable:!1})}return UD(t,n,r)}:UD:function(t,n,r){if(HE(t),n=Qq(n),HE(r),mle)try{return UD(t,n,r)}catch(i){}if("get"in r||"set"in r)throw new Tle("Accessors not supported");return"value"in r&&(t[n]=r.value),t}});var xD=F((nUe,Jq)=>{"use strict";m();T();N();var hle=ju(),yle=zE(),Ile=fD();Jq.exports=hle?function(e,t,n){return yle.f(e,t,Ile(1,n))}:function(e,t,n){return e[t]=n,e}});var Wq=F((sUe,zq)=>{"use strict";m();T();N();var qD=ju(),gle=$u(),Hq=Function.prototype,_le=qD&&Object.getOwnPropertyDescriptor,VD=gle(Hq,"name"),vle=VD&&function(){}.name==="something",Sle=VD&&(!qD||qD&&_le(Hq,"name").configurable);zq.exports={EXISTS:VD,PROPER:vle,CONFIGURABLE:Sle}});var Zq=F((lUe,Xq)=>{"use strict";m();T();N();var Ole=Di(),Dle=ba(),KD=JE(),ble=Ole(Function.toString);Dle(KD.inspectSource)||(KD.inspectSource=function(e){return ble(e)});Xq.exports=KD.inspectSource});var nV=F((mUe,tV)=>{"use strict";m();T();N();var Ale=aa(),Rle=ba(),eV=Ale.WeakMap;tV.exports=Rle(eV)&&/native code/.test(String(eV))});var aV=F((hUe,iV)=>{"use strict";m();T();N();var Ple=AD(),Fle=RD(),rV=Ple("keys");iV.exports=function(e){return rV[e]||(rV[e]=Fle(e))}});var jD=F((_Ue,sV)=>{"use strict";m();T();N();sV.exports={}});var lV=F((DUe,cV)=>{"use strict";m();T();N();var Lle=nV(),uV=aa(),wle=_d(),Cle=xD(),$D=$u(),GD=JE(),Ule=aV(),Ble=jD(),oV="Object already initialized",QD=uV.TypeError,kle=uV.WeakMap,WE,bf,XE,Mle=function(e){return XE(e)?bf(e):WE(e,{})},xle=function(e){return function(t){var n;if(!wle(t)||(n=bf(t)).type!==e)throw new QD("Incompatible receiver, "+e+" required");return n}};Lle||GD.state?(Ra=GD.state||(GD.state=new kle),Ra.get=Ra.get,Ra.has=Ra.has,Ra.set=Ra.set,WE=function(e,t){if(Ra.has(e))throw new QD(oV);return t.facade=e,Ra.set(e,t),t},bf=function(e){return Ra.get(e)||{}},XE=function(e){return Ra.has(e)}):(Jc=Ule("state"),Ble[Jc]=!0,WE=function(e,t){if($D(e,Jc))throw new QD(oV);return t.facade=e,Cle(e,Jc,t),t},bf=function(e){return $D(e,Jc)?e[Jc]:{}},XE=function(e){return $D(e,Jc)});var Ra,Jc;cV.exports={set:WE,get:bf,has:XE,enforce:Mle,getterFor:xle}});var mV=F((PUe,fV)=>{"use strict";m();T();N();var JD=Di(),qle=Ms(),Vle=ba(),ZE=$u(),YD=ju(),Kle=Wq().CONFIGURABLE,jle=Zq(),pV=lV(),$le=pV.enforce,Gle=pV.get,dV=String,eh=Object.defineProperty,Qle=JD("".slice),Yle=JD("".replace),Jle=JD([].join),Hle=YD&&!qle(function(){return eh(function(){},"length",{value:8}).length!==8}),zle=String(String).split("String"),Wle=fV.exports=function(e,t,n){Qle(dV(t),0,7)==="Symbol("&&(t="["+Yle(dV(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!ZE(e,"name")||Kle&&e.name!==t)&&(YD?eh(e,"name",{value:t,configurable:!0}):e.name=t),Hle&&n&&ZE(n,"arity")&&e.length!==n.arity&&eh(e,"length",{value:n.arity});try{n&&ZE(n,"constructor")&&n.constructor?YD&&eh(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(i){}var r=$le(e);return ZE(r,"source")||(r.source=Jle(zle,typeof t=="string"?t:"")),e};Function.prototype.toString=Wle(function(){return Vle(this)&&Gle(this).source||jle(this)},"toString")});var TV=F((CUe,NV)=>{"use strict";m();T();N();var Xle=ba(),Zle=zE(),ede=mV(),tde=YE();NV.exports=function(e,t,n,r){r||(r={});var i=r.enumerable,a=r.name!==void 0?r.name:t;if(Xle(n)&&ede(n,a,r),r.global)i?e[t]=n:tde(t,n);else{try{r.unsafe?e[t]&&(i=!0):delete e[t]}catch(o){}i?e[t]=n:Zle.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e}});var hV=F((MUe,EV)=>{"use strict";m();T();N();var nde=Math.ceil,rde=Math.floor;EV.exports=Math.trunc||function(t){var n=+t;return(n>0?rde:nde)(n)}});var th=F((KUe,yV)=>{"use strict";m();T();N();var ide=hV();yV.exports=function(e){var t=+e;return t!==t||t===0?0:ide(t)}});var gV=F((QUe,IV)=>{"use strict";m();T();N();var ade=th(),sde=Math.max,ode=Math.min;IV.exports=function(e,t){var n=ade(e);return n<0?sde(n+t,0):ode(n,t)}});var vV=F((zUe,_V)=>{"use strict";m();T();N();var ude=th(),cde=Math.min;_V.exports=function(e){var t=ude(e);return t>0?cde(t,9007199254740991):0}});var OV=F((eBe,SV)=>{"use strict";m();T();N();var lde=vV();SV.exports=function(e){return lde(e.length)}});var AV=F((iBe,bV)=>{"use strict";m();T();N();var dde=jE(),pde=gV(),fde=OV(),DV=function(e){return function(t,n,r){var i=dde(t),a=fde(i);if(a===0)return!e&&-1;var o=pde(r,a),u;if(e&&n!==n){for(;a>o;)if(u=i[o++],u!==u)return!0}else for(;a>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}};bV.exports={includes:DV(!0),indexOf:DV(!1)}});var FV=F((uBe,PV)=>{"use strict";m();T();N();var mde=Di(),HD=$u(),Nde=jE(),Tde=AV().indexOf,Ede=jD(),RV=mde([].push);PV.exports=function(e,t){var n=Nde(e),r=0,i=[],a;for(a in n)!HD(Ede,a)&&HD(n,a)&&RV(i,a);for(;t.length>r;)HD(n,a=t[r++])&&(~Tde(i,a)||RV(i,a));return i}});var wV=F((pBe,LV)=>{"use strict";m();T();N();LV.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var UV=F(CV=>{"use strict";m();T();N();var hde=FV(),yde=wV(),Ide=yde.concat("length","prototype");CV.f=Object.getOwnPropertyNames||function(t){return hde(t,Ide)}});var kV=F(BV=>{"use strict";m();T();N();BV.f=Object.getOwnPropertySymbols});var xV=F((SBe,MV)=>{"use strict";m();T();N();var gde=$E(),_de=Di(),vde=UV(),Sde=kV(),Ode=Df(),Dde=_de([].concat);MV.exports=gde("Reflect","ownKeys")||function(t){var n=vde.f(Ode(t)),r=Sde.f;return r?Dde(n,r(t)):n}});var KV=F((ABe,VV)=>{"use strict";m();T();N();var qV=$u(),bde=xV(),Ade=CD(),Rde=zE();VV.exports=function(e,t,n){for(var r=bde(t),i=Rde.f,a=Ade.f,o=0;o{"use strict";m();T();N();var Pde=Ms(),Fde=ba(),Lde=/#|\.prototype\./,Af=function(e,t){var n=Cde[wde(e)];return n===Bde?!0:n===Ude?!1:Fde(t)?Pde(t):!!t},wde=Af.normalize=function(e){return String(e).replace(Lde,".").toLowerCase()},Cde=Af.data={},Ude=Af.NATIVE="N",Bde=Af.POLYFILL="P";jV.exports=Af});var zD=F((BBe,GV)=>{"use strict";m();T();N();var nh=aa(),kde=CD().f,Mde=xD(),xde=TV(),qde=YE(),Vde=KV(),Kde=$V();GV.exports=function(e,t){var n=e.target,r=e.global,i=e.stat,a,o,u,l,d,p;if(r?o=nh:i?o=nh[n]||qde(n,{}):o=nh[n]&&nh[n].prototype,o)for(u in t){if(d=t[u],e.dontCallGetSet?(p=kde(o,u),l=p&&p.value):l=o[u],a=Kde(r?u:n+(i?".":"#")+u,e.forced),!a&&l!==void 0){if(typeof d==typeof l)continue;Vde(d,l)}(e.sham||l&&l.sham)&&Mde(d,"sham",!0),xde(o,u,d,e)}}});var Rf=F((qBe,QV)=>{"use strict";m();T();N();var WD=Di(),rh=Set.prototype;QV.exports={Set,add:WD(rh.add),has:WD(rh.has),remove:WD(rh.delete),proto:rh}});var XD=F(($Be,YV)=>{"use strict";m();T();N();var jde=Rf().has;YV.exports=function(e){return jde(e),e}});var HV=F((JBe,JV)=>{"use strict";m();T();N();var $de=Di(),Gde=QE();JV.exports=function(e,t,n){try{return $de(Gde(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(r){}}});var ZD=F((XBe,zV)=>{"use strict";m();T();N();var Qde=HV(),Yde=Rf();zV.exports=Qde(Yde.proto,"size","get")||function(e){return e.size}});var eb=F((nke,WV)=>{"use strict";m();T();N();var Jde=Yc();WV.exports=function(e,t,n){for(var r=n?e:e.iterator,i=e.next,a,o;!(a=Jde(i,r)).done;)if(o=t(a.value),o!==void 0)return o}});var rK=F((ske,nK)=>{"use strict";m();T();N();var XV=Di(),Hde=eb(),ZV=Rf(),zde=ZV.Set,eK=ZV.proto,Wde=XV(eK.forEach),tK=XV(eK.keys),Xde=tK(new zde).next;nK.exports=function(e,t,n){return n?Hde({iterator:tK(e),next:Xde},t):Wde(e,t)}});var aK=F((lke,iK)=>{"use strict";m();T();N();iK.exports=function(e){return{iterator:e,next:e.next,done:!1}}});var tb=F((mke,dK)=>{"use strict";m();T();N();var sK=QE(),cK=Df(),oK=Yc(),Zde=th(),epe=aK(),uK="Invalid size",tpe=RangeError,npe=TypeError,rpe=Math.max,lK=function(e,t){this.set=e,this.size=rpe(t,0),this.has=sK(e.has),this.keys=sK(e.keys)};lK.prototype={getIterator:function(){return epe(cK(oK(this.keys,this.set)))},includes:function(e){return oK(this.has,this.set,e)}};dK.exports=function(e){cK(e);var t=+e.size;if(t!==t)throw new npe(uK);var n=Zde(t);if(n<0)throw new tpe(uK);return new lK(e,n)}});var fK=F((hke,pK)=>{"use strict";m();T();N();var ipe=XD(),ape=ZD(),spe=rK(),ope=tb();pK.exports=function(t){var n=ipe(this),r=ope(t);return ape(n)>r.size?!1:spe(n,function(i){if(!r.includes(i))return!1},!0)!==!1}});var nb=F((_ke,TK)=>{"use strict";m();T();N();var upe=$E(),mK=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},NK=function(e){return{size:e,has:function(){return!0},keys:function(){throw new Error("e")}}};TK.exports=function(e,t){var n=upe("Set");try{new n()[e](mK(0));try{return new n()[e](mK(-1)),!1}catch(i){if(!t)return!0;try{return new n()[e](NK(-1/0)),!1}catch(a){var r=new n;return r.add(1),r.add(2),t(r[e](NK(1/0)))}}}catch(i){return!1}}});var EK=F(()=>{"use strict";m();T();N();var cpe=zD(),lpe=fK(),dpe=nb(),ppe=!dpe("isSubsetOf",function(e){return e});cpe({target:"Set",proto:!0,real:!0,forced:ppe},{isSubsetOf:lpe})});var hK=F(()=>{"use strict";m();T();N();EK()});var gK=F((Bke,IK)=>{"use strict";m();T();N();var fpe=Yc(),yK=Df(),mpe=SD();IK.exports=function(e,t,n){var r,i;yK(e);try{if(r=mpe(e,"return"),!r){if(t==="throw")throw n;return n}r=fpe(r,e)}catch(a){i=!0,r=a}if(t==="throw")throw n;if(i)throw r;return yK(r),n}});var vK=F((qke,_K)=>{"use strict";m();T();N();var Npe=XD(),Tpe=Rf().has,Epe=ZD(),hpe=tb(),ype=eb(),Ipe=gK();_K.exports=function(t){var n=Npe(this),r=hpe(t);if(Epe(n){"use strict";m();T();N();var gpe=zD(),_pe=vK(),vpe=nb(),Spe=!vpe("isSupersetOf",function(e){return!e});gpe({target:"Set",proto:!0,real:!0,forced:Spe},{isSupersetOf:_pe})});var OK=F(()=>{"use strict";m();T();N();SK()});var Pf=F(Bn=>{"use strict";m();T();N();Object.defineProperty(Bn,"__esModule",{value:!0});Bn.subtractSet=Dpe;Bn.mapToArrayOfValues=bpe;Bn.kindToConvertedTypeString=Ape;Bn.fieldDatasToSimpleFieldDatas=Rpe;Bn.isNodeLeaf=Ppe;Bn.newEntityInterfaceFederationData=Fpe;Bn.upsertEntityInterfaceFederationData=Lpe;Bn.upsertEntityData=Cpe;Bn.updateEntityData=DK;Bn.newFieldAuthorizationData=Upe;Bn.newAuthorizationData=Bpe;Bn.addScopes=rb;Bn.mergeRequiredScopesByAND=sh;Bn.mergeRequiredScopesByOR=ib;Bn.upsertFieldAuthorizationData=bK;Bn.upsertAuthorizationData=xpe;Bn.upsertAuthorizationConfiguration=qpe;Bn.isObjectNodeKind=Vpe;Bn.isCompositeOutputNodeKind=Kpe;Bn.isObjectDefinitionData=jpe;Bn.getNodeCoords=$pe;var Wt=Oe(),fi=Zn(),ih=Mr(),ah=ku();hK();OK();var Ope=gd();function Dpe(e,t){for(let n of e)t.delete(n)}function bpe(e){let t=[];for(let n of e.values())t.push(n);return t}function Ape(e){switch(e){case Wt.Kind.BOOLEAN:return fi.BOOLEAN_SCALAR;case Wt.Kind.ENUM:case Wt.Kind.ENUM_TYPE_DEFINITION:case Wt.Kind.ENUM_TYPE_EXTENSION:return fi.ENUM;case Wt.Kind.ENUM_VALUE_DEFINITION:return fi.ENUM_VALUE;case Wt.Kind.FIELD_DEFINITION:return fi.FIELD;case Wt.Kind.FLOAT:return fi.FLOAT_SCALAR;case Wt.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Wt.Kind.INPUT_OBJECT_TYPE_EXTENSION:return fi.INPUT_OBJECT;case Wt.Kind.INPUT_VALUE_DEFINITION:return fi.INPUT_VALUE;case Wt.Kind.INT:return fi.INT_SCALAR;case Wt.Kind.INTERFACE_TYPE_DEFINITION:case Wt.Kind.INTERFACE_TYPE_EXTENSION:return fi.INTERFACE;case Wt.Kind.NULL:return fi.NULL;case Wt.Kind.OBJECT:case Wt.Kind.OBJECT_TYPE_DEFINITION:case Wt.Kind.OBJECT_TYPE_EXTENSION:return fi.OBJECT;case Wt.Kind.STRING:return fi.STRING_SCALAR;case Wt.Kind.SCALAR_TYPE_DEFINITION:case Wt.Kind.SCALAR_TYPE_EXTENSION:return fi.SCALAR;case Wt.Kind.UNION_TYPE_DEFINITION:case Wt.Kind.UNION_TYPE_EXTENSION:return fi.UNION;default:return e}}function Rpe(e){let t=[];for(let{name:n,namedTypeName:r}of e)t.push({name:n,namedTypeName:r});return t}function Ppe(e){if(!e)return!0;switch(e){case Wt.Kind.OBJECT_TYPE_DEFINITION:case Wt.Kind.INTERFACE_TYPE_DEFINITION:case Wt.Kind.UNION_TYPE_DEFINITION:return!1;default:return!0}}function Fpe(e,t){return{concreteTypeNames:new Set(e.concreteTypeNames),fieldDatasBySubgraphName:new Map([[t,e.fieldDatas]]),interfaceFieldNames:new Set(e.interfaceFieldNames),interfaceObjectFieldNames:new Set(e.interfaceObjectFieldNames),interfaceObjectSubgraphNames:new Set(e.isInterfaceObject?[t]:[]),subgraphDataByTypeName:new Map([[t,e]]),typeName:e.typeName}}function Lpe(e,t,n){(0,ih.addIterableToSet)({source:t.concreteTypeNames,target:e.concreteTypeNames}),e.subgraphDataByTypeName.set(n,t),e.fieldDatasBySubgraphName.set(n,t.fieldDatas),(0,ih.addIterableToSet)({source:t.interfaceFieldNames,target:e.interfaceFieldNames}),(0,ih.addIterableToSet)({source:t.interfaceObjectFieldNames,target:e.interfaceObjectFieldNames}),t.isInterfaceObject&&e.interfaceObjectSubgraphNames.add(n)}function wpe({keyFieldSetDataByFieldSet:e,subgraphName:t,typeName:n}){let r=new Map([[t,e]]),i=new Map;for(let[a,{documentNode:o,isUnresolvable:u}]of e)u||i.set(a,o);return{keyFieldSetDatasBySubgraphName:r,documentNodeByKeyFieldSet:i,keyFieldSets:new Set,subgraphNames:new Set([t]),typeName:n}}function Cpe({entityDataByTypeName:e,keyFieldSetDataByFieldSet:t,subgraphName:n,typeName:r}){let i=e.get(r);i?DK({entityData:i,keyFieldSetDataByFieldSet:t,subgraphName:n}):e.set(r,wpe({keyFieldSetDataByFieldSet:t,subgraphName:n,typeName:r}))}function DK({entityData:e,keyFieldSetDataByFieldSet:t,subgraphName:n}){e.subgraphNames.add(n);let r=e.keyFieldSetDatasBySubgraphName.get(n);if(!r){e.keyFieldSetDatasBySubgraphName.set(n,t);for(let[i,{documentNode:a,isUnresolvable:o}]of t)o||e.documentNodeByKeyFieldSet.set(i,a);return}for(let[i,a]of t){a.isUnresolvable||e.documentNodeByKeyFieldSet.set(i,a.documentNode);let o=r.get(i);if(o){o.isUnresolvable||(o.isUnresolvable=a.isUnresolvable);continue}r.set(i,a)}}function Upe(e){return{fieldName:e,inheritedData:{requiredScopes:[],requiredScopesByOR:[],requiresAuthentication:!1},originalData:{requiredScopes:[],requiresAuthentication:!1}}}function Bpe(e){return{fieldAuthDataByFieldName:new Map,requiredScopes:[],requiredScopesByOR:[],requiresAuthentication:!1,typeName:e}}function rb(e,t){for(let n=e.length-1;n>-1;n--){if(e[n].isSubsetOf(t))return;e[n].isSupersetOf(t)&&e.splice(n,1)}e.push(t)}function sh(e,t){if(e.length<1||t.length<1){for(let r of t)e.push(new Set(r));return e}let n=[];for(let r of t)for(let i of e){let a=(0,ih.addSets)(r,i);rb(n,a)}return n}function ib(e,t){for(let n of t)rb(e,n);return e.length<=ah.MAX_OR_SCOPES}function bK(e,t){var i,a;let n=t.fieldName,r=e.get(n);return r?((i=r.inheritedData).requiresAuthentication||(i.requiresAuthentication=t.inheritedData.requiresAuthentication),(a=r.originalData).requiresAuthentication||(a.requiresAuthentication=t.originalData.requiresAuthentication),!ib(r.inheritedData.requiredScopesByOR,t.inheritedData.requiredScopes)||r.inheritedData.requiredScopes.length*t.inheritedData.requiredScopes.length>ah.MAX_OR_SCOPES||r.originalData.requiredScopes.length*t.originalData.requiredScopes.length>ah.MAX_OR_SCOPES?!1:(r.inheritedData.requiredScopes=sh(r.inheritedData.requiredScopes,t.inheritedData.requiredScopes),r.originalData.requiredScopes=sh(r.originalData.requiredScopes,t.originalData.requiredScopes),!0)):(e.set(n,AK(t)),!0)}function kpe(e){let t=new Map;for(let[n,r]of e)t.set(n,AK(r));return t}function AK(e){return{fieldName:e.fieldName,inheritedData:{requiredScopes:[...e.inheritedData.requiredScopes],requiredScopesByOR:[...e.inheritedData.requiredScopes],requiresAuthentication:e.inheritedData.requiresAuthentication},originalData:{requiredScopes:[...e.originalData.requiredScopes],requiresAuthentication:e.originalData.requiresAuthentication}}}function Mpe(e){return{fieldAuthDataByFieldName:kpe(e.fieldAuthDataByFieldName),requiredScopes:[...e.requiredScopes],requiredScopesByOR:[...e.requiredScopes],requiresAuthentication:e.requiresAuthentication,typeName:e.typeName}}function xpe(e,t,n){let r=e.get(t.typeName);if(!r){e.set(t.typeName,Mpe(t));return}r.requiresAuthentication||(r.requiresAuthentication=t.requiresAuthentication),!ib(r.requiredScopesByOR,t.requiredScopes)||r.requiredScopes.length*t.requiredScopes.length>ah.MAX_OR_SCOPES?n.add(t.typeName):r.requiredScopes=sh(r.requiredScopes,t.requiredScopes);for(let[i,a]of t.fieldAuthDataByFieldName)bK(r.fieldAuthDataByFieldName,a)||n.add(`${t.typeName}.${i}`)}function qpe(e,t){let n=t.typeName;for(let[r,i]of t.fieldAuthDataByFieldName){let a=`${n}.${r}`,o=e.get(a);o?(o.requiresAuthentication=i.inheritedData.requiresAuthentication,o.requiredScopes=i.inheritedData.requiredScopes.map(u=>[...u]),o.requiredScopesByOR=i.inheritedData.requiredScopesByOR.map(u=>[...u])):e.set(a,{argumentNames:[],typeName:n,fieldName:r,requiresAuthentication:i.inheritedData.requiresAuthentication,requiredScopes:i.inheritedData.requiredScopes.map(u=>[...u]),requiredScopesByOR:i.inheritedData.requiredScopesByOR.map(u=>[...u])})}}function Vpe(e){return e===Wt.Kind.OBJECT_TYPE_DEFINITION||e===Wt.Kind.OBJECT_TYPE_EXTENSION}function Kpe(e){return Ope.COMPOSITE_OUTPUT_NODE_KINDS.has(e)}function jpe(e){return e?e.kind===Wt.Kind.OBJECT_TYPE_DEFINITION:!1}function $pe(e){switch(e.kind){case Wt.Kind.ARGUMENT:case Wt.Kind.FIELD_DEFINITION:case Wt.Kind.INPUT_VALUE_DEFINITION:case Wt.Kind.ENUM_VALUE_DEFINITION:return e.federatedCoords;default:return e.name}}});var ab=F(Pe=>{"use strict";m();T();N();Object.defineProperty(Pe,"__esModule",{value:!0});Pe.QUERY_CACHE_DEFINITION_DATA=Pe.IS_DEFINITION_DATA=Pe.ENTITY_CACHE_DEFINITION_DATA=Pe.CACHE_POPULATE_DEFINITION_DATA=Pe.CACHE_INVALIDATE_DEFINITION_DATA=Pe.TAG_DEFINITION_DATA=Pe.SUBSCRIPTION_FILTER_DEFINITION_DATA=Pe.SHAREABLE_DEFINITION_DATA=Pe.SPECIFIED_BY_DEFINITION_DATA=Pe.SEMANTIC_NON_NULL_DATA=Pe.REQUIRES_SCOPES_DEFINITION_DATA=Pe.REQUIRE_FETCH_REASONS_DEFINITION_DATA=Pe.REQUEST_SCOPED_DEFINITION_DATA=Pe.REDIS_SUBSCRIBE_DEFINITION_DATA=Pe.REDIS_PUBLISH_DEFINITION_DATA=Pe.REQUIRES_DEFINITION_DATA=Pe.PROVIDES_DEFINITION_DATA=Pe.LIST_SIZE_DEFINITION_DATA=Pe.LINK_DEFINITION_DATA=Pe.KEY_DEFINITION_DATA=Pe.OVERRIDE_DEFINITION_DATA=Pe.ONE_OF_DEFINITION_DATA=Pe.NATS_SUBSCRIBE_DEFINITION_DATA=Pe.NATS_REQUEST_DEFINITION_DATA=Pe.NATS_PUBLISH_DEFINITION_DATA=Pe.KAFKA_SUBSCRIBE_DEFINITION_DATA=Pe.KAFKA_PUBLISH_DEFINITION_DATA=Pe.INTERFACE_OBJECT_DEFINITION_DATA=Pe.INACCESSIBLE_DEFINITION_DATA=Pe.EXTERNAL_DEFINITION_DATA=Pe.EXTENDS_DEFINITION_DATA=Pe.DEPRECATED_DEFINITION_DATA=Pe.COST_DEFINITION_DATA=Pe.CONNECT_FIELD_RESOLVER_DEFINITION_DATA=Pe.CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION_DATA=Pe.CONFIGURE_DESCRIPTION_DEFINITION_DATA=Pe.COMPOSE_DIRECTIVE_DEFINITION_DATA=Pe.AUTHENTICATED_DEFINITION_DATA=void 0;var Fn=kr(),Et=Oe(),U=Zn(),At=nf(),En=MT();Pe.AUTHENTICATED_DEFINITION_DATA={argumentTypeNodeByName:new Map([]),isRepeatable:!1,locations:new Set([U.ENUM_UPPER,U.FIELD_DEFINITION_UPPER,U.INTERFACE_UPPER,U.OBJECT_UPPER,U.SCALAR_UPPER]),name:U.AUTHENTICATED,node:At.AUTHENTICATED_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};Pe.COMPOSE_DIRECTIVE_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.NAME,{name:U.NAME,typeNode:En.REQUIRED_STRING_TYPE_NODE}]]),isRepeatable:!0,locations:new Set([U.SCHEMA_UPPER]),name:U.COMPOSE_DIRECTIVE,node:At.COMPOSE_DIRECTIVE_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([U.NAME])};Pe.CONFIGURE_DESCRIPTION_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.PROPAGATE,{name:U.PROPAGATE,typeNode:{kind:Et.Kind.NON_NULL_TYPE,type:(0,Fn.stringToNamedTypeNode)(U.BOOLEAN_SCALAR)},defaultValue:{kind:Et.Kind.BOOLEAN,value:!0}}],[U.DESCRIPTION_OVERRIDE,{name:U.DESCRIPTION_OVERRIDE,typeNode:(0,Fn.stringToNamedTypeNode)(U.STRING_SCALAR)}]]),isRepeatable:!1,locations:new Set([U.ARGUMENT_DEFINITION_UPPER,U.ENUM_UPPER,U.ENUM_VALUE_UPPER,U.FIELD_DEFINITION_UPPER,U.INTERFACE_UPPER,U.INPUT_OBJECT_UPPER,U.INPUT_FIELD_DEFINITION_UPPER,U.OBJECT_UPPER,U.SCALAR_UPPER,U.SCHEMA_UPPER,U.UNION_UPPER]),name:U.CONFIGURE_DESCRIPTION,node:At.CONFIGURE_DESCRIPTION_DEFINITION,optionalArgumentNames:new Set([U.PROPAGATE,U.DESCRIPTION_OVERRIDE]),requiredArgumentNames:new Set};Pe.CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.PROPAGATE,{name:U.PROPAGATE,typeNode:{kind:Et.Kind.NON_NULL_TYPE,type:(0,Fn.stringToNamedTypeNode)(U.BOOLEAN_SCALAR)},defaultValue:{kind:Et.Kind.BOOLEAN,value:!0}}]]),isRepeatable:!1,locations:new Set([U.ENUM_UPPER,U.INPUT_OBJECT_UPPER,U.INTERFACE_UPPER,U.OBJECT_UPPER]),name:U.CONFIGURE_CHILD_DESCRIPTIONS,node:At.CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION,optionalArgumentNames:new Set([U.PROPAGATE]),requiredArgumentNames:new Set};Pe.CONNECT_FIELD_RESOLVER_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.CONTEXT,{name:U.CONTEXT,typeNode:En.REQUIRED_FIELDSET_TYPE_NODE}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.CONNECT_FIELD_RESOLVER,node:At.CONNECT_FIELD_RESOLVER_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([U.CONTEXT])};Pe.COST_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.WEIGHT,{name:U.WEIGHT,typeNode:{kind:Et.Kind.NON_NULL_TYPE,type:(0,Fn.stringToNamedTypeNode)(U.INT_SCALAR)}}]]),isRepeatable:!1,locations:new Set([U.ARGUMENT_DEFINITION_UPPER,U.ENUM_UPPER,U.FIELD_DEFINITION_UPPER,U.INPUT_FIELD_DEFINITION_UPPER,U.OBJECT_UPPER,U.SCALAR_UPPER]),name:U.COST,node:At.COST_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([U.WEIGHT])};Pe.DEPRECATED_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.REASON,{name:U.REASON,typeNode:(0,Fn.stringToNamedTypeNode)(U.STRING_SCALAR),defaultValue:{kind:Et.Kind.STRING,value:Et.DEFAULT_DEPRECATION_REASON}}]]),isRepeatable:!1,locations:new Set([U.ARGUMENT_DEFINITION_UPPER,U.ENUM_VALUE_UPPER,U.FIELD_DEFINITION_UPPER,U.INPUT_FIELD_DEFINITION_UPPER]),name:U.DEPRECATED,node:At.DEPRECATED_DEFINITION,optionalArgumentNames:new Set([U.REASON]),requiredArgumentNames:new Set};Pe.EXTENDS_DEFINITION_DATA={argumentTypeNodeByName:new Map,isRepeatable:!1,locations:new Set([U.INTERFACE_UPPER,U.OBJECT_UPPER]),name:U.EXTENDS,node:At.EXTENDS_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};Pe.EXTERNAL_DEFINITION_DATA={argumentTypeNodeByName:new Map,isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER,U.OBJECT_UPPER]),name:U.EXTERNAL,node:At.EXTERNAL_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};Pe.INACCESSIBLE_DEFINITION_DATA={argumentTypeNodeByName:new Map,isRepeatable:!1,locations:new Set([U.ARGUMENT_DEFINITION_UPPER,U.ENUM_UPPER,U.ENUM_VALUE_UPPER,U.FIELD_DEFINITION_UPPER,U.INPUT_FIELD_DEFINITION_UPPER,U.INPUT_OBJECT_UPPER,U.INTERFACE_UPPER,U.OBJECT_UPPER,U.SCALAR_UPPER,U.UNION_UPPER]),name:U.INACCESSIBLE,node:At.INACCESSIBLE_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};Pe.INTERFACE_OBJECT_DEFINITION_DATA={argumentTypeNodeByName:new Map,isRepeatable:!1,locations:new Set([U.OBJECT_UPPER]),name:U.INTERFACE_OBJECT,node:At.INTERFACE_OBJECT_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};Pe.KAFKA_PUBLISH_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.TOPIC,{name:U.TOPIC,typeNode:En.REQUIRED_STRING_TYPE_NODE}],[U.PROVIDER_ID,{name:U.PROVIDER_ID,typeNode:En.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:Et.Kind.STRING,value:U.DEFAULT_EDFS_PROVIDER_ID}}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.EDFS_KAFKA_PUBLISH,node:At.EDFS_KAFKA_PUBLISH_DEFINITION,optionalArgumentNames:new Set([U.PROVIDER_ID]),requiredArgumentNames:new Set([U.TOPIC])};Pe.KAFKA_SUBSCRIBE_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.TOPICS,{name:U.TOPICS,typeNode:{kind:Et.Kind.NON_NULL_TYPE,type:{kind:Et.Kind.LIST_TYPE,type:En.REQUIRED_STRING_TYPE_NODE}}}],[U.PROVIDER_ID,{name:U.PROVIDER_ID,typeNode:En.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:Et.Kind.STRING,value:U.DEFAULT_EDFS_PROVIDER_ID}}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.EDFS_KAFKA_SUBSCRIBE,node:At.EDFS_KAFKA_SUBSCRIBE_DEFINITION,optionalArgumentNames:new Set([U.PROVIDER_ID]),requiredArgumentNames:new Set([U.TOPICS])};Pe.NATS_PUBLISH_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.SUBJECT,{name:U.SUBJECT,typeNode:En.REQUIRED_STRING_TYPE_NODE}],[U.PROVIDER_ID,{name:U.PROVIDER_ID,typeNode:En.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:Et.Kind.STRING,value:U.DEFAULT_EDFS_PROVIDER_ID}}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.EDFS_NATS_PUBLISH,node:At.EDFS_NATS_PUBLISH_DEFINITION,optionalArgumentNames:new Set([U.PROVIDER_ID]),requiredArgumentNames:new Set([U.SUBJECT])};Pe.NATS_REQUEST_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.SUBJECT,{name:U.SUBJECT,typeNode:En.REQUIRED_STRING_TYPE_NODE}],[U.PROVIDER_ID,{name:U.PROVIDER_ID,typeNode:En.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:Et.Kind.STRING,value:U.DEFAULT_EDFS_PROVIDER_ID}}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.EDFS_NATS_REQUEST,node:At.EDFS_NATS_REQUEST_DEFINITION,optionalArgumentNames:new Set([U.PROVIDER_ID]),requiredArgumentNames:new Set([U.SUBJECT])};Pe.NATS_SUBSCRIBE_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.SUBJECTS,{name:U.SUBJECTS,typeNode:{kind:Et.Kind.NON_NULL_TYPE,type:{kind:Et.Kind.LIST_TYPE,type:En.REQUIRED_STRING_TYPE_NODE}}}],[U.PROVIDER_ID,{name:U.PROVIDER_ID,typeNode:En.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:Et.Kind.STRING,value:U.DEFAULT_EDFS_PROVIDER_ID}}],[U.STREAM_CONFIGURATION,{name:U.STREAM_CONFIGURATION,typeNode:(0,Fn.stringToNamedTypeNode)(U.EDFS_NATS_STREAM_CONFIGURATION)}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.EDFS_NATS_SUBSCRIBE,node:At.EDFS_NATS_SUBSCRIBE_DEFINITION,optionalArgumentNames:new Set([U.PROVIDER_ID,U.STREAM_CONFIGURATION]),requiredArgumentNames:new Set([U.SUBJECTS])};Pe.ONE_OF_DEFINITION_DATA={argumentTypeNodeByName:new Map([]),isRepeatable:!1,locations:new Set([U.INPUT_OBJECT_UPPER]),name:U.ONE_OF,node:At.ONE_OF_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};Pe.OVERRIDE_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.FROM,{name:U.FROM,typeNode:En.REQUIRED_STRING_TYPE_NODE}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.OVERRIDE,node:At.OVERRIDE_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([U.FROM])};Pe.KEY_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.FIELDS,{name:U.FIELDS,typeNode:En.REQUIRED_FIELDSET_TYPE_NODE}],[U.RESOLVABLE,{name:U.RESOLVABLE,typeNode:(0,Fn.stringToNamedTypeNode)(U.BOOLEAN_SCALAR),defaultValue:{kind:Et.Kind.BOOLEAN,value:!0}}]]),isRepeatable:!0,locations:new Set([U.INTERFACE_UPPER,U.OBJECT_UPPER]),name:U.KEY,node:At.KEY_DEFINITION,optionalArgumentNames:new Set([U.RESOLVABLE]),requiredArgumentNames:new Set([U.FIELDS])};Pe.LINK_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.URL_LOWER,{name:U.URL_LOWER,typeNode:En.REQUIRED_STRING_TYPE_NODE}],[U.AS,{name:U.AS,typeNode:(0,Fn.stringToNamedTypeNode)(U.STRING_SCALAR)}],[U.FOR,{name:U.FOR,typeNode:(0,Fn.stringToNamedTypeNode)(U.LINK_PURPOSE)}],[U.IMPORT,{name:U.IMPORT,typeNode:{kind:Et.Kind.LIST_TYPE,type:(0,Fn.stringToNamedTypeNode)(U.LINK_IMPORT)}}]]),isRepeatable:!0,locations:new Set([U.SCHEMA_UPPER]),name:U.LINK,node:At.LINK_DEFINITION,optionalArgumentNames:new Set([U.AS,U.FOR,U.IMPORT]),requiredArgumentNames:new Set([U.URL_LOWER])};Pe.LIST_SIZE_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.ASSUMED_SIZE,{name:U.ASSUMED_SIZE,typeNode:(0,Fn.stringToNamedTypeNode)(U.INT_SCALAR)}],[U.SLICING_ARGUMENTS,{name:U.SLICING_ARGUMENTS,typeNode:{kind:Et.Kind.LIST_TYPE,type:{kind:Et.Kind.NON_NULL_TYPE,type:(0,Fn.stringToNamedTypeNode)(U.STRING_SCALAR)}}}],[U.SIZED_FIELDS,{name:U.SIZED_FIELDS,typeNode:{kind:Et.Kind.LIST_TYPE,type:{kind:Et.Kind.NON_NULL_TYPE,type:(0,Fn.stringToNamedTypeNode)(U.STRING_SCALAR)}}}],[U.REQUIRE_ONE_SLICING_ARGUMENT,{name:U.REQUIRE_ONE_SLICING_ARGUMENT,typeNode:(0,Fn.stringToNamedTypeNode)(U.BOOLEAN_SCALAR),defaultValue:{kind:Et.Kind.BOOLEAN,value:!0}}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.LIST_SIZE,node:At.LIST_SIZE_DEFINITION,optionalArgumentNames:new Set([U.ASSUMED_SIZE,U.SLICING_ARGUMENTS,U.SIZED_FIELDS,U.REQUIRE_ONE_SLICING_ARGUMENT]),requiredArgumentNames:new Set};Pe.PROVIDES_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.FIELDS,{name:U.FIELDS,typeNode:En.REQUIRED_FIELDSET_TYPE_NODE}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.PROVIDES,node:At.PROVIDES_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([U.FIELDS])};Pe.REQUIRES_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.FIELDS,{name:U.FIELDS,typeNode:En.REQUIRED_FIELDSET_TYPE_NODE}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.REQUIRES,node:At.REQUIRES_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([U.FIELDS])};Pe.REDIS_PUBLISH_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.CHANNEL,{name:U.CHANNEL,typeNode:En.REQUIRED_STRING_TYPE_NODE}],[U.PROVIDER_ID,{name:U.PROVIDER_ID,typeNode:En.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:Et.Kind.STRING,value:U.DEFAULT_EDFS_PROVIDER_ID}}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.EDFS_REDIS_PUBLISH,node:At.EDFS_REDIS_PUBLISH_DEFINITION,optionalArgumentNames:new Set([U.PROVIDER_ID]),requiredArgumentNames:new Set([U.CHANNEL])};Pe.REDIS_SUBSCRIBE_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.CHANNELS,{name:U.CHANNELS,typeNode:{kind:Et.Kind.NON_NULL_TYPE,type:{kind:Et.Kind.LIST_TYPE,type:En.REQUIRED_STRING_TYPE_NODE}}}],[U.PROVIDER_ID,{name:U.PROVIDER_ID,typeNode:En.REQUIRED_STRING_TYPE_NODE,defaultValue:{kind:Et.Kind.STRING,value:U.DEFAULT_EDFS_PROVIDER_ID}}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.EDFS_REDIS_SUBSCRIBE,node:At.EDFS_REDIS_SUBSCRIBE_DEFINITION,optionalArgumentNames:new Set([U.PROVIDER_ID]),requiredArgumentNames:new Set([U.CHANNELS])};Pe.REQUEST_SCOPED_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.KEY,{name:U.KEY,typeNode:En.REQUIRED_STRING_TYPE_NODE}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.REQUEST_SCOPED,node:At.REQUEST_SCOPED_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([U.KEY])};Pe.REQUIRE_FETCH_REASONS_DEFINITION_DATA={argumentTypeNodeByName:new Map,isRepeatable:!0,locations:new Set([U.FIELD_DEFINITION_UPPER,U.INTERFACE_UPPER,U.OBJECT_UPPER]),name:U.REQUIRE_FETCH_REASONS,node:At.REQUIRE_FETCH_REASONS_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};Pe.REQUIRES_SCOPES_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.SCOPES,{name:U.SCOPES,typeNode:{kind:Et.Kind.NON_NULL_TYPE,type:{kind:Et.Kind.LIST_TYPE,type:{kind:Et.Kind.NON_NULL_TYPE,type:{kind:Et.Kind.LIST_TYPE,type:{kind:Et.Kind.NON_NULL_TYPE,type:(0,Fn.stringToNamedTypeNode)(U.SCOPE_SCALAR)}}}}}}]]),isRepeatable:!1,locations:new Set([U.ENUM_UPPER,U.FIELD_DEFINITION_UPPER,U.INTERFACE_UPPER,U.OBJECT_UPPER,U.SCALAR_UPPER]),name:U.REQUIRES_SCOPES,node:At.REQUIRES_SCOPES_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([U.SCOPES])};Pe.SEMANTIC_NON_NULL_DATA={argumentTypeNodeByName:new Map([[U.LEVELS,{name:U.LEVELS,typeNode:{kind:Et.Kind.NON_NULL_TYPE,type:{kind:Et.Kind.LIST_TYPE,type:{kind:Et.Kind.NON_NULL_TYPE,type:(0,Fn.stringToNamedTypeNode)(U.INT_SCALAR)}}},defaultValue:{kind:Et.Kind.LIST,values:[{kind:Et.Kind.INT,value:"0"}]}}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.SEMANTIC_NON_NULL,node:At.SEMANTIC_NON_NULL_DEFINITION,optionalArgumentNames:new Set([U.LEVELS]),requiredArgumentNames:new Set};Pe.SPECIFIED_BY_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.URL_LOWER,{name:U.URL_LOWER,typeNode:En.REQUIRED_STRING_TYPE_NODE}]]),isRepeatable:!1,locations:new Set([U.SCALAR_UPPER]),name:U.SPECIFIED_BY,node:At.SPECIFIED_BY_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([U.URL_LOWER])};Pe.SHAREABLE_DEFINITION_DATA={argumentTypeNodeByName:new Map,isRepeatable:!0,locations:new Set([U.FIELD_DEFINITION_UPPER,U.OBJECT_UPPER]),name:U.SHAREABLE,node:At.SHAREABLE_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};Pe.SUBSCRIPTION_FILTER_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.CONDITION,{name:U.CONDITION,typeNode:{kind:Et.Kind.NON_NULL_TYPE,type:(0,Fn.stringToNamedTypeNode)(U.SUBSCRIPTION_FILTER_CONDITION)}}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.SUBSCRIPTION_FILTER,node:At.SUBSCRIPTION_FILTER_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([U.CONDITION])};Pe.TAG_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.NAME,{name:U.NAME,typeNode:En.REQUIRED_STRING_TYPE_NODE}]]),isRepeatable:!0,locations:new Set([U.ARGUMENT_DEFINITION_UPPER,U.ENUM_UPPER,U.ENUM_VALUE_UPPER,U.FIELD_DEFINITION_UPPER,U.INPUT_FIELD_DEFINITION_UPPER,U.INPUT_OBJECT_UPPER,U.INTERFACE_UPPER,U.OBJECT_UPPER,U.SCALAR_UPPER,U.UNION_UPPER]),name:U.TAG,node:At.TAG_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([U.NAME])};Pe.CACHE_INVALIDATE_DEFINITION_DATA={argumentTypeNodeByName:new Map([]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.CACHE_INVALIDATE,node:At.CACHE_INVALIDATE_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set};Pe.CACHE_POPULATE_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.MAX_AGE,{name:U.MAX_AGE,typeNode:(0,Fn.stringToNamedTypeNode)(U.INT_SCALAR)}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.CACHE_POPULATE,node:At.CACHE_POPULATE_DEFINITION,optionalArgumentNames:new Set([U.MAX_AGE]),requiredArgumentNames:new Set};Pe.ENTITY_CACHE_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.MAX_AGE,{name:U.MAX_AGE,typeNode:En.REQUIRED_INT_TYPE_NODE}],[U.NEGATIVE_CACHE_TTL,{name:U.NEGATIVE_CACHE_TTL,typeNode:(0,Fn.stringToNamedTypeNode)(U.INT_SCALAR),defaultValue:{kind:Et.Kind.INT,value:"0"}}],[U.INCLUDE_HEADERS,{name:U.INCLUDE_HEADERS,typeNode:(0,Fn.stringToNamedTypeNode)(U.BOOLEAN_SCALAR),defaultValue:{kind:Et.Kind.BOOLEAN,value:!1}}],[U.PARTIAL_CACHE_LOAD,{name:U.PARTIAL_CACHE_LOAD,typeNode:(0,Fn.stringToNamedTypeNode)(U.BOOLEAN_SCALAR),defaultValue:{kind:Et.Kind.BOOLEAN,value:!1}}],[U.SHADOW_MODE,{name:U.SHADOW_MODE,typeNode:(0,Fn.stringToNamedTypeNode)(U.BOOLEAN_SCALAR),defaultValue:{kind:Et.Kind.BOOLEAN,value:!1}}]]),isRepeatable:!1,locations:new Set([U.OBJECT_UPPER]),name:U.ENTITY_CACHE,node:At.ENTITY_CACHE_DEFINITION,optionalArgumentNames:new Set([U.NEGATIVE_CACHE_TTL,U.INCLUDE_HEADERS,U.PARTIAL_CACHE_LOAD,U.SHADOW_MODE]),requiredArgumentNames:new Set([U.MAX_AGE])};Pe.IS_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.FIELDS,{name:U.FIELDS,typeNode:En.REQUIRED_STRING_TYPE_NODE}]]),isRepeatable:!1,locations:new Set([U.ARGUMENT_DEFINITION_UPPER]),name:U.IS,node:At.IS_DEFINITION,optionalArgumentNames:new Set,requiredArgumentNames:new Set([U.FIELDS])};Pe.QUERY_CACHE_DEFINITION_DATA={argumentTypeNodeByName:new Map([[U.MAX_AGE,{name:U.MAX_AGE,typeNode:En.REQUIRED_INT_TYPE_NODE}],[U.INCLUDE_HEADERS,{name:U.INCLUDE_HEADERS,typeNode:(0,Fn.stringToNamedTypeNode)(U.BOOLEAN_SCALAR),defaultValue:{kind:Et.Kind.BOOLEAN,value:!1}}],[U.SHADOW_MODE,{name:U.SHADOW_MODE,typeNode:(0,Fn.stringToNamedTypeNode)(U.BOOLEAN_SCALAR),defaultValue:{kind:Et.Kind.BOOLEAN,value:!1}}]]),isRepeatable:!1,locations:new Set([U.FIELD_DEFINITION_UPPER]),name:U.QUERY_CACHE,node:At.QUERY_CACHE_DEFINITION,optionalArgumentNames:new Set([U.INCLUDE_HEADERS,U.SHADOW_MODE]),requiredArgumentNames:new Set([U.MAX_AGE])}});var Ff=F(Pa=>{"use strict";m();T();N();Object.defineProperty(Pa,"__esModule",{value:!0});Pa.newFieldSetData=Gpe;Pa.extractFieldSetValue=Qpe;Pa.getNormalizedFieldSet=Ype;Pa.getInitialFieldCoordsPath=Jpe;Pa.validateKeyFieldSets=Hpe;Pa.getConditionalFieldSetDirectiveName=zpe;Pa.isNodeQuery=Wpe;Pa.validateArgumentTemplateReferences=Xpe;Pa.initializeDirectiveDefinitionDatas=Zpe;var Jn=Oe(),RK=kr(),Rr=Ji(),PK=ku(),sb=Uu(),Rt=ab(),lt=Zn(),xs=Mr();function Gpe(){return{provides:new Map,requires:new Map}}function Qpe(e,t,n){if(!n||n.length>1)return;let r=n[0].arguments;if(!r||r.length!==1)return;let i=r[0];i.name.value!==lt.FIELDS||i.value.kind!==Jn.Kind.STRING||t.set(e,i.value.value)}function Ype(e){return(0,Jn.print)((0,RK.lexicographicallySortDocumentNode)(e)).replaceAll(/\s+/g," ").slice(2,-2)}function Jpe(e,t){return e?[t]:[]}function Hpe(e,t,n){let r=e.entityInterfaceDataByTypeName.get(t.name),i=t.name,a=[],o=r?void 0:e.internalGraph.addEntityDataNode(t.name),u=e.internalGraph.addOrUpdateNode(t.name),l=0;for(let[d,{documentNode:p,isUnresolvable:E,rawFieldSet:h}]of n){r&&(r.resolvable||(r.resolvable=!E)),l+=1;let _=[],S=[t],k=[],B=[],K=new Set,ne=-1,ee=!0,oe="",de=!1;if((0,Jn.visit)(p,{Argument:{enter(me){return _.push((0,Rr.unexpectedArgumentErrorMessage)(h,`${S[ne].name}.${oe}`,me.name.value)),Jn.BREAK}},Field:{enter(me){let pe=S[ne],ge=pe.name;if(ee){let bt=`${ge}.${oe}`,Yt=pe.fieldDataByName.get(oe);if(!Yt)return _.push((0,Rr.undefinedFieldInFieldSetErrorMessage)(h,bt,oe)),Jn.BREAK;let jr=(0,sb.getTypeNodeNamedTypeName)(Yt.node.type),or=e.parentDefinitionDataByTypeName.get(jr),yn=or?or.kind:Jn.Kind.SCALAR_TYPE_DEFINITION;return _.push((0,Rr.invalidSelectionSetErrorMessage)(h,[bt],jr,(0,xs.kindToNodeType)(yn))),Jn.BREAK}let H=me.name.value,he=`${ge}.${H}`;if(oe=H,H===lt.TYPENAME)return;let Je=pe.fieldDataByName.get(H);if(!Je)return _.push((0,Rr.undefinedFieldInFieldSetErrorMessage)(h,ge,H)),Jn.BREAK;if(Je.argumentDataByName.size)return _.push((0,Rr.argumentsInKeyFieldSetErrorMessage)(h,he)),Jn.BREAK;if(k[ne].has(H))return _.push((0,Rr.duplicateFieldInFieldSetErrorMessage)(h,he)),Jn.BREAK;let Qt=Je.externalFieldDataBySubgraphName.get(e.subgraphName);if(!e.isSubgraphEventDrivenGraph&&(Qt!=null&&Qt.isDefinedExternal)&&!Qt.isUnconditionallyProvided&&!e.conditionalFieldDataByCoords.get(he)&&!e.options.ignoreExternalKeys){de=!0;let Yt=u.headToTailEdges.get(H);Yt&&(Yt.isExternal=!0)}(0,xs.getValueOrDefault)((0,xs.getValueOrDefault)(e.keyFieldSetsByEntityTypeNameByFieldCoords,he,()=>new Map),i,()=>new Set).add(d),B.push(H),Je.isShareableBySubgraphName.set(e.subgraphName,!0),k[ne].add(H),(0,xs.getValueOrDefault)(e.keyFieldNamesByParentTypeName,ge,()=>new Set).add(H);let _n=(0,sb.getTypeNodeNamedTypeName)(Je.node.type);if(PK.BASE_SCALARS.has(_n)){K.add(B.join(lt.LITERAL_PERIOD)),B.pop();return}let hn=e.parentDefinitionDataByTypeName.get(_n);if(!hn)return _.push((0,Rr.unknownTypeInFieldSetErrorMessage)(h,he,_n)),Jn.BREAK;if(hn.kind===Jn.Kind.OBJECT_TYPE_DEFINITION){ee=!0,S.push(hn);return}if((0,RK.isKindAbstract)(hn.kind))return _.push((0,Rr.abstractTypeInKeyFieldSetErrorMessage)(h,he,_n,(0,xs.kindToNodeType)(hn.kind))),Jn.BREAK;K.add(B.join(lt.LITERAL_PERIOD)),B.pop()}},InlineFragment:{enter(){return _.push(Rr.inlineFragmentInFieldSetErrorMessage),Jn.BREAK}},SelectionSet:{enter(){if(!ee){let me=S[ne],ge=`${me.name}.${oe}`;if(oe===lt.TYPENAME)return _.push((0,Rr.invalidSelectionSetDefinitionErrorMessage)(h,[ge],lt.STRING_SCALAR,(0,xs.kindToNodeType)(Jn.Kind.SCALAR_TYPE_DEFINITION))),Jn.BREAK;let H=me.fieldDataByName.get(oe);if(!H)return _.push((0,Rr.undefinedFieldInFieldSetErrorMessage)(h,ge,oe)),Jn.BREAK;let he=(0,sb.getTypeNodeNamedTypeName)(H.node.type),Je=e.parentDefinitionDataByTypeName.get(he),Qt=Je?Je.kind:Jn.Kind.SCALAR_TYPE_DEFINITION;return _.push((0,Rr.invalidSelectionSetDefinitionErrorMessage)(h,[ge],he,(0,xs.kindToNodeType)(Qt))),Jn.BREAK}if(ne+=1,ee=!1,ne<0||ne>=S.length)return _.push((0,Rr.unparsableFieldSetSelectionErrorMessage)(h,oe)),Jn.BREAK;k.push(new Set)},leave(){if(ee){let pe=S[ne].name,ge=S[ne+1],H=`${pe}.${oe}`;_.push((0,Rr.invalidSelectionSetErrorMessage)(h,[H],ge.name,(0,xs.kindToNodeType)(ge.kind))),ee=!1}ne-=1,S.pop(),k.pop()}}}),_.length>0){e.errors.push((0,Rr.invalidDirectiveError)(lt.KEY,i,(0,xs.numberToOrdinal)(l),_));continue}a.push(q({fieldName:"",selectionSet:d},E?{disableEntityResolver:!0}:{})),u.satisfiedFieldSets.add(d),de&&u.externalFieldSets.add(d),!E&&(o==null||o.addTargetSubgraphByFieldSet(d,e.subgraphName))}if(a.length>0)return a}function zpe(e){return e?lt.PROVIDES:lt.REQUIRES}function Wpe(e,t){return e===lt.QUERY||t===Jn.OperationTypeNode.QUERY}function Xpe(e,t,n){let r=e.matchAll(PK.EDFS_ARGS_REGEXP),i=new Set,a=new Set;for(let o of r){if(o.length<2){a.add(o[0]);continue}t.has(o[1])||i.add(o[1])}for(let o of i)n.push((0,Rr.undefinedEventSubjectsArgumentErrorMessage)(o));for(let o of a)n.push((0,Rr.invalidEventSubjectsArgumentErrorMessage)(o))}function Zpe(){return new Map([[lt.AUTHENTICATED,Rt.AUTHENTICATED_DEFINITION_DATA],[lt.CACHE_INVALIDATE,Rt.CACHE_INVALIDATE_DEFINITION_DATA],[lt.CACHE_POPULATE,Rt.CACHE_POPULATE_DEFINITION_DATA],[lt.COMPOSE_DIRECTIVE,Rt.COMPOSE_DIRECTIVE_DEFINITION_DATA],[lt.CONFIGURE_DESCRIPTION,Rt.CONFIGURE_DESCRIPTION_DEFINITION_DATA],[lt.CONFIGURE_CHILD_DESCRIPTIONS,Rt.CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION_DATA],[lt.CONNECT_FIELD_RESOLVER,Rt.CONNECT_FIELD_RESOLVER_DEFINITION_DATA],[lt.COST,Rt.COST_DEFINITION_DATA],[lt.DEPRECATED,Rt.DEPRECATED_DEFINITION_DATA],[lt.EDFS_KAFKA_PUBLISH,Rt.KAFKA_PUBLISH_DEFINITION_DATA],[lt.EDFS_KAFKA_SUBSCRIBE,Rt.KAFKA_SUBSCRIBE_DEFINITION_DATA],[lt.EDFS_NATS_PUBLISH,Rt.NATS_PUBLISH_DEFINITION_DATA],[lt.EDFS_NATS_REQUEST,Rt.NATS_REQUEST_DEFINITION_DATA],[lt.EDFS_NATS_SUBSCRIBE,Rt.NATS_SUBSCRIBE_DEFINITION_DATA],[lt.EDFS_REDIS_PUBLISH,Rt.REDIS_PUBLISH_DEFINITION_DATA],[lt.EDFS_REDIS_SUBSCRIBE,Rt.REDIS_SUBSCRIBE_DEFINITION_DATA],[lt.ENTITY_CACHE,Rt.ENTITY_CACHE_DEFINITION_DATA],[lt.EXTENDS,Rt.EXTENDS_DEFINITION_DATA],[lt.EXTERNAL,Rt.EXTERNAL_DEFINITION_DATA],[lt.INACCESSIBLE,Rt.INACCESSIBLE_DEFINITION_DATA],[lt.INTERFACE_OBJECT,Rt.INTERFACE_OBJECT_DEFINITION_DATA],[lt.IS,Rt.IS_DEFINITION_DATA],[lt.KEY,Rt.KEY_DEFINITION_DATA],[lt.LINK,Rt.LINK_DEFINITION_DATA],[lt.LIST_SIZE,Rt.LIST_SIZE_DEFINITION_DATA],[lt.ONE_OF,Rt.ONE_OF_DEFINITION_DATA],[lt.OVERRIDE,Rt.OVERRIDE_DEFINITION_DATA],[lt.PROVIDES,Rt.PROVIDES_DEFINITION_DATA],[lt.QUERY_CACHE,Rt.QUERY_CACHE_DEFINITION_DATA],[lt.REQUEST_SCOPED,Rt.REQUEST_SCOPED_DEFINITION_DATA],[lt.REQUIRE_FETCH_REASONS,Rt.REQUIRE_FETCH_REASONS_DEFINITION_DATA],[lt.REQUIRES,Rt.REQUIRES_DEFINITION_DATA],[lt.REQUIRES_SCOPES,Rt.REQUIRES_SCOPES_DEFINITION_DATA],[lt.SEMANTIC_NON_NULL,Rt.SEMANTIC_NON_NULL_DATA],[lt.SHAREABLE,Rt.SHAREABLE_DEFINITION_DATA],[lt.SPECIFIED_BY,Rt.SPECIFIED_BY_DEFINITION_DATA],[lt.SUBSCRIPTION_FILTER,Rt.SUBSCRIPTION_FILTER_DEFINITION_DATA],[lt.TAG,Rt.TAG_DEFINITION_DATA]])}});var ub=F(ob=>{"use strict";m();T();N();Object.defineProperty(ob,"__esModule",{value:!0});ob.recordSubgraphName=efe;function efe(e,t,n){if(!t.has(e)){t.add(e);return}n.add(e)}});var lb=F(oh=>{"use strict";m();T();N();Object.defineProperty(oh,"__esModule",{value:!0});oh.Warning=void 0;var cb=class extends Error{constructor(n){super(n.message);y(this,"subgraph");this.name="Warning",this.subgraph=n.subgraph}};oh.Warning=cb});var Lf=F(sr=>{"use strict";m();T();N();Object.defineProperty(sr,"__esModule",{value:!0});sr.invalidOverrideTargetSubgraphNameWarning=tfe;sr.externalInterfaceFieldsWarning=nfe;sr.nonExternalConditionalFieldWarning=rfe;sr.unimplementedInterfaceOutputTypeWarning=ife;sr.invalidExternalFieldWarning=afe;sr.requiresDefinedOnNonEntityFieldWarning=sfe;sr.consumerInactiveThresholdInvalidValueWarning=ofe;sr.externalEntityExtensionKeyFieldWarning=ufe;sr.fieldAlreadyProvidedWarning=cfe;sr.singleSubgraphInputFieldOneOfWarning=lfe;sr.incompleteQueryCacheKeyMappingWarning=dfe;sr.autoMappingTypeMismatchWarning=pfe;sr.autoMappingAdditionalNonKeyArgumentWarning=ffe;sr.autoBatchAdditionalNonKeyArgumentWarning=mfe;sr.singleFederatedInputFieldOneOfWarning=Nfe;sr.queryCacheReturnEntityMissingEntityCacheWarning=Tfe;sr.redundantIsDirectiveWarning=Efe;sr.requestScopedSingleFieldWarning=hfe;var vr=lb(),db=Zn();function tfe(e,t,n,r){return new vr.Warning({message:`The Object type "${t}" defines the directive "@override(from: "${e}")" on the following field`+(n.length>1?"s":"")+': "'+n.join(db.QUOTATION_JOIN)+`". The required "from" argument of type "String!" should be provided with an existing subgraph name. However, a subgraph by the name of "${e}" does not exist. -If this subgraph has been recently deleted, remember to clean up unused "@override" directives that reference this subgraph.`,subgraph:{name:r}})}function JE(e){return`The subgraph "${e}" is currently a "version one" subgraph, but if it were updated to "version two" in its current state, composition would be unsuccessful due to the following warning that would instead propagate as an error: -`}function pfe(e,t,n){return new Ra.Warning({message:JE(e)+`The Interface "${t}" is invalid because the following field definition`+(n.length>1?"s are":" is")+` declared "@external": - "`+n.join(JD.QUOTATION_JOIN)+`" -Interface fields should not be declared "@external". This is because Interface fields do not resolve directly, but the "@external" directive relates to whether a Field instance can be resolved by the subgraph in which it is defined.`,subgraph:{name:e}})}function mfe(e,t,n,r,i){return new Ra.Warning({message:JE(t)+`The Field "${e}" in subgraph "${t}" defines a "@${i}" directive with the following field set: +If this subgraph has been recently deleted, remember to clean up unused "@override" directives that reference this subgraph.`,subgraph:{name:r}})}function uh(e){return`The subgraph "${e}" is currently a "version one" subgraph, but if it were updated to "version two" in its current state, composition would be unsuccessful due to the following warning that would instead propagate as an error: +`}function nfe(e,t,n){return new vr.Warning({message:uh(e)+`The Interface "${t}" is invalid because the following field definition`+(n.length>1?"s are":" is")+` declared "@external": + "`+n.join(db.QUOTATION_JOIN)+`" +Interface fields should not be declared "@external". This is because Interface fields do not resolve directly, but the "@external" directive relates to whether a Field instance can be resolved by the subgraph in which it is defined.`,subgraph:{name:e}})}function rfe(e,t,n,r,i){return new vr.Warning({message:uh(t)+`The Field "${e}" in subgraph "${t}" defines a "@${i}" directive with the following field set: "${r}". However, neither the field "${n}" nor any of its field set ancestors are declared @external. -Consequently, "${n}" is already provided by subgraph "${t}" and should not form part of a "@${i}" directive field set.`,subgraph:{name:t}})}function Nfe(e,t){return new Ra.Warning({message:`Subgraph "${e}": The Interface "${t}" is used as an output type without at least one Object type implementation defined in the schema.`,subgraph:{name:e}})}function Tfe(e,t){return new Ra.Warning({message:JE(t)+` The Object Field "${e}" is invalidly declared "@external". An Object field should only be declared "@external" if it is part of a "@key", "@provides", or "@requires" field set, or the field is necessary to satisfy an Interface implementation. In the case that none of these conditions is true, the "@external" directive should be removed.`,subgraph:{name:t}})}function Efe(e,t){return new Ra.Warning({message:` The Object Field "${e}" defines a "@requires" directive, but the Object is not an entity. Consequently, the "@requires" FieldSet cannot be satisfied because there is no entity resolver with which to provide the required Fields.`,subgraph:{name:t}})}function hfe(e,t=""){return new Ra.Warning({message:'The "consumerInactiveThreshold" argument of type "Int" should be positive and smaller than 2,147,483,648.'+ +t?` -${t}`:"",subgraph:{name:e}})}function yfe(e,t,n,r){return new Ra.Warning({message:`The entity extension "${e}" defined in subgraph "${r}" defines a "@key" directive with the field set "${t}". +Consequently, "${n}" is already provided by subgraph "${t}" and should not form part of a "@${i}" directive field set.`,subgraph:{name:t}})}function ife(e,t){return new vr.Warning({message:`Subgraph "${e}": The Interface "${t}" is used as an output type without at least one Object type implementation defined in the schema.`,subgraph:{name:e}})}function afe(e,t){return new vr.Warning({message:uh(t)+` The Object Field "${e}" is invalidly declared "@external". An Object field should only be declared "@external" if it is part of a "@key", "@provides", or "@requires" field set, or the field is necessary to satisfy an Interface implementation. In the case that none of these conditions is true, the "@external" directive should be removed.`,subgraph:{name:t}})}function sfe(e,t){return new vr.Warning({message:` The Object Field "${e}" defines a "@requires" directive, but the Object is not an entity. Consequently, the "@requires" FieldSet cannot be satisfied because there is no entity resolver with which to provide the required Fields.`,subgraph:{name:t}})}function ofe(e,t=""){return new vr.Warning({message:'The "consumerInactiveThreshold" argument of type "Int" should be positive and smaller than 2,147,483,648.'+ +t?` +${t}`:"",subgraph:{name:e}})}function ufe(e,t,n,r){return new vr.Warning({message:`The entity extension "${e}" defined in subgraph "${r}" defines a "@key" directive with the field set "${t}". The following field coordinates that form part of that field set are declared "@external": - "`+n.join(JD.QUOTATION_JOIN)+`" -Please note fields that form part of entity extension "@key" field sets are always provided in that subgraph. Any such "@external" declarations are unnecessary relics of Federation Version 1 syntax and are effectively ignored.`,subgraph:{name:r}})}function Ife(e,t,n,r){return new Ra.Warning({message:JE(r)+`The field "${e}" is unconditionally provided by subgraph "${r}" and should not form part of any "@${t}" field set. + "`+n.join(db.QUOTATION_JOIN)+`" +Please note fields that form part of entity extension "@key" field sets are always provided in that subgraph. Any such "@external" declarations are unnecessary relics of Federation Version 1 syntax and are effectively ignored.`,subgraph:{name:r}})}function cfe(e,t,n,r){return new vr.Warning({message:uh(r)+`The field "${e}" is unconditionally provided by subgraph "${r}" and should not form part of any "@${t}" field set. However, "${e}" forms part of the "@${t}" field set defined "${n}". -Although "${e}" is declared "@external", it is part of a "@key" directive on an extension type. Such fields are only declared "@external" for legacy syntactical reasons and are not internally considered "@external".`,subgraph:{name:r}})}function gfe({fieldName:e,subgraphName:t,typeName:n}){return new Ra.Warning({message:`The directive "@oneOf" is defined on Input Object "${n}", but only one optional Input field, "${e}", is defined. Consider removing "@oneOf" and changing "${e}" to a required type instead.`,subgraph:{name:t}})}function _fe({fieldName:e,typeName:t}){return new Ra.Warning({message:`The directive "@oneOf" is defined on Input Object "${t}", but only one optional Input field, "${e}", is propagated to the federated graph. Consider removing "@oneOf", changing "${e}" to a required type, and removing any other remaining optional Input fields instead.`,subgraph:{name:""}})}});var WD=F(HE=>{"use strict";m();T();N();Object.defineProperty(HE,"__esModule",{value:!0});HE.upsertDirectiveSchemaAndEntityDefinitions=Ofe;HE.upsertParentsAndChildren=Dfe;var Gn=Se(),ku=Qi(),HD=Ru(),zE=_p(),Ed=Cr(),zD=vp(),vfe=pd(),Td=Ql(),Op=Au(),Sfe=Sp(),ia=Hn(),yr=Ur();function Ofe(e,t){(0,Gn.visit)(t,{Directive:{enter(n){let r=n.name.value;return e.referencedDirectiveNames.add(r),vfe.EVENT_DIRECTIVE_NAMES.has(r)&&e.edfsDirectiveReferences.add(r),HD.V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.has(r)&&(e.isSubgraphVersionTwo=!0),!1}},DirectiveDefinition:{enter(n){return e.addDirectiveDefinitionDataByNode(n)&&e.customDirectiveDefinitionByName.set(n.name.value,n),!1}},InterfaceTypeDefinition:{enter(n){let r=n.name.value;if(e.internalGraph.addOrUpdateNode(r,{isAbstract:!0}),!(0,Ed.isObjectLikeNodeEntity)(n))return;let i=(0,yr.getValueOrDefault)(e.keyFieldSetDatasByTypeName,r,()=>new Map);e.extractKeyFieldSets(n,i),(0,zE.upsertEntityData)({entityDataByTypeName:e.entityDataByTypeName,keyFieldSetDataByFieldSet:i,subgraphName:e.subgraphName,typeName:r}),(0,yr.getValueOrDefault)(e.entityInterfaceDataByTypeName,r,()=>({concreteTypeNames:new Set,fieldDatas:[],interfaceFieldNames:new Set,interfaceObjectFieldNames:new Set,isInterfaceObject:!1,resolvable:!1,typeName:r}))}},InterfaceTypeExtension:{enter(n){let r=n.name.value;if(e.internalGraph.addOrUpdateNode(r,{isAbstract:!0}),!(0,Ed.isObjectLikeNodeEntity)(n))return;let i=(0,yr.getValueOrDefault)(e.keyFieldSetDatasByTypeName,r,()=>new Map);e.extractKeyFieldSets(n,i),(0,zE.upsertEntityData)({entityDataByTypeName:e.entityDataByTypeName,keyFieldSetDataByFieldSet:i,subgraphName:e.subgraphName,typeName:r}),(0,yr.getValueOrDefault)(e.entityInterfaceDataByTypeName,r,()=>({concreteTypeNames:new Set,fieldDatas:[],interfaceFieldNames:new Set,interfaceObjectFieldNames:new Set,isInterfaceObject:!1,resolvable:!1,typeName:r}))}},ObjectTypeDefinition:{enter(n){if(!(0,Ed.isObjectLikeNodeEntity)(n))return;let r=n.name.value;(0,Ed.isNodeInterfaceObject)(n)&&(e.entityInterfaceDataByTypeName.set(r,{concreteTypeNames:new Set,fieldDatas:[],interfaceObjectFieldNames:new Set,interfaceFieldNames:new Set,isInterfaceObject:!0,resolvable:!1,typeName:r}),e.internalGraph.addOrUpdateNode(r,{isAbstract:!0}));let i=(0,yr.getValueOrDefault)(e.keyFieldSetDatasByTypeName,r,()=>new Map);e.extractKeyFieldSets(n,i),(0,zE.upsertEntityData)({entityDataByTypeName:e.entityDataByTypeName,keyFieldSetDataByFieldSet:i,subgraphName:e.subgraphName,typeName:r})}},ObjectTypeExtension:{enter(n){if(!(0,Ed.isObjectLikeNodeEntity)(n))return;let r=n.name.value,i=(0,yr.getValueOrDefault)(e.keyFieldSetDatasByTypeName,r,()=>new Map);e.extractKeyFieldSets(n,i),(0,zE.upsertEntityData)({entityDataByTypeName:e.entityDataByTypeName,keyFieldSetDataByFieldSet:i,subgraphName:e.subgraphName,typeName:r})}},OperationTypeDefinition:{enter(n){let r=n.operation,i=e.schemaData.operationTypes.get(r),a=(0,Op.getTypeNodeNamedTypeName)(n.type);if(i)return e.errors.push((0,ku.duplicateOperationTypeDefinitionError)(r,a,(0,Op.getTypeNodeNamedTypeName)(i.type))),!1;let o=e.operationTypeNodeByTypeName.get(a);return o?(e.errors.push((0,ku.invalidOperationTypeDefinitionError)(o,a,r)),!1):(e.operationTypeNodeByTypeName.set(a,r),e.schemaData.operationTypes.set(r,n),!1)}},SchemaDefinition:{enter(n){e.schemaData.description=n.description,e.extractDirectives(n,e.schemaData.directivesByName)}},SchemaExtension:{enter(n){e.extractDirectives(n,e.schemaData.directivesByName)}}})}function Dfe(e,t){let n=!1,r;(0,Gn.visit)(t,{EnumTypeDefinition:{enter(i){e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertEnumDataByNode(i)},leave(){e.originalParentTypeName="",e.lastParentNodeKind=Gn.Kind.NULL}},EnumTypeExtension:{enter(i){e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertEnumDataByNode(i,!0)},leave(){e.originalParentTypeName="",e.lastParentNodeKind=Gn.Kind.NULL}},EnumValueDefinition:{enter(i){let a=i.name.value;e.lastChildNodeKind=i.kind;let o=(0,yr.getOrThrowError)(e.parentDefinitionDataByTypeName,e.originalParentTypeName,ia.PARENT_DEFINITION_DATA);if(o.kind!==Gn.Kind.ENUM_TYPE_DEFINITION){e.errors.push((0,ku.unexpectedParentKindForChildError)(e.originalParentTypeName,"Enum or Enum extension",(0,yr.kindToNodeType)(o.kind),a,(0,yr.kindToNodeType)(i.kind)));return}if(o.enumValueDataByName.has(a)){e.errors.push((0,ku.duplicateEnumValueDefinitionError)(e.originalParentTypeName,a));return}o.enumValueDataByName.set(a,{appearances:1,configureDescriptionDataBySubgraphName:new Map,directivesByName:e.extractDirectives(i,new Map),federatedCoords:`${e.originalParentTypeName}.${a}`,kind:Gn.Kind.ENUM_VALUE_DEFINITION,name:a,node:(0,Op.getMutableEnumValueNode)(i),parentTypeName:e.originalParentTypeName,persistedDirectivesData:(0,Td.newPersistedDirectivesData)(),subgraphNames:new Set([e.subgraphName]),description:(0,Ed.formatDescription)(i.description)})},leave(){e.lastChildNodeKind=Gn.Kind.NULL}},FieldDefinition:{enter(i){let a=i.name.value;if(n&&ia.IGNORED_FIELDS.has(a))return!1;e.edfsDirectiveReferences.size>0&&e.validateSubscriptionFilterDirectiveLocation(i),e.lastChildNodeKind=i.kind;let o=(0,Op.getTypeNodeNamedTypeName)(i.type);(0,yr.getValueOrDefault)(e.fieldCoordsByNamedTypeName,o,()=>new Set).add(`${e.renamedParentTypeName||e.originalParentTypeName}.${a}`),r&&!r.isAbstract&&e.internalGraph.addEdge(r,e.internalGraph.addOrUpdateNode(o),a),HD.BASE_SCALARS.has(o)||e.referencedTypeNames.add(o);let u=(0,yr.getOrThrowError)(e.parentDefinitionDataByTypeName,e.originalParentTypeName,ia.PARENT_DEFINITION_DATA);if(!(0,Td.isParentDataCompositeOutputType)(u)){e.errors.push((0,ku.unexpectedParentKindForChildError)(e.originalParentTypeName,'"Object" or "Interface"',(0,yr.kindToNodeType)(u.kind),a,(0,yr.kindToNodeType)(i.kind)));return}if(u.fieldDataByName.has(a)){e.errors.push((0,ku.duplicateFieldDefinitionError)((0,yr.kindToNodeType)(u.kind),u.name,a));return}let l=e.extractArguments(new Map,i),d=e.extractDirectives(i,new Map),p=new Set;e.handleFieldInheritableDirectives({directivesByName:d,fieldName:a,inheritedDirectiveNames:p,parentData:u});let E=e.addFieldDataByNode(u.fieldDataByName,i,l,d,p);n&&e.extractEventDirectivesToConfiguration(i,l);let h=E.directivesByName.get(ia.PROVIDES),v=E.directivesByName.get(ia.REQUIRES);if(!v&&!h)return;let A=e.entityDataByTypeName.get(e.originalParentTypeName),B=(0,yr.getValueOrDefault)(e.fieldSetDataByTypeName,e.originalParentTypeName,zD.newFieldSetData);h&&(0,zD.extractFieldSetValue)(a,B.provides,h),v&&(A||e.warnings.push((0,Sfe.requiresDefinedOnNonEntityFieldWarning)(`${e.originalParentTypeName}.${a}`,e.subgraphName)),(0,zD.extractFieldSetValue)(a,B.requires,v))},leave(){e.lastChildNodeKind=Gn.Kind.NULL}},InputObjectTypeDefinition:{enter(i){e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertInputObjectByNode(i)},leave(){e.lastParentNodeKind=Gn.Kind.NULL,e.originalParentTypeName=""}},InputObjectTypeExtension:{enter(i){e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertInputObjectByNode(i,!0)},leave(){e.originalParentTypeName="",e.lastParentNodeKind=Gn.Kind.NULL}},InputValueDefinition:{enter(i){let a=i.name.value;if(e.lastParentNodeKind!==Gn.Kind.INPUT_OBJECT_TYPE_DEFINITION&&e.lastParentNodeKind!==Gn.Kind.INPUT_OBJECT_TYPE_EXTENSION){e.argumentName=a;return}e.lastChildNodeKind=i.kind;let o=(0,Op.getTypeNodeNamedTypeName)(i.type);HD.BASE_SCALARS.has(o)||e.referencedTypeNames.add(o);let u=(0,yr.getOrThrowError)(e.parentDefinitionDataByTypeName,e.originalParentTypeName,ia.PARENT_DEFINITION_DATA);if(u.kind!==Gn.Kind.INPUT_OBJECT_TYPE_DEFINITION)return e.errors.push((0,ku.unexpectedParentKindForChildError)(e.originalParentTypeName,"input object or input object extension",(0,yr.kindToNodeType)(u.kind),a,(0,yr.kindToNodeType)(i.kind))),!1;if(u.inputValueDataByName.has(a)){e.errors.push((0,ku.duplicateInputFieldDefinitionError)(e.originalParentTypeName,a));return}e.addInputValueDataByNode({inputValueDataByName:u.inputValueDataByName,isArgument:!1,node:i,originalParentTypeName:e.originalParentTypeName})},leave(){e.argumentName="",e.lastChildNodeKind===Gn.Kind.INPUT_VALUE_DEFINITION&&(e.lastChildNodeKind=Gn.Kind.NULL)}},InterfaceTypeDefinition:{enter(i){e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertInterfaceDataByNode(i)},leave(){e.doesParentRequireFetchReasons=!1,e.originalParentTypeName="",e.lastParentNodeKind=Gn.Kind.NULL}},InterfaceTypeExtension:{enter(i){e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertInterfaceDataByNode(i,!0)},leave(){e.doesParentRequireFetchReasons=!1,e.originalParentTypeName="",e.lastParentNodeKind=Gn.Kind.NULL}},ObjectTypeDefinition:{enter(i){if(i.name.value===ia.SERVICE_OBJECT)return!1;e.originalParentTypeName=i.name.value,n=(0,Td.isTypeNameRootType)(e.originalParentTypeName,e.operationTypeNodeByTypeName),e.renamedParentTypeName=(0,Td.getRenamedRootTypeName)(e.originalParentTypeName,e.operationTypeNodeByTypeName),e.originalTypeNameByRenamedTypeName.set(e.renamedParentTypeName,e.originalParentTypeName),r=n?e.internalGraph.getRootNode(e.renamedParentTypeName):e.internalGraph.addOrUpdateNode(e.renamedParentTypeName),e.lastParentNodeKind=i.kind,e.upsertObjectDataByNode(i)},leave(){r=void 0,n=!1,e.originalParentTypeName="",e.renamedParentTypeName="",e.lastParentNodeKind=Gn.Kind.NULL,e.isParentObjectExternal=!1,e.doesParentRequireFetchReasons=!1,e.isParentObjectShareable=!1}},ObjectTypeExtension:{enter(i){if(i.name.value===ia.SERVICE_OBJECT)return!1;e.originalParentTypeName=i.name.value,n=(0,Td.isTypeNameRootType)(e.originalParentTypeName,e.operationTypeNodeByTypeName),e.renamedParentTypeName=(0,Td.getRenamedRootTypeName)(e.originalParentTypeName,e.operationTypeNodeByTypeName),e.originalTypeNameByRenamedTypeName.set(e.renamedParentTypeName,e.originalParentTypeName),r=n?e.internalGraph.getRootNode(e.renamedParentTypeName):e.internalGraph.addOrUpdateNode(e.renamedParentTypeName),e.lastParentNodeKind=i.kind,e.upsertObjectDataByNode(i,!0)},leave(){r=void 0,n=!1,e.originalParentTypeName="",e.renamedParentTypeName="",e.lastParentNodeKind=Gn.Kind.NULL,e.isParentObjectExternal=!1,e.doesParentRequireFetchReasons=!1,e.isParentObjectShareable=!1}},ScalarTypeDefinition:{enter(i){if(i.name.value===ia.ANY_SCALAR)return!1;e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertScalarByNode(i)},leave(){e.originalParentTypeName="",e.lastParentNodeKind=Gn.Kind.NULL}},ScalarTypeExtension:{enter(i){if(i.name.value===ia.ANY_SCALAR)return!1;e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertScalarByNode(i,!0)},leave(){e.originalParentTypeName="",e.lastParentNodeKind=Gn.Kind.NULL}},UnionTypeDefinition:{enter(i){if(i.name.value===ia.ENTITY_UNION)return!1;e.upsertUnionByNode(i)}},UnionTypeExtension:{enter(i){if(i.name.value===ia.ENTITY_UNION)return!1;e.upsertUnionByNode(i,!0)}}})}});var nb=F(as=>{"use strict";m();T();N();Object.defineProperty(as,"__esModule",{value:!0});as.EntityDataNode=as.RootNode=as.GraphNode=as.Edge=void 0;var WE=Ur(),XD=class{constructor(t,n,r,i=!1){g(this,"edgeName");g(this,"id");g(this,"isAbstractEdge");g(this,"isExternal",!1);g(this,"isInaccessible",!1);g(this,"node");g(this,"visitedIndices",new Set);this.edgeName=i?`... on ${r}`:r,this.id=t,this.isAbstractEdge=i,this.node=n}isEdgeInaccessible(){return this.isInaccessible||this.node.isInaccessible}};as.Edge=XD;var ZD=class{constructor(t,n,r){g(this,"externalFieldSets",new Set);g(this,"fieldDataByName",new Map);g(this,"headToTailEdges",new Map);g(this,"entityEdges",new Array);g(this,"nodeName");g(this,"hasEntitySiblings",!1);g(this,"isAbstract");g(this,"isInaccessible",!1);g(this,"isLeaf",!1);g(this,"isRootNode",!1);g(this,"satisfiedFieldSets",new Set);g(this,"subgraphName");g(this,"typeName");this.isAbstract=!!(r!=null&&r.isAbstract),this.isLeaf=!!(r!=null&&r.isLeaf),this.nodeName=`${t}.${n}`,this.subgraphName=t,this.typeName=n}handleInaccessibleEdges(){if(this.isAbstract)return;let t=(0,WE.getEntriesNotInHashSet)(this.headToTailEdges.keys(),this.fieldDataByName);for(let n of t){let r=this.headToTailEdges.get(n);r&&(r.isInaccessible=!0)}}getAllAccessibleEntityNodeNames(){let t=new Set([this.nodeName]);return this.getAccessibleEntityNodeNames(this,t),t.delete(this.nodeName),t}getAccessibleEntityNodeNames(t,n){for(let r of t.entityEdges)(0,WE.add)(n,r.node.nodeName)&&this.getAccessibleEntityNodeNames(r.node,n)}};as.GraphNode=ZD;var eb=class{constructor(t){g(this,"fieldDataByName",new Map);g(this,"headToSharedTailEdges",new Map);g(this,"isAbstract",!1);g(this,"isRootNode",!0);g(this,"typeName");this.typeName=t}removeInaccessibleEdges(t){for(let[n,r]of this.headToSharedTailEdges)if(!t.has(n))for(let i of r)i.isInaccessible=!0}};as.RootNode=eb;var tb=class{constructor(t){g(this,"fieldSetsByTargetSubgraphName",new Map);g(this,"targetSubgraphNamesByFieldSet",new Map);g(this,"typeName");this.typeName=t}addTargetSubgraphByFieldSet(t,n){(0,WE.getValueOrDefault)(this.targetSubgraphNamesByFieldSet,t,()=>new Set).add(n),(0,WE.getValueOrDefault)(this.fieldSetsByTargetSubgraphName,n,()=>new Set).add(t)}};as.EntityDataNode=tb});var rb=F(Qn=>{"use strict";m();T();N();Object.defineProperty(Qn,"__esModule",{value:!0});Qn.ROOT_TYPE_NAMES=Qn.QUOTATION_JOIN=Qn.NOT_APPLICABLE=Qn.LITERAL_SPACE=Qn.LITERAL_PERIOD=Qn.SUBSCRIPTION=Qn.QUERY=Qn.MUTATION=void 0;Qn.MUTATION="Mutation";Qn.QUERY="Query";Qn.SUBSCRIPTION="Subscription";Qn.LITERAL_PERIOD=".";Qn.LITERAL_SPACE=" ";Qn.NOT_APPLICABLE="N/A";Qn.QUOTATION_JOIN='", "';Qn.ROOT_TYPE_NAMES=new Set([Qn.MUTATION,Qn.QUERY,Qn.SUBSCRIPTION])});var EV=F(XE=>{"use strict";m();T();N();Object.defineProperty(XE,"__esModule",{value:!0});XE.MAX_RESOLVABILITY_PATH_SIZE=void 0;XE.MAX_RESOLVABILITY_PATH_SIZE=5});var ob=F(Pa=>{"use strict";m();T();N();Object.defineProperty(Pa,"__esModule",{value:!0});Pa.newRootFieldData=Afe;Pa.generateResolvabilityErrorReasons=sb;Pa.generateSharedResolvabilityErrorReasons=hV;Pa.generateSelectionSetSegments=ZE;Pa.renderSelectionSet=eh;Pa.generateRootResolvabilityErrors=wfe;Pa.generateEntityResolvabilityErrors=Lfe;Pa.generateSharedEntityResolvabilityErrors=Cfe;Pa.getMultipliedRelativeOriginPaths=Ufe;var ib=Qi(),ab=Ur(),br=rb(),bfe=EV();function Afe(e,t,n){return{coords:`${e}.${t}`,message:`The root type field "${e}.${t}" is defined in the following subgraph`+(n.size>1?"s":"")+`: "${[...n].join(br.QUOTATION_JOIN)}".`,subgraphNames:n}}function Rfe(e,t){return e.isLeaf?e.name+` <-- +Although "${e}" is declared "@external", it is part of a "@key" directive on an extension type. Such fields are only declared "@external" for legacy syntactical reasons and are not internally considered "@external".`,subgraph:{name:r}})}function lfe({fieldName:e,subgraphName:t,typeName:n}){return new vr.Warning({message:`The directive "@oneOf" is defined on Input Object "${n}", but only one optional Input field, "${e}", is defined. Consider removing "@oneOf" and changing "${e}" to a required type instead.`,subgraph:{name:t}})}function dfe({subgraphName:e,fieldCoords:t,entityType:n,unmappedKeyField:r}){return new vr.Warning({message:`Field "${t}" has @openfed__queryCache returning "${n}" but @key field "${r}" cannot be mapped to any argument. Cache reads are disabled for this field (cache writes/population still work). Add an argument named "${r}" or use @openfed__is(fields: "${r}") to enable cache reads.`,subgraph:{name:e}})}function pfe({subgraphName:e,argumentName:t,fieldCoords:n,argumentType:r,keyField:i,entityType:a,keyFieldType:o}){return new vr.Warning({message:`Argument "${t}" on field "${n}" has type "${r}" but @key field "${i}" on entity "${a}" has type "${o}". Auto-mapping skipped due to type mismatch.`,subgraph:{name:e}})}function ffe({subgraphName:e,argumentName:t,fieldCoords:n,keyField:r,entityType:i,extraArgument:a}){return new vr.Warning({message:`Argument "${t}" on field "${n}" matches @key field "${r}" on entity "${i}", but field has additional argument "${a}" which is not mapped to a key field. Auto-mapping skipped \u2014 all arguments must be key arguments because additional arguments may filter the response, making the cache key incomplete.`,subgraph:{name:e}})}function mfe({subgraphName:e,fieldCoords:t,argumentName:n,keyField:r,entityType:i,extraArgument:a}){return new vr.Warning({message:`Field "${t}" returns a list of entities, so cache lookup is a batch lookup and requires a single key input that determines the returned entities. Argument "${n}" matches @key field "${r}" on entity "${i}", but additional argument "${a}" is not mapped to a key field and may filter the response, so auto-mapping is skipped because the batch key would be incomplete.`,subgraph:{name:e}})}function Nfe({fieldName:e,typeName:t}){return new vr.Warning({message:`The directive "@oneOf" is defined on Input Object "${t}", but only one optional Input field, "${e}", is propagated to the federated graph. Consider removing "@oneOf", changing "${e}" to a required type, and removing any other remaining optional Input fields instead.`,subgraph:{name:""}})}function Tfe({subgraphName:e,fieldCoords:t,entityType:n}){return new vr.Warning({message:`Field "${t}" has @openfed__queryCache and returns entity "${n}", but "${n}" has no @openfed__entityCache directive. Add @openfed__entityCache(maxAge: ...) to "${n}" to enable caching, or remove @openfed__queryCache from "${t}". The @openfed__queryCache config for this field was not extracted.`,subgraph:{name:e}})}function Efe({subgraphName:e,argumentName:t,fieldCoords:n,keyField:r,entityType:i}){return new vr.Warning({message:`Argument "${t}" on field "${n}" has @openfed__is(fields: "${r}"), but "${t}" already auto-maps to @key field "${r}" on entity "${i}". The @openfed__is directive is redundant and can be removed.`,subgraph:{name:e}})}function hfe({subgraphName:e,key:t,fieldCoords:n}){return new vr.Warning({message:`@openfed__requestScoped(key: "${t}") is declared on only one field ("${n}") in this subgraph. The directive is meaningless unless at least 2 fields share the same key so that the second and subsequent fields can be served from the per-request L1 cache populated by the first.`,subgraph:{name:e}})}});var mb=F(lh=>{"use strict";m();T();N();Object.defineProperty(lh,"__esModule",{value:!0});lh.upsertDirectiveSchemaAndEntityDefinitions=gfe;lh.upsertParentsAndChildren=_fe;var Hn=Oe(),Gu=Ji(),fb=ku(),ch=Pf(),Od=kr(),pb=Ff(),yfe=gd(),Sd=ed(),wf=Uu(),Ife=Lf(),sa=Zn(),Sr=Mr();function gfe(e,t){(0,Hn.visit)(t,{Directive:{enter(n){let r=n.name.value;return e.referencedDirectiveNames.add(r),yfe.EVENT_DIRECTIVE_NAMES.has(r)&&e.edfsDirectiveReferences.add(r),fb.V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.has(r)&&(e.isSubgraphVersionTwo=!0),!1}},DirectiveDefinition:{enter(n){return e.addDirectiveDefinitionDataByNode(n)&&e.customDirectiveDefinitionByName.set(n.name.value,n),!1}},InterfaceTypeDefinition:{enter(n){let r=n.name.value;if(e.internalGraph.addOrUpdateNode(r,{isAbstract:!0}),!(0,Od.isObjectLikeNodeEntity)(n))return;let i=(0,Sr.getValueOrDefault)(e.keyFieldSetDatasByTypeName,r,()=>new Map);e.extractKeyFieldSets(n,i),(0,ch.upsertEntityData)({entityDataByTypeName:e.entityDataByTypeName,keyFieldSetDataByFieldSet:i,subgraphName:e.subgraphName,typeName:r}),(0,Sr.getValueOrDefault)(e.entityInterfaceDataByTypeName,r,()=>({concreteTypeNames:new Set,fieldDatas:[],interfaceFieldNames:new Set,interfaceObjectFieldNames:new Set,isInterfaceObject:!1,resolvable:!1,typeName:r}))}},InterfaceTypeExtension:{enter(n){let r=n.name.value;if(e.internalGraph.addOrUpdateNode(r,{isAbstract:!0}),!(0,Od.isObjectLikeNodeEntity)(n))return;let i=(0,Sr.getValueOrDefault)(e.keyFieldSetDatasByTypeName,r,()=>new Map);e.extractKeyFieldSets(n,i),(0,ch.upsertEntityData)({entityDataByTypeName:e.entityDataByTypeName,keyFieldSetDataByFieldSet:i,subgraphName:e.subgraphName,typeName:r}),(0,Sr.getValueOrDefault)(e.entityInterfaceDataByTypeName,r,()=>({concreteTypeNames:new Set,fieldDatas:[],interfaceFieldNames:new Set,interfaceObjectFieldNames:new Set,isInterfaceObject:!1,resolvable:!1,typeName:r}))}},ObjectTypeDefinition:{enter(n){if(!(0,Od.isObjectLikeNodeEntity)(n))return;let r=n.name.value;(0,Od.isNodeInterfaceObject)(n)&&(e.entityInterfaceDataByTypeName.set(r,{concreteTypeNames:new Set,fieldDatas:[],interfaceObjectFieldNames:new Set,interfaceFieldNames:new Set,isInterfaceObject:!0,resolvable:!1,typeName:r}),e.internalGraph.addOrUpdateNode(r,{isAbstract:!0}));let i=(0,Sr.getValueOrDefault)(e.keyFieldSetDatasByTypeName,r,()=>new Map);e.extractKeyFieldSets(n,i),(0,ch.upsertEntityData)({entityDataByTypeName:e.entityDataByTypeName,keyFieldSetDataByFieldSet:i,subgraphName:e.subgraphName,typeName:r})}},ObjectTypeExtension:{enter(n){if(!(0,Od.isObjectLikeNodeEntity)(n))return;let r=n.name.value,i=(0,Sr.getValueOrDefault)(e.keyFieldSetDatasByTypeName,r,()=>new Map);e.extractKeyFieldSets(n,i),(0,ch.upsertEntityData)({entityDataByTypeName:e.entityDataByTypeName,keyFieldSetDataByFieldSet:i,subgraphName:e.subgraphName,typeName:r})}},OperationTypeDefinition:{enter(n){let r=n.operation,i=e.schemaData.operationTypes.get(r),a=(0,wf.getTypeNodeNamedTypeName)(n.type);if(i)return e.errors.push((0,Gu.duplicateOperationTypeDefinitionError)(r,a,(0,wf.getTypeNodeNamedTypeName)(i.type))),!1;let o=e.operationTypeNodeByTypeName.get(a);return o?(e.errors.push((0,Gu.invalidOperationTypeDefinitionError)(o,a,r)),!1):(e.operationTypeNodeByTypeName.set(a,r),e.schemaData.operationTypes.set(r,n),!1)}},SchemaDefinition:{enter(n){e.schemaData.description=n.description,e.extractDirectives(n,e.schemaData.directivesByName)}},SchemaExtension:{enter(n){e.extractDirectives(n,e.schemaData.directivesByName)}}})}function _fe(e,t){let n=!1,r;(0,Hn.visit)(t,{EnumTypeDefinition:{enter(i){e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertEnumDataByNode(i)},leave(){e.originalParentTypeName="",e.lastParentNodeKind=Hn.Kind.NULL}},EnumTypeExtension:{enter(i){e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertEnumDataByNode(i,!0)},leave(){e.originalParentTypeName="",e.lastParentNodeKind=Hn.Kind.NULL}},EnumValueDefinition:{enter(i){let a=i.name.value;e.lastChildNodeKind=i.kind;let o=(0,Sr.getOrThrowError)(e.parentDefinitionDataByTypeName,e.originalParentTypeName,sa.PARENT_DEFINITION_DATA);if(o.kind!==Hn.Kind.ENUM_TYPE_DEFINITION){e.errors.push((0,Gu.unexpectedParentKindForChildError)(e.originalParentTypeName,"Enum or Enum extension",(0,Sr.kindToNodeType)(o.kind),a,(0,Sr.kindToNodeType)(i.kind)));return}if(o.enumValueDataByName.has(a)){e.errors.push((0,Gu.duplicateEnumValueDefinitionError)(e.originalParentTypeName,a));return}o.enumValueDataByName.set(a,{appearances:1,configureDescriptionDataBySubgraphName:new Map,directivesByName:e.extractDirectives(i,new Map),federatedCoords:`${e.originalParentTypeName}.${a}`,kind:Hn.Kind.ENUM_VALUE_DEFINITION,name:a,node:(0,wf.getMutableEnumValueNode)(i),parentTypeName:e.originalParentTypeName,persistedDirectivesData:(0,Sd.newPersistedDirectivesData)(),subgraphNames:new Set([e.subgraphName]),description:(0,Od.formatDescription)(i.description)})},leave(){e.lastChildNodeKind=Hn.Kind.NULL}},FieldDefinition:{enter(i){let a=i.name.value;if(n&&sa.IGNORED_FIELDS.has(a))return!1;e.edfsDirectiveReferences.size>0&&e.validateSubscriptionFilterDirectiveLocation(i),e.lastChildNodeKind=i.kind;let o=(0,wf.getTypeNodeNamedTypeName)(i.type);(0,Sr.getValueOrDefault)(e.fieldCoordsByNamedTypeName,o,()=>new Set).add(`${e.renamedParentTypeName||e.originalParentTypeName}.${a}`),r&&!r.isAbstract&&e.internalGraph.addEdge(r,e.internalGraph.addOrUpdateNode(o),a),fb.BASE_SCALARS.has(o)||e.referencedTypeNames.add(o);let u=(0,Sr.getOrThrowError)(e.parentDefinitionDataByTypeName,e.originalParentTypeName,sa.PARENT_DEFINITION_DATA);if(!(0,Sd.isParentDataCompositeOutputType)(u)){e.errors.push((0,Gu.unexpectedParentKindForChildError)(e.originalParentTypeName,'"Object" or "Interface"',(0,Sr.kindToNodeType)(u.kind),a,(0,Sr.kindToNodeType)(i.kind)));return}if(u.fieldDataByName.has(a)){e.errors.push((0,Gu.duplicateFieldDefinitionError)((0,Sr.kindToNodeType)(u.kind),u.name,a));return}let l=e.extractArguments(new Map,i),d=e.extractDirectives(i,new Map),p=new Set;e.handleFieldInheritableDirectives({directivesByName:d,fieldName:a,inheritedDirectiveNames:p,parentData:u});let E=e.addFieldDataByNode(u.fieldDataByName,i,l,d,p);n&&e.extractEventDirectivesToConfiguration(i,l);let h=E.directivesByName.get(sa.PROVIDES),_=E.directivesByName.get(sa.REQUIRES);if(!_&&!h)return;let S=e.entityDataByTypeName.get(e.originalParentTypeName),k=(0,Sr.getValueOrDefault)(e.fieldSetDataByTypeName,e.originalParentTypeName,pb.newFieldSetData);h&&(0,pb.extractFieldSetValue)(a,k.provides,h),_&&(S||e.warnings.push((0,Ife.requiresDefinedOnNonEntityFieldWarning)(`${e.originalParentTypeName}.${a}`,e.subgraphName)),(0,pb.extractFieldSetValue)(a,k.requires,_))},leave(){e.lastChildNodeKind=Hn.Kind.NULL}},InputObjectTypeDefinition:{enter(i){e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertInputObjectByNode(i)},leave(){e.lastParentNodeKind=Hn.Kind.NULL,e.originalParentTypeName=""}},InputObjectTypeExtension:{enter(i){e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertInputObjectByNode(i,!0)},leave(){e.originalParentTypeName="",e.lastParentNodeKind=Hn.Kind.NULL}},InputValueDefinition:{enter(i){let a=i.name.value;if(e.lastParentNodeKind!==Hn.Kind.INPUT_OBJECT_TYPE_DEFINITION&&e.lastParentNodeKind!==Hn.Kind.INPUT_OBJECT_TYPE_EXTENSION){e.argumentName=a;return}e.lastChildNodeKind=i.kind;let o=(0,wf.getTypeNodeNamedTypeName)(i.type);fb.BASE_SCALARS.has(o)||e.referencedTypeNames.add(o);let u=(0,Sr.getOrThrowError)(e.parentDefinitionDataByTypeName,e.originalParentTypeName,sa.PARENT_DEFINITION_DATA);if(u.kind!==Hn.Kind.INPUT_OBJECT_TYPE_DEFINITION)return e.errors.push((0,Gu.unexpectedParentKindForChildError)(e.originalParentTypeName,"input object or input object extension",(0,Sr.kindToNodeType)(u.kind),a,(0,Sr.kindToNodeType)(i.kind))),!1;if(u.inputValueDataByName.has(a)){e.errors.push((0,Gu.duplicateInputFieldDefinitionError)(e.originalParentTypeName,a));return}e.addInputValueDataByNode({inputValueDataByName:u.inputValueDataByName,isArgument:!1,node:i,originalParentTypeName:e.originalParentTypeName})},leave(){e.argumentName="",e.lastChildNodeKind===Hn.Kind.INPUT_VALUE_DEFINITION&&(e.lastChildNodeKind=Hn.Kind.NULL)}},InterfaceTypeDefinition:{enter(i){e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertInterfaceDataByNode(i)},leave(){e.doesParentRequireFetchReasons=!1,e.originalParentTypeName="",e.lastParentNodeKind=Hn.Kind.NULL}},InterfaceTypeExtension:{enter(i){e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertInterfaceDataByNode(i,!0)},leave(){e.doesParentRequireFetchReasons=!1,e.originalParentTypeName="",e.lastParentNodeKind=Hn.Kind.NULL}},ObjectTypeDefinition:{enter(i){if(i.name.value===sa.SERVICE_OBJECT)return!1;e.originalParentTypeName=i.name.value,n=(0,Sd.isTypeNameRootType)(e.originalParentTypeName,e.operationTypeNodeByTypeName),e.renamedParentTypeName=(0,Sd.getRenamedRootTypeName)(e.originalParentTypeName,e.operationTypeNodeByTypeName),e.originalTypeNameByRenamedTypeName.set(e.renamedParentTypeName,e.originalParentTypeName),r=n?e.internalGraph.getRootNode(e.renamedParentTypeName):e.internalGraph.addOrUpdateNode(e.renamedParentTypeName),e.lastParentNodeKind=i.kind,e.upsertObjectDataByNode(i)},leave(){r=void 0,n=!1,e.originalParentTypeName="",e.renamedParentTypeName="",e.lastParentNodeKind=Hn.Kind.NULL,e.isParentObjectExternal=!1,e.doesParentRequireFetchReasons=!1,e.isParentObjectShareable=!1}},ObjectTypeExtension:{enter(i){if(i.name.value===sa.SERVICE_OBJECT)return!1;e.originalParentTypeName=i.name.value,n=(0,Sd.isTypeNameRootType)(e.originalParentTypeName,e.operationTypeNodeByTypeName),e.renamedParentTypeName=(0,Sd.getRenamedRootTypeName)(e.originalParentTypeName,e.operationTypeNodeByTypeName),e.originalTypeNameByRenamedTypeName.set(e.renamedParentTypeName,e.originalParentTypeName),r=n?e.internalGraph.getRootNode(e.renamedParentTypeName):e.internalGraph.addOrUpdateNode(e.renamedParentTypeName),e.lastParentNodeKind=i.kind,e.upsertObjectDataByNode(i,!0)},leave(){r=void 0,n=!1,e.originalParentTypeName="",e.renamedParentTypeName="",e.lastParentNodeKind=Hn.Kind.NULL,e.isParentObjectExternal=!1,e.doesParentRequireFetchReasons=!1,e.isParentObjectShareable=!1}},ScalarTypeDefinition:{enter(i){if(i.name.value===sa.ANY_SCALAR)return!1;e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertScalarByNode(i)},leave(){e.originalParentTypeName="",e.lastParentNodeKind=Hn.Kind.NULL}},ScalarTypeExtension:{enter(i){if(i.name.value===sa.ANY_SCALAR)return!1;e.originalParentTypeName=i.name.value,e.lastParentNodeKind=i.kind,e.upsertScalarByNode(i,!0)},leave(){e.originalParentTypeName="",e.lastParentNodeKind=Hn.Kind.NULL}},UnionTypeDefinition:{enter(i){if(i.name.value===sa.ENTITY_UNION)return!1;e.upsertUnionByNode(i)}},UnionTypeExtension:{enter(i){if(i.name.value===sa.ENTITY_UNION)return!1;e.upsertUnionByNode(i,!0)}}})}});var yb=F(ss=>{"use strict";m();T();N();Object.defineProperty(ss,"__esModule",{value:!0});ss.EntityDataNode=ss.RootNode=ss.GraphNode=ss.Edge=void 0;var dh=Mr(),Nb=class{constructor(t,n,r,i=!1){y(this,"edgeName");y(this,"id");y(this,"isAbstractEdge");y(this,"isExternal",!1);y(this,"isInaccessible",!1);y(this,"node");y(this,"visitedIndices",new Set);this.edgeName=i?`... on ${r}`:r,this.id=t,this.isAbstractEdge=i,this.node=n}isEdgeInaccessible(){return this.isInaccessible||this.node.isInaccessible}};ss.Edge=Nb;var Tb=class{constructor(t,n,r){y(this,"externalFieldSets",new Set);y(this,"fieldDataByName",new Map);y(this,"headToTailEdges",new Map);y(this,"entityEdges",new Array);y(this,"nodeName");y(this,"hasEntitySiblings",!1);y(this,"isAbstract");y(this,"isInaccessible",!1);y(this,"isLeaf",!1);y(this,"isRootNode",!1);y(this,"satisfiedFieldSets",new Set);y(this,"subgraphName");y(this,"typeName");this.isAbstract=!!(r!=null&&r.isAbstract),this.isLeaf=!!(r!=null&&r.isLeaf),this.nodeName=`${t}.${n}`,this.subgraphName=t,this.typeName=n}handleInaccessibleEdges(){if(this.isAbstract)return;let t=(0,dh.getEntriesNotInHashSet)(this.headToTailEdges.keys(),this.fieldDataByName);for(let n of t){let r=this.headToTailEdges.get(n);r&&(r.isInaccessible=!0)}}getAllAccessibleEntityNodeNames(){let t=new Set([this.nodeName]);return this.getAccessibleEntityNodeNames(this,t),t.delete(this.nodeName),t}getAccessibleEntityNodeNames(t,n){for(let r of t.entityEdges)(0,dh.add)(n,r.node.nodeName)&&this.getAccessibleEntityNodeNames(r.node,n)}};ss.GraphNode=Tb;var Eb=class{constructor(t){y(this,"fieldDataByName",new Map);y(this,"headToSharedTailEdges",new Map);y(this,"isAbstract",!1);y(this,"isRootNode",!0);y(this,"typeName");this.typeName=t}removeInaccessibleEdges(t){for(let[n,r]of this.headToSharedTailEdges)if(!t.has(n))for(let i of r)i.isInaccessible=!0}};ss.RootNode=Eb;var hb=class{constructor(t){y(this,"fieldSetsByTargetSubgraphName",new Map);y(this,"targetSubgraphNamesByFieldSet",new Map);y(this,"typeName");this.typeName=t}addTargetSubgraphByFieldSet(t,n){(0,dh.getValueOrDefault)(this.targetSubgraphNamesByFieldSet,t,()=>new Set).add(n),(0,dh.getValueOrDefault)(this.fieldSetsByTargetSubgraphName,n,()=>new Set).add(t)}};ss.EntityDataNode=hb});var Ib=F(zn=>{"use strict";m();T();N();Object.defineProperty(zn,"__esModule",{value:!0});zn.ROOT_TYPE_NAMES=zn.QUOTATION_JOIN=zn.NOT_APPLICABLE=zn.LITERAL_SPACE=zn.LITERAL_PERIOD=zn.SUBSCRIPTION=zn.QUERY=zn.MUTATION=void 0;zn.MUTATION="Mutation";zn.QUERY="Query";zn.SUBSCRIPTION="Subscription";zn.LITERAL_PERIOD=".";zn.LITERAL_SPACE=" ";zn.NOT_APPLICABLE="N/A";zn.QUOTATION_JOIN='", "';zn.ROOT_TYPE_NAMES=new Set([zn.MUTATION,zn.QUERY,zn.SUBSCRIPTION])});var FK=F(ph=>{"use strict";m();T();N();Object.defineProperty(ph,"__esModule",{value:!0});ph.MAX_RESOLVABILITY_PATH_SIZE=void 0;ph.MAX_RESOLVABILITY_PATH_SIZE=5});var Sb=F(Fa=>{"use strict";m();T();N();Object.defineProperty(Fa,"__esModule",{value:!0});Fa.newRootFieldData=Sfe;Fa.generateResolvabilityErrorReasons=vb;Fa.generateSharedResolvabilityErrorReasons=LK;Fa.generateSelectionSetSegments=fh;Fa.renderSelectionSet=mh;Fa.generateRootResolvabilityErrors=Afe;Fa.generateEntityResolvabilityErrors=Rfe;Fa.generateSharedEntityResolvabilityErrors=Pfe;Fa.getMultipliedRelativeOriginPaths=Ffe;var gb=Ji(),_b=Mr(),Pr=Ib(),vfe=FK();function Sfe(e,t,n){return{coords:`${e}.${t}`,message:`The root type field "${e}.${t}" is defined in the following subgraph`+(n.size>1?"s":"")+`: "${[...n].join(Pr.QUOTATION_JOIN)}".`,subgraphNames:n}}function Ofe(e,t){return e.isLeaf?e.name+` <-- `:e.name+` { <-- -`+br.LITERAL_SPACE.repeat(t+3)+`... -`+br.LITERAL_SPACE.repeat(t+2)+`} -`}function sb({entityAncestorData:e,rootFieldData:t,unresolvableFieldData:n}){let{externalSubgraphNames:r,fieldName:i,typeName:a,subgraphNames:o}=n,u=[t.message];if(r.size>0){let l=o.difference(r);u.push(`The field "${a}.${i}" is defined (and resolvable) in the following subgraph`+(l.size>1?"s":"")+`: "${[...l].join(br.QUOTATION_JOIN)}".`,`The field "${a}.${i}" is defined "@external" (and unresolvable) in the following subgraph`+(r.size>1?"s":"")+`: "${[...r].join(br.QUOTATION_JOIN)}".`)}else u.push(`The field "${a}.${i}" is defined in the following subgraph`+(o.size>1?"s":"")+`: "${[...o].join(br.QUOTATION_JOIN)}".`);if(e){let l=!1;for(let[d,p]of e.fieldSetsByTargetSubgraphName)if(o.has(d)){l=!0;for(let E of p)e.subgraphName!==d&&u.push(`The entity ancestor "${e.typeName}" in subgraph "${e.subgraphName}" does not satisfy the key field set "${E}" to access subgraph "${d}".`)}l||u.push(`The entity ancestor "${e.typeName}" in subgraph "${e.subgraphName}" has no accessible target entities (resolvable @key directives) in the subgraphs where "${a}.${i}" is defined.`),u.push(`The type "${a}" is not a descendant of any other entity ancestors that can provide a shared route to access "${i}".`)}else t.subgraphNames.size>1&&u.push(`None of the subgraphs that shares the same root type field "${t.coords}" can provide a route to access "${i}".`),u.push(`The type "${a}" is not a descendant of an entity ancestor that can provide a shared route to access "${i}".`);return a!==(e==null?void 0:e.typeName)&&u.push(`The type "${a}" has no accessible target entities (resolvable @key directives) in any other subgraph, so accessing other subgraphs is not possible.`),u}function Pfe({entityAncestors:{subgraphNames:e,typeName:t},fieldSets:n,reasons:r,targetSubgraphName:i}){for(let a of n){let o=e.filter(l=>l!==i);if(o.length<1)continue;let u=o.length>1;r.push(`The entity ancestor${u?"s":""} "${t}" in subgraph${u?"s":""} "${o.join(br.QUOTATION_JOIN)}" do${u?"":"es"} not satisfy the key field set "${a}" to access subgraph "${i}".`)}}function Ffe({coords:e,entityAncestors:{sourceSubgraphNamesBySatisfiedFieldSet:t,subgraphNames:n,typeName:r},fieldSets:i,reasons:a,targetSubgraphName:o}){let u=[],l=[];for(let d of i){let p=t.get(d);if(!p){let v=n.filter(B=>B!==o),A=v.length>1;u.push(`The entity ancestor${A?"s":""} "${r}" in subgraph${A?"s":""} "${v.join(br.QUOTATION_JOIN)}" do${A?"":"es"} not satisfy the key field set "${d}" to access subgraph "${o}".`);continue}let E=p.filter(v=>v!==o);if(E.length<1)continue;let h=E.length>1;l.push(`The entity ancestor "${r}" in subgraph${h?"s":""} "${E.join(br.QUOTATION_JOIN)}" ${h?"are":"is"} able to satisfy at least one key field set to access subgraph "${o}", but this still does not provide a route to resolve "${e}".`)}a.push(...l.length>0?l:u)}function hV({entityAncestors:e,rootFieldData:t,unresolvableFieldData:n}){let{externalSubgraphNames:r,fieldName:i,typeName:a,subgraphNames:o}=n,u=`${a}.${i}`,l=[t.message];if(r.size>0){let E=o.difference(r);l.push(`The field "${a}.${i}" is defined (and resolvable) in the following subgraph`+(E.size>1?"s":"")+`: "${[...E].join(br.QUOTATION_JOIN)}".`,`The field "${a}.${i}" is defined "@external" (and unresolvable) in the following subgraph`+(r.size>1?"s":"")+`: "${[...r].join(br.QUOTATION_JOIN)}".`)}else l.push(`The field "${a}.${i}" is defined in the following subgraph`+(o.size>1?"s":"")+`: "${[...o].join(br.QUOTATION_JOIN)}".`);let d=a===e.typeName,p=!1;for(let[E,h]of e.fieldSetsByTargetSubgraphName)o.has(E)&&(p=!0,d?Pfe({coords:u,entityAncestors:e,fieldSets:h,reasons:l,targetSubgraphName:E}):Ffe({coords:u,entityAncestors:e,fieldSets:h,reasons:l,targetSubgraphName:E}));if(!p){let E=e.subgraphNames.length>1;l.push(`The entity ancestor "${e.typeName}" in subgraph${E?"s":""} "${e.subgraphNames.join(br.QUOTATION_JOIN)}" has no accessible target entities (resolvable @key directives) in the subgraphs where "${u}" is defined.`)}return l.push(`The type "${a}" is not a descendant of any other entity ancestors that can provide a shared route to access "${i}".`),a!==e.typeName&&l.push(`The type "${a}" has no accessible target entities (resolvable @key directives) in any other subgraph, so accessing other subgraphs is not possible.`),l}function ZE(e,t=bfe.MAX_RESOLVABILITY_PATH_SIZE){let n=e.split(new RegExp("(?<=\\w)\\.")),r="",i="",a=!1,o=n.length-t*2;t>0&&n.length>t*2+1&&(a=!0,n.splice(t+1,o-1));for(let u=0;u{"use strict";m();T();N();Object.defineProperty(th,"__esModule",{value:!0});th.NodeResolutionData=void 0;var IV=Qi(),Vc,cb=class cb{constructor({fieldDataByName:t,isResolved:n=!1,resolvedDescendantNames:r,resolvedFieldNames:i,typeName:a}){rc(this,Vc,!1);g(this,"fieldDataByName");g(this,"resolvedDescendantNames");g(this,"resolvedFieldNames");g(this,"typeName");rI(this,Vc,n),this.fieldDataByName=t,this.resolvedDescendantNames=new Set(r),this.resolvedFieldNames=new Set(i),this.typeName=a}addData({resolvedDescendantNames:t,resolvedFieldNames:n}){for(let r of n)this.addResolvedFieldName(r);for(let r of t)this.resolvedDescendantNames.add(r)}addResolvedFieldName(t){if(!this.fieldDataByName.has(t))throw(0,IV.unexpectedEdgeFatalError)(this.typeName,[t]);this.resolvedFieldNames.add(t)}addExternalSubgraphName({fieldName:t,subgraphName:n}){let r=this.fieldDataByName.get(t);if(!r)throw(0,IV.unexpectedEdgeFatalError)(this.typeName,[t]);r.externalSubgraphNames.add(n)}copy(){return new cb({fieldDataByName:this.fieldDataByName,isResolved:nI(this,Vc),resolvedDescendantNames:this.resolvedDescendantNames,resolvedFieldNames:this.resolvedFieldNames,typeName:this.typeName})}areDescendantsResolved(){return this.fieldDataByName.size===this.resolvedDescendantNames.size}isResolved(){if(nI(this,Vc))return!0;if(this.fieldDataByName.size!==this.resolvedFieldNames.size)return!1;for(let t of this.fieldDataByName.keys())if(!this.resolvedFieldNames.has(t))return!1;return rI(this,Vc,!0),!0}};Vc=new WeakMap;var ub=cb;th.NodeResolutionData=ub});var gV=F(rh=>{"use strict";m();T();N();Object.defineProperty(rh,"__esModule",{value:!0});rh.EntityWalker=void 0;var Bfe=nh(),ss=Ur(),lb=class{constructor({encounteredEntityNodeNames:t,index:n,relativeOriginPaths:r,resDataByNodeName:i,resDataByRelativeOriginPath:a,resolvedPaths:o,subgraphNameByUnresolvablePath:u,visitedEntities:l}){g(this,"encounteredEntityNodeNames");g(this,"index");g(this,"resDataByNodeName");g(this,"resDataByRelativeOriginPath");g(this,"resolvedPaths");g(this,"selectionPathByEntityNodeName",new Map);g(this,"subgraphNameByUnresolvablePath");g(this,"visitedEntities");g(this,"relativeOriginPaths");this.encounteredEntityNodeNames=t,this.index=n,this.relativeOriginPaths=r,this.resDataByNodeName=i,this.resDataByRelativeOriginPath=a,this.resolvedPaths=o,this.subgraphNameByUnresolvablePath=u,this.visitedEntities=l}getNodeResolutionData({node:{fieldDataByName:t,nodeName:n,typeName:r},selectionPath:i}){let a=(0,ss.getValueOrDefault)(this.resDataByNodeName,n,()=>new Bfe.NodeResolutionData({fieldDataByName:t,typeName:r}));if(!this.relativeOriginPaths||this.relativeOriginPaths.size<1)return(0,ss.getValueOrDefault)(this.resDataByRelativeOriginPath,i,()=>a.copy());let o;for(let u of this.relativeOriginPaths){let l=(0,ss.getValueOrDefault)(this.resDataByRelativeOriginPath,`${u}${i}`,()=>a.copy());o!=null||(o=l)}return o}visitEntityDescendantEdge({edge:t,selectionPath:n}){if(t.isEdgeInaccessible())return{visited:!1,areDescendantsResolved:!1};if(t.isExternal)return{visited:!1,areDescendantsResolved:!1,isExternal:!0};if(t.node.isLeaf)return{visited:!0,areDescendantsResolved:!0};let r=`${n}.${t.edgeName}`;return this.getNodeResolutionData({node:t.node,selectionPath:r}).areDescendantsResolved()?{visited:!0,areDescendantsResolved:!0}:(0,ss.add)(t.visitedIndices,this.index)?t.node.hasEntitySiblings?this.visitedEntities.has(t.node.nodeName)||this.encounteredEntityNodeNames.has(t.node.nodeName)?{visited:!0,areDescendantsResolved:!0}:(this.encounteredEntityNodeNames.add(t.node.nodeName),(0,ss.getValueOrDefault)(this.selectionPathByEntityNodeName,t.node.nodeName,()=>r),{visited:!0,areDescendantsResolved:!1}):t.node.isAbstract?this.visitEntityDescendantAbstractNode({node:t.node,selectionPath:r}):this.visitEntityDescendantConcreteNode({node:t.node,selectionPath:r}):(this.removeUnresolvablePaths({selectionPath:r,removeDescendantPaths:!0}),{visited:!0,areDescendantsResolved:!0,isRevisitedNode:!0})}visitEntityDescendantConcreteNode({node:t,selectionPath:n}){if(t.headToTailEdges.size<1)return t.isLeaf=!0,{visited:!0,areDescendantsResolved:!0};let r=this.getNodeResolutionData({node:t,selectionPath:n});if(r.isResolved()&&r.areDescendantsResolved())return{visited:!0,areDescendantsResolved:!0};let i;for(let[a,o]of t.headToTailEdges){let{areDescendantsResolved:u,isExternal:l,isRevisitedNode:d,visited:p}=this.visitEntityDescendantEdge({edge:o,selectionPath:n});i!=null||(i=d),this.propagateVisitedField({areDescendantsResolved:u,data:r,fieldName:a,isExternal:l,node:t,selectionPath:n,visited:p})}return r.isResolved()?this.removeUnresolvablePaths({removeDescendantPaths:i,selectionPath:n}):this.addUnresolvablePaths({selectionPath:n,subgraphName:t.subgraphName}),{visited:!0,areDescendantsResolved:r.areDescendantsResolved()}}visitEntityDescendantAbstractNode({node:t,selectionPath:n}){if(t.headToTailEdges.size<1)return{visited:!0,areDescendantsResolved:!0};let r=0;for(let i of t.headToTailEdges.values())this.visitEntityDescendantEdge({edge:i,selectionPath:n}).areDescendantsResolved&&(r+=1);return{visited:!0,areDescendantsResolved:r===t.headToTailEdges.size}}propagateVisitedField({areDescendantsResolved:t,data:n,fieldName:r,isExternal:i,node:a,selectionPath:o,visited:u}){if(i){n.addExternalSubgraphName({fieldName:r,subgraphName:a.subgraphName});return}if(!u)return;let l=(0,ss.getValueOrDefault)(this.resDataByNodeName,a.nodeName,()=>n.copy());if(n.addResolvedFieldName(r),l.addResolvedFieldName(r),t&&n.resolvedDescendantNames.add(r),this.relativeOriginPaths){for(let p of this.relativeOriginPaths){let E=(0,ss.getValueOrDefault)(this.resDataByRelativeOriginPath,`${p}${o}`,()=>n.copy());E.addResolvedFieldName(r),t&&(E.resolvedDescendantNames.add(r),this.removeUnresolvablePaths({selectionPath:`.${r}`,removeDescendantPaths:!0}))}return}let d=(0,ss.getValueOrDefault)(this.resDataByRelativeOriginPath,o,()=>n.copy());d.addResolvedFieldName(r),t&&d.resolvedDescendantNames.add(r)}addUnresolvablePaths({selectionPath:t,subgraphName:n}){if(!this.relativeOriginPaths){if(this.resolvedPaths.has(t))return;(0,ss.getValueOrDefault)(this.subgraphNameByUnresolvablePath,t,()=>n);return}for(let r of this.relativeOriginPaths){let i=`${r}${t}`;this.resolvedPaths.has(i)||(0,ss.getValueOrDefault)(this.subgraphNameByUnresolvablePath,i,()=>n)}}removeUnresolvablePaths({selectionPath:t,removeDescendantPaths:n}){if(!this.relativeOriginPaths){if(this.subgraphNameByUnresolvablePath.delete(t),n)for(let r of this.subgraphNameByUnresolvablePath.keys())r.startsWith(t)&&(this.subgraphNameByUnresolvablePath.delete(r),this.resolvedPaths.add(r));return}for(let r of this.relativeOriginPaths){let i=`${r}${t}`;if(this.subgraphNameByUnresolvablePath.delete(i),this.resolvedPaths.add(i),n)for(let a of this.subgraphNameByUnresolvablePath.keys())a.startsWith(i)&&(this.subgraphNameByUnresolvablePath.delete(a),this.resolvedPaths.add(a))}}};rh.EntityWalker=lb});var _V=F(ah=>{"use strict";m();T();N();Object.defineProperty(ah,"__esModule",{value:!0});ah.RootFieldWalker=void 0;var os=Ur(),ih=nh(),db=class{constructor({index:t,nodeResolutionDataByNodeName:n}){g(this,"index");g(this,"resDataByNodeName");g(this,"resDataByPath",new Map);g(this,"entityNodeNamesByPath",new Map);g(this,"pathsByEntityNodeName",new Map);g(this,"unresolvablePaths",new Set);this.index=t,this.resDataByNodeName=n}visitEdge({edge:t,selectionPath:n}){return t.isEdgeInaccessible()?{visited:!1,areDescendantsResolved:!1}:t.isExternal?{visited:!1,areDescendantsResolved:!1,isExternal:!0}:t.node.isLeaf?{visited:!0,areDescendantsResolved:!0}:(0,os.add)(t.visitedIndices,this.index)?t.node.hasEntitySiblings?this.resDataByNodeName.has(t.node.nodeName)?{visited:!0,areDescendantsResolved:!0}:((0,os.getValueOrDefault)(this.pathsByEntityNodeName,t.node.nodeName,()=>new Set).add(`${n}.${t.edgeName}`),{visited:!0,areDescendantsResolved:!1}):t.node.isAbstract?this.visitAbstractNode({node:t.node,selectionPath:`${n}.${t.edgeName}`}):this.visitConcreteNode({node:t.node,selectionPath:`${n}.${t.edgeName}`}):{visited:!0,areDescendantsResolved:!0}}visitAbstractNode({node:t,selectionPath:n}){if(t.headToTailEdges.size<1)return{visited:!0,areDescendantsResolved:!0};let r=0;for(let i of t.headToTailEdges.values())this.visitEdge({edge:i,selectionPath:n}).areDescendantsResolved&&(r+=1);return{visited:!0,areDescendantsResolved:r===t.headToTailEdges.size}}visitConcreteNode({node:t,selectionPath:n}){if(t.headToTailEdges.size<1)return t.isLeaf=!0,{visited:!0,areDescendantsResolved:!0};let r=this.resDataByNodeName.get(t.nodeName);if(r)return{visited:!0,areDescendantsResolved:r.areDescendantsResolved()};let i=this.getNodeResolutionData({node:t,selectionPath:n});if(i.isResolved()&&i.areDescendantsResolved())return{visited:!0,areDescendantsResolved:!0};for(let[a,o]of t.headToTailEdges){let{areDescendantsResolved:u,isExternal:l,visited:d}=this.visitEdge({edge:o,selectionPath:n});this.propagateVisitedField({areDescendantsResolved:u,data:i,fieldName:a,isExternal:l,node:t,selectionPath:n,visited:d})}return i.isResolved()?this.unresolvablePaths.delete(n):this.unresolvablePaths.add(n),{visited:!0,areDescendantsResolved:i.areDescendantsResolved()}}visitSharedEdge({edge:t,selectionPath:n}){return t.isEdgeInaccessible()?{visited:!1,areDescendantsResolved:!1}:t.isExternal?{visited:!1,areDescendantsResolved:!1,isExternal:!0}:t.node.isLeaf?{visited:!0,areDescendantsResolved:!0}:(0,os.add)(t.visitedIndices,this.index)?(t.node.hasEntitySiblings&&(0,os.getValueOrDefault)(this.entityNodeNamesByPath,`${n}.${t.edgeName}`,()=>new Set).add(t.node.nodeName),t.node.isAbstract?this.visitSharedAbstractNode({node:t.node,selectionPath:`${n}.${t.edgeName}`}):this.visitSharedConcreteNode({node:t.node,selectionPath:`${n}.${t.edgeName}`})):{visited:!0,areDescendantsResolved:!0}}visitSharedAbstractNode({node:t,selectionPath:n}){if(t.headToTailEdges.size<1)return{visited:!0,areDescendantsResolved:!0};let r=0;for(let i of t.headToTailEdges.values())this.visitSharedEdge({edge:i,selectionPath:n}).areDescendantsResolved&&(r+=1);return{visited:!0,areDescendantsResolved:r===t.headToTailEdges.size}}visitSharedConcreteNode({node:t,selectionPath:n}){if(t.headToTailEdges.size<1)return t.isLeaf=!0,{visited:!0,areDescendantsResolved:!0};let r=this.getSharedNodeResolutionData({node:t,selectionPath:n});if(r.isResolved()&&r.areDescendantsResolved())return{visited:!0,areDescendantsResolved:!0};for(let[i,a]of t.headToTailEdges){let{visited:o,areDescendantsResolved:u}=this.visitSharedEdge({edge:a,selectionPath:n});this.propagateSharedVisitedField({areDescendantsResolved:u,data:r,fieldName:i,node:t,visited:o})}return r.isResolved()?this.unresolvablePaths.delete(n):this.unresolvablePaths.add(n),{visited:!0,areDescendantsResolved:r.areDescendantsResolved()}}getNodeResolutionData({node:t,selectionPath:n}){let r=(0,os.getValueOrDefault)(this.resDataByNodeName,t.nodeName,()=>new ih.NodeResolutionData({fieldDataByName:t.fieldDataByName,typeName:t.typeName}));return(0,os.getValueOrDefault)(this.resDataByPath,n,()=>r.copy()),r}getSharedNodeResolutionData({node:t,selectionPath:n}){let r=(0,os.getValueOrDefault)(this.resDataByNodeName,t.nodeName,()=>new ih.NodeResolutionData({fieldDataByName:t.fieldDataByName,typeName:t.typeName}));return(0,os.getValueOrDefault)(this.resDataByPath,n,()=>r.copy())}propagateVisitedField({areDescendantsResolved:t,data:n,fieldName:r,isExternal:i,node:a,selectionPath:o,visited:u}){if(i){n.addExternalSubgraphName({fieldName:r,subgraphName:a.subgraphName});return}if(!u)return;n.addResolvedFieldName(r);let l=(0,os.getValueOrDefault)(this.resDataByPath,o,()=>new ih.NodeResolutionData({fieldDataByName:a.fieldDataByName,typeName:a.typeName}));l.addResolvedFieldName(r),t&&(n.resolvedDescendantNames.add(r),l.resolvedDescendantNames.add(r))}propagateSharedVisitedField({areDescendantsResolved:t,data:n,fieldName:r,node:i,visited:a}){if(!a)return;n.addResolvedFieldName(r);let o=(0,os.getValueOrDefault)(this.resDataByNodeName,i.nodeName,()=>new ih.NodeResolutionData({fieldDataByName:i.fieldDataByName,typeName:i.typeName}));o.addResolvedFieldName(r),t&&(n.resolvedDescendantNames.add(r),o.resolvedDescendantNames.add(r))}visitRootFieldEdges({edges:t,rootTypeName:n}){let r=t.length>1;for(let i of t){if(i.isInaccessible)return{visited:!1,areDescendantsResolved:!1};let a=r?this.visitSharedEdge({edge:i,selectionPath:n}):this.visitEdge({edge:i,selectionPath:n});if(a.areDescendantsResolved)return a}return{visited:!0,areDescendantsResolved:!1}}};ah.RootFieldWalker=db});var pb=F(oh=>{"use strict";m();T();N();Object.defineProperty(oh,"__esModule",{value:!0});oh.Graph=void 0;var hd=nb(),yd=ob(),Yr=Ur(),sh=rb(),kfe=gV(),Mfe=_V(),fb=class{constructor(){g(this,"edgeId",-1);g(this,"entityDataNodeByTypeName",new Map);g(this,"nodeByNodeName",new Map);g(this,"nodesByTypeName",new Map);g(this,"resolvedRootFieldNodeNames",new Set);g(this,"rootNodeByTypeName",new Map);g(this,"subgraphName",sh.NOT_APPLICABLE);g(this,"resDataByNodeName",new Map);g(this,"resDataByRelativePathByEntity",new Map);g(this,"visitedEntitiesByOriginEntity",new Map);g(this,"walkerIndex",-1)}getRootNode(t){return(0,Yr.getValueOrDefault)(this.rootNodeByTypeName,t,()=>new hd.RootNode(t))}addOrUpdateNode(t,n){let r=`${this.subgraphName}.${t}`,i=this.nodeByNodeName.get(r);if(i)return i.isAbstract||(i.isAbstract=!!(n!=null&&n.isAbstract)),!i.isLeaf&&(n!=null&&n.isLeaf)&&(i.isLeaf=!0),i;let a=new hd.GraphNode(this.subgraphName,t,n);return this.nodeByNodeName.set(r,a),(0,Yr.getValueOrDefault)(this.nodesByTypeName,t,()=>[]).push(a),a}addEdge(t,n,r,i=!1){if(t.isRootNode){let u=new hd.Edge(this.getNextEdgeId(),n,r);return(0,Yr.getValueOrDefault)(t.headToSharedTailEdges,r,()=>[]).push(u),u}let a=t,o=new hd.Edge(this.getNextEdgeId(),n,i?n.typeName:r,i);return a.headToTailEdges.set(r,o),o}addEntityDataNode(t){let n=this.entityDataNodeByTypeName.get(t);if(n)return n;let r=new hd.EntityDataNode(t);return this.entityDataNodeByTypeName.set(t,r),r}getNextEdgeId(){return this.edgeId+=1}getNextWalkerIndex(){return this.walkerIndex+=1}setNodeInaccessible(t){let n=this.nodesByTypeName.get(t);if(n)for(let r of n)r.isInaccessible=!0}initializeNode(t,n){let r=this.entityDataNodeByTypeName.get(t);if(sh.ROOT_TYPE_NAMES.has(t)){let a=this.getRootNode(t);a.removeInaccessibleEdges(n),a.fieldDataByName=n;return}let i=this.nodesByTypeName.get(t);if(i){for(let a of i)if(a.fieldDataByName=n,a.handleInaccessibleEdges(),a.isLeaf=!1,!!r){a.hasEntitySiblings=!0;for(let o of a.satisfiedFieldSets){if(a.externalFieldSets.has(o))continue;let u=r.targetSubgraphNamesByFieldSet.get(o);for(let l of u!=null?u:[]){if(l===a.subgraphName)continue;let d=this.nodeByNodeName.get(`${l}.${a.typeName}`);d&&a.entityEdges.push(new hd.Edge(this.getNextEdgeId(),d,""))}}}}}setSubgraphName(t){this.subgraphName=t}visitEntity({encounteredEntityNodeNames:t,entityNodeName:n,relativeOriginPaths:r,resDataByRelativeOriginPath:i,resolvedPaths:a,subgraphNameByUnresolvablePath:o,visitedEntities:u}){let l=this.nodeByNodeName.get(n);if(!l)throw new Error(`Fatal: Could not find entity node for "${n}".`);u.add(n);let d=this.nodesByTypeName.get(l.typeName);if(!(d!=null&&d.length))throw new Error(`Fatal: Could not find any nodes for "${n}".`);let p=new kfe.EntityWalker({encounteredEntityNodeNames:t,index:this.getNextWalkerIndex(),relativeOriginPaths:r,resDataByNodeName:this.resDataByNodeName,resDataByRelativeOriginPath:i,resolvedPaths:a,subgraphNameByUnresolvablePath:o,visitedEntities:u}),E=l.getAllAccessibleEntityNodeNames();for(let h of d){if(h.nodeName!==l.nodeName&&!E.has(h.nodeName))continue;let{areDescendantsResolved:v}=p.visitEntityDescendantConcreteNode({node:h,selectionPath:""});if(v)return}for(let[h,v]of p.selectionPathByEntityNodeName)this.visitEntity({encounteredEntityNodeNames:t,entityNodeName:h,relativeOriginPaths:(0,yd.getMultipliedRelativeOriginPaths)({relativeOriginPaths:r,selectionPath:v}),resDataByRelativeOriginPath:i,resolvedPaths:a,subgraphNameByUnresolvablePath:o,visitedEntities:u})}validate(){for(let t of this.rootNodeByTypeName.values())for(let[n,r]of t.headToSharedTailEdges){let i=r.length>1;if(!i){let p=r[0].node.nodeName;if(this.resolvedRootFieldNodeNames.has(p))continue;this.resolvedRootFieldNodeNames.add(p)}let a=new Mfe.RootFieldWalker({index:this.getNextWalkerIndex(),nodeResolutionDataByNodeName:this.resDataByNodeName});if(a.visitRootFieldEdges({edges:r,rootTypeName:t.typeName.toLowerCase()}).areDescendantsResolved)continue;let o=i?a.entityNodeNamesByPath.size>0:a.pathsByEntityNodeName.size>0;if(a.unresolvablePaths.size<1&&!o)continue;let u=(0,Yr.getOrThrowError)(t.fieldDataByName,n,"fieldDataByName"),l=(0,yd.newRootFieldData)(t.typeName,n,u.subgraphNames);if(!o)return{errors:(0,yd.generateRootResolvabilityErrors)({unresolvablePaths:a.unresolvablePaths,resDataByPath:a.resDataByPath,rootFieldData:l}),success:!1};let d=this.validateEntities({isSharedRootField:i,rootFieldData:l,walker:a});if(!d.success)return d}return{success:!0}}consolidateUnresolvableRootWithEntityPaths({pathFromRoot:t,resDataByRelativeOriginPath:n,subgraphNameByUnresolvablePath:r,walker:i}){for(let a of i.unresolvablePaths){if(!a.startsWith(t))continue;let o=a.slice(t.length),u=(0,Yr.getOrThrowError)(i.resDataByPath,a,"rootFieldWalker.unresolvablePaths"),l=n.get(o);if(l){if(u.addData(l),l.addData(u),!u.isResolved()){i.unresolvablePaths.delete(a);continue}i.unresolvablePaths.delete(a),r.delete(o)}}}consolidateUnresolvableEntityWithRootPaths({pathFromRoot:t,resDataByRelativeOriginPath:n,subgraphNameByUnresolvablePath:r,walker:i}){for(let a of r.keys()){let o=(0,Yr.getOrThrowError)(n,a,"resDataByRelativeOriginPath"),u=`${t}${a}`,l=i.resDataByPath.get(u);l&&(o.addData(l),l.addData(o)),o.isResolved()&&r.delete(a)}}validateSharedRootFieldEntities({rootFieldData:t,walker:n}){let r=new Set;for(let[i,a]of n.entityNodeNamesByPath){if(n.unresolvablePaths.size<1)return{success:!0};let o=new Map,u=new Map;for(let l of a)this.visitEntity({encounteredEntityNodeNames:new Set,entityNodeName:l,resDataByRelativeOriginPath:u,resolvedPaths:r,subgraphNameByUnresolvablePath:o,visitedEntities:new Set});if(this.consolidateUnresolvableRootWithEntityPaths({pathFromRoot:i,resDataByRelativeOriginPath:u,subgraphNameByUnresolvablePath:o,walker:n}),!(o.size<1)&&(this.consolidateUnresolvableEntityWithRootPaths({pathFromRoot:i,resDataByRelativeOriginPath:u,subgraphNameByUnresolvablePath:o,walker:n}),!(o.size<1)))return{errors:(0,yd.generateSharedEntityResolvabilityErrors)({entityAncestors:this.getEntityAncestorCollection(a),pathFromRoot:i,resDataByPath:u,rootFieldData:t,subgraphNameByUnresolvablePath:o}),success:!1}}return n.unresolvablePaths.size>0?{errors:(0,yd.generateRootResolvabilityErrors)({resDataByPath:n.resDataByPath,rootFieldData:t,unresolvablePaths:n.unresolvablePaths}),success:!1}:{success:!0}}validateRootFieldEntities({rootFieldData:t,walker:n}){var i;let r=new Set;for(let[a,o]of n.pathsByEntityNodeName){let u=new Map;if(this.resDataByNodeName.has(a))continue;let l=(0,Yr.getValueOrDefault)(this.resDataByRelativePathByEntity,a,()=>new Map);if(this.visitEntity({encounteredEntityNodeNames:new Set,entityNodeName:a,resDataByRelativeOriginPath:l,resolvedPaths:r,subgraphNameByUnresolvablePath:u,visitedEntities:(0,Yr.getValueOrDefault)(this.visitedEntitiesByOriginEntity,a,()=>new Set)}),!(u.size<1))return{errors:this.getEntityResolvabilityErrors({entityNodeName:a,pathFromRoot:(i=(0,Yr.getFirstEntry)(o))!=null?i:"",rootFieldData:t,subgraphNameByUnresolvablePath:u}),success:!1}}return{success:!0}}validateEntities(t){return t.isSharedRootField?this.validateSharedRootFieldEntities(t):this.validateRootFieldEntities(t)}getEntityResolvabilityErrors({entityNodeName:t,pathFromRoot:n,rootFieldData:r,subgraphNameByUnresolvablePath:i}){let a=(0,Yr.getOrThrowError)(this.resDataByRelativePathByEntity,t,"resDataByRelativePathByEntity"),o=t.split(sh.LITERAL_PERIOD)[1],{fieldSetsByTargetSubgraphName:u}=(0,Yr.getOrThrowError)(this.entityDataNodeByTypeName,o,"entityDataNodeByTypeName");return(0,yd.generateEntityResolvabilityErrors)({entityAncestorData:{fieldSetsByTargetSubgraphName:u,subgraphName:"",typeName:o},pathFromRoot:n,resDataByPath:a,rootFieldData:r,subgraphNameByUnresolvablePath:i})}getEntityAncestorCollection(t){let n=(0,Yr.getFirstEntry)(t).split(sh.LITERAL_PERIOD)[1],{fieldSetsByTargetSubgraphName:r}=(0,Yr.getOrThrowError)(this.entityDataNodeByTypeName,n,"entityDataNodeByTypeName"),i=new Array,a=new Map;for(let o of t){let{satisfiedFieldSets:u,subgraphName:l}=(0,Yr.getOrThrowError)(this.nodeByNodeName,o,"nodeByNodeName");for(let d of u)(0,Yr.getValueOrDefault)(a,d,()=>[]).push(l);i.push(l)}return{fieldSetsByTargetSubgraphName:r,sourceSubgraphNamesBySatisfiedFieldSet:a,subgraphNames:i,typeName:n}}};oh.Graph=fb});var mb=F(uh=>{"use strict";m();T();N();Object.defineProperty(uh,"__esModule",{value:!0});uh.newFieldSetConditionData=xfe;uh.newConfigurationData=qfe;function xfe({fieldCoordinatesPath:e,fieldPath:t}){return{fieldCoordinatesPath:e,fieldPath:t}}function qfe(e,t){return{fieldNames:new Set,isRootNode:e,typeName:t}}});var Eb=F(jc=>{"use strict";m();T();N();Object.defineProperty(jc,"__esModule",{value:!0});jc.NormalizationFactory=void 0;jc.normalizeSubgraphFromString=$fe;jc.normalizeSubgraph=OV;jc.batchNormalize=Gfe;var Q=Se(),bn=Cr(),li=vp(),xr=Ru(),Yn=_p(),ne=Qi(),Dp=pd(),Vfe=Jv(),Ir=_E(),jfe=GD(),cs=Sp(),vV=WD(),us=Jf(),Rt=Ql(),nr=Au(),Tb=pb(),ch=OE(),W=Hn(),Kfe=jl(),Ue=Ur(),bp=mb(),SV=DE();function $fe({noLocation:e,options:t,sdlString:n}){let{error:r,documentNode:i}=(0,bn.safeParse)(n,e);return r||!i?{errors:[(0,ne.subgraphInvalidSyntaxError)(r)],success:!1,warnings:[]}:new Ap({internalGraph:new Tb.Graph,options:t}).normalize(i)}function OV({document:e,internalGraph:t,options:n,subgraphName:r}){return new Ap({internalGraph:t||new Tb.Graph,options:n,subgraphName:r}).normalize(e)}var Rp,Nb,lh,DV,Ap=class{constructor({internalGraph:t,options:n,subgraphName:r}){rc(this,Rp);rc(this,lh);g(this,"argumentName","");g(this,"authorizationDataByParentTypeName",new Map);g(this,"concreteTypeNamesByAbstractTypeName",new Map);g(this,"conditionalFieldDataByCoords",new Map);g(this,"configurationDataByTypeName",new Map);g(this,"costs",{fieldWeights:new Map,listSizes:new Map,typeWeights:new Map,directiveArgumentWeights:new Map});g(this,"customDirectiveDefinitionByName",new Map);g(this,"definedDirectiveNames",new Set);g(this,"directiveDefinitionByName",new Map);g(this,"directiveDefinitionDataByName",(0,li.initializeDirectiveDefinitionDatas)());g(this,"doesParentRequireFetchReasons",!1);g(this,"edfsDirectiveReferences",new Set);g(this,"errors",new Array);g(this,"entityDataByTypeName",new Map);g(this,"entityInterfaceDataByTypeName",new Map);g(this,"eventsConfigurations",new Map);g(this,"fieldSetDataByTypeName",new Map);g(this,"interfaceImplementationTypeNamesByInterfaceTypeName",new Map);g(this,"internalGraph");g(this,"invalidConfigureDescriptionNodeDatas",[]);g(this,"invalidORScopesCoords",new Set);g(this,"invalidRepeatedDirectiveNameByCoords",new Map);g(this,"isParentObjectExternal",!1);g(this,"isParentObjectShareable",!1);g(this,"isSubgraphEventDrivenGraph",!1);g(this,"isSubgraphVersionTwo",!1);g(this,"keyFieldSetDatasByTypeName",new Map);g(this,"lastParentNodeKind",Q.Kind.NULL);g(this,"lastChildNodeKind",Q.Kind.NULL);g(this,"options");g(this,"parentTypeNamesWithAuthDirectives",new Set);g(this,"keyFieldSetsByEntityTypeNameByFieldCoords",new Map);g(this,"keyFieldNamesByParentTypeName",new Map);g(this,"fieldCoordsByNamedTypeName",new Map);g(this,"operationTypeNodeByTypeName",new Map);g(this,"originalParentTypeName","");g(this,"originalTypeNameByRenamedTypeName",new Map);g(this,"overridesByTargetSubgraphName",new Map);g(this,"parentDefinitionDataByTypeName",new Map);g(this,"schemaData");g(this,"referencedDirectiveNames",new Set);g(this,"referencedTypeNames",new Set);g(this,"renamedParentTypeName","");g(this,"subgraphName");g(this,"unvalidatedExternalFieldCoords",new Set);g(this,"usesEdfsNatsStreamConfiguration",!1);g(this,"warnings",[]);this.options=n!=null?n:{},this.subgraphName=r||W.NOT_APPLICABLE,this.internalGraph=t,this.internalGraph.setSubgraphName(this.subgraphName),this.schemaData={directivesByName:new Map,kind:Q.Kind.SCHEMA_DEFINITION,name:W.SCHEMA,operationTypes:new Map}}sanitizeDefaultValue({data:t,namedTypeData:n,node:r}){t.defaultValue&&(0,Rt.isEnumData)(n)&&(t.defaultValue=(0,Q.visit)(t.defaultValue,{StringValue:{enter(i){return{kind:Q.Kind.ENUM,value:i.value}}}}),r&&(r.defaultValue=t.defaultValue))}validateArguments(t,n){for(let r of t.argumentDataByName.values()){let i=(0,nr.getTypeNodeNamedTypeName)(r.type);if(xr.BASE_SCALARS.has(i)){r.namedTypeKind=Q.Kind.SCALAR_TYPE_DEFINITION;continue}let a=this.parentDefinitionDataByTypeName.get(i);if(a){if((0,Rt.isInputNodeKind)(a.kind)){r.namedTypeKind=a.kind,this.sanitizeDefaultValue({data:r,namedTypeData:a,node:r.node});continue}this.errors.push((0,ne.invalidNamedTypeError)({data:r,namedTypeData:a,nodeType:`${(0,Ue.kindToNodeType)(n)} field argument`}))}}}isTypeNameRootType(t){return W.ROOT_TYPE_NAMES.has(t)||this.operationTypeNodeByTypeName.has(t)}isArgumentValueValid(t,n){if(n.kind===Q.Kind.NULL)return t.kind!==Q.Kind.NON_NULL_TYPE;switch(t.kind){case Q.Kind.LIST_TYPE:{if(n.kind!==Q.Kind.LIST)return this.isArgumentValueValid((0,nr.getNamedTypeNode)(t.type),n);for(let r of n.values)if(!this.isArgumentValueValid(t.type,r))return!1;return!0}case Q.Kind.NAMED_TYPE:switch(t.name.value){case W.BOOLEAN_SCALAR:return n.kind===Q.Kind.BOOLEAN;case W.FLOAT_SCALAR:return n.kind===Q.Kind.FLOAT||n.kind===Q.Kind.INT;case W.ID_SCALAR:return n.kind===Q.Kind.STRING||n.kind===Q.Kind.INT;case W.INT_SCALAR:return n.kind===Q.Kind.INT;case W.FIELD_SET_SCALAR:case W.SCOPE_SCALAR:case W.STRING_SCALAR:return n.kind===Q.Kind.STRING;case W.LINK_IMPORT:return!0;case W.LINK_PURPOSE:return n.kind!==Q.Kind.ENUM?!1:n.value===W.SECURITY||n.value===W.EXECUTION;case W.SUBSCRIPTION_FIELD_CONDITION:case W.SUBSCRIPTION_FILTER_CONDITION:return n.kind===Q.Kind.OBJECT;default:{let r=this.parentDefinitionDataByTypeName.get(t.name.value);if(!r)return!1;if(r.kind===Q.Kind.SCALAR_TYPE_DEFINITION)return!0;if(r.kind===Q.Kind.ENUM_TYPE_DEFINITION){if(n.kind!==Q.Kind.ENUM&&n.kind!==Q.Kind.STRING)return!1;let i=r.enumValueDataByName.get(n.value);return i?!i.directivesByName.has(W.INACCESSIBLE):!1}return r.kind!==Q.Kind.INPUT_OBJECT_TYPE_DEFINITION?!1:n.kind===Q.Kind.OBJECT}}default:return this.isArgumentValueValid(t.type,n)}}handleFieldInheritableDirectives({directivesByName:t,fieldName:n,inheritedDirectiveNames:r,parentData:i}){this.doesParentRequireFetchReasons&&!t.has(W.REQUIRE_FETCH_REASONS)&&(t.set(W.REQUIRE_FETCH_REASONS,[(0,Ue.generateSimpleDirective)(W.REQUIRE_FETCH_REASONS)]),r.add(W.REQUIRE_FETCH_REASONS)),(this.doesParentRequireFetchReasons||t.has(W.REQUIRE_FETCH_REASONS))&&i.requireFetchReasonsFieldNames.add(n),(0,Yn.isObjectDefinitionData)(i)&&(this.isParentObjectExternal&&!t.has(W.EXTERNAL)&&(t.set(W.EXTERNAL,[(0,Ue.generateSimpleDirective)(W.EXTERNAL)]),r.add(W.EXTERNAL)),t.has(W.EXTERNAL)&&this.unvalidatedExternalFieldCoords.add(`${i.name}.${n}`),this.isParentObjectShareable&&!t.has(W.SHAREABLE)&&(t.set(W.SHAREABLE,[(0,Ue.generateSimpleDirective)(W.SHAREABLE)]),r.add(W.SHAREABLE)))}extractDirectives(t,n){if(!t.directives)return n;let r=(0,Yn.isCompositeOutputNodeKind)(t.kind),i=(0,Yn.isObjectNodeKind)(t.kind);for(let a of t.directives){let o=a.name.value;o===W.SHAREABLE?(0,Ue.getValueOrDefault)(n,o,()=>[a]):(0,Ue.getValueOrDefault)(n,o,()=>[]).push(a),r&&(this.doesParentRequireFetchReasons||(this.doesParentRequireFetchReasons=o===W.REQUIRE_FETCH_REASONS),i&&(this.isParentObjectExternal||(this.isParentObjectExternal=o===W.EXTERNAL),this.isParentObjectShareable||(this.isParentObjectShareable=o===W.SHAREABLE)))}return n}validateDirective({data:t,definitionData:n,directiveCoords:r,directiveNode:i,errorMessages:a,requiredArgumentNames:o}){let u=i.name.value,l=t.kind===Q.Kind.FIELD_DEFINITION?t.renamedParentTypeName||t.originalParentTypeName:t.name,d=u===W.AUTHENTICATED,p=u===W.COST,E=(0,Rt.isFieldData)(t),h=u===W.LIST_SIZE,v=u===W.OVERRIDE,A=u===W.REQUIRES_SCOPES,B=u===W.SEMANTIC_NON_NULL;if(!i.arguments||i.arguments.length<1)return n.requiredArgumentNames.size>0&&a.push((0,ne.undefinedRequiredArgumentsErrorMessage)(u,o,[])),d&&this.handleAuthenticatedDirective(t,l),B&&E&&((0,Rt.isTypeRequired)(t.type)?a.push((0,ne.semanticNonNullLevelsNonNullErrorMessage)({typeString:(0,Ir.printTypeNode)(t.type),value:"0"})):t.nullLevelsBySubgraphName.set(this.subgraphName,new Set([0]))),h&&E&&!(0,Rt.isTypeNodeListType)(t.type)&&a.push((0,ne.listSizeFieldMustReturnListOrUseSizedFieldsErrorMessage)(r,(0,Ir.printTypeNode)(t.type))),a;let V=new Set,J=new Set,re=new Set,ie=[];for(let _e of i.arguments){let ye=_e.name.value;if(V.has(ye)){J.add(ye);continue}V.add(ye);let qe=n.argumentTypeNodeByName.get(ye);if(!qe){re.add(ye);continue}if(!this.isArgumentValueValid(qe.typeNode,_e.value)){a.push((0,ne.invalidArgumentValueErrorMessage)((0,Q.print)(_e.value),`@${u}`,ye,(0,Ir.printTypeNode)(qe.typeNode)));continue}if(v&&E){this.handleOverrideDirective({data:t,directiveCoords:r,errorMessages:a,targetSubgraphName:_e.value.value});continue}if(B&&E){this.handleSemanticNonNullDirective({data:t,directiveNode:i,errorMessages:a});continue}!A||ye!==W.SCOPES||this.extractRequiredScopes({directiveCoords:r,orScopes:_e.value.values,requiredScopes:ie})}p?this.handleCostDirective({data:t,directiveCoords:r,directiveNode:i,errorMessages:a}):h&&E&&this.handleListSizeDirective({data:t,directiveCoords:r,directiveNode:i,errorMessages:a}),J.size>0&&a.push((0,ne.duplicateDirectiveArgumentDefinitionsErrorMessage)([...J])),re.size>0&&a.push((0,ne.unexpectedDirectiveArgumentErrorMessage)(u,[...re]));let Ne=(0,Ue.getEntriesNotInHashSet)(o,V);if(Ne.length>0&&a.push((0,ne.undefinedRequiredArgumentsErrorMessage)(u,o,Ne)),a.length>0||!A)return a;let Ee=(0,Ue.getValueOrDefault)(this.authorizationDataByParentTypeName,l,()=>(0,Yn.newAuthorizationData)(l));if(t.kind!==Q.Kind.FIELD_DEFINITION)this.parentTypeNamesWithAuthDirectives.add(l),Ee.requiredScopes.push(...ie);else{let _e=(0,Ue.getValueOrDefault)(Ee.fieldAuthDataByFieldName,t.name,()=>(0,Yn.newFieldAuthorizationData)(t.name));_e.inheritedData.requiredScopes.push(...ie),_e.originalData.requiredScopes.push(...ie)}return a}validateDirectives(t,n){var i;let r=new Set;for(let[a,o]of t.directivesByName){let u=this.directiveDefinitionDataByName.get(a);if(!u){r.has(a)||(this.errors.push((0,ne.undefinedDirectiveError)(a,n)),r.add(a));continue}let l=[],d=(0,bn.nodeKindToDirectiveLocation)(t.kind);if(u.locations.has(d)||l.push((0,ne.invalidDirectiveLocationErrorMessage)(a,d)),o.length>1&&!u.isRepeatable){let E=(0,Ue.getValueOrDefault)(this.invalidRepeatedDirectiveNameByCoords,n,()=>new Set);E.has(a)||(E.add(a),l.push((0,ne.invalidRepeatedDirectiveErrorMessage)(a)))}let p=[...u.requiredArgumentNames];for(let E of(i=u.node.arguments)!=null?i:[]){if(!E.defaultValue)continue;let h=u.argumentTypeNodeByName.get(E.name.value);if(!h)continue;let v=this.parentDefinitionDataByTypeName.get((0,nr.getTypeNodeNamedTypeName)(h.typeNode));v&&this.sanitizeDefaultValue({data:h,namedTypeData:v,node:E})}for(let E=0;E0&&this.errors.push((0,ne.invalidDirectiveError)(a,n,(0,Ue.numberToOrdinal)(E+1),h))}}switch(t.kind){case Q.Kind.ENUM_TYPE_DEFINITION:{for(let[a,o]of t.enumValueDataByName)this.validateDirectives(o,`${t.name}.${a}`);return}case Q.Kind.FIELD_DEFINITION:{for(let[a,o]of t.argumentDataByName)this.validateDirectives(o,`${t.originalParentTypeName}.${t.name}(${a}: ...)`);return}case Q.Kind.INPUT_OBJECT_TYPE_DEFINITION:{for(let[a,o]of t.inputValueDataByName)this.validateDirectives(o,`${t.name}.${a}`);return}case Q.Kind.INTERFACE_TYPE_DEFINITION:case Q.Kind.OBJECT_TYPE_DEFINITION:{for(let[a,o]of t.fieldDataByName)this.validateDirectives(o,`${t.name}.${a}`);return}default:return}}getNodeExtensionType(t,n,r=!1){return t?us.ExtensionType.REAL:r||!n.has(W.EXTENDS)?us.ExtensionType.NONE:us.ExtensionType.EXTENDS}setParentDataExtensionType(t,n){switch(t.extensionType){case us.ExtensionType.EXTENDS:case us.ExtensionType.NONE:{if(n===us.ExtensionType.REAL)return;this.errors.push((0,ne.duplicateTypeDefinitionError)((0,Ue.kindToNodeType)(t.kind),t.name));return}default:t.extensionType=n}}extractConfigureDescriptionData(t,n){var i,a;if(!n.arguments||n.arguments.length<1){t.description||this.invalidConfigureDescriptionNodeDatas.push(t),t.configureDescriptionDataBySubgraphName.set(this.subgraphName,{propagate:!0,description:((i=t.description)==null?void 0:i.value)||""});return}let r={propagate:!0,description:((a=t.description)==null?void 0:a.value)||""};for(let o of n.arguments)switch(o.name.value){case W.PROPAGATE:{if(o.value.kind!=Q.Kind.BOOLEAN)return;r.propagate=o.value.value;break}case W.DESCRIPTION_OVERRIDE:{if(o.value.kind!=Q.Kind.STRING)return;r.description=o.value.value;break}default:return}!t.description&&!r.description&&this.invalidConfigureDescriptionNodeDatas.push(t),t.configureDescriptionDataBySubgraphName.set(this.subgraphName,r)}extractConfigureDescriptionsData(t){let n=t.directivesByName.get(W.CONFIGURE_DESCRIPTION);n&&n.length==1&&this.extractConfigureDescriptionData(t,n[0])}extractImplementedInterfaceTypeNames(t,n){if(!t.interfaces)return n;let r=(0,Rt.isInterfaceNode)(t),i=t.name.value;for(let a of t.interfaces){let o=a.name.value;if(n.has(o)){this.errors.push((0,ne.duplicateImplementedInterfaceError)((0,Yn.kindToConvertedTypeString)(t.kind),i,o));continue}r&&(0,Ue.getValueOrDefault)(this.interfaceImplementationTypeNamesByInterfaceTypeName,o,()=>new Set).add(i),n.add(o)}return n}updateCompositeOutputDataByNode(t,n,r){this.setParentDataExtensionType(n,r),this.extractImplementedInterfaceTypeNames(t,n.implementedInterfaceTypeNames),n.description||(n.description=(0,bn.formatDescription)("description"in t?t.description:void 0)),this.extractConfigureDescriptionsData(n),n.isEntity||(n.isEntity=n.directivesByName.has(W.KEY)),n.isInaccessible||(n.isInaccessible=n.directivesByName.has(W.INACCESSIBLE)),n.subgraphNames.add(this.subgraphName)}addConcreteTypeNamesForImplementedInterfaces(t,n){for(let r of t)(0,Ue.getValueOrDefault)(this.concreteTypeNamesByAbstractTypeName,r,()=>new Set).add(n),this.internalGraph.addEdge(this.internalGraph.addOrUpdateNode(r,{isAbstract:!0}),this.internalGraph.addOrUpdateNode(n),n,!0)}extractArguments(t,n){var o;if(!((o=n.arguments)!=null&&o.length))return t;let r=n.name.value,i=`${this.originalParentTypeName}.${r}`,a=new Set;for(let u of n.arguments){let l=u.name.value;if(t.has(l)){a.add(l);continue}this.addInputValueDataByNode({fieldName:r,inputValueDataByName:t,isArgument:!0,node:u,originalParentTypeName:this.originalParentTypeName,renamedParentTypeName:this.renamedParentTypeName})}return a.size>0&&this.errors.push((0,ne.duplicateArgumentsError)(i,[...a])),t}addPersistedDirectiveDefinitionDataByNode(t,n,r){let i=n.name.value,a=`@${i}`,o=new Map;for(let u of n.arguments||[])this.addInputValueDataByNode({inputValueDataByName:o,isArgument:!0,node:u,originalParentTypeName:a});t.set(i,{argumentDataByName:o,executableLocations:r,name:i,repeatable:n.repeatable,subgraphNames:new Set([this.subgraphName]),description:(0,bn.formatDescription)(n.description)})}extractDirectiveLocations(t,n){let r=new Set,i=new Set;for(let a of t.locations){let o=a.value;if(!i.has(o)){if(!W.EXECUTABLE_DIRECTIVE_LOCATIONS.has(o)&&!Dp.TYPE_SYSTEM_DIRECTIVE_LOCATIONS.has(o)){n.push((0,ne.invalidDirectiveDefinitionLocationErrorMessage)(o)),i.add(o);continue}if(r.has(o)){n.push((0,ne.duplicateDirectiveDefinitionLocationErrorMessage)(o)),i.add(o);continue}r.add(o)}}return r}extractArgumentData(t,n){let r=new Map,i=new Set,a=new Set,o={argumentTypeNodeByName:r,optionalArgumentNames:i,requiredArgumentNames:a};if(!t)return o;let u=new Set;for(let l of t){let d=l.name.value;if(r.has(d)){u.add(d);continue}l.defaultValue&&i.add(d),(0,Rt.isTypeRequired)(l.type)&&!l.defaultValue&&a.add(d),r.set(d,{name:d,typeNode:l.type,defaultValue:l.defaultValue})}return u.size>0&&n.push((0,ne.duplicateDirectiveDefinitionArgumentErrorMessage)([...u])),o}extractDirectiveArgumentCosts(t){var r;if(!t.arguments)return;let n=t.name.value;for(let i of t.arguments)if(i.directives)for(let a of i.directives){if(a.name.value!==W.COST)continue;let o=(r=a.arguments)==null?void 0:r.find(l=>l.name.value===W.WEIGHT);if(!o)continue;if(o.value.kind!==Q.Kind.INT){let l=`@${n}(${i.name.value}: ...)`;this.errors.push((0,ne.invalidDirectiveError)(W.COST,l,"1st",[(0,ne.invalidArgumentValueErrorMessage)((0,Q.print)(o.value),`@${W.COST}`,W.WEIGHT,"Int!")]));continue}let u=parseInt(o.value.value,10);this.costs.directiveArgumentWeights.set(`${n}.${i.name.value}`,u)}}addDirectiveDefinitionDataByNode(t){let n=t.name.value;if(this.definedDirectiveNames.has(n))return this.errors.push((0,ne.duplicateDirectiveDefinitionError)(n)),!1;this.definedDirectiveNames.add(n),this.extractDirectiveArgumentCosts(t);let r=xr.V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.get(n);if(r)return this.directiveDefinitionByName.set(n,r),this.isSubgraphVersionTwo=!0,!1;if(xr.DIRECTIVE_DEFINITION_BY_NAME.has(n))return!1;this.directiveDefinitionByName.set(n,t);let i=[],{argumentTypeNodeByName:a,optionalArgumentNames:o,requiredArgumentNames:u}=this.extractArgumentData(t.arguments,i);return this.directiveDefinitionDataByName.set(n,{argumentTypeNodeByName:a,isRepeatable:t.repeatable,locations:this.extractDirectiveLocations(t,i),name:n,node:t,optionalArgumentNames:o,requiredArgumentNames:u}),i.length>0&&this.errors.push((0,ne.invalidDirectiveDefinitionError)(n,i)),!0}addFieldDataByNode(t,n,r,i,a=new Set){let o=n.name.value,u=this.renamedParentTypeName||this.originalParentTypeName,l=`${this.originalParentTypeName}.${o}`,{isExternal:d,isShareable:p}=(0,Rt.isNodeExternalOrShareable)(n,!this.isSubgraphVersionTwo,i),E=(0,nr.getTypeNodeNamedTypeName)(n.type),h={argumentDataByName:r,configureDescriptionDataBySubgraphName:new Map,externalFieldDataBySubgraphName:new Map([[this.subgraphName,(0,Rt.newExternalFieldData)(d)]]),federatedCoords:`${u}.${o}`,inheritedDirectiveNames:a,isInaccessible:i.has(W.INACCESSIBLE),isShareableBySubgraphName:new Map([[this.subgraphName,p]]),kind:Q.Kind.FIELD_DEFINITION,name:o,namedTypeKind:xr.BASE_SCALARS.has(E)?Q.Kind.SCALAR_TYPE_DEFINITION:Q.Kind.NULL,namedTypeName:E,node:(0,nr.getMutableFieldNode)(n,l,this.errors),nullLevelsBySubgraphName:new Map,originalParentTypeName:this.originalParentTypeName,persistedDirectivesData:(0,Rt.newPersistedDirectivesData)(),renamedParentTypeName:u,subgraphNames:new Set([this.subgraphName]),type:(0,nr.getMutableTypeNode)(n.type,l,this.errors),directivesByName:i,description:(0,bn.formatDescription)(n.description)};return xr.BASE_SCALARS.has(h.namedTypeName)||this.referencedTypeNames.add(h.namedTypeName),this.extractConfigureDescriptionsData(h),t.set(o,h),h}addInputValueDataByNode({fieldName:t,inputValueDataByName:n,isArgument:r,node:i,originalParentTypeName:a,renamedParentTypeName:o}){let u=o||a,l=i.name.value,d=r?`${a}${t?`.${t}`:""}(${l}: ...)`:`${a}.${l}`;i.defaultValue&&!(0,Rt.areDefaultValuesCompatible)(i.type,i.defaultValue)&&this.errors.push((0,ne.incompatibleInputValueDefaultValueTypeError)((r?W.ARGUMENT:W.INPUT_FIELD)+` "${l}"`,d,(0,Ir.printTypeNode)(i.type),(0,Q.print)(i.defaultValue)));let p=r?`${u}${t?`.${t}`:""}(${l}: ...)`:`${u}.${l}`,E=(0,nr.getTypeNodeNamedTypeName)(i.type),h={configureDescriptionDataBySubgraphName:new Map,directivesByName:this.extractDirectives(i,new Map),federatedCoords:p,fieldName:t,includeDefaultValue:!!i.defaultValue,isArgument:r,kind:r?Q.Kind.ARGUMENT:Q.Kind.INPUT_VALUE_DEFINITION,name:l,namedTypeKind:xr.BASE_SCALARS.has(E)?Q.Kind.SCALAR_TYPE_DEFINITION:Q.Kind.NULL,namedTypeName:E,node:(0,nr.getMutableInputValueNode)(i,a,this.errors),originalCoords:d,originalParentTypeName:a,persistedDirectivesData:(0,Rt.newPersistedDirectivesData)(),renamedParentTypeName:u,requiredSubgraphNames:new Set((0,Rt.isTypeRequired)(i.type)?[this.subgraphName]:[]),subgraphNames:new Set([this.subgraphName]),type:(0,nr.getMutableTypeNode)(i.type,a,this.errors),defaultValue:i.defaultValue,description:(0,bn.formatDescription)(i.description)};this.extractConfigureDescriptionsData(h),n.set(l,h)}upsertInterfaceDataByNode(t,n=!1){let r=t.name.value,i=this.parentDefinitionDataByTypeName.get(r),a=this.extractDirectives(t,(i==null?void 0:i.directivesByName)||new Map),o=this.getNodeExtensionType(n,a),u=this.entityInterfaceDataByTypeName.get(r);if(u&&t.fields)for(let d of t.fields)u.interfaceFieldNames.add(d.name.value);if(i){if(i.kind!==Q.Kind.INTERFACE_TYPE_DEFINITION){this.errors.push((0,ne.multipleNamedTypeDefinitionError)(r,(0,Ue.kindToNodeType)(i.kind),(0,Yn.kindToConvertedTypeString)(t.kind)));return}this.updateCompositeOutputDataByNode(t,i,o);return}let l={configureDescriptionDataBySubgraphName:new Map,directivesByName:a,extensionType:o,fieldDataByName:new Map,implementedInterfaceTypeNames:this.extractImplementedInterfaceTypeNames(t,new Set),isEntity:a.has(W.KEY),isInaccessible:a.has(W.INACCESSIBLE),kind:Q.Kind.INTERFACE_TYPE_DEFINITION,name:r,node:(0,nr.getMutableInterfaceNode)(t.name),persistedDirectivesData:(0,Rt.newPersistedDirectivesData)(),requireFetchReasonsFieldNames:new Set,subgraphNames:new Set([this.subgraphName]),description:(0,bn.formatDescription)("description"in t?t.description:void 0)};this.extractConfigureDescriptionsData(l),this.parentDefinitionDataByTypeName.set(r,l)}getRenamedRootTypeName(t){let n=this.operationTypeNodeByTypeName.get(t);if(!n)return t;switch(n){case Q.OperationTypeNode.MUTATION:return W.MUTATION;case Q.OperationTypeNode.SUBSCRIPTION:return W.SUBSCRIPTION;default:return W.QUERY}}addInterfaceObjectFieldsByNode(t){let n=t.name.value,r=this.entityInterfaceDataByTypeName.get(n);if(!(!r||!r.isInterfaceObject||!t.fields))for(let i of t.fields)r.interfaceObjectFieldNames.add(i.name.value)}upsertObjectDataByNode(t,n=!1){var p;let r=t.name.value,i=this.parentDefinitionDataByTypeName.get(r),a=this.extractDirectives(t,(p=i==null?void 0:i.directivesByName)!=null?p:new Map),o=this.isTypeNameRootType(r),u=this.getNodeExtensionType(n,a,o);if(this.addInterfaceObjectFieldsByNode(t),i){if(i.kind!==Q.Kind.OBJECT_TYPE_DEFINITION){this.errors.push((0,ne.multipleNamedTypeDefinitionError)(r,(0,Ue.kindToNodeType)(i.kind),(0,Yn.kindToConvertedTypeString)(t.kind)));return}this.updateCompositeOutputDataByNode(t,i,u),a.has(W.INTERFACE_OBJECT)||this.addConcreteTypeNamesForImplementedInterfaces(i.implementedInterfaceTypeNames,r);return}let l=this.extractImplementedInterfaceTypeNames(t,new Set);a.has(W.INTERFACE_OBJECT)||this.addConcreteTypeNamesForImplementedInterfaces(l,r);let d={configureDescriptionDataBySubgraphName:new Map,directivesByName:a,extensionType:u,fieldDataByName:new Map,implementedInterfaceTypeNames:l,isEntity:a.has(W.KEY),isInaccessible:a.has(W.INACCESSIBLE),isRootType:o,kind:Q.Kind.OBJECT_TYPE_DEFINITION,name:r,node:(0,nr.getMutableObjectNode)(t.name),persistedDirectivesData:(0,Rt.newPersistedDirectivesData)(),requireFetchReasonsFieldNames:new Set,renamedTypeName:this.getRenamedRootTypeName(r),subgraphNames:new Set([this.subgraphName]),description:(0,bn.formatDescription)("description"in t?t.description:void 0)};this.extractConfigureDescriptionsData(d),this.parentDefinitionDataByTypeName.set(r,d)}upsertEnumDataByNode(t,n=!1){let r=t.name.value;this.internalGraph.addOrUpdateNode(r,{isLeaf:!0});let i=this.parentDefinitionDataByTypeName.get(r),a=this.extractDirectives(t,(i==null?void 0:i.directivesByName)||new Map),o=this.getNodeExtensionType(n,a);if(i){if(i.kind!==Q.Kind.ENUM_TYPE_DEFINITION){this.errors.push((0,ne.multipleNamedTypeDefinitionError)(r,(0,Ue.kindToNodeType)(i.kind),(0,Yn.kindToConvertedTypeString)(t.kind)));return}this.setParentDataExtensionType(i,o),i.isInaccessible||(i.isInaccessible=a.has(W.INACCESSIBLE)),i.subgraphNames.add(this.subgraphName),i.description||(i.description=(0,bn.formatDescription)("description"in t?t.description:void 0)),this.extractConfigureDescriptionsData(i);return}let u={appearances:1,configureDescriptionDataBySubgraphName:new Map,directivesByName:a,extensionType:o,enumValueDataByName:new Map,isInaccessible:a.has(W.INACCESSIBLE),kind:Q.Kind.ENUM_TYPE_DEFINITION,name:r,node:(0,nr.getMutableEnumNode)(t.name),persistedDirectivesData:(0,Rt.newPersistedDirectivesData)(),subgraphNames:new Set([this.subgraphName]),description:(0,bn.formatDescription)("description"in t?t.description:void 0)};this.extractConfigureDescriptionsData(u),this.parentDefinitionDataByTypeName.set(r,u)}upsertInputObjectByNode(t,n=!1){let r=t.name.value,i=this.parentDefinitionDataByTypeName.get(r),a=this.extractDirectives(t,(i==null?void 0:i.directivesByName)||new Map),o=this.getNodeExtensionType(n,a);if(i)return i.kind!==Q.Kind.INPUT_OBJECT_TYPE_DEFINITION?(this.errors.push((0,ne.multipleNamedTypeDefinitionError)(r,(0,Ue.kindToNodeType)(i.kind),(0,Yn.kindToConvertedTypeString)(t.kind))),{success:!1}):(this.setParentDataExtensionType(i,o),i.isInaccessible||(i.isInaccessible=a.has(W.INACCESSIBLE)),i.subgraphNames.add(this.subgraphName),i.description||(i.description=(0,bn.formatDescription)("description"in t?t.description:void 0)),this.extractConfigureDescriptionsData(i),{success:!0,data:i});let u={configureDescriptionDataBySubgraphName:new Map,directivesByName:a,extensionType:o,inputValueDataByName:new Map,isInaccessible:a.has(W.INACCESSIBLE),kind:Q.Kind.INPUT_OBJECT_TYPE_DEFINITION,name:r,node:(0,nr.getMutableInputObjectNode)(t.name),persistedDirectivesData:(0,Rt.newPersistedDirectivesData)(),subgraphNames:new Set([this.subgraphName]),description:(0,bn.formatDescription)("description"in t?t.description:void 0)};return this.extractConfigureDescriptionsData(u),this.parentDefinitionDataByTypeName.set(r,u),{success:!0,data:u}}upsertScalarByNode(t,n=!1){let r=t.name.value;this.internalGraph.addOrUpdateNode(r,{isLeaf:!0});let i=this.parentDefinitionDataByTypeName.get(r),a=this.extractDirectives(t,(i==null?void 0:i.directivesByName)||new Map),o=this.getNodeExtensionType(n,a);if(i){if(i.kind!==Q.Kind.SCALAR_TYPE_DEFINITION){this.errors.push((0,ne.multipleNamedTypeDefinitionError)(r,(0,Ue.kindToNodeType)(i.kind),(0,Yn.kindToConvertedTypeString)(t.kind)));return}this.setParentDataExtensionType(i,o),i.description||(i.description=(0,bn.formatDescription)("description"in t?t.description:void 0)),i.subgraphNames.add(this.subgraphName),this.extractConfigureDescriptionsData(i);return}let u={configureDescriptionDataBySubgraphName:new Map,directivesByName:a,extensionType:o,kind:Q.Kind.SCALAR_TYPE_DEFINITION,name:r,node:(0,nr.getMutableScalarNode)(t.name),persistedDirectivesData:(0,Rt.newPersistedDirectivesData)(),subgraphNames:new Set([this.subgraphName]),description:(0,bn.formatDescription)("description"in t?t.description:void 0)};this.extractConfigureDescriptionsData(u),this.parentDefinitionDataByTypeName.set(r,u)}extractUnionMembers(t,n){if(!t.types)return n;let r=t.name.value;for(let i of t.types){let a=i.name.value;if(n.has(a)){this.errors.push((0,ne.duplicateUnionMemberDefinitionError)(r,a));continue}(0,Ue.getValueOrDefault)(this.concreteTypeNamesByAbstractTypeName,r,()=>new Set).add(a),xr.BASE_SCALARS.has(a)||this.referencedTypeNames.add(a),n.set(a,i)}return n}upsertUnionByNode(t,n=!1){let r=t.name.value,i=this.parentDefinitionDataByTypeName.get(r),a=this.extractDirectives(t,(i==null?void 0:i.directivesByName)||new Map),o=this.getNodeExtensionType(n,a);if(this.addConcreteTypeNamesForUnion(t),i){if(i.kind!==Q.Kind.UNION_TYPE_DEFINITION){this.errors.push((0,ne.multipleNamedTypeDefinitionError)(r,(0,Ue.kindToNodeType)(i.kind),(0,Yn.kindToConvertedTypeString)(t.kind)));return}this.setParentDataExtensionType(i,o),this.extractUnionMembers(t,i.memberByMemberTypeName),i.description||(i.description=(0,bn.formatDescription)("description"in t?t.description:void 0)),i.subgraphNames.add(this.subgraphName),this.extractConfigureDescriptionsData(i);return}let u={configureDescriptionDataBySubgraphName:new Map,directivesByName:a,extensionType:o,kind:Q.Kind.UNION_TYPE_DEFINITION,memberByMemberTypeName:this.extractUnionMembers(t,new Map),name:r,node:(0,nr.getMutableUnionNode)(t.name),persistedDirectivesData:(0,Rt.newPersistedDirectivesData)(),subgraphNames:new Set([this.subgraphName]),description:(0,bn.formatDescription)("description"in t?t.description:void 0)};this.extractConfigureDescriptionsData(u),this.parentDefinitionDataByTypeName.set(r,u)}extractKeyFieldSets(t,n){var a;let r=t.name.value;if(!((a=t.directives)!=null&&a.length)){this.errors.push((0,ne.expectedEntityError)(r));return}let i=0;for(let o of t.directives){if(o.name.value!==W.KEY||(i+=1,!o.arguments||o.arguments.length<1))continue;let u,l=!1;for(let v of o.arguments){if(v.name.value===W.RESOLVABLE){v.value.kind===Q.Kind.BOOLEAN&&!v.value.value&&(l=!0);continue}if(v.name.value!==W.FIELDS){u=void 0;break}if(v.value.kind!==Q.Kind.STRING){u=void 0;break}u=v.value.value}if(u===void 0)continue;let{error:d,documentNode:p}=(0,bn.safeParse)("{"+u+"}");if(d||!p){this.errors.push((0,ne.invalidDirectiveError)(W.KEY,r,(0,Ue.numberToOrdinal)(i),[(0,ne.unparsableFieldSetErrorMessage)(u,d)]));continue}let E=(0,li.getNormalizedFieldSet)(p),h=n.get(E);h?h.isUnresolvable||(h.isUnresolvable=l):n.set(E,{documentNode:p,isUnresolvable:l,normalizedFieldSet:E,rawFieldSet:u})}}getFieldSetParent(t,n,r,i){if(!t)return{fieldSetParentData:n};let a=(0,Ue.getOrThrowError)(n.fieldDataByName,r,`${i}.fieldDataByFieldName`),o=(0,nr.getTypeNodeNamedTypeName)(a.node.type),u=`${i}.${r}`;if(xr.BASE_SCALARS.has(o))return{errorString:(0,ne.incompatibleTypeWithProvidesErrorMessage)({fieldCoords:u,responseType:o,subgraphName:this.subgraphName})};let l=this.parentDefinitionDataByTypeName.get(o);return l?l.kind!==Q.Kind.INTERFACE_TYPE_DEFINITION&&l.kind!==Q.Kind.OBJECT_TYPE_DEFINITION?{errorString:(0,ne.incompatibleTypeWithProvidesErrorMessage)({fieldCoords:u,responseType:o,subgraphName:this.subgraphName})}:{fieldSetParentData:l}:{errorString:(0,ne.unknownNamedTypeErrorMessage)(u,o)}}validateConditionalFieldSet(t,n,r,i,a){let{error:o,documentNode:u}=(0,bn.safeParse)("{"+n+"}");if(o||!u)return{errorMessages:[(0,ne.unparsableFieldSetErrorMessage)(n,o)]};let l=this,d=[t],p=(0,li.getConditionalFieldSetDirectiveName)(i),E=[],h=`${a}.${r}`,v=(0,li.getInitialFieldCoordsPath)(i,h),A=[r],B=new Set,V=[],J=-1,re=!0,ie=r,Ne=!1;return(0,Q.visit)(u,{Argument:{enter(){return!1}},Field:{enter(Ee){var Kt,qr;let _e=d[J],ye=_e.name;if(_e.kind===Q.Kind.UNION_TYPE_DEFINITION)return V.push((0,ne.invalidSelectionOnUnionErrorMessage)(n,v,ye)),Q.BREAK;let qe=Ee.name.value,Z=`${ye}.${qe}`;if(l.unvalidatedExternalFieldCoords.delete(Z),re)return V.push((0,ne.invalidSelectionSetErrorMessage)(n,v,ye,(0,Ue.kindToNodeType)(_e.kind))),Q.BREAK;if(v.push(Z),A.push(qe),ie=qe,qe===W.TYPENAME){if(i)return V.push((0,ne.typeNameAlreadyProvidedErrorMessage)(Z,l.subgraphName)),Q.BREAK;B.size<1&&yl(Kt=l,Rp,Nb).call(Kt,{currentFieldCoords:Z,directiveCoords:h,directiveName:p,fieldSet:n});return}let ge=_e.fieldDataByName.get(qe);if(!ge)return V.push((0,ne.undefinedFieldInFieldSetErrorMessage)(n,ye,qe)),Q.BREAK;if(E[J].has(qe))return V.push((0,ne.duplicateFieldInFieldSetErrorMessage)(n,Z)),Q.BREAK;E[J].add(qe);let{isDefinedExternal:It,isUnconditionallyProvided:Zt}=(0,Ue.getOrThrowError)(ge.externalFieldDataBySubgraphName,l.subgraphName,`${Z}.externalFieldDataBySubgraphName`),In=It&&!Zt;Zt||(Ne=!0);let Tn=(0,nr.getTypeNodeNamedTypeName)(ge.node.type),Ot=l.parentDefinitionDataByTypeName.get(Tn);if(xr.BASE_SCALARS.has(Tn)||(Ot==null?void 0:Ot.kind)===Q.Kind.SCALAR_TYPE_DEFINITION||(Ot==null?void 0:Ot.kind)===Q.Kind.ENUM_TYPE_DEFINITION){if(B.size<1&&!It){yl(qr=l,Rp,Nb).call(qr,{currentFieldCoords:Z,directiveCoords:h,directiveName:p,fieldSet:n});return}if(B.size<1&&Zt){l.isSubgraphVersionTwo?V.push((0,ne.fieldAlreadyProvidedErrorMessage)(Z,l.subgraphName,p)):l.warnings.push((0,cs.fieldAlreadyProvidedWarning)(Z,p,h,l.subgraphName));return}if(!In&&!i)return;let rr=(0,Ue.getValueOrDefault)(l.conditionalFieldDataByCoords,Z,Rt.newConditionalFieldData),En=(0,bp.newFieldSetConditionData)({fieldCoordinatesPath:[...v],fieldPath:[...A]});i?rr.providedBy.push(En):rr.requiredBy.push(En);return}if(!Ot)return V.push((0,ne.unknownTypeInFieldSetErrorMessage)(n,Z,Tn)),Q.BREAK;if(It&&(i&&(0,Ue.getValueOrDefault)(l.conditionalFieldDataByCoords,Z,Rt.newConditionalFieldData).providedBy.push((0,bp.newFieldSetConditionData)({fieldCoordinatesPath:[...v],fieldPath:[...A]})),B.add(Z)),Ot.kind===Q.Kind.OBJECT_TYPE_DEFINITION||Ot.kind===Q.Kind.INTERFACE_TYPE_DEFINITION||Ot.kind===Q.Kind.UNION_TYPE_DEFINITION){re=!0,d.push(Ot);return}},leave(){B.delete(v.pop()||""),A.pop()}},InlineFragment:{enter(Ee){let _e=d[J],ye=_e.name,qe=v.length<1?t.name:v[v.length-1];if(!Ee.typeCondition)return V.push((0,ne.inlineFragmentWithoutTypeConditionErrorMessage)(n,qe)),Q.BREAK;let Z=Ee.typeCondition.name.value;if(Z===ye){d.push(_e),re=!0;return}if(!(0,bn.isKindAbstract)(_e.kind))return V.push((0,ne.invalidInlineFragmentTypeErrorMessage)(n,v,Z,ye)),Q.BREAK;let ge=l.parentDefinitionDataByTypeName.get(Z);if(!ge)return V.push((0,ne.unknownInlineFragmentTypeConditionErrorMessage)(n,v,ye,Z)),Q.BREAK;switch(re=!0,ge.kind){case Q.Kind.INTERFACE_TYPE_DEFINITION:{if(!ge.implementedInterfaceTypeNames.has(ye))break;d.push(ge);return}case Q.Kind.OBJECT_TYPE_DEFINITION:{let It=l.concreteTypeNamesByAbstractTypeName.get(ye);if(!It||!It.has(Z))break;d.push(ge);return}case Q.Kind.UNION_TYPE_DEFINITION:{d.push(ge);return}default:return V.push((0,ne.invalidInlineFragmentTypeConditionTypeErrorMessage)(n,v,ye,Z,(0,Ue.kindToNodeType)(ge.kind))),Q.BREAK}return V.push((0,ne.invalidInlineFragmentTypeConditionErrorMessage)(n,v,Z,(0,Ue.kindToNodeType)(_e.kind),ye)),Q.BREAK}},SelectionSet:{enter(){if(!re){let Ee=d[J];if(Ee.kind===Q.Kind.UNION_TYPE_DEFINITION)return V.push((0,ne.unparsableFieldSetSelectionErrorMessage)(n,ie)),Q.BREAK;if(ie===W.TYPENAME)return V.push((0,ne.invalidSelectionSetDefinitionErrorMessage)(n,v,W.STRING_SCALAR,(0,Ue.kindToNodeType)(Q.Kind.SCALAR_TYPE_DEFINITION))),Q.BREAK;let _e=Ee.fieldDataByName.get(ie);if(!_e)return V.push((0,ne.undefinedFieldInFieldSetErrorMessage)(n,Ee.name,ie)),Q.BREAK;let ye=(0,nr.getTypeNodeNamedTypeName)(_e.node.type),qe=l.parentDefinitionDataByTypeName.get(ye),Z=qe?qe.kind:Q.Kind.SCALAR_TYPE_DEFINITION;return V.push((0,ne.invalidSelectionSetDefinitionErrorMessage)(n,v,ye,(0,Ue.kindToNodeType)(Z))),Q.BREAK}if(J+=1,re=!1,J<0||J>=d.length)return V.push((0,ne.unparsableFieldSetSelectionErrorMessage)(n,ie)),Q.BREAK;E.push(new Set)},leave(){if(re){let Ee=d[J+1];V.push((0,ne.invalidSelectionSetErrorMessage)(n,v,Ee.name,(0,Ue.kindToNodeType)(Ee.kind))),re=!1}J-=1,d.pop(),E.pop()}}}),V.length>0||!Ne?{errorMessages:V}:{configuration:{fieldName:r,selectionSet:(0,li.getNormalizedFieldSet)(u)},errorMessages:V}}validateProvidesOrRequires(t,n,r){let i=[],a=[],o=(0,Rt.getParentTypeName)(t);for(let[u,l]of n){let{fieldSetParentData:d,errorString:p}=this.getFieldSetParent(r,t,u,o),E=`${o}.${u}`;if(p){i.push(p);continue}if(!d)continue;let{errorMessages:h,configuration:v}=this.validateConditionalFieldSet(d,l,u,r,o);if(h.length>0){i.push(` On field "${E}": - -`+h.join(W.HYPHEN_JOIN));continue}v&&a.push(v)}if(i.length>0){this.errors.push((0,ne.invalidProvidesOrRequiresDirectivesError)((0,li.getConditionalFieldSetDirectiveName)(r),i));return}if(a.length>0)return a}validateInterfaceImplementations(t){if(t.implementedInterfaceTypeNames.size<1)return;let n=t.directivesByName.has(W.INACCESSIBLE),r=new Map,i=new Map,a=!1;for(let o of t.implementedInterfaceTypeNames){let u=this.parentDefinitionDataByTypeName.get(o);if(xr.BASE_SCALARS.has(o)&&this.referencedTypeNames.add(o),!u)continue;if(u.kind!==Q.Kind.INTERFACE_TYPE_DEFINITION){i.set(u.name,(0,Ue.kindToNodeType)(u.kind));continue}if(t.name===u.name){a=!0;continue}let l={invalidFieldImplementations:new Map,unimplementedFields:[]},d=!1;for(let[p,E]of u.fieldDataByName){this.unvalidatedExternalFieldCoords.delete(`${t.name}.${p}`);let h=!1,v=t.fieldDataByName.get(p);if(!v){d=!0,l.unimplementedFields.push(p);continue}let A={invalidAdditionalArguments:new Set,invalidImplementedArguments:[],isInaccessible:!1,originalResponseType:(0,Ir.printTypeNode)(E.node.type),unimplementedArguments:new Set};(0,Rt.isTypeValidImplementation)({concreteTypeNamesByAbstractTypeName:this.concreteTypeNamesByAbstractTypeName,implementationType:v.node.type,interfaceImplementationTypeNamesByInterfaceTypeName:this.interfaceImplementationTypeNamesByInterfaceTypeName,originalType:E.node.type})||(d=!0,h=!0,A.implementedResponseType=(0,Ir.printTypeNode)(v.node.type));let B=new Set;for(let[V,J]of E.argumentDataByName){B.add(V);let re=v.argumentDataByName.get(V);if(!re){d=!0,h=!0,A.unimplementedArguments.add(V);continue}let ie=(0,Ir.printTypeNode)(re.type),Ne=(0,Ir.printTypeNode)(J.type);Ne!==ie&&(d=!0,h=!0,A.invalidImplementedArguments.push({actualType:ie,argumentName:V,expectedType:Ne}))}for(let[V,J]of v.argumentDataByName)B.has(V)||J.type.kind===Q.Kind.NON_NULL_TYPE&&(d=!0,h=!0,A.invalidAdditionalArguments.add(V));!n&&v.isInaccessible&&!E.isInaccessible&&(d=!0,h=!0,A.isInaccessible=!0),h&&l.invalidFieldImplementations.set(p,A)}d&&r.set(o,l)}i.size>0&&this.errors.push((0,ne.invalidImplementedTypeError)(t.name,i)),a&&this.errors.push((0,ne.selfImplementationError)(t.name)),r.size>0&&this.errors.push((0,ne.invalidInterfaceImplementationError)(t.name,(0,Ue.kindToNodeType)(t.kind),r))}handleAuthenticatedDirective(t,n){let r=(0,Ue.getValueOrDefault)(this.authorizationDataByParentTypeName,n,()=>(0,Yn.newAuthorizationData)(n));if(t.kind===Q.Kind.FIELD_DEFINITION){let i=(0,Ue.getValueOrDefault)(r.fieldAuthDataByFieldName,t.name,()=>(0,Yn.newFieldAuthorizationData)(t.name));i.inheritedData.requiresAuthentication=!0,i.originalData.requiresAuthentication=!0}else r.requiresAuthentication=!0,this.parentTypeNamesWithAuthDirectives.add(n)}handleOverrideDirective({data:t,directiveCoords:n,errorMessages:r,targetSubgraphName:i}){if(i===this.subgraphName){r.push((0,ne.equivalentSourceAndTargetOverrideErrorMessage)(i,n));return}let a=(0,Ue.getValueOrDefault)(this.overridesByTargetSubgraphName,i,()=>new Map);(0,Ue.getValueOrDefault)(a,t.renamedParentTypeName,()=>new Set).add(t.name)}handleSemanticNonNullDirective({data:t,directiveNode:n,errorMessages:r}){var E;let i=new Set,a=t.node.type,o=0;for(;a;)switch(a.kind){case Q.Kind.LIST_TYPE:{o+=1,a=a.type;break}case Q.Kind.NON_NULL_TYPE:{i.add(o),a=a.type;break}default:{a=null;break}}let u=(E=n.arguments)==null?void 0:E.find(h=>h.name.value===W.LEVELS);if(!u||u.value.kind!==Q.Kind.LIST){r.push(ne.semanticNonNullArgumentErrorMessage);return}let l=u.value.values,d=(0,Ir.printTypeNode)(t.type),p=new Set;for(let{value:h}of l){let v=parseInt(h,10);if(Number.isNaN(v)){r.push((0,ne.semanticNonNullLevelsNaNIndexErrorMessage)(h));continue}if(v<0||v>o){r.push((0,ne.semanticNonNullLevelsIndexOutOfBoundsErrorMessage)({maxIndex:o,typeString:d,value:h}));continue}if(!i.has(v)){p.add(v);continue}r.push((0,ne.semanticNonNullLevelsNonNullErrorMessage)({typeString:d,value:h}))}t.nullLevelsBySubgraphName.set(this.subgraphName,p)}handleCostDirective({data:t,directiveCoords:n,directiveNode:r,errorMessages:i}){var u;let a=(u=r.arguments)==null?void 0:u.find(l=>l.name.value===W.WEIGHT);if(!a||a.value.kind!==Q.Kind.INT)return;let o=parseInt(a.value.value,10);switch(t.kind){case Q.Kind.OBJECT_TYPE_DEFINITION:case Q.Kind.SCALAR_TYPE_DEFINITION:case Q.Kind.ENUM_TYPE_DEFINITION:this.costs.typeWeights.set(t.name,o);break;case Q.Kind.FIELD_DEFINITION:{let l=t.renamedParentTypeName||t.originalParentTypeName,d=this.parentDefinitionDataByTypeName.get(l);if(!d)break;if(d.kind===Q.Kind.INTERFACE_TYPE_DEFINITION){i.push((0,ne.costOnInterfaceFieldErrorMessage)(n));break}let p=`${l}.${t.name}`,E=(0,Ue.getValueOrDefault)(this.costs.fieldWeights,p,()=>({typeName:l,fieldName:t.name,argumentWeights:new Map}));E.weight=o;break}case Q.Kind.INPUT_VALUE_DEFINITION:case Q.Kind.ARGUMENT:{let l=t;if(l.isArgument&&l.fieldName){let d=l.renamedParentTypeName||l.originalParentTypeName,p=this.parentDefinitionDataByTypeName.get(d);if(!p)break;if(p.kind===Q.Kind.INTERFACE_TYPE_DEFINITION){i.push((0,ne.costOnInterfaceFieldErrorMessage)(n));break}let E=`${d}.${l.fieldName}`;(0,Ue.getValueOrDefault)(this.costs.fieldWeights,E,()=>({typeName:d,fieldName:l.fieldName,argumentWeights:new Map})).argumentWeights.set(l.name,o)}else{let d=l.renamedParentTypeName||l.originalParentTypeName,p=`${d}.${l.name}`,E=(0,Ue.getValueOrDefault)(this.costs.fieldWeights,p,()=>({typeName:d,fieldName:l.name,argumentWeights:new Map}));E.weight=o}break}}}handleListSizeDirective({data:t,directiveCoords:n,directiveNode:r,errorMessages:i}){let a=r.arguments;if(!a)return;let o=!1,u=t.renamedParentTypeName||t.originalParentTypeName,l={typeName:u,fieldName:t.name,slicingArguments:[],sizedFields:[],requireOneSlicingArgument:!0};for(let p of a)switch(p.name.value){case W.ASSUMED_SIZE:p.value.kind===Q.Kind.INT&&(l.assumedSize=parseInt(p.value.value,10));break;case W.REQUIRE_ONE_SLICING_ARGUMENT:p.value.kind===Q.Kind.BOOLEAN&&(l.requireOneSlicingArgument=p.value.value);break;case W.SLICING_ARGUMENTS:{let h;if(p.value.kind===Q.Kind.LIST)h=p.value.values;else if(p.value.kind===Q.Kind.STRING)h=[p.value];else continue;for(let v of h){if(v.kind!==Q.Kind.STRING)continue;let A=v.value,B=t.argumentDataByName.get(A);if(!B){i.push((0,ne.listSizeInvalidSlicingArgumentErrorMessage)(n,A));continue}if((B.type.kind===Q.Kind.NON_NULL_TYPE?B.type.type:B.type).kind===Q.Kind.LIST_TYPE||B.namedTypeName!==W.INT_SCALAR){i.push((0,ne.listSizeSlicingArgumentNotIntErrorMessage)(n,A,(0,Ir.printTypeNode)(B.type)));continue}l.slicingArguments.push(A)}break}case W.SIZED_FIELDS:{let h;if(p.value.kind===Q.Kind.LIST)h=p.value.values;else if(p.value.kind===Q.Kind.STRING)h=[p.value];else continue;if(h.length<1)continue;o=!0;let v=t.namedTypeName,A=this.parentDefinitionDataByTypeName.get(v);if(!A||!(0,Rt.isParentDataCompositeOutputType)(A)){i.push((0,ne.listSizeSizedFieldsInvalidReturnTypeErrorMessage)(n,v));continue}for(let B of h){if(B.kind!==Q.Kind.STRING)continue;let V=B.value,J=A.fieldDataByName.get(V);if(!J){i.push((0,ne.listSizeSizedFieldNotFoundErrorMessage)(n,V,v));continue}if(!(0,Rt.isTypeNodeListType)(J.type)){i.push((0,ne.listSizeSizedFieldNotListErrorMessage)(n,V,v,(0,Ir.printTypeNode)(J.type)));continue}l.sizedFields.push(V)}break}}if(!o&&!(0,Rt.isTypeNodeListType)(t.type)&&i.push((0,ne.listSizeFieldMustReturnListOrUseSizedFieldsErrorMessage)(n,(0,Ir.printTypeNode)(t.type))),o&&(0,Rt.isTypeNodeListType)(t.type)&&i.push((0,ne.listSizeSizedFieldsOnListsErrorMessage)(n,(0,Ir.printTypeNode)(t.type))),l.assumedSize!==void 0&&l.slicingArguments.length>0)if(l.requireOneSlicingArgument)i.push((0,ne.listSizeAssumedSizeWithRequiredSlicingArgumentErrorMessage)(n));else for(let p of l.slicingArguments){let E=t.argumentDataByName.get(p);E!=null&&E.defaultValue&&i.push((0,ne.listSizeAssumedSizeSlicingArgDefaultErrorMessage)(n,p))}let d=`${u}.${t.name}`;this.costs.listSizes.set(d,l)}extractRequiredScopes({directiveCoords:t,orScopes:n,requiredScopes:r}){if(n.length>xr.MAX_OR_SCOPES){this.invalidORScopesCoords.add(t);return}for(let i of n){let a=new Set;for(let o of i.values)a.add(o.value);a.size<1||(0,Yn.addScopes)(r,a)}}getKafkaPublishConfiguration(t,n,r,i){let a=[],o=W.DEFAULT_EDFS_PROVIDER_ID;for(let u of t.arguments||[])switch(u.name.value){case W.TOPIC:{if(u.value.kind!==Q.Kind.STRING||u.value.value.length<1){i.push((0,ne.invalidEventSubjectErrorMessage)(W.TOPIC));continue}(0,li.validateArgumentTemplateReferences)(u.value.value,n,i),a.push(u.value.value);break}case W.PROVIDER_ID:{if(u.value.kind!==Q.Kind.STRING||u.value.value.length<1){i.push(ne.invalidEventProviderIdErrorMessage);continue}o=u.value.value;break}}if(!(i.length>0))return{fieldName:r,providerId:o,providerType:W.PROVIDER_TYPE_KAFKA,topics:a,type:W.PUBLISH}}getKafkaSubscribeConfiguration(t,n,r,i){let a=[],o=W.DEFAULT_EDFS_PROVIDER_ID;for(let u of t.arguments||[])switch(u.name.value){case W.TOPICS:{if(u.value.kind!==Q.Kind.LIST){i.push((0,ne.invalidEventSubjectsErrorMessage)(W.TOPICS));continue}for(let l of u.value.values){if(l.kind!==Q.Kind.STRING||l.value.length<1){i.push((0,ne.invalidEventSubjectsItemErrorMessage)(W.TOPICS));break}(0,li.validateArgumentTemplateReferences)(l.value,n,i),a.push(l.value)}break}case W.PROVIDER_ID:{if(u.value.kind!==Q.Kind.STRING||u.value.value.length<1){i.push(ne.invalidEventProviderIdErrorMessage);continue}o=u.value.value;break}}if(!(i.length>0))return{fieldName:r,providerId:o,providerType:W.PROVIDER_TYPE_KAFKA,topics:a,type:W.SUBSCRIBE}}getNatsPublishAndRequestConfiguration(t,n,r,i,a){let o=[],u=W.DEFAULT_EDFS_PROVIDER_ID;for(let l of n.arguments||[])switch(l.name.value){case W.SUBJECT:{if(l.value.kind!==Q.Kind.STRING||l.value.value.length<1){a.push((0,ne.invalidEventSubjectErrorMessage)(W.SUBJECT));continue}(0,li.validateArgumentTemplateReferences)(l.value.value,r,a),o.push(l.value.value);break}case W.PROVIDER_ID:{if(l.value.kind!==Q.Kind.STRING||l.value.value.length<1){a.push(ne.invalidEventProviderIdErrorMessage);continue}u=l.value.value;break}}if(!(a.length>0))return{fieldName:i,providerId:u,providerType:W.PROVIDER_TYPE_NATS,subjects:o,type:t}}getNatsSubscribeConfiguration(t,n,r,i){let a=[],o=W.DEFAULT_EDFS_PROVIDER_ID,u=ch.DEFAULT_CONSUMER_INACTIVE_THRESHOLD,l="",d="";for(let p of t.arguments||[])switch(p.name.value){case W.SUBJECTS:{if(p.value.kind!==Q.Kind.LIST){i.push((0,ne.invalidEventSubjectsErrorMessage)(W.SUBJECTS));continue}for(let E of p.value.values){if(E.kind!==Q.Kind.STRING||E.value.length<1){i.push((0,ne.invalidEventSubjectsItemErrorMessage)(W.SUBJECTS));break}(0,li.validateArgumentTemplateReferences)(E.value,n,i),a.push(E.value)}break}case W.PROVIDER_ID:{if(p.value.kind!==Q.Kind.STRING||p.value.value.length<1){i.push(ne.invalidEventProviderIdErrorMessage);continue}o=p.value.value;break}case W.STREAM_CONFIGURATION:{if(this.usesEdfsNatsStreamConfiguration=!0,p.value.kind!==Q.Kind.OBJECT||p.value.fields.length<1){i.push(ne.invalidNatsStreamInputErrorMessage);continue}let E=!0,h=new Set,v=new Set(Dp.STREAM_CONFIGURATION_FIELD_NAMES),A=new Set([W.CONSUMER_NAME,W.STREAM_NAME]),B=new Set,V=new Set;for(let J of p.value.fields){let re=J.name.value;if(!Dp.STREAM_CONFIGURATION_FIELD_NAMES.has(re)){h.add(re),E=!1;continue}if(v.has(re))v.delete(re);else{B.add(re),E=!1;continue}switch(A.has(re)&&A.delete(re),re){case W.CONSUMER_NAME:if(J.value.kind!=Q.Kind.STRING||J.value.value.length<1){V.add(re),E=!1;continue}l=J.value.value;break;case W.STREAM_NAME:if(J.value.kind!=Q.Kind.STRING||J.value.value.length<1){V.add(re),E=!1;continue}d=J.value.value;break;case W.CONSUMER_INACTIVE_THRESHOLD:if(J.value.kind!=Q.Kind.INT){i.push((0,ne.invalidArgumentValueErrorMessage)((0,Q.print)(J.value),"edfs__NatsStreamConfiguration","consumerInactiveThreshold",W.INT_SCALAR)),E=!1;continue}try{u=parseInt(J.value.value,10)}catch(ie){i.push((0,ne.invalidArgumentValueErrorMessage)((0,Q.print)(J.value),"edfs__NatsStreamConfiguration","consumerInactiveThreshold",W.INT_SCALAR)),E=!1}break}}(!E||A.size>0)&&i.push((0,ne.invalidNatsStreamInputFieldsErrorMessage)([...A],[...B],[...V],[...h]))}}if(!(i.length>0))return u<0?(u=ch.DEFAULT_CONSUMER_INACTIVE_THRESHOLD,this.warnings.push((0,cs.consumerInactiveThresholdInvalidValueWarning)(this.subgraphName,`The value has been set to ${ch.DEFAULT_CONSUMER_INACTIVE_THRESHOLD}.`))):u>Kfe.MAX_INT32&&(u=0,this.warnings.push((0,cs.consumerInactiveThresholdInvalidValueWarning)(this.subgraphName,"The value has been set to 0. This means the consumer will remain indefinitely active until its manual deletion."))),M({fieldName:r,providerId:o,providerType:W.PROVIDER_TYPE_NATS,subjects:a,type:W.SUBSCRIBE},l&&d?{streamConfiguration:{consumerInactiveThreshold:u,consumerName:l,streamName:d}}:{})}getRedisPublishConfiguration(t,n,r,i){let a=[],o=W.DEFAULT_EDFS_PROVIDER_ID;for(let u of t.arguments||[])switch(u.name.value){case W.CHANNEL:{if(u.value.kind!==Q.Kind.STRING||u.value.value.length<1){i.push((0,ne.invalidEventSubjectErrorMessage)(W.CHANNEL));continue}(0,li.validateArgumentTemplateReferences)(u.value.value,n,i),a.push(u.value.value);break}case W.PROVIDER_ID:{if(u.value.kind!==Q.Kind.STRING||u.value.value.length<1){i.push(ne.invalidEventProviderIdErrorMessage);continue}o=u.value.value;break}}if(!(i.length>0))return{fieldName:r,providerId:o,providerType:W.PROVIDER_TYPE_REDIS,channels:a,type:W.PUBLISH}}getRedisSubscribeConfiguration(t,n,r,i){let a=[],o=W.DEFAULT_EDFS_PROVIDER_ID;for(let u of t.arguments||[])switch(u.name.value){case W.CHANNELS:{if(u.value.kind!==Q.Kind.LIST){i.push((0,ne.invalidEventSubjectsErrorMessage)(W.CHANNELS));continue}for(let l of u.value.values){if(l.kind!==Q.Kind.STRING||l.value.length<1){i.push((0,ne.invalidEventSubjectsItemErrorMessage)(W.CHANNELS));break}(0,li.validateArgumentTemplateReferences)(l.value,n,i),a.push(l.value)}break}case W.PROVIDER_ID:{if(u.value.kind!==Q.Kind.STRING||u.value.value.length<1){i.push(ne.invalidEventProviderIdErrorMessage);continue}o=u.value.value;break}}if(!(i.length>0))return{fieldName:r,providerId:o,providerType:W.PROVIDER_TYPE_REDIS,channels:a,type:W.SUBSCRIBE}}validateSubscriptionFilterDirectiveLocation(t){if(!t.directives)return;let n=this.renamedParentTypeName||this.originalParentTypeName,r=`${n}.${t.name.value}`,i=this.getOperationTypeNodeForRootTypeName(n)===Q.OperationTypeNode.SUBSCRIPTION;for(let a of t.directives)if(a.name.value===W.SUBSCRIPTION_FILTER&&!i){this.errors.push((0,ne.invalidSubscriptionFilterLocationError)(r));return}}extractEventDirectivesToConfiguration(t,n){if(!t.directives)return;let r=t.name.value,i=`${this.renamedParentTypeName||this.originalParentTypeName}.${r}`;for(let a of t.directives){let o=[],u;switch(a.name.value){case W.EDFS_KAFKA_PUBLISH:u=this.getKafkaPublishConfiguration(a,n,r,o);break;case W.EDFS_KAFKA_SUBSCRIBE:u=this.getKafkaSubscribeConfiguration(a,n,r,o);break;case W.EDFS_NATS_PUBLISH:{u=this.getNatsPublishAndRequestConfiguration(W.PUBLISH,a,n,r,o);break}case W.EDFS_NATS_REQUEST:{u=this.getNatsPublishAndRequestConfiguration(W.REQUEST,a,n,r,o);break}case W.EDFS_NATS_SUBSCRIBE:{u=this.getNatsSubscribeConfiguration(a,n,r,o);break}case W.EDFS_REDIS_PUBLISH:{u=this.getRedisPublishConfiguration(a,n,r,o);break}case W.EDFS_REDIS_SUBSCRIBE:{u=this.getRedisSubscribeConfiguration(a,n,r,o);break}default:continue}if(o.length>0){this.errors.push((0,ne.invalidEventDirectiveError)(a.name.value,i,o));continue}u&&(0,Ue.getValueOrDefault)(this.eventsConfigurations,this.renamedParentTypeName||this.originalParentTypeName,()=>[]).push(u)}}getValidEventsDirectiveNamesForOperationTypeNode(t){switch(t){case Q.OperationTypeNode.MUTATION:return new Set([W.EDFS_KAFKA_PUBLISH,W.EDFS_NATS_PUBLISH,W.EDFS_NATS_REQUEST,W.EDFS_REDIS_PUBLISH]);case Q.OperationTypeNode.QUERY:return new Set([W.EDFS_NATS_REQUEST]);case Q.OperationTypeNode.SUBSCRIPTION:return new Set([W.EDFS_KAFKA_SUBSCRIBE,W.EDFS_NATS_SUBSCRIBE,W.EDFS_REDIS_SUBSCRIBE])}}getOperationTypeNodeForRootTypeName(t){let n=this.operationTypeNodeByTypeName.get(t);if(n)return n;switch(t){case W.MUTATION:return Q.OperationTypeNode.MUTATION;case W.QUERY:return Q.OperationTypeNode.QUERY;case W.SUBSCRIPTION:return Q.OperationTypeNode.SUBSCRIPTION;default:return}}validateEventDrivenRootType(t,n,r,i){let a=this.getOperationTypeNodeForRootTypeName(t.name);if(!a){this.errors.push((0,ne.invalidRootTypeError)(t.name));return}let o=this.getValidEventsDirectiveNamesForOperationTypeNode(a);for(let[u,l]of t.fieldDataByName){let d=`${l.originalParentTypeName}.${u}`,p=new Set;for(let V of Dp.EVENT_DIRECTIVE_NAMES)l.directivesByName.has(V)&&p.add(V);let E=new Set;for(let V of p)o.has(V)||E.add(V);if((p.size<1||E.size>0)&&n.set(d,{definesDirectives:p.size>0,invalidDirectiveNames:[...E]}),a===Q.OperationTypeNode.MUTATION){let V=(0,Ir.printTypeNode)(l.type);V!==W.NON_NULLABLE_EDFS_PUBLISH_EVENT_RESULT&&i.set(d,V);continue}let h=(0,Ir.printTypeNode)(l.type),v=l.namedTypeName+"!",A=!1,B=this.concreteTypeNamesByAbstractTypeName.get(l.namedTypeName)||new Set([l.namedTypeName]);for(let V of B)if(A||(A=this.entityDataByTypeName.has(V)),A)break;(!A||h!==v)&&r.set(d,h)}}validateEventDrivenKeyDefinition(t,n){let r=this.keyFieldSetDatasByTypeName.get(t);if(r)for(let[i,{isUnresolvable:a}]of r)a||(0,Ue.getValueOrDefault)(n,t,()=>[]).push(i)}validateEventDrivenObjectFields(t,n,r,i){var a;for(let[o,u]of t){let l=`${u.originalParentTypeName}.${o}`;if(n.has(o)){(a=u.externalFieldDataBySubgraphName.get(this.subgraphName))!=null&&a.isDefinedExternal||r.set(l,o);continue}i.set(l,o)}}isEdfsPublishResultValid(){let t=this.parentDefinitionDataByTypeName.get(W.EDFS_PUBLISH_RESULT);if(!t)return!0;if(t.kind!==Q.Kind.OBJECT_TYPE_DEFINITION||t.fieldDataByName.size!=1)return!1;for(let[n,r]of t.fieldDataByName)if(r.argumentDataByName.size>0||n!==W.SUCCESS||(0,Ir.printTypeNode)(r.type)!==W.NON_NULLABLE_BOOLEAN)return!1;return!0}isNatsStreamConfigurationInputObjectValid(t){if(!(0,Rt.isInputObjectDefinitionData)(t)||t.inputValueDataByName.size!=3)return!1;for(let[n,r]of t.inputValueDataByName)switch(n){case W.CONSUMER_INACTIVE_THRESHOLD:{if((0,Ir.printTypeNode)(r.type)!==W.NON_NULLABLE_INT||!r.defaultValue||r.defaultValue.kind!==Q.Kind.INT||r.defaultValue.value!==`${ch.DEFAULT_CONSUMER_INACTIVE_THRESHOLD}`)return!1;break}case W.CONSUMER_NAME:case W.STREAM_NAME:{if((0,Ir.printTypeNode)(r.type)!==W.NON_NULLABLE_STRING)return!1;break}default:return!1}return!0}validateEventDrivenSubgraph(){let t=[],n=new Map,r=new Map,i=new Map,a=new Map,o=new Map,u=new Map,l=new Set,d=new Set;for(let[p,E]of this.parentDefinitionDataByTypeName){if(p===W.EDFS_PUBLISH_RESULT||p===W.EDFS_NATS_STREAM_CONFIGURATION||E.kind!==Q.Kind.OBJECT_TYPE_DEFINITION)continue;if(E.isRootType){this.validateEventDrivenRootType(E,n,r,i);continue}let h=this.keyFieldNamesByParentTypeName.get(p);if(!h){d.add(p);continue}this.validateEventDrivenKeyDefinition(p,a),this.validateEventDrivenObjectFields(E.fieldDataByName,h,o,u)}if(this.isEdfsPublishResultValid()||t.push(ne.invalidEdfsPublishResultObjectErrorMessage),this.edfsDirectiveReferences.has(W.EDFS_NATS_SUBSCRIBE)){let p=this.parentDefinitionDataByTypeName.get(W.EDFS_NATS_STREAM_CONFIGURATION);p&&this.usesEdfsNatsStreamConfiguration&&!this.isNatsStreamConfigurationInputObjectValid(p)&&t.push(ne.invalidNatsStreamConfigurationDefinitionErrorMessage),this.parentDefinitionDataByTypeName.delete(W.EDFS_NATS_STREAM_CONFIGURATION);let E=this.upsertInputObjectByNode(SV.EDFS_NATS_STREAM_CONFIGURATION_DEFINITION);if(E.success)for(let h of SV.EDFS_NATS_STREAM_CONFIGURATION_DEFINITION.fields)this.addInputValueDataByNode({fieldName:h.name.value,isArgument:!1,inputValueDataByName:E.data.inputValueDataByName,node:h,originalParentTypeName:W.EDFS_NATS_STREAM_CONFIGURATION});else return}n.size>0&&t.push((0,ne.invalidRootTypeFieldEventsDirectivesErrorMessage)(n)),i.size>0&&t.push((0,ne.invalidEventDrivenMutationResponseTypeErrorMessage)(i)),r.size>0&&t.push((0,ne.invalidRootTypeFieldResponseTypesEventDrivenErrorMessage)(r)),a.size>0&&t.push((0,ne.invalidKeyFieldSetsEventDrivenErrorMessage)(a)),o.size>0&&t.push((0,ne.nonExternalKeyFieldNamesEventDrivenErrorMessage)(o)),u.size>0&&t.push((0,ne.nonKeyFieldNamesEventDrivenErrorMessage)(u)),l.size>0&&t.push((0,ne.nonEntityObjectExtensionsEventDrivenErrorMessage)([...l])),d.size>0&&t.push((0,ne.nonKeyComposingObjectTypeNamesEventDrivenErrorMessage)([...d])),t.length>0&&this.errors.push((0,ne.invalidEventDrivenGraphError)(t))}validateUnionMembers(t){if(t.memberByMemberTypeName.size<1){this.errors.push((0,ne.noDefinedUnionMembersError)(t.name));return}let n=[];for(let r of t.memberByMemberTypeName.keys()){let i=this.parentDefinitionDataByTypeName.get(r);i&&i.kind!==Q.Kind.OBJECT_TYPE_DEFINITION&&n.push(`"${r}", which is type "${(0,Ue.kindToNodeType)(i.kind)}"`)}n.length>0&&this.errors.push((0,ne.invalidUnionMemberTypeError)(t.name,n))}addConcreteTypeNamesForUnion(t){if(!t.types||t.types.length<1)return;let n=t.name.value;for(let r of t.types){let i=r.name.value;(0,Ue.getValueOrDefault)(this.concreteTypeNamesByAbstractTypeName,n,()=>new Set).add(i),this.internalGraph.addEdge(this.internalGraph.addOrUpdateNode(n,{isAbstract:!0}),this.internalGraph.addOrUpdateNode(i),i,!0)}}addValidKeyFieldSetConfigurations(){for(let[t,n]of this.keyFieldSetDatasByTypeName){let r=this.parentDefinitionDataByTypeName.get(t);if(!r||r.kind!==Q.Kind.OBJECT_TYPE_DEFINITION&&r.kind!==Q.Kind.INTERFACE_TYPE_DEFINITION){this.errors.push((0,ne.undefinedCompositeOutputTypeError)(t));continue}let i=(0,Rt.getParentTypeName)(r),a=(0,Ue.getValueOrDefault)(this.configurationDataByTypeName,i,()=>(0,bp.newConfigurationData)(!0,i)),o=(0,li.validateKeyFieldSets)(this,r,n);o&&(a.keys=o)}}getValidFlattenedDirectiveArray(t,n,r=!1){let i=[];for(let[a,o]of t){if(r&&W.INHERITABLE_DIRECTIVE_NAMES.has(a))continue;let u=this.directiveDefinitionDataByName.get(a);if(!u)continue;if(!u.isRepeatable&&o.length>1){let p=(0,Ue.getValueOrDefault)(this.invalidRepeatedDirectiveNameByCoords,n,()=>new Set);p.has(a)||(p.add(a),this.errors.push((0,ne.invalidDirectiveError)(a,n,"1st",[(0,ne.invalidRepeatedDirectiveErrorMessage)(a)])));continue}if(a!==W.KEY){i.push(...o);continue}let l=[],d=new Set;for(let p=0;p0)return $(M({},t.description?{description:t.description}:{}),{directives:this.getValidFlattenedDirectiveArray(t.directivesByName,t.name),kind:Q.Kind.SCHEMA_DEFINITION,operationTypes:n});if(!(t.directivesByName.size<1))return{directives:this.getValidFlattenedDirectiveArray(t.directivesByName,t.name),kind:Q.Kind.SCHEMA_EXTENSION}}getUnionNodeByData(t){return t.node.description=t.description,t.node.directives=this.getValidFlattenedDirectiveArray(t.directivesByName,t.name),t.node.types=(0,Yn.mapToArrayOfValues)(t.memberByMemberTypeName),t.node}evaluateExternalKeyFields(){let t=[];for(let[n,r]of this.keyFieldSetDatasByTypeName){let i=this.parentDefinitionDataByTypeName.get(n);if(!i||i.kind!==Q.Kind.OBJECT_TYPE_DEFINITION&&i.kind!==Q.Kind.INTERFACE_TYPE_DEFINITION){t.push(n),this.errors.push((0,ne.undefinedCompositeOutputTypeError)(n));continue}let a=this;for(let o of r.values()){let u=[i],l=new Map,d=-1,p=!0;if((0,Q.visit)(o.documentNode,{Argument:{enter(){return Q.BREAK}},Field:{enter(E){let h=u[d],v=h.name;if(p)return Q.BREAK;let A=E.name.value,B=`${v}.${A}`;a.unvalidatedExternalFieldCoords.delete(B);let V=h.fieldDataByName.get(A);if(!V||V.argumentDataByName.size)return Q.BREAK;V.isShareableBySubgraphName.set(a.subgraphName,!0);let J=V.externalFieldDataBySubgraphName.get(a.subgraphName);a.edfsDirectiveReferences.size<1&&J&&J.isDefinedExternal&&!J.isUnconditionallyProvided&&i.extensionType!==us.ExtensionType.NONE&&(J.isUnconditionallyProvided=!0,(0,Ue.getValueOrDefault)(l,o.rawFieldSet,()=>new Set).add(B)),(0,Ue.getValueOrDefault)(a.keyFieldNamesByParentTypeName,v,()=>new Set).add(A);let re=(0,nr.getTypeNodeNamedTypeName)(V.node.type);if(xr.BASE_SCALARS.has(re))return;let ie=a.parentDefinitionDataByTypeName.get(re);if(!ie)return Q.BREAK;if(ie.kind===Q.Kind.OBJECT_TYPE_DEFINITION){p=!0,u.push(ie);return}if((0,bn.isKindAbstract)(ie.kind))return Q.BREAK}},InlineFragment:{enter(){return Q.BREAK}},SelectionSet:{enter(){if(!p||(d+=1,p=!1,d<0||d>=u.length))return Q.BREAK},leave(){p&&(p=!1),d-=1,u.pop()}}}),!(l.size<1))for(let[E,h]of l)this.warnings.push((0,cs.externalEntityExtensionKeyFieldWarning)(i.name,E,[...h],this.subgraphName))}}for(let n of t)this.keyFieldSetDatasByTypeName.delete(n)}addValidConditionalFieldSetConfigurations(){for(let[t,n]of this.fieldSetDataByTypeName){let r=this.parentDefinitionDataByTypeName.get(t);if(!r||r.kind!==Q.Kind.OBJECT_TYPE_DEFINITION&&r.kind!==Q.Kind.INTERFACE_TYPE_DEFINITION){this.errors.push((0,ne.undefinedCompositeOutputTypeError)(t));continue}let i=(0,Rt.getParentTypeName)(r),a=(0,Ue.getValueOrDefault)(this.configurationDataByTypeName,i,()=>(0,bp.newConfigurationData)(!1,i)),o=this.validateProvidesOrRequires(r,n.provides,!0);o&&(a.provides=o);let u=this.validateProvidesOrRequires(r,n.requires,!1);u&&(a.requires=u)}}addFieldNamesToConfigurationData(t,n){let r=new Set;for(let[i,a]of t){let o=a.externalFieldDataBySubgraphName.get(this.subgraphName);if(!o||o.isUnconditionallyProvided){n.fieldNames.add(i);continue}r.add(i),this.edfsDirectiveReferences.size>0&&n.fieldNames.add(i)}r.size>0&&(n.externalFieldNames=r)}validateOneOfDirective({data:t,requiredFieldNames:n}){var r,i;return t.directivesByName.has(W.ONE_OF)?n.size>0?(this.errors.push((0,ne.oneOfRequiredFieldsError)({requiredFieldNames:Array.from(n),typeName:t.name})),!1):(t.inputValueDataByName.size===1&&this.warnings.push((0,cs.singleSubgraphInputFieldOneOfWarning)({fieldName:(i=(r=(0,Ue.getFirstEntry)(t.inputValueDataByName))==null?void 0:r.name)!=null?i:"unknown",subgraphName:this.subgraphName,typeName:t.name})),!0):!0}normalize(t){var o;(0,vV.upsertDirectiveSchemaAndEntityDefinitions)(this,t),(0,vV.upsertParentsAndChildren)(this,t);let n=[];yl(this,lh,DV).call(this,n),this.validateDirectives(this.schemaData,W.SCHEMA);let r=this.getSchemaNodeByData(this.schemaData);(r==null?void 0:r.kind)===Q.Kind.SCHEMA_DEFINITION&&n.push(r);for(let[u,l]of this.parentDefinitionDataByTypeName)this.validateDirectives(l,u);this.invalidORScopesCoords.size>0&&this.errors.push((0,ne.orScopesLimitError)(xr.MAX_OR_SCOPES,[...this.invalidORScopesCoords]));for(let u of this.invalidConfigureDescriptionNodeDatas)u.description||this.errors.push((0,ne.configureDescriptionNoDescriptionError)((0,Ue.kindToNodeType)(u.kind),u.name));this.evaluateExternalKeyFields();for(let[u,l]of this.parentDefinitionDataByTypeName)switch(l.kind){case Q.Kind.ENUM_TYPE_DEFINITION:{if(l.enumValueDataByName.size<1){this.errors.push((0,ne.noDefinedEnumValuesError)(u));break}n.push(this.getEnumNodeByData(l));break}case Q.Kind.INPUT_OBJECT_TYPE_DEFINITION:{if(l.inputValueDataByName.size<1){this.errors.push((0,ne.noInputValueDefinitionsError)(u));break}let d=new Set;for(let p of l.inputValueDataByName.values()){if((0,Rt.isTypeRequired)(p.type)&&d.add(p.name),p.namedTypeKind!==Q.Kind.NULL)continue;let E=this.parentDefinitionDataByTypeName.get(p.namedTypeName);if(E){if(this.sanitizeDefaultValue({data:p,namedTypeData:E,node:p.node}),!(0,Rt.isInputNodeKind)(E.kind)){this.errors.push((0,ne.invalidNamedTypeError)({data:p,namedTypeData:E,nodeType:`${(0,Ue.kindToNodeType)(l.kind)} field`}));continue}p.namedTypeKind=E.kind}}if(!this.validateOneOfDirective({data:l,requiredFieldNames:d}))break;u!==W.EDFS_NATS_STREAM_CONFIGURATION&&n.push(this.getInputObjectNodeByData(l));break}case Q.Kind.INTERFACE_TYPE_DEFINITION:case Q.Kind.OBJECT_TYPE_DEFINITION:{let d=this.entityDataByTypeName.has(u),p=this.operationTypeNodeByTypeName.get(u),E=l.kind===Q.Kind.OBJECT_TYPE_DEFINITION;this.isSubgraphVersionTwo&&l.extensionType===us.ExtensionType.EXTENDS&&(l.extensionType=us.ExtensionType.NONE),p&&(l.fieldDataByName.delete(W.SERVICE_FIELD),l.fieldDataByName.delete(W.ENTITIES_FIELD));let h=[];for(let[J,re]of l.fieldDataByName){if(!E&&((o=re.externalFieldDataBySubgraphName.get(this.subgraphName))!=null&&o.isDefinedExternal)&&h.push(J),this.validateArguments(re,l.kind),re.namedTypeKind!==Q.Kind.NULL)continue;let ie=this.parentDefinitionDataByTypeName.get(re.namedTypeName);if(ie){if(!(0,Rt.isOutputNodeKind)(ie.kind)){this.errors.push((0,ne.invalidNamedTypeError)({data:re,namedTypeData:ie,nodeType:`${(0,Ue.kindToNodeType)(l.kind)} field`}));continue}re.namedTypeKind=this.entityInterfaceDataByTypeName.get(ie.name)?Q.Kind.INTERFACE_TYPE_DEFINITION:ie.kind}}h.length>0&&(this.isSubgraphVersionTwo?this.errors.push((0,ne.externalInterfaceFieldsError)(u,h)):this.warnings.push((0,cs.externalInterfaceFieldsWarning)(this.subgraphName,u,[...h])));let v=(0,Rt.getParentTypeName)(l),A=(0,Ue.getValueOrDefault)(this.configurationDataByTypeName,v,()=>(0,bp.newConfigurationData)(d,u)),B=this.entityInterfaceDataByTypeName.get(u);if(B){B.fieldDatas=(0,Yn.fieldDatasToSimpleFieldDatas)(l.fieldDataByName.values());let J=this.concreteTypeNamesByAbstractTypeName.get(u);J&&(0,Ue.addIterableToSet)({source:J,target:B.concreteTypeNames}),A.isInterfaceObject=B.isInterfaceObject,A.entityInterfaceConcreteTypeNames=B.concreteTypeNames}let V=this.eventsConfigurations.get(v);V&&(A.events=V),this.addFieldNamesToConfigurationData(l.fieldDataByName,A),this.validateInterfaceImplementations(l),n.push(this.getCompositeOutputNodeByData(l)),l.fieldDataByName.size<1&&!(0,li.isNodeQuery)(u,p)&&this.errors.push((0,ne.noFieldDefinitionsError)((0,Ue.kindToNodeType)(l.kind),u)),l.requireFetchReasonsFieldNames.size>0&&(A.requireFetchReasonsFieldNames=[...l.requireFetchReasonsFieldNames]);break}case Q.Kind.SCALAR_TYPE_DEFINITION:{if(l.extensionType===us.ExtensionType.REAL){this.errors.push((0,ne.noBaseScalarDefinitionError)(u));break}n.push(this.getScalarNodeByData(l));break}case Q.Kind.UNION_TYPE_DEFINITION:{n.push(this.getUnionNodeByData(l)),this.validateUnionMembers(l);break}default:throw(0,ne.unexpectedKindFatalError)(u)}this.isSubgraphEventDrivenGraph=this.edfsDirectiveReferences.size>0,this.addValidConditionalFieldSetConfigurations(),this.addValidKeyFieldSetConfigurations();for(let u of Object.values(Q.OperationTypeNode)){let l=this.schemaData.operationTypes.get(u),d=(0,Ue.getOrThrowError)(bn.operationTypeNodeToDefaultType,u,W.OPERATION_TO_DEFAULT),p=l?(0,nr.getTypeNodeNamedTypeName)(l.type):d;if(xr.BASE_SCALARS.has(p)&&this.referencedTypeNames.add(p),p!==d&&this.parentDefinitionDataByTypeName.has(d)){this.errors.push((0,ne.invalidRootTypeDefinitionError)(u,p,d));continue}let E=this.parentDefinitionDataByTypeName.get(p);if(l){if(!E)continue;this.operationTypeNodeByTypeName.set(p,u)}if(!E)continue;let h=this.configurationDataByTypeName.get(d);h&&(h.isRootNode=!0,h.typeName=d),E.kind!==Q.Kind.OBJECT_TYPE_DEFINITION&&this.errors.push((0,ne.operationDefinitionError)(p,u,E.kind))}for(let u of this.referencedTypeNames){let l=this.parentDefinitionDataByTypeName.get(u);if(!l){this.errors.push((0,ne.undefinedTypeError)(u));continue}if(l.kind!==Q.Kind.INTERFACE_TYPE_DEFINITION)continue;let d=this.concreteTypeNamesByAbstractTypeName.get(u);(!d||d.size<1)&&this.warnings.push((0,cs.unimplementedInterfaceOutputTypeWarning)(this.subgraphName,u))}let i=new Map;for(let u of this.directiveDefinitionByName.values()){let l=(0,bn.extractExecutableDirectiveLocations)(u.locations,new Set);l.size<1||this.addPersistedDirectiveDefinitionDataByNode(i,u,l)}this.isSubgraphEventDrivenGraph&&this.validateEventDrivenSubgraph();for(let u of this.unvalidatedExternalFieldCoords)this.isSubgraphVersionTwo?this.errors.push((0,ne.invalidExternalDirectiveError)(u)):this.warnings.push((0,cs.invalidExternalFieldWarning)(u,this.subgraphName));if(this.errors.length>0)return{success:!1,errors:this.errors,warnings:this.warnings};let a={kind:Q.Kind.DOCUMENT,definitions:n};return{authorizationDataByParentTypeName:this.authorizationDataByParentTypeName,concreteTypeNamesByAbstractTypeName:this.concreteTypeNamesByAbstractTypeName,conditionalFieldDataByCoordinates:this.conditionalFieldDataByCoords,configurationDataByTypeName:this.configurationDataByTypeName,costs:this.costs,directiveDefinitionByName:this.directiveDefinitionByName,entityDataByTypeName:this.entityDataByTypeName,entityInterfaces:this.entityInterfaceDataByTypeName,fieldCoordsByNamedTypeName:this.fieldCoordsByNamedTypeName,interfaceImplementationTypeNamesByInterfaceTypeName:this.interfaceImplementationTypeNamesByInterfaceTypeName,isEventDrivenGraph:this.isSubgraphEventDrivenGraph,isVersionTwo:this.isSubgraphVersionTwo,keyFieldNamesByParentTypeName:this.keyFieldNamesByParentTypeName,keyFieldSetsByEntityTypeNameByKeyFieldCoords:this.keyFieldSetsByEntityTypeNameByFieldCoords,operationTypes:this.operationTypeNodeByTypeName,originalTypeNameByRenamedTypeName:this.originalTypeNameByRenamedTypeName,overridesByTargetSubgraphName:this.overridesByTargetSubgraphName,parentDefinitionDataByTypeName:this.parentDefinitionDataByTypeName,persistedDirectiveDefinitionDataByDirectiveName:i,schemaNode:r,subgraphAST:a,subgraphString:(0,Q.print)(a),schema:(0,Vfe.buildASTSchema)(a,{addInvalidExtensionOrphans:!0,assumeValid:!0,assumeValidSDL:!0}),success:!0,warnings:this.warnings}}};Rp=new WeakSet,Nb=function({currentFieldCoords:t,directiveCoords:n,directiveName:r,fieldSet:i}){if(this.isSubgraphVersionTwo){this.errors.push((0,ne.nonExternalConditionalFieldError)({directiveCoords:n,directiveName:r,fieldSet:i,subgraphName:this.subgraphName,targetCoords:t}));return}this.warnings.push((0,cs.nonExternalConditionalFieldWarning)(n,this.subgraphName,t,i,r))},lh=new WeakSet,DV=function(t){let n=new Set;for(let r of this.referencedDirectiveNames){let i=xr.DIRECTIVE_DEFINITION_BY_NAME.get(r);i&&(this.directiveDefinitionByName.set(r,i),(0,Ue.addOptionalIterableToSet)({source:Dp.DEPENDENCIES_BY_DIRECTIVE_NAME.get(r),target:n}),t.push(i))}for(let r of this.customDirectiveDefinitionByName.values())t.push(r);t.push(...n)};jc.NormalizationFactory=Ap;function Gfe({options:e,subgraphs:t}){let n=new Map,r=new Map,i=new Map,a=new Map,o=new Map,u=new Map,l=new Map,d=new Set,p=new Map,E=new Set,h=new Set,v=[],A=new Set,B=new Map,V=[],J=[];for(let Ne of t)Ne.name&&(0,jfe.recordSubgraphName)(Ne.name,E,h);let re=new Tb.Graph;for(let Ne=0;Ne0&&V.push(...ye.warnings),!ye.success){J.push((0,ne.subgraphValidationError)(_e,ye.errors));continue}if(!ye){J.push((0,ne.subgraphValidationError)(_e,[ne.subgraphValidationFailureError]));continue}p.set(_e,ye.parentDefinitionDataByTypeName);for(let qe of ye.authorizationDataByParentTypeName.values())(0,Yn.upsertAuthorizationData)(n,qe,A);for(let[qe,Z]of ye.fieldCoordsByNamedTypeName)(0,Ue.addIterableToSet)({source:Z,target:(0,Ue.getValueOrDefault)(B,qe,()=>new Set)});for(let[qe,Z]of ye.concreteTypeNamesByAbstractTypeName){let ge=r.get(qe);if(!ge){r.set(qe,new Set(Z));continue}(0,Ue.addIterableToSet)({source:Z,target:ge})}for(let[qe,Z]of ye.interfaceImplementationTypeNamesByInterfaceTypeName){let ge=a.get(qe);if(!ge){a.set(qe,new Set(Z));continue}(0,Ue.addIterableToSet)({source:Z,target:ge})}for(let[qe,Z]of ye.entityDataByTypeName){let ge=Z.keyFieldSetDatasBySubgraphName.get(_e);ge&&(0,Yn.upsertEntityData)({entityDataByTypeName:i,keyFieldSetDataByFieldSet:ge,typeName:qe,subgraphName:_e})}if(Ee.name&&o.set(_e,{conditionalFieldDataByCoordinates:ye.conditionalFieldDataByCoordinates,configurationDataByTypeName:ye.configurationDataByTypeName,costs:ye.costs,definitions:ye.subgraphAST,directiveDefinitionByName:ye.directiveDefinitionByName,entityInterfaces:ye.entityInterfaces,isVersionTwo:ye.isVersionTwo,keyFieldNamesByParentTypeName:ye.keyFieldNamesByParentTypeName,name:_e,operationTypes:ye.operationTypes,overriddenFieldNamesByParentTypeName:new Map,parentDefinitionDataByTypeName:ye.parentDefinitionDataByTypeName,persistedDirectiveDefinitionDataByDirectiveName:ye.persistedDirectiveDefinitionDataByDirectiveName,schema:ye.schema,schemaNode:ye.schemaNode,url:Ee.url}),!(ye.overridesByTargetSubgraphName.size<1))for(let[qe,Z]of ye.overridesByTargetSubgraphName){let ge=E.has(qe);for(let[It,Zt]of Z){let In=ye.originalTypeNameByRenamedTypeName.get(It)||It;if(!ge)V.push((0,cs.invalidOverrideTargetSubgraphNameWarning)(qe,In,[...Zt],Ee.name));else{let Tn=(0,Ue.getValueOrDefault)(u,qe,()=>new Map),Ot=(0,Ue.getValueOrDefault)(Tn,It,()=>new Set(Zt));(0,Ue.addIterableToSet)({source:Zt,target:Ot})}for(let Tn of Zt){let Ot=`${In}.${Tn}`,Kt=l.get(Ot);if(!Kt){l.set(Ot,[_e]);continue}Kt.push(_e),d.add(Ot)}}}}let ie=[];if(A.size>0&&ie.push((0,ne.orScopesLimitError)(xr.MAX_OR_SCOPES,[...A])),(v.length>0||h.size>0)&&ie.push((0,ne.invalidSubgraphNamesError)([...h],v)),d.size>0){let Ne=[];for(let Ee of d){let _e=(0,Ue.getOrThrowError)(l,Ee,"overrideSourceSubgraphNamesByFieldPath");Ne.push((0,ne.duplicateOverriddenFieldErrorMessage)(Ee,_e))}ie.push((0,ne.duplicateOverriddenFieldsError)(Ne))}if(ie.push(...J),ie.length>0)return{errors:ie,success:!1,warnings:V};for(let[Ne,Ee]of u){let _e=(0,Ue.getOrThrowError)(o,Ne,"internalSubgraphBySubgraphName");_e.overriddenFieldNamesByParentTypeName=Ee;for(let[ye,qe]of Ee){let Z=_e.configurationDataByTypeName.get(ye);Z&&((0,Yn.subtractSet)(qe,Z.fieldNames),Z.fieldNames.size<1&&_e.configurationDataByTypeName.delete(ye))}}return{authorizationDataByParentTypeName:n,concreteTypeNamesByAbstractTypeName:r,entityDataByTypeName:i,fieldCoordsByNamedTypeName:B,interfaceImplementationTypeNamesByInterfaceTypeName:a,internalSubgraphBySubgraphName:o,internalGraph:re,success:!0,warnings:V}}});var dh=F(Gc=>{"use strict";m();T();N();Object.defineProperty(Gc,"__esModule",{value:!0});Gc.DivergentType=void 0;Gc.getLeastRestrictiveMergedTypeNode=Yfe;Gc.getMostRestrictiveMergedTypeNode=Jfe;Gc.renameNamedTypeName=zfe;var Kc=Se(),AV=Qi(),Qfe=Au(),bV=Cr(),RV=jl(),$c;(function(e){e[e.NONE=0]="NONE",e[e.CURRENT=1]="CURRENT",e[e.OTHER=2]="OTHER"})($c||(Gc.DivergentType=$c={}));function PV(e,t,n,r,i){t=(0,Qfe.getMutableTypeNode)(t,n,i);let a={kind:e.kind},o=$c.NONE,u=a;for(let l=0;l{"use strict";m();T();N();Object.defineProperty(yb,"__esModule",{value:!0});yb.renameRootTypes=Xfe;var Hfe=Se(),hb=Cr(),Wfe=dh(),Mu=Hn(),Qc=Ur();function Xfe(e,t){let n,r=!1,i;(0,Hfe.visit)(t.definitions,{FieldDefinition:{enter(a){let o=a.name.value;if(r&&(o===Mu.SERVICE_FIELD||o===Mu.ENTITIES_FIELD))return n.fieldDataByName.delete(o),!1;let u=n.name,l=(0,Qc.getOrThrowError)(n.fieldDataByName,o,`${u}.fieldDataByFieldName`),d=t.operationTypes.get(l.namedTypeName);if(d){let p=(0,Qc.getOrThrowError)(hb.operationTypeNodeToDefaultType,d,Mu.OPERATION_TO_DEFAULT);l.namedTypeName!==p&&(0,Wfe.renameNamedTypeName)(l,p,e.errors)}return i!=null&&i.has(o)&&l.isShareableBySubgraphName.delete(t.name),!1}},InterfaceTypeDefinition:{enter(a){let o=a.name.value;if(!e.entityInterfaceFederationDataByTypeName.get(o))return!1;n=(0,Qc.getOrThrowError)(t.parentDefinitionDataByTypeName,o,Mu.PARENT_DEFINITION_DATA)},leave(){n=void 0}},ObjectTypeDefinition:{enter(a){let o=a.name.value,u=t.operationTypes.get(o),l=u?(0,Qc.getOrThrowError)(hb.operationTypeNodeToDefaultType,u,Mu.OPERATION_TO_DEFAULT):o;n=(0,Qc.getOrThrowError)(t.parentDefinitionDataByTypeName,o,Mu.PARENT_DEFINITION_DATA),r=n.isRootType,!e.entityInterfaceFederationDataByTypeName.get(o)&&(e.addValidPrimaryKeyTargetsToEntityData(o),i=t.overriddenFieldNamesByParentTypeName.get(l),o!==l&&(n.name=l,t.parentDefinitionDataByTypeName.set(l,n),t.parentDefinitionDataByTypeName.delete(o)))},leave(){n=void 0,r=!1,i=void 0}},ObjectTypeExtension:{enter(a){let o=a.name.value,u=t.operationTypes.get(o),l=u?(0,Qc.getOrThrowError)(hb.operationTypeNodeToDefaultType,u,Mu.OPERATION_TO_DEFAULT):o;n=(0,Qc.getOrThrowError)(t.parentDefinitionDataByTypeName,o,Mu.PARENT_DEFINITION_DATA),r=n.isRootType,e.addValidPrimaryKeyTargetsToEntityData(o),i=t.overriddenFieldNamesByParentTypeName.get(o),o!==l&&(n.name=l,t.parentDefinitionDataByTypeName.set(l,n),t.parentDefinitionDataByTypeName.delete(o))},leave(){n=void 0,r=!1,i=void 0}}})}});var FV=F((Id,Pp)=>{"use strict";m();T();N();(function(){var e,t="4.17.21",n=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid `variable` option passed into `_.template`",o="__lodash_hash_undefined__",u=500,l="__lodash_placeholder__",d=1,p=2,E=4,h=1,v=2,A=1,B=2,V=4,J=8,re=16,ie=32,Ne=64,Ee=128,_e=256,ye=512,qe=30,Z="...",ge=800,It=16,Zt=1,In=2,Tn=3,Ot=1/0,Kt=9007199254740991,qr=17976931348623157e292,rr=NaN,En=4294967295,en=En-1,Ln=En>>>1,se=[["ary",Ee],["bind",A],["bindKey",B],["curry",J],["curryRight",re],["flip",ye],["partial",ie],["partialRight",Ne],["rearg",_e]],Ae="[object Arguments]",ve="[object Array]",Ce="[object AsyncFunction]",bt="[object Boolean]",z="[object Date]",ae="[object DOMException]",Ke="[object Error]",He="[object Function]",Mt="[object GeneratorFunction]",it="[object Map]",Lt="[object Number]",ms="[object Null]",Wr="[object Object]",Ns="[object Promise]",al="[object Proxy]",Ba="[object RegExp]",gr="[object Set]",di="[object String]",$t="[object Symbol]",_r="[object Undefined]",Gu="[object WeakMap]",ka="[object WeakSet]",Qu="[object ArrayBuffer]",P="[object DataView]",I="[object Float32Array]",_="[object Float64Array]",U="[object Int8Array]",K="[object Int16Array]",ee="[object Int32Array]",ce="[object Uint8Array]",Tt="[object Uint8ClampedArray]",hn="[object Uint16Array]",un="[object Uint32Array]",vn=/\b__p \+= '';/g,sn=/\b(__p \+=) '' \+/g,IK=/(__e\(.*?\)|\b__t\)) \+\n'';/g,_A=/&(?:amp|lt|gt|quot|#39);/g,vA=/[&<>"']/g,gK=RegExp(_A.source),_K=RegExp(vA.source),vK=/<%-([\s\S]+?)%>/g,SK=/<%([\s\S]+?)%>/g,SA=/<%=([\s\S]+?)%>/g,OK=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,DK=/^\w*$/,bK=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Vh=/[\\^$.*+?()[\]{}|]/g,AK=RegExp(Vh.source),jh=/^\s+/,RK=/\s/,PK=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,FK=/\{\n\/\* \[wrapped with (.+)\] \*/,wK=/,? & /,LK=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,CK=/[()=,{}\[\]\/\s]/,UK=/\\(\\)?/g,BK=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,OA=/\w*$/,kK=/^[-+]0x[0-9a-f]+$/i,MK=/^0b[01]+$/i,xK=/^\[object .+?Constructor\]$/,qK=/^0o[0-7]+$/i,VK=/^(?:0|[1-9]\d*)$/,jK=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,om=/($^)/,KK=/['\n\r\u2028\u2029\\]/g,um="\\ud800-\\udfff",$K="\\u0300-\\u036f",GK="\\ufe20-\\ufe2f",QK="\\u20d0-\\u20ff",DA=$K+GK+QK,bA="\\u2700-\\u27bf",AA="a-z\\xdf-\\xf6\\xf8-\\xff",YK="\\xac\\xb1\\xd7\\xf7",JK="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",zK="\\u2000-\\u206f",HK=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",RA="A-Z\\xc0-\\xd6\\xd8-\\xde",PA="\\ufe0e\\ufe0f",FA=YK+JK+zK+HK,Kh="['\u2019]",WK="["+um+"]",wA="["+FA+"]",cm="["+DA+"]",LA="\\d+",XK="["+bA+"]",CA="["+AA+"]",UA="[^"+um+FA+LA+bA+AA+RA+"]",$h="\\ud83c[\\udffb-\\udfff]",ZK="(?:"+cm+"|"+$h+")",BA="[^"+um+"]",Gh="(?:\\ud83c[\\udde6-\\uddff]){2}",Qh="[\\ud800-\\udbff][\\udc00-\\udfff]",sl="["+RA+"]",kA="\\u200d",MA="(?:"+CA+"|"+UA+")",e$="(?:"+sl+"|"+UA+")",xA="(?:"+Kh+"(?:d|ll|m|re|s|t|ve))?",qA="(?:"+Kh+"(?:D|LL|M|RE|S|T|VE))?",VA=ZK+"?",jA="["+PA+"]?",t$="(?:"+kA+"(?:"+[BA,Gh,Qh].join("|")+")"+jA+VA+")*",n$="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",r$="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",KA=jA+VA+t$,i$="(?:"+[XK,Gh,Qh].join("|")+")"+KA,a$="(?:"+[BA+cm+"?",cm,Gh,Qh,WK].join("|")+")",s$=RegExp(Kh,"g"),o$=RegExp(cm,"g"),Yh=RegExp($h+"(?="+$h+")|"+a$+KA,"g"),u$=RegExp([sl+"?"+CA+"+"+xA+"(?="+[wA,sl,"$"].join("|")+")",e$+"+"+qA+"(?="+[wA,sl+MA,"$"].join("|")+")",sl+"?"+MA+"+"+xA,sl+"+"+qA,r$,n$,LA,i$].join("|"),"g"),c$=RegExp("["+kA+um+DA+PA+"]"),l$=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,d$=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],f$=-1,gn={};gn[I]=gn[_]=gn[U]=gn[K]=gn[ee]=gn[ce]=gn[Tt]=gn[hn]=gn[un]=!0,gn[Ae]=gn[ve]=gn[Qu]=gn[bt]=gn[P]=gn[z]=gn[Ke]=gn[He]=gn[it]=gn[Lt]=gn[Wr]=gn[Ba]=gn[gr]=gn[di]=gn[Gu]=!1;var yn={};yn[Ae]=yn[ve]=yn[Qu]=yn[P]=yn[bt]=yn[z]=yn[I]=yn[_]=yn[U]=yn[K]=yn[ee]=yn[it]=yn[Lt]=yn[Wr]=yn[Ba]=yn[gr]=yn[di]=yn[$t]=yn[ce]=yn[Tt]=yn[hn]=yn[un]=!0,yn[Ke]=yn[He]=yn[Gu]=!1;var p$={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},m$={"&":"&","<":"<",">":">",'"':""","'":"'"},N$={"&":"&","<":"<",">":">",""":'"',"'":"'"},T$={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},E$=parseFloat,h$=parseInt,$A=typeof global=="object"&&global&&global.Object===Object&&global,y$=typeof self=="object"&&self&&self.Object===Object&&self,fr=$A||y$||Function("return this")(),Jh=typeof Id=="object"&&Id&&!Id.nodeType&&Id,Yu=Jh&&typeof Pp=="object"&&Pp&&!Pp.nodeType&&Pp,GA=Yu&&Yu.exports===Jh,zh=GA&&$A.process,Di=function(){try{var Y=Yu&&Yu.require&&Yu.require("util").types;return Y||zh&&zh.binding&&zh.binding("util")}catch(ue){}}(),QA=Di&&Di.isArrayBuffer,YA=Di&&Di.isDate,JA=Di&&Di.isMap,zA=Di&&Di.isRegExp,HA=Di&&Di.isSet,WA=Di&&Di.isTypedArray;function fi(Y,ue,te){switch(te.length){case 0:return Y.call(ue);case 1:return Y.call(ue,te[0]);case 2:return Y.call(ue,te[0],te[1]);case 3:return Y.call(ue,te[0],te[1],te[2])}return Y.apply(ue,te)}function I$(Y,ue,te,Be){for(var ft=-1,Ht=Y==null?0:Y.length;++ft-1}function Hh(Y,ue,te){for(var Be=-1,ft=Y==null?0:Y.length;++Be-1;);return te}function a0(Y,ue){for(var te=Y.length;te--&&ol(ue,Y[te],0)>-1;);return te}function R$(Y,ue){for(var te=Y.length,Be=0;te--;)Y[te]===ue&&++Be;return Be}var P$=ey(p$),F$=ey(m$);function w$(Y){return"\\"+T$[Y]}function L$(Y,ue){return Y==null?e:Y[ue]}function ul(Y){return c$.test(Y)}function C$(Y){return l$.test(Y)}function U$(Y){for(var ue,te=[];!(ue=Y.next()).done;)te.push(ue.value);return te}function iy(Y){var ue=-1,te=Array(Y.size);return Y.forEach(function(Be,ft){te[++ue]=[ft,Be]}),te}function s0(Y,ue){return function(te){return Y(ue(te))}}function uu(Y,ue){for(var te=-1,Be=Y.length,ft=0,Ht=[];++te-1}function _G(s,c){var f=this.__data__,y=bm(f,s);return y<0?(++this.size,f.push([s,c])):f[y][1]=c,this}Ts.prototype.clear=hG,Ts.prototype.delete=yG,Ts.prototype.get=IG,Ts.prototype.has=gG,Ts.prototype.set=_G;function Es(s){var c=-1,f=s==null?0:s.length;for(this.clear();++c=c?s:c)),s}function Pi(s,c,f,y,S,L){var x,j=c&d,H=c&p,de=c&E;if(f&&(x=S?f(s,y,S,L):f(s)),x!==e)return x;if(!An(s))return s;var fe=pt(s);if(fe){if(x=DQ(s),!j)return Xr(s,x)}else{var Te=Rr(s),Re=Te==He||Te==Mt;if(Nu(s))return j0(s,j);if(Te==Wr||Te==Ae||Re&&!S){if(x=H||Re?{}:oR(s),!j)return H?NQ(s,MG(x,s)):mQ(s,h0(x,s))}else{if(!yn[Te])return S?s:{};x=bQ(s,Te,j)}}L||(L=new oa);var Ge=L.get(s);if(Ge)return Ge;L.set(s,x),BR(s)?s.forEach(function(nt){x.add(Pi(nt,c,f,nt,s,L))}):CR(s)&&s.forEach(function(nt,At){x.set(At,Pi(nt,c,f,At,s,L))});var tt=de?H?Py:Ry:H?ei:pr,gt=fe?e:tt(s);return bi(gt||s,function(nt,At){gt&&(At=nt,nt=s[At]),xd(x,At,Pi(nt,c,f,At,s,L))}),x}function xG(s){var c=pr(s);return function(f){return y0(f,s,c)}}function y0(s,c,f){var y=f.length;if(s==null)return!y;for(s=mn(s);y--;){var S=f[y],L=c[S],x=s[S];if(x===e&&!(S in s)||!L(x))return!1}return!0}function I0(s,c,f){if(typeof s!="function")throw new Ai(i);return Qd(function(){s.apply(e,f)},c)}function qd(s,c,f,y){var S=-1,L=lm,x=!0,j=s.length,H=[],de=c.length;if(!j)return H;f&&(c=Sn(c,pi(f))),y?(L=Hh,x=!1):c.length>=n&&(L=Ld,x=!1,c=new Hu(c));e:for(;++SS?0:S+f),y=y===e||y>S?S:ht(y),y<0&&(y+=S),y=f>y?0:MR(y);f0&&f(j)?c>1?vr(j,c-1,f,y,S):ou(S,j):y||(S[S.length]=j)}return S}var dy=J0(),v0=J0(!0);function Ma(s,c){return s&&dy(s,c,pr)}function fy(s,c){return s&&v0(s,c,pr)}function Rm(s,c){return su(c,function(f){return _s(s[f])})}function Xu(s,c){c=pu(c,s);for(var f=0,y=c.length;s!=null&&fc}function jG(s,c){return s!=null&&on.call(s,c)}function KG(s,c){return s!=null&&c in mn(s)}function $G(s,c,f){return s>=Ar(c,f)&&s=120&&fe.length>=120)?new Hu(x&&fe):e}fe=s[0];var Te=-1,Re=j[0];e:for(;++Te-1;)j!==s&&Im.call(j,H,1),Im.call(s,H,1);return s}function C0(s,c){for(var f=s?c.length:0,y=f-1;f--;){var S=c[f];if(f==y||S!==L){var L=S;gs(S)?Im.call(s,S,1):_y(s,S)}}return s}function yy(s,c){return s+vm(m0()*(c-s+1))}function rQ(s,c,f,y){for(var S=-1,L=ar(_m((c-s)/(f||1)),0),x=te(L);L--;)x[y?L:++S]=s,s+=f;return x}function Iy(s,c){var f="";if(!s||c<1||c>Kt)return f;do c%2&&(f+=s),c=vm(c/2),c&&(s+=s);while(c);return f}function vt(s,c){return ky(lR(s,c,ti),s+"")}function iQ(s){return E0(hl(s))}function aQ(s,c){var f=hl(s);return qm(f,Wu(c,0,f.length))}function Kd(s,c,f,y){if(!An(s))return s;c=pu(c,s);for(var S=-1,L=c.length,x=L-1,j=s;j!=null&&++SS?0:S+c),f=f>S?S:f,f<0&&(f+=S),S=c>f?0:f-c>>>0,c>>>=0;for(var L=te(S);++y>>1,x=s[L];x!==null&&!Ni(x)&&(f?x<=c:x=n){var de=c?null:yQ(s);if(de)return fm(de);x=!1,S=Ld,H=new Hu}else H=c?[]:j;e:for(;++y=y?s:Fi(s,c,f)}var V0=H$||function(s){return fr.clearTimeout(s)};function j0(s,c){if(c)return s.slice();var f=s.length,y=c0?c0(f):new s.constructor(f);return s.copy(y),y}function Dy(s){var c=new s.constructor(s.byteLength);return new hm(c).set(new hm(s)),c}function lQ(s,c){var f=c?Dy(s.buffer):s.buffer;return new s.constructor(f,s.byteOffset,s.byteLength)}function dQ(s){var c=new s.constructor(s.source,OA.exec(s));return c.lastIndex=s.lastIndex,c}function fQ(s){return Md?mn(Md.call(s)):{}}function K0(s,c){var f=c?Dy(s.buffer):s.buffer;return new s.constructor(f,s.byteOffset,s.length)}function $0(s,c){if(s!==c){var f=s!==e,y=s===null,S=s===s,L=Ni(s),x=c!==e,j=c===null,H=c===c,de=Ni(c);if(!j&&!de&&!L&&s>c||L&&x&&H&&!j&&!de||y&&x&&H||!f&&H||!S)return 1;if(!y&&!L&&!de&&s=j)return H;var de=f[y];return H*(de=="desc"?-1:1)}}return s.index-c.index}function G0(s,c,f,y){for(var S=-1,L=s.length,x=f.length,j=-1,H=c.length,de=ar(L-x,0),fe=te(H+de),Te=!y;++j1?f[S-1]:e,x=S>2?f[2]:e;for(L=s.length>3&&typeof L=="function"?(S--,L):e,x&&jr(f[0],f[1],x)&&(L=S<3?e:L,S=1),c=mn(c);++y-1?S[L?c[x]:x]:e}}function W0(s){return Is(function(c){var f=c.length,y=f,S=Ri.prototype.thru;for(s&&c.reverse();y--;){var L=c[y];if(typeof L!="function")throw new Ai(i);if(S&&!x&&Mm(L)=="wrapper")var x=new Ri([],!0)}for(y=x?y:f;++y1&&Ct.reverse(),fe&&Hj))return!1;var de=L.get(s),fe=L.get(c);if(de&&fe)return de==c&&fe==s;var Te=-1,Re=!0,Ge=f&v?new Hu:e;for(L.set(s,c),L.set(c,s);++Te1?"& ":"")+c[y],c=c.join(f>2?", ":" "),s.replace(PK,`{ +`+Pr.LITERAL_SPACE.repeat(t+3)+`... +`+Pr.LITERAL_SPACE.repeat(t+2)+`} +`}function vb({entityAncestorData:e,rootFieldData:t,unresolvableFieldData:n}){let{externalSubgraphNames:r,fieldName:i,typeName:a,subgraphNames:o}=n,u=[t.message];if(r.size>0){let l=o.difference(r);u.push(`The field "${a}.${i}" is defined (and resolvable) in the following subgraph`+(l.size>1?"s":"")+`: "${[...l].join(Pr.QUOTATION_JOIN)}".`,`The field "${a}.${i}" is defined "@external" (and unresolvable) in the following subgraph`+(r.size>1?"s":"")+`: "${[...r].join(Pr.QUOTATION_JOIN)}".`)}else u.push(`The field "${a}.${i}" is defined in the following subgraph`+(o.size>1?"s":"")+`: "${[...o].join(Pr.QUOTATION_JOIN)}".`);if(e){let l=!1;for(let[d,p]of e.fieldSetsByTargetSubgraphName)if(o.has(d)){l=!0;for(let E of p)e.subgraphName!==d&&u.push(`The entity ancestor "${e.typeName}" in subgraph "${e.subgraphName}" does not satisfy the key field set "${E}" to access subgraph "${d}".`)}l||u.push(`The entity ancestor "${e.typeName}" in subgraph "${e.subgraphName}" has no accessible target entities (resolvable @key directives) in the subgraphs where "${a}.${i}" is defined.`),u.push(`The type "${a}" is not a descendant of any other entity ancestors that can provide a shared route to access "${i}".`)}else t.subgraphNames.size>1&&u.push(`None of the subgraphs that shares the same root type field "${t.coords}" can provide a route to access "${i}".`),u.push(`The type "${a}" is not a descendant of an entity ancestor that can provide a shared route to access "${i}".`);return a!==(e==null?void 0:e.typeName)&&u.push(`The type "${a}" has no accessible target entities (resolvable @key directives) in any other subgraph, so accessing other subgraphs is not possible.`),u}function Dfe({entityAncestors:{subgraphNames:e,typeName:t},fieldSets:n,reasons:r,targetSubgraphName:i}){for(let a of n){let o=e.filter(l=>l!==i);if(o.length<1)continue;let u=o.length>1;r.push(`The entity ancestor${u?"s":""} "${t}" in subgraph${u?"s":""} "${o.join(Pr.QUOTATION_JOIN)}" do${u?"":"es"} not satisfy the key field set "${a}" to access subgraph "${i}".`)}}function bfe({coords:e,entityAncestors:{sourceSubgraphNamesBySatisfiedFieldSet:t,subgraphNames:n,typeName:r},fieldSets:i,reasons:a,targetSubgraphName:o}){let u=[],l=[];for(let d of i){let p=t.get(d);if(!p){let _=n.filter(k=>k!==o),S=_.length>1;u.push(`The entity ancestor${S?"s":""} "${r}" in subgraph${S?"s":""} "${_.join(Pr.QUOTATION_JOIN)}" do${S?"":"es"} not satisfy the key field set "${d}" to access subgraph "${o}".`);continue}let E=p.filter(_=>_!==o);if(E.length<1)continue;let h=E.length>1;l.push(`The entity ancestor "${r}" in subgraph${h?"s":""} "${E.join(Pr.QUOTATION_JOIN)}" ${h?"are":"is"} able to satisfy at least one key field set to access subgraph "${o}", but this still does not provide a route to resolve "${e}".`)}a.push(...l.length>0?l:u)}function LK({entityAncestors:e,rootFieldData:t,unresolvableFieldData:n}){let{externalSubgraphNames:r,fieldName:i,typeName:a,subgraphNames:o}=n,u=`${a}.${i}`,l=[t.message];if(r.size>0){let E=o.difference(r);l.push(`The field "${a}.${i}" is defined (and resolvable) in the following subgraph`+(E.size>1?"s":"")+`: "${[...E].join(Pr.QUOTATION_JOIN)}".`,`The field "${a}.${i}" is defined "@external" (and unresolvable) in the following subgraph`+(r.size>1?"s":"")+`: "${[...r].join(Pr.QUOTATION_JOIN)}".`)}else l.push(`The field "${a}.${i}" is defined in the following subgraph`+(o.size>1?"s":"")+`: "${[...o].join(Pr.QUOTATION_JOIN)}".`);let d=a===e.typeName,p=!1;for(let[E,h]of e.fieldSetsByTargetSubgraphName)o.has(E)&&(p=!0,d?Dfe({coords:u,entityAncestors:e,fieldSets:h,reasons:l,targetSubgraphName:E}):bfe({coords:u,entityAncestors:e,fieldSets:h,reasons:l,targetSubgraphName:E}));if(!p){let E=e.subgraphNames.length>1;l.push(`The entity ancestor "${e.typeName}" in subgraph${E?"s":""} "${e.subgraphNames.join(Pr.QUOTATION_JOIN)}" has no accessible target entities (resolvable @key directives) in the subgraphs where "${u}" is defined.`)}return l.push(`The type "${a}" is not a descendant of any other entity ancestors that can provide a shared route to access "${i}".`),a!==e.typeName&&l.push(`The type "${a}" has no accessible target entities (resolvable @key directives) in any other subgraph, so accessing other subgraphs is not possible.`),l}function fh(e,t=vfe.MAX_RESOLVABILITY_PATH_SIZE){let n=e.split(new RegExp("(?<=\\w)\\.")),r="",i="",a=!1,o=n.length-t*2;t>0&&n.length>t*2+1&&(a=!0,n.splice(t+1,o-1));for(let u=0;u{"use strict";m();T();N();Object.defineProperty(Nh,"__esModule",{value:!0});Nh.NodeResolutionData=void 0;var CK=Ji(),Hc,Db=class Db{constructor({fieldDataByName:t,isResolved:n=!1,resolvedDescendantNames:r,resolvedFieldNames:i,typeName:a}){dc(this,Hc,!1);y(this,"fieldDataByName");y(this,"resolvedDescendantNames");y(this,"resolvedFieldNames");y(this,"typeName");EI(this,Hc,n),this.fieldDataByName=t,this.resolvedDescendantNames=new Set(r),this.resolvedFieldNames=new Set(i),this.typeName=a}addData({resolvedDescendantNames:t,resolvedFieldNames:n}){for(let r of n)this.addResolvedFieldName(r);for(let r of t)this.resolvedDescendantNames.add(r)}addResolvedFieldName(t){if(!this.fieldDataByName.has(t))throw(0,CK.unexpectedEdgeFatalError)(this.typeName,[t]);this.resolvedFieldNames.add(t)}addExternalSubgraphName({fieldName:t,subgraphName:n}){let r=this.fieldDataByName.get(t);if(!r)throw(0,CK.unexpectedEdgeFatalError)(this.typeName,[t]);r.externalSubgraphNames.add(n)}copy(){return new Db({fieldDataByName:this.fieldDataByName,isResolved:TI(this,Hc),resolvedDescendantNames:this.resolvedDescendantNames,resolvedFieldNames:this.resolvedFieldNames,typeName:this.typeName})}areDescendantsResolved(){return this.fieldDataByName.size===this.resolvedDescendantNames.size}isResolved(){if(TI(this,Hc))return!0;if(this.fieldDataByName.size!==this.resolvedFieldNames.size)return!1;for(let t of this.fieldDataByName.keys())if(!this.resolvedFieldNames.has(t))return!1;return EI(this,Hc,!0),!0}};Hc=new WeakMap;var Ob=Db;Nh.NodeResolutionData=Ob});var UK=F(Eh=>{"use strict";m();T();N();Object.defineProperty(Eh,"__esModule",{value:!0});Eh.EntityWalker=void 0;var Lfe=Th(),os=Mr(),bb=class{constructor({encounteredEntityNodeNames:t,index:n,relativeOriginPaths:r,resDataByNodeName:i,resDataByRelativeOriginPath:a,resolvedPaths:o,subgraphNameByUnresolvablePath:u,visitedEntities:l}){y(this,"encounteredEntityNodeNames");y(this,"index");y(this,"resDataByNodeName");y(this,"resDataByRelativeOriginPath");y(this,"resolvedPaths");y(this,"selectionPathByEntityNodeName",new Map);y(this,"subgraphNameByUnresolvablePath");y(this,"visitedEntities");y(this,"relativeOriginPaths");this.encounteredEntityNodeNames=t,this.index=n,this.relativeOriginPaths=r,this.resDataByNodeName=i,this.resDataByRelativeOriginPath=a,this.resolvedPaths=o,this.subgraphNameByUnresolvablePath=u,this.visitedEntities=l}getNodeResolutionData({node:{fieldDataByName:t,nodeName:n,typeName:r},selectionPath:i}){let a=(0,os.getValueOrDefault)(this.resDataByNodeName,n,()=>new Lfe.NodeResolutionData({fieldDataByName:t,typeName:r}));if(!this.relativeOriginPaths||this.relativeOriginPaths.size<1)return(0,os.getValueOrDefault)(this.resDataByRelativeOriginPath,i,()=>a.copy());let o;for(let u of this.relativeOriginPaths){let l=(0,os.getValueOrDefault)(this.resDataByRelativeOriginPath,`${u}${i}`,()=>a.copy());o!=null||(o=l)}return o}visitEntityDescendantEdge({edge:t,selectionPath:n}){if(t.isEdgeInaccessible())return{visited:!1,areDescendantsResolved:!1};if(t.isExternal)return{visited:!1,areDescendantsResolved:!1,isExternal:!0};if(t.node.isLeaf)return{visited:!0,areDescendantsResolved:!0};let r=`${n}.${t.edgeName}`;return this.getNodeResolutionData({node:t.node,selectionPath:r}).areDescendantsResolved()?{visited:!0,areDescendantsResolved:!0}:(0,os.add)(t.visitedIndices,this.index)?t.node.hasEntitySiblings?this.visitedEntities.has(t.node.nodeName)||this.encounteredEntityNodeNames.has(t.node.nodeName)?{visited:!0,areDescendantsResolved:!0}:(this.encounteredEntityNodeNames.add(t.node.nodeName),(0,os.getValueOrDefault)(this.selectionPathByEntityNodeName,t.node.nodeName,()=>r),{visited:!0,areDescendantsResolved:!1}):t.node.isAbstract?this.visitEntityDescendantAbstractNode({node:t.node,selectionPath:r}):this.visitEntityDescendantConcreteNode({node:t.node,selectionPath:r}):(this.removeUnresolvablePaths({selectionPath:r,removeDescendantPaths:!0}),{visited:!0,areDescendantsResolved:!0,isRevisitedNode:!0})}visitEntityDescendantConcreteNode({node:t,selectionPath:n}){if(t.headToTailEdges.size<1)return t.isLeaf=!0,{visited:!0,areDescendantsResolved:!0};let r=this.getNodeResolutionData({node:t,selectionPath:n});if(r.isResolved()&&r.areDescendantsResolved())return{visited:!0,areDescendantsResolved:!0};let i;for(let[a,o]of t.headToTailEdges){let{areDescendantsResolved:u,isExternal:l,isRevisitedNode:d,visited:p}=this.visitEntityDescendantEdge({edge:o,selectionPath:n});i!=null||(i=d),this.propagateVisitedField({areDescendantsResolved:u,data:r,fieldName:a,isExternal:l,node:t,selectionPath:n,visited:p})}return r.isResolved()?this.removeUnresolvablePaths({removeDescendantPaths:i,selectionPath:n}):this.addUnresolvablePaths({selectionPath:n,subgraphName:t.subgraphName}),{visited:!0,areDescendantsResolved:r.areDescendantsResolved()}}visitEntityDescendantAbstractNode({node:t,selectionPath:n}){if(t.headToTailEdges.size<1)return{visited:!0,areDescendantsResolved:!0};let r=0;for(let i of t.headToTailEdges.values())this.visitEntityDescendantEdge({edge:i,selectionPath:n}).areDescendantsResolved&&(r+=1);return{visited:!0,areDescendantsResolved:r===t.headToTailEdges.size}}propagateVisitedField({areDescendantsResolved:t,data:n,fieldName:r,isExternal:i,node:a,selectionPath:o,visited:u}){if(i){n.addExternalSubgraphName({fieldName:r,subgraphName:a.subgraphName});return}if(!u)return;let l=(0,os.getValueOrDefault)(this.resDataByNodeName,a.nodeName,()=>n.copy());if(n.addResolvedFieldName(r),l.addResolvedFieldName(r),t&&n.resolvedDescendantNames.add(r),this.relativeOriginPaths){for(let p of this.relativeOriginPaths){let E=(0,os.getValueOrDefault)(this.resDataByRelativeOriginPath,`${p}${o}`,()=>n.copy());E.addResolvedFieldName(r),t&&(E.resolvedDescendantNames.add(r),this.removeUnresolvablePaths({selectionPath:`.${r}`,removeDescendantPaths:!0}))}return}let d=(0,os.getValueOrDefault)(this.resDataByRelativeOriginPath,o,()=>n.copy());d.addResolvedFieldName(r),t&&d.resolvedDescendantNames.add(r)}addUnresolvablePaths({selectionPath:t,subgraphName:n}){if(!this.relativeOriginPaths){if(this.resolvedPaths.has(t))return;(0,os.getValueOrDefault)(this.subgraphNameByUnresolvablePath,t,()=>n);return}for(let r of this.relativeOriginPaths){let i=`${r}${t}`;this.resolvedPaths.has(i)||(0,os.getValueOrDefault)(this.subgraphNameByUnresolvablePath,i,()=>n)}}removeUnresolvablePaths({selectionPath:t,removeDescendantPaths:n}){if(!this.relativeOriginPaths){if(this.subgraphNameByUnresolvablePath.delete(t),n)for(let r of this.subgraphNameByUnresolvablePath.keys())r.startsWith(t)&&(this.subgraphNameByUnresolvablePath.delete(r),this.resolvedPaths.add(r));return}for(let r of this.relativeOriginPaths){let i=`${r}${t}`;if(this.subgraphNameByUnresolvablePath.delete(i),this.resolvedPaths.add(i),n)for(let a of this.subgraphNameByUnresolvablePath.keys())a.startsWith(i)&&(this.subgraphNameByUnresolvablePath.delete(a),this.resolvedPaths.add(a))}}};Eh.EntityWalker=bb});var BK=F(yh=>{"use strict";m();T();N();Object.defineProperty(yh,"__esModule",{value:!0});yh.RootFieldWalker=void 0;var us=Mr(),hh=Th(),Ab=class{constructor({index:t,nodeResolutionDataByNodeName:n}){y(this,"index");y(this,"resDataByNodeName");y(this,"resDataByPath",new Map);y(this,"entityNodeNamesByPath",new Map);y(this,"pathsByEntityNodeName",new Map);y(this,"unresolvablePaths",new Set);this.index=t,this.resDataByNodeName=n}visitEdge({edge:t,selectionPath:n}){return t.isEdgeInaccessible()?{visited:!1,areDescendantsResolved:!1}:t.isExternal?{visited:!1,areDescendantsResolved:!1,isExternal:!0}:t.node.isLeaf?{visited:!0,areDescendantsResolved:!0}:(0,us.add)(t.visitedIndices,this.index)?t.node.hasEntitySiblings?this.resDataByNodeName.has(t.node.nodeName)?{visited:!0,areDescendantsResolved:!0}:((0,us.getValueOrDefault)(this.pathsByEntityNodeName,t.node.nodeName,()=>new Set).add(`${n}.${t.edgeName}`),{visited:!0,areDescendantsResolved:!1}):t.node.isAbstract?this.visitAbstractNode({node:t.node,selectionPath:`${n}.${t.edgeName}`}):this.visitConcreteNode({node:t.node,selectionPath:`${n}.${t.edgeName}`}):{visited:!0,areDescendantsResolved:!0}}visitAbstractNode({node:t,selectionPath:n}){if(t.headToTailEdges.size<1)return{visited:!0,areDescendantsResolved:!0};let r=0;for(let i of t.headToTailEdges.values())this.visitEdge({edge:i,selectionPath:n}).areDescendantsResolved&&(r+=1);return{visited:!0,areDescendantsResolved:r===t.headToTailEdges.size}}visitConcreteNode({node:t,selectionPath:n}){if(t.headToTailEdges.size<1)return t.isLeaf=!0,{visited:!0,areDescendantsResolved:!0};let r=this.resDataByNodeName.get(t.nodeName);if(r)return{visited:!0,areDescendantsResolved:r.areDescendantsResolved()};let i=this.getNodeResolutionData({node:t,selectionPath:n});if(i.isResolved()&&i.areDescendantsResolved())return{visited:!0,areDescendantsResolved:!0};for(let[a,o]of t.headToTailEdges){let{areDescendantsResolved:u,isExternal:l,visited:d}=this.visitEdge({edge:o,selectionPath:n});this.propagateVisitedField({areDescendantsResolved:u,data:i,fieldName:a,isExternal:l,node:t,selectionPath:n,visited:d})}return i.isResolved()?this.unresolvablePaths.delete(n):this.unresolvablePaths.add(n),{visited:!0,areDescendantsResolved:i.areDescendantsResolved()}}visitSharedEdge({edge:t,selectionPath:n}){return t.isEdgeInaccessible()?{visited:!1,areDescendantsResolved:!1}:t.isExternal?{visited:!1,areDescendantsResolved:!1,isExternal:!0}:t.node.isLeaf?{visited:!0,areDescendantsResolved:!0}:(0,us.add)(t.visitedIndices,this.index)?(t.node.hasEntitySiblings&&(0,us.getValueOrDefault)(this.entityNodeNamesByPath,`${n}.${t.edgeName}`,()=>new Set).add(t.node.nodeName),t.node.isAbstract?this.visitSharedAbstractNode({node:t.node,selectionPath:`${n}.${t.edgeName}`}):this.visitSharedConcreteNode({node:t.node,selectionPath:`${n}.${t.edgeName}`})):{visited:!0,areDescendantsResolved:!0}}visitSharedAbstractNode({node:t,selectionPath:n}){if(t.headToTailEdges.size<1)return{visited:!0,areDescendantsResolved:!0};let r=0;for(let i of t.headToTailEdges.values())this.visitSharedEdge({edge:i,selectionPath:n}).areDescendantsResolved&&(r+=1);return{visited:!0,areDescendantsResolved:r===t.headToTailEdges.size}}visitSharedConcreteNode({node:t,selectionPath:n}){if(t.headToTailEdges.size<1)return t.isLeaf=!0,{visited:!0,areDescendantsResolved:!0};let r=this.getSharedNodeResolutionData({node:t,selectionPath:n});if(r.isResolved()&&r.areDescendantsResolved())return{visited:!0,areDescendantsResolved:!0};for(let[i,a]of t.headToTailEdges){let{visited:o,areDescendantsResolved:u}=this.visitSharedEdge({edge:a,selectionPath:n});this.propagateSharedVisitedField({areDescendantsResolved:u,data:r,fieldName:i,node:t,visited:o})}return r.isResolved()?this.unresolvablePaths.delete(n):this.unresolvablePaths.add(n),{visited:!0,areDescendantsResolved:r.areDescendantsResolved()}}getNodeResolutionData({node:t,selectionPath:n}){let r=(0,us.getValueOrDefault)(this.resDataByNodeName,t.nodeName,()=>new hh.NodeResolutionData({fieldDataByName:t.fieldDataByName,typeName:t.typeName}));return(0,us.getValueOrDefault)(this.resDataByPath,n,()=>r.copy()),r}getSharedNodeResolutionData({node:t,selectionPath:n}){let r=(0,us.getValueOrDefault)(this.resDataByNodeName,t.nodeName,()=>new hh.NodeResolutionData({fieldDataByName:t.fieldDataByName,typeName:t.typeName}));return(0,us.getValueOrDefault)(this.resDataByPath,n,()=>r.copy())}propagateVisitedField({areDescendantsResolved:t,data:n,fieldName:r,isExternal:i,node:a,selectionPath:o,visited:u}){if(i){n.addExternalSubgraphName({fieldName:r,subgraphName:a.subgraphName});return}if(!u)return;n.addResolvedFieldName(r);let l=(0,us.getValueOrDefault)(this.resDataByPath,o,()=>new hh.NodeResolutionData({fieldDataByName:a.fieldDataByName,typeName:a.typeName}));l.addResolvedFieldName(r),t&&(n.resolvedDescendantNames.add(r),l.resolvedDescendantNames.add(r))}propagateSharedVisitedField({areDescendantsResolved:t,data:n,fieldName:r,node:i,visited:a}){if(!a)return;n.addResolvedFieldName(r);let o=(0,us.getValueOrDefault)(this.resDataByNodeName,i.nodeName,()=>new hh.NodeResolutionData({fieldDataByName:i.fieldDataByName,typeName:i.typeName}));o.addResolvedFieldName(r),t&&(n.resolvedDescendantNames.add(r),o.resolvedDescendantNames.add(r))}visitRootFieldEdges({edges:t,rootTypeName:n}){let r=t.length>1;for(let i of t){if(i.isInaccessible)return{visited:!1,areDescendantsResolved:!1};let a=r?this.visitSharedEdge({edge:i,selectionPath:n}):this.visitEdge({edge:i,selectionPath:n});if(a.areDescendantsResolved)return a}return{visited:!0,areDescendantsResolved:!1}}};yh.RootFieldWalker=Ab});var Pb=F(gh=>{"use strict";m();T();N();Object.defineProperty(gh,"__esModule",{value:!0});gh.Graph=void 0;var Dd=yb(),bd=Sb(),zr=Mr(),Ih=Ib(),wfe=UK(),Cfe=BK(),Rb=class{constructor(){y(this,"edgeId",-1);y(this,"entityDataNodeByTypeName",new Map);y(this,"nodeByNodeName",new Map);y(this,"nodesByTypeName",new Map);y(this,"resolvedRootFieldNodeNames",new Set);y(this,"rootNodeByTypeName",new Map);y(this,"subgraphName",Ih.NOT_APPLICABLE);y(this,"resDataByNodeName",new Map);y(this,"resDataByRelativePathByEntity",new Map);y(this,"visitedEntitiesByOriginEntity",new Map);y(this,"walkerIndex",-1)}getRootNode(t){return(0,zr.getValueOrDefault)(this.rootNodeByTypeName,t,()=>new Dd.RootNode(t))}addOrUpdateNode(t,n){let r=`${this.subgraphName}.${t}`,i=this.nodeByNodeName.get(r);if(i)return i.isAbstract||(i.isAbstract=!!(n!=null&&n.isAbstract)),!i.isLeaf&&(n!=null&&n.isLeaf)&&(i.isLeaf=!0),i;let a=new Dd.GraphNode(this.subgraphName,t,n);return this.nodeByNodeName.set(r,a),(0,zr.getValueOrDefault)(this.nodesByTypeName,t,()=>[]).push(a),a}addEdge(t,n,r,i=!1){if(t.isRootNode){let u=new Dd.Edge(this.getNextEdgeId(),n,r);return(0,zr.getValueOrDefault)(t.headToSharedTailEdges,r,()=>[]).push(u),u}let a=t,o=new Dd.Edge(this.getNextEdgeId(),n,i?n.typeName:r,i);return a.headToTailEdges.set(r,o),o}addEntityDataNode(t){let n=this.entityDataNodeByTypeName.get(t);if(n)return n;let r=new Dd.EntityDataNode(t);return this.entityDataNodeByTypeName.set(t,r),r}getNextEdgeId(){return this.edgeId+=1}getNextWalkerIndex(){return this.walkerIndex+=1}setNodeInaccessible(t){let n=this.nodesByTypeName.get(t);if(n)for(let r of n)r.isInaccessible=!0}initializeNode(t,n){let r=this.entityDataNodeByTypeName.get(t);if(Ih.ROOT_TYPE_NAMES.has(t)){let a=this.getRootNode(t);a.removeInaccessibleEdges(n),a.fieldDataByName=n;return}let i=this.nodesByTypeName.get(t);if(i){for(let a of i)if(a.fieldDataByName=n,a.handleInaccessibleEdges(),a.isLeaf=!1,!!r){a.hasEntitySiblings=!0;for(let o of a.satisfiedFieldSets){if(a.externalFieldSets.has(o))continue;let u=r.targetSubgraphNamesByFieldSet.get(o);for(let l of u!=null?u:[]){if(l===a.subgraphName)continue;let d=this.nodeByNodeName.get(`${l}.${a.typeName}`);d&&a.entityEdges.push(new Dd.Edge(this.getNextEdgeId(),d,""))}}}}}setSubgraphName(t){this.subgraphName=t}visitEntity({encounteredEntityNodeNames:t,entityNodeName:n,relativeOriginPaths:r,resDataByRelativeOriginPath:i,resolvedPaths:a,subgraphNameByUnresolvablePath:o,visitedEntities:u}){let l=this.nodeByNodeName.get(n);if(!l)throw new Error(`Fatal: Could not find entity node for "${n}".`);u.add(n);let d=this.nodesByTypeName.get(l.typeName);if(!(d!=null&&d.length))throw new Error(`Fatal: Could not find any nodes for "${n}".`);let p=new wfe.EntityWalker({encounteredEntityNodeNames:t,index:this.getNextWalkerIndex(),relativeOriginPaths:r,resDataByNodeName:this.resDataByNodeName,resDataByRelativeOriginPath:i,resolvedPaths:a,subgraphNameByUnresolvablePath:o,visitedEntities:u}),E=l.getAllAccessibleEntityNodeNames();for(let h of d){if(h.nodeName!==l.nodeName&&!E.has(h.nodeName))continue;let{areDescendantsResolved:_}=p.visitEntityDescendantConcreteNode({node:h,selectionPath:""});if(_)return}for(let[h,_]of p.selectionPathByEntityNodeName)this.visitEntity({encounteredEntityNodeNames:t,entityNodeName:h,relativeOriginPaths:(0,bd.getMultipliedRelativeOriginPaths)({relativeOriginPaths:r,selectionPath:_}),resDataByRelativeOriginPath:i,resolvedPaths:a,subgraphNameByUnresolvablePath:o,visitedEntities:u})}validate(){for(let t of this.rootNodeByTypeName.values())for(let[n,r]of t.headToSharedTailEdges){let i=r.length>1;if(!i){let p=r[0].node.nodeName;if(this.resolvedRootFieldNodeNames.has(p))continue;this.resolvedRootFieldNodeNames.add(p)}let a=new Cfe.RootFieldWalker({index:this.getNextWalkerIndex(),nodeResolutionDataByNodeName:this.resDataByNodeName});if(a.visitRootFieldEdges({edges:r,rootTypeName:t.typeName.toLowerCase()}).areDescendantsResolved)continue;let o=i?a.entityNodeNamesByPath.size>0:a.pathsByEntityNodeName.size>0;if(a.unresolvablePaths.size<1&&!o)continue;let u=(0,zr.getOrThrowError)(t.fieldDataByName,n,"fieldDataByName"),l=(0,bd.newRootFieldData)(t.typeName,n,u.subgraphNames);if(!o)return{errors:(0,bd.generateRootResolvabilityErrors)({unresolvablePaths:a.unresolvablePaths,resDataByPath:a.resDataByPath,rootFieldData:l}),success:!1};let d=this.validateEntities({isSharedRootField:i,rootFieldData:l,walker:a});if(!d.success)return d}return{success:!0}}consolidateUnresolvableRootWithEntityPaths({pathFromRoot:t,resDataByRelativeOriginPath:n,subgraphNameByUnresolvablePath:r,walker:i}){for(let a of i.unresolvablePaths){if(!a.startsWith(t))continue;let o=a.slice(t.length),u=(0,zr.getOrThrowError)(i.resDataByPath,a,"rootFieldWalker.unresolvablePaths"),l=n.get(o);if(l){if(u.addData(l),l.addData(u),!u.isResolved()){i.unresolvablePaths.delete(a);continue}i.unresolvablePaths.delete(a),r.delete(o)}}}consolidateUnresolvableEntityWithRootPaths({pathFromRoot:t,resDataByRelativeOriginPath:n,subgraphNameByUnresolvablePath:r,walker:i}){for(let a of r.keys()){let o=(0,zr.getOrThrowError)(n,a,"resDataByRelativeOriginPath"),u=`${t}${a}`,l=i.resDataByPath.get(u);l&&(o.addData(l),l.addData(o)),o.isResolved()&&r.delete(a)}}validateSharedRootFieldEntities({rootFieldData:t,walker:n}){let r=new Set;for(let[i,a]of n.entityNodeNamesByPath){if(n.unresolvablePaths.size<1)return{success:!0};let o=new Map,u=new Map;for(let l of a)this.visitEntity({encounteredEntityNodeNames:new Set,entityNodeName:l,resDataByRelativeOriginPath:u,resolvedPaths:r,subgraphNameByUnresolvablePath:o,visitedEntities:new Set});if(this.consolidateUnresolvableRootWithEntityPaths({pathFromRoot:i,resDataByRelativeOriginPath:u,subgraphNameByUnresolvablePath:o,walker:n}),!(o.size<1)&&(this.consolidateUnresolvableEntityWithRootPaths({pathFromRoot:i,resDataByRelativeOriginPath:u,subgraphNameByUnresolvablePath:o,walker:n}),!(o.size<1)))return{errors:(0,bd.generateSharedEntityResolvabilityErrors)({entityAncestors:this.getEntityAncestorCollection(a),pathFromRoot:i,resDataByPath:u,rootFieldData:t,subgraphNameByUnresolvablePath:o}),success:!1}}return n.unresolvablePaths.size>0?{errors:(0,bd.generateRootResolvabilityErrors)({resDataByPath:n.resDataByPath,rootFieldData:t,unresolvablePaths:n.unresolvablePaths}),success:!1}:{success:!0}}validateRootFieldEntities({rootFieldData:t,walker:n}){var i;let r=new Set;for(let[a,o]of n.pathsByEntityNodeName){let u=new Map;if(this.resDataByNodeName.has(a))continue;let l=(0,zr.getValueOrDefault)(this.resDataByRelativePathByEntity,a,()=>new Map);if(this.visitEntity({encounteredEntityNodeNames:new Set,entityNodeName:a,resDataByRelativeOriginPath:l,resolvedPaths:r,subgraphNameByUnresolvablePath:u,visitedEntities:(0,zr.getValueOrDefault)(this.visitedEntitiesByOriginEntity,a,()=>new Set)}),!(u.size<1))return{errors:this.getEntityResolvabilityErrors({entityNodeName:a,pathFromRoot:(i=(0,zr.getFirstEntry)(o))!=null?i:"",rootFieldData:t,subgraphNameByUnresolvablePath:u}),success:!1}}return{success:!0}}validateEntities(t){return t.isSharedRootField?this.validateSharedRootFieldEntities(t):this.validateRootFieldEntities(t)}getEntityResolvabilityErrors({entityNodeName:t,pathFromRoot:n,rootFieldData:r,subgraphNameByUnresolvablePath:i}){let a=(0,zr.getOrThrowError)(this.resDataByRelativePathByEntity,t,"resDataByRelativePathByEntity"),o=t.split(Ih.LITERAL_PERIOD)[1],{fieldSetsByTargetSubgraphName:u}=(0,zr.getOrThrowError)(this.entityDataNodeByTypeName,o,"entityDataNodeByTypeName");return(0,bd.generateEntityResolvabilityErrors)({entityAncestorData:{fieldSetsByTargetSubgraphName:u,subgraphName:"",typeName:o},pathFromRoot:n,resDataByPath:a,rootFieldData:r,subgraphNameByUnresolvablePath:i})}getEntityAncestorCollection(t){let n=(0,zr.getFirstEntry)(t).split(Ih.LITERAL_PERIOD)[1],{fieldSetsByTargetSubgraphName:r}=(0,zr.getOrThrowError)(this.entityDataNodeByTypeName,n,"entityDataNodeByTypeName"),i=new Array,a=new Map;for(let o of t){let{satisfiedFieldSets:u,subgraphName:l}=(0,zr.getOrThrowError)(this.nodeByNodeName,o,"nodeByNodeName");for(let d of u)(0,zr.getValueOrDefault)(a,d,()=>[]).push(l);i.push(l)}return{fieldSetsByTargetSubgraphName:r,sourceSubgraphNamesBySatisfiedFieldSet:a,subgraphNames:i,typeName:n}}};gh.Graph=Rb});var Fb=F(_h=>{"use strict";m();T();N();Object.defineProperty(_h,"__esModule",{value:!0});_h.newFieldSetConditionData=Ufe;_h.newConfigurationData=Bfe;function Ufe({fieldCoordinatesPath:e,fieldPath:t}){return{fieldCoordinatesPath:e,fieldPath:t}}function Bfe(e,t){return{fieldNames:new Set,isRootNode:e,typeName:t}}});var Cb=F(Wc=>{"use strict";m();T();N();Object.defineProperty(Wc,"__esModule",{value:!0});Wc.NormalizationFactory=void 0;Wc.normalizeSubgraphFromString=qfe;Wc.normalizeSubgraph=xK;Wc.batchNormalize=Vfe;var Q=Oe(),Dn=kr(),Wr=Ff(),Kr=ku(),Wn=Pf(),$=Ji(),Cf=gd(),kfe=uS(),Lt=BE(),Mfe=ub(),Or=Lf(),kK=mb(),cs=tf(),st=ed(),On=Uu(),wb=Pb(),vh=xE(),M=Zn(),xfe=Wl(),Be=Mr(),zc=Fb(),MK=qE();function qfe({noLocation:e,options:t,sdlString:n}){let{error:r,documentNode:i}=(0,Dn.safeParse)(n,e);return r||!i?{errors:[(0,$.subgraphInvalidSyntaxError)(r)],success:!1,warnings:[]}:new Uf({internalGraph:new wb.Graph,options:t}).normalize(i)}function xK({document:e,internalGraph:t,options:n,subgraphName:r}){return new Uf({internalGraph:t||new wb.Graph,options:n,subgraphName:r}).normalize(e)}var Bf,Lb,Sh,qK,Uf=class{constructor({internalGraph:t,options:n,subgraphName:r}){dc(this,Bf);dc(this,Sh);y(this,"argumentName","");y(this,"authorizationDataByParentTypeName",new Map);y(this,"concreteTypeNamesByAbstractTypeName",new Map);y(this,"conditionalFieldDataByCoords",new Map);y(this,"configurationDataByTypeName",new Map);y(this,"costs",{fieldWeights:new Map,listSizes:new Map,typeWeights:new Map,directiveArgumentWeights:new Map});y(this,"customDirectiveDefinitionByName",new Map);y(this,"definedDirectiveNames",new Set);y(this,"directiveDefinitionByName",new Map);y(this,"directiveDefinitionDataByName",(0,Wr.initializeDirectiveDefinitionDatas)());y(this,"doesParentRequireFetchReasons",!1);y(this,"edfsDirectiveReferences",new Set);y(this,"entityCacheConfigByTypeName",new Map);y(this,"errors",new Array);y(this,"entityDataByTypeName",new Map);y(this,"entityInterfaceDataByTypeName",new Map);y(this,"eventsConfigurations",new Map);y(this,"fieldSetDataByTypeName",new Map);y(this,"interfaceImplementationTypeNamesByInterfaceTypeName",new Map);y(this,"internalGraph");y(this,"invalidConfigureDescriptionNodeDatas",[]);y(this,"invalidORScopesCoords",new Set);y(this,"invalidRepeatedDirectiveNameByCoords",new Map);y(this,"isParentObjectExternal",!1);y(this,"isParentObjectShareable",!1);y(this,"isSubgraphEventDrivenGraph",!1);y(this,"isSubgraphVersionTwo",!1);y(this,"keyFieldSetDatasByTypeName",new Map);y(this,"lastParentNodeKind",Q.Kind.NULL);y(this,"lastChildNodeKind",Q.Kind.NULL);y(this,"options");y(this,"parentTypeNamesWithAuthDirectives",new Set);y(this,"keyFieldSetsByEntityTypeNameByFieldCoords",new Map);y(this,"keyFieldNamesByParentTypeName",new Map);y(this,"fieldCoordsByNamedTypeName",new Map);y(this,"operationTypeNodeByTypeName",new Map);y(this,"originalParentTypeName","");y(this,"originalTypeNameByRenamedTypeName",new Map);y(this,"overridesByTargetSubgraphName",new Map);y(this,"parentDefinitionDataByTypeName",new Map);y(this,"schemaData");y(this,"referencedDirectiveNames",new Set);y(this,"referencedTypeNames",new Set);y(this,"renamedParentTypeName","");y(this,"subgraphName");y(this,"unvalidatedExternalFieldCoords",new Set);y(this,"usesEdfsNatsStreamConfiguration",!1);y(this,"warnings",[]);this.options=n!=null?n:{},this.subgraphName=r||M.NOT_APPLICABLE,this.internalGraph=t,this.internalGraph.setSubgraphName(this.subgraphName),this.schemaData={directivesByName:new Map,kind:Q.Kind.SCHEMA_DEFINITION,name:M.SCHEMA,operationTypes:new Map}}sanitizeDefaultValue({data:t,namedTypeData:n,node:r}){t.defaultValue&&(0,st.isEnumData)(n)&&(t.defaultValue=(0,Q.visit)(t.defaultValue,{StringValue:{enter(i){return{kind:Q.Kind.ENUM,value:i.value}}}}),r&&(r.defaultValue=t.defaultValue))}validateArguments(t,n){for(let r of t.argumentDataByName.values()){let i=(0,On.getTypeNodeNamedTypeName)(r.type);if(Kr.BASE_SCALARS.has(i)){r.namedTypeKind=Q.Kind.SCALAR_TYPE_DEFINITION;continue}let a=this.parentDefinitionDataByTypeName.get(i);if(a){if((0,st.isInputNodeKind)(a.kind)){r.namedTypeKind=a.kind,this.sanitizeDefaultValue({data:r,namedTypeData:a,node:r.node});continue}this.errors.push((0,$.invalidNamedTypeError)({data:r,namedTypeData:a,nodeType:`${(0,Be.kindToNodeType)(n)} field argument`}))}}}isTypeNameRootType(t){return M.ROOT_TYPE_NAMES.has(t)||this.operationTypeNodeByTypeName.has(t)}isArgumentValueValid(t,n){if(n.kind===Q.Kind.NULL)return t.kind!==Q.Kind.NON_NULL_TYPE;switch(t.kind){case Q.Kind.LIST_TYPE:{if(n.kind!==Q.Kind.LIST)return this.isArgumentValueValid((0,On.getNamedTypeNode)(t.type),n);for(let r of n.values)if(!this.isArgumentValueValid(t.type,r))return!1;return!0}case Q.Kind.NAMED_TYPE:switch(t.name.value){case M.BOOLEAN_SCALAR:return n.kind===Q.Kind.BOOLEAN;case M.FLOAT_SCALAR:return n.kind===Q.Kind.FLOAT||n.kind===Q.Kind.INT;case M.ID_SCALAR:return n.kind===Q.Kind.STRING||n.kind===Q.Kind.INT;case M.INT_SCALAR:return n.kind===Q.Kind.INT;case M.FIELD_SET_SCALAR:case M.SCOPE_SCALAR:case M.STRING_SCALAR:return n.kind===Q.Kind.STRING;case M.LINK_IMPORT:return!0;case M.LINK_PURPOSE:return n.kind!==Q.Kind.ENUM?!1:n.value===M.SECURITY||n.value===M.EXECUTION;case M.SUBSCRIPTION_FIELD_CONDITION:case M.SUBSCRIPTION_FILTER_CONDITION:return n.kind===Q.Kind.OBJECT;default:{let r=this.parentDefinitionDataByTypeName.get(t.name.value);if(!r)return!1;if(r.kind===Q.Kind.SCALAR_TYPE_DEFINITION)return!0;if(r.kind===Q.Kind.ENUM_TYPE_DEFINITION){if(n.kind!==Q.Kind.ENUM&&n.kind!==Q.Kind.STRING)return!1;let i=r.enumValueDataByName.get(n.value);return i?!i.directivesByName.has(M.INACCESSIBLE):!1}return r.kind!==Q.Kind.INPUT_OBJECT_TYPE_DEFINITION?!1:n.kind===Q.Kind.OBJECT}}default:return this.isArgumentValueValid(t.type,n)}}handleFieldInheritableDirectives({directivesByName:t,fieldName:n,inheritedDirectiveNames:r,parentData:i}){this.doesParentRequireFetchReasons&&!t.has(M.REQUIRE_FETCH_REASONS)&&(t.set(M.REQUIRE_FETCH_REASONS,[(0,Be.generateSimpleDirective)(M.REQUIRE_FETCH_REASONS)]),r.add(M.REQUIRE_FETCH_REASONS)),(this.doesParentRequireFetchReasons||t.has(M.REQUIRE_FETCH_REASONS))&&i.requireFetchReasonsFieldNames.add(n),(0,Wn.isObjectDefinitionData)(i)&&(this.isParentObjectExternal&&!t.has(M.EXTERNAL)&&(t.set(M.EXTERNAL,[(0,Be.generateSimpleDirective)(M.EXTERNAL)]),r.add(M.EXTERNAL)),t.has(M.EXTERNAL)&&this.unvalidatedExternalFieldCoords.add(`${i.name}.${n}`),this.isParentObjectShareable&&!t.has(M.SHAREABLE)&&(t.set(M.SHAREABLE,[(0,Be.generateSimpleDirective)(M.SHAREABLE)]),r.add(M.SHAREABLE)))}extractDirectives(t,n){if(!t.directives)return n;let r=(0,Wn.isCompositeOutputNodeKind)(t.kind),i=(0,Wn.isObjectNodeKind)(t.kind);for(let a of t.directives){let o=a.name.value;o===M.SHAREABLE?(0,Be.getValueOrDefault)(n,o,()=>[a]):(0,Be.getValueOrDefault)(n,o,()=>[]).push(a),r&&(this.doesParentRequireFetchReasons||(this.doesParentRequireFetchReasons=o===M.REQUIRE_FETCH_REASONS),i&&(this.isParentObjectExternal||(this.isParentObjectExternal=o===M.EXTERNAL),this.isParentObjectShareable||(this.isParentObjectShareable=o===M.SHAREABLE)))}return n}validateDirective({data:t,definitionData:n,directiveCoords:r,directiveNode:i,errorMessages:a,requiredArgumentNames:o}){let u=i.name.value,l=t.kind===Q.Kind.FIELD_DEFINITION?t.renamedParentTypeName||t.originalParentTypeName:t.name,d=u===M.AUTHENTICATED,p=u===M.COST,E=(0,st.isFieldData)(t),h=u===M.LIST_SIZE,_=u===M.OVERRIDE,S=u===M.REQUIRES_SCOPES,k=u===M.SEMANTIC_NON_NULL;if(!i.arguments||i.arguments.length<1)return n.requiredArgumentNames.size>0&&a.push((0,$.undefinedRequiredArgumentsErrorMessage)(u,o,[])),d&&this.handleAuthenticatedDirective(t,l),k&&E&&((0,st.isTypeRequired)(t.type)?a.push((0,$.semanticNonNullLevelsNonNullErrorMessage)({typeString:(0,Lt.printTypeNode)(t.type),value:"0"})):t.nullLevelsBySubgraphName.set(this.subgraphName,new Set([0]))),h&&E&&!(0,st.isTypeNodeListType)(t.type)&&a.push((0,$.listSizeFieldMustReturnListOrUseSizedFieldsErrorMessage)(r,(0,Lt.printTypeNode)(t.type))),a;let B=new Set,K=new Set,ne=new Set,ee=[];for(let me of i.arguments){let pe=me.name.value;if(B.has(pe)){K.add(pe);continue}B.add(pe);let ge=n.argumentTypeNodeByName.get(pe);if(!ge){ne.add(pe);continue}if(!this.isArgumentValueValid(ge.typeNode,me.value)){a.push((0,$.invalidArgumentValueErrorMessage)((0,Q.print)(me.value),`@${u}`,pe,(0,Lt.printTypeNode)(ge.typeNode)));continue}if(_&&E){this.handleOverrideDirective({data:t,directiveCoords:r,errorMessages:a,targetSubgraphName:me.value.value});continue}if(k&&E){this.handleSemanticNonNullDirective({data:t,directiveNode:i,errorMessages:a});continue}!S||pe!==M.SCOPES||this.extractRequiredScopes({directiveCoords:r,orScopes:me.value.values,requiredScopes:ee})}p?this.handleCostDirective({data:t,directiveCoords:r,directiveNode:i,errorMessages:a}):h&&E&&this.handleListSizeDirective({data:t,directiveCoords:r,directiveNode:i,errorMessages:a}),K.size>0&&a.push((0,$.duplicateDirectiveArgumentDefinitionsErrorMessage)([...K])),ne.size>0&&a.push((0,$.unexpectedDirectiveArgumentErrorMessage)(u,[...ne]));let oe=(0,Be.getEntriesNotInHashSet)(o,B);if(oe.length>0&&a.push((0,$.undefinedRequiredArgumentsErrorMessage)(u,o,oe)),a.length>0||!S)return a;let de=(0,Be.getValueOrDefault)(this.authorizationDataByParentTypeName,l,()=>(0,Wn.newAuthorizationData)(l));if(t.kind!==Q.Kind.FIELD_DEFINITION)this.parentTypeNamesWithAuthDirectives.add(l),de.requiredScopes.push(...ee);else{let me=(0,Be.getValueOrDefault)(de.fieldAuthDataByFieldName,t.name,()=>(0,Wn.newFieldAuthorizationData)(t.name));me.inheritedData.requiredScopes.push(...ee),me.originalData.requiredScopes.push(...ee)}return a}validateDirectives(t,n){var i;let r=new Set;for(let[a,o]of t.directivesByName){let u=this.directiveDefinitionDataByName.get(a);if(!u){r.has(a)||(this.errors.push((0,$.undefinedDirectiveError)(a,n)),r.add(a));continue}let l=[],d=(0,Dn.nodeKindToDirectiveLocation)(t.kind);if(u.locations.has(d)||l.push((0,$.invalidDirectiveLocationErrorMessage)(a,d)),o.length>1&&!u.isRepeatable){let E=(0,Be.getValueOrDefault)(this.invalidRepeatedDirectiveNameByCoords,n,()=>new Set);E.has(a)||(E.add(a),l.push((0,$.invalidRepeatedDirectiveErrorMessage)(a)))}let p=[...u.requiredArgumentNames];for(let E of(i=u.node.arguments)!=null?i:[]){if(!E.defaultValue)continue;let h=u.argumentTypeNodeByName.get(E.name.value);if(!h)continue;let _=this.parentDefinitionDataByTypeName.get((0,On.getTypeNodeNamedTypeName)(h.typeNode));_&&this.sanitizeDefaultValue({data:h,namedTypeData:_,node:E})}for(let E=0;E0&&this.errors.push((0,$.invalidDirectiveError)(a,n,(0,Be.numberToOrdinal)(E+1),h))}}switch(t.kind){case Q.Kind.ENUM_TYPE_DEFINITION:{for(let[a,o]of t.enumValueDataByName)this.validateDirectives(o,`${t.name}.${a}`);return}case Q.Kind.FIELD_DEFINITION:{for(let[a,o]of t.argumentDataByName)this.validateDirectives(o,`${t.originalParentTypeName}.${t.name}(${a}: ...)`);return}case Q.Kind.INPUT_OBJECT_TYPE_DEFINITION:{for(let[a,o]of t.inputValueDataByName)this.validateDirectives(o,`${t.name}.${a}`);return}case Q.Kind.INTERFACE_TYPE_DEFINITION:case Q.Kind.OBJECT_TYPE_DEFINITION:{for(let[a,o]of t.fieldDataByName)this.validateDirectives(o,`${t.name}.${a}`);return}default:return}}getNodeExtensionType(t,n,r=!1){return t?cs.ExtensionType.REAL:r||!n.has(M.EXTENDS)?cs.ExtensionType.NONE:cs.ExtensionType.EXTENDS}setParentDataExtensionType(t,n){switch(t.extensionType){case cs.ExtensionType.EXTENDS:case cs.ExtensionType.NONE:{if(n===cs.ExtensionType.REAL)return;this.errors.push((0,$.duplicateTypeDefinitionError)((0,Be.kindToNodeType)(t.kind),t.name));return}default:t.extensionType=n}}extractConfigureDescriptionData(t,n){var i,a;if(!n.arguments||n.arguments.length<1){t.description||this.invalidConfigureDescriptionNodeDatas.push(t),t.configureDescriptionDataBySubgraphName.set(this.subgraphName,{propagate:!0,description:((i=t.description)==null?void 0:i.value)||""});return}let r={propagate:!0,description:((a=t.description)==null?void 0:a.value)||""};for(let o of n.arguments)switch(o.name.value){case M.PROPAGATE:{if(o.value.kind!=Q.Kind.BOOLEAN)return;r.propagate=o.value.value;break}case M.DESCRIPTION_OVERRIDE:{if(o.value.kind!=Q.Kind.STRING)return;r.description=o.value.value;break}default:return}!t.description&&!r.description&&this.invalidConfigureDescriptionNodeDatas.push(t),t.configureDescriptionDataBySubgraphName.set(this.subgraphName,r)}extractConfigureDescriptionsData(t){let n=t.directivesByName.get(M.CONFIGURE_DESCRIPTION);n&&n.length==1&&this.extractConfigureDescriptionData(t,n[0])}extractImplementedInterfaceTypeNames(t,n){if(!t.interfaces)return n;let r=(0,st.isInterfaceNode)(t),i=t.name.value;for(let a of t.interfaces){let o=a.name.value;if(n.has(o)){this.errors.push((0,$.duplicateImplementedInterfaceError)((0,Wn.kindToConvertedTypeString)(t.kind),i,o));continue}r&&(0,Be.getValueOrDefault)(this.interfaceImplementationTypeNamesByInterfaceTypeName,o,()=>new Set).add(i),n.add(o)}return n}updateCompositeOutputDataByNode(t,n,r){this.setParentDataExtensionType(n,r),this.extractImplementedInterfaceTypeNames(t,n.implementedInterfaceTypeNames),n.description||(n.description=(0,Dn.formatDescription)("description"in t?t.description:void 0)),this.extractConfigureDescriptionsData(n),n.isEntity||(n.isEntity=n.directivesByName.has(M.KEY)),n.isInaccessible||(n.isInaccessible=n.directivesByName.has(M.INACCESSIBLE)),n.subgraphNames.add(this.subgraphName)}addConcreteTypeNamesForImplementedInterfaces(t,n){for(let r of t)(0,Be.getValueOrDefault)(this.concreteTypeNamesByAbstractTypeName,r,()=>new Set).add(n),this.internalGraph.addEdge(this.internalGraph.addOrUpdateNode(r,{isAbstract:!0}),this.internalGraph.addOrUpdateNode(n),n,!0)}extractArguments(t,n){var o;if(!((o=n.arguments)!=null&&o.length))return t;let r=n.name.value,i=`${this.originalParentTypeName}.${r}`,a=new Set;for(let u of n.arguments){let l=u.name.value;if(t.has(l)){a.add(l);continue}this.addInputValueDataByNode({fieldName:r,inputValueDataByName:t,isArgument:!0,node:u,originalParentTypeName:this.originalParentTypeName,renamedParentTypeName:this.renamedParentTypeName})}return a.size>0&&this.errors.push((0,$.duplicateArgumentsError)(i,[...a])),t}addPersistedDirectiveDefinitionDataByNode(t,n,r){let i=n.name.value,a=`@${i}`,o=new Map;for(let u of n.arguments||[])this.addInputValueDataByNode({inputValueDataByName:o,isArgument:!0,node:u,originalParentTypeName:a});t.set(i,{argumentDataByName:o,executableLocations:r,name:i,repeatable:n.repeatable,subgraphNames:new Set([this.subgraphName]),description:(0,Dn.formatDescription)(n.description)})}extractDirectiveLocations(t,n){let r=new Set,i=new Set;for(let a of t.locations){let o=a.value;if(!i.has(o)){if(!M.EXECUTABLE_DIRECTIVE_LOCATIONS.has(o)&&!Cf.TYPE_SYSTEM_DIRECTIVE_LOCATIONS.has(o)){n.push((0,$.invalidDirectiveDefinitionLocationErrorMessage)(o)),i.add(o);continue}if(r.has(o)){n.push((0,$.duplicateDirectiveDefinitionLocationErrorMessage)(o)),i.add(o);continue}r.add(o)}}return r}extractArgumentData(t,n){let r=new Map,i=new Set,a=new Set,o={argumentTypeNodeByName:r,optionalArgumentNames:i,requiredArgumentNames:a};if(!t)return o;let u=new Set;for(let l of t){let d=l.name.value;if(r.has(d)){u.add(d);continue}l.defaultValue&&i.add(d),(0,st.isTypeRequired)(l.type)&&!l.defaultValue&&a.add(d),r.set(d,{name:d,typeNode:l.type,defaultValue:l.defaultValue})}return u.size>0&&n.push((0,$.duplicateDirectiveDefinitionArgumentErrorMessage)([...u])),o}extractDirectiveArgumentCosts(t){var r;if(!t.arguments)return;let n=t.name.value;for(let i of t.arguments)if(i.directives)for(let a of i.directives){if(a.name.value!==M.COST)continue;let o=(r=a.arguments)==null?void 0:r.find(l=>l.name.value===M.WEIGHT);if(!o)continue;if(o.value.kind!==Q.Kind.INT){let l=`@${n}(${i.name.value}: ...)`;this.errors.push((0,$.invalidDirectiveError)(M.COST,l,M.FIRST_ORDINAL,[(0,$.invalidArgumentValueErrorMessage)((0,Q.print)(o.value),`@${M.COST}`,M.WEIGHT,"Int!")]));continue}let u=parseInt(o.value.value,10);this.costs.directiveArgumentWeights.set(`${n}.${i.name.value}`,u)}}addDirectiveDefinitionDataByNode(t){let n=t.name.value;if(this.definedDirectiveNames.has(n))return this.errors.push((0,$.duplicateDirectiveDefinitionError)(n)),!1;this.definedDirectiveNames.add(n),this.extractDirectiveArgumentCosts(t);let r=Kr.V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.get(n);if(r)return this.directiveDefinitionByName.set(n,r),this.isSubgraphVersionTwo=!0,!1;if(Kr.DIRECTIVE_DEFINITION_BY_NAME.has(n))return!1;this.directiveDefinitionByName.set(n,t);let i=[],{argumentTypeNodeByName:a,optionalArgumentNames:o,requiredArgumentNames:u}=this.extractArgumentData(t.arguments,i);return this.directiveDefinitionDataByName.set(n,{argumentTypeNodeByName:a,isRepeatable:t.repeatable,locations:this.extractDirectiveLocations(t,i),name:n,node:t,optionalArgumentNames:o,requiredArgumentNames:u}),i.length>0&&this.errors.push((0,$.invalidDirectiveDefinitionError)(n,i)),!0}addFieldDataByNode(t,n,r,i,a=new Set){let o=n.name.value,u=this.renamedParentTypeName||this.originalParentTypeName,l=`${this.originalParentTypeName}.${o}`,{isExternal:d,isShareable:p}=(0,st.isNodeExternalOrShareable)(n,!this.isSubgraphVersionTwo,i),E=(0,On.getTypeNodeNamedTypeName)(n.type),h={argumentDataByName:r,configureDescriptionDataBySubgraphName:new Map,externalFieldDataBySubgraphName:new Map([[this.subgraphName,(0,st.newExternalFieldData)(d)]]),federatedCoords:`${u}.${o}`,inheritedDirectiveNames:a,isInaccessible:i.has(M.INACCESSIBLE),isShareableBySubgraphName:new Map([[this.subgraphName,p]]),kind:Q.Kind.FIELD_DEFINITION,name:o,namedTypeKind:Kr.BASE_SCALARS.has(E)?Q.Kind.SCALAR_TYPE_DEFINITION:Q.Kind.NULL,namedTypeName:E,node:(0,On.getMutableFieldNode)(n,l,this.errors),nullLevelsBySubgraphName:new Map,originalParentTypeName:this.originalParentTypeName,persistedDirectivesData:(0,st.newPersistedDirectivesData)(),renamedParentTypeName:u,subgraphNames:new Set([this.subgraphName]),type:(0,On.getMutableTypeNode)(n.type,l,this.errors),directivesByName:i,description:(0,Dn.formatDescription)(n.description)};return Kr.BASE_SCALARS.has(h.namedTypeName)||this.referencedTypeNames.add(h.namedTypeName),this.extractConfigureDescriptionsData(h),t.set(o,h),h}addInputValueDataByNode({fieldName:t,inputValueDataByName:n,isArgument:r,node:i,originalParentTypeName:a,renamedParentTypeName:o}){let u=o||a,l=i.name.value,d=r?`${a}${t?`.${t}`:""}(${l}: ...)`:`${a}.${l}`;i.defaultValue&&!(0,st.areDefaultValuesCompatible)(i.type,i.defaultValue)&&this.errors.push((0,$.incompatibleInputValueDefaultValueTypeError)((r?M.ARGUMENT:M.INPUT_FIELD)+` "${l}"`,d,(0,Lt.printTypeNode)(i.type),(0,Q.print)(i.defaultValue)));let p=r?`${u}${t?`.${t}`:""}(${l}: ...)`:`${u}.${l}`,E=(0,On.getTypeNodeNamedTypeName)(i.type),h={configureDescriptionDataBySubgraphName:new Map,directivesByName:this.extractDirectives(i,new Map),federatedCoords:p,fieldName:t,includeDefaultValue:!!i.defaultValue,isArgument:r,kind:r?Q.Kind.ARGUMENT:Q.Kind.INPUT_VALUE_DEFINITION,name:l,namedTypeKind:Kr.BASE_SCALARS.has(E)?Q.Kind.SCALAR_TYPE_DEFINITION:Q.Kind.NULL,namedTypeName:E,node:(0,On.getMutableInputValueNode)(i,a,this.errors),originalCoords:d,originalParentTypeName:a,persistedDirectivesData:(0,st.newPersistedDirectivesData)(),renamedParentTypeName:u,requiredSubgraphNames:new Set((0,st.isTypeRequired)(i.type)?[this.subgraphName]:[]),subgraphNames:new Set([this.subgraphName]),type:(0,On.getMutableTypeNode)(i.type,a,this.errors),defaultValue:i.defaultValue,description:(0,Dn.formatDescription)(i.description)};this.extractConfigureDescriptionsData(h),n.set(l,h)}upsertInterfaceDataByNode(t,n=!1){let r=t.name.value,i=this.parentDefinitionDataByTypeName.get(r),a=this.extractDirectives(t,(i==null?void 0:i.directivesByName)||new Map),o=this.getNodeExtensionType(n,a),u=this.entityInterfaceDataByTypeName.get(r);if(u&&t.fields)for(let d of t.fields)u.interfaceFieldNames.add(d.name.value);if(i){if(i.kind!==Q.Kind.INTERFACE_TYPE_DEFINITION){this.errors.push((0,$.multipleNamedTypeDefinitionError)(r,(0,Be.kindToNodeType)(i.kind),(0,Wn.kindToConvertedTypeString)(t.kind)));return}this.updateCompositeOutputDataByNode(t,i,o);return}let l={configureDescriptionDataBySubgraphName:new Map,directivesByName:a,extensionType:o,fieldDataByName:new Map,implementedInterfaceTypeNames:this.extractImplementedInterfaceTypeNames(t,new Set),isEntity:a.has(M.KEY),isInaccessible:a.has(M.INACCESSIBLE),kind:Q.Kind.INTERFACE_TYPE_DEFINITION,name:r,node:(0,On.getMutableInterfaceNode)(t.name),persistedDirectivesData:(0,st.newPersistedDirectivesData)(),requireFetchReasonsFieldNames:new Set,subgraphNames:new Set([this.subgraphName]),description:(0,Dn.formatDescription)("description"in t?t.description:void 0)};this.extractConfigureDescriptionsData(l),this.parentDefinitionDataByTypeName.set(r,l)}getRenamedRootTypeName(t){let n=this.operationTypeNodeByTypeName.get(t);if(!n)return t;switch(n){case Q.OperationTypeNode.MUTATION:return M.MUTATION;case Q.OperationTypeNode.SUBSCRIPTION:return M.SUBSCRIPTION;default:return M.QUERY}}addInterfaceObjectFieldsByNode(t){let n=t.name.value,r=this.entityInterfaceDataByTypeName.get(n);if(!(!r||!r.isInterfaceObject||!t.fields))for(let i of t.fields)r.interfaceObjectFieldNames.add(i.name.value)}upsertObjectDataByNode(t,n=!1){var p;let r=t.name.value,i=this.parentDefinitionDataByTypeName.get(r),a=this.extractDirectives(t,(p=i==null?void 0:i.directivesByName)!=null?p:new Map),o=this.isTypeNameRootType(r),u=this.getNodeExtensionType(n,a,o);if(this.addInterfaceObjectFieldsByNode(t),i){if(i.kind!==Q.Kind.OBJECT_TYPE_DEFINITION){this.errors.push((0,$.multipleNamedTypeDefinitionError)(r,(0,Be.kindToNodeType)(i.kind),(0,Wn.kindToConvertedTypeString)(t.kind)));return}this.updateCompositeOutputDataByNode(t,i,u),a.has(M.INTERFACE_OBJECT)||this.addConcreteTypeNamesForImplementedInterfaces(i.implementedInterfaceTypeNames,r);return}let l=this.extractImplementedInterfaceTypeNames(t,new Set);a.has(M.INTERFACE_OBJECT)||this.addConcreteTypeNamesForImplementedInterfaces(l,r);let d={configureDescriptionDataBySubgraphName:new Map,directivesByName:a,extensionType:u,fieldDataByName:new Map,implementedInterfaceTypeNames:l,isEntity:a.has(M.KEY),isInaccessible:a.has(M.INACCESSIBLE),isRootType:o,kind:Q.Kind.OBJECT_TYPE_DEFINITION,name:r,node:(0,On.getMutableObjectNode)(t.name),persistedDirectivesData:(0,st.newPersistedDirectivesData)(),requireFetchReasonsFieldNames:new Set,renamedTypeName:this.getRenamedRootTypeName(r),subgraphNames:new Set([this.subgraphName]),description:(0,Dn.formatDescription)("description"in t?t.description:void 0)};this.extractConfigureDescriptionsData(d),this.parentDefinitionDataByTypeName.set(r,d)}upsertEnumDataByNode(t,n=!1){let r=t.name.value;this.internalGraph.addOrUpdateNode(r,{isLeaf:!0});let i=this.parentDefinitionDataByTypeName.get(r),a=this.extractDirectives(t,(i==null?void 0:i.directivesByName)||new Map),o=this.getNodeExtensionType(n,a);if(i){if(i.kind!==Q.Kind.ENUM_TYPE_DEFINITION){this.errors.push((0,$.multipleNamedTypeDefinitionError)(r,(0,Be.kindToNodeType)(i.kind),(0,Wn.kindToConvertedTypeString)(t.kind)));return}this.setParentDataExtensionType(i,o),i.isInaccessible||(i.isInaccessible=a.has(M.INACCESSIBLE)),i.subgraphNames.add(this.subgraphName),i.description||(i.description=(0,Dn.formatDescription)("description"in t?t.description:void 0)),this.extractConfigureDescriptionsData(i);return}let u={appearances:1,configureDescriptionDataBySubgraphName:new Map,directivesByName:a,extensionType:o,enumValueDataByName:new Map,isInaccessible:a.has(M.INACCESSIBLE),kind:Q.Kind.ENUM_TYPE_DEFINITION,name:r,node:(0,On.getMutableEnumNode)(t.name),persistedDirectivesData:(0,st.newPersistedDirectivesData)(),subgraphNames:new Set([this.subgraphName]),description:(0,Dn.formatDescription)("description"in t?t.description:void 0)};this.extractConfigureDescriptionsData(u),this.parentDefinitionDataByTypeName.set(r,u)}upsertInputObjectByNode(t,n=!1){let r=t.name.value,i=this.parentDefinitionDataByTypeName.get(r),a=this.extractDirectives(t,(i==null?void 0:i.directivesByName)||new Map),o=this.getNodeExtensionType(n,a);if(i)return i.kind!==Q.Kind.INPUT_OBJECT_TYPE_DEFINITION?(this.errors.push((0,$.multipleNamedTypeDefinitionError)(r,(0,Be.kindToNodeType)(i.kind),(0,Wn.kindToConvertedTypeString)(t.kind))),{success:!1}):(this.setParentDataExtensionType(i,o),i.isInaccessible||(i.isInaccessible=a.has(M.INACCESSIBLE)),i.subgraphNames.add(this.subgraphName),i.description||(i.description=(0,Dn.formatDescription)("description"in t?t.description:void 0)),this.extractConfigureDescriptionsData(i),{success:!0,data:i});let u={configureDescriptionDataBySubgraphName:new Map,directivesByName:a,extensionType:o,inputValueDataByName:new Map,isInaccessible:a.has(M.INACCESSIBLE),kind:Q.Kind.INPUT_OBJECT_TYPE_DEFINITION,name:r,node:(0,On.getMutableInputObjectNode)(t.name),persistedDirectivesData:(0,st.newPersistedDirectivesData)(),subgraphNames:new Set([this.subgraphName]),description:(0,Dn.formatDescription)("description"in t?t.description:void 0)};return this.extractConfigureDescriptionsData(u),this.parentDefinitionDataByTypeName.set(r,u),{success:!0,data:u}}upsertScalarByNode(t,n=!1){let r=t.name.value;this.internalGraph.addOrUpdateNode(r,{isLeaf:!0});let i=this.parentDefinitionDataByTypeName.get(r),a=this.extractDirectives(t,(i==null?void 0:i.directivesByName)||new Map),o=this.getNodeExtensionType(n,a);if(i){if(i.kind!==Q.Kind.SCALAR_TYPE_DEFINITION){this.errors.push((0,$.multipleNamedTypeDefinitionError)(r,(0,Be.kindToNodeType)(i.kind),(0,Wn.kindToConvertedTypeString)(t.kind)));return}this.setParentDataExtensionType(i,o),i.description||(i.description=(0,Dn.formatDescription)("description"in t?t.description:void 0)),i.subgraphNames.add(this.subgraphName),this.extractConfigureDescriptionsData(i);return}let u={configureDescriptionDataBySubgraphName:new Map,directivesByName:a,extensionType:o,kind:Q.Kind.SCALAR_TYPE_DEFINITION,name:r,node:(0,On.getMutableScalarNode)(t.name),persistedDirectivesData:(0,st.newPersistedDirectivesData)(),subgraphNames:new Set([this.subgraphName]),description:(0,Dn.formatDescription)("description"in t?t.description:void 0)};this.extractConfigureDescriptionsData(u),this.parentDefinitionDataByTypeName.set(r,u)}extractUnionMembers(t,n){if(!t.types)return n;let r=t.name.value;for(let i of t.types){let a=i.name.value;if(n.has(a)){this.errors.push((0,$.duplicateUnionMemberDefinitionError)(r,a));continue}(0,Be.getValueOrDefault)(this.concreteTypeNamesByAbstractTypeName,r,()=>new Set).add(a),Kr.BASE_SCALARS.has(a)||this.referencedTypeNames.add(a),n.set(a,i)}return n}upsertUnionByNode(t,n=!1){let r=t.name.value,i=this.parentDefinitionDataByTypeName.get(r),a=this.extractDirectives(t,(i==null?void 0:i.directivesByName)||new Map),o=this.getNodeExtensionType(n,a);if(this.addConcreteTypeNamesForUnion(t),i){if(i.kind!==Q.Kind.UNION_TYPE_DEFINITION){this.errors.push((0,$.multipleNamedTypeDefinitionError)(r,(0,Be.kindToNodeType)(i.kind),(0,Wn.kindToConvertedTypeString)(t.kind)));return}this.setParentDataExtensionType(i,o),this.extractUnionMembers(t,i.memberByMemberTypeName),i.description||(i.description=(0,Dn.formatDescription)("description"in t?t.description:void 0)),i.subgraphNames.add(this.subgraphName),this.extractConfigureDescriptionsData(i);return}let u={configureDescriptionDataBySubgraphName:new Map,directivesByName:a,extensionType:o,kind:Q.Kind.UNION_TYPE_DEFINITION,memberByMemberTypeName:this.extractUnionMembers(t,new Map),name:r,node:(0,On.getMutableUnionNode)(t.name),persistedDirectivesData:(0,st.newPersistedDirectivesData)(),subgraphNames:new Set([this.subgraphName]),description:(0,Dn.formatDescription)("description"in t?t.description:void 0)};this.extractConfigureDescriptionsData(u),this.parentDefinitionDataByTypeName.set(r,u)}extractKeyFieldSets(t,n){var a;let r=t.name.value;if(!((a=t.directives)!=null&&a.length)){this.errors.push((0,$.expectedEntityError)(r));return}let i=0;for(let o of t.directives){if(o.name.value!==M.KEY||(i+=1,!o.arguments||o.arguments.length<1))continue;let u,l=!1;for(let _ of o.arguments){if(_.name.value===M.RESOLVABLE){_.value.kind===Q.Kind.BOOLEAN&&!_.value.value&&(l=!0);continue}if(_.name.value!==M.FIELDS){u=void 0;break}if(_.value.kind!==Q.Kind.STRING){u=void 0;break}u=_.value.value}if(u===void 0)continue;let{error:d,documentNode:p}=(0,Dn.safeParse)("{"+u+"}");if(d||!p){this.errors.push((0,$.invalidDirectiveError)(M.KEY,r,(0,Be.numberToOrdinal)(i),[(0,$.unparsableFieldSetErrorMessage)(u,d)]));continue}let E=(0,Wr.getNormalizedFieldSet)(p),h=n.get(E);h?h.isUnresolvable||(h.isUnresolvable=l):n.set(E,{documentNode:p,isUnresolvable:l,normalizedFieldSet:E,rawFieldSet:u})}}getFieldSetParent(t,n,r,i){if(!t)return{fieldSetParentData:n};let a=(0,Be.getOrThrowError)(n.fieldDataByName,r,`${i}.fieldDataByFieldName`),o=(0,On.getTypeNodeNamedTypeName)(a.node.type),u=`${i}.${r}`;if(Kr.BASE_SCALARS.has(o))return{errorString:(0,$.incompatibleTypeWithProvidesErrorMessage)({fieldCoords:u,responseType:o,subgraphName:this.subgraphName})};let l=this.parentDefinitionDataByTypeName.get(o);return l?l.kind!==Q.Kind.INTERFACE_TYPE_DEFINITION&&l.kind!==Q.Kind.OBJECT_TYPE_DEFINITION?{errorString:(0,$.incompatibleTypeWithProvidesErrorMessage)({fieldCoords:u,responseType:o,subgraphName:this.subgraphName})}:{fieldSetParentData:l}:{errorString:(0,$.unknownNamedTypeErrorMessage)(u,o)}}validateConditionalFieldSet(t,n,r,i,a){let{error:o,documentNode:u}=(0,Dn.safeParse)("{"+n+"}");if(o||!u)return{errorMessages:[(0,$.unparsableFieldSetErrorMessage)(n,o)]};let l=this,d=[t],p=(0,Wr.getConditionalFieldSetDirectiveName)(i),E=[],h=`${a}.${r}`,_=(0,Wr.getInitialFieldCoordsPath)(i,h),S=[r],k=new Set,B=[],K=-1,ne=!0,ee=r,oe=!1;return(0,Q.visit)(u,{Argument:{enter(){return!1}},Field:{enter(de){var Yt,jr;let me=d[K],pe=me.name;if(me.kind===Q.Kind.UNION_TYPE_DEFINITION)return B.push((0,$.invalidSelectionOnUnionErrorMessage)(n,_,pe)),Q.BREAK;let ge=de.name.value,H=`${pe}.${ge}`;if(l.unvalidatedExternalFieldCoords.delete(H),ne)return B.push((0,$.invalidSelectionSetErrorMessage)(n,_,pe,(0,Be.kindToNodeType)(me.kind))),Q.BREAK;if(_.push(H),S.push(ge),ee=ge,ge===M.TYPENAME){if(i)return B.push((0,$.typeNameAlreadyProvidedErrorMessage)(H,l.subgraphName)),Q.BREAK;k.size<1&&Al(Yt=l,Bf,Lb).call(Yt,{currentFieldCoords:H,directiveCoords:h,directiveName:p,fieldSet:n});return}let he=me.fieldDataByName.get(ge);if(!he)return B.push((0,$.undefinedFieldInFieldSetErrorMessage)(n,pe,ge)),Q.BREAK;if(E[K].has(ge))return B.push((0,$.duplicateFieldInFieldSetErrorMessage)(n,H)),Q.BREAK;E[K].add(ge);let{isDefinedExternal:Je,isUnconditionallyProvided:Qt}=(0,Be.getOrThrowError)(he.externalFieldDataBySubgraphName,l.subgraphName,`${H}.externalFieldDataBySubgraphName`),_n=Je&&!Qt;Qt||(oe=!0);let hn=(0,On.getTypeNodeNamedTypeName)(he.node.type),bt=l.parentDefinitionDataByTypeName.get(hn);if(Kr.BASE_SCALARS.has(hn)||(bt==null?void 0:bt.kind)===Q.Kind.SCALAR_TYPE_DEFINITION||(bt==null?void 0:bt.kind)===Q.Kind.ENUM_TYPE_DEFINITION){if(k.size<1&&!Je){Al(jr=l,Bf,Lb).call(jr,{currentFieldCoords:H,directiveCoords:h,directiveName:p,fieldSet:n});return}if(k.size<1&&Qt){l.isSubgraphVersionTwo?B.push((0,$.fieldAlreadyProvidedErrorMessage)(H,l.subgraphName,p)):l.warnings.push((0,Or.fieldAlreadyProvidedWarning)(H,p,h,l.subgraphName));return}if(!_n&&!i)return;let or=(0,Be.getValueOrDefault)(l.conditionalFieldDataByCoords,H,st.newConditionalFieldData),yn=(0,zc.newFieldSetConditionData)({fieldCoordinatesPath:[..._],fieldPath:[...S]});i?or.providedBy.push(yn):or.requiredBy.push(yn);return}if(!bt)return B.push((0,$.unknownTypeInFieldSetErrorMessage)(n,H,hn)),Q.BREAK;if(Je&&(i&&(0,Be.getValueOrDefault)(l.conditionalFieldDataByCoords,H,st.newConditionalFieldData).providedBy.push((0,zc.newFieldSetConditionData)({fieldCoordinatesPath:[..._],fieldPath:[...S]})),k.add(H)),bt.kind===Q.Kind.OBJECT_TYPE_DEFINITION||bt.kind===Q.Kind.INTERFACE_TYPE_DEFINITION||bt.kind===Q.Kind.UNION_TYPE_DEFINITION){ne=!0,d.push(bt);return}},leave(){k.delete(_.pop()||""),S.pop()}},InlineFragment:{enter(de){let me=d[K],pe=me.name,ge=_.length<1?t.name:_[_.length-1];if(!de.typeCondition)return B.push((0,$.inlineFragmentWithoutTypeConditionErrorMessage)(n,ge)),Q.BREAK;let H=de.typeCondition.name.value;if(H===pe){d.push(me),ne=!0;return}if(!(0,Dn.isKindAbstract)(me.kind))return B.push((0,$.invalidInlineFragmentTypeErrorMessage)(n,_,H,pe)),Q.BREAK;let he=l.parentDefinitionDataByTypeName.get(H);if(!he)return B.push((0,$.unknownInlineFragmentTypeConditionErrorMessage)(n,_,pe,H)),Q.BREAK;switch(ne=!0,he.kind){case Q.Kind.INTERFACE_TYPE_DEFINITION:{if(!he.implementedInterfaceTypeNames.has(pe))break;d.push(he);return}case Q.Kind.OBJECT_TYPE_DEFINITION:{let Je=l.concreteTypeNamesByAbstractTypeName.get(pe);if(!Je||!Je.has(H))break;d.push(he);return}case Q.Kind.UNION_TYPE_DEFINITION:{d.push(he);return}default:return B.push((0,$.invalidInlineFragmentTypeConditionTypeErrorMessage)(n,_,pe,H,(0,Be.kindToNodeType)(he.kind))),Q.BREAK}return B.push((0,$.invalidInlineFragmentTypeConditionErrorMessage)(n,_,H,(0,Be.kindToNodeType)(me.kind),pe)),Q.BREAK}},SelectionSet:{enter(){if(!ne){let de=d[K];if(de.kind===Q.Kind.UNION_TYPE_DEFINITION)return B.push((0,$.unparsableFieldSetSelectionErrorMessage)(n,ee)),Q.BREAK;if(ee===M.TYPENAME)return B.push((0,$.invalidSelectionSetDefinitionErrorMessage)(n,_,M.STRING_SCALAR,(0,Be.kindToNodeType)(Q.Kind.SCALAR_TYPE_DEFINITION))),Q.BREAK;let me=de.fieldDataByName.get(ee);if(!me)return B.push((0,$.undefinedFieldInFieldSetErrorMessage)(n,de.name,ee)),Q.BREAK;let pe=(0,On.getTypeNodeNamedTypeName)(me.node.type),ge=l.parentDefinitionDataByTypeName.get(pe),H=ge?ge.kind:Q.Kind.SCALAR_TYPE_DEFINITION;return B.push((0,$.invalidSelectionSetDefinitionErrorMessage)(n,_,pe,(0,Be.kindToNodeType)(H))),Q.BREAK}if(K+=1,ne=!1,K<0||K>=d.length)return B.push((0,$.unparsableFieldSetSelectionErrorMessage)(n,ee)),Q.BREAK;E.push(new Set)},leave(){if(ne){let de=d[K+1];B.push((0,$.invalidSelectionSetErrorMessage)(n,_,de.name,(0,Be.kindToNodeType)(de.kind))),ne=!1}K-=1,d.pop(),E.pop()}}}),B.length>0||!oe?{errorMessages:B}:{configuration:{fieldName:r,selectionSet:(0,Wr.getNormalizedFieldSet)(u)},errorMessages:B}}validateProvidesOrRequires(t,n,r){let i=[],a=[],o=(0,st.getParentTypeName)(t);for(let[u,l]of n){let{fieldSetParentData:d,errorString:p}=this.getFieldSetParent(r,t,u,o),E=`${o}.${u}`;if(p){i.push(p);continue}if(!d)continue;let{errorMessages:h,configuration:_}=this.validateConditionalFieldSet(d,l,u,r,o);if(h.length>0){i.push(` On field "${E}": + -`+h.join(M.HYPHEN_JOIN));continue}_&&a.push(_)}if(i.length>0){this.errors.push((0,$.invalidProvidesOrRequiresDirectivesError)((0,Wr.getConditionalFieldSetDirectiveName)(r),i));return}if(a.length>0)return a}validateInterfaceImplementations(t){if(t.implementedInterfaceTypeNames.size<1)return;let n=t.directivesByName.has(M.INACCESSIBLE),r=new Map,i=new Map,a=!1;for(let o of t.implementedInterfaceTypeNames){let u=this.parentDefinitionDataByTypeName.get(o);if(Kr.BASE_SCALARS.has(o)&&this.referencedTypeNames.add(o),!u)continue;if(u.kind!==Q.Kind.INTERFACE_TYPE_DEFINITION){i.set(u.name,(0,Be.kindToNodeType)(u.kind));continue}if(t.name===u.name){a=!0;continue}let l={invalidFieldImplementations:new Map,unimplementedFields:[]},d=!1;for(let[p,E]of u.fieldDataByName){this.unvalidatedExternalFieldCoords.delete(`${t.name}.${p}`);let h=!1,_=t.fieldDataByName.get(p);if(!_){d=!0,l.unimplementedFields.push(p);continue}let S={invalidAdditionalArguments:new Set,invalidImplementedArguments:[],isInaccessible:!1,originalResponseType:(0,Lt.printTypeNode)(E.node.type),unimplementedArguments:new Set};(0,st.isTypeValidImplementation)({concreteTypeNamesByAbstractTypeName:this.concreteTypeNamesByAbstractTypeName,implementationType:_.node.type,interfaceImplementationTypeNamesByInterfaceTypeName:this.interfaceImplementationTypeNamesByInterfaceTypeName,originalType:E.node.type})||(d=!0,h=!0,S.implementedResponseType=(0,Lt.printTypeNode)(_.node.type));let k=new Set;for(let[B,K]of E.argumentDataByName){k.add(B);let ne=_.argumentDataByName.get(B);if(!ne){d=!0,h=!0,S.unimplementedArguments.add(B);continue}let ee=(0,Lt.printTypeNode)(ne.type),oe=(0,Lt.printTypeNode)(K.type);oe!==ee&&(d=!0,h=!0,S.invalidImplementedArguments.push({actualType:ee,argumentName:B,expectedType:oe}))}for(let[B,K]of _.argumentDataByName)k.has(B)||K.type.kind===Q.Kind.NON_NULL_TYPE&&(d=!0,h=!0,S.invalidAdditionalArguments.add(B));!n&&_.isInaccessible&&!E.isInaccessible&&(d=!0,h=!0,S.isInaccessible=!0),h&&l.invalidFieldImplementations.set(p,S)}d&&r.set(o,l)}i.size>0&&this.errors.push((0,$.invalidImplementedTypeError)(t.name,i)),a&&this.errors.push((0,$.selfImplementationError)(t.name)),r.size>0&&this.errors.push((0,$.invalidInterfaceImplementationError)(t.name,(0,Be.kindToNodeType)(t.kind),r))}handleAuthenticatedDirective(t,n){let r=(0,Be.getValueOrDefault)(this.authorizationDataByParentTypeName,n,()=>(0,Wn.newAuthorizationData)(n));if(t.kind===Q.Kind.FIELD_DEFINITION){let i=(0,Be.getValueOrDefault)(r.fieldAuthDataByFieldName,t.name,()=>(0,Wn.newFieldAuthorizationData)(t.name));i.inheritedData.requiresAuthentication=!0,i.originalData.requiresAuthentication=!0}else r.requiresAuthentication=!0,this.parentTypeNamesWithAuthDirectives.add(n)}handleOverrideDirective({data:t,directiveCoords:n,errorMessages:r,targetSubgraphName:i}){if(i===this.subgraphName){r.push((0,$.equivalentSourceAndTargetOverrideErrorMessage)(i,n));return}let a=(0,Be.getValueOrDefault)(this.overridesByTargetSubgraphName,i,()=>new Map);(0,Be.getValueOrDefault)(a,t.renamedParentTypeName,()=>new Set).add(t.name)}handleSemanticNonNullDirective({data:t,directiveNode:n,errorMessages:r}){var E;let i=new Set,a=t.node.type,o=0;for(;a;)switch(a.kind){case Q.Kind.LIST_TYPE:{o+=1,a=a.type;break}case Q.Kind.NON_NULL_TYPE:{i.add(o),a=a.type;break}default:{a=null;break}}let u=(E=n.arguments)==null?void 0:E.find(h=>h.name.value===M.LEVELS);if(!u||u.value.kind!==Q.Kind.LIST){r.push($.semanticNonNullArgumentErrorMessage);return}let l=u.value.values,d=(0,Lt.printTypeNode)(t.type),p=new Set;for(let{value:h}of l){let _=parseInt(h,10);if(Number.isNaN(_)){r.push((0,$.semanticNonNullLevelsNaNIndexErrorMessage)(h));continue}if(_<0||_>o){r.push((0,$.semanticNonNullLevelsIndexOutOfBoundsErrorMessage)({maxIndex:o,typeString:d,value:h}));continue}if(!i.has(_)){p.add(_);continue}r.push((0,$.semanticNonNullLevelsNonNullErrorMessage)({typeString:d,value:h}))}t.nullLevelsBySubgraphName.set(this.subgraphName,p)}handleCostDirective({data:t,directiveCoords:n,directiveNode:r,errorMessages:i}){var u;let a=(u=r.arguments)==null?void 0:u.find(l=>l.name.value===M.WEIGHT);if(!a||a.value.kind!==Q.Kind.INT)return;let o=parseInt(a.value.value,10);switch(t.kind){case Q.Kind.OBJECT_TYPE_DEFINITION:case Q.Kind.SCALAR_TYPE_DEFINITION:case Q.Kind.ENUM_TYPE_DEFINITION:this.costs.typeWeights.set(t.name,o);break;case Q.Kind.FIELD_DEFINITION:{let l=t.renamedParentTypeName||t.originalParentTypeName,d=this.parentDefinitionDataByTypeName.get(l);if(!d)break;if(d.kind===Q.Kind.INTERFACE_TYPE_DEFINITION){i.push((0,$.costOnInterfaceFieldErrorMessage)(n));break}let p=`${l}.${t.name}`,E=(0,Be.getValueOrDefault)(this.costs.fieldWeights,p,()=>({typeName:l,fieldName:t.name,argumentWeights:new Map}));E.weight=o;break}case Q.Kind.INPUT_VALUE_DEFINITION:case Q.Kind.ARGUMENT:{let l=t;if(l.isArgument&&l.fieldName){let d=l.renamedParentTypeName||l.originalParentTypeName,p=this.parentDefinitionDataByTypeName.get(d);if(!p)break;if(p.kind===Q.Kind.INTERFACE_TYPE_DEFINITION){i.push((0,$.costOnInterfaceFieldErrorMessage)(n));break}let E=`${d}.${l.fieldName}`;(0,Be.getValueOrDefault)(this.costs.fieldWeights,E,()=>({typeName:d,fieldName:l.fieldName,argumentWeights:new Map})).argumentWeights.set(l.name,o)}else{let d=l.renamedParentTypeName||l.originalParentTypeName,p=`${d}.${l.name}`,E=(0,Be.getValueOrDefault)(this.costs.fieldWeights,p,()=>({typeName:d,fieldName:l.name,argumentWeights:new Map}));E.weight=o}break}}}handleListSizeDirective({data:t,directiveCoords:n,directiveNode:r,errorMessages:i}){let a=r.arguments;if(!a)return;let o=!1,u=t.renamedParentTypeName||t.originalParentTypeName,l={typeName:u,fieldName:t.name,slicingArguments:[],sizedFields:[],requireOneSlicingArgument:!0};for(let p of a)switch(p.name.value){case M.ASSUMED_SIZE:p.value.kind===Q.Kind.INT&&(l.assumedSize=parseInt(p.value.value,10));break;case M.REQUIRE_ONE_SLICING_ARGUMENT:p.value.kind===Q.Kind.BOOLEAN&&(l.requireOneSlicingArgument=p.value.value);break;case M.SLICING_ARGUMENTS:{let h;if(p.value.kind===Q.Kind.LIST)h=p.value.values;else if(p.value.kind===Q.Kind.STRING)h=[p.value];else continue;for(let _ of h){if(_.kind!==Q.Kind.STRING)continue;let S=_.value,k=t.argumentDataByName.get(S);if(!k){i.push((0,$.listSizeInvalidSlicingArgumentErrorMessage)(n,S));continue}if((k.type.kind===Q.Kind.NON_NULL_TYPE?k.type.type:k.type).kind===Q.Kind.LIST_TYPE||k.namedTypeName!==M.INT_SCALAR){i.push((0,$.listSizeSlicingArgumentNotIntErrorMessage)(n,S,(0,Lt.printTypeNode)(k.type)));continue}l.slicingArguments.push(S)}break}case M.SIZED_FIELDS:{let h;if(p.value.kind===Q.Kind.LIST)h=p.value.values;else if(p.value.kind===Q.Kind.STRING)h=[p.value];else continue;if(h.length<1)continue;o=!0;let _=t.namedTypeName,S=this.parentDefinitionDataByTypeName.get(_);if(!S||!(0,st.isParentDataCompositeOutputType)(S)){i.push((0,$.listSizeSizedFieldsInvalidReturnTypeErrorMessage)(n,_));continue}for(let k of h){if(k.kind!==Q.Kind.STRING)continue;let B=k.value,K=S.fieldDataByName.get(B);if(!K){i.push((0,$.listSizeSizedFieldNotFoundErrorMessage)(n,B,_));continue}if(!(0,st.isTypeNodeListType)(K.type)){i.push((0,$.listSizeSizedFieldNotListErrorMessage)(n,B,_,(0,Lt.printTypeNode)(K.type)));continue}l.sizedFields.push(B)}break}}if(!o&&!(0,st.isTypeNodeListType)(t.type)&&i.push((0,$.listSizeFieldMustReturnListOrUseSizedFieldsErrorMessage)(n,(0,Lt.printTypeNode)(t.type))),o&&(0,st.isTypeNodeListType)(t.type)&&i.push((0,$.listSizeSizedFieldsOnListsErrorMessage)(n,(0,Lt.printTypeNode)(t.type))),l.assumedSize!==void 0&&l.slicingArguments.length>0)if(l.requireOneSlicingArgument)i.push((0,$.listSizeAssumedSizeWithRequiredSlicingArgumentErrorMessage)(n));else for(let p of l.slicingArguments){let E=t.argumentDataByName.get(p);E!=null&&E.defaultValue&&i.push((0,$.listSizeAssumedSizeSlicingArgDefaultErrorMessage)(n,p))}let d=`${u}.${t.name}`;this.costs.listSizes.set(d,l)}extractRequiredScopes({directiveCoords:t,orScopes:n,requiredScopes:r}){if(n.length>Kr.MAX_OR_SCOPES){this.invalidORScopesCoords.add(t);return}for(let i of n){let a=new Set;for(let o of i.values)a.add(o.value);a.size<1||(0,Wn.addScopes)(r,a)}}getKafkaPublishConfiguration(t,n,r,i){let a=[],o=M.DEFAULT_EDFS_PROVIDER_ID;for(let u of t.arguments||[])switch(u.name.value){case M.TOPIC:{if(u.value.kind!==Q.Kind.STRING||u.value.value.length<1){i.push((0,$.invalidEventSubjectErrorMessage)(M.TOPIC));continue}(0,Wr.validateArgumentTemplateReferences)(u.value.value,n,i),a.push(u.value.value);break}case M.PROVIDER_ID:{if(u.value.kind!==Q.Kind.STRING||u.value.value.length<1){i.push($.invalidEventProviderIdErrorMessage);continue}o=u.value.value;break}}if(!(i.length>0))return{fieldName:r,providerId:o,providerType:M.PROVIDER_TYPE_KAFKA,topics:a,type:M.PUBLISH}}getKafkaSubscribeConfiguration(t,n,r,i){let a=[],o=M.DEFAULT_EDFS_PROVIDER_ID;for(let u of t.arguments||[])switch(u.name.value){case M.TOPICS:{if(u.value.kind!==Q.Kind.LIST){i.push((0,$.invalidEventSubjectsErrorMessage)(M.TOPICS));continue}for(let l of u.value.values){if(l.kind!==Q.Kind.STRING||l.value.length<1){i.push((0,$.invalidEventSubjectsItemErrorMessage)(M.TOPICS));break}(0,Wr.validateArgumentTemplateReferences)(l.value,n,i),a.push(l.value)}break}case M.PROVIDER_ID:{if(u.value.kind!==Q.Kind.STRING||u.value.value.length<1){i.push($.invalidEventProviderIdErrorMessage);continue}o=u.value.value;break}}if(!(i.length>0))return{fieldName:r,providerId:o,providerType:M.PROVIDER_TYPE_KAFKA,topics:a,type:M.SUBSCRIBE}}getNatsPublishAndRequestConfiguration(t,n,r,i,a){let o=[],u=M.DEFAULT_EDFS_PROVIDER_ID;for(let l of n.arguments||[])switch(l.name.value){case M.SUBJECT:{if(l.value.kind!==Q.Kind.STRING||l.value.value.length<1){a.push((0,$.invalidEventSubjectErrorMessage)(M.SUBJECT));continue}(0,Wr.validateArgumentTemplateReferences)(l.value.value,r,a),o.push(l.value.value);break}case M.PROVIDER_ID:{if(l.value.kind!==Q.Kind.STRING||l.value.value.length<1){a.push($.invalidEventProviderIdErrorMessage);continue}u=l.value.value;break}}if(!(a.length>0))return{fieldName:i,providerId:u,providerType:M.PROVIDER_TYPE_NATS,subjects:o,type:t}}getNatsSubscribeConfiguration(t,n,r,i){let a=[],o=M.DEFAULT_EDFS_PROVIDER_ID,u=vh.DEFAULT_CONSUMER_INACTIVE_THRESHOLD,l="",d="";for(let p of t.arguments||[])switch(p.name.value){case M.SUBJECTS:{if(p.value.kind!==Q.Kind.LIST){i.push((0,$.invalidEventSubjectsErrorMessage)(M.SUBJECTS));continue}for(let E of p.value.values){if(E.kind!==Q.Kind.STRING||E.value.length<1){i.push((0,$.invalidEventSubjectsItemErrorMessage)(M.SUBJECTS));break}(0,Wr.validateArgumentTemplateReferences)(E.value,n,i),a.push(E.value)}break}case M.PROVIDER_ID:{if(p.value.kind!==Q.Kind.STRING||p.value.value.length<1){i.push($.invalidEventProviderIdErrorMessage);continue}o=p.value.value;break}case M.STREAM_CONFIGURATION:{if(this.usesEdfsNatsStreamConfiguration=!0,p.value.kind!==Q.Kind.OBJECT||p.value.fields.length<1){i.push($.invalidNatsStreamInputErrorMessage);continue}let E=!0,h=new Set,_=new Set(Cf.STREAM_CONFIGURATION_FIELD_NAMES),S=new Set([M.CONSUMER_NAME,M.STREAM_NAME]),k=new Set,B=new Set;for(let K of p.value.fields){let ne=K.name.value;if(!Cf.STREAM_CONFIGURATION_FIELD_NAMES.has(ne)){h.add(ne),E=!1;continue}if(_.has(ne))_.delete(ne);else{k.add(ne),E=!1;continue}switch(S.has(ne)&&S.delete(ne),ne){case M.CONSUMER_NAME:if(K.value.kind!=Q.Kind.STRING||K.value.value.length<1){B.add(ne),E=!1;continue}l=K.value.value;break;case M.STREAM_NAME:if(K.value.kind!=Q.Kind.STRING||K.value.value.length<1){B.add(ne),E=!1;continue}d=K.value.value;break;case M.CONSUMER_INACTIVE_THRESHOLD:if(K.value.kind!=Q.Kind.INT){i.push((0,$.invalidArgumentValueErrorMessage)((0,Q.print)(K.value),"edfs__NatsStreamConfiguration","consumerInactiveThreshold",M.INT_SCALAR)),E=!1;continue}try{u=parseInt(K.value.value,10)}catch(ee){i.push((0,$.invalidArgumentValueErrorMessage)((0,Q.print)(K.value),"edfs__NatsStreamConfiguration","consumerInactiveThreshold",M.INT_SCALAR)),E=!1}break}}(!E||S.size>0)&&i.push((0,$.invalidNatsStreamInputFieldsErrorMessage)([...S],[...k],[...B],[...h]))}}if(!(i.length>0))return u<0?(u=vh.DEFAULT_CONSUMER_INACTIVE_THRESHOLD,this.warnings.push((0,Or.consumerInactiveThresholdInvalidValueWarning)(this.subgraphName,`The value has been set to ${vh.DEFAULT_CONSUMER_INACTIVE_THRESHOLD}.`))):u>xfe.MAX_INT32&&(u=0,this.warnings.push((0,Or.consumerInactiveThresholdInvalidValueWarning)(this.subgraphName,"The value has been set to 0. This means the consumer will remain indefinitely active until its manual deletion."))),q({fieldName:r,providerId:o,providerType:M.PROVIDER_TYPE_NATS,subjects:a,type:M.SUBSCRIBE},l&&d?{streamConfiguration:{consumerInactiveThreshold:u,consumerName:l,streamName:d}}:{})}getRedisPublishConfiguration(t,n,r,i){let a=[],o=M.DEFAULT_EDFS_PROVIDER_ID;for(let u of t.arguments||[])switch(u.name.value){case M.CHANNEL:{if(u.value.kind!==Q.Kind.STRING||u.value.value.length<1){i.push((0,$.invalidEventSubjectErrorMessage)(M.CHANNEL));continue}(0,Wr.validateArgumentTemplateReferences)(u.value.value,n,i),a.push(u.value.value);break}case M.PROVIDER_ID:{if(u.value.kind!==Q.Kind.STRING||u.value.value.length<1){i.push($.invalidEventProviderIdErrorMessage);continue}o=u.value.value;break}}if(!(i.length>0))return{fieldName:r,providerId:o,providerType:M.PROVIDER_TYPE_REDIS,channels:a,type:M.PUBLISH}}getRedisSubscribeConfiguration(t,n,r,i){let a=[],o=M.DEFAULT_EDFS_PROVIDER_ID;for(let u of t.arguments||[])switch(u.name.value){case M.CHANNELS:{if(u.value.kind!==Q.Kind.LIST){i.push((0,$.invalidEventSubjectsErrorMessage)(M.CHANNELS));continue}for(let l of u.value.values){if(l.kind!==Q.Kind.STRING||l.value.length<1){i.push((0,$.invalidEventSubjectsItemErrorMessage)(M.CHANNELS));break}(0,Wr.validateArgumentTemplateReferences)(l.value,n,i),a.push(l.value)}break}case M.PROVIDER_ID:{if(u.value.kind!==Q.Kind.STRING||u.value.value.length<1){i.push($.invalidEventProviderIdErrorMessage);continue}o=u.value.value;break}}if(!(i.length>0))return{fieldName:r,providerId:o,providerType:M.PROVIDER_TYPE_REDIS,channels:a,type:M.SUBSCRIBE}}validateSubscriptionFilterDirectiveLocation(t){if(!t.directives)return;let n=this.renamedParentTypeName||this.originalParentTypeName,r=`${n}.${t.name.value}`,i=this.getOperationTypeNodeForRootTypeName(n)===Q.OperationTypeNode.SUBSCRIPTION;for(let a of t.directives)if(a.name.value===M.SUBSCRIPTION_FILTER&&!i){this.errors.push((0,$.invalidSubscriptionFilterLocationError)(r));return}}extractEventDirectivesToConfiguration(t,n){if(!t.directives)return;let r=t.name.value,i=`${this.renamedParentTypeName||this.originalParentTypeName}.${r}`;for(let a of t.directives){let o=[],u;switch(a.name.value){case M.EDFS_KAFKA_PUBLISH:u=this.getKafkaPublishConfiguration(a,n,r,o);break;case M.EDFS_KAFKA_SUBSCRIBE:u=this.getKafkaSubscribeConfiguration(a,n,r,o);break;case M.EDFS_NATS_PUBLISH:{u=this.getNatsPublishAndRequestConfiguration(M.PUBLISH,a,n,r,o);break}case M.EDFS_NATS_REQUEST:{u=this.getNatsPublishAndRequestConfiguration(M.REQUEST,a,n,r,o);break}case M.EDFS_NATS_SUBSCRIBE:{u=this.getNatsSubscribeConfiguration(a,n,r,o);break}case M.EDFS_REDIS_PUBLISH:{u=this.getRedisPublishConfiguration(a,n,r,o);break}case M.EDFS_REDIS_SUBSCRIBE:{u=this.getRedisSubscribeConfiguration(a,n,r,o);break}default:continue}if(o.length>0){this.errors.push((0,$.invalidEventDirectiveError)(a.name.value,i,o));continue}u&&(0,Be.getValueOrDefault)(this.eventsConfigurations,this.renamedParentTypeName||this.originalParentTypeName,()=>[]).push(u)}}getValidEventsDirectiveNamesForOperationTypeNode(t){switch(t){case Q.OperationTypeNode.MUTATION:return new Set([M.EDFS_KAFKA_PUBLISH,M.EDFS_NATS_PUBLISH,M.EDFS_NATS_REQUEST,M.EDFS_REDIS_PUBLISH]);case Q.OperationTypeNode.QUERY:return new Set([M.EDFS_NATS_REQUEST]);case Q.OperationTypeNode.SUBSCRIPTION:return new Set([M.EDFS_KAFKA_SUBSCRIBE,M.EDFS_NATS_SUBSCRIBE,M.EDFS_REDIS_SUBSCRIBE])}}getOperationTypeNodeForRootTypeName(t){let n=this.operationTypeNodeByTypeName.get(t);if(n)return n;switch(t){case M.MUTATION:return Q.OperationTypeNode.MUTATION;case M.QUERY:return Q.OperationTypeNode.QUERY;case M.SUBSCRIPTION:return Q.OperationTypeNode.SUBSCRIPTION;default:return}}validateEventDrivenRootType(t,n,r,i){let a=this.getOperationTypeNodeForRootTypeName(t.name);if(!a){this.errors.push((0,$.invalidRootTypeError)(t.name));return}let o=this.getValidEventsDirectiveNamesForOperationTypeNode(a);for(let[u,l]of t.fieldDataByName){let d=`${l.originalParentTypeName}.${u}`,p=new Set;for(let B of Cf.EVENT_DIRECTIVE_NAMES)l.directivesByName.has(B)&&p.add(B);let E=new Set;for(let B of p)o.has(B)||E.add(B);if((p.size<1||E.size>0)&&n.set(d,{definesDirectives:p.size>0,invalidDirectiveNames:[...E]}),a===Q.OperationTypeNode.MUTATION){let B=(0,Lt.printTypeNode)(l.type);B!==M.NON_NULLABLE_EDFS_PUBLISH_EVENT_RESULT&&i.set(d,B);continue}let h=(0,Lt.printTypeNode)(l.type),_=l.namedTypeName+"!",S=!1,k=this.concreteTypeNamesByAbstractTypeName.get(l.namedTypeName)||new Set([l.namedTypeName]);for(let B of k)if(S||(S=this.entityDataByTypeName.has(B)),S)break;(!S||h!==_)&&r.set(d,h)}}validateEventDrivenKeyDefinition(t,n){let r=this.keyFieldSetDatasByTypeName.get(t);if(r)for(let[i,{isUnresolvable:a}]of r)a||(0,Be.getValueOrDefault)(n,t,()=>[]).push(i)}validateEventDrivenObjectFields(t,n,r,i){var a;for(let[o,u]of t){let l=`${u.originalParentTypeName}.${o}`;if(n.has(o)){(a=u.externalFieldDataBySubgraphName.get(this.subgraphName))!=null&&a.isDefinedExternal||r.set(l,o);continue}i.set(l,o)}}isEdfsPublishResultValid(){let t=this.parentDefinitionDataByTypeName.get(M.EDFS_PUBLISH_RESULT);if(!t)return!0;if(t.kind!==Q.Kind.OBJECT_TYPE_DEFINITION||t.fieldDataByName.size!=1)return!1;for(let[n,r]of t.fieldDataByName)if(r.argumentDataByName.size>0||n!==M.SUCCESS||(0,Lt.printTypeNode)(r.type)!==M.NON_NULLABLE_BOOLEAN)return!1;return!0}isNatsStreamConfigurationInputObjectValid(t){if(!(0,st.isInputObjectDefinitionData)(t)||t.inputValueDataByName.size!=3)return!1;for(let[n,r]of t.inputValueDataByName)switch(n){case M.CONSUMER_INACTIVE_THRESHOLD:{if((0,Lt.printTypeNode)(r.type)!==M.NON_NULLABLE_INT||!r.defaultValue||r.defaultValue.kind!==Q.Kind.INT||r.defaultValue.value!==`${vh.DEFAULT_CONSUMER_INACTIVE_THRESHOLD}`)return!1;break}case M.CONSUMER_NAME:case M.STREAM_NAME:{if((0,Lt.printTypeNode)(r.type)!==M.NON_NULLABLE_STRING)return!1;break}default:return!1}return!0}validateEventDrivenSubgraph(){let t=[],n=new Map,r=new Map,i=new Map,a=new Map,o=new Map,u=new Map,l=new Set,d=new Set;for(let[p,E]of this.parentDefinitionDataByTypeName){if(p===M.EDFS_PUBLISH_RESULT||p===M.EDFS_NATS_STREAM_CONFIGURATION||E.kind!==Q.Kind.OBJECT_TYPE_DEFINITION)continue;if(E.isRootType){this.validateEventDrivenRootType(E,n,r,i);continue}let h=this.keyFieldNamesByParentTypeName.get(p);if(!h){d.add(p);continue}this.validateEventDrivenKeyDefinition(p,a),this.validateEventDrivenObjectFields(E.fieldDataByName,h,o,u)}if(this.isEdfsPublishResultValid()||t.push($.invalidEdfsPublishResultObjectErrorMessage),this.edfsDirectiveReferences.has(M.EDFS_NATS_SUBSCRIBE)){let p=this.parentDefinitionDataByTypeName.get(M.EDFS_NATS_STREAM_CONFIGURATION);p&&this.usesEdfsNatsStreamConfiguration&&!this.isNatsStreamConfigurationInputObjectValid(p)&&t.push($.invalidNatsStreamConfigurationDefinitionErrorMessage),this.parentDefinitionDataByTypeName.delete(M.EDFS_NATS_STREAM_CONFIGURATION);let E=this.upsertInputObjectByNode(MK.EDFS_NATS_STREAM_CONFIGURATION_DEFINITION);if(E.success)for(let h of MK.EDFS_NATS_STREAM_CONFIGURATION_DEFINITION.fields)this.addInputValueDataByNode({fieldName:h.name.value,isArgument:!1,inputValueDataByName:E.data.inputValueDataByName,node:h,originalParentTypeName:M.EDFS_NATS_STREAM_CONFIGURATION});else return}n.size>0&&t.push((0,$.invalidRootTypeFieldEventsDirectivesErrorMessage)(n)),i.size>0&&t.push((0,$.invalidEventDrivenMutationResponseTypeErrorMessage)(i)),r.size>0&&t.push((0,$.invalidRootTypeFieldResponseTypesEventDrivenErrorMessage)(r)),a.size>0&&t.push((0,$.invalidKeyFieldSetsEventDrivenErrorMessage)(a)),o.size>0&&t.push((0,$.nonExternalKeyFieldNamesEventDrivenErrorMessage)(o)),u.size>0&&t.push((0,$.nonKeyFieldNamesEventDrivenErrorMessage)(u)),l.size>0&&t.push((0,$.nonEntityObjectExtensionsEventDrivenErrorMessage)([...l])),d.size>0&&t.push((0,$.nonKeyComposingObjectTypeNamesEventDrivenErrorMessage)([...d])),t.length>0&&this.errors.push((0,$.invalidEventDrivenGraphError)(t))}validateUnionMembers(t){if(t.memberByMemberTypeName.size<1){this.errors.push((0,$.noDefinedUnionMembersError)(t.name));return}let n=[];for(let r of t.memberByMemberTypeName.keys()){let i=this.parentDefinitionDataByTypeName.get(r);i&&i.kind!==Q.Kind.OBJECT_TYPE_DEFINITION&&n.push(`"${r}", which is type "${(0,Be.kindToNodeType)(i.kind)}"`)}n.length>0&&this.errors.push((0,$.invalidUnionMemberTypeError)(t.name,n))}addConcreteTypeNamesForUnion(t){if(!t.types||t.types.length<1)return;let n=t.name.value;for(let r of t.types){let i=r.name.value;(0,Be.getValueOrDefault)(this.concreteTypeNamesByAbstractTypeName,n,()=>new Set).add(i),this.internalGraph.addEdge(this.internalGraph.addOrUpdateNode(n,{isAbstract:!0}),this.internalGraph.addOrUpdateNode(i),i,!0)}}addValidKeyFieldSetConfigurations(){for(let[t,n]of this.keyFieldSetDatasByTypeName){let r=this.parentDefinitionDataByTypeName.get(t);if(!r||r.kind!==Q.Kind.OBJECT_TYPE_DEFINITION&&r.kind!==Q.Kind.INTERFACE_TYPE_DEFINITION){this.errors.push((0,$.undefinedCompositeOutputTypeError)(t));continue}let i=(0,st.getParentTypeName)(r),a=(0,Be.getValueOrDefault)(this.configurationDataByTypeName,i,()=>(0,zc.newConfigurationData)(!0,i)),o=(0,Wr.validateKeyFieldSets)(this,r,n);o&&(a.keys=o)}}extractRequestScopedFields(){var i;let t=[],n=new Map;for(let[,a]of this.parentDefinitionDataByTypeName){if(a.kind!==Q.Kind.OBJECT_TYPE_DEFINITION&&a.kind!==Q.Kind.INTERFACE_TYPE_DEFINITION)continue;let o=(0,st.getParentTypeName)(a);for(let[u,l]of a.fieldDataByName){let d=l.directivesByName.get(M.REQUEST_SCOPED);if(!d||d.length<1)continue;let p=d[0],E=`${o}.${u}`,h;if(p.arguments)for(let k of p.arguments)k.name.value===M.KEY&&k.value.kind===Q.Kind.STRING&&(h=k.value.value);if(!h)continue;let _=`${this.subgraphName}.${h}`;t.push({typeName:o,fieldName:u,fieldCoords:E,key:h,l1Key:_});let S=n.get(h);S?S.push(E):n.set(h,[E])}}if(t.length===0)return;for(let[a,o]of n)o.length<2&&this.warnings.push((0,Or.requestScopedSingleFieldWarning)({subgraphName:this.subgraphName,key:a,fieldCoords:o[0]}));let r=new Map;for(let a of t){let o=(i=r.get(a.typeName))!=null?i:[];o.push({fieldName:a.fieldName,typeName:a.typeName,l1Key:a.l1Key}),r.set(a.typeName,o)}for(let[a,o]of r){let u=(0,Be.getValueOrDefault)(this.configurationDataByTypeName,a,()=>(0,zc.newConfigurationData)(!1,a));u.requestScopedFields=o}}extractCacheIntArg(t,n){if(t.arguments){for(let r of t.arguments)if(r.name.value===n&&r.value.kind===Q.Kind.INT)return parseInt(r.value.value,10)}}extractCacheBoolArg(t,n){if(!t.arguments)return!1;for(let r of t.arguments)if(r.name.value===n&&r.value.kind===Q.Kind.BOOLEAN)return r.value.value;return!1}getCacheConfigurationData(t,n){return(0,Be.getValueOrDefault)(this.configurationDataByTypeName,t,()=>(0,zc.newConfigurationData)(n,t))}validateAndExtractEntityCachingConfigs(){this.extractEntityCacheDirectives(),this.processRootFieldCacheDirectives()}extractEntityCacheDirectives(){var t,n;for(let[r,i]of this.parentDefinitionDataByTypeName){if(i.kind!==Q.Kind.OBJECT_TYPE_DEFINITION)continue;let a=i.directivesByName.get(M.ENTITY_CACHE);if(!a)continue;if(!this.keyFieldSetDatasByTypeName.has(r)){this.errors.push((0,$.invalidDirectiveError)(M.ENTITY_CACHE,r,M.FIRST_ORDINAL,[(0,$.entityCacheWithoutKeyErrorMessage)(r)]));continue}let o=a[0],u=(t=this.extractCacheIntArg(o,M.MAX_AGE))!=null?t:0,l=(n=this.extractCacheIntArg(o,M.NEGATIVE_CACHE_TTL))!=null?n:0,d=this.extractCacheBoolArg(o,M.INCLUDE_HEADERS),p=this.extractCacheBoolArg(o,M.PARTIAL_CACHE_LOAD),E=this.extractCacheBoolArg(o,M.SHADOW_MODE);if(u<=0){this.errors.push((0,$.invalidDirectiveError)(M.ENTITY_CACHE,r,M.FIRST_ORDINAL,[(0,$.maxAgeNotPositiveIntegerErrorMessage)(M.ENTITY_CACHE,u)]));continue}if(l<0){this.errors.push((0,$.invalidDirectiveError)(M.ENTITY_CACHE,r,M.FIRST_ORDINAL,[(0,$.negativeCacheTTLNotNonNegativeIntegerErrorMessage)(M.ENTITY_CACHE,l)]));continue}let h={typeName:r,maxAgeSeconds:u,notFoundCacheTtlSeconds:l,includeHeaders:d,partialCacheLoad:p,shadowMode:E};this.entityCacheConfigByTypeName.set(r,h);let _=this.getCacheConfigurationData(r,!0);_.entityCacheConfigurations||(_.entityCacheConfigurations=[]),_.entityCacheConfigurations.push(h)}}processRootFieldCacheDirectives(){for(let[t,n]of this.parentDefinitionDataByTypeName){if(n.kind!==Q.Kind.OBJECT_TYPE_DEFINITION)continue;let r=this.getOperationTypeNodeForRootTypeName(t);if(r)for(let[i,a]of n.fieldDataByName){let o=`${t}.${i}`,u=a.directivesByName.has(M.QUERY_CACHE),l=a.directivesByName.has(M.CACHE_INVALIDATE),d=a.directivesByName.has(M.CACHE_POPULATE);if(l&&d){this.errors.push((0,$.invalidDirectiveError)(M.CACHE_INVALIDATE,o,M.FIRST_ORDINAL,[(0,$.cacheInvalidateAndPopulateMutualExclusionErrorMessage)(o)]));continue}u&&this.extractQueryCacheConfig(t,i,a,r),l&&this.extractCacheInvalidateConfig(t,i,a,r),d&&this.extractCachePopulateConfig(t,i,a,r),this.validateIsDirectivePlacement(o,a,u)}}}extractQueryCacheConfig(t,n,r,i){var K;let a=`${t}.${n}`;if(i!==Q.OperationTypeNode.QUERY){this.errors.push((0,$.invalidDirectiveError)(M.QUERY_CACHE,a,M.FIRST_ORDINAL,[(0,$.queryCacheOnNonQueryFieldErrorMessage)(a)]));return}let o=(0,On.getTypeNodeNamedTypeName)(r.node.type);if(!this.keyFieldSetDatasByTypeName.has(o)){this.errors.push((0,$.invalidDirectiveError)(M.QUERY_CACHE,a,M.FIRST_ORDINAL,[(0,$.queryCacheOnNonEntityReturnTypeErrorMessage)(a,o)]));return}let u=r.directivesByName.get(M.QUERY_CACHE)[0],l=(K=this.extractCacheIntArg(u,M.MAX_AGE))!=null?K:0,d=this.extractCacheBoolArg(u,M.INCLUDE_HEADERS),p=this.extractCacheBoolArg(u,M.SHADOW_MODE);if(l<=0){this.errors.push((0,$.invalidDirectiveError)(M.QUERY_CACHE,a,M.FIRST_ORDINAL,[(0,$.maxAgeNotPositiveIntegerErrorMessage)(M.QUERY_CACHE,l)]));return}let E=this.parentDefinitionDataByTypeName.get(o);if((E==null?void 0:E.kind)===Q.Kind.OBJECT_TYPE_DEFINITION&&!this.entityCacheConfigByTypeName.has(o)){this.warnings.push((0,Or.queryCacheReturnEntityMissingEntityCacheWarning)({subgraphName:this.subgraphName,fieldCoords:a,entityType:o}));return}let _=(0,st.isTypeNodeListType)(r.node.type),S=this.keyFieldSetDatasByTypeName.get(o),k=this.buildArgumentKeyMappings(r,a,o,S,_),B=this.getCacheConfigurationData(t,!1);B.rootFieldCacheConfigurations||(B.rootFieldCacheConfigurations=[]),B.rootFieldCacheConfigurations.push({fieldName:n,maxAgeSeconds:l,includeHeaders:d,shadowMode:p,entityTypeName:o,entityKeyMappings:k})}extractCacheInvalidateConfig(t,n,r,i){let a=`${t}.${n}`;if(i!==Q.OperationTypeNode.MUTATION&&i!==Q.OperationTypeNode.SUBSCRIPTION){this.errors.push((0,$.invalidDirectiveError)(M.CACHE_INVALIDATE,a,M.FIRST_ORDINAL,[(0,$.cacheInvalidateOnNonMutationSubscriptionFieldErrorMessage)(a)]));return}let o=(0,On.getTypeNodeNamedTypeName)(r.node.type);if(!this.keyFieldSetDatasByTypeName.has(o)||!this.entityCacheConfigByTypeName.has(o)){this.errors.push((0,$.invalidDirectiveError)(M.CACHE_INVALIDATE,a,M.FIRST_ORDINAL,[(0,$.cacheInvalidateOnNonEntityReturnTypeErrorMessage)(a,o)]));return}let u=this.getCacheConfigurationData(t,!1);u.cacheInvalidateConfigurations||(u.cacheInvalidateConfigurations=[]),u.cacheInvalidateConfigurations.push({fieldName:n,operationType:i===Q.OperationTypeNode.MUTATION?M.MUTATION:M.SUBSCRIPTION,entityTypeName:o})}extractCachePopulateConfig(t,n,r,i){let a=`${t}.${n}`;if(i!==Q.OperationTypeNode.MUTATION&&i!==Q.OperationTypeNode.SUBSCRIPTION){this.errors.push((0,$.invalidDirectiveError)(M.CACHE_POPULATE,a,M.FIRST_ORDINAL,[(0,$.cachePopulateOnNonMutationSubscriptionFieldErrorMessage)(a)]));return}let o=(0,On.getTypeNodeNamedTypeName)(r.node.type);if(!this.keyFieldSetDatasByTypeName.has(o)||!this.entityCacheConfigByTypeName.has(o)){this.errors.push((0,$.invalidDirectiveError)(M.CACHE_POPULATE,a,M.FIRST_ORDINAL,[(0,$.cachePopulateOnNonEntityReturnTypeErrorMessage)(a,o)]));return}let u=r.directivesByName.get(M.CACHE_POPULATE)[0],l=this.extractCacheIntArg(u,M.MAX_AGE),d;if(l!==void 0){if(l<=0){this.errors.push((0,$.invalidDirectiveError)(M.CACHE_POPULATE,a,M.FIRST_ORDINAL,[(0,$.maxAgeNotPositiveIntegerErrorMessage)(M.CACHE_POPULATE,l)]));return}d=l}let p=this.getCacheConfigurationData(t,!1);p.cachePopulateConfigurations||(p.cachePopulateConfigurations=[]),p.cachePopulateConfigurations.push({fieldName:n,operationType:i===Q.OperationTypeNode.MUTATION?M.MUTATION:M.SUBSCRIPTION,entityTypeName:o,maxAgeSeconds:d})}validateIsDirectivePlacement(t,n,r){if(!r)for(let[i,a]of n.argumentDataByName)a.directivesByName.has(M.IS)&&this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${i}: ...)`,M.FIRST_ORDINAL,[(0,$.isWithoutQueryCacheErrorMessage)(i,t)]))}extractKeyFieldInfos(t,n){let r=[],i=t.definitions[0];if(!i||!("selectionSet"in i)||!i.selectionSet)return r;let a=(o,u,l)=>{for(let d of o){if(d.kind!==Q.Kind.FIELD)continue;let p=d.name.value,E=l?`${l}.${p}`:p,h=this.parentDefinitionDataByTypeName.get(u);if(!h||!("fieldDataByName"in h))continue;let _=h.fieldDataByName.get(p);if(_)if(d.selectionSet&&d.selectionSet.selections.length>0){let S=(0,On.getTypeNodeNamedTypeName)(_.node.type);a(d.selectionSet.selections,S,E)}else r.push({path:E,typeNode:_.node.type})}};return a(i.selectionSet.selections,n,""),r}getNamedTypeName(t){return t.kind===Q.Kind.NAMED_TYPE?t.name.value:this.getNamedTypeName(t.type)}unwrapListType(t){if(t.kind===Q.Kind.LIST_TYPE)return t.type;if(t.kind===Q.Kind.NON_NULL_TYPE){let n=this.unwrapListType(t.type);if(n!==t.type)return n}return t}namedTypesMatch(t,n){return this.getNamedTypeName(t)===this.getNamedTypeName(n)}listStructureMatches(t,n){let r=(0,st.isTypeNodeListType)(t),i=(0,st.isTypeNodeListType)(n);return r===i}typesMatchIncludingListShape(t,n){return t.kind!==n.kind?!1:t.kind===Q.Kind.NAMED_TYPE?t.name.value===n.name.value:t.kind===Q.Kind.NON_NULL_TYPE||t.kind===Q.Kind.LIST_TYPE?this.typesMatchIncludingListShape(t.type,n.type):!1}getIsFieldValue(t){let n=t.directivesByName.get(M.IS);if(!n||n.length<1)return;let r=n[0];if(r.arguments){for(let i of r.arguments)if(i.name.value===M.FIELDS&&i.value.kind===Q.Kind.STRING)return i.value.value}}validateNestedInputObjectMapping(t,n,r,i,a,o,u,l,d,p=""){let E=this.parentDefinitionDataByTypeName.get(o);if(!E||E.kind!==Q.Kind.INPUT_OBJECT_TYPE_DEFINITION)return null;let h=new Map;for(let S of i){let k=S.path.indexOf(M.LITERAL_PERIOD),B=k>=0?S.path.substring(0,k):S.path,K=k>=0?S.path.substring(k+1):"";h.has(B)||h.set(B,[]),h.get(B).push(W(q({},S),{restPath:K}))}let _=[];for(let[S,k]of h){let B=E.inputValueDataByName.get(S);if(!B)return d?this.errors.push((0,$.invalidDirectiveError)(M.QUERY_CACHE,n,M.FIRST_ORDINAL,[(0,$.nestedInputObjectMissingFieldErrorMessage)(t,n,a,r,o,S)])):this.errors.push((0,$.invalidDirectiveError)(M.IS,`${n}(${t}: ...)`,M.FIRST_ORDINAL,[(0,$.inputObjectCompositeMissingFieldErrorMessage)(t,n,a,r,o,S)])),null;let K=p?`${p}.${S}`:S;if(k.some(ee=>ee.restPath!=="")){let ee=k.map(me=>({path:me.restPath,typeNode:me.typeNode})),oe=this.getNamedTypeName(B.type),de=this.validateNestedInputObjectMapping(t,n,r,ee,a,oe,[...u,S],l,!0,K);if(!de)return null;_.push(...de)}else{let ee=k[0].typeNode;if(!this.typesMatchIncludingListShape(ee,B.type)){let me=(p?`${p}.${S}`:S).split(M.LITERAL_PERIOD),pe=r;for(let H=0;H0)return!0}return!1}buildExplicitMappings(t,n,r,i,a){let o=new Map,u=new Set,l=new Map,d=new Set,p=this.parentDefinitionDataByTypeName.get(n);if(p&&"fieldDataByName"in p)for(let B of p.fieldDataByName.keys())d.add(B);for(let[B,K]of r){let ne=this.extractKeyFieldInfos(K.documentNode,n);o.set(B,ne);for(let ee of ne)u.add(ee.path),l.set(ee.path,{typeNode:ee.typeNode})}let E=[],h=[],_=new Set;for(let B of a){if(!B.isFieldValue)continue;let K=B.isFieldValue;if(K.includes(M.LITERAL_SPACE)){let me=this.errors.length,pe=this.buildCompositeIsMapping(t,n,r,i,B);if(this.errors.length>me)return[];for(let ge of pe)for(let H of ge.fieldMappings)_.add(H.entityKeyField);h.push(...pe);continue}let ee=K.split(M.LITERAL_PERIOD)[0];if(!u.has(K))return d.has(ee)&&!K.includes(M.LITERAL_PERIOD)?this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${B.name}: ...)`,M.FIRST_ORDINAL,[(0,$.nonKeyFieldSpecErrorMessage)(B.name,t,K,n)])):this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${B.name}: ...)`,M.FIRST_ORDINAL,[(0,$.isReferencesUnknownKeyFieldErrorMessage)(K,B.name,t,n)])),[];if(_.has(K))return this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${B.name}: ...)`,M.FIRST_ORDINAL,[(0,$.duplicateKeyFieldMappingErrorMessage)(t,K)])),[];let oe=l.get(K).typeNode,de=B.typeNode;if(i){if((0,st.isTypeNodeListType)(oe)){if(!B.isList)return this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${B.name}: ...)`,M.FIRST_ORDINAL,[(0,$.batchListValuedKeyRequiresNestedListsErrorMessage)(t,K,n,`a scalar tag of type "${(0,Lt.printTypeNode)(de)}"`)])),[];let me=this.unwrapListType(de);if(!(0,st.isTypeNodeListType)(me))return this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${B.name}: ...)`,M.FIRST_ORDINAL,[(0,$.batchListValuedKeyRequiresNestedListsErrorMessage)(t,K,n,`a single tag list of type "${(0,Lt.printTypeNode)(de)}"`)])),[];let pe=this.unwrapListType(me);if(!this.namedTypesMatch(pe,oe))return this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${B.name}: ...)`,M.FIRST_ORDINAL,[(0,$.explicitTypeMismatchErrorMessage)(B.name,t,(0,Lt.printTypeNode)(de),K,n,(0,Lt.printTypeNode)(oe))])),[]}else if(B.isList){let me=this.unwrapListType(de);if(!this.namedTypesMatch(me,oe))return this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${B.name}: ...)`,M.FIRST_ORDINAL,[(0,$.explicitTypeMismatchErrorMessage)(B.name,t,(0,Lt.printTypeNode)(de),K,n,(0,Lt.printTypeNode)(oe))])),[]}}else{let me=B.isList,pe=(0,st.isTypeNodeListType)(oe);if(me&&!pe)return this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${B.name}: ...)`,M.FIRST_ORDINAL,[(0,$.listArgumentToScalarKeySpecErrorMessage)(B.name,t,(0,Lt.printTypeNode)(de),K,n,(0,Lt.printTypeNode)(oe))])),[];if(!me&&pe)return this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${B.name}: ...)`,M.FIRST_ORDINAL,[(0,$.scalarArgumentToListKeySpecErrorMessage)(B.name,t,(0,Lt.printTypeNode)(de),K,n,(0,Lt.printTypeNode)(oe))])),[];if(!this.namedTypesMatch(de,oe))return this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${B.name}: ...)`,M.FIRST_ORDINAL,[(0,$.explicitTypeMismatchErrorMessage)(B.name,t,(0,Lt.printTypeNode)(de),K,n,(0,Lt.printTypeNode)(oe))])),[]}if(B.name===K){let me=(0,st.isTypeNodeListType)(oe),pe=B.isList,ge;i?ge=pe&&!me:ge=pe===me,ge&&this.warnings.push((0,Or.redundantIsDirectiveWarning)({subgraphName:this.subgraphName,argumentName:B.name,fieldCoords:t,keyField:K,entityType:n}))}_.add(K),E.push({argumentName:B.name,isFieldValue:K,argumentInfo:B})}if(E.length===0)return h;for(let B of a)if(!B.isFieldValue&&_.has(B.name))return this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${a.find(K=>K.isFieldValue===B.name).name}: ...)`,M.FIRST_ORDINAL,[(0,$.duplicateKeyFieldMappingErrorMessage)(t,B.name)])),[];if(i){let B=a.filter(ee=>!ee.isFieldValue&&!u.has(ee.name));if(B.length>0){let ee=E[0];return this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${ee.argumentName}: ...)`,M.FIRST_ORDINAL,[(0,$.explicitBatchAdditionalNonKeyArgumentErrorMessage)(t,ee.argumentName,ee.isFieldValue,n,B[0].name)])),[]}let K=E.every(ee=>!ee.argumentInfo.isList),ne=E.filter(ee=>ee.argumentInfo.isList);if(K)return this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${E[0].argumentName}: ...)`,M.FIRST_ORDINAL,[(0,$.explicitScalarArgumentsCannotEstablishBatchMappingErrorMessage)(t,n)])),[];if(ne.length>1)return this.errors.push((0,$.invalidDirectiveError)(M.QUERY_CACHE,t,M.FIRST_ORDINAL,[(0,$.multipleListArgumentsBatchFactoryMessage)(t,n)])),[]}let S=a.filter(B=>!B.isFieldValue&&!u.has(B.name));if(S.length>0)if(i){let B=E[0];return this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${B.argumentName}: ...)`,M.FIRST_ORDINAL,[(0,$.explicitBatchAdditionalNonKeyArgumentErrorMessage)(t,B.argumentName,B.isFieldValue,n,S[0].name)])),[]}else{let B;for(let[K]of r){let ne=o.get(K),ee=new Set(ne.map(oe=>oe.path));if(E.every(oe=>ee.has(oe.isFieldValue))){B=K;break}}if(E.length===1&&B&&!B.includes(M.LITERAL_SPACE))this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${E[0].argumentName}: ...)`,M.FIRST_ORDINAL,[(0,$.explicitSingularAdditionalNonKeyArgumentErrorMessage)(t,E[0].argumentName,E[0].isFieldValue,n,S[0].name)]));else if(B){let K=E.map(ne=>ne.argumentName);this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${K[0]}: ...)`,M.FIRST_ORDINAL,[(0,$.explicitCompositeAdditionalNonKeyArgumentErrorMessage)(t,K[0],K[1]||K[0],B,n,S[0].name)]))}return[]}let k=[];for(let B of r.keys()){let K=o.get(B),ne=new Set(K.map(ge=>ge.path)),ee=E.filter(ge=>ne.has(ge.isFieldValue)),oe=[],de=[],me=!0;for(let ge of K){if(ee.some(he=>he.isFieldValue===ge.path))continue;let H=a.find(he=>!he.isFieldValue&&he.name===ge.path);H&&this.namedTypesMatch(H.typeNode,ge.typeNode)&&(0,st.isTypeNodeListType)(H.typeNode)===(0,st.isTypeNodeListType)(ge.typeNode)?oe.push({argumentName:H.name,keyPath:ge.path,argInfo:H}):(de.push(ge.path),me=!1)}if(!me){if(ee.length>0&&de.length>0)return this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${ee[0].argumentName}: ...)`,M.FIRST_ORDINAL,[(0,$.explicitIncompleteCompositeKeyErrorMessage)(t,ee[0].argumentName,ee[0].isFieldValue,n,B,de[0])])),[];continue}let pe=[];for(let ge of K){let H=ee.find(Je=>Je.isFieldValue===ge.path);if(H){let Je={entityKeyField:H.isFieldValue,argumentPath:[H.argumentName]};i&&H.argumentInfo.isList&&(Je.isBatch=!0),pe.push(Je);continue}let he=oe.find(Je=>Je.keyPath===ge.path);if(he){let Je={entityKeyField:he.keyPath,argumentPath:[he.argumentName]};i&&he.argInfo.isList&&(Je.isBatch=!0),pe.push(Je)}}pe.length>0&&k.push({entityTypeName:n,fieldMappings:pe})}return[...h,...k]}buildCompositeIsMapping(t,n,r,i,a){let o=a.isFieldValue,{documentNode:u}=(0,Dn.safeParse)("{"+o+"}"),l=u?(0,Wr.getNormalizedFieldSet)(u):o;for(let[d,p]of r){if(d!==l)continue;let E=this.extractKeyFieldInfos(p.documentNode,n),h=this.getNamedTypeName(a.typeNode),_=this.parentDefinitionDataByTypeName.get(h);if(!_||_.kind!==Q.Kind.INPUT_OBJECT_TYPE_DEFINITION)return this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${a.name}: ...)`,M.FIRST_ORDINAL,[(0,$.nonInputArgumentCannotTargetCompositeKeyErrorMessage)(a.name,t,o,n,(0,Lt.printTypeNode)(a.typeNode))])),[];let S=i&&a.isList,k=d.includes(M.LITERAL_OPEN_BRACE),B=this.validateNestedInputObjectMapping(a.name,t,n,E,d,h,[a.name],S,k);return B?[{entityTypeName:n,fieldMappings:B}]:[]}return this.errors.push((0,$.invalidDirectiveError)(M.IS,`${t}(${a.name}: ...)`,M.FIRST_ORDINAL,[(0,$.isReferencesUnknownKeyFieldErrorMessage)(o,a.name,t,n)])),[]}invalidateAutoMappingWithExtraArgument(t,n,r,i,a,o,u,l,d=!0){let p=t.filter(E=>!n.has(E.name)&&!r.has(E.name));return p.length<1||!u||!l?!1:(d&&(i?this.warnings.push((0,Or.autoBatchAdditionalNonKeyArgumentWarning)({subgraphName:this.subgraphName,fieldCoords:a,argumentName:u,keyField:l,entityType:o,extraArgument:p[0].name})):this.warnings.push((0,Or.autoMappingAdditionalNonKeyArgumentWarning)({subgraphName:this.subgraphName,argumentName:u,fieldCoords:a,keyField:l,entityType:o,extraArgument:p[0].name}))),!0)}buildAutoMappings(t,n,r,i,a){var p;let o=[],u=!1,l=new Set;for(let[,E]of r){let h=this.extractKeyFieldInfos(E.documentNode,n);for(let _ of h)l.add(_.path)}for(let[E,h]of r){if(!E.includes(M.LITERAL_OPEN_BRACE))continue;let _=this.extractKeyFieldInfos(h.documentNode,n);if(_.length===0)continue;let S=new Set;for(let k of _){let B=k.path.split(M.LITERAL_PERIOD)[0];S.add(B)}if(S.size===1){let k=[...S][0],B=a.find(K=>K.name===k);if(B){let K=this.getNamedTypeName(B.typeNode),ne=this.parentDefinitionDataByTypeName.get(K);if(ne&&ne.kind===Q.Kind.INPUT_OBJECT_TYPE_DEFINITION){let ee=_.map(me=>({path:me.path.substring(k.length+1),typeNode:me.typeNode})),oe=i&&B.isList,de=this.validateNestedInputObjectMapping(B.name,t,n,ee,E,K,[B.name],oe,!0,k);if(de){if(this.invalidateAutoMappingWithExtraArgument(a,l,new Set([B.name]),i,t,n,B.name,(p=de[0])==null?void 0:p.entityKeyField,!1)){o.length=0;continue}o.push({entityTypeName:n,fieldMappings:de})}continue}}}}let d=!1;for(let E of r.values()){if(d)break;let h=this.extractKeyFieldInfos(E.documentNode,n);if(h.length===0)continue;let _=[],S=!0,k=!1,B,K,ne,ee=!1;for(let de of h){let me=de.path,pe=a.find(Qt=>Qt.name===me);if(!pe){S=!1,ne=me;continue}let ge=pe.typeNode,H=de.typeNode,he=pe.isList,Je=(0,st.isTypeNodeListType)(H);if(!this.namedTypesMatch(ge,H)||he!==Je&&!i){u||(this.warnings.push((0,Or.autoMappingTypeMismatchWarning)({subgraphName:this.subgraphName,argumentName:pe.name,fieldCoords:t,argumentType:(0,Lt.printTypeNode)(ge),keyField:me,entityType:n,keyFieldType:(0,Lt.printTypeNode)(H)})),u=!0),S=!1,k=!0;break}if(B||(B=pe.name,K=me),i)if(he){if(Je){S=!1;continue}_.push({entityKeyField:me,argumentPath:[pe.name],isBatch:!0})}else{ee=!0,S=!1;continue}else _.push({entityKeyField:me,argumentPath:[pe.name]})}if(k)continue;let oe=a.filter(de=>!l.has(de.name));if(i&&ee&&oe.length>0&&B&&K){this.warnings.push((0,Or.autoBatchAdditionalNonKeyArgumentWarning)({subgraphName:this.subgraphName,fieldCoords:t,argumentName:B,keyField:K,entityType:n,extraArgument:oe[0].name})),o.length=0,d=!0;continue}if(!S&&_.length>0&&ne){i||this.warnings.push((0,Or.incompleteQueryCacheKeyMappingWarning)({subgraphName:this.subgraphName,fieldCoords:t,entityType:n,unmappedKeyField:ne}));continue}if(S&&_.length>0){if(this.invalidateAutoMappingWithExtraArgument(a,l,new Set(_.map(de=>de.argumentPath[0])),i,t,n,B,K)){o.length=0,d=!0;continue}o.push({entityTypeName:n,fieldMappings:_})}}return o}getValidFlattenedDirectiveArray(t,n,r=!1){let i=[];for(let[a,o]of t){if(r&&M.INHERITABLE_DIRECTIVE_NAMES.has(a))continue;let u=this.directiveDefinitionDataByName.get(a);if(!u)continue;if(!u.isRepeatable&&o.length>1){let p=(0,Be.getValueOrDefault)(this.invalidRepeatedDirectiveNameByCoords,n,()=>new Set);p.has(a)||(p.add(a),this.errors.push((0,$.invalidDirectiveError)(a,n,M.FIRST_ORDINAL,[(0,$.invalidRepeatedDirectiveErrorMessage)(a)])));continue}if(a!==M.KEY){i.push(...o);continue}let l=[],d=new Set;for(let p=0;p0)return W(q({},t.description?{description:t.description}:{}),{directives:this.getValidFlattenedDirectiveArray(t.directivesByName,t.name),kind:Q.Kind.SCHEMA_DEFINITION,operationTypes:n});if(!(t.directivesByName.size<1))return{directives:this.getValidFlattenedDirectiveArray(t.directivesByName,t.name),kind:Q.Kind.SCHEMA_EXTENSION}}getUnionNodeByData(t){return t.node.description=t.description,t.node.directives=this.getValidFlattenedDirectiveArray(t.directivesByName,t.name),t.node.types=(0,Wn.mapToArrayOfValues)(t.memberByMemberTypeName),t.node}evaluateExternalKeyFields(){let t=[];for(let[n,r]of this.keyFieldSetDatasByTypeName){let i=this.parentDefinitionDataByTypeName.get(n);if(!i||i.kind!==Q.Kind.OBJECT_TYPE_DEFINITION&&i.kind!==Q.Kind.INTERFACE_TYPE_DEFINITION){t.push(n),this.errors.push((0,$.undefinedCompositeOutputTypeError)(n));continue}let a=this;for(let o of r.values()){let u=[i],l=new Map,d=-1,p=!0;if((0,Q.visit)(o.documentNode,{Argument:{enter(){return Q.BREAK}},Field:{enter(E){let h=u[d],_=h.name;if(p)return Q.BREAK;let S=E.name.value,k=`${_}.${S}`;a.unvalidatedExternalFieldCoords.delete(k);let B=h.fieldDataByName.get(S);if(!B||B.argumentDataByName.size)return Q.BREAK;B.isShareableBySubgraphName.set(a.subgraphName,!0);let K=B.externalFieldDataBySubgraphName.get(a.subgraphName);a.edfsDirectiveReferences.size<1&&K&&K.isDefinedExternal&&!K.isUnconditionallyProvided&&i.extensionType!==cs.ExtensionType.NONE&&(K.isUnconditionallyProvided=!0,(0,Be.getValueOrDefault)(l,o.rawFieldSet,()=>new Set).add(k)),(0,Be.getValueOrDefault)(a.keyFieldNamesByParentTypeName,_,()=>new Set).add(S);let ne=(0,On.getTypeNodeNamedTypeName)(B.node.type);if(Kr.BASE_SCALARS.has(ne))return;let ee=a.parentDefinitionDataByTypeName.get(ne);if(!ee)return Q.BREAK;if(ee.kind===Q.Kind.OBJECT_TYPE_DEFINITION){p=!0,u.push(ee);return}if((0,Dn.isKindAbstract)(ee.kind))return Q.BREAK}},InlineFragment:{enter(){return Q.BREAK}},SelectionSet:{enter(){if(!p||(d+=1,p=!1,d<0||d>=u.length))return Q.BREAK},leave(){p&&(p=!1),d-=1,u.pop()}}}),!(l.size<1))for(let[E,h]of l)this.warnings.push((0,Or.externalEntityExtensionKeyFieldWarning)(i.name,E,[...h],this.subgraphName))}}for(let n of t)this.keyFieldSetDatasByTypeName.delete(n)}addValidConditionalFieldSetConfigurations(){for(let[t,n]of this.fieldSetDataByTypeName){let r=this.parentDefinitionDataByTypeName.get(t);if(!r||r.kind!==Q.Kind.OBJECT_TYPE_DEFINITION&&r.kind!==Q.Kind.INTERFACE_TYPE_DEFINITION){this.errors.push((0,$.undefinedCompositeOutputTypeError)(t));continue}let i=(0,st.getParentTypeName)(r),a=(0,Be.getValueOrDefault)(this.configurationDataByTypeName,i,()=>(0,zc.newConfigurationData)(!1,i)),o=this.validateProvidesOrRequires(r,n.provides,!0);o&&(a.provides=o);let u=this.validateProvidesOrRequires(r,n.requires,!1);u&&(a.requires=u)}}addFieldNamesToConfigurationData(t,n){let r=new Set;for(let[i,a]of t){let o=a.externalFieldDataBySubgraphName.get(this.subgraphName);if(!o||o.isUnconditionallyProvided){n.fieldNames.add(i);continue}r.add(i),this.edfsDirectiveReferences.size>0&&n.fieldNames.add(i)}r.size>0&&(n.externalFieldNames=r)}validateOneOfDirective({data:t,requiredFieldNames:n}){var r,i;return t.directivesByName.has(M.ONE_OF)?n.size>0?(this.errors.push((0,$.oneOfRequiredFieldsError)({requiredFieldNames:Array.from(n),typeName:t.name})),!1):(t.inputValueDataByName.size===1&&this.warnings.push((0,Or.singleSubgraphInputFieldOneOfWarning)({fieldName:(i=(r=(0,Be.getFirstEntry)(t.inputValueDataByName))==null?void 0:r.name)!=null?i:"unknown",subgraphName:this.subgraphName,typeName:t.name})),!0):!0}normalize(t){var o;(0,kK.upsertDirectiveSchemaAndEntityDefinitions)(this,t),(0,kK.upsertParentsAndChildren)(this,t);let n=[];Al(this,Sh,qK).call(this,n),this.validateDirectives(this.schemaData,M.SCHEMA);let r=this.getSchemaNodeByData(this.schemaData);(r==null?void 0:r.kind)===Q.Kind.SCHEMA_DEFINITION&&n.push(r);for(let[u,l]of this.parentDefinitionDataByTypeName)this.validateDirectives(l,u);this.invalidORScopesCoords.size>0&&this.errors.push((0,$.orScopesLimitError)(Kr.MAX_OR_SCOPES,[...this.invalidORScopesCoords]));for(let u of this.invalidConfigureDescriptionNodeDatas)u.description||this.errors.push((0,$.configureDescriptionNoDescriptionError)((0,Be.kindToNodeType)(u.kind),u.name));this.evaluateExternalKeyFields();for(let[u,l]of this.parentDefinitionDataByTypeName)switch(l.kind){case Q.Kind.ENUM_TYPE_DEFINITION:{if(l.enumValueDataByName.size<1){this.errors.push((0,$.noDefinedEnumValuesError)(u));break}n.push(this.getEnumNodeByData(l));break}case Q.Kind.INPUT_OBJECT_TYPE_DEFINITION:{if(l.inputValueDataByName.size<1){this.errors.push((0,$.noInputValueDefinitionsError)(u));break}let d=new Set;for(let p of l.inputValueDataByName.values()){if((0,st.isTypeRequired)(p.type)&&d.add(p.name),p.namedTypeKind!==Q.Kind.NULL)continue;let E=this.parentDefinitionDataByTypeName.get(p.namedTypeName);if(E){if(this.sanitizeDefaultValue({data:p,namedTypeData:E,node:p.node}),!(0,st.isInputNodeKind)(E.kind)){this.errors.push((0,$.invalidNamedTypeError)({data:p,namedTypeData:E,nodeType:`${(0,Be.kindToNodeType)(l.kind)} field`}));continue}p.namedTypeKind=E.kind}}if(!this.validateOneOfDirective({data:l,requiredFieldNames:d}))break;u!==M.EDFS_NATS_STREAM_CONFIGURATION&&n.push(this.getInputObjectNodeByData(l));break}case Q.Kind.INTERFACE_TYPE_DEFINITION:case Q.Kind.OBJECT_TYPE_DEFINITION:{let d=this.entityDataByTypeName.has(u),p=this.operationTypeNodeByTypeName.get(u),E=l.kind===Q.Kind.OBJECT_TYPE_DEFINITION;this.isSubgraphVersionTwo&&l.extensionType===cs.ExtensionType.EXTENDS&&(l.extensionType=cs.ExtensionType.NONE),p&&(l.fieldDataByName.delete(M.SERVICE_FIELD),l.fieldDataByName.delete(M.ENTITIES_FIELD));let h=[];for(let[K,ne]of l.fieldDataByName){if(!E&&((o=ne.externalFieldDataBySubgraphName.get(this.subgraphName))!=null&&o.isDefinedExternal)&&h.push(K),this.validateArguments(ne,l.kind),ne.namedTypeKind!==Q.Kind.NULL)continue;let ee=this.parentDefinitionDataByTypeName.get(ne.namedTypeName);if(ee){if(!(0,st.isOutputNodeKind)(ee.kind)){this.errors.push((0,$.invalidNamedTypeError)({data:ne,namedTypeData:ee,nodeType:`${(0,Be.kindToNodeType)(l.kind)} field`}));continue}ne.namedTypeKind=this.entityInterfaceDataByTypeName.get(ee.name)?Q.Kind.INTERFACE_TYPE_DEFINITION:ee.kind}}h.length>0&&(this.isSubgraphVersionTwo?this.errors.push((0,$.externalInterfaceFieldsError)(u,h)):this.warnings.push((0,Or.externalInterfaceFieldsWarning)(this.subgraphName,u,[...h])));let _=(0,st.getParentTypeName)(l),S=(0,Be.getValueOrDefault)(this.configurationDataByTypeName,_,()=>(0,zc.newConfigurationData)(d,u)),k=this.entityInterfaceDataByTypeName.get(u);if(k){k.fieldDatas=(0,Wn.fieldDatasToSimpleFieldDatas)(l.fieldDataByName.values());let K=this.concreteTypeNamesByAbstractTypeName.get(u);K&&(0,Be.addIterableToSet)({source:K,target:k.concreteTypeNames}),S.isInterfaceObject=k.isInterfaceObject,S.entityInterfaceConcreteTypeNames=k.concreteTypeNames}let B=this.eventsConfigurations.get(_);B&&(S.events=B),this.addFieldNamesToConfigurationData(l.fieldDataByName,S),this.validateInterfaceImplementations(l),n.push(this.getCompositeOutputNodeByData(l)),l.fieldDataByName.size<1&&!(0,Wr.isNodeQuery)(u,p)&&this.errors.push((0,$.noFieldDefinitionsError)((0,Be.kindToNodeType)(l.kind),u)),l.requireFetchReasonsFieldNames.size>0&&(S.requireFetchReasonsFieldNames=[...l.requireFetchReasonsFieldNames]);break}case Q.Kind.SCALAR_TYPE_DEFINITION:{if(l.extensionType===cs.ExtensionType.REAL){this.errors.push((0,$.noBaseScalarDefinitionError)(u));break}n.push(this.getScalarNodeByData(l));break}case Q.Kind.UNION_TYPE_DEFINITION:{n.push(this.getUnionNodeByData(l)),this.validateUnionMembers(l);break}default:throw(0,$.unexpectedKindFatalError)(u)}this.isSubgraphEventDrivenGraph=this.edfsDirectiveReferences.size>0,this.addValidConditionalFieldSetConfigurations(),this.addValidKeyFieldSetConfigurations(),this.extractRequestScopedFields(),this.validateAndExtractEntityCachingConfigs();for(let u of Object.values(Q.OperationTypeNode)){let l=this.schemaData.operationTypes.get(u),d=(0,Be.getOrThrowError)(Dn.operationTypeNodeToDefaultType,u,M.OPERATION_TO_DEFAULT),p=l?(0,On.getTypeNodeNamedTypeName)(l.type):d;if(Kr.BASE_SCALARS.has(p)&&this.referencedTypeNames.add(p),p!==d&&this.parentDefinitionDataByTypeName.has(d)){this.errors.push((0,$.invalidRootTypeDefinitionError)(u,p,d));continue}let E=this.parentDefinitionDataByTypeName.get(p);if(l){if(!E)continue;this.operationTypeNodeByTypeName.set(p,u)}if(!E)continue;let h=this.configurationDataByTypeName.get(d);h&&(h.isRootNode=!0,h.typeName=d),E.kind!==Q.Kind.OBJECT_TYPE_DEFINITION&&this.errors.push((0,$.operationDefinitionError)(p,u,E.kind))}for(let u of this.referencedTypeNames){let l=this.parentDefinitionDataByTypeName.get(u);if(!l){this.errors.push((0,$.undefinedTypeError)(u));continue}if(l.kind!==Q.Kind.INTERFACE_TYPE_DEFINITION)continue;let d=this.concreteTypeNamesByAbstractTypeName.get(u);(!d||d.size<1)&&this.warnings.push((0,Or.unimplementedInterfaceOutputTypeWarning)(this.subgraphName,u))}let i=new Map;for(let u of this.directiveDefinitionByName.values()){let l=(0,Dn.extractExecutableDirectiveLocations)(u.locations,new Set);l.size<1||this.addPersistedDirectiveDefinitionDataByNode(i,u,l)}this.isSubgraphEventDrivenGraph&&this.validateEventDrivenSubgraph();for(let u of this.unvalidatedExternalFieldCoords)this.isSubgraphVersionTwo?this.errors.push((0,$.invalidExternalDirectiveError)(u)):this.warnings.push((0,Or.invalidExternalFieldWarning)(u,this.subgraphName));if(this.errors.length>0)return{success:!1,errors:this.errors,warnings:this.warnings};let a={kind:Q.Kind.DOCUMENT,definitions:n};return{authorizationDataByParentTypeName:this.authorizationDataByParentTypeName,concreteTypeNamesByAbstractTypeName:this.concreteTypeNamesByAbstractTypeName,conditionalFieldDataByCoordinates:this.conditionalFieldDataByCoords,configurationDataByTypeName:this.configurationDataByTypeName,costs:this.costs,directiveDefinitionByName:this.directiveDefinitionByName,entityDataByTypeName:this.entityDataByTypeName,entityInterfaces:this.entityInterfaceDataByTypeName,fieldCoordsByNamedTypeName:this.fieldCoordsByNamedTypeName,interfaceImplementationTypeNamesByInterfaceTypeName:this.interfaceImplementationTypeNamesByInterfaceTypeName,isEventDrivenGraph:this.isSubgraphEventDrivenGraph,isVersionTwo:this.isSubgraphVersionTwo,keyFieldNamesByParentTypeName:this.keyFieldNamesByParentTypeName,keyFieldSetsByEntityTypeNameByKeyFieldCoords:this.keyFieldSetsByEntityTypeNameByFieldCoords,operationTypes:this.operationTypeNodeByTypeName,originalTypeNameByRenamedTypeName:this.originalTypeNameByRenamedTypeName,overridesByTargetSubgraphName:this.overridesByTargetSubgraphName,parentDefinitionDataByTypeName:this.parentDefinitionDataByTypeName,persistedDirectiveDefinitionDataByDirectiveName:i,schemaNode:r,subgraphAST:a,subgraphString:(0,Q.print)(a),schema:(0,kfe.buildASTSchema)(a,{addInvalidExtensionOrphans:!0,assumeValid:!0,assumeValidSDL:!0}),success:!0,warnings:this.warnings}}};Bf=new WeakSet,Lb=function({currentFieldCoords:t,directiveCoords:n,directiveName:r,fieldSet:i}){if(this.isSubgraphVersionTwo){this.errors.push((0,$.nonExternalConditionalFieldError)({directiveCoords:n,directiveName:r,fieldSet:i,subgraphName:this.subgraphName,targetCoords:t}));return}this.warnings.push((0,Or.nonExternalConditionalFieldWarning)(n,this.subgraphName,t,i,r))},Sh=new WeakSet,qK=function(t){let n=new Set;for(let r of this.referencedDirectiveNames){let i=Kr.DIRECTIVE_DEFINITION_BY_NAME.get(r);i&&(this.directiveDefinitionByName.set(r,i),(0,Be.addOptionalIterableToSet)({source:Cf.DEPENDENCIES_BY_DIRECTIVE_NAME.get(r),target:n}),t.push(i))}for(let r of this.customDirectiveDefinitionByName.values())t.push(r);t.push(...n)};Wc.NormalizationFactory=Uf;function Vfe({options:e,subgraphs:t}){let n=new Map,r=new Map,i=new Map,a=new Map,o=new Map,u=new Map,l=new Map,d=new Set,p=new Map,E=new Set,h=new Set,_=[],S=new Set,k=new Map,B=[],K=[];for(let oe of t)oe.name&&(0,Mfe.recordSubgraphName)(oe.name,E,h);let ne=new wb.Graph;for(let oe=0;oe0&&B.push(...pe.warnings),!pe.success){K.push((0,$.subgraphValidationError)(me,pe.errors));continue}if(!pe){K.push((0,$.subgraphValidationError)(me,[$.subgraphValidationFailureError]));continue}p.set(me,pe.parentDefinitionDataByTypeName);for(let ge of pe.authorizationDataByParentTypeName.values())(0,Wn.upsertAuthorizationData)(n,ge,S);for(let[ge,H]of pe.fieldCoordsByNamedTypeName)(0,Be.addIterableToSet)({source:H,target:(0,Be.getValueOrDefault)(k,ge,()=>new Set)});for(let[ge,H]of pe.concreteTypeNamesByAbstractTypeName){let he=r.get(ge);if(!he){r.set(ge,new Set(H));continue}(0,Be.addIterableToSet)({source:H,target:he})}for(let[ge,H]of pe.interfaceImplementationTypeNamesByInterfaceTypeName){let he=a.get(ge);if(!he){a.set(ge,new Set(H));continue}(0,Be.addIterableToSet)({source:H,target:he})}for(let[ge,H]of pe.entityDataByTypeName){let he=H.keyFieldSetDatasBySubgraphName.get(me);he&&(0,Wn.upsertEntityData)({entityDataByTypeName:i,keyFieldSetDataByFieldSet:he,typeName:ge,subgraphName:me})}if(de.name&&o.set(me,{conditionalFieldDataByCoordinates:pe.conditionalFieldDataByCoordinates,configurationDataByTypeName:pe.configurationDataByTypeName,costs:pe.costs,definitions:pe.subgraphAST,directiveDefinitionByName:pe.directiveDefinitionByName,entityInterfaces:pe.entityInterfaces,isVersionTwo:pe.isVersionTwo,keyFieldNamesByParentTypeName:pe.keyFieldNamesByParentTypeName,name:me,operationTypes:pe.operationTypes,overriddenFieldNamesByParentTypeName:new Map,parentDefinitionDataByTypeName:pe.parentDefinitionDataByTypeName,persistedDirectiveDefinitionDataByDirectiveName:pe.persistedDirectiveDefinitionDataByDirectiveName,schema:pe.schema,schemaNode:pe.schemaNode,url:de.url}),!(pe.overridesByTargetSubgraphName.size<1))for(let[ge,H]of pe.overridesByTargetSubgraphName){let he=E.has(ge);for(let[Je,Qt]of H){let _n=pe.originalTypeNameByRenamedTypeName.get(Je)||Je;if(!he)B.push((0,Or.invalidOverrideTargetSubgraphNameWarning)(ge,_n,[...Qt],de.name));else{let hn=(0,Be.getValueOrDefault)(u,ge,()=>new Map),bt=(0,Be.getValueOrDefault)(hn,Je,()=>new Set(Qt));(0,Be.addIterableToSet)({source:Qt,target:bt})}for(let hn of Qt){let bt=`${_n}.${hn}`,Yt=l.get(bt);if(!Yt){l.set(bt,[me]);continue}Yt.push(me),d.add(bt)}}}}let ee=[];if(S.size>0&&ee.push((0,$.orScopesLimitError)(Kr.MAX_OR_SCOPES,[...S])),(_.length>0||h.size>0)&&ee.push((0,$.invalidSubgraphNamesError)([...h],_)),d.size>0){let oe=[];for(let de of d){let me=(0,Be.getOrThrowError)(l,de,"overrideSourceSubgraphNamesByFieldPath");oe.push((0,$.duplicateOverriddenFieldErrorMessage)(de,me))}ee.push((0,$.duplicateOverriddenFieldsError)(oe))}if(ee.push(...K),ee.length>0)return{errors:ee,success:!1,warnings:B};for(let[oe,de]of u){let me=(0,Be.getOrThrowError)(o,oe,"internalSubgraphBySubgraphName");me.overriddenFieldNamesByParentTypeName=de;for(let[pe,ge]of de){let H=me.configurationDataByTypeName.get(pe);H&&((0,Wn.subtractSet)(ge,H.fieldNames),H.fieldNames.size<1&&me.configurationDataByTypeName.delete(pe))}}return{authorizationDataByParentTypeName:n,concreteTypeNamesByAbstractTypeName:r,entityDataByTypeName:i,fieldCoordsByNamedTypeName:k,interfaceImplementationTypeNamesByInterfaceTypeName:a,internalSubgraphBySubgraphName:o,internalGraph:ne,success:!0,warnings:B}}});var Oh=F(el=>{"use strict";m();T();N();Object.defineProperty(el,"__esModule",{value:!0});el.DivergentType=void 0;el.getLeastRestrictiveMergedTypeNode=jfe;el.getMostRestrictiveMergedTypeNode=$fe;el.renameNamedTypeName=Gfe;var Xc=Oe(),KK=Ji(),Kfe=Uu(),VK=kr(),jK=Wl(),Zc;(function(e){e[e.NONE=0]="NONE",e[e.CURRENT=1]="CURRENT",e[e.OTHER=2]="OTHER"})(Zc||(el.DivergentType=Zc={}));function $K(e,t,n,r,i){t=(0,Kfe.getMutableTypeNode)(t,n,i);let a={kind:e.kind},o=Zc.NONE,u=a;for(let l=0;l{"use strict";m();T();N();Object.defineProperty(Bb,"__esModule",{value:!0});Bb.renameRootTypes=Jfe;var Qfe=Oe(),Ub=kr(),Yfe=Oh(),Qu=Zn(),tl=Mr();function Jfe(e,t){let n,r=!1,i;(0,Qfe.visit)(t.definitions,{FieldDefinition:{enter(a){let o=a.name.value;if(r&&(o===Qu.SERVICE_FIELD||o===Qu.ENTITIES_FIELD))return n.fieldDataByName.delete(o),!1;let u=n.name,l=(0,tl.getOrThrowError)(n.fieldDataByName,o,`${u}.fieldDataByFieldName`),d=t.operationTypes.get(l.namedTypeName);if(d){let p=(0,tl.getOrThrowError)(Ub.operationTypeNodeToDefaultType,d,Qu.OPERATION_TO_DEFAULT);l.namedTypeName!==p&&(0,Yfe.renameNamedTypeName)(l,p,e.errors)}return i!=null&&i.has(o)&&l.isShareableBySubgraphName.delete(t.name),!1}},InterfaceTypeDefinition:{enter(a){let o=a.name.value;if(!e.entityInterfaceFederationDataByTypeName.get(o))return!1;n=(0,tl.getOrThrowError)(t.parentDefinitionDataByTypeName,o,Qu.PARENT_DEFINITION_DATA)},leave(){n=void 0}},ObjectTypeDefinition:{enter(a){let o=a.name.value,u=t.operationTypes.get(o),l=u?(0,tl.getOrThrowError)(Ub.operationTypeNodeToDefaultType,u,Qu.OPERATION_TO_DEFAULT):o;n=(0,tl.getOrThrowError)(t.parentDefinitionDataByTypeName,o,Qu.PARENT_DEFINITION_DATA),r=n.isRootType,!e.entityInterfaceFederationDataByTypeName.get(o)&&(e.addValidPrimaryKeyTargetsToEntityData(o),i=t.overriddenFieldNamesByParentTypeName.get(l),o!==l&&(n.name=l,t.parentDefinitionDataByTypeName.set(l,n),t.parentDefinitionDataByTypeName.delete(o)))},leave(){n=void 0,r=!1,i=void 0}},ObjectTypeExtension:{enter(a){let o=a.name.value,u=t.operationTypes.get(o),l=u?(0,tl.getOrThrowError)(Ub.operationTypeNodeToDefaultType,u,Qu.OPERATION_TO_DEFAULT):o;n=(0,tl.getOrThrowError)(t.parentDefinitionDataByTypeName,o,Qu.PARENT_DEFINITION_DATA),r=n.isRootType,e.addValidPrimaryKeyTargetsToEntityData(o),i=t.overriddenFieldNamesByParentTypeName.get(o),o!==l&&(n.name=l,t.parentDefinitionDataByTypeName.set(l,n),t.parentDefinitionDataByTypeName.delete(o))},leave(){n=void 0,r=!1,i=void 0}}})}});var GK=F((Ad,kf)=>{"use strict";m();T();N();(function(){var e,t="4.17.21",n=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid `variable` option passed into `_.template`",o="__lodash_hash_undefined__",u=500,l="__lodash_placeholder__",d=1,p=2,E=4,h=1,_=2,S=1,k=2,B=4,K=8,ne=16,ee=32,oe=64,de=128,me=256,pe=512,ge=30,H="...",he=800,Je=16,Qt=1,_n=2,hn=3,bt=1/0,Yt=9007199254740991,jr=17976931348623157e292,or=NaN,yn=4294967295,tn=yn-1,kn=yn>>>1,ce=[["ary",de],["bind",S],["bindKey",k],["curry",K],["curryRight",ne],["flip",pe],["partial",ee],["partialRight",oe],["rearg",me]],Le="[object Arguments]",Se="[object Array]",Me="[object AsyncFunction]",Pt="[object Boolean]",Z="[object Date]",ue="[object DOMException]",je="[object Error]",We="[object Function]",Vt="[object GeneratorFunction]",ot="[object Map]",Bt="[object Number]",ms="[object Null]",ti="[object Object]",Ns="[object Promise]",ml="[object Proxy]",ka="[object RegExp]",Dr="[object Set]",mi="[object String]",Jt="[object Symbol]",br="[object Undefined]",Zu="[object WeakMap]",Ma="[object WeakSet]",ec="[object ArrayBuffer]",P="[object DataView]",g="[object Float32Array]",v="[object Float64Array]",x="[object Int8Array]",z="[object Int16Array]",ie="[object Int32Array]",fe="[object Uint8Array]",gt="[object Uint8ClampedArray]",In="[object Uint16Array]",cn="[object Uint32Array]",bn=/\b__p \+= '';/g,on=/\b(__p \+=) '' \+/g,Cj=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xA=/&(?:amp|lt|gt|quot|#39);/g,qA=/[&<>"']/g,Uj=RegExp(xA.source),Bj=RegExp(qA.source),kj=/<%-([\s\S]+?)%>/g,Mj=/<%([\s\S]+?)%>/g,VA=/<%=([\s\S]+?)%>/g,xj=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qj=/^\w*$/,Vj=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ty=/[\\^$.*+?()[\]{}|]/g,Kj=RegExp(ty.source),ny=/^\s+/,jj=/\s/,$j=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Gj=/\{\n\/\* \[wrapped with (.+)\] \*/,Qj=/,? & /,Yj=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Jj=/[()=,{}\[\]\/\s]/,Hj=/\\(\\)?/g,zj=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,KA=/\w*$/,Wj=/^[-+]0x[0-9a-f]+$/i,Xj=/^0b[01]+$/i,Zj=/^\[object .+?Constructor\]$/,e$=/^0o[0-7]+$/i,t$=/^(?:0|[1-9]\d*)$/,n$=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,gm=/($^)/,r$=/['\n\r\u2028\u2029\\]/g,_m="\\ud800-\\udfff",i$="\\u0300-\\u036f",a$="\\ufe20-\\ufe2f",s$="\\u20d0-\\u20ff",jA=i$+a$+s$,$A="\\u2700-\\u27bf",GA="a-z\\xdf-\\xf6\\xf8-\\xff",o$="\\xac\\xb1\\xd7\\xf7",u$="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",c$="\\u2000-\\u206f",l$=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",QA="A-Z\\xc0-\\xd6\\xd8-\\xde",YA="\\ufe0e\\ufe0f",JA=o$+u$+c$+l$,ry="['\u2019]",d$="["+_m+"]",HA="["+JA+"]",vm="["+jA+"]",zA="\\d+",p$="["+$A+"]",WA="["+GA+"]",XA="[^"+_m+JA+zA+$A+GA+QA+"]",iy="\\ud83c[\\udffb-\\udfff]",f$="(?:"+vm+"|"+iy+")",ZA="[^"+_m+"]",ay="(?:\\ud83c[\\udde6-\\uddff]){2}",sy="[\\ud800-\\udbff][\\udc00-\\udfff]",Nl="["+QA+"]",e0="\\u200d",t0="(?:"+WA+"|"+XA+")",m$="(?:"+Nl+"|"+XA+")",n0="(?:"+ry+"(?:d|ll|m|re|s|t|ve))?",r0="(?:"+ry+"(?:D|LL|M|RE|S|T|VE))?",i0=f$+"?",a0="["+YA+"]?",N$="(?:"+e0+"(?:"+[ZA,ay,sy].join("|")+")"+a0+i0+")*",T$="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",E$="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",s0=a0+i0+N$,h$="(?:"+[p$,ay,sy].join("|")+")"+s0,y$="(?:"+[ZA+vm+"?",vm,ay,sy,d$].join("|")+")",I$=RegExp(ry,"g"),g$=RegExp(vm,"g"),oy=RegExp(iy+"(?="+iy+")|"+y$+s0,"g"),_$=RegExp([Nl+"?"+WA+"+"+n0+"(?="+[HA,Nl,"$"].join("|")+")",m$+"+"+r0+"(?="+[HA,Nl+t0,"$"].join("|")+")",Nl+"?"+t0+"+"+n0,Nl+"+"+r0,E$,T$,zA,h$].join("|"),"g"),v$=RegExp("["+e0+_m+jA+YA+"]"),S$=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,O$=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],D$=-1,vn={};vn[g]=vn[v]=vn[x]=vn[z]=vn[ie]=vn[fe]=vn[gt]=vn[In]=vn[cn]=!0,vn[Le]=vn[Se]=vn[ec]=vn[Pt]=vn[P]=vn[Z]=vn[je]=vn[We]=vn[ot]=vn[Bt]=vn[ti]=vn[ka]=vn[Dr]=vn[mi]=vn[Zu]=!1;var gn={};gn[Le]=gn[Se]=gn[ec]=gn[P]=gn[Pt]=gn[Z]=gn[g]=gn[v]=gn[x]=gn[z]=gn[ie]=gn[ot]=gn[Bt]=gn[ti]=gn[ka]=gn[Dr]=gn[mi]=gn[Jt]=gn[fe]=gn[gt]=gn[In]=gn[cn]=!0,gn[je]=gn[We]=gn[Zu]=!1;var b$={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},A$={"&":"&","<":"<",">":">",'"':""","'":"'"},R$={"&":"&","<":"<",">":">",""":'"',"'":"'"},P$={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},F$=parseFloat,L$=parseInt,o0=typeof global=="object"&&global&&global.Object===Object&&global,w$=typeof self=="object"&&self&&self.Object===Object&&self,Tr=o0||w$||Function("return this")(),uy=typeof Ad=="object"&&Ad&&!Ad.nodeType&&Ad,tc=uy&&typeof kf=="object"&&kf&&!kf.nodeType&&kf,u0=tc&&tc.exports===uy,cy=u0&&o0.process,Ai=function(){try{var X=tc&&tc.require&&tc.require("util").types;return X||cy&&cy.binding&&cy.binding("util")}catch(le){}}(),c0=Ai&&Ai.isArrayBuffer,l0=Ai&&Ai.isDate,d0=Ai&&Ai.isMap,p0=Ai&&Ai.isRegExp,f0=Ai&&Ai.isSet,m0=Ai&&Ai.isTypedArray;function Ni(X,le,ae){switch(ae.length){case 0:return X.call(le);case 1:return X.call(le,ae[0]);case 2:return X.call(le,ae[0],ae[1]);case 3:return X.call(le,ae[0],ae[1],ae[2])}return X.apply(le,ae)}function C$(X,le,ae,xe){for(var Tt=-1,Xt=X==null?0:X.length;++Tt-1}function ly(X,le,ae){for(var xe=-1,Tt=X==null?0:X.length;++xe-1;);return ae}function _0(X,le){for(var ae=X.length;ae--&&Tl(le,X[ae],0)>-1;);return ae}function j$(X,le){for(var ae=X.length,xe=0;ae--;)X[ae]===le&&++xe;return xe}var $$=my(b$),G$=my(A$);function Q$(X){return"\\"+P$[X]}function Y$(X,le){return X==null?e:X[le]}function El(X){return v$.test(X)}function J$(X){return S$.test(X)}function H$(X){for(var le,ae=[];!(le=X.next()).done;)ae.push(le.value);return ae}function hy(X){var le=-1,ae=Array(X.size);return X.forEach(function(xe,Tt){ae[++le]=[Tt,xe]}),ae}function v0(X,le){return function(ae){return X(le(ae))}}function Nu(X,le){for(var ae=-1,xe=X.length,Tt=0,Xt=[];++ae-1}function BG(s,c){var f=this.__data__,I=Vm(f,s);return I<0?(++this.size,f.push([s,c])):f[I][1]=c,this}Ts.prototype.clear=LG,Ts.prototype.delete=wG,Ts.prototype.get=CG,Ts.prototype.has=UG,Ts.prototype.set=BG;function Es(s){var c=-1,f=s==null?0:s.length;for(this.clear();++c=c?s:c)),s}function Li(s,c,f,I,O,C){var V,Y=c&d,te=c&p,Ne=c&E;if(f&&(V=O?f(s,I,O,C):f(s)),V!==e)return V;if(!wn(s))return s;var Te=ht(s);if(Te){if(V=qQ(s),!Y)return ni(s,V)}else{var Ie=Lr(s),we=Ie==We||Ie==Vt;if(_u(s))return aR(s,Y);if(Ie==ti||Ie==Le||we&&!O){if(V=te||we?{}:SR(s),!Y)return te?RQ(s,XG(V,s)):AQ(s,U0(V,s))}else{if(!gn[Ie])return O?s:{};V=VQ(s,Ie,Y)}}C||(C=new ca);var Ge=C.get(s);if(Ge)return Ge;C.set(s,V),ZR(s)?s.forEach(function(it){V.add(Li(it,c,f,it,s,C))}):WR(s)&&s.forEach(function(it,Ft){V.set(Ft,Li(it,c,f,Ft,s,C))});var rt=Ne?te?$y:jy:te?ii:Er,St=Te?e:rt(s);return Ri(St||s,function(it,Ft){St&&(Ft=it,it=s[Ft]),Yd(V,Ft,Li(it,c,f,Ft,s,C))}),V}function ZG(s){var c=Er(s);return function(f){return B0(f,s,c)}}function B0(s,c,f){var I=f.length;if(s==null)return!I;for(s=Nn(s);I--;){var O=f[I],C=c[O],V=s[O];if(V===e&&!(O in s)||!C(V))return!1}return!0}function k0(s,c,f){if(typeof s!="function")throw new Pi(i);return ep(function(){s.apply(e,f)},c)}function Jd(s,c,f,I){var O=-1,C=Sm,V=!0,Y=s.length,te=[],Ne=c.length;if(!Y)return te;f&&(c=An(c,Ti(f))),I?(C=ly,V=!1):c.length>=n&&(C=Vd,V=!1,c=new ic(c));e:for(;++OO?0:O+f),I=I===e||I>O?O:_t(I),I<0&&(I+=O),I=f>I?0:tP(I);f0&&f(Y)?c>1?Ar(Y,c-1,f,I,O):mu(O,Y):I||(O[O.length]=Y)}return O}var Oy=dR(),q0=dR(!0);function xa(s,c){return s&&Oy(s,c,Er)}function Dy(s,c){return s&&q0(s,c,Er)}function jm(s,c){return fu(c,function(f){return _s(s[f])})}function sc(s,c){c=Iu(c,s);for(var f=0,I=c.length;s!=null&&fc}function nQ(s,c){return s!=null&&un.call(s,c)}function rQ(s,c){return s!=null&&c in Nn(s)}function iQ(s,c,f){return s>=Fr(c,f)&&s=120&&Te.length>=120)?new ic(V&&Te):e}Te=s[0];var Ie=-1,we=Y[0];e:for(;++Ie-1;)Y!==s&&Cm.call(Y,te,1),Cm.call(s,te,1);return s}function W0(s,c){for(var f=s?c.length:0,I=f-1;f--;){var O=c[f];if(f==I||O!==C){var C=O;gs(O)?Cm.call(s,O,1):By(s,O)}}return s}function wy(s,c){return s+km(F0()*(c-s+1))}function EQ(s,c,f,I){for(var O=-1,C=cr(Bm((c-s)/(f||1)),0),V=ae(C);C--;)V[I?C:++O]=s,s+=f;return V}function Cy(s,c){var f="";if(!s||c<1||c>Yt)return f;do c%2&&(f+=s),c=km(c/2),c&&(s+=s);while(c);return f}function Ot(s,c){return Wy(bR(s,c,ai),s+"")}function hQ(s){return C0(bl(s))}function yQ(s,c){var f=bl(s);return eN(f,ac(c,0,f.length))}function Wd(s,c,f,I){if(!wn(s))return s;c=Iu(c,s);for(var O=-1,C=c.length,V=C-1,Y=s;Y!=null&&++OO?0:O+c),f=f>O?O:f,f<0&&(f+=O),O=c>f?0:f-c>>>0,c>>>=0;for(var C=ae(O);++I>>1,V=s[C];V!==null&&!hi(V)&&(f?V<=c:V=n){var Ne=c?null:wQ(s);if(Ne)return Dm(Ne);V=!1,O=Vd,te=new ic}else te=c?[]:Y;e:for(;++I=I?s:wi(s,c,f)}var iR=lG||function(s){return Tr.clearTimeout(s)};function aR(s,c){if(c)return s.slice();var f=s.length,I=D0?D0(f):new s.constructor(f);return s.copy(I),I}function qy(s){var c=new s.constructor(s.byteLength);return new Lm(c).set(new Lm(s)),c}function SQ(s,c){var f=c?qy(s.buffer):s.buffer;return new s.constructor(f,s.byteOffset,s.byteLength)}function OQ(s){var c=new s.constructor(s.source,KA.exec(s));return c.lastIndex=s.lastIndex,c}function DQ(s){return Qd?Nn(Qd.call(s)):{}}function sR(s,c){var f=c?qy(s.buffer):s.buffer;return new s.constructor(f,s.byteOffset,s.length)}function oR(s,c){if(s!==c){var f=s!==e,I=s===null,O=s===s,C=hi(s),V=c!==e,Y=c===null,te=c===c,Ne=hi(c);if(!Y&&!Ne&&!C&&s>c||C&&V&&te&&!Y&&!Ne||I&&V&&te||!f&&te||!O)return 1;if(!I&&!C&&!Ne&&s=Y)return te;var Ne=f[I];return te*(Ne=="desc"?-1:1)}}return s.index-c.index}function uR(s,c,f,I){for(var O=-1,C=s.length,V=f.length,Y=-1,te=c.length,Ne=cr(C-V,0),Te=ae(te+Ne),Ie=!I;++Y1?f[O-1]:e,V=O>2?f[2]:e;for(C=s.length>3&&typeof C=="function"?(O--,C):e,V&&Gr(f[0],f[1],V)&&(C=O<3?e:C,O=1),c=Nn(c);++I-1?O[C?c[V]:V]:e}}function mR(s){return Is(function(c){var f=c.length,I=f,O=Fi.prototype.thru;for(s&&c.reverse();I--;){var C=c[I];if(typeof C!="function")throw new Pi(i);if(O&&!V&&Xm(C)=="wrapper")var V=new Fi([],!0)}for(I=V?I:f;++I1&&kt.reverse(),Te&&teY))return!1;var Ne=C.get(s),Te=C.get(c);if(Ne&&Te)return Ne==c&&Te==s;var Ie=-1,we=!0,Ge=f&_?new ic:e;for(C.set(s,c),C.set(c,s);++Ie1?"& ":"")+c[I],c=c.join(f>2?", ":" "),s.replace($j,`{ /* [wrapped with `+c+`] */ -`)}function RQ(s){return pt(s)||tc(s)||!!(f0&&s&&s[f0])}function gs(s,c){var f=typeof s;return c=c==null?Kt:c,!!c&&(f=="number"||f!="symbol"&&VK.test(s))&&s>-1&&s%1==0&&s0){if(++c>=ge)return arguments[0]}else c=0;return s.apply(e,arguments)}}function qm(s,c){var f=-1,y=s.length,S=y-1;for(c=c===e?y:c;++f1?s[c-1]:e;return f=typeof f=="function"?(s.pop(),f):e,_R(s,f)});function vR(s){var c=w(s);return c.__chain__=!0,c}function qY(s,c){return c(s),s}function Vm(s,c){return c(s)}var VY=Is(function(s){var c=s.length,f=c?s[0]:0,y=this.__wrapped__,S=function(L){return ly(L,s)};return c>1||this.__actions__.length||!(y instanceof Pt)||!gs(f)?this.thru(S):(y=y.slice(f,+f+(c?1:0)),y.__actions__.push({func:Vm,args:[S],thisArg:e}),new Ri(y,this.__chain__).thru(function(L){return c&&!L.length&&L.push(e),L}))});function jY(){return vR(this)}function KY(){return new Ri(this.value(),this.__chain__)}function $Y(){this.__values__===e&&(this.__values__=kR(this.value()));var s=this.__index__>=this.__values__.length,c=s?e:this.__values__[this.__index__++];return{done:s,value:c}}function GY(){return this}function QY(s){for(var c,f=this;f instanceof Dm;){var y=TR(f);y.__index__=0,y.__values__=e,c?S.__wrapped__=y:c=y;var S=y;f=f.__wrapped__}return S.__wrapped__=s,c}function YY(){var s=this.__wrapped__;if(s instanceof Pt){var c=s;return this.__actions__.length&&(c=new Pt(this)),c=c.reverse(),c.__actions__.push({func:Vm,args:[My],thisArg:e}),new Ri(c,this.__chain__)}return this.thru(My)}function JY(){return x0(this.__wrapped__,this.__actions__)}var zY=Lm(function(s,c,f){on.call(s,f)?++s[f]:hs(s,f,1)});function HY(s,c,f){var y=pt(s)?XA:qG;return f&&jr(s,c,f)&&(c=e),y(s,et(c,3))}function WY(s,c){var f=pt(s)?su:_0;return f(s,et(c,3))}var XY=H0(ER),ZY=H0(hR);function e2(s,c){return vr(jm(s,c),1)}function t2(s,c){return vr(jm(s,c),Ot)}function n2(s,c,f){return f=f===e?1:ht(f),vr(jm(s,c),f)}function SR(s,c){var f=pt(s)?bi:du;return f(s,et(c,3))}function OR(s,c){var f=pt(s)?g$:g0;return f(s,et(c,3))}var r2=Lm(function(s,c,f){on.call(s,f)?s[f].push(c):hs(s,f,[c])});function i2(s,c,f,y){s=Zr(s)?s:hl(s),f=f&&!y?ht(f):0;var S=s.length;return f<0&&(f=ar(S+f,0)),Ym(s)?f<=S&&s.indexOf(c,f)>-1:!!S&&ol(s,c,f)>-1}var a2=vt(function(s,c,f){var y=-1,S=typeof c=="function",L=Zr(s)?te(s.length):[];return du(s,function(x){L[++y]=S?fi(c,x,f):Vd(x,c,f)}),L}),s2=Lm(function(s,c,f){hs(s,f,c)});function jm(s,c){var f=pt(s)?Sn:A0;return f(s,et(c,3))}function o2(s,c,f,y){return s==null?[]:(pt(c)||(c=c==null?[]:[c]),f=y?e:f,pt(f)||(f=f==null?[]:[f]),w0(s,c,f))}var u2=Lm(function(s,c,f){s[f?0:1].push(c)},function(){return[[],[]]});function c2(s,c,f){var y=pt(s)?Wh:n0,S=arguments.length<3;return y(s,et(c,4),f,S,du)}function l2(s,c,f){var y=pt(s)?_$:n0,S=arguments.length<3;return y(s,et(c,4),f,S,g0)}function d2(s,c){var f=pt(s)?su:_0;return f(s,Gm(et(c,3)))}function f2(s){var c=pt(s)?E0:iQ;return c(s)}function p2(s,c,f){(f?jr(s,c,f):c===e)?c=1:c=ht(c);var y=pt(s)?UG:aQ;return y(s,c)}function m2(s){var c=pt(s)?BG:oQ;return c(s)}function N2(s){if(s==null)return 0;if(Zr(s))return Ym(s)?cl(s):s.length;var c=Rr(s);return c==it||c==gr?s.size:Ty(s).length}function T2(s,c,f){var y=pt(s)?Xh:uQ;return f&&jr(s,c,f)&&(c=e),y(s,et(c,3))}var E2=vt(function(s,c){if(s==null)return[];var f=c.length;return f>1&&jr(s,c[0],c[1])?c=[]:f>2&&jr(c[0],c[1],c[2])&&(c=[c[0]]),w0(s,vr(c,1),[])}),Km=W$||function(){return fr.Date.now()};function h2(s,c){if(typeof c!="function")throw new Ai(i);return s=ht(s),function(){if(--s<1)return c.apply(this,arguments)}}function DR(s,c,f){return c=f?e:c,c=s&&c==null?s.length:c,ys(s,Ee,e,e,e,e,c)}function bR(s,c){var f;if(typeof c!="function")throw new Ai(i);return s=ht(s),function(){return--s>0&&(f=c.apply(this,arguments)),s<=1&&(c=e),f}}var qy=vt(function(s,c,f){var y=A;if(f.length){var S=uu(f,Tl(qy));y|=ie}return ys(s,y,c,f,S)}),AR=vt(function(s,c,f){var y=A|B;if(f.length){var S=uu(f,Tl(AR));y|=ie}return ys(c,y,s,f,S)});function RR(s,c,f){c=f?e:c;var y=ys(s,J,e,e,e,e,e,c);return y.placeholder=RR.placeholder,y}function PR(s,c,f){c=f?e:c;var y=ys(s,re,e,e,e,e,e,c);return y.placeholder=PR.placeholder,y}function FR(s,c,f){var y,S,L,x,j,H,de=0,fe=!1,Te=!1,Re=!0;if(typeof s!="function")throw new Ai(i);c=Li(c)||0,An(f)&&(fe=!!f.leading,Te="maxWait"in f,L=Te?ar(Li(f.maxWait)||0,c):L,Re="trailing"in f?!!f.trailing:Re);function Ge(Vn){var ca=y,Ss=S;return y=S=e,de=Vn,x=s.apply(Ss,ca),x}function tt(Vn){return de=Vn,j=Qd(At,c),fe?Ge(Vn):x}function gt(Vn){var ca=Vn-H,Ss=Vn-de,HR=c-ca;return Te?Ar(HR,L-Ss):HR}function nt(Vn){var ca=Vn-H,Ss=Vn-de;return H===e||ca>=c||ca<0||Te&&Ss>=L}function At(){var Vn=Km();if(nt(Vn))return Ct(Vn);j=Qd(At,gt(Vn))}function Ct(Vn){return j=e,Re&&y?Ge(Vn):(y=S=e,x)}function Ti(){j!==e&&V0(j),de=0,y=H=S=j=e}function Kr(){return j===e?x:Ct(Km())}function Ei(){var Vn=Km(),ca=nt(Vn);if(y=arguments,S=this,H=Vn,ca){if(j===e)return tt(H);if(Te)return V0(j),j=Qd(At,c),Ge(H)}return j===e&&(j=Qd(At,c)),x}return Ei.cancel=Ti,Ei.flush=Kr,Ei}var y2=vt(function(s,c){return I0(s,1,c)}),I2=vt(function(s,c,f){return I0(s,Li(c)||0,f)});function g2(s){return ys(s,ye)}function $m(s,c){if(typeof s!="function"||c!=null&&typeof c!="function")throw new Ai(i);var f=function(){var y=arguments,S=c?c.apply(this,y):y[0],L=f.cache;if(L.has(S))return L.get(S);var x=s.apply(this,y);return f.cache=L.set(S,x)||L,x};return f.cache=new($m.Cache||Es),f}$m.Cache=Es;function Gm(s){if(typeof s!="function")throw new Ai(i);return function(){var c=arguments;switch(c.length){case 0:return!s.call(this);case 1:return!s.call(this,c[0]);case 2:return!s.call(this,c[0],c[1]);case 3:return!s.call(this,c[0],c[1],c[2])}return!s.apply(this,c)}}function _2(s){return bR(2,s)}var v2=cQ(function(s,c){c=c.length==1&&pt(c[0])?Sn(c[0],pi(et())):Sn(vr(c,1),pi(et()));var f=c.length;return vt(function(y){for(var S=-1,L=Ar(y.length,f);++S=c}),tc=O0(function(){return arguments}())?O0:function(s){return Cn(s)&&on.call(s,"callee")&&!d0.call(s,"callee")},pt=te.isArray,M2=QA?pi(QA):QG;function Zr(s){return s!=null&&Qm(s.length)&&!_s(s)}function qn(s){return Cn(s)&&Zr(s)}function x2(s){return s===!0||s===!1||Cn(s)&&Vr(s)==bt}var Nu=Z$||Xy,q2=YA?pi(YA):YG;function V2(s){return Cn(s)&&s.nodeType===1&&!Yd(s)}function j2(s){if(s==null)return!0;if(Zr(s)&&(pt(s)||typeof s=="string"||typeof s.splice=="function"||Nu(s)||El(s)||tc(s)))return!s.length;var c=Rr(s);if(c==it||c==gr)return!s.size;if(Gd(s))return!Ty(s).length;for(var f in s)if(on.call(s,f))return!1;return!0}function K2(s,c){return jd(s,c)}function $2(s,c,f){f=typeof f=="function"?f:e;var y=f?f(s,c):e;return y===e?jd(s,c,e,f):!!y}function jy(s){if(!Cn(s))return!1;var c=Vr(s);return c==Ke||c==ae||typeof s.message=="string"&&typeof s.name=="string"&&!Yd(s)}function G2(s){return typeof s=="number"&&p0(s)}function _s(s){if(!An(s))return!1;var c=Vr(s);return c==He||c==Mt||c==Ce||c==al}function LR(s){return typeof s=="number"&&s==ht(s)}function Qm(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Kt}function An(s){var c=typeof s;return s!=null&&(c=="object"||c=="function")}function Cn(s){return s!=null&&typeof s=="object"}var CR=JA?pi(JA):zG;function Q2(s,c){return s===c||Ny(s,c,wy(c))}function Y2(s,c,f){return f=typeof f=="function"?f:e,Ny(s,c,wy(c),f)}function J2(s){return UR(s)&&s!=+s}function z2(s){if(wQ(s))throw new ft(r);return D0(s)}function H2(s){return s===null}function W2(s){return s==null}function UR(s){return typeof s=="number"||Cn(s)&&Vr(s)==Lt}function Yd(s){if(!Cn(s)||Vr(s)!=Wr)return!1;var c=ym(s);if(c===null)return!0;var f=on.call(c,"constructor")&&c.constructor;return typeof f=="function"&&f instanceof f&&Nm.call(f)==Y$}var Ky=zA?pi(zA):HG;function X2(s){return LR(s)&&s>=-Kt&&s<=Kt}var BR=HA?pi(HA):WG;function Ym(s){return typeof s=="string"||!pt(s)&&Cn(s)&&Vr(s)==di}function Ni(s){return typeof s=="symbol"||Cn(s)&&Vr(s)==$t}var El=WA?pi(WA):XG;function Z2(s){return s===e}function eJ(s){return Cn(s)&&Rr(s)==Gu}function tJ(s){return Cn(s)&&Vr(s)==ka}var nJ=km(Ey),rJ=km(function(s,c){return s<=c});function kR(s){if(!s)return[];if(Zr(s))return Ym(s)?sa(s):Xr(s);if(Cd&&s[Cd])return U$(s[Cd]());var c=Rr(s),f=c==it?iy:c==gr?fm:hl;return f(s)}function vs(s){if(!s)return s===0?s:0;if(s=Li(s),s===Ot||s===-Ot){var c=s<0?-1:1;return c*qr}return s===s?s:0}function ht(s){var c=vs(s),f=c%1;return c===c?f?c-f:c:0}function MR(s){return s?Wu(ht(s),0,En):0}function Li(s){if(typeof s=="number")return s;if(Ni(s))return rr;if(An(s)){var c=typeof s.valueOf=="function"?s.valueOf():s;s=An(c)?c+"":c}if(typeof s!="string")return s===0?s:+s;s=r0(s);var f=MK.test(s);return f||qK.test(s)?h$(s.slice(2),f?2:8):kK.test(s)?rr:+s}function xR(s){return xa(s,ei(s))}function iJ(s){return s?Wu(ht(s),-Kt,Kt):s===0?s:0}function tn(s){return s==null?"":mi(s)}var aJ=ml(function(s,c){if(Gd(c)||Zr(c)){xa(c,pr(c),s);return}for(var f in c)on.call(c,f)&&xd(s,f,c[f])}),qR=ml(function(s,c){xa(c,ei(c),s)}),Jm=ml(function(s,c,f,y){xa(c,ei(c),s,y)}),sJ=ml(function(s,c,f,y){xa(c,pr(c),s,y)}),oJ=Is(ly);function uJ(s,c){var f=pl(s);return c==null?f:h0(f,c)}var cJ=vt(function(s,c){s=mn(s);var f=-1,y=c.length,S=y>2?c[2]:e;for(S&&jr(c[0],c[1],S)&&(y=1);++f1),L}),xa(s,Py(s),f),y&&(f=Pi(f,d|p|E,IQ));for(var S=c.length;S--;)_y(f,c[S]);return f});function bJ(s,c){return jR(s,Gm(et(c)))}var AJ=Is(function(s,c){return s==null?{}:tQ(s,c)});function jR(s,c){if(s==null)return{};var f=Sn(Py(s),function(y){return[y]});return c=et(c),L0(s,f,function(y,S){return c(y,S[0])})}function RJ(s,c,f){c=pu(c,s);var y=-1,S=c.length;for(S||(S=1,s=e);++yc){var y=s;s=c,c=y}if(f||s%1||c%1){var S=m0();return Ar(s+S*(c-s+E$("1e-"+((S+"").length-1))),c)}return yy(s,c)}var qJ=Nl(function(s,c,f){return c=c.toLowerCase(),s+(f?GR(c):c)});function GR(s){return Qy(tn(s).toLowerCase())}function QR(s){return s=tn(s),s&&s.replace(jK,P$).replace(o$,"")}function VJ(s,c,f){s=tn(s),c=mi(c);var y=s.length;f=f===e?y:Wu(ht(f),0,y);var S=f;return f-=c.length,f>=0&&s.slice(f,S)==c}function jJ(s){return s=tn(s),s&&_K.test(s)?s.replace(vA,F$):s}function KJ(s){return s=tn(s),s&&AK.test(s)?s.replace(Vh,"\\$&"):s}var $J=Nl(function(s,c,f){return s+(f?"-":"")+c.toLowerCase()}),GJ=Nl(function(s,c,f){return s+(f?" ":"")+c.toLowerCase()}),QJ=z0("toLowerCase");function YJ(s,c,f){s=tn(s),c=ht(c);var y=c?cl(s):0;if(!c||y>=c)return s;var S=(c-y)/2;return Bm(vm(S),f)+s+Bm(_m(S),f)}function JJ(s,c,f){s=tn(s),c=ht(c);var y=c?cl(s):0;return c&&y>>0,f?(s=tn(s),s&&(typeof c=="string"||c!=null&&!Ky(c))&&(c=mi(c),!c&&ul(s))?mu(sa(s),0,f):s.split(c,f)):[]}var tz=Nl(function(s,c,f){return s+(f?" ":"")+Qy(c)});function nz(s,c,f){return s=tn(s),f=f==null?0:Wu(ht(f),0,s.length),c=mi(c),s.slice(f,f+c.length)==c}function rz(s,c,f){var y=w.templateSettings;f&&jr(s,c,f)&&(c=e),s=tn(s),c=Jm({},c,y,nR);var S=Jm({},c.imports,y.imports,nR),L=pr(S),x=ry(S,L),j,H,de=0,fe=c.interpolate||om,Te="__p += '",Re=ay((c.escape||om).source+"|"+fe.source+"|"+(fe===SA?BK:om).source+"|"+(c.evaluate||om).source+"|$","g"),Ge="//# sourceURL="+(on.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++f$+"]")+` -`;s.replace(Re,function(nt,At,Ct,Ti,Kr,Ei){return Ct||(Ct=Ti),Te+=s.slice(de,Ei).replace(KK,w$),At&&(j=!0,Te+=`' + -__e(`+At+`) + -'`),Kr&&(H=!0,Te+=`'; -`+Kr+`; -__p += '`),Ct&&(Te+=`' + -((__t = (`+Ct+`)) == null ? '' : __t) + -'`),de=Ei+nt.length,nt}),Te+=`'; -`;var tt=on.call(c,"variable")&&c.variable;if(!tt)Te=`with (obj) { -`+Te+` +`)}function jQ(s){return ht(s)||cc(s)||!!(R0&&s&&s[R0])}function gs(s,c){var f=typeof s;return c=c==null?Yt:c,!!c&&(f=="number"||f!="symbol"&&t$.test(s))&&s>-1&&s%1==0&&s0){if(++c>=he)return arguments[0]}else c=0;return s.apply(e,arguments)}}function eN(s,c){var f=-1,I=s.length,O=I-1;for(c=c===e?I:c;++f1?s[c-1]:e;return f=typeof f=="function"?(s.pop(),f):e,xR(s,f)});function qR(s){var c=L(s);return c.__chain__=!0,c}function e2(s,c){return c(s),s}function tN(s,c){return c(s)}var t2=Is(function(s){var c=s.length,f=c?s[0]:0,I=this.__wrapped__,O=function(C){return Sy(C,s)};return c>1||this.__actions__.length||!(I instanceof wt)||!gs(f)?this.thru(O):(I=I.slice(f,+f+(c?1:0)),I.__actions__.push({func:tN,args:[O],thisArg:e}),new Fi(I,this.__chain__).thru(function(C){return c&&!C.length&&C.push(e),C}))});function n2(){return qR(this)}function r2(){return new Fi(this.value(),this.__chain__)}function i2(){this.__values__===e&&(this.__values__=eP(this.value()));var s=this.__index__>=this.__values__.length,c=s?e:this.__values__[this.__index__++];return{done:s,value:c}}function a2(){return this}function s2(s){for(var c,f=this;f instanceof qm;){var I=wR(f);I.__index__=0,I.__values__=e,c?O.__wrapped__=I:c=I;var O=I;f=f.__wrapped__}return O.__wrapped__=s,c}function o2(){var s=this.__wrapped__;if(s instanceof wt){var c=s;return this.__actions__.length&&(c=new wt(this)),c=c.reverse(),c.__actions__.push({func:tN,args:[Xy],thisArg:e}),new Fi(c,this.__chain__)}return this.thru(Xy)}function u2(){return nR(this.__wrapped__,this.__actions__)}var c2=Ym(function(s,c,f){un.call(s,f)?++s[f]:hs(s,f,1)});function l2(s,c,f){var I=ht(s)?N0:eQ;return f&&Gr(s,c,f)&&(c=e),I(s,nt(c,3))}function d2(s,c){var f=ht(s)?fu:x0;return f(s,nt(c,3))}var p2=fR(CR),f2=fR(UR);function m2(s,c){return Ar(nN(s,c),1)}function N2(s,c){return Ar(nN(s,c),bt)}function T2(s,c,f){return f=f===e?1:_t(f),Ar(nN(s,c),f)}function VR(s,c){var f=ht(s)?Ri:hu;return f(s,nt(c,3))}function KR(s,c){var f=ht(s)?U$:M0;return f(s,nt(c,3))}var E2=Ym(function(s,c,f){un.call(s,f)?s[f].push(c):hs(s,f,[c])});function h2(s,c,f,I){s=ri(s)?s:bl(s),f=f&&!I?_t(f):0;var O=s.length;return f<0&&(f=cr(O+f,0)),oN(s)?f<=O&&s.indexOf(c,f)>-1:!!O&&Tl(s,c,f)>-1}var y2=Ot(function(s,c,f){var I=-1,O=typeof c=="function",C=ri(s)?ae(s.length):[];return hu(s,function(V){C[++I]=O?Ni(c,V,f):Hd(V,c,f)}),C}),I2=Ym(function(s,c,f){hs(s,f,c)});function nN(s,c){var f=ht(s)?An:G0;return f(s,nt(c,3))}function g2(s,c,f,I){return s==null?[]:(ht(c)||(c=c==null?[]:[c]),f=I?e:f,ht(f)||(f=f==null?[]:[f]),H0(s,c,f))}var _2=Ym(function(s,c,f){s[f?0:1].push(c)},function(){return[[],[]]});function v2(s,c,f){var I=ht(s)?dy:y0,O=arguments.length<3;return I(s,nt(c,4),f,O,hu)}function S2(s,c,f){var I=ht(s)?B$:y0,O=arguments.length<3;return I(s,nt(c,4),f,O,M0)}function O2(s,c){var f=ht(s)?fu:x0;return f(s,aN(nt(c,3)))}function D2(s){var c=ht(s)?C0:hQ;return c(s)}function b2(s,c,f){(f?Gr(s,c,f):c===e)?c=1:c=_t(c);var I=ht(s)?HG:yQ;return I(s,c)}function A2(s){var c=ht(s)?zG:gQ;return c(s)}function R2(s){if(s==null)return 0;if(ri(s))return oN(s)?hl(s):s.length;var c=Lr(s);return c==ot||c==Dr?s.size:Py(s).length}function P2(s,c,f){var I=ht(s)?py:_Q;return f&&Gr(s,c,f)&&(c=e),I(s,nt(c,3))}var F2=Ot(function(s,c){if(s==null)return[];var f=c.length;return f>1&&Gr(s,c[0],c[1])?c=[]:f>2&&Gr(c[0],c[1],c[2])&&(c=[c[0]]),H0(s,Ar(c,1),[])}),rN=dG||function(){return Tr.Date.now()};function L2(s,c){if(typeof c!="function")throw new Pi(i);return s=_t(s),function(){if(--s<1)return c.apply(this,arguments)}}function jR(s,c,f){return c=f?e:c,c=s&&c==null?s.length:c,ys(s,de,e,e,e,e,c)}function $R(s,c){var f;if(typeof c!="function")throw new Pi(i);return s=_t(s),function(){return--s>0&&(f=c.apply(this,arguments)),s<=1&&(c=e),f}}var eI=Ot(function(s,c,f){var I=S;if(f.length){var O=Nu(f,Ol(eI));I|=ee}return ys(s,I,c,f,O)}),GR=Ot(function(s,c,f){var I=S|k;if(f.length){var O=Nu(f,Ol(GR));I|=ee}return ys(c,I,s,f,O)});function QR(s,c,f){c=f?e:c;var I=ys(s,K,e,e,e,e,e,c);return I.placeholder=QR.placeholder,I}function YR(s,c,f){c=f?e:c;var I=ys(s,ne,e,e,e,e,e,c);return I.placeholder=YR.placeholder,I}function JR(s,c,f){var I,O,C,V,Y,te,Ne=0,Te=!1,Ie=!1,we=!0;if(typeof s!="function")throw new Pi(i);c=Ui(c)||0,wn(f)&&(Te=!!f.leading,Ie="maxWait"in f,C=Ie?cr(Ui(f.maxWait)||0,c):C,we="trailing"in f?!!f.trailing:we);function Ge(Gn){var da=I,Ss=O;return I=O=e,Ne=Gn,V=s.apply(Ss,da),V}function rt(Gn){return Ne=Gn,Y=ep(Ft,c),Te?Ge(Gn):V}function St(Gn){var da=Gn-te,Ss=Gn-Ne,fP=c-da;return Ie?Fr(fP,C-Ss):fP}function it(Gn){var da=Gn-te,Ss=Gn-Ne;return te===e||da>=c||da<0||Ie&&Ss>=C}function Ft(){var Gn=rN();if(it(Gn))return kt(Gn);Y=ep(Ft,St(Gn))}function kt(Gn){return Y=e,we&&I?Ge(Gn):(I=O=e,V)}function yi(){Y!==e&&iR(Y),Ne=0,I=te=O=Y=e}function Qr(){return Y===e?V:kt(rN())}function Ii(){var Gn=rN(),da=it(Gn);if(I=arguments,O=this,te=Gn,da){if(Y===e)return rt(te);if(Ie)return iR(Y),Y=ep(Ft,c),Ge(te)}return Y===e&&(Y=ep(Ft,c)),V}return Ii.cancel=yi,Ii.flush=Qr,Ii}var w2=Ot(function(s,c){return k0(s,1,c)}),C2=Ot(function(s,c,f){return k0(s,Ui(c)||0,f)});function U2(s){return ys(s,pe)}function iN(s,c){if(typeof s!="function"||c!=null&&typeof c!="function")throw new Pi(i);var f=function(){var I=arguments,O=c?c.apply(this,I):I[0],C=f.cache;if(C.has(O))return C.get(O);var V=s.apply(this,I);return f.cache=C.set(O,V)||C,V};return f.cache=new(iN.Cache||Es),f}iN.Cache=Es;function aN(s){if(typeof s!="function")throw new Pi(i);return function(){var c=arguments;switch(c.length){case 0:return!s.call(this);case 1:return!s.call(this,c[0]);case 2:return!s.call(this,c[0],c[1]);case 3:return!s.call(this,c[0],c[1],c[2])}return!s.apply(this,c)}}function B2(s){return $R(2,s)}var k2=vQ(function(s,c){c=c.length==1&&ht(c[0])?An(c[0],Ti(nt())):An(Ar(c,1),Ti(nt()));var f=c.length;return Ot(function(I){for(var O=-1,C=Fr(I.length,f);++O=c}),cc=K0(function(){return arguments}())?K0:function(s){return Mn(s)&&un.call(s,"callee")&&!A0.call(s,"callee")},ht=ae.isArray,X2=c0?Ti(c0):sQ;function ri(s){return s!=null&&sN(s.length)&&!_s(s)}function $n(s){return Mn(s)&&ri(s)}function Z2(s){return s===!0||s===!1||Mn(s)&&$r(s)==Pt}var _u=fG||pI,eJ=l0?Ti(l0):oQ;function tJ(s){return Mn(s)&&s.nodeType===1&&!tp(s)}function nJ(s){if(s==null)return!0;if(ri(s)&&(ht(s)||typeof s=="string"||typeof s.splice=="function"||_u(s)||Dl(s)||cc(s)))return!s.length;var c=Lr(s);if(c==ot||c==Dr)return!s.size;if(Zd(s))return!Py(s).length;for(var f in s)if(un.call(s,f))return!1;return!0}function rJ(s,c){return zd(s,c)}function iJ(s,c,f){f=typeof f=="function"?f:e;var I=f?f(s,c):e;return I===e?zd(s,c,e,f):!!I}function nI(s){if(!Mn(s))return!1;var c=$r(s);return c==je||c==ue||typeof s.message=="string"&&typeof s.name=="string"&&!tp(s)}function aJ(s){return typeof s=="number"&&P0(s)}function _s(s){if(!wn(s))return!1;var c=$r(s);return c==We||c==Vt||c==Me||c==ml}function zR(s){return typeof s=="number"&&s==_t(s)}function sN(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Yt}function wn(s){var c=typeof s;return s!=null&&(c=="object"||c=="function")}function Mn(s){return s!=null&&typeof s=="object"}var WR=d0?Ti(d0):cQ;function sJ(s,c){return s===c||Ry(s,c,Qy(c))}function oJ(s,c,f){return f=typeof f=="function"?f:e,Ry(s,c,Qy(c),f)}function uJ(s){return XR(s)&&s!=+s}function cJ(s){if(QQ(s))throw new Tt(r);return j0(s)}function lJ(s){return s===null}function dJ(s){return s==null}function XR(s){return typeof s=="number"||Mn(s)&&$r(s)==Bt}function tp(s){if(!Mn(s)||$r(s)!=ti)return!1;var c=wm(s);if(c===null)return!0;var f=un.call(c,"constructor")&&c.constructor;return typeof f=="function"&&f instanceof f&&Rm.call(f)==oG}var rI=p0?Ti(p0):lQ;function pJ(s){return zR(s)&&s>=-Yt&&s<=Yt}var ZR=f0?Ti(f0):dQ;function oN(s){return typeof s=="string"||!ht(s)&&Mn(s)&&$r(s)==mi}function hi(s){return typeof s=="symbol"||Mn(s)&&$r(s)==Jt}var Dl=m0?Ti(m0):pQ;function fJ(s){return s===e}function mJ(s){return Mn(s)&&Lr(s)==Zu}function NJ(s){return Mn(s)&&$r(s)==Ma}var TJ=Wm(Fy),EJ=Wm(function(s,c){return s<=c});function eP(s){if(!s)return[];if(ri(s))return oN(s)?ua(s):ni(s);if(Kd&&s[Kd])return H$(s[Kd]());var c=Lr(s),f=c==ot?hy:c==Dr?Dm:bl;return f(s)}function vs(s){if(!s)return s===0?s:0;if(s=Ui(s),s===bt||s===-bt){var c=s<0?-1:1;return c*jr}return s===s?s:0}function _t(s){var c=vs(s),f=c%1;return c===c?f?c-f:c:0}function tP(s){return s?ac(_t(s),0,yn):0}function Ui(s){if(typeof s=="number")return s;if(hi(s))return or;if(wn(s)){var c=typeof s.valueOf=="function"?s.valueOf():s;s=wn(c)?c+"":c}if(typeof s!="string")return s===0?s:+s;s=I0(s);var f=Xj.test(s);return f||e$.test(s)?L$(s.slice(2),f?2:8):Wj.test(s)?or:+s}function nP(s){return qa(s,ii(s))}function hJ(s){return s?ac(_t(s),-Yt,Yt):s===0?s:0}function nn(s){return s==null?"":Ei(s)}var yJ=vl(function(s,c){if(Zd(c)||ri(c)){qa(c,Er(c),s);return}for(var f in c)un.call(c,f)&&Yd(s,f,c[f])}),rP=vl(function(s,c){qa(c,ii(c),s)}),uN=vl(function(s,c,f,I){qa(c,ii(c),s,I)}),IJ=vl(function(s,c,f,I){qa(c,Er(c),s,I)}),gJ=Is(Sy);function _J(s,c){var f=_l(s);return c==null?f:U0(f,c)}var vJ=Ot(function(s,c){s=Nn(s);var f=-1,I=c.length,O=I>2?c[2]:e;for(O&&Gr(c[0],c[1],O)&&(I=1);++f1),C}),qa(s,$y(s),f),I&&(f=Li(f,d|p|E,CQ));for(var O=c.length;O--;)By(f,c[O]);return f});function VJ(s,c){return aP(s,aN(nt(c)))}var KJ=Is(function(s,c){return s==null?{}:NQ(s,c)});function aP(s,c){if(s==null)return{};var f=An($y(s),function(I){return[I]});return c=nt(c),z0(s,f,function(I,O){return c(I,O[0])})}function jJ(s,c,f){c=Iu(c,s);var I=-1,O=c.length;for(O||(O=1,s=e);++Ic){var I=s;s=c,c=I}if(f||s%1||c%1){var O=F0();return Fr(s+O*(c-s+F$("1e-"+((O+"").length-1))),c)}return wy(s,c)}var eH=Sl(function(s,c,f){return c=c.toLowerCase(),s+(f?uP(c):c)});function uP(s){return sI(nn(s).toLowerCase())}function cP(s){return s=nn(s),s&&s.replace(n$,$$).replace(g$,"")}function tH(s,c,f){s=nn(s),c=Ei(c);var I=s.length;f=f===e?I:ac(_t(f),0,I);var O=f;return f-=c.length,f>=0&&s.slice(f,O)==c}function nH(s){return s=nn(s),s&&Bj.test(s)?s.replace(qA,G$):s}function rH(s){return s=nn(s),s&&Kj.test(s)?s.replace(ty,"\\$&"):s}var iH=Sl(function(s,c,f){return s+(f?"-":"")+c.toLowerCase()}),aH=Sl(function(s,c,f){return s+(f?" ":"")+c.toLowerCase()}),sH=pR("toLowerCase");function oH(s,c,f){s=nn(s),c=_t(c);var I=c?hl(s):0;if(!c||I>=c)return s;var O=(c-I)/2;return zm(km(O),f)+s+zm(Bm(O),f)}function uH(s,c,f){s=nn(s),c=_t(c);var I=c?hl(s):0;return c&&I>>0,f?(s=nn(s),s&&(typeof c=="string"||c!=null&&!rI(c))&&(c=Ei(c),!c&&El(s))?gu(ua(s),0,f):s.split(c,f)):[]}var NH=Sl(function(s,c,f){return s+(f?" ":"")+sI(c)});function TH(s,c,f){return s=nn(s),f=f==null?0:ac(_t(f),0,s.length),c=Ei(c),s.slice(f,f+c.length)==c}function EH(s,c,f){var I=L.templateSettings;f&&Gr(s,c,f)&&(c=e),s=nn(s),c=uN({},c,I,yR);var O=uN({},c.imports,I.imports,yR),C=Er(O),V=Ey(O,C),Y,te,Ne=0,Te=c.interpolate||gm,Ie="__p += '",we=yy((c.escape||gm).source+"|"+Te.source+"|"+(Te===VA?zj:gm).source+"|"+(c.evaluate||gm).source+"|$","g"),Ge="//# sourceURL="+(un.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++D$+"]")+` +`;s.replace(we,function(it,Ft,kt,yi,Qr,Ii){return kt||(kt=yi),Ie+=s.slice(Ne,Ii).replace(r$,Q$),Ft&&(Y=!0,Ie+=`' + +__e(`+Ft+`) + +'`),Qr&&(te=!0,Ie+=`'; +`+Qr+`; +__p += '`),kt&&(Ie+=`' + +((__t = (`+kt+`)) == null ? '' : __t) + +'`),Ne=Ii+it.length,it}),Ie+=`'; +`;var rt=un.call(c,"variable")&&c.variable;if(!rt)Ie=`with (obj) { +`+Ie+` } -`;else if(CK.test(tt))throw new ft(a);Te=(H?Te.replace(vn,""):Te).replace(sn,"$1").replace(IK,"$1;"),Te="function("+(tt||"obj")+`) { -`+(tt?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(j?", __e = _.escape":"")+(H?`, __j = Array.prototype.join; +`;else if(Jj.test(rt))throw new Tt(a);Ie=(te?Ie.replace(bn,""):Ie).replace(on,"$1").replace(Cj,"$1;"),Ie="function("+(rt||"obj")+`) { +`+(rt?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(Y?", __e = _.escape":"")+(te?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; -`)+Te+`return __p -}`;var gt=JR(function(){return Ht(L,Ge+"return "+Te).apply(e,x)});if(gt.source=Te,jy(gt))throw gt;return gt}function iz(s){return tn(s).toLowerCase()}function az(s){return tn(s).toUpperCase()}function sz(s,c,f){if(s=tn(s),s&&(f||c===e))return r0(s);if(!s||!(c=mi(c)))return s;var y=sa(s),S=sa(c),L=i0(y,S),x=a0(y,S)+1;return mu(y,L,x).join("")}function oz(s,c,f){if(s=tn(s),s&&(f||c===e))return s.slice(0,o0(s)+1);if(!s||!(c=mi(c)))return s;var y=sa(s),S=a0(y,sa(c))+1;return mu(y,0,S).join("")}function uz(s,c,f){if(s=tn(s),s&&(f||c===e))return s.replace(jh,"");if(!s||!(c=mi(c)))return s;var y=sa(s),S=i0(y,sa(c));return mu(y,S).join("")}function cz(s,c){var f=qe,y=Z;if(An(c)){var S="separator"in c?c.separator:S;f="length"in c?ht(c.length):f,y="omission"in c?mi(c.omission):y}s=tn(s);var L=s.length;if(ul(s)){var x=sa(s);L=x.length}if(f>=L)return s;var j=f-cl(y);if(j<1)return y;var H=x?mu(x,0,j).join(""):s.slice(0,j);if(S===e)return H+y;if(x&&(j+=H.length-j),Ky(S)){if(s.slice(j).search(S)){var de,fe=H;for(S.global||(S=ay(S.source,tn(OA.exec(S))+"g")),S.lastIndex=0;de=S.exec(fe);)var Te=de.index;H=H.slice(0,Te===e?j:Te)}}else if(s.indexOf(mi(S),j)!=j){var Re=H.lastIndexOf(S);Re>-1&&(H=H.slice(0,Re))}return H+y}function lz(s){return s=tn(s),s&&gK.test(s)?s.replace(_A,x$):s}var dz=Nl(function(s,c,f){return s+(f?" ":"")+c.toUpperCase()}),Qy=z0("toUpperCase");function YR(s,c,f){return s=tn(s),c=f?e:c,c===e?C$(s)?j$(s):O$(s):s.match(c)||[]}var JR=vt(function(s,c){try{return fi(s,e,c)}catch(f){return jy(f)?f:new ft(f)}}),fz=Is(function(s,c){return bi(c,function(f){f=qa(f),hs(s,f,qy(s[f],s))}),s});function pz(s){var c=s==null?0:s.length,f=et();return s=c?Sn(s,function(y){if(typeof y[1]!="function")throw new Ai(i);return[f(y[0]),y[1]]}):[],vt(function(y){for(var S=-1;++SKt)return[];var f=En,y=Ar(s,En);c=et(c),s-=En;for(var S=ny(y,c);++f0||c<0)?new Pt(f):(s<0?f=f.takeRight(-s):s&&(f=f.drop(s)),c!==e&&(c=ht(c),f=c<0?f.dropRight(-c):f.take(c-s)),f)},Pt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Pt.prototype.toArray=function(){return this.take(En)},Ma(Pt.prototype,function(s,c){var f=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),S=w[y?"take"+(c=="last"?"Right":""):c],L=y||/^find/.test(c);S&&(w.prototype[c]=function(){var x=this.__wrapped__,j=y?[1]:arguments,H=x instanceof Pt,de=j[0],fe=H||pt(x),Te=function(At){var Ct=S.apply(w,ou([At],j));return y&&Re?Ct[0]:Ct};fe&&f&&typeof de=="function"&&de.length!=1&&(H=fe=!1);var Re=this.__chain__,Ge=!!this.__actions__.length,tt=L&&!Re,gt=H&&!Ge;if(!L&&fe){x=gt?x:new Pt(this);var nt=s.apply(x,j);return nt.__actions__.push({func:Vm,args:[Te],thisArg:e}),new Ri(nt,Re)}return tt&>?s.apply(this,j):(nt=this.thru(Te),tt?y?nt.value()[0]:nt.value():nt)})}),bi(["pop","push","shift","sort","splice","unshift"],function(s){var c=pm[s],f=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",y=/^(?:pop|shift)$/.test(s);w.prototype[s]=function(){var S=arguments;if(y&&!this.__chain__){var L=this.value();return c.apply(pt(L)?L:[],S)}return this[f](function(x){return c.apply(pt(x)?x:[],S)})}}),Ma(Pt.prototype,function(s,c){var f=w[c];if(f){var y=f.name+"";on.call(fl,y)||(fl[y]=[]),fl[y].push({name:c,func:f})}}),fl[Cm(e,B).name]=[{name:"wrapper",func:e}],Pt.prototype.clone=lG,Pt.prototype.reverse=dG,Pt.prototype.value=fG,w.prototype.at=VY,w.prototype.chain=jY,w.prototype.commit=KY,w.prototype.next=$Y,w.prototype.plant=QY,w.prototype.reverse=YY,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=JY,w.prototype.first=w.prototype.head,Cd&&(w.prototype[Cd]=GY),w},cu=K$();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(fr._=cu,define(function(){return cu})):Yu?((Yu.exports=cu)._=cu,Jh._=cu):fr._=cu}).call(Id)});var BV=F(zc=>{"use strict";m();T();N();Object.defineProperty(zc,"__esModule",{value:!0});zc.FederationFactory=void 0;zc.federateSubgraphs=rpe;zc.federateSubgraphsWithContracts=ipe;zc.federateSubgraphsContract=ape;var Fe=Se(),wV=Au(),Jr=Cr(),we=Qi(),Yc=OT(),Jc=pd(),zr=_p(),fh=_E(),Fp=Ru(),Zfe=Eb(),epe=vp(),LV=Jf(),Oe=Ql(),tpe=Ib(),CV=FV(),gd=dh(),De=Hn(),ph=jl(),me=Ur(),npe=Sp(),xu=zf(),Nh,UV,mh=class{constructor({authorizationDataByParentTypeName:t,concreteTypeNamesByAbstractTypeName:n,entityDataByTypeName:r,entityInterfaceFederationDataByTypeName:i,fieldCoordsByNamedTypeName:a,interfaceImplementationTypeNamesByInterfaceTypeName:o,internalGraph:u,internalSubgraphBySubgraphName:l,options:d,warnings:p}){rc(this,Nh);g(this,"authorizationDataByParentTypeName");g(this,"coordsByNamedTypeName",new Map);g(this,"directiveDefinitionByName",new Map);g(this,"clientDefinitions",[]);g(this,"currentSubgraphName","");g(this,"concreteTypeNamesByAbstractTypeName");g(this,"subgraphNamesByNamedTypeNameByFieldCoords",new Map);g(this,"entityDataByTypeName");g(this,"entityInterfaceFederationDataByTypeName");g(this,"errors",[]);g(this,"fieldConfigurationByFieldCoords",new Map);g(this,"fieldCoordsByNamedTypeName");g(this,"inaccessibleCoords",new Set);g(this,"inaccessibleRequiredInputValueErrorByCoords",new Map);g(this,"interfaceImplementationTypeNamesByInterfaceTypeName");g(this,"internalGraph");g(this,"internalSubgraphBySubgraphName");g(this,"invalidORScopesCoords",new Set);g(this,"isMaxDepth",!1);g(this,"isVersionTwo",!1);g(this,"namedInputValueTypeNames",new Set);g(this,"namedOutputTypeNames",new Set);g(this,"options");g(this,"parentDefinitionDataByTypeName",new Map);g(this,"parentTagDataByTypeName",new Map);g(this,"persistedDirectiveDefinitionByDirectiveName",new Map([[De.AUTHENTICATED,xu.AUTHENTICATED_DEFINITION],[De.DEPRECATED,xu.DEPRECATED_DEFINITION],[De.INACCESSIBLE,xu.INACCESSIBLE_DEFINITION],[De.ONE_OF,xu.ONE_OF_DEFINITION],[De.REQUIRES_SCOPES,xu.REQUIRES_SCOPES_DEFINITION],[De.SEMANTIC_NON_NULL,xu.SEMANTIC_NON_NULL_DEFINITION],[De.TAG,xu.TAG_DEFINITION]]));g(this,"potentialPersistedDirectiveDefinitionDataByDirectiveName",new Map);g(this,"referencedPersistedDirectiveNames",new Set);g(this,"routerDefinitions",[]);g(this,"subscriptionFilterDataByFieldPath",new Map);g(this,"tagNamesByCoords",new Map);g(this,"warnings");this.authorizationDataByParentTypeName=t,this.options=d!=null?d:{},this.concreteTypeNamesByAbstractTypeName=n,this.entityDataByTypeName=r,this.entityInterfaceFederationDataByTypeName=i,this.fieldCoordsByNamedTypeName=a,this.interfaceImplementationTypeNamesByInterfaceTypeName=o,this.internalGraph=u,this.internalSubgraphBySubgraphName=l,this.warnings=p}extractPersistedDirectives({data:t,directivesByName:n}){for(let[r,i]of n)if(this.persistedDirectiveDefinitionByDirectiveName.get(r)&&(this.referencedPersistedDirectiveNames.add(r),!(De.AUTHORIZATION_DIRECTIVES.has(r)||i.length<1)))switch(r){case De.DEPRECATED:{t.isDeprecated=!0,(0,Oe.upsertDeprecatedDirective)(t,i[0]);break}case De.TAG:{(0,Oe.upsertTagDirectives)(t,i);break}default:{let o=t.directivesByName.get(r);if(!o){t.directivesByName.set(r,[...i]);break}if(De.NON_REPEATABLE_PERSISTED_DIRECTIVES.has(r))break;o.push(...i)}}return t}getValidImplementedInterfaces(t){var o;let n=[];if(t.implementedInterfaceTypeNames.size<1)return n;let r=(0,Oe.isNodeDataInaccessible)(t),i=new Map,a=new Map;for(let u of t.implementedInterfaceTypeNames){n.push((0,Jr.stringToNamedTypeNode)(u));let l=(0,me.getOrThrowError)(this.parentDefinitionDataByTypeName,u,De.PARENT_DEFINITION_DATA);if(l.kind!==Fe.Kind.INTERFACE_TYPE_DEFINITION){a.set(l.name,(0,me.kindToNodeType)(l.kind));continue}let d={invalidFieldImplementations:new Map,unimplementedFields:[]},p=!1;for(let[E,h]of l.fieldDataByName){let v=!1,A=t.fieldDataByName.get(E);if(!A){p=!0,d.unimplementedFields.push(E);continue}let B={invalidAdditionalArguments:new Set,invalidImplementedArguments:[],isInaccessible:!1,originalResponseType:(0,fh.printTypeNode)(h.node.type),unimplementedArguments:new Set};(0,Oe.isTypeValidImplementation)({concreteTypeNamesByAbstractTypeName:this.concreteTypeNamesByAbstractTypeName,implementationType:A.node.type,interfaceImplementationTypeNamesByInterfaceTypeName:this.interfaceImplementationTypeNamesByInterfaceTypeName,originalType:h.node.type})||(p=!0,v=!0,B.implementedResponseType=(0,fh.printTypeNode)(A.node.type));let V=new Set;for(let[J,re]of h.argumentDataByName){let ie=re.node;V.add(J);let Ne=(o=A.argumentDataByName.get(J))==null?void 0:o.node;if(!Ne){p=!0,v=!0,B.unimplementedArguments.add(J);continue}let Ee=(0,fh.printTypeNode)(Ne.type),_e=(0,fh.printTypeNode)(ie.type);_e!==Ee&&(p=!0,v=!0,B.invalidImplementedArguments.push({actualType:Ee,argumentName:J,expectedType:_e}))}for(let[J,re]of A.argumentDataByName){let ie=re.node;V.has(J)||ie.type.kind===Fe.Kind.NON_NULL_TYPE&&(p=!0,v=!0,B.invalidAdditionalArguments.add(J))}!r&&A.isInaccessible&&!h.isInaccessible&&(p=!0,v=!0,B.isInaccessible=!0),v&&d.invalidFieldImplementations.set(E,B)}p&&i.set(u,d)}return a.size>0&&this.errors.push((0,we.invalidImplementedTypeError)(t.name,a)),i.size>0&&this.errors.push((0,we.invalidInterfaceImplementationError)(t.node.name.value,(0,me.kindToNodeType)(t.kind),i)),n}addValidPrimaryKeyTargetsToEntityData(t){var p;let n=this.entityDataByTypeName.get(t);if(!n)return;let r=(0,me.getOrThrowError)(this.internalSubgraphBySubgraphName,this.currentSubgraphName,"internalSubgraphBySubgraphName"),i=r.parentDefinitionDataByTypeName,a=i.get(n.typeName);if(!a||a.kind!==Fe.Kind.OBJECT_TYPE_DEFINITION)throw(0,we.incompatibleParentKindFatalError)(n.typeName,Fe.Kind.OBJECT_TYPE_DEFINITION,(a==null?void 0:a.kind)||Fe.Kind.NULL);let o=r.configurationDataByTypeName.get(n.typeName);if(!o)return;let u=[],l=this.internalGraph.nodeByNodeName.get(`${this.currentSubgraphName}.${n.typeName}`);(0,Yc.validateImplicitFieldSets)({conditionalFieldDataByCoords:r.conditionalFieldDataByCoordinates,currentSubgraphName:this.currentSubgraphName,entityData:n,implicitKeys:u,objectData:a,parentDefinitionDataByTypeName:i,graphNode:l});for(let[E,h]of this.entityInterfaceFederationDataByTypeName){if(!((p=h.concreteTypeNames)!=null&&p.has(n.typeName)))continue;let v=this.entityDataByTypeName.get(E);v&&(0,Yc.validateImplicitFieldSets)({conditionalFieldDataByCoords:r.conditionalFieldDataByCoordinates,currentSubgraphName:this.currentSubgraphName,entityData:v,implicitKeys:u,objectData:a,parentDefinitionDataByTypeName:i,graphNode:l})}if(u.length<1)return;if(!o.keys||o.keys.length<1){o.isRootNode=!0,o.keys=u;return}let d=new Set(o.keys.map(E=>E.selectionSet));for(let E of u)d.has(E.selectionSet)||(o.keys.push(E),d.add(E.selectionSet))}addValidPrimaryKeyTargetsFromInterfaceObject(t,n,r,i){let a=t.parentDefinitionDataByTypeName,o=a.get(n);if(!o||!(0,Oe.isParentDataCompositeOutputType)(o))throw(0,we.incompatibleParentKindFatalError)(n,Fe.Kind.INTERFACE_TYPE_DEFINITION,(o==null?void 0:o.kind)||Fe.Kind.NULL);let u=(0,me.getOrThrowError)(t.configurationDataByTypeName,r.typeName,"internalSubgraph.configurationDataByTypeName"),l=[];if((0,Yc.validateImplicitFieldSets)({conditionalFieldDataByCoords:t.conditionalFieldDataByCoordinates,currentSubgraphName:t.name,entityData:r,implicitKeys:l,objectData:o,parentDefinitionDataByTypeName:a,graphNode:i}),l.length<1)return;if(!u.keys||u.keys.length<1){u.isRootNode=!0,u.keys=l;return}let d=new Set(u.keys.map(p=>p.selectionSet));for(let p of l)d.has(p.selectionSet)||(u.keys.push(p),d.add(p.selectionSet))}getEnumValueMergeMethod(t){return this.namedInputValueTypeNames.has(t)?this.namedOutputTypeNames.has(t)?Oe.MergeMethod.CONSISTENT:Oe.MergeMethod.INTERSECTION:Oe.MergeMethod.UNION}generateTagData(){for(let[t,n]of this.tagNamesByCoords){let r=t.split(De.LITERAL_PERIOD);if(r.length<1)continue;let i=(0,me.getValueOrDefault)(this.parentTagDataByTypeName,r[0],()=>(0,Yc.newParentTagData)(r[0]));switch(r.length){case 1:for(let l of n)i.tagNames.add(l);break;case 2:let a=(0,me.getValueOrDefault)(i.childTagDataByChildName,r[1],()=>(0,Yc.newChildTagData)(r[1]));for(let l of n)a.tagNames.add(l);break;case 3:let o=(0,me.getValueOrDefault)(i.childTagDataByChildName,r[1],()=>(0,Yc.newChildTagData)(r[1])),u=(0,me.getValueOrDefault)(o.tagNamesByArgumentName,r[2],()=>new Set);for(let l of n)u.add(l);break;default:break}}}upsertEnumValueData(t,n,r){let i=t.get(n.name),a=i||this.copyEnumValueData(n);this.extractPersistedDirectives({data:a.persistedDirectivesData,directivesByName:n.directivesByName});let o=(0,Oe.isNodeDataInaccessible)(n);if((r||o)&&this.inaccessibleCoords.add(a.federatedCoords),this.recordTagNamesByCoords(a,a.federatedCoords),!i){t.set(a.name,a);return}a.appearances+=1,(0,me.addNewObjectValueMapEntries)(n.configureDescriptionDataBySubgraphName,a.configureDescriptionDataBySubgraphName),(0,Oe.setLongestDescription)(a,n),(0,me.addIterableToSet)({source:n.subgraphNames,target:a.subgraphNames})}upsertInputValueData(t,n,r,i){let a=t.get(n.name),o=a||this.copyInputValueData(n);if(this.extractPersistedDirectives({data:o.persistedDirectivesData,directivesByName:n.directivesByName}),this.recordTagNamesByCoords(o,`${r}.${o.name}`),this.namedInputValueTypeNames.add(o.namedTypeName),(0,me.getValueOrDefault)(this.coordsByNamedTypeName,o.namedTypeName,()=>new Set).add(o.federatedCoords),!a){t.set(o.name,o);return}(0,me.addNewObjectValueMapEntries)(n.configureDescriptionDataBySubgraphName,o.configureDescriptionDataBySubgraphName),(0,Oe.setLongestDescription)(o,n),(0,me.addIterableToSet)({source:n.requiredSubgraphNames,target:o.requiredSubgraphNames}),(0,me.addIterableToSet)({source:n.subgraphNames,target:o.subgraphNames}),this.handleInputValueInaccessibility(i,o,r);let u=(0,gd.getMostRestrictiveMergedTypeNode)(o.type,n.type,o.originalCoords,this.errors);u.success?o.type=u.typeNode:this.errors.push((0,we.incompatibleMergedTypesError)({actualType:u.actualType,isArgument:a.isArgument,coords:a.federatedCoords,expectedType:u.expectedType})),(0,Oe.compareAndValidateInputValueDefaultValues)(o,n,this.errors)}handleInputValueInaccessibility(t,n,r){if(t){this.inaccessibleRequiredInputValueErrorByCoords.delete(n.federatedCoords),this.inaccessibleCoords.add(n.federatedCoords);return}if((0,Oe.isNodeDataInaccessible)(n)){if((0,Oe.isTypeRequired)(n.type)){this.inaccessibleRequiredInputValueErrorByCoords.set(n.federatedCoords,(0,we.inaccessibleRequiredInputValueError)(n,r));return}this.inaccessibleCoords.add(n.federatedCoords)}}handleSubscriptionFilterDirective(t,n){let r=t.directivesByName.get(De.SUBSCRIPTION_FILTER);if(!r)return;let i=(0,me.getFirstEntry)(t.subgraphNames);if(i===void 0){this.errors.push((0,we.unknownFieldSubgraphNameError)(t.federatedCoords));return}this.subscriptionFilterDataByFieldPath.set(t.federatedCoords,{directive:r[0],fieldData:n||t,directiveSubgraphName:i})}federateOutputType({current:t,other:n,coords:r,mostRestrictive:i}){n=(0,wV.getMutableTypeNode)(n,r,this.errors);let a={kind:t.kind},o=gd.DivergentType.NONE,u=a;for(let l=0;lnew Set)})}upsertFieldData(t,n,r){let i=t.get(n.name),a=i||this.copyFieldData(n,r||(0,Oe.isNodeDataInaccessible)(n));(0,me.getValueOrDefault)(this.coordsByNamedTypeName,n.namedTypeName,()=>new Set).add(a.federatedCoords),this.namedOutputTypeNames.add(n.namedTypeName),this.handleSubscriptionFilterDirective(n,a),this.extractPersistedDirectives({data:a.persistedDirectivesData,directivesByName:n.directivesByName});let o=r||(0,Oe.isNodeDataInaccessible)(a);if(o&&this.inaccessibleCoords.add(a.federatedCoords),this.recordTagNamesByCoords(a,a.federatedCoords),!i){t.set(a.name,a);return}let u=this.federateOutputType({current:a.type,other:n.type,coords:a.federatedCoords,mostRestrictive:!1});if(u.success)if(a.type=u.typeNode,a.namedTypeName!==n.namedTypeName){let l=(0,me.getValueOrDefault)(this.subgraphNamesByNamedTypeNameByFieldCoords,a.federatedCoords,()=>new Map),d=(0,me.getValueOrDefault)(l,a.namedTypeName,()=>new Set);if(d.size<1)for(let p of a.subgraphNames)n.subgraphNames.has(p)||d.add(p);(0,me.addIterableToSet)({source:n.subgraphNames,target:(0,me.getValueOrDefault)(l,n.namedTypeName,()=>new Set)})}else this.addSubgraphNameToExistingFieldNamedTypeDisparity(n);for(let l of n.argumentDataByName.values())this.upsertInputValueData(a.argumentDataByName,l,a.federatedCoords,o);(0,me.addNewObjectValueMapEntries)(n.configureDescriptionDataBySubgraphName,i.configureDescriptionDataBySubgraphName),(0,Oe.setLongestDescription)(a,n),a.isInaccessible||(a.isInaccessible=n.isInaccessible),(0,me.addNewObjectValueMapEntries)(n.externalFieldDataBySubgraphName,a.externalFieldDataBySubgraphName),(0,me.addMapEntries)({source:n.isShareableBySubgraphName,target:a.isShareableBySubgraphName}),(0,me.addMapEntries)({source:n.nullLevelsBySubgraphName,target:a.nullLevelsBySubgraphName}),(0,me.addIterableToSet)({source:n.subgraphNames,target:a.subgraphNames})}getClientSchemaUnionMembers(t){let n=[];for(let[r,i]of t.memberByMemberTypeName)this.inaccessibleCoords.has(r)||n.push(i);return n}recordTagNamesByCoords(t,n){let r=n||t.name;if(t.persistedDirectivesData.tagDirectiveByName.size<1)return;let i=(0,me.getValueOrDefault)(this.tagNamesByCoords,r,()=>new Set);for(let a of t.persistedDirectivesData.tagDirectiveByName.keys())i.add(a)}copyMutualParentDefinitionData(t){return{configureDescriptionDataBySubgraphName:(0,me.copyObjectValueMap)(t.configureDescriptionDataBySubgraphName),directivesByName:(0,me.copyArrayValueMap)(t.directivesByName),extensionType:t.extensionType,name:t.name,persistedDirectivesData:this.extractPersistedDirectives({data:(0,Oe.newPersistedDirectivesData)(),directivesByName:t.directivesByName}),description:(0,Oe.getInitialFederatedDescription)(t)}}copyEnumValueData(t){return{appearances:t.appearances,configureDescriptionDataBySubgraphName:(0,me.copyObjectValueMap)(t.configureDescriptionDataBySubgraphName),federatedCoords:t.federatedCoords,directivesByName:(0,me.copyArrayValueMap)(t.directivesByName),kind:t.kind,name:t.name,node:{directives:[],kind:t.kind,name:(0,Jr.stringToNameNode)(t.name)},parentTypeName:t.parentTypeName,persistedDirectivesData:this.extractPersistedDirectives({data:(0,Oe.newPersistedDirectivesData)(),directivesByName:t.directivesByName}),subgraphNames:new Set(t.subgraphNames),description:(0,Oe.getInitialFederatedDescription)(t)}}copyInputValueData(t){return{configureDescriptionDataBySubgraphName:(0,me.copyObjectValueMap)(t.configureDescriptionDataBySubgraphName),directivesByName:(0,me.copyArrayValueMap)(t.directivesByName),federatedCoords:t.federatedCoords,fieldName:t.fieldName,includeDefaultValue:t.includeDefaultValue,isArgument:t.isArgument,kind:t.kind,name:t.name,namedTypeKind:t.namedTypeKind,namedTypeName:t.namedTypeName,node:{directives:[],kind:Fe.Kind.INPUT_VALUE_DEFINITION,name:(0,Jr.stringToNameNode)(t.name),type:t.type},originalCoords:t.originalCoords,originalParentTypeName:t.originalParentTypeName,persistedDirectivesData:this.extractPersistedDirectives({data:(0,Oe.newPersistedDirectivesData)(),directivesByName:t.directivesByName}),renamedParentTypeName:t.renamedParentTypeName,requiredSubgraphNames:new Set(t.requiredSubgraphNames),subgraphNames:new Set(t.subgraphNames),type:t.type,defaultValue:t.defaultValue,description:(0,Oe.getInitialFederatedDescription)(t)}}copyInputValueDataByValueName(t,n,r){let i=new Map;for(let[a,o]of t){let u=this.copyInputValueData(o);this.handleInputValueInaccessibility(n,u,r),(0,me.getValueOrDefault)(this.coordsByNamedTypeName,u.namedTypeName,()=>new Set).add(u.federatedCoords),this.namedInputValueTypeNames.add(u.namedTypeName),this.recordTagNamesByCoords(u,`${r}.${o.name}`),i.set(a,u)}return i}copyFieldData(t,n){return{argumentDataByName:this.copyInputValueDataByValueName(t.argumentDataByName,n,t.federatedCoords),configureDescriptionDataBySubgraphName:(0,me.copyObjectValueMap)(t.configureDescriptionDataBySubgraphName),directivesByName:(0,me.copyArrayValueMap)(t.directivesByName),externalFieldDataBySubgraphName:(0,me.copyObjectValueMap)(t.externalFieldDataBySubgraphName),federatedCoords:t.federatedCoords,inheritedDirectiveNames:new Set,isInaccessible:t.isInaccessible,isShareableBySubgraphName:new Map(t.isShareableBySubgraphName),kind:t.kind,name:t.name,namedTypeKind:t.namedTypeKind,namedTypeName:t.namedTypeName,node:{arguments:[],directives:[],kind:t.kind,name:(0,Jr.stringToNameNode)(t.name),type:t.type},nullLevelsBySubgraphName:t.nullLevelsBySubgraphName,originalParentTypeName:t.originalParentTypeName,persistedDirectivesData:this.extractPersistedDirectives({data:(0,Oe.newPersistedDirectivesData)(),directivesByName:t.directivesByName}),renamedParentTypeName:t.renamedParentTypeName,subgraphNames:new Set(t.subgraphNames),type:t.type,description:(0,Oe.getInitialFederatedDescription)(t)}}copyEnumValueDataByName(t,n){let r=new Map;for(let[i,a]of t){let o=this.copyEnumValueData(a);this.recordTagNamesByCoords(o,o.federatedCoords),(n||(0,Oe.isNodeDataInaccessible)(o))&&this.inaccessibleCoords.add(o.federatedCoords),r.set(i,o)}return r}copyFieldDataByName(t,n){let r=new Map;for(let[i,a]of t){let o=n||(0,Oe.isNodeDataInaccessible)(a),u=this.copyFieldData(a,o);this.handleSubscriptionFilterDirective(u),(0,me.getValueOrDefault)(this.coordsByNamedTypeName,u.namedTypeName,()=>new Set).add(u.federatedCoords),this.namedOutputTypeNames.add(u.namedTypeName),this.recordTagNamesByCoords(u,u.federatedCoords),o&&this.inaccessibleCoords.add(u.federatedCoords),r.set(i,u)}return r}copyParentDefinitionData(t){let n=this.copyMutualParentDefinitionData(t);switch(t.kind){case Fe.Kind.ENUM_TYPE_DEFINITION:return $(M({},n),{appearances:t.appearances,enumValueDataByName:this.copyEnumValueDataByName(t.enumValueDataByName,t.isInaccessible),isInaccessible:t.isInaccessible,kind:t.kind,node:{kind:t.kind,name:(0,Jr.stringToNameNode)(t.name)},subgraphNames:new Set(t.subgraphNames)});case Fe.Kind.INPUT_OBJECT_TYPE_DEFINITION:return $(M({},n),{inputValueDataByName:this.copyInputValueDataByValueName(t.inputValueDataByName,t.isInaccessible,t.name),isInaccessible:t.isInaccessible,kind:t.kind,node:{kind:t.kind,name:(0,Jr.stringToNameNode)(t.name)},subgraphNames:new Set(t.subgraphNames)});case Fe.Kind.INTERFACE_TYPE_DEFINITION:return $(M({},n),{fieldDataByName:this.copyFieldDataByName(t.fieldDataByName,t.isInaccessible),implementedInterfaceTypeNames:new Set(t.implementedInterfaceTypeNames),isEntity:t.isEntity,isInaccessible:t.isInaccessible,kind:t.kind,node:{kind:t.kind,name:(0,Jr.stringToNameNode)(t.name)},requireFetchReasonsFieldNames:new Set,subgraphNames:new Set(t.subgraphNames)});case Fe.Kind.OBJECT_TYPE_DEFINITION:return $(M({},n),{fieldDataByName:this.copyFieldDataByName(t.fieldDataByName,t.isInaccessible),implementedInterfaceTypeNames:new Set(t.implementedInterfaceTypeNames),isEntity:t.isEntity,isInaccessible:t.isInaccessible,isRootType:t.isRootType,kind:t.kind,node:{kind:t.kind,name:(0,Jr.stringToNameNode)(t.renamedTypeName||t.name)},requireFetchReasonsFieldNames:new Set,renamedTypeName:t.renamedTypeName,subgraphNames:new Set(t.subgraphNames)});case Fe.Kind.SCALAR_TYPE_DEFINITION:return $(M({},n),{kind:t.kind,node:{kind:t.kind,name:(0,Jr.stringToNameNode)(t.name)},subgraphNames:new Set(t.subgraphNames)});case Fe.Kind.UNION_TYPE_DEFINITION:return $(M({},n),{kind:t.kind,node:{kind:t.kind,name:(0,Jr.stringToNameNode)(t.name)},memberByMemberTypeName:new Map(t.memberByMemberTypeName),subgraphNames:new Set(t.subgraphNames)})}}getParentTargetData({existingData:t,incomingData:n}){if(!t){let r=this.copyParentDefinitionData(n);return(0,Oe.isParentDataRootType)(r)&&(r.extensionType=LV.ExtensionType.NONE),r}return this.extractPersistedDirectives({data:t.persistedDirectivesData,directivesByName:n.directivesByName}),t}upsertParentDefinitionData(t,n){let r=this.entityInterfaceFederationDataByTypeName.get(t.name),i=this.parentDefinitionDataByTypeName.get(t.name),a=this.getParentTargetData({existingData:i,incomingData:t});this.recordTagNamesByCoords(a);let o=(0,Oe.isNodeDataInaccessible)(a);if(o&&this.inaccessibleCoords.add(a.name),r&&r.interfaceObjectSubgraphNames.has(n)){if(i&&i.kind!==Fe.Kind.INTERFACE_TYPE_DEFINITION){this.errors.push((0,we.incompatibleParentTypeMergeError)({existingData:i,incomingSubgraphName:n}));return}a.kind=Fe.Kind.INTERFACE_TYPE_DEFINITION,a.node.kind=Fe.Kind.INTERFACE_TYPE_DEFINITION}if(!i){this.parentDefinitionDataByTypeName.set(a.name,a);return}if(a.kind!==t.kind&&(!r||!r.interfaceObjectSubgraphNames.has(n)||a.kind!==Fe.Kind.INTERFACE_TYPE_DEFINITION||t.kind!==Fe.Kind.OBJECT_TYPE_DEFINITION)){this.errors.push((0,we.incompatibleParentTypeMergeError)({existingData:a,incomingNodeType:(0,me.kindToNodeType)(t.kind),incomingSubgraphName:n}));return}switch((0,me.addNewObjectValueMapEntries)(t.configureDescriptionDataBySubgraphName,a.configureDescriptionDataBySubgraphName),(0,Oe.setLongestDescription)(a,t),(0,Oe.setParentDataExtensionType)(a,t),a.kind){case Fe.Kind.ENUM_TYPE_DEFINITION:if(!(0,Oe.areKindsEqual)(a,t))return;a.appearances+=1,a.isInaccessible||(a.isInaccessible=o),(0,me.addIterableToSet)({source:t.subgraphNames,target:a.subgraphNames});for(let l of t.enumValueDataByName.values())this.upsertEnumValueData(a.enumValueDataByName,l,o);return;case Fe.Kind.INPUT_OBJECT_TYPE_DEFINITION:if(!(0,Oe.areKindsEqual)(a,t))return;o&&!a.isInaccessible&&this.propagateInaccessibilityToExistingChildren(a),a.isInaccessible||(a.isInaccessible=o),(0,me.addIterableToSet)({source:t.subgraphNames,target:a.subgraphNames});for(let l of t.inputValueDataByName.values())this.upsertInputValueData(a.inputValueDataByName,l,a.name,a.isInaccessible);return;case Fe.Kind.INTERFACE_TYPE_DEFINITION:case Fe.Kind.OBJECT_TYPE_DEFINITION:let u=t;o&&!a.isInaccessible&&this.propagateInaccessibilityToExistingChildren(a),a.isInaccessible||(a.isInaccessible=o),(0,me.addIterableToSet)({source:u.implementedInterfaceTypeNames,target:a.implementedInterfaceTypeNames}),(0,me.addIterableToSet)({source:u.subgraphNames,target:a.subgraphNames});for(let l of u.fieldDataByName.values())this.upsertFieldData(a.fieldDataByName,l,a.isInaccessible);return;case Fe.Kind.UNION_TYPE_DEFINITION:if(!(0,Oe.areKindsEqual)(a,t))return;(0,me.addMapEntries)({source:t.memberByMemberTypeName,target:a.memberByMemberTypeName}),(0,me.addIterableToSet)({source:t.subgraphNames,target:a.subgraphNames});return;default:(0,me.addIterableToSet)({source:t.subgraphNames,target:a.subgraphNames});return}}propagateInaccessibilityToExistingChildren(t){switch(t.kind){case Fe.Kind.INPUT_OBJECT_TYPE_DEFINITION:for(let n of t.inputValueDataByName.values())this.inaccessibleCoords.add(n.federatedCoords);break;default:for(let n of t.fieldDataByName.values()){this.inaccessibleCoords.add(n.federatedCoords);for(let r of n.argumentDataByName.values())this.inaccessibleCoords.add(r.federatedCoords)}}}upsertPersistedDirectiveDefinitionData(t,n){let r=t.name,i=this.potentialPersistedDirectiveDefinitionDataByDirectiveName.get(r);if(!i){if(n>1)return;let a=new Map;for(let o of t.argumentDataByName.values())this.namedInputValueTypeNames.add(o.namedTypeName),this.upsertInputValueData(a,o,`@${t.name}`,!1);this.potentialPersistedDirectiveDefinitionDataByDirectiveName.set(r,{argumentDataByName:a,executableLocations:new Set(t.executableLocations),name:r,repeatable:t.repeatable,subgraphNames:new Set(t.subgraphNames),description:t.description});return}if(i.subgraphNames.size+1!==n){this.potentialPersistedDirectiveDefinitionDataByDirectiveName.delete(r);return}if((0,Oe.setMutualExecutableLocations)(i,t.executableLocations),i.executableLocations.size<1){this.potentialPersistedDirectiveDefinitionDataByDirectiveName.delete(r);return}for(let a of t.argumentDataByName.values())this.namedInputValueTypeNames.add((0,wV.getTypeNodeNamedTypeName)(a.type)),this.upsertInputValueData(i.argumentDataByName,a,`@${i.name}`,!1);(0,Oe.setLongestDescription)(i,t),i.repeatable&&(i.repeatable=t.repeatable),(0,me.addIterableToSet)({source:t.subgraphNames,target:i.subgraphNames})}shouldUpdateFederatedFieldAbstractNamedType(t,n){if(!t)return!1;let r=this.concreteTypeNamesByAbstractTypeName.get(t);if(!r||r.size<1)return!1;for(let i of n)if(!r.has(i))return!1;return!0}updateTypeNodeNamedType(t,n){let r=t;for(let i=0;i1){this.errors.push((0,we.incompatibleFederatedFieldNamedTypeError)(t,n));continue}break}case Fe.Kind.UNION_TYPE_DEFINITION:{if(l){this.errors.push((0,we.incompatibleFederatedFieldNamedTypeError)(t,n));continue}l=p;break}default:{this.errors.push((0,we.incompatibleFederatedFieldNamedTypeError)(t,n));break}}}if(o.size<1&&!l){this.errors.push((0,we.incompatibleFederatedFieldNamedTypeError)(t,n));continue}let d=l;if(o.size>0){if(l){this.errors.push((0,we.incompatibleFederatedFieldNamedTypeError)(t,n));continue}for(let p of o.keys()){d=p;for(let[E,h]of o)if(p!==E&&!h.implementedInterfaceTypeNames.has(p)){d="";break}if(d)break}}if(!this.shouldUpdateFederatedFieldAbstractNamedType(d,u)){this.errors.push((0,we.incompatibleFederatedFieldNamedTypeError)(t,n));continue}a.namedTypeName=d,this.updateTypeNodeNamedType(a.type,d)}}federateInternalSubgraphData(){let t=0,n=!1;for(let r of this.internalSubgraphBySubgraphName.values()){t+=1,this.currentSubgraphName=r.name,this.isVersionTwo||(this.isVersionTwo=r.isVersionTwo),(0,tpe.renameRootTypes)(this,r);for(let i of r.parentDefinitionDataByTypeName.values())this.upsertParentDefinitionData(i,r.name);if(!n){if(!r.persistedDirectiveDefinitionDataByDirectiveName.size){n=!0;continue}for(let i of r.persistedDirectiveDefinitionDataByDirectiveName.values())this.upsertPersistedDirectiveDefinitionData(i,t);this.potentialPersistedDirectiveDefinitionDataByDirectiveName.size<1&&(n=!0)}}this.handleDisparateFieldNamedTypes()}handleInterfaceObjectForInternalGraph({entityData:t,internalSubgraph:n,interfaceObjectData:r,interfaceObjectNode:i,resolvableKeyFieldSets:a,subgraphName:o}){let u=this.internalGraph.addOrUpdateNode(t.typeName),l=this.internalGraph.addEntityDataNode(t.typeName);for(let p of i.satisfiedFieldSets)u.satisfiedFieldSets.add(p),a.has(p)&&l.addTargetSubgraphByFieldSet(p,o);let d=r.fieldDatasBySubgraphName.get(o);for(let{name:p,namedTypeName:E}of d||[])this.internalGraph.addEdge(u,this.internalGraph.addOrUpdateNode(E),p);this.internalGraph.addEdge(i,u,t.typeName,!0),this.addValidPrimaryKeyTargetsFromInterfaceObject(n,i.typeName,t,u)}handleEntityInterfaces(){var t;for(let[n,r]of this.entityInterfaceFederationDataByTypeName){let i=(0,me.getOrThrowError)(this.parentDefinitionDataByTypeName,n,De.PARENT_DEFINITION_DATA);if(i.kind===Fe.Kind.INTERFACE_TYPE_DEFINITION)for(let a of r.interfaceObjectSubgraphNames){let o=(0,me.getOrThrowError)(this.internalSubgraphBySubgraphName,a,"internalSubgraphBySubgraphName"),u=o.configurationDataByTypeName,l=this.concreteTypeNamesByAbstractTypeName.get(n);if(!l)continue;let d=(0,me.getOrThrowError)(u,n,"configurationDataByTypeName"),p=d.keys;if(!p)continue;d.entityInterfaceConcreteTypeNames=new Set(r.concreteTypeNames),this.internalGraph.setSubgraphName(a);let E=this.internalGraph.addOrUpdateNode(n,{isAbstract:!0});for(let h of l){let v=(0,me.getOrThrowError)(this.parentDefinitionDataByTypeName,h,De.PARENT_DEFINITION_DATA);if(!(0,zr.isObjectDefinitionData)(v))continue;let A=(0,me.getOrThrowError)(this.entityDataByTypeName,h,"entityDataByTypeName");A.subgraphNames.add(a);let B=u.get(h);if(B)if((0,me.addIterableToSet)({source:d.fieldNames,target:B.fieldNames}),!B.keys)B.keys=[...p];else e:for(let ie of p){for(let{selectionSet:Ne}of B.keys)if(ie.selectionSet===Ne)continue e;B.keys.push(ie)}else u.set(h,{fieldNames:new Set(d.fieldNames),isRootNode:!0,keys:[...p],typeName:h});let V=new Set;for(let ie of p.filter(Ne=>!Ne.disableEntityResolver))V.add(ie.selectionSet);let J=this.authorizationDataByParentTypeName.get(n),re=(0,me.getOrThrowError)(o.parentDefinitionDataByTypeName,n,"internalSubgraph.parentDefinitionDataByTypeName");if((0,zr.isObjectDefinitionData)(re)){for(let[ie,Ne]of re.fieldDataByName){let Ee=`${h}.${ie}`;(0,me.getValueOrDefault)(this.fieldCoordsByNamedTypeName,Ne.namedTypeName,()=>new Set).add(Ee);let _e=J==null?void 0:J.fieldAuthDataByFieldName.get(ie);if(_e){let Z=(0,me.getValueOrDefault)(this.authorizationDataByParentTypeName,h,()=>(0,zr.newAuthorizationData)(h));(0,zr.upsertFieldAuthorizationData)(Z.fieldAuthDataByFieldName,_e)||this.invalidORScopesCoords.add(Ee)}let ye=v.fieldDataByName.get(ie);if(ye){let Z=(t=Ne.isShareableBySubgraphName.get(a))!=null?t:!1;ye.isShareableBySubgraphName.set(a,Z),ye.subgraphNames.add(a);let ge=Ne.externalFieldDataBySubgraphName.get(a);if(!ge)continue;ye.externalFieldDataBySubgraphName.set(a,M({},ge));continue}let qe=i.isInaccessible||v.isInaccessible||Ne.isInaccessible;v.fieldDataByName.set(ie,this.copyFieldData(Ne,qe))}this.handleInterfaceObjectForInternalGraph({internalSubgraph:o,subgraphName:a,interfaceObjectData:r,interfaceObjectNode:E,resolvableKeyFieldSets:V,entityData:A})}}}}}fieldDataToGraphFieldData(t){var n;return{externalSubgraphNames:new Set,name:t.name,namedTypeName:t.namedTypeName,isLeaf:(0,zr.isNodeLeaf)((n=this.parentDefinitionDataByTypeName.get(t.namedTypeName))==null?void 0:n.kind),subgraphNames:t.subgraphNames}}getValidFlattenedPersistedDirectiveNodeArray(t){var i;let n=(0,zr.getNodeCoords)(t),r=[];for(let[a,o]of t.persistedDirectivesData.directivesByName){if(a===De.SEMANTIC_NON_NULL&&(0,Oe.isFieldData)(t)){r.push((0,me.generateSemanticNonNullDirective)((i=(0,me.getFirstEntry)(t.nullLevelsBySubgraphName))!=null?i:new Set([0])));continue}let u=this.persistedDirectiveDefinitionByDirectiveName.get(a);if(u){if(o.length<2){r.push(...o);continue}if(!u.repeatable){this.errors.push((0,we.invalidRepeatedFederatedDirectiveErrorMessage)(a,n));continue}r.push(...o)}}return r}getRouterPersistedDirectiveNodes(t){let n=[...t.persistedDirectivesData.tagDirectiveByName.values()];return t.persistedDirectivesData.isDeprecated&&n.push((0,Oe.generateDeprecatedDirective)(t.persistedDirectivesData.deprecatedReason)),n.push(...this.getValidFlattenedPersistedDirectiveNodeArray(t)),n}getFederatedGraphNodeDescription(t){if(t.configureDescriptionDataBySubgraphName.size<1)return t.description;let n=[],r="";for(let[i,{propagate:a,description:o}]of t.configureDescriptionDataBySubgraphName)a&&(n.push(i),r=o);if(n.length===1)return(0,Yc.getDescriptionFromString)(r);if(n.length<1)return t.description;this.errors.push((0,we.configureDescriptionPropagationError)((0,Oe.getDefinitionDataCoords)(t,!0),n))}getNodeForRouterSchemaByData(t){return t.node.name=(0,Jr.stringToNameNode)(t.name),t.node.description=this.getFederatedGraphNodeDescription(t),t.node.directives=this.getRouterPersistedDirectiveNodes(t),t.node}getNodeWithPersistedDirectivesByInputValueData(t){return t.node.name=(0,Jr.stringToNameNode)(t.name),t.node.type=t.type,t.node.description=this.getFederatedGraphNodeDescription(t),t.node.directives=this.getRouterPersistedDirectiveNodes(t),t.includeDefaultValue&&(t.node.defaultValue=t.defaultValue),t.node}getValidFieldArgumentNodes(t){let n=[],r=[],i=[],a=`${t.renamedParentTypeName}.${t.name}`;for(let[o,u]of t.argumentDataByName)t.subgraphNames.size===u.subgraphNames.size?(r.push(o),n.push(this.getNodeWithPersistedDirectivesByInputValueData(u))):(0,Oe.isTypeRequired)(u.type)&&i.push({inputValueName:o,missingSubgraphs:(0,me.getEntriesNotInHashSet)(t.subgraphNames,u.subgraphNames),requiredSubgraphs:[...u.requiredSubgraphNames]});return i.length>0?this.errors.push((0,we.invalidRequiredInputValueError)(De.FIELD,a,i)):r.length>0&&((0,me.getValueOrDefault)(this.fieldConfigurationByFieldCoords,a,()=>({argumentNames:r,fieldName:t.name,typeName:t.renamedParentTypeName})).argumentNames=r),n}getNodeWithPersistedDirectivesByFieldData(t,n){return t.node.arguments=n,t.node.name=(0,Jr.stringToNameNode)(t.name),t.node.type=t.type,t.node.description=this.getFederatedGraphNodeDescription(t),t.node.directives=this.getRouterPersistedDirectiveNodes(t),t.node}validateSemanticNonNull(t){let n;for(let r of t.nullLevelsBySubgraphName.values()){if(!n){n=r;continue}if(n.size!==r.size){this.errors.push((0,we.semanticNonNullInconsistentLevelsError)(t));return}for(let i of r)if(!n.has(i)){this.errors.push((0,we.semanticNonNullInconsistentLevelsError)(t));return}}}validateOneOfDirective({data:t,inputValueNodes:n,requiredFieldNames:r}){return t.directivesByName.has(De.ONE_OF)?r.size>0?(this.errors.push((0,we.oneOfRequiredFieldsError)({requiredFieldNames:Array.from(r),typeName:t.name})),!1):(n.length===1&&this.warnings.push((0,npe.singleFederatedInputFieldOneOfWarning)({fieldName:n[0].name.value,typeName:t.name})),!0):!0}pushParentDefinitionDataToDocumentDefinitions(t){for(let[n,r]of this.parentDefinitionDataByTypeName)switch(r.extensionType!==LV.ExtensionType.NONE&&this.errors.push((0,we.noBaseDefinitionForExtensionError)((0,me.kindToNodeType)(r.kind),n)),r.kind){case Fe.Kind.ENUM_TYPE_DEFINITION:{if(Jc.IGNORED_FEDERATED_TYPE_NAMES.has(n))break;let i=[],a=[],o=this.getEnumValueMergeMethod(n);(0,Oe.propagateAuthDirectives)(r,this.authorizationDataByParentTypeName.get(n));for(let u of r.enumValueDataByName.values()){let l=this.getNodeForRouterSchemaByData(u),d=(0,Oe.isNodeDataInaccessible)(u),p=$(M({},u.node),{directives:(0,Oe.getClientPersistedDirectiveNodes)(u)});switch(o){case Oe.MergeMethod.CONSISTENT:!d&&r.appearances>u.appearances&&this.errors.push((0,we.incompatibleSharedEnumError)(n)),i.push(l),d||a.push(p);break;case Oe.MergeMethod.INTERSECTION:r.appearances===u.appearances&&(i.push(l),d||a.push(p));break;default:i.push(l),d||a.push(p);break}}if(r.node.values=i,this.routerDefinitions.push(this.getNodeForRouterSchemaByData(r)),(0,Oe.isNodeDataInaccessible)(r)){this.validateReferencesOfInaccessibleType(r),this.internalGraph.setNodeInaccessible(r.name);break}if(a.length<1){this.errors.push((0,we.allChildDefinitionsAreInaccessibleError)((0,me.kindToNodeType)(r.kind),n,De.ENUM_VALUE));break}this.clientDefinitions.push($(M({},r.node),{directives:(0,Oe.getClientPersistedDirectiveNodes)(r),values:a}));break}case Fe.Kind.INPUT_OBJECT_TYPE_DEFINITION:{if(Jc.IGNORED_FEDERATED_TYPE_NAMES.has(n))break;let i=new Array,a=new Array,o=new Array,u=new Set;for(let[l,d]of r.inputValueDataByName)if((0,Oe.isTypeRequired)(d.type)&&u.add(l),r.subgraphNames.size===d.subgraphNames.size){if(a.push(this.getNodeWithPersistedDirectivesByInputValueData(d)),(0,Oe.isNodeDataInaccessible)(d))continue;o.push($(M({},d.node),{directives:(0,Oe.getClientPersistedDirectiveNodes)(d)}))}else(0,Oe.isTypeRequired)(d.type)&&i.push({inputValueName:l,missingSubgraphs:(0,me.getEntriesNotInHashSet)(r.subgraphNames,d.subgraphNames),requiredSubgraphs:[...d.requiredSubgraphNames]});if(i.length>0){this.errors.push((0,we.invalidRequiredInputValueError)(De.INPUT_OBJECT,n,i,!1));break}if(!this.validateOneOfDirective({data:r,inputValueNodes:a,requiredFieldNames:u}))break;if(r.node.fields=a,this.routerDefinitions.push(this.getNodeForRouterSchemaByData(r)),(0,Oe.isNodeDataInaccessible)(r)){this.validateReferencesOfInaccessibleType(r);break}if(o.length<1){this.errors.push((0,we.allChildDefinitionsAreInaccessibleError)((0,me.kindToNodeType)(r.kind),n,"Input field"));break}this.clientDefinitions.push($(M({},r.node),{directives:(0,Oe.getClientPersistedDirectiveNodes)(r),fields:o}));break}case Fe.Kind.INTERFACE_TYPE_DEFINITION:case Fe.Kind.OBJECT_TYPE_DEFINITION:{let i=[],a=[],o=new Map,u=(0,Oe.newInvalidFieldNames)(),l=r.kind===Fe.Kind.OBJECT_TYPE_DEFINITION,d=this.authorizationDataByParentTypeName.get(n);(0,Oe.propagateAuthDirectives)(r,d);for(let[E,h]of r.fieldDataByName){(0,Oe.propagateFieldAuthDirectives)(h,d);let v=this.getValidFieldArgumentNodes(h);l&&(0,Oe.validateExternalAndShareable)(h,u),this.validateSemanticNonNull(h),i.push(this.getNodeWithPersistedDirectivesByFieldData(h,v)),!(0,Oe.isNodeDataInaccessible)(h)&&(a.push((0,Oe.getClientSchemaFieldNodeByFieldData)(h)),o.set(E,this.fieldDataToGraphFieldData(h)))}if(l&&(u.byShareable.size>0&&this.errors.push((0,we.invalidFieldShareabilityError)(r,u.byShareable)),u.subgraphNamesByExternalFieldName.size>0&&this.errors.push((0,we.allExternalFieldInstancesError)(n,u.subgraphNamesByExternalFieldName))),r.node.fields=i,this.internalGraph.initializeNode(n,o),r.implementedInterfaceTypeNames.size>0){t.push({data:r,clientSchemaFieldNodes:a});break}this.routerDefinitions.push(this.getNodeForRouterSchemaByData(r));let p=(0,epe.isNodeQuery)(n);if((0,Oe.isNodeDataInaccessible)(r)){if(p){this.errors.push(we.inaccessibleQueryRootTypeError);break}this.validateReferencesOfInaccessibleType(r),this.internalGraph.setNodeInaccessible(r.name);break}if(a.length<1){let E=p?(0,we.noQueryRootTypeError)(!1):(0,we.allChildDefinitionsAreInaccessibleError)((0,me.kindToNodeType)(r.kind),n,De.FIELD);this.errors.push(E);break}this.clientDefinitions.push($(M({},r.node),{directives:(0,Oe.getClientPersistedDirectiveNodes)(r),fields:a}));break}case Fe.Kind.SCALAR_TYPE_DEFINITION:{if(Jc.IGNORED_FEDERATED_TYPE_NAMES.has(n))break;if((0,Oe.propagateAuthDirectives)(r,this.authorizationDataByParentTypeName.get(n)),this.routerDefinitions.push(this.getNodeForRouterSchemaByData(r)),(0,Oe.isNodeDataInaccessible)(r)){this.validateReferencesOfInaccessibleType(r),this.internalGraph.setNodeInaccessible(r.name);break}this.clientDefinitions.push($(M({},r.node),{directives:(0,Oe.getClientPersistedDirectiveNodes)(r)}));break}case Fe.Kind.UNION_TYPE_DEFINITION:{if(r.node.types=(0,zr.mapToArrayOfValues)(r.memberByMemberTypeName),this.routerDefinitions.push(this.getNodeForRouterSchemaByData(r)),(0,Oe.isNodeDataInaccessible)(r)){this.validateReferencesOfInaccessibleType(r),this.internalGraph.setNodeInaccessible(r.name);break}let i=this.getClientSchemaUnionMembers(r);if(i.length<1){this.errors.push((0,we.allChildDefinitionsAreInaccessibleError)(De.UNION,n,"union member type"));break}this.clientDefinitions.push($(M({},r.node),{directives:(0,Oe.getClientPersistedDirectiveNodes)(r),types:i}));break}}}pushNamedTypeAuthDataToFields(){var t;for(let[n,r]of this.authorizationDataByParentTypeName){if(!r.requiresAuthentication&&r.requiredScopes.length<1)continue;let i=this.fieldCoordsByNamedTypeName.get(n);if(i)for(let a of i){let o=a.split(De.LITERAL_PERIOD);switch(o.length){case 2:{let u=(0,me.getValueOrDefault)(this.authorizationDataByParentTypeName,o[0],()=>(0,zr.newAuthorizationData)(o[0])),l=(0,me.getValueOrDefault)(u.fieldAuthDataByFieldName,o[1],()=>(0,zr.newFieldAuthorizationData)(o[1]));(t=l.inheritedData).requiresAuthentication||(t.requiresAuthentication=r.requiresAuthentication),l.inheritedData.requiredScopes.length*r.requiredScopes.length>Fp.MAX_OR_SCOPES?this.invalidORScopesCoords.add(a):(l.inheritedData.requiredScopesByOR=(0,zr.mergeRequiredScopesByAND)(l.inheritedData.requiredScopesByOR,r.requiredScopesByOR),l.inheritedData.requiredScopes=(0,zr.mergeRequiredScopesByAND)(l.inheritedData.requiredScopes,r.requiredScopes));break}default:break}}}}federateSubgraphData(){this.federateInternalSubgraphData(),this.handleEntityInterfaces(),this.generateTagData(),yl(this,Nh,UV).call(this),this.pushNamedTypeAuthDataToFields()}validateInterfaceImplementationsAndPushToDocumentDefinitions(t){for(let{data:n,clientSchemaFieldNodes:r}of t){if(n.node.interfaces=this.getValidImplementedInterfaces(n),this.routerDefinitions.push(this.getNodeForRouterSchemaByData(n)),(0,Oe.isNodeDataInaccessible)(n)){this.validateReferencesOfInaccessibleType(n),this.internalGraph.setNodeInaccessible(n.name);continue}let i=[];for(let a of n.implementedInterfaceTypeNames)this.inaccessibleCoords.has(a)||i.push((0,Jr.stringToNamedTypeNode)(a));this.clientDefinitions.push($(M({},n.node),{directives:(0,Oe.getClientPersistedDirectiveNodes)(n),fields:r,interfaces:i}))}}validatePathSegmentInaccessibility(t){if(!t)return!1;let r=t.split(De.LEFT_PARENTHESIS)[0].split(De.LITERAL_PERIOD),i=r[0];for(let a=0;a0&&this.errors.push((0,we.invalidReferencesOfInaccessibleTypeError)((0,me.kindToNodeType)(t.kind),t.name,r))}validateQueryRootType(){let t=this.parentDefinitionDataByTypeName.get(De.QUERY);if(!t||t.kind!==Fe.Kind.OBJECT_TYPE_DEFINITION||t.fieldDataByName.size<1){this.errors.push((0,we.noQueryRootTypeError)());return}for(let n of t.fieldDataByName.values())if(!(0,Oe.isNodeDataInaccessible)(n))return;this.errors.push((0,we.noQueryRootTypeError)())}validateSubscriptionFieldConditionFieldPath(t,n,r,i,a){let o=t.split(De.LITERAL_PERIOD);if(o.length<1)return a.push((0,we.invalidSubscriptionFieldConditionFieldPathErrorMessage)(r,t)),[];let u=n;if(this.inaccessibleCoords.has(u.renamedTypeName))return a.push((0,we.inaccessibleSubscriptionFieldConditionFieldPathFieldErrorMessage)(r,t,o[0],u.renamedTypeName)),[];let l="";for(let d=0;d0?`.${p}`:p,u.kind!==Fe.Kind.OBJECT_TYPE_DEFINITION)return a.push((0,we.invalidSubscriptionFieldConditionFieldPathParentErrorMessage)(r,t,l)),[];let E=u.fieldDataByName.get(p);if(!E)return a.push((0,we.undefinedSubscriptionFieldConditionFieldPathFieldErrorMessage)(r,t,l,p,u.renamedTypeName)),[];let h=`${u.renamedTypeName}.${p}`;if(!E.subgraphNames.has(i))return a.push((0,we.invalidSubscriptionFieldConditionFieldPathFieldErrorMessage)(r,t,l,h,i)),[];if(this.inaccessibleCoords.has(h))return a.push((0,we.inaccessibleSubscriptionFieldConditionFieldPathFieldErrorMessage)(r,t,l,h)),[];if(Fp.BASE_SCALARS.has(E.namedTypeName)){u={kind:Fe.Kind.SCALAR_TYPE_DEFINITION,name:E.namedTypeName};continue}u=(0,me.getOrThrowError)(this.parentDefinitionDataByTypeName,E.namedTypeName,De.PARENT_DEFINITION_DATA)}return(0,Oe.isLeafKind)(u.kind)?o:(a.push((0,we.nonLeafSubscriptionFieldConditionFieldPathFinalFieldErrorMessage)(r,t,o[o.length-1],(0,me.kindToNodeType)(u.kind),u.name)),[])}validateSubscriptionFieldCondition(t,n,r,i,a,o,u){if(i>ph.MAX_SUBSCRIPTION_FILTER_DEPTH||this.isMaxDepth)return u.push((0,we.subscriptionFilterConditionDepthExceededErrorMessage)(a)),this.isMaxDepth=!0,!1;let l=!1,d=new Set([De.FIELD_PATH,De.VALUES]),p=new Set,E=new Set,h=[];for(let v of t.fields){let A=v.name.value,B=a+`.${A}`;switch(A){case De.FIELD_PATH:{if(d.has(De.FIELD_PATH))d.delete(De.FIELD_PATH);else{l=!0,p.add(De.FIELD_PATH);break}if(v.value.kind!==Fe.Kind.STRING){h.push((0,we.invalidInputFieldTypeErrorMessage)(B,De.STRING,(0,me.kindToNodeType)(v.value.kind))),l=!0;break}let V=this.validateSubscriptionFieldConditionFieldPath(v.value.value,r,B,o,h);if(V.length<1){l=!0;break}n.fieldPath=V;break}case De.VALUES:{if(d.has(De.VALUES))d.delete(De.VALUES);else{l=!0,p.add(De.VALUES);break}let V=v.value.kind;if(V==Fe.Kind.NULL||V==Fe.Kind.OBJECT){h.push((0,we.invalidInputFieldTypeErrorMessage)(B,De.LIST,(0,me.kindToNodeType)(v.value.kind))),l=!0;break}if(V!==Fe.Kind.LIST){n.values=[(0,Oe.getSubscriptionFilterValue)(v.value)];break}let J=new Set,re=[];for(let ie=0;ie0){h.push((0,we.subscriptionFieldConditionInvalidValuesArrayErrorMessage)(B,re));continue}if(J.size<1){l=!0,h.push((0,we.subscriptionFieldConditionEmptyValuesArrayErrorMessage)(B));continue}n.values=[...J];break}default:l=!0,E.add(A)}}return l?(u.push((0,we.subscriptionFieldConditionInvalidInputFieldErrorMessage)(a,[...d],[...p],[...E],h)),!1):!0}validateSubscriptionFilterCondition(t,n,r,i,a,o,u){if(i>ph.MAX_SUBSCRIPTION_FILTER_DEPTH||this.isMaxDepth)return u.push((0,we.subscriptionFilterConditionDepthExceededErrorMessage)(a)),this.isMaxDepth=!0,!1;if(i+=1,t.fields.length!==1)return u.push((0,we.subscriptionFilterConditionInvalidInputFieldNumberErrorMessage)(a,t.fields.length)),!1;let l=t.fields[0],d=l.name.value;if(!Jc.SUBSCRIPTION_FILTER_INPUT_NAMES.has(d))return u.push((0,we.subscriptionFilterConditionInvalidInputFieldErrorMessage)(a,d)),!1;let p=a+`.${d}`;switch(l.value.kind){case Fe.Kind.OBJECT:switch(d){case De.IN_UPPER:return n.in={fieldPath:[],values:[]},this.validateSubscriptionFieldCondition(l.value,n.in,r,i,a+".IN",o,u);case De.NOT_UPPER:return n.not={},this.validateSubscriptionFilterCondition(l.value,n.not,r,i,a+".NOT",o,u);default:return u.push((0,we.subscriptionFilterConditionInvalidInputFieldTypeErrorMessage)(p,De.LIST,De.OBJECT)),!1}case Fe.Kind.LIST:{let E=[];switch(d){case De.AND_UPPER:{n.and=E;break}case De.OR_UPPER:{n.or=E;break}default:return u.push((0,we.subscriptionFilterConditionInvalidInputFieldTypeErrorMessage)(p,De.OBJECT,De.LIST)),!1}let h=l.value.values.length;if(h<1||h>5)return u.push((0,we.subscriptionFilterArrayConditionInvalidLengthErrorMessage)(p,h)),!1;let v=!0,A=[];for(let B=0;B0?(u.push((0,we.subscriptionFilterArrayConditionInvalidItemTypeErrorMessage)(p,A)),!1):v}default:{let E=Jc.SUBSCRIPTION_FILTER_LIST_INPUT_NAMES.has(d)?De.LIST:De.OBJECT;return u.push((0,we.subscriptionFilterConditionInvalidInputFieldTypeErrorMessage)(p,E,(0,me.kindToNodeType)(l.value.kind))),!1}}}validateSubscriptionFilterAndGenerateConfiguration(t,n,r,i,a,o){if(!t.arguments||t.arguments.length!==1)return;let u=t.arguments[0];if(u.value.kind!==Fe.Kind.OBJECT){this.errors.push((0,we.invalidSubscriptionFilterDirectiveError)(r,[(0,we.subscriptionFilterConditionInvalidInputFieldTypeErrorMessage)(De.CONDITION,De.OBJECT,(0,me.kindToNodeType)(u.value.kind))]));return}let l={},d=[];if(!this.validateSubscriptionFilterCondition(u.value,l,n,0,De.CONDITION,o,d)){this.errors.push((0,we.invalidSubscriptionFilterDirectiveError)(r,d)),this.isMaxDepth=!1;return}(0,me.getValueOrDefault)(this.fieldConfigurationByFieldCoords,r,()=>({argumentNames:[],fieldName:i,typeName:a})).subscriptionFilterCondition=l}validateSubscriptionFiltersAndGenerateConfiguration(){for(let[t,n]of this.subscriptionFilterDataByFieldPath){if(this.inaccessibleCoords.has(t))continue;let r=this.parentDefinitionDataByTypeName.get(n.fieldData.namedTypeName);if(!r){this.errors.push((0,we.invalidSubscriptionFilterDirectiveError)(t,[(0,we.subscriptionFilterNamedTypeErrorMessage)(n.fieldData.namedTypeName)]));continue}(0,Oe.isNodeDataInaccessible)(r)||r.kind===Fe.Kind.OBJECT_TYPE_DEFINITION&&this.validateSubscriptionFilterAndGenerateConfiguration(n.directive,r,t,n.fieldData.name,n.fieldData.renamedParentTypeName,n.directiveSubgraphName)}}buildFederationResult(){this.subscriptionFilterDataByFieldPath.size>0&&this.validateSubscriptionFiltersAndGenerateConfiguration(),this.invalidORScopesCoords.size>0&&this.errors.push((0,we.orScopesLimitError)(Fp.MAX_OR_SCOPES,[...this.invalidORScopesCoords]));for(let a of this.potentialPersistedDirectiveDefinitionDataByDirectiveName.values())(0,Oe.addValidPersistedDirectiveDefinitionNodeByData)(this.routerDefinitions,a,this.persistedDirectiveDefinitionByDirectiveName,this.errors);let t=[];this.pushParentDefinitionDataToDocumentDefinitions(t),this.validateInterfaceImplementationsAndPushToDocumentDefinitions(t),this.validateQueryRootType();for(let a of this.inaccessibleRequiredInputValueErrorByCoords.values())this.errors.push(a);if(this.errors.length>0)return{errors:this.errors,success:!1,warnings:this.warnings};if(!this.options.disableResolvabilityValidation&&this.internalSubgraphBySubgraphName.size>1){let a=this.internalGraph.validate();if(!a.success)return{errors:a.errors,success:!1,warnings:this.warnings}}let n={kind:Fe.Kind.DOCUMENT,definitions:this.routerDefinitions},r=(0,Fe.buildASTSchema)({kind:Fe.Kind.DOCUMENT,definitions:this.clientDefinitions},{assumeValid:!0,assumeValidSDL:!0}),i=new Map;for(let{configurationDataByTypeName:a,costs:o,directiveDefinitionByName:u,isVersionTwo:l,name:d,parentDefinitionDataByTypeName:p,schema:E,schemaNode:h}of this.internalSubgraphBySubgraphName.values())i.set(d,{configurationDataByTypeName:a,costs:o,directiveDefinitionByName:u,isVersionTwo:l,parentDefinitionDataByTypeName:p,schema:E,schemaNode:h});for(let a of this.authorizationDataByParentTypeName.values())(0,zr.upsertAuthorizationConfiguration)(this.fieldConfigurationByFieldCoords,a);return M({directiveDefinitionByName:this.directiveDefinitionByName,fieldConfigurations:Array.from(this.fieldConfigurationByFieldCoords.values()),federatedGraphAST:n,federatedGraphSchema:(0,Fe.buildASTSchema)(n,{assumeValid:!0,assumeValidSDL:!0}),federatedGraphClientSchema:r,parentDefinitionDataByTypeName:this.parentDefinitionDataByTypeName,subgraphConfigBySubgraphName:i,success:!0,warnings:this.warnings},this.getClientSchemaObjectBoolean())}getClientSchemaObjectBoolean(){return this.inaccessibleCoords.size<1&&this.tagNamesByCoords.size<1?{}:{shouldIncludeClientSchema:!0}}handleChildTagExclusions(t,n,r,i){let a=n.size;for(let[o,u]of r){let l=(0,me.getOrThrowError)(n,o,`${t.name}.childDataByChildName`);if((0,Oe.isNodeDataInaccessible)(l)){a-=1;continue}i.isDisjointFrom(u.tagNames)||((0,me.getValueOrDefault)(l.persistedDirectivesData.directivesByName,De.INACCESSIBLE,()=>[(0,me.generateSimpleDirective)(De.INACCESSIBLE)]),this.inaccessibleCoords.add(`${t.name}.${o}`),a-=1)}a<1&&(t.persistedDirectivesData.directivesByName.set(De.INACCESSIBLE,[(0,me.generateSimpleDirective)(De.INACCESSIBLE)]),this.inaccessibleCoords.add(t.name))}handleChildTagInclusions(t,n,r,i){let a=n.size;for(let[o,u]of n){if((0,Oe.isNodeDataInaccessible)(u)){a-=1;continue}let l=r.get(o);(!l||i.isDisjointFrom(l.tagNames))&&((0,me.getValueOrDefault)(u.persistedDirectivesData.directivesByName,De.INACCESSIBLE,()=>[(0,me.generateSimpleDirective)(De.INACCESSIBLE)]),this.inaccessibleCoords.add(`${t.name}.${o}`),a-=1)}a<1&&(t.persistedDirectivesData.directivesByName.set(De.INACCESSIBLE,[(0,me.generateSimpleDirective)(De.INACCESSIBLE)]),this.inaccessibleCoords.add(t.name))}buildFederationContractResult(t){if(this.isVersionTwo||this.routerDefinitions.push(xu.INACCESSIBLE_DEFINITION),t.tagNamesToExclude.size>0)for(let[o,u]of this.parentTagDataByTypeName){let l=(0,me.getOrThrowError)(this.parentDefinitionDataByTypeName,o,De.PARENT_DEFINITION_DATA);if(!(0,Oe.isNodeDataInaccessible)(l)){if(!t.tagNamesToExclude.isDisjointFrom(u.tagNames)){l.persistedDirectivesData.directivesByName.set(De.INACCESSIBLE,[(0,me.generateSimpleDirective)(De.INACCESSIBLE)]),this.inaccessibleCoords.add(o);continue}if(!(u.childTagDataByChildName.size<1))switch(l.kind){case Fe.Kind.SCALAR_TYPE_DEFINITION:case Fe.Kind.UNION_TYPE_DEFINITION:break;case Fe.Kind.ENUM_TYPE_DEFINITION:{this.handleChildTagExclusions(l,l.enumValueDataByName,u.childTagDataByChildName,t.tagNamesToExclude);break}case Fe.Kind.INPUT_OBJECT_TYPE_DEFINITION:{this.handleChildTagExclusions(l,l.inputValueDataByName,u.childTagDataByChildName,t.tagNamesToExclude);break}default:{let d=l.fieldDataByName.size;for(let[p,E]of u.childTagDataByChildName){let h=(0,me.getOrThrowError)(l.fieldDataByName,p,`${o}.fieldDataByFieldName`);if((0,Oe.isNodeDataInaccessible)(h)){d-=1;continue}if(!t.tagNamesToExclude.isDisjointFrom(E.tagNames)){(0,me.getValueOrDefault)(h.persistedDirectivesData.directivesByName,De.INACCESSIBLE,()=>[(0,me.generateSimpleDirective)(De.INACCESSIBLE)]),this.inaccessibleCoords.add(h.federatedCoords),d-=1;continue}for(let[v,A]of E.tagNamesByArgumentName){let B=(0,me.getOrThrowError)(h.argumentDataByName,v,`${p}.argumentDataByArgumentName`);(0,Oe.isNodeDataInaccessible)(B)||t.tagNamesToExclude.isDisjointFrom(A)||((0,me.getValueOrDefault)(B.persistedDirectivesData.directivesByName,De.INACCESSIBLE,()=>[(0,me.generateSimpleDirective)(De.INACCESSIBLE)]),this.inaccessibleCoords.add(B.federatedCoords))}}d<1&&(l.persistedDirectivesData.directivesByName.set(De.INACCESSIBLE,[(0,me.generateSimpleDirective)(De.INACCESSIBLE)]),this.inaccessibleCoords.add(o))}}}}else if(t.tagNamesToInclude.size>0)for(let[o,u]of this.parentDefinitionDataByTypeName){if((0,Oe.isNodeDataInaccessible)(u))continue;let l=this.parentTagDataByTypeName.get(o);if(!l){u.persistedDirectivesData.directivesByName.set(De.INACCESSIBLE,[(0,me.generateSimpleDirective)(De.INACCESSIBLE)]),this.inaccessibleCoords.add(o);continue}if(t.tagNamesToInclude.isDisjointFrom(l.tagNames)){if(l.childTagDataByChildName.size<1){u.persistedDirectivesData.directivesByName.set(De.INACCESSIBLE,[(0,me.generateSimpleDirective)(De.INACCESSIBLE)]),this.inaccessibleCoords.add(o);continue}switch(u.kind){case Fe.Kind.SCALAR_TYPE_DEFINITION:case Fe.Kind.UNION_TYPE_DEFINITION:continue;case Fe.Kind.ENUM_TYPE_DEFINITION:this.handleChildTagInclusions(u,u.enumValueDataByName,l.childTagDataByChildName,t.tagNamesToInclude);break;case Fe.Kind.INPUT_OBJECT_TYPE_DEFINITION:this.handleChildTagInclusions(u,u.inputValueDataByName,l.childTagDataByChildName,t.tagNamesToInclude);break;default:let d=u.fieldDataByName.size;for(let[p,E]of u.fieldDataByName){if((0,Oe.isNodeDataInaccessible)(E)){d-=1;continue}let h=l.childTagDataByChildName.get(p);(!h||t.tagNamesToInclude.isDisjointFrom(h.tagNames))&&((0,me.getValueOrDefault)(E.persistedDirectivesData.directivesByName,De.INACCESSIBLE,()=>[(0,me.generateSimpleDirective)(De.INACCESSIBLE)]),this.inaccessibleCoords.add(E.federatedCoords),d-=1)}d<1&&(u.persistedDirectivesData.directivesByName.set(De.INACCESSIBLE,[(0,me.generateSimpleDirective)(De.INACCESSIBLE)]),this.inaccessibleCoords.add(o))}}}this.subscriptionFilterDataByFieldPath.size>0&&this.validateSubscriptionFiltersAndGenerateConfiguration();for(let o of this.potentialPersistedDirectiveDefinitionDataByDirectiveName.values())(0,Oe.addValidPersistedDirectiveDefinitionNodeByData)(this.routerDefinitions,o,this.persistedDirectiveDefinitionByDirectiveName,this.errors);let n=[];if(this.pushParentDefinitionDataToDocumentDefinitions(n),this.validateInterfaceImplementationsAndPushToDocumentDefinitions(n),this.validateQueryRootType(),this.errors.length>0)return{errors:this.errors,success:!1,warnings:this.warnings};let r={kind:Fe.Kind.DOCUMENT,definitions:this.routerDefinitions},i=(0,Fe.buildASTSchema)({kind:Fe.Kind.DOCUMENT,definitions:this.clientDefinitions},{assumeValid:!0,assumeValidSDL:!0}),a=new Map;for(let{configurationDataByTypeName:o,costs:u,directiveDefinitionByName:l,isVersionTwo:d,name:p,parentDefinitionDataByTypeName:E,schema:h,schemaNode:v}of this.internalSubgraphBySubgraphName.values())a.set(p,{configurationDataByTypeName:o,costs:u,directiveDefinitionByName:l,isVersionTwo:d,parentDefinitionDataByTypeName:E,schema:h,schemaNode:v});for(let o of this.authorizationDataByParentTypeName.values())(0,zr.upsertAuthorizationConfiguration)(this.fieldConfigurationByFieldCoords,o);return M({directiveDefinitionByName:this.directiveDefinitionByName,fieldConfigurations:Array.from(this.fieldConfigurationByFieldCoords.values()),federatedGraphAST:r,federatedGraphSchema:(0,Fe.buildASTSchema)(r,{assumeValid:!0,assumeValidSDL:!0}),federatedGraphClientSchema:i,parentDefinitionDataByTypeName:this.parentDefinitionDataByTypeName,subgraphConfigBySubgraphName:a,success:!0,warnings:this.warnings},this.getClientSchemaObjectBoolean())}federateSubgraphsInternal(){return this.federateSubgraphData(),this.buildFederationResult()}};Nh=new WeakSet,UV=function(){var r;let t=new Set,n=new Set;for(let i of this.referencedPersistedDirectiveNames){let a=Fp.DIRECTIVE_DEFINITION_BY_NAME.get(i);if(!a)continue;let o=(r=Jc.DEPENDENCIES_BY_DIRECTIVE_NAME.get(i))!=null?r:[];this.directiveDefinitionByName.set(i,a),Jc.CLIENT_PERSISTED_DIRECTIVE_NAMES.has(i)&&(this.clientDefinitions.push(a),(0,me.addIterableToSet)({source:o,target:t})),this.routerDefinitions.push(a),(0,me.addIterableToSet)({source:o,target:n})}this.clientDefinitions.push(...t),this.routerDefinitions.push(...n)};zc.FederationFactory=mh;function gb({options:e,subgraphs:t}){if(t.length<1)return{errors:[we.minimumSubgraphRequirementError],success:!1,warnings:[]};let n=(0,Zfe.batchNormalize)({subgraphs:t,options:e});if(!n.success)return{errors:n.errors,success:!1,warnings:n.warnings};let r=new Map,i=new Map;for(let[u,l]of n.internalSubgraphBySubgraphName)for(let[d,p]of l.entityInterfaces){let E=r.get(d);if(!E){r.set(d,(0,zr.newEntityInterfaceFederationData)(p,u));continue}(0,zr.upsertEntityInterfaceFederationData)(E,p,u)}let a=new Array,o=new Map;for(let[u,l]of r){let d=l.concreteTypeNames.size;for(let[p,E]of l.subgraphDataByTypeName){let h=(0,me.getValueOrDefault)(o,p,()=>new Set);if((0,me.addIterableToSet)({source:E.concreteTypeNames,target:h}),!E.isInterfaceObject){E.resolvable&&E.concreteTypeNames.size!==d&&(0,me.getValueOrDefault)(i,u,()=>new Array).push({subgraphName:p,definedConcreteTypeNames:new Set(E.concreteTypeNames),requiredConcreteTypeNames:new Set(l.concreteTypeNames)});continue}(0,me.addIterableToSet)({source:l.concreteTypeNames,target:h});let{parentDefinitionDataByTypeName:v}=(0,me.getOrThrowError)(n.internalSubgraphBySubgraphName,p,"internalSubgraphBySubgraphName"),A=[];for(let B of l.concreteTypeNames)v.has(B)&&A.push(B);A.length>0&&a.push((0,we.invalidInterfaceObjectImplementationDefinitionsError)(u,p,A))}}for(let[u,l]of i){let d=new Array;for(let p of l){let E=o.get(p.subgraphName);if(!E){d.push(p);continue}let h=p.requiredConcreteTypeNames.intersection(E);p.requiredConcreteTypeNames.size!==h.size&&(p.definedConcreteTypeNames=h,d.push(p))}if(d.length>0){i.set(u,d);continue}i.delete(u)}return i.size>0&&a.push((0,we.undefinedEntityInterfaceImplementationsError)(i,r)),a.length>0?{errors:a,success:!1,warnings:n.warnings}:{federationFactory:new mh({authorizationDataByParentTypeName:n.authorizationDataByParentTypeName,concreteTypeNamesByAbstractTypeName:n.concreteTypeNamesByAbstractTypeName,entityDataByTypeName:n.entityDataByTypeName,entityInterfaceFederationDataByTypeName:r,fieldCoordsByNamedTypeName:n.fieldCoordsByNamedTypeName,interfaceImplementationTypeNamesByInterfaceTypeName:n.interfaceImplementationTypeNamesByInterfaceTypeName,internalSubgraphBySubgraphName:n.internalSubgraphBySubgraphName,internalGraph:n.internalGraph,options:e,warnings:n.warnings}),success:!0,warnings:n.warnings}}function rpe({options:e,subgraphs:t}){let n=gb({options:e,subgraphs:t});return n.success?n.federationFactory.federateSubgraphsInternal():{errors:n.errors,success:!1,warnings:n.warnings}}function ipe({options:e,subgraphs:t,tagOptionsByContractName:n}){let r=gb({options:e,subgraphs:t});if(!r.success)return{errors:r.errors,success:!1,warnings:r.warnings};r.federationFactory.federateSubgraphData();let i=[(0,CV.cloneDeep)(r.federationFactory)],a=r.federationFactory.buildFederationResult();if(!a.success)return{errors:a.errors,success:!1,warnings:a.warnings};let o=n.size-1,u=new Map,l=0;for(let[d,p]of n){l!==o&&i.push((0,CV.cloneDeep)(i[l]));let E=i[l].buildFederationContractResult(p);u.set(d,E),l++}return $(M({},a),{federationResultByContractName:u})}function ape({contractTagOptions:e,options:t,subgraphs:n}){let r=gb({options:t,subgraphs:n});return r.success?(r.federationFactory.federateSubgraphData(),r.federationFactory.buildFederationContractResult(e)):{errors:r.errors,success:!1,warnings:r.warnings}}});var Th=F(qs=>{"use strict";m();T();N();Object.defineProperty(qs,"__esModule",{value:!0});qs.LATEST_ROUTER_COMPATIBILITY_VERSION=qs.ROUTER_COMPATIBILITY_VERSIONS=qs.ROUTER_COMPATIBILITY_VERSION_ONE=void 0;qs.ROUTER_COMPATIBILITY_VERSION_ONE="1";qs.ROUTER_COMPATIBILITY_VERSIONS=new Set([qs.ROUTER_COMPATIBILITY_VERSION_ONE]);qs.LATEST_ROUTER_COMPATIBILITY_VERSION="1"});var kV=F(wp=>{"use strict";m();T();N();Object.defineProperty(wp,"__esModule",{value:!0});wp.federateSubgraphs=spe;wp.federateSubgraphsWithContracts=ope;wp.federateSubgraphsContract=upe;var _b=BV(),vb=Th();function spe({options:e,subgraphs:t,version:n=vb.ROUTER_COMPATIBILITY_VERSION_ONE}){switch(n){default:return(0,_b.federateSubgraphs)({options:e,subgraphs:t})}}function ope({options:e,subgraphs:t,tagOptionsByContractName:n,version:r=vb.ROUTER_COMPATIBILITY_VERSION_ONE}){switch(r){default:return(0,_b.federateSubgraphsWithContracts)({options:e,subgraphs:t,tagOptionsByContractName:n})}}function upe({contractTagOptions:e,options:t,subgraphs:n,version:r=vb.ROUTER_COMPATIBILITY_VERSION_ONE}){switch(r){default:return(0,_b.federateSubgraphsContract)({contractTagOptions:e,options:t,subgraphs:n})}}});var xV=F(MV=>{"use strict";m();T();N();Object.defineProperty(MV,"__esModule",{value:!0})});var VV=F(qV=>{"use strict";m();T();N();Object.defineProperty(qV,"__esModule",{value:!0})});var jV=F(Lp=>{"use strict";m();T();N();Object.defineProperty(Lp,"__esModule",{value:!0});Lp.normalizeSubgraphFromString=cpe;Lp.normalizeSubgraph=lpe;Lp.batchNormalize=dpe;var Sb=Eb(),Ob=Th();function cpe({noLocation:e=!0,options:t,sdlString:n,version:r=Ob.ROUTER_COMPATIBILITY_VERSION_ONE}){switch(r){default:return(0,Sb.normalizeSubgraphFromString)({noLocation:e,options:t,sdlString:n})}}function lpe({document:e,internalGraph:t,options:n,subgraphName:r,version:i=Ob.ROUTER_COMPATIBILITY_VERSION_ONE}){switch(i){default:return(0,Sb.normalizeSubgraph)({document:e,internalGraph:t,options:n,subgraphName:r})}}function dpe({options:e,subgraphs:t,version:n=Ob.ROUTER_COMPATIBILITY_VERSION_ONE}){switch(n){default:return(0,Sb.batchNormalize)({options:e,subgraphs:t})}}});var $V=F(KV=>{"use strict";m();T();N();Object.defineProperty(KV,"__esModule",{value:!0})});var QV=F(GV=>{"use strict";m();T();N();Object.defineProperty(GV,"__esModule",{value:!0})});var JV=F(YV=>{"use strict";m();T();N();Object.defineProperty(YV,"__esModule",{value:!0})});var HV=F(zV=>{"use strict";m();T();N();Object.defineProperty(zV,"__esModule",{value:!0})});var XV=F(WV=>{"use strict";m();T();N();Object.defineProperty(WV,"__esModule",{value:!0})});var ej=F(ZV=>{"use strict";m();T();N();Object.defineProperty(ZV,"__esModule",{value:!0})});var nj=F(tj=>{"use strict";m();T();N();Object.defineProperty(tj,"__esModule",{value:!0})});var ij=F(rj=>{"use strict";m();T();N();Object.defineProperty(rj,"__esModule",{value:!0})});var aj=F(Eh=>{"use strict";m();T();N();Object.defineProperty(Eh,"__esModule",{value:!0});Eh.COMPOSITION_VERSION=void 0;Eh.COMPOSITION_VERSION="{{$COMPOSITION__VERSION}}"});var oj=F(sj=>{"use strict";m();T();N();Object.defineProperty(sj,"__esModule",{value:!0})});var cj=F(uj=>{"use strict";m();T();N();Object.defineProperty(uj,"__esModule",{value:!0})});var dj=F(lj=>{"use strict";m();T();N();Object.defineProperty(lj,"__esModule",{value:!0})});var pj=F(fj=>{"use strict";m();T();N();Object.defineProperty(fj,"__esModule",{value:!0})});var hh=F(We=>{"use strict";m();T();N();var fpe=We&&We.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),ot=We&&We.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&fpe(t,e,n)};Object.defineProperty(We,"__esModule",{value:!0});ot(Cr(),We);ot(Jv(),We);ot(Qi(),We);ot(ux(),We);ot(kV(),We);ot(xV(),We);ot(VV(),We);ot(jV(),We);ot($V(),We);ot(QV(),We);ot(pb(),We);ot(nb(),We);ot(nh(),We);ot(JV(),We);ot(HV(),We);ot(ob(),We);ot(Th(),We);ot(XV(),We);ot(mb(),We);ot(Au(),We);ot(Jf(),We);ot(Ql(),We);ot(ej(),We);ot(nj(),We);ot(ij(),We);ot(aj(),We);ot(oj(),We);ot(Hn(),We);ot(cj(),We);ot(Ur(),We);ot(YD(),We);ot(Ru(),We);ot(zf(),We);ot(OE(),We);ot(DE(),We);ot(pd(),We);ot(ST(),We);ot(dj(),We);ot(OT(),We);ot(Ib(),We);ot(jD(),We);ot(vp(),We);ot(pj(),We);ot(WD(),We);ot(dh(),We);ot(GD(),We);ot(_p(),We);ot(Sp(),We)});var cme={};Hm(cme,{buildRouterConfiguration:()=>ume,federateSubgraphs:()=>ome});m();T();N();var rl=hi(hh());m();T();N();m();T();N();function Db(e){if(!e)return e;if(!URL.canParse(e))throw new Error("Invalid URL");let t=e.indexOf("?"),n=e.indexOf("#"),r=e;return t>0?r=r.slice(0,n>0?Math.min(t,n):t):n>0&&(r=r.slice(0,n)),r}m();T();N();m();T();N();var mj={};m();T();N();function Nj(e){return e!=null}m();T();N();m();T();N();var Ih=hi(Se(),1);m();T();N();m();T();N();function qu(e){return yh(e,[])}function yh(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return ppe(e,t);default:return String(e)}}function Tj(e){return(e.name="GraphQLError")?e.toString():`${e.name}: ${e.message}; - ${e.stack}`}function ppe(e,t){if(e===null)return"null";if(e instanceof Error)return e.name==="AggregateError"?Tj(e)+` -`+Ej(e.errors,t):Tj(e);if(t.includes(e))return"[Circular]";let n=[...t,e];if(mpe(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:yh(r,n)}else if(Array.isArray(e))return Ej(e,n);return Npe(e,n)}function mpe(e){return typeof e.toJSON=="function"}function Npe(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>3?"["+Tpe(e)+"]":"{ "+n.map(([i,a])=>i+": "+yh(a,t)).join(", ")+" }"}function Ej(e,t){if(e.length===0)return"[]";if(t.length>3)return"[Array]";let n=e.length,r=[];for(let i=0;iEpe.includes(t))}function _d(e,t){t!=null&&t.originalError&&!(t.originalError instanceof Error)&&hpe(t.originalError)&&(t.originalError=_d(t.originalError.message,t.originalError));let n=Cp.GraphQLError,r=Cp.versionInfo.major>=16?new n(e,t):new n(e,t==null?void 0:t.nodes,t==null?void 0:t.source,t==null?void 0:t.positions,t==null?void 0:t.path,t==null?void 0:t.originalError,t==null?void 0:t.extensions);return t!=null&&t.coordinate&&r.coordinate==null&&Object.defineProperties(r,{coordinate:{value:t.coordinate,enumerable:!0,configurable:!0}}),r}m();T();N();function hj(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e}function yj(e){return typeof e=="object"&&e!==null}function Ij(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function gj(e,t,n={}){var o;let r={},a=((o=t.arguments)!=null?o:[]).reduce((u,l)=>$(M({},u),{[l.name.value]:l}),{});for(let{name:u,type:l,defaultValue:d}of e.args){let p=a[u];if(!p){if(d!==void 0)r[u]=d;else if((0,Fa.isNonNullType)(l))throw _d(`Argument "${u}" of required type "${qu(l)}" was not provided.`,{nodes:[t]});continue}let E=p.value,h=E.kind===Fa.Kind.NULL;if(E.kind===Fa.Kind.VARIABLE){let A=E.name.value;if(n==null||!Ij(n,A)){if(d!==void 0)r[u]=d;else if((0,Fa.isNonNullType)(l))throw _d(`Argument "${u}" of required type "${qu(l)}" was provided the variable "$${A}" which was not provided a runtime value.`,{nodes:[E]});continue}h=n[A]==null}if(h&&(0,Fa.isNonNullType)(l))throw _d(`Argument "${u}" of non-null type "${qu(l)}" must not be null.`,{nodes:[E]});let v=(0,Fa.valueFromAST)(E,l,n);if(v===void 0)throw _d(`Argument "${u}" has invalid value ${(0,Fa.print)(E)}.`,{nodes:[E]});r[u]=v}return r}m();T();N();function vd(e){let t=new WeakMap;return function(r){let i=t.get(r);if(i===void 0){let a=e(r);return t.set(r,a),a}return i}}function _j(e,t,n=["directives"]){var o;let r={};if(e.extensions){let u=e.extensions;for(let l of n)u=u==null?void 0:u[l];if(u!=null)for(let l in u){let d=u[l],p=l;if(Array.isArray(d))for(let E of d){let h=r[p];h||(h=[],r[p]=h),h.push(E)}else{let E=r[p];E||(E=[],r[p]=E),E.push(d)}}}let i=vd(u=>JSON.stringify(u)),a=[];e.astNode&&a.push(e.astNode),e.extensionASTNodes&&a.push(...e.extensionASTNodes);for(let u of a)if((o=u.directives)!=null&&o.length)for(let l of u.directives){let d=l.name.value,p=r[d];p||(p=[],r[d]=p);let E=t==null?void 0:t.getDirective(d),h={};if(E&&(h=gj(E,l)),l.arguments)for(let v of l.arguments){let A=v.name.value;if(h[A]==null){let B=E==null?void 0:E.args.find(V=>V.name===A);B&&(h[A]=(0,Ih.valueFromAST)(v.value,B.type))}h[A]==null&&(h[A]=(0,Ih.valueFromASTUntyped)(v.value))}if(a.length>0&&p.length>0){let v=i(h);if(p.some(A=>i(A)===v))continue}p.push(h)}return r}function bb(e,t=["directives"]){let n=_j(e,void 0,t);return Object.entries(n).map(([r,i])=>i==null?void 0:i.map(a=>({name:r,args:a}))).flat(1/0).filter(Boolean)}m();T();N();var ze=hi(Se(),1);m();T();N();var ls=hi(Se(),1);function ds(e){if((0,ls.isNonNullType)(e)){let t=ds(e.ofType);if(t.kind===ls.Kind.NON_NULL_TYPE)throw new Error(`Invalid type node ${qu(e)}. Inner type of non-null type cannot be a non-null type.`);return{kind:ls.Kind.NON_NULL_TYPE,type:t}}else if((0,ls.isListType)(e))return{kind:ls.Kind.LIST_TYPE,type:ds(e.ofType)};return{kind:ls.Kind.NAMED_TYPE,name:{kind:ls.Kind.NAME,value:e.name}}}m();T();N();var dr=hi(Se(),1);m();T();N();var wa=hi(Se(),1);function Hc(e){if(e===null)return{kind:wa.Kind.NULL};if(e===void 0)return null;if(Array.isArray(e)){let t=[];for(let n of e){let r=Hc(n);r!=null&&t.push(r)}return{kind:wa.Kind.LIST,values:t}}if(typeof e=="object"){if(e!=null&&e.toJSON)return Hc(e.toJSON());let t=[];for(let n in e){let r=e[n],i=Hc(r);i&&t.push({kind:wa.Kind.OBJECT_FIELD,name:{kind:wa.Kind.NAME,value:n},value:i})}return{kind:wa.Kind.OBJECT,fields:t}}if(typeof e=="boolean")return{kind:wa.Kind.BOOLEAN,value:e};if(typeof e=="bigint")return{kind:wa.Kind.INT,value:String(e)};if(typeof e=="number"&&isFinite(e)){let t=String(e);return ype.test(t)?{kind:wa.Kind.INT,value:t}:{kind:wa.Kind.FLOAT,value:t}}if(typeof e=="string")return{kind:wa.Kind.STRING,value:e};throw new TypeError(`Cannot convert value to AST: ${e}.`)}var ype=/^-?(?:0|[1-9][0-9]*)$/;function Vu(e,t){if((0,dr.isNonNullType)(t)){let n=Vu(e,t.ofType);return(n==null?void 0:n.kind)===dr.Kind.NULL?null:n}if(e===null)return{kind:dr.Kind.NULL};if(e===void 0)return null;if((0,dr.isListType)(t)){let n=t.ofType;if(hj(e)){let r=[];for(let i of e){let a=Vu(i,n);a!=null&&r.push(a)}return{kind:dr.Kind.LIST,values:r}}return Vu(e,n)}if((0,dr.isInputObjectType)(t)){if(!yj(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=Vu(e[r.name],r.type);i&&n.push({kind:dr.Kind.OBJECT_FIELD,name:{kind:dr.Kind.NAME,value:r.name},value:i})}return{kind:dr.Kind.OBJECT,fields:n}}if((0,dr.isLeafType)(t)){let n=t.serialize(e);return n==null?null:(0,dr.isEnumType)(t)?{kind:dr.Kind.ENUM,value:n}:t.name==="ID"&&typeof n=="string"&&Ipe.test(n)?{kind:dr.Kind.INT,value:n}:Hc(n)}console.assert(!1,"Unexpected input type: "+qu(t))}var Ipe=/^-?(?:0|[1-9][0-9]*)$/;m();T();N();var vj=hi(Se(),1);function Oi(e){var t;if((t=e.astNode)!=null&&t.description)return $(M({},e.astNode.description),{block:!0});if(e.description)return{kind:vj.Kind.STRING,value:e.description,block:!0}}m();T();N();var O1e=vd(function(t){let n=gpe(t);return new Set([...n].map(r=>r.name))}),gpe=vd(function(t){let n=Ab(t);return new Set(n.values())}),Ab=vd(function(t){let n=new Map,r=t.getQueryType();r&&n.set("query",r);let i=t.getMutationType();i&&n.set("mutation",i);let a=t.getSubscriptionType();return a&&n.set("subscription",a),n});function _pe(e,t={}){let n=t.pathToDirectivesInExtensions,r=e.getTypeMap(),i=vpe(e,n),a=i!=null?[i]:[],o=e.getDirectives();for(let u of o)(0,ze.isSpecifiedDirective)(u)||a.push(Spe(u,e,n));for(let u in r){let l=r[u],d=(0,ze.isSpecifiedScalarType)(l),p=(0,ze.isIntrospectionType)(l);if(!(d||p))if((0,ze.isObjectType)(l))a.push(Ope(l,e,n));else if((0,ze.isInterfaceType)(l))a.push(Dpe(l,e,n));else if((0,ze.isUnionType)(l))a.push(bpe(l,e,n));else if((0,ze.isInputObjectType)(l))a.push(Ape(l,e,n));else if((0,ze.isEnumType)(l))a.push(Rpe(l,e,n));else if((0,ze.isScalarType)(l))a.push(Ppe(l,e,n));else throw new Error(`Unknown type ${l}.`)}return{kind:ze.Kind.DOCUMENT,definitions:a}}function Sj(e,t={}){let n=_pe(e,t);return(0,ze.print)(n)}function vpe(e,t){let n=new Map([["query",void 0],["mutation",void 0],["subscription",void 0]]),r=[];if(e.astNode!=null&&r.push(e.astNode),e.extensionASTNodes!=null)for(let d of e.extensionASTNodes)r.push(d);for(let d of r)if(d.operationTypes)for(let p of d.operationTypes)n.set(p.operation,p);let i=Ab(e);for(let[d,p]of n){let E=i.get(d);if(E!=null){let h=ds(E);p!=null?p.type=h:n.set(d,{kind:ze.Kind.OPERATION_TYPE_DEFINITION,operation:d,type:h})}}let a=[...n.values()].filter(Nj),o=fs(e,e,t);if(!a.length&&!o.length)return null;let u={kind:a.length?ze.Kind.SCHEMA_DEFINITION:ze.Kind.SCHEMA_EXTENSION,operationTypes:a,directives:o},l=Oi(e);return l&&(u.description=l),u}function Spe(e,t,n){var r,i;return{kind:ze.Kind.DIRECTIVE_DEFINITION,description:Oi(e),name:{kind:ze.Kind.NAME,value:e.name},arguments:(r=e.args)==null?void 0:r.map(a=>Oj(a,t,n)),repeatable:e.isRepeatable,locations:((i=e.locations)==null?void 0:i.map(a=>({kind:ze.Kind.NAME,value:a})))||[]}}function fs(e,t,n){let r=[],i=bb(e,n),a;i!=null&&(a=bj(t,i));let o=null,u=null,l=null;if(a!=null&&(r=a.filter(d=>ze.specifiedDirectives.every(p=>p.name!==d.name.value)),o=a.find(d=>d.name.value==="deprecated"),u=a.find(d=>d.name.value==="specifiedBy"),l=a.find(d=>d.name.value==="oneOf")),e.deprecationReason!=null&&o==null&&(o=Lpe(e.deprecationReason)),e.specifiedByUrl!=null||e.specifiedByURL!=null&&u==null){let p={url:e.specifiedByUrl||e.specifiedByURL};u=Up("specifiedBy",p)}return e.isOneOf&&l==null&&(l=Up("oneOf")),o!=null&&r.push(o),u!=null&&r.push(u),l!=null&&r.push(l),r}function Oj(e,t,n){var r;return{kind:ze.Kind.INPUT_VALUE_DEFINITION,description:Oi(e),name:{kind:ze.Kind.NAME,value:e.name},type:ds(e.type),defaultValue:e.defaultValue!==void 0&&(r=Vu(e.defaultValue,e.type))!=null?r:void 0,directives:fs(e,t,n)}}function Ope(e,t,n){return{kind:ze.Kind.OBJECT_TYPE_DEFINITION,description:Oi(e),name:{kind:ze.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(r=>Dj(r,t,n)),interfaces:Object.values(e.getInterfaces()).map(r=>ds(r)),directives:fs(e,t,n)}}function Dpe(e,t,n){let r={kind:ze.Kind.INTERFACE_TYPE_DEFINITION,description:Oi(e),name:{kind:ze.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(i=>Dj(i,t,n)),directives:fs(e,t,n)};return"getInterfaces"in e&&(r.interfaces=Object.values(e.getInterfaces()).map(i=>ds(i))),r}function bpe(e,t,n){return{kind:ze.Kind.UNION_TYPE_DEFINITION,description:Oi(e),name:{kind:ze.Kind.NAME,value:e.name},directives:fs(e,t,n),types:e.getTypes().map(r=>ds(r))}}function Ape(e,t,n){return{kind:ze.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:Oi(e),name:{kind:ze.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(r=>Fpe(r,t,n)),directives:fs(e,t,n)}}function Rpe(e,t,n){return{kind:ze.Kind.ENUM_TYPE_DEFINITION,description:Oi(e),name:{kind:ze.Kind.NAME,value:e.name},values:Object.values(e.getValues()).map(r=>wpe(r,t,n)),directives:fs(e,t,n)}}function Ppe(e,t,n){let r=bb(e,n),i=bj(t,r),a=e.specifiedByUrl||e.specifiedByURL;if(a&&!i.some(o=>o.name.value==="specifiedBy")){let o={url:a};i.push(Up("specifiedBy",o))}return{kind:ze.Kind.SCALAR_TYPE_DEFINITION,description:Oi(e),name:{kind:ze.Kind.NAME,value:e.name},directives:i}}function Dj(e,t,n){return{kind:ze.Kind.FIELD_DEFINITION,description:Oi(e),name:{kind:ze.Kind.NAME,value:e.name},arguments:e.args.map(r=>Oj(r,t,n)),type:ds(e.type),directives:fs(e,t,n)}}function Fpe(e,t,n){var r;return{kind:ze.Kind.INPUT_VALUE_DEFINITION,description:Oi(e),name:{kind:ze.Kind.NAME,value:e.name},type:ds(e.type),directives:fs(e,t,n),defaultValue:(r=Vu(e.defaultValue,e.type))!=null?r:void 0}}function wpe(e,t,n){return{kind:ze.Kind.ENUM_VALUE_DEFINITION,description:Oi(e),name:{kind:ze.Kind.NAME,value:e.name},directives:fs(e,t,n)}}function Lpe(e){return Up("deprecated",{reason:e},ze.GraphQLDeprecatedDirective)}function Up(e,t,n){let r=[];for(let i in t){let a=t[i],o;if(n!=null){let u=n.args.find(l=>l.name===i);u&&(o=Vu(a,u.type))}o==null&&(o=Hc(a)),o!=null&&r.push({kind:ze.Kind.ARGUMENT,name:{kind:ze.Kind.NAME,value:i},value:o})}return{kind:ze.Kind.DIRECTIVE,name:{kind:ze.Kind.NAME,value:e},arguments:r}}function bj(e,t){let n=[];for(let{name:r,args:i}of t){let a=e==null?void 0:e.getDirective(r);n.push(Up(r,i,a))}return n}var wd=hi(hh(),1);m();T();N();m();T();N();m();T();N();m();T();N();m();T();N();m();T();N();function pn(e,t){if(!e)throw new Error(t)}var Cpe=34028234663852886e22,Upe=-34028234663852886e22,Bpe=4294967295,kpe=2147483647,Mpe=-2147483648;function Sd(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>kpe||eBpe||e<0)throw new Error("invalid uint 32: "+e)}function gh(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>Cpe||e({no:i.no,name:i.name,localName:e[i.no]})),r)}function Pb(e,t,n){let r=Object.create(null),i=Object.create(null),a=[];for(let o of t){let u=Fj(o);a.push(u),r[o.name]=u,i[o.no]=u}return{typeName:e,values:a,findName(o){return r[o]},findNumber(o){return i[o]}}}function Pj(e,t,n){let r={};for(let i of t){let a=Fj(i);r[a.localName]=a.no,r[a.no]=a.localName}return Rb(r,e,t,n),r}function Fj(e){return"localName"in e?e:Object.assign(Object.assign({},e),{localName:e.name})}m();T();N();m();T();N();var Pe=class{equals(t){return this.getType().runtime.util.equals(this.getType(),this,t)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(t,n){let r=this.getType(),i=r.runtime.bin,a=i.makeReadOptions(n);return i.readMessage(this,a.readerFactory(t),t.byteLength,a),this}fromJson(t,n){let r=this.getType(),i=r.runtime.json,a=i.makeReadOptions(n);return i.readMessage(r,t,a,this),this}fromJsonString(t,n){let r;try{r=JSON.parse(t)}catch(i){throw new Error(`cannot decode ${this.getType().typeName} from JSON: ${i instanceof Error?i.message:String(i)}`)}return this.fromJson(r,n)}toBinary(t){let n=this.getType(),r=n.runtime.bin,i=r.makeWriteOptions(t),a=i.writerFactory();return r.writeMessage(this,a,i),a.finish()}toJson(t){let n=this.getType(),r=n.runtime.json,i=r.makeWriteOptions(t);return r.writeMessage(this,i)}toJsonString(t){var n;let r=this.toJson(t);return JSON.stringify(r,null,(n=t==null?void 0:t.prettySpaces)!==null&&n!==void 0?n:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}};function wj(e,t,n,r){var i;let a=(i=r==null?void 0:r.localName)!==null&&i!==void 0?i:t.substring(t.lastIndexOf(".")+1),o={[a]:function(u){e.util.initFields(this),e.util.initPartial(u,this)}}[a];return Object.setPrototypeOf(o.prototype,new Pe),Object.assign(o,{runtime:e,typeName:t,fields:e.util.newFieldList(n),fromBinary(u,l){return new o().fromBinary(u,l)},fromJson(u,l){return new o().fromJson(u,l)},fromJsonString(u,l){return new o().fromJsonString(u,l)},equals(u,l){return e.util.equals(o,u,l)}}),o}m();T();N();m();T();N();m();T();N();m();T();N();function Cj(){let e=0,t=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<>4,!(n&128))return this.assertBounds(),[e,t];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(t|=(i&127)<>>a,u=!(!(o>>>7)&&t==0),l=(u?o|128:o)&255;if(n.push(l),!u)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),!!i){for(let a=3;a<31;a=a+7){let o=t>>>a,u=!!(o>>>7),l=(u?o|128:o)&255;if(n.push(l),!u)return}n.push(t>>>31&1)}}var _h=4294967296;function Fb(e){let t=e[0]==="-";t&&(e=e.slice(1));let n=1e6,r=0,i=0;function a(o,u){let l=Number(e.slice(o,u));i*=n,r=r*n+l,r>=_h&&(i=i+(r/_h|0),r=r%_h)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?Bj(r,i):Lb(r,i)}function Uj(e,t){let n=Lb(e,t),r=n.hi&2147483648;r&&(n=Bj(n.lo,n.hi));let i=wb(n.lo,n.hi);return r?"-"+i:i}function wb(e,t){if({lo:e,hi:t}=xpe(e,t),t<=2097151)return String(_h*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,u=i*2,l=1e7;return a>=l&&(o+=Math.floor(a/l),a%=l),o>=l&&(u+=Math.floor(o/l),o%=l),u.toString()+Lj(o)+Lj(a)}function xpe(e,t){return{lo:e>>>0,hi:t>>>0}}function Lb(e,t){return{lo:e|0,hi:t|0}}function Bj(e,t){return t=~t,e?e=~e+1:t+=1,Lb(e,t)}var Lj=e=>{let t=String(e);return"0000000".slice(t.length)+t};function Cb(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e=e>>7;t.push(1)}}function kj(){let e=this.buf[this.pos++],t=e&127;if(!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let n=5;e&128&&n<10;n++)e=this.buf[this.pos++];if(e&128)throw new Error("invalid varint");return this.assertBounds(),t>>>0}function qpe(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(typeof O!="object"||typeof O.env!="object"||O.env.BUF_BIGINT_DISABLE!=="1")){let i=BigInt("-9223372036854775808"),a=BigInt("9223372036854775807"),o=BigInt("0"),u=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(l){let d=typeof l=="bigint"?l:BigInt(l);if(d>a||du||dpn(/^-?[0-9]+$/.test(i),`int64 invalid: ${i}`),r=i=>pn(/^[0-9]+$/.test(i),`uint64 invalid: ${i}`);return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),n(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),r(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),n(i),Fb(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),r(i),Fb(i)},dec(i,a){return Uj(i,a)},uDec(i,a){return wb(i,a)}}}var Jn=qpe();m();T();N();var pe;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(pe||(pe={}));var La;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING"})(La||(La={}));function Vs(e,t,n){if(t===n)return!0;if(e==pe.BYTES){if(!(t instanceof Uint8Array)||!(n instanceof Uint8Array)||t.length!==n.length)return!1;for(let r=0;r>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(Bp(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return Sd(t),Cb(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let n=this.textEncoder.encode(t);return this.uint32(n.byteLength),this.raw(n)}float(t){gh(t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,t,!0),this.raw(n)}double(t){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,t,!0),this.raw(n)}fixed32(t){Bp(t);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t,!0),this.raw(n)}sfixed32(t){Sd(t);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),this.raw(n)}sint32(t){return Sd(t),t=(t<<1^t>>31)>>>0,Cb(t,this.buf),this}sfixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=Jn.enc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}fixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=Jn.uEnc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}int64(t){let n=Jn.enc(t);return vh(n.lo,n.hi,this.buf),this}sint64(t){let n=Jn.enc(t),r=n.hi>>31,i=n.lo<<1^r,a=(n.hi<<1|n.lo>>>31)^r;return vh(i,a,this.buf),this}uint64(t){let n=Jn.uEnc(t);return vh(n.lo,n.hi,this.buf),this}},Dh=class{constructor(t,n){this.varint64=Cj,this.uint32=kj,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=n!=null?n:new TextDecoder}tag(){let t=this.uint32(),n=t>>>3,r=t&7;if(n<=0||r<0||r>5)throw new Error("illegal tag: field no "+n+" wire type "+r);return[n,r]}skip(t){let n=this.pos;switch(t){case xn.Varint:for(;this.buf[this.pos++]&128;);break;case xn.Bit64:this.pos+=4;case xn.Bit32:this.pos+=4;break;case xn.LengthDelimited:let r=this.uint32();this.pos+=r;break;case xn.StartGroup:let i;for(;(i=this.tag()[1])!==xn.EndGroup;)this.skip(i);break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return Jn.dec(...this.varint64())}uint64(){return Jn.uDec(...this.varint64())}sint64(){let[t,n]=this.varint64(),r=-(t&1);return t=(t>>>1|(n&1)<<31)^r,n=n>>>1^r,Jn.dec(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Jn.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Jn.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),n=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(n,n+t)}string(){return this.textDecoder.decode(this.bytes())}};function Mj(e,t,n,r){let i;return{typeName:t,extendee:n,get field(){if(!i){let a=typeof r=="function"?r():r;a.name=t.split(".").pop(),a.jsonName=`[${t}]`,i=e.util.newFieldList([a]).list()[0]}return i},runtime:e}}function bh(e){let t=e.field.localName,n=Object.create(null);return n[t]=Vpe(e),[n,()=>n[t]]}function Vpe(e){let t=e.field;if(t.repeated)return[];if(t.default!==void 0)return t.default;switch(t.kind){case"enum":return t.T.values[0].no;case"scalar":return Ca(t.T,t.L);case"message":let n=t.T,r=new n;return n.fieldWrapper?n.fieldWrapper.unwrapField(r):r;case"map":throw"map fields are not allowed to be extensions"}}function xj(e,t){if(!t.repeated&&(t.kind=="enum"||t.kind=="scalar")){for(let n=e.length-1;n>=0;--n)if(e[n].no==t.no)return[e[n]];return[]}return e.filter(n=>n.no===t.no)}m();T();N();m();T();N();var js="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ah=[];for(let e=0;e>4,o=a,i=2;break;case 2:n[r++]=(o&15)<<4|(a&60)>>2,o=a,i=3;break;case 3:n[r++]=(o&3)<<6|a,i=0;break}}if(i==1)throw Error("invalid base64 string.");return n.subarray(0,r)},enc(e){let t="",n=0,r,i=0;for(let a=0;a>2],i=(r&3)<<4,n=1;break;case 1:t+=js[i|r>>4],i=(r&15)<<2,n=2;break;case 2:t+=js[i|r>>6],t+=js[r&63],n=0;break}return n&&(t+=js[i],t+="=",n==1&&(t+="=")),t}};m();T();N();function qj(e,t,n){jj(t,e);let r=t.runtime.bin.makeReadOptions(n),i=xj(e.getType().runtime.bin.listUnknownFields(e),t.field),[a,o]=bh(t);for(let u of i)t.runtime.bin.readField(a,r.readerFactory(u.data),t.field,u.wireType,r);return o()}function Vj(e,t,n,r){jj(t,e);let i=t.runtime.bin.makeReadOptions(r),a=t.runtime.bin.makeWriteOptions(r);if(Bb(e,t)){let d=e.getType().runtime.bin.listUnknownFields(e).filter(p=>p.no!=t.field.no);e.getType().runtime.bin.discardUnknownFields(e);for(let p of d)e.getType().runtime.bin.onUnknownField(e,p.no,p.wireType,p.data)}let o=a.writerFactory(),u=t.field;!u.opt&&!u.repeated&&(u.kind=="enum"||u.kind=="scalar")&&(u=Object.assign(Object.assign({},t.field),{opt:!0})),t.runtime.bin.writeField(u,n,o,a);let l=i.readerFactory(o.finish());for(;l.posr.no==t.field.no)}function jj(e,t){pn(e.extendee.typeName==t.getType().typeName,`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}m();T();N();function Rh(e,t){let n=e.localName;if(e.repeated)return t[n].length>0;if(e.oneof)return t[e.oneof.localName].case===n;switch(e.kind){case"enum":case"scalar":return e.opt||e.req?t[n]!==void 0:e.kind=="enum"?t[n]!==e.T.values[0].no:!Sh(e.T,t[n]);case"message":return t[n]!==void 0;case"map":return Object.keys(t[n]).length>0}}function kb(e,t){let n=e.localName,r=!e.opt&&!e.req;if(e.repeated)t[n]=[];else if(e.oneof)t[e.oneof.localName]={case:void 0};else switch(e.kind){case"map":t[n]={};break;case"enum":t[n]=r?e.T.values[0].no:void 0;break;case"scalar":t[n]=r?Ca(e.T,e.L):void 0;break;case"message":t[n]=void 0;break}}m();T();N();m();T();N();function Ua(e,t){if(e===null||typeof e!="object"||!Object.getOwnPropertyNames(Pe.prototype).every(r=>r in e&&typeof e[r]=="function"))return!1;let n=e.getType();return n===null||typeof n!="function"||!("typeName"in n)||typeof n.typeName!="string"?!1:t===void 0?!0:n.typeName==t.typeName}function Ph(e,t){return Ua(t)||!e.fieldWrapper?t:e.fieldWrapper.wrapField(t)}var sje={"google.protobuf.DoubleValue":pe.DOUBLE,"google.protobuf.FloatValue":pe.FLOAT,"google.protobuf.Int64Value":pe.INT64,"google.protobuf.UInt64Value":pe.UINT64,"google.protobuf.Int32Value":pe.INT32,"google.protobuf.UInt32Value":pe.UINT32,"google.protobuf.BoolValue":pe.BOOL,"google.protobuf.StringValue":pe.STRING,"google.protobuf.BytesValue":pe.BYTES};var Kj={ignoreUnknownFields:!1},$j={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function jpe(e){return e?Object.assign(Object.assign({},Kj),e):Kj}function Kpe(e){return e?Object.assign(Object.assign({},$j),e):$j}var Lh=Symbol(),Fh=Symbol();function Yj(){return{makeReadOptions:jpe,makeWriteOptions:Kpe,readMessage(e,t,n,r){if(t==null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message ${e.typeName} from JSON: ${ps(t)}`);r=r!=null?r:new e;let i=new Map,a=n.typeRegistry;for(let[o,u]of Object.entries(t)){let l=e.fields.findJsonName(o);if(l){if(l.oneof){if(u===null&&l.kind=="scalar")continue;let d=i.get(l.oneof);if(d!==void 0)throw new Error(`cannot decode message ${e.typeName} from JSON: multiple keys for oneof "${l.oneof.name}" present: "${d}", "${o}"`);i.set(l.oneof,o)}Gj(r,u,l,n,e)}else{let d=!1;if(a!=null&&a.findExtension&&o.startsWith("[")&&o.endsWith("]")){let p=a.findExtension(o.substring(1,o.length-1));if(p&&p.extendee.typeName==e.typeName){d=!0;let[E,h]=bh(p);Gj(E,u,p.field,n,p),Vj(r,p,h(),n)}}if(!d&&!n.ignoreUnknownFields)throw new Error(`cannot decode message ${e.typeName} from JSON: key "${o}" is unknown`)}}return r},writeMessage(e,t){let n=e.getType(),r={},i;try{for(i of n.fields.byNumber()){if(!Rh(i,e)){if(i.req)throw"required field not set";if(!t.emitDefaultValues||!Gpe(i))continue}let o=i.oneof?e[i.oneof.localName].value:e[i.localName],u=Qj(i,o,t);u!==void 0&&(r[t.useProtoFieldName?i.name:i.jsonName]=u)}let a=t.typeRegistry;if(a!=null&&a.findExtensionFor)for(let o of n.runtime.bin.listUnknownFields(e)){let u=a.findExtensionFor(n.typeName,o.no);if(u&&Bb(e,u)){let l=qj(e,u,t),d=Qj(u.field,l,t);d!==void 0&&(r[u.field.jsonName]=d)}}}catch(a){let o=i?`cannot encode field ${n.typeName}.${i.name} to JSON`:`cannot encode message ${n.typeName} to JSON`,u=a instanceof Error?a.message:String(a);throw new Error(o+(u.length>0?`: ${u}`:""))}return r},readScalar(e,t,n){return kp(e,t,n!=null?n:La.BIGINT,!0)},writeScalar(e,t,n){if(t!==void 0&&(n||Sh(e,t)))return wh(e,t)},debug:ps}}function ps(e){if(e===null)return"null";switch(typeof e){case"object":return Array.isArray(e)?"array":"object";case"string":return e.length>100?"string":`"${e.split('"').join('\\"')}"`;default:return String(e)}}function Gj(e,t,n,r,i){let a=n.localName;if(n.repeated){if(pn(n.kind!="map"),t===null)return;if(!Array.isArray(t))throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: ${ps(t)}`);let o=e[a];for(let u of t){if(u===null)throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: ${ps(u)}`);switch(n.kind){case"message":o.push(n.T.fromJson(u,r));break;case"enum":let l=Mb(n.T,u,r.ignoreUnknownFields,!0);l!==Fh&&o.push(l);break;case"scalar":try{o.push(kp(n.T,u,n.L,!0))}catch(d){let p=`cannot decode field ${i.typeName}.${n.name} from JSON: ${ps(u)}`;throw d instanceof Error&&d.message.length>0&&(p+=`: ${d.message}`),new Error(p)}break}}}else if(n.kind=="map"){if(t===null)return;if(typeof t!="object"||Array.isArray(t))throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: ${ps(t)}`);let o=e[a];for(let[u,l]of Object.entries(t)){if(l===null)throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: map value null`);let d;try{d=$pe(n.K,u)}catch(p){let E=`cannot decode map key for field ${i.typeName}.${n.name} from JSON: ${ps(t)}`;throw p instanceof Error&&p.message.length>0&&(E+=`: ${p.message}`),new Error(E)}switch(n.V.kind){case"message":o[d]=n.V.T.fromJson(l,r);break;case"enum":let p=Mb(n.V.T,l,r.ignoreUnknownFields,!0);p!==Fh&&(o[d]=p);break;case"scalar":try{o[d]=kp(n.V.T,l,La.BIGINT,!0)}catch(E){let h=`cannot decode map value for field ${i.typeName}.${n.name} from JSON: ${ps(t)}`;throw E instanceof Error&&E.message.length>0&&(h+=`: ${E.message}`),new Error(h)}break}}}else switch(n.oneof&&(e=e[n.oneof.localName]={case:a},a="value"),n.kind){case"message":let o=n.T;if(t===null&&o.typeName!="google.protobuf.Value")return;let u=e[a];Ua(u)?u.fromJson(t,r):(e[a]=u=o.fromJson(t,r),o.fieldWrapper&&!n.oneof&&(e[a]=o.fieldWrapper.unwrapField(u)));break;case"enum":let l=Mb(n.T,t,r.ignoreUnknownFields,!1);switch(l){case Lh:kb(n,e);break;case Fh:break;default:e[a]=l;break}break;case"scalar":try{let d=kp(n.T,t,n.L,!1);switch(d){case Lh:kb(n,e);break;default:e[a]=d;break}}catch(d){let p=`cannot decode field ${i.typeName}.${n.name} from JSON: ${ps(t)}`;throw d instanceof Error&&d.message.length>0&&(p+=`: ${d.message}`),new Error(p)}break}}function $pe(e,t){if(e===pe.BOOL)switch(t){case"true":t=!0;break;case"false":t=!1;break}return kp(e,t,La.BIGINT,!0).toString()}function kp(e,t,n,r){if(t===null)return r?Ca(e,n):Lh;switch(e){case pe.DOUBLE:case pe.FLOAT:if(t==="NaN")return Number.NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(t===""||typeof t=="string"&&t.trim().length!==t.length||typeof t!="string"&&typeof t!="number")break;let i=Number(t);if(Number.isNaN(i)||!Number.isFinite(i))break;return e==pe.FLOAT&&gh(i),i;case pe.INT32:case pe.FIXED32:case pe.SFIXED32:case pe.SINT32:case pe.UINT32:let a;if(typeof t=="number"?a=t:typeof t=="string"&&t.length>0&&t.trim().length===t.length&&(a=Number(t)),a===void 0)break;return e==pe.UINT32||e==pe.FIXED32?Bp(a):Sd(a),a;case pe.INT64:case pe.SFIXED64:case pe.SINT64:if(typeof t!="number"&&typeof t!="string")break;let o=Jn.parse(t);return n?o.toString():o;case pe.FIXED64:case pe.UINT64:if(typeof t!="number"&&typeof t!="string")break;let u=Jn.uParse(t);return n?u.toString():u;case pe.BOOL:if(typeof t!="boolean")break;return t;case pe.STRING:if(typeof t!="string")break;try{encodeURIComponent(t)}catch(l){throw new Error("invalid UTF8")}return t;case pe.BYTES:if(t==="")return new Uint8Array(0);if(typeof t!="string")break;return Ub.dec(t)}throw new Error}function Mb(e,t,n,r){if(t===null)return e.typeName=="google.protobuf.NullValue"?0:r?e.values[0].no:Lh;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":let i=e.findName(t);if(i!==void 0)return i.no;if(n)return Fh;break}throw new Error(`cannot decode enum ${e.typeName} from JSON: ${ps(t)}`)}function Gpe(e){return e.repeated||e.kind=="map"?!0:!(e.oneof||e.kind=="message"||e.opt||e.req)}function Qj(e,t,n){if(e.kind=="map"){pn(typeof t=="object"&&t!=null);let r={},i=Object.entries(t);switch(e.V.kind){case"scalar":for(let[o,u]of i)r[o.toString()]=wh(e.V.T,u);break;case"message":for(let[o,u]of i)r[o.toString()]=u.toJson(n);break;case"enum":let a=e.V.T;for(let[o,u]of i)r[o.toString()]=xb(a,u,n.enumAsInteger);break}return n.emitDefaultValues||i.length>0?r:void 0}if(e.repeated){pn(Array.isArray(t));let r=[];switch(e.kind){case"scalar":for(let i=0;i0?r:void 0}switch(e.kind){case"scalar":return wh(e.T,t);case"enum":return xb(e.T,t,n.enumAsInteger);case"message":return Ph(e.T,t).toJson(n)}}function xb(e,t,n){var r;if(pn(typeof t=="number"),e.typeName=="google.protobuf.NullValue")return null;if(n)return t;let i=e.findNumber(t);return(r=i==null?void 0:i.name)!==null&&r!==void 0?r:t}function wh(e,t){switch(e){case pe.INT32:case pe.SFIXED32:case pe.SINT32:case pe.FIXED32:case pe.UINT32:return pn(typeof t=="number"),t;case pe.FLOAT:case pe.DOUBLE:return pn(typeof t=="number"),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case pe.STRING:return pn(typeof t=="string"),t;case pe.BOOL:return pn(typeof t=="boolean"),t;case pe.UINT64:case pe.FIXED64:case pe.INT64:case pe.SFIXED64:case pe.SINT64:return pn(typeof t=="bigint"||typeof t=="string"||typeof t=="number"),t.toString();case pe.BYTES:return pn(t instanceof Uint8Array),Ub.enc(t)}}m();T();N();var Od=Symbol("@bufbuild/protobuf/unknown-fields"),Jj={readUnknownFields:!0,readerFactory:e=>new Dh(e)},zj={writeUnknownFields:!0,writerFactory:()=>new Oh};function Qpe(e){return e?Object.assign(Object.assign({},Jj),e):Jj}function Ype(e){return e?Object.assign(Object.assign({},zj),e):zj}function Zj(){return{makeReadOptions:Qpe,makeWriteOptions:Ype,listUnknownFields(e){var t;return(t=e[Od])!==null&&t!==void 0?t:[]},discardUnknownFields(e){delete e[Od]},writeUnknownFields(e,t){let r=e[Od];if(r)for(let i of r)t.tag(i.no,i.wireType).raw(i.data)},onUnknownField(e,t,n,r){let i=e;Array.isArray(i[Od])||(i[Od]=[]),i[Od].push({no:t,wireType:n,data:r})},readMessage(e,t,n,r,i){let a=e.getType(),o=i?t.len:t.pos+n,u,l;for(;t.pos0&&(l=zpe),a){let h=e[o];if(r==xn.LengthDelimited&&u!=pe.STRING&&u!=pe.BYTES){let A=t.uint32()+t.pos;for(;t.posUa(h,E)?h:new E(h));else{let h=o[i];E.fieldWrapper?E.typeName==="google.protobuf.BytesValue"?a[i]=xp(h):a[i]=h:a[i]=Ua(h,E)?h:new E(h)}break}}},equals(e,t,n){return t===n?!0:!t||!n?!1:e.fields.byMember().every(r=>{let i=t[r.localName],a=n[r.localName];if(r.repeated){if(i.length!==a.length)return!1;switch(r.kind){case"message":return i.every((o,u)=>r.T.equals(o,a[u]));case"scalar":return i.every((o,u)=>Vs(r.T,o,a[u]));case"enum":return i.every((o,u)=>Vs(pe.INT32,o,a[u]))}throw new Error(`repeated cannot contain ${r.kind}`)}switch(r.kind){case"message":return r.T.equals(i,a);case"enum":return Vs(pe.INT32,i,a);case"scalar":return Vs(r.T,i,a);case"oneof":if(i.case!==a.case)return!1;let o=r.findField(i.case);if(o===void 0)return!0;switch(o.kind){case"message":return o.T.equals(i.value,a.value);case"enum":return Vs(pe.INT32,i.value,a.value);case"scalar":return Vs(o.T,i.value,a.value)}throw new Error(`oneof cannot contain ${o.kind}`);case"map":let u=Object.keys(i).concat(Object.keys(a));switch(r.V.kind){case"message":let l=r.V.T;return u.every(p=>l.equals(i[p],a[p]));case"enum":return u.every(p=>Vs(pe.INT32,i[p],a[p]));case"scalar":let d=r.V.T;return u.every(p=>Vs(d,i[p],a[p]))}break}})},clone(e){let t=e.getType(),n=new t,r=n;for(let i of t.fields.byMember()){let a=e[i.localName],o;if(i.repeated)o=a.map(Bh);else if(i.kind=="map"){o=r[i.localName];for(let[u,l]of Object.entries(a))o[u]=Bh(l)}else i.kind=="oneof"?o=i.findField(a.case)?{case:a.case,value:Bh(a.value)}:{case:void 0}:o=Bh(a);r[i.localName]=o}for(let i of t.runtime.bin.listUnknownFields(e))t.runtime.bin.onUnknownField(r,i.no,i.wireType,i.data);return n}}}function Bh(e){if(e===void 0)return e;if(Ua(e))return e.clone();if(e instanceof Uint8Array){let t=new Uint8Array(e.byteLength);return t.set(e),t}return e}function xp(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function nK(e,t,n){return{syntax:e,json:Yj(),bin:Zj(),util:Object.assign(Object.assign({},tK()),{newFieldList:t,initFields:n}),makeMessageType(r,i,a){return wj(this,r,i,a)},makeEnum:Pj,makeEnumType:Pb,getEnumType:Rj,makeExtension(r,i,a){return Mj(this,r,i,a)}}}m();T();N();var kh=class{constructor(t,n){this._fields=t,this._normalizer=n}findJsonName(t){if(!this.jsonNames){let n={};for(let r of this.list())n[r.jsonName]=n[r.name]=r;this.jsonNames=n}return this.jsonNames[t]}find(t){if(!this.numbers){let n={};for(let r of this.list())n[r.no]=r;this.numbers=n}return this.numbers[t]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((t,n)=>t.no-n.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];let t=this.members,n;for(let r of this.list())r.oneof?r.oneof!==n&&(n=r.oneof,t.push(n)):t.push(r)}return this.members}};m();T();N();m();T();N();m();T();N();function qb(e,t){let n=aK(e);return t?n:tme(eme(n))}function rK(e){return qb(e,!1)}var iK=aK;function aK(e){let t=!1,n=[];for(let r=0;r`${e}$`,eme=e=>Zpe.has(e)?sK(e):e,tme=e=>Xpe.has(e)?sK(e):e;var Mh=class{constructor(t){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=t,this.localName=rK(t)}addField(t){pn(t.oneof===this,`field ${t.name} not one of ${this.name}`),this.fields.push(t)}findField(t){if(!this._lookup){this._lookup=Object.create(null);for(let n=0;nnew kh(e,t=>oK(t,!0)),e=>{for(let t of e.getType().fields.byMember()){if(t.opt)continue;let n=t.localName,r=e;if(t.repeated){r[n]=[];continue}switch(t.kind){case"oneof":r[n]={case:void 0};break;case"enum":r[n]=0;break;case"map":r[n]={};break;case"scalar":r[n]=Ca(t.T,t.L);break;case"message":break}}});var Dd;(function(e){e[e.OK=0]="OK",e[e.ERR=1]="ERR",e[e.ERR_NOT_FOUND=2]="ERR_NOT_FOUND",e[e.ERR_ALREADY_EXISTS=3]="ERR_ALREADY_EXISTS",e[e.ERR_INVALID_SUBGRAPH_SCHEMA=4]="ERR_INVALID_SUBGRAPH_SCHEMA",e[e.ERR_SUBGRAPH_COMPOSITION_FAILED=5]="ERR_SUBGRAPH_COMPOSITION_FAILED",e[e.ERR_SUBGRAPH_CHECK_FAILED=6]="ERR_SUBGRAPH_CHECK_FAILED",e[e.ERR_INVALID_LABELS=7]="ERR_INVALID_LABELS",e[e.ERR_ANALYTICS_DISABLED=8]="ERR_ANALYTICS_DISABLED",e[e.ERROR_NOT_AUTHENTICATED=9]="ERROR_NOT_AUTHENTICATED",e[e.ERR_OPENAI_DISABLED=10]="ERR_OPENAI_DISABLED",e[e.ERR_FREE_TRIAL_EXPIRED=11]="ERR_FREE_TRIAL_EXPIRED",e[e.ERROR_NOT_AUTHORIZED=12]="ERROR_NOT_AUTHORIZED",e[e.ERR_LIMIT_REACHED=13]="ERR_LIMIT_REACHED",e[e.ERR_DEPLOYMENT_FAILED=14]="ERR_DEPLOYMENT_FAILED",e[e.ERR_INVALID_NAME=15]="ERR_INVALID_NAME",e[e.ERR_UPGRADE_PLAN=16]="ERR_UPGRADE_PLAN",e[e.ERR_BAD_REQUEST=17]="ERR_BAD_REQUEST",e[e.ERR_SCHEMA_MISMATCH_WITH_APPROVED_PROPOSAL=18]="ERR_SCHEMA_MISMATCH_WITH_APPROVED_PROPOSAL"})(Dd||(Dd={}));C.util.setEnumType(Dd,"wg.cosmo.common.EnumStatusCode",[{no:0,name:"OK"},{no:1,name:"ERR"},{no:2,name:"ERR_NOT_FOUND"},{no:3,name:"ERR_ALREADY_EXISTS"},{no:4,name:"ERR_INVALID_SUBGRAPH_SCHEMA"},{no:5,name:"ERR_SUBGRAPH_COMPOSITION_FAILED"},{no:6,name:"ERR_SUBGRAPH_CHECK_FAILED"},{no:7,name:"ERR_INVALID_LABELS"},{no:8,name:"ERR_ANALYTICS_DISABLED"},{no:9,name:"ERROR_NOT_AUTHENTICATED"},{no:10,name:"ERR_OPENAI_DISABLED"},{no:11,name:"ERR_FREE_TRIAL_EXPIRED"},{no:12,name:"ERROR_NOT_AUTHORIZED"},{no:13,name:"ERR_LIMIT_REACHED"},{no:14,name:"ERR_DEPLOYMENT_FAILED"},{no:15,name:"ERR_INVALID_NAME"},{no:16,name:"ERR_UPGRADE_PLAN"},{no:17,name:"ERR_BAD_REQUEST"},{no:18,name:"ERR_SCHEMA_MISMATCH_WITH_APPROVED_PROPOSAL"}]);var Ks;(function(e){e[e.GRAPHQL_SUBSCRIPTION_PROTOCOL_WS=0]="GRAPHQL_SUBSCRIPTION_PROTOCOL_WS",e[e.GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE=1]="GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE",e[e.GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE_POST=2]="GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE_POST"})(Ks||(Ks={}));C.util.setEnumType(Ks,"wg.cosmo.common.GraphQLSubscriptionProtocol",[{no:0,name:"GRAPHQL_SUBSCRIPTION_PROTOCOL_WS"},{no:1,name:"GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE"},{no:2,name:"GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE_POST"}]);var $s;(function(e){e[e.GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO=0]="GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO",e[e.GRAPHQL_WEBSOCKET_SUBPROTOCOL_WS=1]="GRAPHQL_WEBSOCKET_SUBPROTOCOL_WS",e[e.GRAPHQL_WEBSOCKET_SUBPROTOCOL_TRANSPORT_WS=2]="GRAPHQL_WEBSOCKET_SUBPROTOCOL_TRANSPORT_WS"})($s||($s={}));C.util.setEnumType($s,"wg.cosmo.common.GraphQLWebsocketSubprotocol",[{no:0,name:"GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO"},{no:1,name:"GRAPHQL_WEBSOCKET_SUBPROTOCOL_WS"},{no:2,name:"GRAPHQL_WEBSOCKET_SUBPROTOCOL_TRANSPORT_WS"}]);var EK=hi(Se(),1);m();T();N();var Vb;(function(e){e[e.RENDER_ARGUMENT_DEFAULT=0]="RENDER_ARGUMENT_DEFAULT",e[e.RENDER_ARGUMENT_AS_GRAPHQL_VALUE=1]="RENDER_ARGUMENT_AS_GRAPHQL_VALUE",e[e.RENDER_ARGUMENT_AS_ARRAY_CSV=2]="RENDER_ARGUMENT_AS_ARRAY_CSV"})(Vb||(Vb={}));C.util.setEnumType(Vb,"wg.cosmo.node.v1.ArgumentRenderConfiguration",[{no:0,name:"RENDER_ARGUMENT_DEFAULT"},{no:1,name:"RENDER_ARGUMENT_AS_GRAPHQL_VALUE"},{no:2,name:"RENDER_ARGUMENT_AS_ARRAY_CSV"}]);var Xc;(function(e){e[e.OBJECT_FIELD=0]="OBJECT_FIELD",e[e.FIELD_ARGUMENT=1]="FIELD_ARGUMENT"})(Xc||(Xc={}));C.util.setEnumType(Xc,"wg.cosmo.node.v1.ArgumentSource",[{no:0,name:"OBJECT_FIELD"},{no:1,name:"FIELD_ARGUMENT"}]);var ju;(function(e){e[e.STATIC=0]="STATIC",e[e.GRAPHQL=1]="GRAPHQL",e[e.PUBSUB=2]="PUBSUB"})(ju||(ju={}));C.util.setEnumType(ju,"wg.cosmo.node.v1.DataSourceKind",[{no:0,name:"STATIC"},{no:1,name:"GRAPHQL"},{no:2,name:"PUBSUB"}]);var qp;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.RESOLVE=1]="RESOLVE",e[e.REQUIRES=2]="REQUIRES"})(qp||(qp={}));C.util.setEnumType(qp,"wg.cosmo.node.v1.LookupType",[{no:0,name:"LOOKUP_TYPE_UNSPECIFIED"},{no:1,name:"LOOKUP_TYPE_RESOLVE"},{no:2,name:"LOOKUP_TYPE_REQUIRES"}]);var Vp;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.QUERY=1]="QUERY",e[e.MUTATION=2]="MUTATION",e[e.SUBSCRIPTION=3]="SUBSCRIPTION"})(Vp||(Vp={}));C.util.setEnumType(Vp,"wg.cosmo.node.v1.OperationType",[{no:0,name:"OPERATION_TYPE_UNSPECIFIED"},{no:1,name:"OPERATION_TYPE_QUERY"},{no:2,name:"OPERATION_TYPE_MUTATION"},{no:3,name:"OPERATION_TYPE_SUBSCRIPTION"}]);var iu;(function(e){e[e.PUBLISH=0]="PUBLISH",e[e.REQUEST=1]="REQUEST",e[e.SUBSCRIBE=2]="SUBSCRIBE"})(iu||(iu={}));C.util.setEnumType(iu,"wg.cosmo.node.v1.EventType",[{no:0,name:"PUBLISH"},{no:1,name:"REQUEST"},{no:2,name:"SUBSCRIBE"}]);var Ku;(function(e){e[e.STATIC_CONFIGURATION_VARIABLE=0]="STATIC_CONFIGURATION_VARIABLE",e[e.ENV_CONFIGURATION_VARIABLE=1]="ENV_CONFIGURATION_VARIABLE",e[e.PLACEHOLDER_CONFIGURATION_VARIABLE=2]="PLACEHOLDER_CONFIGURATION_VARIABLE"})(Ku||(Ku={}));C.util.setEnumType(Ku,"wg.cosmo.node.v1.ConfigurationVariableKind",[{no:0,name:"STATIC_CONFIGURATION_VARIABLE"},{no:1,name:"ENV_CONFIGURATION_VARIABLE"},{no:2,name:"PLACEHOLDER_CONFIGURATION_VARIABLE"}]);var Zc;(function(e){e[e.GET=0]="GET",e[e.POST=1]="POST",e[e.PUT=2]="PUT",e[e.DELETE=3]="DELETE",e[e.OPTIONS=4]="OPTIONS"})(Zc||(Zc={}));C.util.setEnumType(Zc,"wg.cosmo.node.v1.HTTPMethod",[{no:0,name:"GET"},{no:1,name:"POST"},{no:2,name:"PUT"},{no:3,name:"DELETE"},{no:4,name:"OPTIONS"}]);var Gs=class Gs extends Pe{constructor(n){super();g(this,"id","");g(this,"name","");g(this,"routingUrl","");C.util.initPartial(n,this)}static fromBinary(n,r){return new Gs().fromBinary(n,r)}static fromJson(n,r){return new Gs().fromJson(n,r)}static fromJsonString(n,r){return new Gs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Gs,n,r)}};g(Gs,"runtime",C),g(Gs,"typeName","wg.cosmo.node.v1.Subgraph"),g(Gs,"fields",C.util.newFieldList(()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"routing_url",kind:"scalar",T:9}]));var xh=Gs,Qs=class Qs extends Pe{constructor(n){super();g(this,"configByFeatureFlagName",{});C.util.initPartial(n,this)}static fromBinary(n,r){return new Qs().fromBinary(n,r)}static fromJson(n,r){return new Qs().fromJson(n,r)}static fromJsonString(n,r){return new Qs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Qs,n,r)}};g(Qs,"runtime",C),g(Qs,"typeName","wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs"),g(Qs,"fields",C.util.newFieldList(()=>[{no:1,name:"config_by_feature_flag_name",kind:"map",K:9,V:{kind:"message",T:Kb}}]));var jb=Qs,Ys=class Ys extends Pe{constructor(n){super();g(this,"engineConfig");g(this,"version","");g(this,"subgraphs",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new Ys().fromBinary(n,r)}static fromJson(n,r){return new Ys().fromJson(n,r)}static fromJsonString(n,r){return new Ys().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Ys,n,r)}};g(Ys,"runtime",C),g(Ys,"typeName","wg.cosmo.node.v1.FeatureFlagRouterExecutionConfig"),g(Ys,"fields",C.util.newFieldList(()=>[{no:1,name:"engine_config",kind:"message",T:bd},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"subgraphs",kind:"message",T:xh,repeated:!0}]));var Kb=Ys,Js=class Js extends Pe{constructor(n){super();g(this,"engineConfig");g(this,"version","");g(this,"subgraphs",[]);g(this,"featureFlagConfigs");g(this,"compatibilityVersion","");C.util.initPartial(n,this)}static fromBinary(n,r){return new Js().fromBinary(n,r)}static fromJson(n,r){return new Js().fromJson(n,r)}static fromJsonString(n,r){return new Js().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Js,n,r)}};g(Js,"runtime",C),g(Js,"typeName","wg.cosmo.node.v1.RouterConfig"),g(Js,"fields",C.util.newFieldList(()=>[{no:1,name:"engine_config",kind:"message",T:bd},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"subgraphs",kind:"message",T:xh,repeated:!0},{no:4,name:"feature_flag_configs",kind:"message",T:jb,opt:!0},{no:5,name:"compatibility_version",kind:"scalar",T:9}]));var jp=Js,zs=class zs extends Pe{constructor(n){super();g(this,"code",Dd.OK);g(this,"details");C.util.initPartial(n,this)}static fromBinary(n,r){return new zs().fromBinary(n,r)}static fromJson(n,r){return new zs().fromJson(n,r)}static fromJsonString(n,r){return new zs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(zs,n,r)}};g(zs,"runtime",C),g(zs,"typeName","wg.cosmo.node.v1.Response"),g(zs,"fields",C.util.newFieldList(()=>[{no:1,name:"code",kind:"enum",T:C.getEnumType(Dd)},{no:2,name:"details",kind:"scalar",T:9,opt:!0}]));var $b=zs,Hs=class Hs extends Pe{constructor(n){super();g(this,"code",0);g(this,"message","");C.util.initPartial(n,this)}static fromBinary(n,r){return new Hs().fromBinary(n,r)}static fromJson(n,r){return new Hs().fromJson(n,r)}static fromJsonString(n,r){return new Hs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Hs,n,r)}};g(Hs,"runtime",C),g(Hs,"typeName","wg.cosmo.node.v1.ResponseStatus"),g(Hs,"fields",C.util.newFieldList(()=>[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9}]));var uK=Hs,Ws=class Ws extends Pe{constructor(n){super();g(this,"accountLimits");g(this,"graphPublicKey","");C.util.initPartial(n,this)}static fromBinary(n,r){return new Ws().fromBinary(n,r)}static fromJson(n,r){return new Ws().fromJson(n,r)}static fromJsonString(n,r){return new Ws().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Ws,n,r)}};g(Ws,"runtime",C),g(Ws,"typeName","wg.cosmo.node.v1.RegistrationInfo"),g(Ws,"fields",C.util.newFieldList(()=>[{no:1,name:"account_limits",kind:"message",T:Qb},{no:2,name:"graph_public_key",kind:"scalar",T:9}]));var Gb=Ws,Xs=class Xs extends Pe{constructor(n){super();g(this,"traceSamplingRate",0);C.util.initPartial(n,this)}static fromBinary(n,r){return new Xs().fromBinary(n,r)}static fromJson(n,r){return new Xs().fromJson(n,r)}static fromJsonString(n,r){return new Xs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Xs,n,r)}};g(Xs,"runtime",C),g(Xs,"typeName","wg.cosmo.node.v1.AccountLimits"),g(Xs,"fields",C.util.newFieldList(()=>[{no:1,name:"trace_sampling_rate",kind:"scalar",T:2}]));var Qb=Xs,Zs=class Zs extends Pe{constructor(t){super(),C.util.initPartial(t,this)}static fromBinary(t,n){return new Zs().fromBinary(t,n)}static fromJson(t,n){return new Zs().fromJson(t,n)}static fromJsonString(t,n){return new Zs().fromJsonString(t,n)}static equals(t,n){return C.util.equals(Zs,t,n)}};g(Zs,"runtime",C),g(Zs,"typeName","wg.cosmo.node.v1.SelfRegisterRequest"),g(Zs,"fields",C.util.newFieldList(()=>[]));var cK=Zs,eo=class eo extends Pe{constructor(n){super();g(this,"response");g(this,"registrationInfo");C.util.initPartial(n,this)}static fromBinary(n,r){return new eo().fromBinary(n,r)}static fromJson(n,r){return new eo().fromJson(n,r)}static fromJsonString(n,r){return new eo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(eo,n,r)}};g(eo,"runtime",C),g(eo,"typeName","wg.cosmo.node.v1.SelfRegisterResponse"),g(eo,"fields",C.util.newFieldList(()=>[{no:1,name:"response",kind:"message",T:$b},{no:2,name:"registrationInfo",kind:"message",T:Gb,opt:!0}]));var lK=eo,to=class to extends Pe{constructor(n){super();g(this,"defaultFlushInterval",Jn.zero);g(this,"datasourceConfigurations",[]);g(this,"fieldConfigurations",[]);g(this,"graphqlSchema","");g(this,"typeConfigurations",[]);g(this,"stringStorage",{});g(this,"graphqlClientSchema");C.util.initPartial(n,this)}static fromBinary(n,r){return new to().fromBinary(n,r)}static fromJson(n,r){return new to().fromJson(n,r)}static fromJsonString(n,r){return new to().fromJsonString(n,r)}static equals(n,r){return C.util.equals(to,n,r)}};g(to,"runtime",C),g(to,"typeName","wg.cosmo.node.v1.EngineConfiguration"),g(to,"fields",C.util.newFieldList(()=>[{no:1,name:"defaultFlushInterval",kind:"scalar",T:3},{no:2,name:"datasource_configurations",kind:"message",T:Kp,repeated:!0},{no:3,name:"field_configurations",kind:"message",T:zp,repeated:!0},{no:4,name:"graphqlSchema",kind:"scalar",T:9},{no:5,name:"type_configurations",kind:"message",T:Yb,repeated:!0},{no:6,name:"string_storage",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:7,name:"graphql_client_schema",kind:"scalar",T:9,opt:!0}]));var bd=to,no=class no extends Pe{constructor(n){super();g(this,"kind",ju.STATIC);g(this,"rootNodes",[]);g(this,"childNodes",[]);g(this,"overrideFieldPathFromAlias",!1);g(this,"customGraphql");g(this,"customStatic");g(this,"directives",[]);g(this,"requestTimeoutSeconds",Jn.zero);g(this,"id","");g(this,"keys",[]);g(this,"provides",[]);g(this,"requires",[]);g(this,"customEvents");g(this,"entityInterfaces",[]);g(this,"interfaceObjects",[]);g(this,"costConfiguration");C.util.initPartial(n,this)}static fromBinary(n,r){return new no().fromBinary(n,r)}static fromJson(n,r){return new no().fromJson(n,r)}static fromJsonString(n,r){return new no().fromJsonString(n,r)}static equals(n,r){return C.util.equals(no,n,r)}};g(no,"runtime",C),g(no,"typeName","wg.cosmo.node.v1.DataSourceConfiguration"),g(no,"fields",C.util.newFieldList(()=>[{no:1,name:"kind",kind:"enum",T:C.getEnumType(ju)},{no:2,name:"root_nodes",kind:"message",T:Ad,repeated:!0},{no:3,name:"child_nodes",kind:"message",T:Ad,repeated:!0},{no:4,name:"override_field_path_from_alias",kind:"scalar",T:8},{no:5,name:"custom_graphql",kind:"message",T:Xp},{no:6,name:"custom_static",kind:"message",T:sA},{no:7,name:"directives",kind:"message",T:oA,repeated:!0},{no:8,name:"request_timeout_seconds",kind:"scalar",T:3},{no:9,name:"id",kind:"scalar",T:9},{no:10,name:"keys",kind:"message",T:Wc,repeated:!0},{no:11,name:"provides",kind:"message",T:Wc,repeated:!0},{no:12,name:"requires",kind:"message",T:Wc,repeated:!0},{no:13,name:"custom_events",kind:"message",T:tl},{no:14,name:"entity_interfaces",kind:"message",T:Rd,repeated:!0},{no:15,name:"interface_objects",kind:"message",T:Rd,repeated:!0},{no:16,name:"cost_configuration",kind:"message",T:$p}]));var Kp=no,ro=class ro extends Pe{constructor(n){super();g(this,"fieldWeights",[]);g(this,"listSizes",[]);g(this,"typeWeights",{});g(this,"directiveArgumentWeights",{});C.util.initPartial(n,this)}static fromBinary(n,r){return new ro().fromBinary(n,r)}static fromJson(n,r){return new ro().fromJson(n,r)}static fromJsonString(n,r){return new ro().fromJsonString(n,r)}static equals(n,r){return C.util.equals(ro,n,r)}};g(ro,"runtime",C),g(ro,"typeName","wg.cosmo.node.v1.CostConfiguration"),g(ro,"fields",C.util.newFieldList(()=>[{no:1,name:"field_weights",kind:"message",T:Gp,repeated:!0},{no:2,name:"list_sizes",kind:"message",T:Qp,repeated:!0},{no:3,name:"type_weights",kind:"map",K:9,V:{kind:"scalar",T:5}},{no:4,name:"directive_argument_weights",kind:"map",K:9,V:{kind:"scalar",T:5}}]));var $p=ro,io=class io extends Pe{constructor(n){super();g(this,"typeName","");g(this,"fieldName","");g(this,"weight");g(this,"argumentWeights",{});C.util.initPartial(n,this)}static fromBinary(n,r){return new io().fromBinary(n,r)}static fromJson(n,r){return new io().fromJson(n,r)}static fromJsonString(n,r){return new io().fromJsonString(n,r)}static equals(n,r){return C.util.equals(io,n,r)}};g(io,"runtime",C),g(io,"typeName","wg.cosmo.node.v1.FieldWeightConfiguration"),g(io,"fields",C.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9},{no:3,name:"weight",kind:"scalar",T:5,opt:!0},{no:4,name:"argument_weights",kind:"map",K:9,V:{kind:"scalar",T:5}}]));var Gp=io,ao=class ao extends Pe{constructor(n){super();g(this,"typeName","");g(this,"fieldName","");g(this,"assumedSize");g(this,"slicingArguments",[]);g(this,"sizedFields",[]);g(this,"requireOneSlicingArgument");C.util.initPartial(n,this)}static fromBinary(n,r){return new ao().fromBinary(n,r)}static fromJson(n,r){return new ao().fromJson(n,r)}static fromJsonString(n,r){return new ao().fromJsonString(n,r)}static equals(n,r){return C.util.equals(ao,n,r)}};g(ao,"runtime",C),g(ao,"typeName","wg.cosmo.node.v1.FieldListSizeConfiguration"),g(ao,"fields",C.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9},{no:3,name:"assumed_size",kind:"scalar",T:5,opt:!0},{no:4,name:"slicing_arguments",kind:"scalar",T:9,repeated:!0},{no:5,name:"sized_fields",kind:"scalar",T:9,repeated:!0},{no:6,name:"require_one_slicing_argument",kind:"scalar",T:8,opt:!0}]));var Qp=ao,so=class so extends Pe{constructor(n){super();g(this,"name","");g(this,"sourceType",Xc.OBJECT_FIELD);C.util.initPartial(n,this)}static fromBinary(n,r){return new so().fromBinary(n,r)}static fromJson(n,r){return new so().fromJson(n,r)}static fromJsonString(n,r){return new so().fromJsonString(n,r)}static equals(n,r){return C.util.equals(so,n,r)}};g(so,"runtime",C),g(so,"typeName","wg.cosmo.node.v1.ArgumentConfiguration"),g(so,"fields",C.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"source_type",kind:"enum",T:C.getEnumType(Xc)}]));var Yp=so,oo=class oo extends Pe{constructor(n){super();g(this,"requiredAndScopes",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new oo().fromBinary(n,r)}static fromJson(n,r){return new oo().fromJson(n,r)}static fromJsonString(n,r){return new oo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(oo,n,r)}};g(oo,"runtime",C),g(oo,"typeName","wg.cosmo.node.v1.Scopes"),g(oo,"fields",C.util.newFieldList(()=>[{no:1,name:"required_and_scopes",kind:"scalar",T:9,repeated:!0}]));var el=oo,uo=class uo extends Pe{constructor(n){super();g(this,"requiresAuthentication",!1);g(this,"requiredOrScopes",[]);g(this,"requiredOrScopesByOr",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new uo().fromBinary(n,r)}static fromJson(n,r){return new uo().fromJson(n,r)}static fromJsonString(n,r){return new uo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(uo,n,r)}};g(uo,"runtime",C),g(uo,"typeName","wg.cosmo.node.v1.AuthorizationConfiguration"),g(uo,"fields",C.util.newFieldList(()=>[{no:1,name:"requires_authentication",kind:"scalar",T:8},{no:2,name:"required_or_scopes",kind:"message",T:el,repeated:!0},{no:3,name:"required_or_scopes_by_or",kind:"message",T:el,repeated:!0}]));var Jp=uo,co=class co extends Pe{constructor(n){super();g(this,"typeName","");g(this,"fieldName","");g(this,"argumentsConfiguration",[]);g(this,"authorizationConfiguration");g(this,"subscriptionFilterCondition");C.util.initPartial(n,this)}static fromBinary(n,r){return new co().fromBinary(n,r)}static fromJson(n,r){return new co().fromJson(n,r)}static fromJsonString(n,r){return new co().fromJsonString(n,r)}static equals(n,r){return C.util.equals(co,n,r)}};g(co,"runtime",C),g(co,"typeName","wg.cosmo.node.v1.FieldConfiguration"),g(co,"fields",C.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9},{no:3,name:"arguments_configuration",kind:"message",T:Yp,repeated:!0},{no:4,name:"authorization_configuration",kind:"message",T:Jp},{no:5,name:"subscription_filter_condition",kind:"message",T:$u,opt:!0}]));var zp=co,lo=class lo extends Pe{constructor(n){super();g(this,"typeName","");g(this,"renameTo","");C.util.initPartial(n,this)}static fromBinary(n,r){return new lo().fromBinary(n,r)}static fromJson(n,r){return new lo().fromJson(n,r)}static fromJsonString(n,r){return new lo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(lo,n,r)}};g(lo,"runtime",C),g(lo,"typeName","wg.cosmo.node.v1.TypeConfiguration"),g(lo,"fields",C.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"rename_to",kind:"scalar",T:9}]));var Yb=lo,fo=class fo extends Pe{constructor(n){super();g(this,"typeName","");g(this,"fieldNames",[]);g(this,"externalFieldNames",[]);g(this,"requireFetchReasonsFieldNames",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new fo().fromBinary(n,r)}static fromJson(n,r){return new fo().fromJson(n,r)}static fromJsonString(n,r){return new fo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(fo,n,r)}};g(fo,"runtime",C),g(fo,"typeName","wg.cosmo.node.v1.TypeField"),g(fo,"fields",C.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_names",kind:"scalar",T:9,repeated:!0},{no:3,name:"external_field_names",kind:"scalar",T:9,repeated:!0},{no:4,name:"require_fetch_reasons_field_names",kind:"scalar",T:9,repeated:!0}]));var Ad=fo,po=class po extends Pe{constructor(n){super();g(this,"fieldName","");g(this,"typeName","");C.util.initPartial(n,this)}static fromBinary(n,r){return new po().fromBinary(n,r)}static fromJson(n,r){return new po().fromJson(n,r)}static fromJsonString(n,r){return new po().fromJsonString(n,r)}static equals(n,r){return C.util.equals(po,n,r)}};g(po,"runtime",C),g(po,"typeName","wg.cosmo.node.v1.FieldCoordinates"),g(po,"fields",C.util.newFieldList(()=>[{no:1,name:"field_name",kind:"scalar",T:9},{no:2,name:"type_name",kind:"scalar",T:9}]));var Hp=po,mo=class mo extends Pe{constructor(n){super();g(this,"fieldCoordinatesPath",[]);g(this,"fieldPath",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new mo().fromBinary(n,r)}static fromJson(n,r){return new mo().fromJson(n,r)}static fromJsonString(n,r){return new mo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(mo,n,r)}};g(mo,"runtime",C),g(mo,"typeName","wg.cosmo.node.v1.FieldSetCondition"),g(mo,"fields",C.util.newFieldList(()=>[{no:1,name:"field_coordinates_path",kind:"message",T:Hp,repeated:!0},{no:2,name:"field_path",kind:"scalar",T:9,repeated:!0}]));var Wp=mo,No=class No extends Pe{constructor(n){super();g(this,"typeName","");g(this,"fieldName","");g(this,"selectionSet","");g(this,"disableEntityResolver",!1);g(this,"conditions",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new No().fromBinary(n,r)}static fromJson(n,r){return new No().fromJson(n,r)}static fromJsonString(n,r){return new No().fromJsonString(n,r)}static equals(n,r){return C.util.equals(No,n,r)}};g(No,"runtime",C),g(No,"typeName","wg.cosmo.node.v1.RequiredField"),g(No,"fields",C.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9},{no:3,name:"selection_set",kind:"scalar",T:9},{no:4,name:"disable_entity_resolver",kind:"scalar",T:8},{no:5,name:"conditions",kind:"message",T:Wp,repeated:!0}]));var Wc=No,To=class To extends Pe{constructor(n){super();g(this,"interfaceTypeName","");g(this,"concreteTypeNames",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new To().fromBinary(n,r)}static fromJson(n,r){return new To().fromJson(n,r)}static fromJsonString(n,r){return new To().fromJsonString(n,r)}static equals(n,r){return C.util.equals(To,n,r)}};g(To,"runtime",C),g(To,"typeName","wg.cosmo.node.v1.EntityInterfaceConfiguration"),g(To,"fields",C.util.newFieldList(()=>[{no:1,name:"interface_type_name",kind:"scalar",T:9},{no:2,name:"concrete_type_names",kind:"scalar",T:9,repeated:!0}]));var Rd=To,Eo=class Eo extends Pe{constructor(n){super();g(this,"url");g(this,"method",Zc.GET);g(this,"header",{});g(this,"body");g(this,"query",[]);g(this,"urlEncodeBody",!1);g(this,"mtls");g(this,"baseUrl");g(this,"path");g(this,"httpProxyUrl");C.util.initPartial(n,this)}static fromBinary(n,r){return new Eo().fromBinary(n,r)}static fromJson(n,r){return new Eo().fromJson(n,r)}static fromJsonString(n,r){return new Eo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Eo,n,r)}};g(Eo,"runtime",C),g(Eo,"typeName","wg.cosmo.node.v1.FetchConfiguration"),g(Eo,"fields",C.util.newFieldList(()=>[{no:1,name:"url",kind:"message",T:Hr},{no:2,name:"method",kind:"enum",T:C.getEnumType(Zc)},{no:3,name:"header",kind:"map",K:9,V:{kind:"message",T:cA}},{no:4,name:"body",kind:"message",T:Hr},{no:5,name:"query",kind:"message",T:uA,repeated:!0},{no:7,name:"url_encode_body",kind:"scalar",T:8},{no:8,name:"mtls",kind:"message",T:lA},{no:9,name:"base_url",kind:"message",T:Hr},{no:10,name:"path",kind:"message",T:Hr},{no:11,name:"http_proxy_url",kind:"message",T:Hr,opt:!0}]));var Jb=Eo,ho=class ho extends Pe{constructor(n){super();g(this,"statusCode",Jn.zero);g(this,"typeName","");g(this,"injectStatusCodeIntoBody",!1);C.util.initPartial(n,this)}static fromBinary(n,r){return new ho().fromBinary(n,r)}static fromJson(n,r){return new ho().fromJson(n,r)}static fromJsonString(n,r){return new ho().fromJsonString(n,r)}static equals(n,r){return C.util.equals(ho,n,r)}};g(ho,"runtime",C),g(ho,"typeName","wg.cosmo.node.v1.StatusCodeTypeMapping"),g(ho,"fields",C.util.newFieldList(()=>[{no:1,name:"status_code",kind:"scalar",T:3},{no:2,name:"type_name",kind:"scalar",T:9},{no:3,name:"inject_status_code_into_body",kind:"scalar",T:8}]));var dK=ho,yo=class yo extends Pe{constructor(n){super();g(this,"fetch");g(this,"subscription");g(this,"federation");g(this,"upstreamSchema");g(this,"customScalarTypeFields",[]);g(this,"grpc");C.util.initPartial(n,this)}static fromBinary(n,r){return new yo().fromBinary(n,r)}static fromJson(n,r){return new yo().fromJson(n,r)}static fromJsonString(n,r){return new yo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(yo,n,r)}};g(yo,"runtime",C),g(yo,"typeName","wg.cosmo.node.v1.DataSourceCustom_GraphQL"),g(yo,"fields",C.util.newFieldList(()=>[{no:1,name:"fetch",kind:"message",T:Jb},{no:2,name:"subscription",kind:"message",T:dA},{no:3,name:"federation",kind:"message",T:fA},{no:4,name:"upstream_schema",kind:"message",T:am},{no:6,name:"custom_scalar_type_fields",kind:"message",T:pA,repeated:!0},{no:7,name:"grpc",kind:"message",T:Pd}]));var Xp=yo,Io=class Io extends Pe{constructor(n){super();g(this,"mapping");g(this,"protoSchema","");g(this,"plugin");C.util.initPartial(n,this)}static fromBinary(n,r){return new Io().fromBinary(n,r)}static fromJson(n,r){return new Io().fromJson(n,r)}static fromJsonString(n,r){return new Io().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Io,n,r)}};g(Io,"runtime",C),g(Io,"typeName","wg.cosmo.node.v1.GRPCConfiguration"),g(Io,"fields",C.util.newFieldList(()=>[{no:1,name:"mapping",kind:"message",T:Hb},{no:2,name:"proto_schema",kind:"scalar",T:9},{no:3,name:"plugin",kind:"message",T:Zp}]));var Pd=Io,go=class go extends Pe{constructor(n){super();g(this,"repository","");g(this,"reference","");C.util.initPartial(n,this)}static fromBinary(n,r){return new go().fromBinary(n,r)}static fromJson(n,r){return new go().fromJson(n,r)}static fromJsonString(n,r){return new go().fromJsonString(n,r)}static equals(n,r){return C.util.equals(go,n,r)}};g(go,"runtime",C),g(go,"typeName","wg.cosmo.node.v1.ImageReference"),g(go,"fields",C.util.newFieldList(()=>[{no:1,name:"repository",kind:"scalar",T:9},{no:2,name:"reference",kind:"scalar",T:9}]));var zb=go,_o=class _o extends Pe{constructor(n){super();g(this,"name","");g(this,"version","");g(this,"imageReference");C.util.initPartial(n,this)}static fromBinary(n,r){return new _o().fromBinary(n,r)}static fromJson(n,r){return new _o().fromJson(n,r)}static fromJsonString(n,r){return new _o().fromJsonString(n,r)}static equals(n,r){return C.util.equals(_o,n,r)}};g(_o,"runtime",C),g(_o,"typeName","wg.cosmo.node.v1.PluginConfiguration"),g(_o,"fields",C.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"image_reference",kind:"message",T:zb,opt:!0}]));var Zp=_o,vo=class vo extends Pe{constructor(n){super();g(this,"enabled",!1);C.util.initPartial(n,this)}static fromBinary(n,r){return new vo().fromBinary(n,r)}static fromJson(n,r){return new vo().fromJson(n,r)}static fromJsonString(n,r){return new vo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(vo,n,r)}};g(vo,"runtime",C),g(vo,"typeName","wg.cosmo.node.v1.SSLConfiguration"),g(vo,"fields",C.util.newFieldList(()=>[{no:1,name:"enabled",kind:"scalar",T:8}]));var fK=vo,So=class So extends Pe{constructor(n){super();g(this,"version",0);g(this,"service","");g(this,"operationMappings",[]);g(this,"entityMappings",[]);g(this,"typeFieldMappings",[]);g(this,"enumMappings",[]);g(this,"resolveMappings",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new So().fromBinary(n,r)}static fromJson(n,r){return new So().fromJson(n,r)}static fromJsonString(n,r){return new So().fromJsonString(n,r)}static equals(n,r){return C.util.equals(So,n,r)}};g(So,"runtime",C),g(So,"typeName","wg.cosmo.node.v1.GRPCMapping"),g(So,"fields",C.util.newFieldList(()=>[{no:1,name:"version",kind:"scalar",T:5},{no:2,name:"service",kind:"scalar",T:9},{no:3,name:"operation_mappings",kind:"message",T:Zb,repeated:!0},{no:4,name:"entity_mappings",kind:"message",T:eA,repeated:!0},{no:5,name:"type_field_mappings",kind:"message",T:nA,repeated:!0},{no:6,name:"enum_mappings",kind:"message",T:iA,repeated:!0},{no:7,name:"resolve_mappings",kind:"message",T:Wb,repeated:!0}]));var Hb=So,Oo=class Oo extends Pe{constructor(n){super();g(this,"type",qp.UNSPECIFIED);g(this,"lookupMapping");g(this,"rpc","");g(this,"request","");g(this,"response","");C.util.initPartial(n,this)}static fromBinary(n,r){return new Oo().fromBinary(n,r)}static fromJson(n,r){return new Oo().fromJson(n,r)}static fromJsonString(n,r){return new Oo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Oo,n,r)}};g(Oo,"runtime",C),g(Oo,"typeName","wg.cosmo.node.v1.LookupMapping"),g(Oo,"fields",C.util.newFieldList(()=>[{no:1,name:"type",kind:"enum",T:C.getEnumType(qp)},{no:2,name:"lookup_mapping",kind:"message",T:Xb},{no:3,name:"rpc",kind:"scalar",T:9},{no:4,name:"request",kind:"scalar",T:9},{no:5,name:"response",kind:"scalar",T:9}]));var Wb=Oo,Do=class Do extends Pe{constructor(n){super();g(this,"type","");g(this,"fieldMapping");C.util.initPartial(n,this)}static fromBinary(n,r){return new Do().fromBinary(n,r)}static fromJson(n,r){return new Do().fromJson(n,r)}static fromJsonString(n,r){return new Do().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Do,n,r)}};g(Do,"runtime",C),g(Do,"typeName","wg.cosmo.node.v1.LookupFieldMapping"),g(Do,"fields",C.util.newFieldList(()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"field_mapping",kind:"message",T:em}]));var Xb=Do,bo=class bo extends Pe{constructor(n){super();g(this,"type",Vp.UNSPECIFIED);g(this,"original","");g(this,"mapped","");g(this,"request","");g(this,"response","");C.util.initPartial(n,this)}static fromBinary(n,r){return new bo().fromBinary(n,r)}static fromJson(n,r){return new bo().fromJson(n,r)}static fromJsonString(n,r){return new bo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(bo,n,r)}};g(bo,"runtime",C),g(bo,"typeName","wg.cosmo.node.v1.OperationMapping"),g(bo,"fields",C.util.newFieldList(()=>[{no:1,name:"type",kind:"enum",T:C.getEnumType(Vp)},{no:2,name:"original",kind:"scalar",T:9},{no:3,name:"mapped",kind:"scalar",T:9},{no:4,name:"request",kind:"scalar",T:9},{no:5,name:"response",kind:"scalar",T:9}]));var Zb=bo,Ao=class Ao extends Pe{constructor(n){super();g(this,"typeName","");g(this,"kind","");g(this,"key","");g(this,"rpc","");g(this,"request","");g(this,"response","");g(this,"requiredFieldMappings",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new Ao().fromBinary(n,r)}static fromJson(n,r){return new Ao().fromJson(n,r)}static fromJsonString(n,r){return new Ao().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Ao,n,r)}};g(Ao,"runtime",C),g(Ao,"typeName","wg.cosmo.node.v1.EntityMapping"),g(Ao,"fields",C.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"kind",kind:"scalar",T:9},{no:3,name:"key",kind:"scalar",T:9},{no:4,name:"rpc",kind:"scalar",T:9},{no:5,name:"request",kind:"scalar",T:9},{no:6,name:"response",kind:"scalar",T:9},{no:7,name:"required_field_mappings",kind:"message",T:tA,repeated:!0}]));var eA=Ao,Ro=class Ro extends Pe{constructor(n){super();g(this,"fieldMapping");g(this,"rpc","");g(this,"request","");g(this,"response","");C.util.initPartial(n,this)}static fromBinary(n,r){return new Ro().fromBinary(n,r)}static fromJson(n,r){return new Ro().fromJson(n,r)}static fromJsonString(n,r){return new Ro().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Ro,n,r)}};g(Ro,"runtime",C),g(Ro,"typeName","wg.cosmo.node.v1.RequiredFieldMapping"),g(Ro,"fields",C.util.newFieldList(()=>[{no:1,name:"field_mapping",kind:"message",T:em},{no:2,name:"rpc",kind:"scalar",T:9},{no:3,name:"request",kind:"scalar",T:9},{no:4,name:"response",kind:"scalar",T:9}]));var tA=Ro,Po=class Po extends Pe{constructor(n){super();g(this,"type","");g(this,"fieldMappings",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new Po().fromBinary(n,r)}static fromJson(n,r){return new Po().fromJson(n,r)}static fromJsonString(n,r){return new Po().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Po,n,r)}};g(Po,"runtime",C),g(Po,"typeName","wg.cosmo.node.v1.TypeFieldMapping"),g(Po,"fields",C.util.newFieldList(()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"field_mappings",kind:"message",T:em,repeated:!0}]));var nA=Po,Fo=class Fo extends Pe{constructor(n){super();g(this,"original","");g(this,"mapped","");g(this,"argumentMappings",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new Fo().fromBinary(n,r)}static fromJson(n,r){return new Fo().fromJson(n,r)}static fromJsonString(n,r){return new Fo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Fo,n,r)}};g(Fo,"runtime",C),g(Fo,"typeName","wg.cosmo.node.v1.FieldMapping"),g(Fo,"fields",C.util.newFieldList(()=>[{no:1,name:"original",kind:"scalar",T:9},{no:2,name:"mapped",kind:"scalar",T:9},{no:3,name:"argument_mappings",kind:"message",T:rA,repeated:!0}]));var em=Fo,wo=class wo extends Pe{constructor(n){super();g(this,"original","");g(this,"mapped","");C.util.initPartial(n,this)}static fromBinary(n,r){return new wo().fromBinary(n,r)}static fromJson(n,r){return new wo().fromJson(n,r)}static fromJsonString(n,r){return new wo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(wo,n,r)}};g(wo,"runtime",C),g(wo,"typeName","wg.cosmo.node.v1.ArgumentMapping"),g(wo,"fields",C.util.newFieldList(()=>[{no:1,name:"original",kind:"scalar",T:9},{no:2,name:"mapped",kind:"scalar",T:9}]));var rA=wo,Lo=class Lo extends Pe{constructor(n){super();g(this,"type","");g(this,"values",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new Lo().fromBinary(n,r)}static fromJson(n,r){return new Lo().fromJson(n,r)}static fromJsonString(n,r){return new Lo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Lo,n,r)}};g(Lo,"runtime",C),g(Lo,"typeName","wg.cosmo.node.v1.EnumMapping"),g(Lo,"fields",C.util.newFieldList(()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"values",kind:"message",T:aA,repeated:!0}]));var iA=Lo,Co=class Co extends Pe{constructor(n){super();g(this,"original","");g(this,"mapped","");C.util.initPartial(n,this)}static fromBinary(n,r){return new Co().fromBinary(n,r)}static fromJson(n,r){return new Co().fromJson(n,r)}static fromJsonString(n,r){return new Co().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Co,n,r)}};g(Co,"runtime",C),g(Co,"typeName","wg.cosmo.node.v1.EnumValueMapping"),g(Co,"fields",C.util.newFieldList(()=>[{no:1,name:"original",kind:"scalar",T:9},{no:2,name:"mapped",kind:"scalar",T:9}]));var aA=Co,Uo=class Uo extends Pe{constructor(n){super();g(this,"consumerName","");g(this,"streamName","");g(this,"consumerInactiveThreshold",0);C.util.initPartial(n,this)}static fromBinary(n,r){return new Uo().fromBinary(n,r)}static fromJson(n,r){return new Uo().fromJson(n,r)}static fromJsonString(n,r){return new Uo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Uo,n,r)}};g(Uo,"runtime",C),g(Uo,"typeName","wg.cosmo.node.v1.NatsStreamConfiguration"),g(Uo,"fields",C.util.newFieldList(()=>[{no:1,name:"consumer_name",kind:"scalar",T:9},{no:2,name:"stream_name",kind:"scalar",T:9},{no:3,name:"consumer_inactive_threshold",kind:"scalar",T:5}]));var tm=Uo,Bo=class Bo extends Pe{constructor(n){super();g(this,"engineEventConfiguration");g(this,"subjects",[]);g(this,"streamConfiguration");C.util.initPartial(n,this)}static fromBinary(n,r){return new Bo().fromBinary(n,r)}static fromJson(n,r){return new Bo().fromJson(n,r)}static fromJsonString(n,r){return new Bo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Bo,n,r)}};g(Bo,"runtime",C),g(Bo,"typeName","wg.cosmo.node.v1.NatsEventConfiguration"),g(Bo,"fields",C.util.newFieldList(()=>[{no:1,name:"engine_event_configuration",kind:"message",T:au},{no:2,name:"subjects",kind:"scalar",T:9,repeated:!0},{no:3,name:"stream_configuration",kind:"message",T:tm}]));var nm=Bo,ko=class ko extends Pe{constructor(n){super();g(this,"engineEventConfiguration");g(this,"topics",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new ko().fromBinary(n,r)}static fromJson(n,r){return new ko().fromJson(n,r)}static fromJsonString(n,r){return new ko().fromJsonString(n,r)}static equals(n,r){return C.util.equals(ko,n,r)}};g(ko,"runtime",C),g(ko,"typeName","wg.cosmo.node.v1.KafkaEventConfiguration"),g(ko,"fields",C.util.newFieldList(()=>[{no:1,name:"engine_event_configuration",kind:"message",T:au},{no:2,name:"topics",kind:"scalar",T:9,repeated:!0}]));var rm=ko,Mo=class Mo extends Pe{constructor(n){super();g(this,"engineEventConfiguration");g(this,"channels",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new Mo().fromBinary(n,r)}static fromJson(n,r){return new Mo().fromJson(n,r)}static fromJsonString(n,r){return new Mo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Mo,n,r)}};g(Mo,"runtime",C),g(Mo,"typeName","wg.cosmo.node.v1.RedisEventConfiguration"),g(Mo,"fields",C.util.newFieldList(()=>[{no:1,name:"engine_event_configuration",kind:"message",T:au},{no:2,name:"channels",kind:"scalar",T:9,repeated:!0}]));var im=Mo,xo=class xo extends Pe{constructor(n){super();g(this,"providerId","");g(this,"type",iu.PUBLISH);g(this,"typeName","");g(this,"fieldName","");C.util.initPartial(n,this)}static fromBinary(n,r){return new xo().fromBinary(n,r)}static fromJson(n,r){return new xo().fromJson(n,r)}static fromJsonString(n,r){return new xo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(xo,n,r)}};g(xo,"runtime",C),g(xo,"typeName","wg.cosmo.node.v1.EngineEventConfiguration"),g(xo,"fields",C.util.newFieldList(()=>[{no:1,name:"provider_id",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:C.getEnumType(iu)},{no:3,name:"type_name",kind:"scalar",T:9},{no:4,name:"field_name",kind:"scalar",T:9}]));var au=xo,qo=class qo extends Pe{constructor(n){super();g(this,"nats",[]);g(this,"kafka",[]);g(this,"redis",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new qo().fromBinary(n,r)}static fromJson(n,r){return new qo().fromJson(n,r)}static fromJsonString(n,r){return new qo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(qo,n,r)}};g(qo,"runtime",C),g(qo,"typeName","wg.cosmo.node.v1.DataSourceCustomEvents"),g(qo,"fields",C.util.newFieldList(()=>[{no:1,name:"nats",kind:"message",T:nm,repeated:!0},{no:2,name:"kafka",kind:"message",T:rm,repeated:!0},{no:3,name:"redis",kind:"message",T:im,repeated:!0}]));var tl=qo,Vo=class Vo extends Pe{constructor(n){super();g(this,"data");C.util.initPartial(n,this)}static fromBinary(n,r){return new Vo().fromBinary(n,r)}static fromJson(n,r){return new Vo().fromJson(n,r)}static fromJsonString(n,r){return new Vo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Vo,n,r)}};g(Vo,"runtime",C),g(Vo,"typeName","wg.cosmo.node.v1.DataSourceCustom_Static"),g(Vo,"fields",C.util.newFieldList(()=>[{no:1,name:"data",kind:"message",T:Hr}]));var sA=Vo,jo=class jo extends Pe{constructor(n){super();g(this,"kind",Ku.STATIC_CONFIGURATION_VARIABLE);g(this,"staticVariableContent","");g(this,"environmentVariableName","");g(this,"environmentVariableDefaultValue","");g(this,"placeholderVariableName","");C.util.initPartial(n,this)}static fromBinary(n,r){return new jo().fromBinary(n,r)}static fromJson(n,r){return new jo().fromJson(n,r)}static fromJsonString(n,r){return new jo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(jo,n,r)}};g(jo,"runtime",C),g(jo,"typeName","wg.cosmo.node.v1.ConfigurationVariable"),g(jo,"fields",C.util.newFieldList(()=>[{no:1,name:"kind",kind:"enum",T:C.getEnumType(Ku)},{no:2,name:"static_variable_content",kind:"scalar",T:9},{no:3,name:"environment_variable_name",kind:"scalar",T:9},{no:4,name:"environment_variable_default_value",kind:"scalar",T:9},{no:5,name:"placeholder_variable_name",kind:"scalar",T:9}]));var Hr=jo,Ko=class Ko extends Pe{constructor(n){super();g(this,"directiveName","");g(this,"renameTo","");C.util.initPartial(n,this)}static fromBinary(n,r){return new Ko().fromBinary(n,r)}static fromJson(n,r){return new Ko().fromJson(n,r)}static fromJsonString(n,r){return new Ko().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Ko,n,r)}};g(Ko,"runtime",C),g(Ko,"typeName","wg.cosmo.node.v1.DirectiveConfiguration"),g(Ko,"fields",C.util.newFieldList(()=>[{no:1,name:"directive_name",kind:"scalar",T:9},{no:2,name:"rename_to",kind:"scalar",T:9}]));var oA=Ko,$o=class $o extends Pe{constructor(n){super();g(this,"name","");g(this,"value","");C.util.initPartial(n,this)}static fromBinary(n,r){return new $o().fromBinary(n,r)}static fromJson(n,r){return new $o().fromJson(n,r)}static fromJsonString(n,r){return new $o().fromJsonString(n,r)}static equals(n,r){return C.util.equals($o,n,r)}};g($o,"runtime",C),g($o,"typeName","wg.cosmo.node.v1.URLQueryConfiguration"),g($o,"fields",C.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:9}]));var uA=$o,Go=class Go extends Pe{constructor(n){super();g(this,"values",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new Go().fromBinary(n,r)}static fromJson(n,r){return new Go().fromJson(n,r)}static fromJsonString(n,r){return new Go().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Go,n,r)}};g(Go,"runtime",C),g(Go,"typeName","wg.cosmo.node.v1.HTTPHeader"),g(Go,"fields",C.util.newFieldList(()=>[{no:1,name:"values",kind:"message",T:Hr,repeated:!0}]));var cA=Go,Qo=class Qo extends Pe{constructor(n){super();g(this,"key");g(this,"cert");g(this,"insecureSkipVerify",!1);C.util.initPartial(n,this)}static fromBinary(n,r){return new Qo().fromBinary(n,r)}static fromJson(n,r){return new Qo().fromJson(n,r)}static fromJsonString(n,r){return new Qo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Qo,n,r)}};g(Qo,"runtime",C),g(Qo,"typeName","wg.cosmo.node.v1.MTLSConfiguration"),g(Qo,"fields",C.util.newFieldList(()=>[{no:1,name:"key",kind:"message",T:Hr},{no:2,name:"cert",kind:"message",T:Hr},{no:3,name:"insecureSkipVerify",kind:"scalar",T:8}]));var lA=Qo,Yo=class Yo extends Pe{constructor(n){super();g(this,"enabled",!1);g(this,"url");g(this,"useSSE");g(this,"protocol");g(this,"websocketSubprotocol");C.util.initPartial(n,this)}static fromBinary(n,r){return new Yo().fromBinary(n,r)}static fromJson(n,r){return new Yo().fromJson(n,r)}static fromJsonString(n,r){return new Yo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Yo,n,r)}};g(Yo,"runtime",C),g(Yo,"typeName","wg.cosmo.node.v1.GraphQLSubscriptionConfiguration"),g(Yo,"fields",C.util.newFieldList(()=>[{no:1,name:"enabled",kind:"scalar",T:8},{no:2,name:"url",kind:"message",T:Hr},{no:3,name:"useSSE",kind:"scalar",T:8,opt:!0},{no:4,name:"protocol",kind:"enum",T:C.getEnumType(Ks),opt:!0},{no:5,name:"websocketSubprotocol",kind:"enum",T:C.getEnumType($s),opt:!0}]));var dA=Yo,Jo=class Jo extends Pe{constructor(n){super();g(this,"enabled",!1);g(this,"serviceSdl","");C.util.initPartial(n,this)}static fromBinary(n,r){return new Jo().fromBinary(n,r)}static fromJson(n,r){return new Jo().fromJson(n,r)}static fromJsonString(n,r){return new Jo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Jo,n,r)}};g(Jo,"runtime",C),g(Jo,"typeName","wg.cosmo.node.v1.GraphQLFederationConfiguration"),g(Jo,"fields",C.util.newFieldList(()=>[{no:1,name:"enabled",kind:"scalar",T:8},{no:2,name:"serviceSdl",kind:"scalar",T:9}]));var fA=Jo,zo=class zo extends Pe{constructor(n){super();g(this,"key","");C.util.initPartial(n,this)}static fromBinary(n,r){return new zo().fromBinary(n,r)}static fromJson(n,r){return new zo().fromJson(n,r)}static fromJsonString(n,r){return new zo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(zo,n,r)}};g(zo,"runtime",C),g(zo,"typeName","wg.cosmo.node.v1.InternedString"),g(zo,"fields",C.util.newFieldList(()=>[{no:1,name:"key",kind:"scalar",T:9}]));var am=zo,Ho=class Ho extends Pe{constructor(n){super();g(this,"typeName","");g(this,"fieldName","");C.util.initPartial(n,this)}static fromBinary(n,r){return new Ho().fromBinary(n,r)}static fromJson(n,r){return new Ho().fromJson(n,r)}static fromJsonString(n,r){return new Ho().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Ho,n,r)}};g(Ho,"runtime",C),g(Ho,"typeName","wg.cosmo.node.v1.SingleTypeField"),g(Ho,"fields",C.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9}]));var pA=Ho,Wo=class Wo extends Pe{constructor(n){super();g(this,"fieldPath",[]);g(this,"json","");C.util.initPartial(n,this)}static fromBinary(n,r){return new Wo().fromBinary(n,r)}static fromJson(n,r){return new Wo().fromJson(n,r)}static fromJsonString(n,r){return new Wo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Wo,n,r)}};g(Wo,"runtime",C),g(Wo,"typeName","wg.cosmo.node.v1.SubscriptionFieldCondition"),g(Wo,"fields",C.util.newFieldList(()=>[{no:1,name:"field_path",kind:"scalar",T:9,repeated:!0},{no:2,name:"json",kind:"scalar",T:9}]));var sm=Wo,aa=class aa extends Pe{constructor(n){super();g(this,"and",[]);g(this,"in");g(this,"not");g(this,"or",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new aa().fromBinary(n,r)}static fromJson(n,r){return new aa().fromJson(n,r)}static fromJsonString(n,r){return new aa().fromJsonString(n,r)}static equals(n,r){return C.util.equals(aa,n,r)}};g(aa,"runtime",C),g(aa,"typeName","wg.cosmo.node.v1.SubscriptionFilterCondition"),g(aa,"fields",C.util.newFieldList(()=>[{no:1,name:"and",kind:"message",T:aa,repeated:!0},{no:2,name:"in",kind:"message",T:sm,opt:!0},{no:3,name:"not",kind:"message",T:aa,opt:!0},{no:4,name:"or",kind:"message",T:aa,repeated:!0}]));var $u=aa,Xo=class Xo extends Pe{constructor(n){super();g(this,"operations",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new Xo().fromBinary(n,r)}static fromJson(n,r){return new Xo().fromJson(n,r)}static fromJsonString(n,r){return new Xo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Xo,n,r)}};g(Xo,"runtime",C),g(Xo,"typeName","wg.cosmo.node.v1.CacheWarmerOperations"),g(Xo,"fields",C.util.newFieldList(()=>[{no:1,name:"operations",kind:"message",T:mA,repeated:!0}]));var pK=Xo,Zo=class Zo extends Pe{constructor(n){super();g(this,"request");g(this,"client");C.util.initPartial(n,this)}static fromBinary(n,r){return new Zo().fromBinary(n,r)}static fromJson(n,r){return new Zo().fromJson(n,r)}static fromJsonString(n,r){return new Zo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Zo,n,r)}};g(Zo,"runtime",C),g(Zo,"typeName","wg.cosmo.node.v1.Operation"),g(Zo,"fields",C.util.newFieldList(()=>[{no:1,name:"request",kind:"message",T:NA},{no:2,name:"client",kind:"message",T:hA}]));var mA=Zo,eu=class eu extends Pe{constructor(n){super();g(this,"operationName","");g(this,"query","");g(this,"extensions");C.util.initPartial(n,this)}static fromBinary(n,r){return new eu().fromBinary(n,r)}static fromJson(n,r){return new eu().fromJson(n,r)}static fromJsonString(n,r){return new eu().fromJsonString(n,r)}static equals(n,r){return C.util.equals(eu,n,r)}};g(eu,"runtime",C),g(eu,"typeName","wg.cosmo.node.v1.OperationRequest"),g(eu,"fields",C.util.newFieldList(()=>[{no:1,name:"operation_name",kind:"scalar",T:9},{no:2,name:"query",kind:"scalar",T:9},{no:3,name:"extensions",kind:"message",T:TA}]));var NA=eu,tu=class tu extends Pe{constructor(n){super();g(this,"persistedQuery");C.util.initPartial(n,this)}static fromBinary(n,r){return new tu().fromBinary(n,r)}static fromJson(n,r){return new tu().fromJson(n,r)}static fromJsonString(n,r){return new tu().fromJsonString(n,r)}static equals(n,r){return C.util.equals(tu,n,r)}};g(tu,"runtime",C),g(tu,"typeName","wg.cosmo.node.v1.Extension"),g(tu,"fields",C.util.newFieldList(()=>[{no:1,name:"persisted_query",kind:"message",T:EA}]));var TA=tu,nu=class nu extends Pe{constructor(n){super();g(this,"sha256Hash","");g(this,"version",0);C.util.initPartial(n,this)}static fromBinary(n,r){return new nu().fromBinary(n,r)}static fromJson(n,r){return new nu().fromJson(n,r)}static fromJsonString(n,r){return new nu().fromJsonString(n,r)}static equals(n,r){return C.util.equals(nu,n,r)}};g(nu,"runtime",C),g(nu,"typeName","wg.cosmo.node.v1.PersistedQuery"),g(nu,"fields",C.util.newFieldList(()=>[{no:1,name:"sha256_hash",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:5}]));var EA=nu,ru=class ru extends Pe{constructor(n){super();g(this,"name","");g(this,"version","");C.util.initPartial(n,this)}static fromBinary(n,r){return new ru().fromBinary(n,r)}static fromJson(n,r){return new ru().fromJson(n,r)}static fromJsonString(n,r){return new ru().fromJsonString(n,r)}static equals(n,r){return C.util.equals(ru,n,r)}};g(ru,"runtime",C),g(ru,"typeName","wg.cosmo.node.v1.ClientInfo"),g(ru,"fields",C.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:9}]));var hA=ru;m();T();N();function yA(e){return new Error(`Normalization failed to return a ${e}.`)}function mK(e){return new Error(`Invalid router compatibility version "${e}".`)}m();T();N();var Fd=hi(hh(),1);function nme(e){if(!e.conditions)return;let t=[];for(let n of e.conditions){let r=[];for(let i of n.fieldCoordinatesPath){let a=i.split(".");if(a.length!==2)throw new Error(`fatal: malformed conditional field coordinates "${i}" for field set "${e.selectionSet}".`);r.push(new Hp({fieldName:a[1],typeName:a[0]}))}t.push(new Wp({fieldCoordinatesPath:r,fieldPath:n.fieldPath}))}return t}function IA(e,t,n){if(e)for(let r of e){let i=nme(r);t.push(new Wc(M(M({typeName:n,fieldName:r.fieldName,selectionSet:r.selectionSet},r.disableEntityResolver?{disableEntityResolver:!0}:{}),i?{conditions:i}:{})))}}function gA(e){switch(e){case"publish":return iu.PUBLISH;case"request":return iu.REQUEST;case"subscribe":return iu.SUBSCRIBE}}function NK(e){var n;let t={rootNodes:[],childNodes:[],keys:[],provides:[],events:new tl({nats:[],kafka:[],redis:[]}),requires:[],entityInterfaces:[],interfaceObjects:[]};for(let r of e.values()){let i=r.typeName,a=[...r.fieldNames],o=new Ad({fieldNames:a,typeName:i});if(r.externalFieldNames&&r.externalFieldNames.size>0&&(o.externalFieldNames=[...r.externalFieldNames]),r.requireFetchReasonsFieldNames&&r.requireFetchReasonsFieldNames.length>0&&(o.requireFetchReasonsFieldNames=[...r.requireFetchReasonsFieldNames]),r.isRootNode?t.rootNodes.push(o):t.childNodes.push(o),r.entityInterfaceConcreteTypeNames){let p=new Rd({interfaceTypeName:i,concreteTypeNames:[...r.entityInterfaceConcreteTypeNames]});r.isInterfaceObject?t.interfaceObjects.push(p):t.entityInterfaces.push(p)}IA(r.keys,t.keys,i),IA(r.provides,t.provides,i),IA(r.requires,t.requires,i);let u=[],l=[],d=[];for(let p of(n=r.events)!=null?n:[])switch(p.providerType){case Fd.PROVIDER_TYPE_KAFKA:{l.push(new rm({engineEventConfiguration:new au({fieldName:p.fieldName,providerId:p.providerId,type:gA(p.type),typeName:i}),topics:p.topics}));break}case Fd.PROVIDER_TYPE_NATS:{u.push(new nm(M({engineEventConfiguration:new au({fieldName:p.fieldName,providerId:p.providerId,type:gA(p.type),typeName:i}),subjects:p.subjects},p.streamConfiguration?{streamConfiguration:new tm({consumerInactiveThreshold:p.streamConfiguration.consumerInactiveThreshold,consumerName:p.streamConfiguration.consumerName,streamName:p.streamConfiguration.streamName})}:{})));break}case Fd.PROVIDER_TYPE_REDIS:{d.push(new im({engineEventConfiguration:new au({fieldName:p.fieldName,providerId:p.providerId,type:gA(p.type),typeName:i}),channels:p.channels}));break}default:throw new Error("Fatal: Unknown event provider.")}t.events.nats.push(...u),t.events.kafka.push(...l),t.events.redis.push(...d)}return t}function TK(e){var n,r;let t=[];for(let i of e){let a=i.argumentNames.map(p=>new Yp({name:p,sourceType:Xc.FIELD_ARGUMENT})),o=new zp({argumentsConfiguration:a,fieldName:i.fieldName,typeName:i.typeName}),u=((n=i.requiredScopes)==null?void 0:n.map(p=>new el({requiredAndScopes:p})))||[],l=((r=i.requiredScopesByOR)==null?void 0:r.map(p=>new el({requiredAndScopes:p})))||[],d=u.length>0;if((i.requiresAuthentication||d)&&(o.authorizationConfiguration=new Jp({requiresAuthentication:i.requiresAuthentication||d,requiredOrScopes:u,requiredOrScopesByOr:l})),i.subscriptionFilterCondition){let p=new $u;qh(p,i.subscriptionFilterCondition),o.subscriptionFilterCondition=p}t.push(o)}return t}function qh(e,t){if(t.and!==void 0){let n=[];for(let r of t.and){let i=new $u;qh(i,r),n.push(i)}e.and=n;return}if(t.in!==void 0){e.in=new sm({fieldPath:t.in.fieldPath,json:JSON.stringify(t.in.values)});return}if(t.not!==void 0){e.not=new $u,qh(e.not,t.not);return}if(t.or!==void 0){let n=[];for(let r of t.or){let i=new $u;qh(i,r),n.push(i)}e.or=n;return}throw new Error("Fatal: Incoming SubscriptionCondition object was malformed.")}function rme(e){if(e&&!(e.fieldWeights.size===0&&e.listSizes.size===0&&e.typeWeights.size===0&&e.directiveArgumentWeights.size===0))return new $p({fieldWeights:[...e.fieldWeights.values()].map(t=>new Gp($(M({},t),{argumentWeights:Object.fromEntries(t.argumentWeights)}))),listSizes:[...e.listSizes.values()].map(t=>new Qp(t)),typeWeights:Object.fromEntries(e.typeWeights),directiveArgumentWeights:Object.fromEntries(e.directiveArgumentWeights)})}var nl;(function(e){e[e.Plugin=0]="Plugin",e[e.Standard=1]="Standard",e[e.GRPC=2]="GRPC"})(nl||(nl={}));var ime=(e,t)=>{let n=stringHash(t);return e.stringStorage[n]=t,new am({key:n})},ame=e=>{switch(e){case"ws":return Ks.GRAPHQL_SUBSCRIPTION_PROTOCOL_WS;case"sse":return Ks.GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE;case"sse_post":return Ks.GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE_POST}},sme=e=>{switch(e){case"auto":return $s.GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO;case"graphql-ws":return $s.GRAPHQL_WEBSOCKET_SUBPROTOCOL_WS;case"graphql-transport-ws":return $s.GRAPHQL_WEBSOCKET_SUBPROTOCOL_TRANSPORT_WS}},hK=function(e){if(!wd.ROUTER_COMPATIBILITY_VERSIONS.has(e.routerCompatibilityVersion))throw mK(e.routerCompatibilityVersion);let t=new bd({defaultFlushInterval:BigInt(500),datasourceConfigurations:[],fieldConfigurations:[],graphqlSchema:"",stringStorage:{},typeConfigurations:[]});for(let n of e.subgraphs){if(!n.configurationDataByTypeName)throw yA("ConfigurationDataByTypeName");if(!n.schema)throw yA("GraphQLSchema");let r={enabled:!0},i=ime(t,Sj((0,EK.lexicographicSortSchema)(n.schema))),{childNodes:a,entityInterfaces:o,events:u,interfaceObjects:l,keys:d,provides:p,requires:E,rootNodes:h}=NK(n.configurationDataByTypeName),v;switch(n.kind){case nl.Standard:{r.enabled=!0,r.protocol=ame(n.subscriptionProtocol||"ws"),r.websocketSubprotocol=sme(n.websocketSubprotocol||"auto"),r.url=new Hr({kind:Ku.STATIC_CONFIGURATION_VARIABLE,staticVariableContent:n.subscriptionUrl||n.url});break}case nl.Plugin:{v=new Pd({mapping:n.mapping,protoSchema:n.protoSchema,plugin:new Zp({name:n.name,version:n.version,imageReference:n.imageReference})});break}case nl.GRPC:{v=new Pd({mapping:n.mapping,protoSchema:n.protoSchema});break}}let A,B,V;if(u.kafka.length>0||u.nats.length>0||u.redis.length>0){A=ju.PUBSUB,V=new tl({kafka:u.kafka,nats:u.nats,redis:u.redis});let re=Ee=>wd.ROOT_TYPE_NAMES.has(Ee.typeName),ie=0,Ne=0;for(;ie({id:n.id,name:n.name,routingUrl:n.url})),compatibilityVersion:`${e.routerCompatibilityVersion}:${wd.COMPOSITION_VERSION}`})};m();T();N();var il=hi(Se());function yK(e){let t;try{t=(0,il.parse)(e.schema)}catch(n){throw new Error(`could not parse schema for Graph ${e.name}: ${n}`)}return{definitions:t,name:e.name,url:e.url}}function ome(e){let t=(0,rl.federateSubgraphs)({subgraphs:e.map(yK),version:rl.LATEST_ROUTER_COMPATIBILITY_VERSION});if(!t.success)throw new Error(`could not federate schema: ${t.errors.map(n=>n.message).join(", ")}`);return{fieldConfigurations:t.fieldConfigurations,sdl:(0,il.print)(t.federatedGraphAST)}}function ume(e){let t=(0,rl.federateSubgraphs)({subgraphs:e.map(yK),version:rl.LATEST_ROUTER_COMPATIBILITY_VERSION});if(!t.success)throw new Error(`could not federate schema: ${t.errors.map(r=>r.message).join(", ")}`);return hK({federatedClientSDL:(0,il.printSchema)(t.federatedGraphClientSchema),federatedSDL:(0,il.printSchema)(t.federatedGraphSchema),fieldConfigurations:t.fieldConfigurations,routerCompatibilityVersion:rl.LATEST_ROUTER_COMPATIBILITY_VERSION,schemaVersionId:"",subgraphs:e.map((r,i)=>{var l,d;let a=t.subgraphConfigBySubgraphName.get(r.name),o=a==null?void 0:a.schema,u=a==null?void 0:a.configurationDataByTypeName;return{kind:nl.Standard,id:`${i}`,name:r.name,url:Db(r.url),sdl:r.schema,subscriptionUrl:Db((l=r.subscription_url)!=null?l:r.url),subscriptionProtocol:(d=r.subscription_protocol)!=null?d:"ws",websocketSubprotocol:r.subscription_protocol==="ws"?r.websocketSubprotocol||"auto":void 0,schema:o,configurationDataByTypeName:u}})}).toJsonString()}return Wm(cme);})(); +`)+Ie+`return __p +}`;var St=dP(function(){return Xt(C,Ge+"return "+Ie).apply(e,V)});if(St.source=Ie,nI(St))throw St;return St}function hH(s){return nn(s).toLowerCase()}function yH(s){return nn(s).toUpperCase()}function IH(s,c,f){if(s=nn(s),s&&(f||c===e))return I0(s);if(!s||!(c=Ei(c)))return s;var I=ua(s),O=ua(c),C=g0(I,O),V=_0(I,O)+1;return gu(I,C,V).join("")}function gH(s,c,f){if(s=nn(s),s&&(f||c===e))return s.slice(0,S0(s)+1);if(!s||!(c=Ei(c)))return s;var I=ua(s),O=_0(I,ua(c))+1;return gu(I,0,O).join("")}function _H(s,c,f){if(s=nn(s),s&&(f||c===e))return s.replace(ny,"");if(!s||!(c=Ei(c)))return s;var I=ua(s),O=g0(I,ua(c));return gu(I,O).join("")}function vH(s,c){var f=ge,I=H;if(wn(c)){var O="separator"in c?c.separator:O;f="length"in c?_t(c.length):f,I="omission"in c?Ei(c.omission):I}s=nn(s);var C=s.length;if(El(s)){var V=ua(s);C=V.length}if(f>=C)return s;var Y=f-hl(I);if(Y<1)return I;var te=V?gu(V,0,Y).join(""):s.slice(0,Y);if(O===e)return te+I;if(V&&(Y+=te.length-Y),rI(O)){if(s.slice(Y).search(O)){var Ne,Te=te;for(O.global||(O=yy(O.source,nn(KA.exec(O))+"g")),O.lastIndex=0;Ne=O.exec(Te);)var Ie=Ne.index;te=te.slice(0,Ie===e?Y:Ie)}}else if(s.indexOf(Ei(O),Y)!=Y){var we=te.lastIndexOf(O);we>-1&&(te=te.slice(0,we))}return te+I}function SH(s){return s=nn(s),s&&Uj.test(s)?s.replace(xA,Z$):s}var OH=Sl(function(s,c,f){return s+(f?" ":"")+c.toUpperCase()}),sI=pR("toUpperCase");function lP(s,c,f){return s=nn(s),c=f?e:c,c===e?J$(s)?nG(s):x$(s):s.match(c)||[]}var dP=Ot(function(s,c){try{return Ni(s,e,c)}catch(f){return nI(f)?f:new Tt(f)}}),DH=Is(function(s,c){return Ri(c,function(f){f=Va(f),hs(s,f,eI(s[f],s))}),s});function bH(s){var c=s==null?0:s.length,f=nt();return s=c?An(s,function(I){if(typeof I[1]!="function")throw new Pi(i);return[f(I[0]),I[1]]}):[],Ot(function(I){for(var O=-1;++OYt)return[];var f=yn,I=Fr(s,yn);c=nt(c),s-=yn;for(var O=Ty(I,c);++f0||c<0)?new wt(f):(s<0?f=f.takeRight(-s):s&&(f=f.drop(s)),c!==e&&(c=_t(c),f=c<0?f.dropRight(-c):f.take(c-s)),f)},wt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},wt.prototype.toArray=function(){return this.take(yn)},xa(wt.prototype,function(s,c){var f=/^(?:filter|find|map|reject)|While$/.test(c),I=/^(?:head|last)$/.test(c),O=L[I?"take"+(c=="last"?"Right":""):c],C=I||/^find/.test(c);O&&(L.prototype[c]=function(){var V=this.__wrapped__,Y=I?[1]:arguments,te=V instanceof wt,Ne=Y[0],Te=te||ht(V),Ie=function(Ft){var kt=O.apply(L,mu([Ft],Y));return I&&we?kt[0]:kt};Te&&f&&typeof Ne=="function"&&Ne.length!=1&&(te=Te=!1);var we=this.__chain__,Ge=!!this.__actions__.length,rt=C&&!we,St=te&&!Ge;if(!C&&Te){V=St?V:new wt(this);var it=s.apply(V,Y);return it.__actions__.push({func:tN,args:[Ie],thisArg:e}),new Fi(it,we)}return rt&&St?s.apply(this,Y):(it=this.thru(Ie),rt?I?it.value()[0]:it.value():it)})}),Ri(["pop","push","shift","sort","splice","unshift"],function(s){var c=bm[s],f=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",I=/^(?:pop|shift)$/.test(s);L.prototype[s]=function(){var O=arguments;if(I&&!this.__chain__){var C=this.value();return c.apply(ht(C)?C:[],O)}return this[f](function(V){return c.apply(ht(V)?V:[],O)})}}),xa(wt.prototype,function(s,c){var f=L[c];if(f){var I=f.name+"";un.call(gl,I)||(gl[I]=[]),gl[I].push({name:c,func:f})}}),gl[Jm(e,k).name]=[{name:"wrapper",func:e}],wt.prototype.clone=SG,wt.prototype.reverse=OG,wt.prototype.value=DG,L.prototype.at=t2,L.prototype.chain=n2,L.prototype.commit=r2,L.prototype.next=i2,L.prototype.plant=s2,L.prototype.reverse=o2,L.prototype.toJSON=L.prototype.valueOf=L.prototype.value=u2,L.prototype.first=L.prototype.head,Kd&&(L.prototype[Kd]=a2),L},Tu=rG();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Tr._=Tu,define(function(){return Tu})):tc?((tc.exports=Tu)._=Tu,uy._=Tu):Tr._=Tu}).call(Ad)});var zK=F(il=>{"use strict";m();T();N();Object.defineProperty(il,"__esModule",{value:!0});il.FederationFactory=void 0;il.federateSubgraphs=Zfe;il.federateSubgraphsWithContracts=eme;il.federateSubgraphsContract=tme;var Ce=Oe(),QK=Uu(),Xr=kr(),Ue=Ji(),nl=xT(),rl=gd(),Zr=Pf(),Dh=BE(),Mf=ku(),Hfe=Cb(),zfe=Ff(),YK=tf(),De=ed(),Wfe=kb(),JK=GK(),Rd=Oh(),Ae=Zn(),bh=Wl(),ye=Mr(),Xfe=Lf(),Yu=nf(),Rh,HK,Ah=class{constructor({authorizationDataByParentTypeName:t,concreteTypeNamesByAbstractTypeName:n,entityDataByTypeName:r,entityInterfaceFederationDataByTypeName:i,fieldCoordsByNamedTypeName:a,interfaceImplementationTypeNamesByInterfaceTypeName:o,internalGraph:u,internalSubgraphBySubgraphName:l,options:d,warnings:p}){dc(this,Rh);y(this,"authorizationDataByParentTypeName");y(this,"coordsByNamedTypeName",new Map);y(this,"directiveDefinitionByName",new Map);y(this,"clientDefinitions",[]);y(this,"currentSubgraphName","");y(this,"concreteTypeNamesByAbstractTypeName");y(this,"subgraphNamesByNamedTypeNameByFieldCoords",new Map);y(this,"entityDataByTypeName");y(this,"entityInterfaceFederationDataByTypeName");y(this,"errors",[]);y(this,"fieldConfigurationByFieldCoords",new Map);y(this,"fieldCoordsByNamedTypeName");y(this,"inaccessibleCoords",new Set);y(this,"inaccessibleRequiredInputValueErrorByCoords",new Map);y(this,"interfaceImplementationTypeNamesByInterfaceTypeName");y(this,"internalGraph");y(this,"internalSubgraphBySubgraphName");y(this,"invalidORScopesCoords",new Set);y(this,"isMaxDepth",!1);y(this,"isVersionTwo",!1);y(this,"namedInputValueTypeNames",new Set);y(this,"namedOutputTypeNames",new Set);y(this,"options");y(this,"parentDefinitionDataByTypeName",new Map);y(this,"parentTagDataByTypeName",new Map);y(this,"persistedDirectiveDefinitionByDirectiveName",new Map([[Ae.AUTHENTICATED,Yu.AUTHENTICATED_DEFINITION],[Ae.DEPRECATED,Yu.DEPRECATED_DEFINITION],[Ae.INACCESSIBLE,Yu.INACCESSIBLE_DEFINITION],[Ae.ONE_OF,Yu.ONE_OF_DEFINITION],[Ae.REQUIRES_SCOPES,Yu.REQUIRES_SCOPES_DEFINITION],[Ae.SEMANTIC_NON_NULL,Yu.SEMANTIC_NON_NULL_DEFINITION],[Ae.TAG,Yu.TAG_DEFINITION]]));y(this,"potentialPersistedDirectiveDefinitionDataByDirectiveName",new Map);y(this,"referencedPersistedDirectiveNames",new Set);y(this,"routerDefinitions",[]);y(this,"subscriptionFilterDataByFieldPath",new Map);y(this,"tagNamesByCoords",new Map);y(this,"warnings");this.authorizationDataByParentTypeName=t,this.options=d!=null?d:{},this.concreteTypeNamesByAbstractTypeName=n,this.entityDataByTypeName=r,this.entityInterfaceFederationDataByTypeName=i,this.fieldCoordsByNamedTypeName=a,this.interfaceImplementationTypeNamesByInterfaceTypeName=o,this.internalGraph=u,this.internalSubgraphBySubgraphName=l,this.warnings=p}extractPersistedDirectives({data:t,directivesByName:n}){for(let[r,i]of n)if(this.persistedDirectiveDefinitionByDirectiveName.get(r)&&(this.referencedPersistedDirectiveNames.add(r),!(Ae.AUTHORIZATION_DIRECTIVES.has(r)||i.length<1)))switch(r){case Ae.DEPRECATED:{t.isDeprecated=!0,(0,De.upsertDeprecatedDirective)(t,i[0]);break}case Ae.TAG:{(0,De.upsertTagDirectives)(t,i);break}default:{let o=t.directivesByName.get(r);if(!o){t.directivesByName.set(r,[...i]);break}if(Ae.NON_REPEATABLE_PERSISTED_DIRECTIVES.has(r))break;o.push(...i)}}return t}getValidImplementedInterfaces(t){var o;let n=[];if(t.implementedInterfaceTypeNames.size<1)return n;let r=(0,De.isNodeDataInaccessible)(t),i=new Map,a=new Map;for(let u of t.implementedInterfaceTypeNames){n.push((0,Xr.stringToNamedTypeNode)(u));let l=(0,ye.getOrThrowError)(this.parentDefinitionDataByTypeName,u,Ae.PARENT_DEFINITION_DATA);if(l.kind!==Ce.Kind.INTERFACE_TYPE_DEFINITION){a.set(l.name,(0,ye.kindToNodeType)(l.kind));continue}let d={invalidFieldImplementations:new Map,unimplementedFields:[]},p=!1;for(let[E,h]of l.fieldDataByName){let _=!1,S=t.fieldDataByName.get(E);if(!S){p=!0,d.unimplementedFields.push(E);continue}let k={invalidAdditionalArguments:new Set,invalidImplementedArguments:[],isInaccessible:!1,originalResponseType:(0,Dh.printTypeNode)(h.node.type),unimplementedArguments:new Set};(0,De.isTypeValidImplementation)({concreteTypeNamesByAbstractTypeName:this.concreteTypeNamesByAbstractTypeName,implementationType:S.node.type,interfaceImplementationTypeNamesByInterfaceTypeName:this.interfaceImplementationTypeNamesByInterfaceTypeName,originalType:h.node.type})||(p=!0,_=!0,k.implementedResponseType=(0,Dh.printTypeNode)(S.node.type));let B=new Set;for(let[K,ne]of h.argumentDataByName){let ee=ne.node;B.add(K);let oe=(o=S.argumentDataByName.get(K))==null?void 0:o.node;if(!oe){p=!0,_=!0,k.unimplementedArguments.add(K);continue}let de=(0,Dh.printTypeNode)(oe.type),me=(0,Dh.printTypeNode)(ee.type);me!==de&&(p=!0,_=!0,k.invalidImplementedArguments.push({actualType:de,argumentName:K,expectedType:me}))}for(let[K,ne]of S.argumentDataByName){let ee=ne.node;B.has(K)||ee.type.kind===Ce.Kind.NON_NULL_TYPE&&(p=!0,_=!0,k.invalidAdditionalArguments.add(K))}!r&&S.isInaccessible&&!h.isInaccessible&&(p=!0,_=!0,k.isInaccessible=!0),_&&d.invalidFieldImplementations.set(E,k)}p&&i.set(u,d)}return a.size>0&&this.errors.push((0,Ue.invalidImplementedTypeError)(t.name,a)),i.size>0&&this.errors.push((0,Ue.invalidInterfaceImplementationError)(t.node.name.value,(0,ye.kindToNodeType)(t.kind),i)),n}addValidPrimaryKeyTargetsToEntityData(t){var p;let n=this.entityDataByTypeName.get(t);if(!n)return;let r=(0,ye.getOrThrowError)(this.internalSubgraphBySubgraphName,this.currentSubgraphName,"internalSubgraphBySubgraphName"),i=r.parentDefinitionDataByTypeName,a=i.get(n.typeName);if(!a||a.kind!==Ce.Kind.OBJECT_TYPE_DEFINITION)throw(0,Ue.incompatibleParentKindFatalError)(n.typeName,Ce.Kind.OBJECT_TYPE_DEFINITION,(a==null?void 0:a.kind)||Ce.Kind.NULL);let o=r.configurationDataByTypeName.get(n.typeName);if(!o)return;let u=[],l=this.internalGraph.nodeByNodeName.get(`${this.currentSubgraphName}.${n.typeName}`);(0,nl.validateImplicitFieldSets)({conditionalFieldDataByCoords:r.conditionalFieldDataByCoordinates,currentSubgraphName:this.currentSubgraphName,entityData:n,implicitKeys:u,objectData:a,parentDefinitionDataByTypeName:i,graphNode:l});for(let[E,h]of this.entityInterfaceFederationDataByTypeName){if(!((p=h.concreteTypeNames)!=null&&p.has(n.typeName)))continue;let _=this.entityDataByTypeName.get(E);_&&(0,nl.validateImplicitFieldSets)({conditionalFieldDataByCoords:r.conditionalFieldDataByCoordinates,currentSubgraphName:this.currentSubgraphName,entityData:_,implicitKeys:u,objectData:a,parentDefinitionDataByTypeName:i,graphNode:l})}if(u.length<1)return;if(!o.keys||o.keys.length<1){o.isRootNode=!0,o.keys=u;return}let d=new Set(o.keys.map(E=>E.selectionSet));for(let E of u)d.has(E.selectionSet)||(o.keys.push(E),d.add(E.selectionSet))}addValidPrimaryKeyTargetsFromInterfaceObject(t,n,r,i){let a=t.parentDefinitionDataByTypeName,o=a.get(n);if(!o||!(0,De.isParentDataCompositeOutputType)(o))throw(0,Ue.incompatibleParentKindFatalError)(n,Ce.Kind.INTERFACE_TYPE_DEFINITION,(o==null?void 0:o.kind)||Ce.Kind.NULL);let u=(0,ye.getOrThrowError)(t.configurationDataByTypeName,r.typeName,"internalSubgraph.configurationDataByTypeName"),l=[];if((0,nl.validateImplicitFieldSets)({conditionalFieldDataByCoords:t.conditionalFieldDataByCoordinates,currentSubgraphName:t.name,entityData:r,implicitKeys:l,objectData:o,parentDefinitionDataByTypeName:a,graphNode:i}),l.length<1)return;if(!u.keys||u.keys.length<1){u.isRootNode=!0,u.keys=l;return}let d=new Set(u.keys.map(p=>p.selectionSet));for(let p of l)d.has(p.selectionSet)||(u.keys.push(p),d.add(p.selectionSet))}getEnumValueMergeMethod(t){return this.namedInputValueTypeNames.has(t)?this.namedOutputTypeNames.has(t)?De.MergeMethod.CONSISTENT:De.MergeMethod.INTERSECTION:De.MergeMethod.UNION}generateTagData(){for(let[t,n]of this.tagNamesByCoords){let r=t.split(Ae.LITERAL_PERIOD);if(r.length<1)continue;let i=(0,ye.getValueOrDefault)(this.parentTagDataByTypeName,r[0],()=>(0,nl.newParentTagData)(r[0]));switch(r.length){case 1:for(let l of n)i.tagNames.add(l);break;case 2:let a=(0,ye.getValueOrDefault)(i.childTagDataByChildName,r[1],()=>(0,nl.newChildTagData)(r[1]));for(let l of n)a.tagNames.add(l);break;case 3:let o=(0,ye.getValueOrDefault)(i.childTagDataByChildName,r[1],()=>(0,nl.newChildTagData)(r[1])),u=(0,ye.getValueOrDefault)(o.tagNamesByArgumentName,r[2],()=>new Set);for(let l of n)u.add(l);break;default:break}}}upsertEnumValueData(t,n,r){let i=t.get(n.name),a=i||this.copyEnumValueData(n);this.extractPersistedDirectives({data:a.persistedDirectivesData,directivesByName:n.directivesByName});let o=(0,De.isNodeDataInaccessible)(n);if((r||o)&&this.inaccessibleCoords.add(a.federatedCoords),this.recordTagNamesByCoords(a,a.federatedCoords),!i){t.set(a.name,a);return}a.appearances+=1,(0,ye.addNewObjectValueMapEntries)(n.configureDescriptionDataBySubgraphName,a.configureDescriptionDataBySubgraphName),(0,De.setLongestDescription)(a,n),(0,ye.addIterableToSet)({source:n.subgraphNames,target:a.subgraphNames})}upsertInputValueData(t,n,r,i){let a=t.get(n.name),o=a||this.copyInputValueData(n);if(this.extractPersistedDirectives({data:o.persistedDirectivesData,directivesByName:n.directivesByName}),this.recordTagNamesByCoords(o,`${r}.${o.name}`),this.namedInputValueTypeNames.add(o.namedTypeName),(0,ye.getValueOrDefault)(this.coordsByNamedTypeName,o.namedTypeName,()=>new Set).add(o.federatedCoords),!a){t.set(o.name,o);return}(0,ye.addNewObjectValueMapEntries)(n.configureDescriptionDataBySubgraphName,o.configureDescriptionDataBySubgraphName),(0,De.setLongestDescription)(o,n),(0,ye.addIterableToSet)({source:n.requiredSubgraphNames,target:o.requiredSubgraphNames}),(0,ye.addIterableToSet)({source:n.subgraphNames,target:o.subgraphNames}),this.handleInputValueInaccessibility(i,o,r);let u=(0,Rd.getMostRestrictiveMergedTypeNode)(o.type,n.type,o.originalCoords,this.errors);u.success?o.type=u.typeNode:this.errors.push((0,Ue.incompatibleMergedTypesError)({actualType:u.actualType,isArgument:a.isArgument,coords:a.federatedCoords,expectedType:u.expectedType})),(0,De.compareAndValidateInputValueDefaultValues)(o,n,this.errors)}handleInputValueInaccessibility(t,n,r){if(t){this.inaccessibleRequiredInputValueErrorByCoords.delete(n.federatedCoords),this.inaccessibleCoords.add(n.federatedCoords);return}if((0,De.isNodeDataInaccessible)(n)){if((0,De.isTypeRequired)(n.type)){this.inaccessibleRequiredInputValueErrorByCoords.set(n.federatedCoords,(0,Ue.inaccessibleRequiredInputValueError)(n,r));return}this.inaccessibleCoords.add(n.federatedCoords)}}handleSubscriptionFilterDirective(t,n){let r=t.directivesByName.get(Ae.SUBSCRIPTION_FILTER);if(!r)return;let i=(0,ye.getFirstEntry)(t.subgraphNames);if(i===void 0){this.errors.push((0,Ue.unknownFieldSubgraphNameError)(t.federatedCoords));return}this.subscriptionFilterDataByFieldPath.set(t.federatedCoords,{directive:r[0],fieldData:n||t,directiveSubgraphName:i})}federateOutputType({current:t,other:n,coords:r,mostRestrictive:i}){n=(0,QK.getMutableTypeNode)(n,r,this.errors);let a={kind:t.kind},o=Rd.DivergentType.NONE,u=a;for(let l=0;lnew Set)})}upsertFieldData(t,n,r){let i=t.get(n.name),a=i||this.copyFieldData(n,r||(0,De.isNodeDataInaccessible)(n));(0,ye.getValueOrDefault)(this.coordsByNamedTypeName,n.namedTypeName,()=>new Set).add(a.federatedCoords),this.namedOutputTypeNames.add(n.namedTypeName),this.handleSubscriptionFilterDirective(n,a),this.extractPersistedDirectives({data:a.persistedDirectivesData,directivesByName:n.directivesByName});let o=r||(0,De.isNodeDataInaccessible)(a);if(o&&this.inaccessibleCoords.add(a.federatedCoords),this.recordTagNamesByCoords(a,a.federatedCoords),!i){t.set(a.name,a);return}let u=this.federateOutputType({current:a.type,other:n.type,coords:a.federatedCoords,mostRestrictive:!1});if(u.success)if(a.type=u.typeNode,a.namedTypeName!==n.namedTypeName){let l=(0,ye.getValueOrDefault)(this.subgraphNamesByNamedTypeNameByFieldCoords,a.federatedCoords,()=>new Map),d=(0,ye.getValueOrDefault)(l,a.namedTypeName,()=>new Set);if(d.size<1)for(let p of a.subgraphNames)n.subgraphNames.has(p)||d.add(p);(0,ye.addIterableToSet)({source:n.subgraphNames,target:(0,ye.getValueOrDefault)(l,n.namedTypeName,()=>new Set)})}else this.addSubgraphNameToExistingFieldNamedTypeDisparity(n);for(let l of n.argumentDataByName.values())this.upsertInputValueData(a.argumentDataByName,l,a.federatedCoords,o);(0,ye.addNewObjectValueMapEntries)(n.configureDescriptionDataBySubgraphName,i.configureDescriptionDataBySubgraphName),(0,De.setLongestDescription)(a,n),a.isInaccessible||(a.isInaccessible=n.isInaccessible),(0,ye.addNewObjectValueMapEntries)(n.externalFieldDataBySubgraphName,a.externalFieldDataBySubgraphName),(0,ye.addMapEntries)({source:n.isShareableBySubgraphName,target:a.isShareableBySubgraphName}),(0,ye.addMapEntries)({source:n.nullLevelsBySubgraphName,target:a.nullLevelsBySubgraphName}),(0,ye.addIterableToSet)({source:n.subgraphNames,target:a.subgraphNames})}getClientSchemaUnionMembers(t){let n=[];for(let[r,i]of t.memberByMemberTypeName)this.inaccessibleCoords.has(r)||n.push(i);return n}recordTagNamesByCoords(t,n){let r=n||t.name;if(t.persistedDirectivesData.tagDirectiveByName.size<1)return;let i=(0,ye.getValueOrDefault)(this.tagNamesByCoords,r,()=>new Set);for(let a of t.persistedDirectivesData.tagDirectiveByName.keys())i.add(a)}copyMutualParentDefinitionData(t){return{configureDescriptionDataBySubgraphName:(0,ye.copyObjectValueMap)(t.configureDescriptionDataBySubgraphName),directivesByName:(0,ye.copyArrayValueMap)(t.directivesByName),extensionType:t.extensionType,name:t.name,persistedDirectivesData:this.extractPersistedDirectives({data:(0,De.newPersistedDirectivesData)(),directivesByName:t.directivesByName}),description:(0,De.getInitialFederatedDescription)(t)}}copyEnumValueData(t){return{appearances:t.appearances,configureDescriptionDataBySubgraphName:(0,ye.copyObjectValueMap)(t.configureDescriptionDataBySubgraphName),federatedCoords:t.federatedCoords,directivesByName:(0,ye.copyArrayValueMap)(t.directivesByName),kind:t.kind,name:t.name,node:{directives:[],kind:t.kind,name:(0,Xr.stringToNameNode)(t.name)},parentTypeName:t.parentTypeName,persistedDirectivesData:this.extractPersistedDirectives({data:(0,De.newPersistedDirectivesData)(),directivesByName:t.directivesByName}),subgraphNames:new Set(t.subgraphNames),description:(0,De.getInitialFederatedDescription)(t)}}copyInputValueData(t){return{configureDescriptionDataBySubgraphName:(0,ye.copyObjectValueMap)(t.configureDescriptionDataBySubgraphName),directivesByName:(0,ye.copyArrayValueMap)(t.directivesByName),federatedCoords:t.federatedCoords,fieldName:t.fieldName,includeDefaultValue:t.includeDefaultValue,isArgument:t.isArgument,kind:t.kind,name:t.name,namedTypeKind:t.namedTypeKind,namedTypeName:t.namedTypeName,node:{directives:[],kind:Ce.Kind.INPUT_VALUE_DEFINITION,name:(0,Xr.stringToNameNode)(t.name),type:t.type},originalCoords:t.originalCoords,originalParentTypeName:t.originalParentTypeName,persistedDirectivesData:this.extractPersistedDirectives({data:(0,De.newPersistedDirectivesData)(),directivesByName:t.directivesByName}),renamedParentTypeName:t.renamedParentTypeName,requiredSubgraphNames:new Set(t.requiredSubgraphNames),subgraphNames:new Set(t.subgraphNames),type:t.type,defaultValue:t.defaultValue,description:(0,De.getInitialFederatedDescription)(t)}}copyInputValueDataByValueName(t,n,r){let i=new Map;for(let[a,o]of t){let u=this.copyInputValueData(o);this.handleInputValueInaccessibility(n,u,r),(0,ye.getValueOrDefault)(this.coordsByNamedTypeName,u.namedTypeName,()=>new Set).add(u.federatedCoords),this.namedInputValueTypeNames.add(u.namedTypeName),this.recordTagNamesByCoords(u,`${r}.${o.name}`),i.set(a,u)}return i}copyFieldData(t,n){return{argumentDataByName:this.copyInputValueDataByValueName(t.argumentDataByName,n,t.federatedCoords),configureDescriptionDataBySubgraphName:(0,ye.copyObjectValueMap)(t.configureDescriptionDataBySubgraphName),directivesByName:(0,ye.copyArrayValueMap)(t.directivesByName),externalFieldDataBySubgraphName:(0,ye.copyObjectValueMap)(t.externalFieldDataBySubgraphName),federatedCoords:t.federatedCoords,inheritedDirectiveNames:new Set,isInaccessible:t.isInaccessible,isShareableBySubgraphName:new Map(t.isShareableBySubgraphName),kind:t.kind,name:t.name,namedTypeKind:t.namedTypeKind,namedTypeName:t.namedTypeName,node:{arguments:[],directives:[],kind:t.kind,name:(0,Xr.stringToNameNode)(t.name),type:t.type},nullLevelsBySubgraphName:t.nullLevelsBySubgraphName,originalParentTypeName:t.originalParentTypeName,persistedDirectivesData:this.extractPersistedDirectives({data:(0,De.newPersistedDirectivesData)(),directivesByName:t.directivesByName}),renamedParentTypeName:t.renamedParentTypeName,subgraphNames:new Set(t.subgraphNames),type:t.type,description:(0,De.getInitialFederatedDescription)(t)}}copyEnumValueDataByName(t,n){let r=new Map;for(let[i,a]of t){let o=this.copyEnumValueData(a);this.recordTagNamesByCoords(o,o.federatedCoords),(n||(0,De.isNodeDataInaccessible)(o))&&this.inaccessibleCoords.add(o.federatedCoords),r.set(i,o)}return r}copyFieldDataByName(t,n){let r=new Map;for(let[i,a]of t){let o=n||(0,De.isNodeDataInaccessible)(a),u=this.copyFieldData(a,o);this.handleSubscriptionFilterDirective(u),(0,ye.getValueOrDefault)(this.coordsByNamedTypeName,u.namedTypeName,()=>new Set).add(u.federatedCoords),this.namedOutputTypeNames.add(u.namedTypeName),this.recordTagNamesByCoords(u,u.federatedCoords),o&&this.inaccessibleCoords.add(u.federatedCoords),r.set(i,u)}return r}copyParentDefinitionData(t){let n=this.copyMutualParentDefinitionData(t);switch(t.kind){case Ce.Kind.ENUM_TYPE_DEFINITION:return W(q({},n),{appearances:t.appearances,enumValueDataByName:this.copyEnumValueDataByName(t.enumValueDataByName,t.isInaccessible),isInaccessible:t.isInaccessible,kind:t.kind,node:{kind:t.kind,name:(0,Xr.stringToNameNode)(t.name)},subgraphNames:new Set(t.subgraphNames)});case Ce.Kind.INPUT_OBJECT_TYPE_DEFINITION:return W(q({},n),{inputValueDataByName:this.copyInputValueDataByValueName(t.inputValueDataByName,t.isInaccessible,t.name),isInaccessible:t.isInaccessible,kind:t.kind,node:{kind:t.kind,name:(0,Xr.stringToNameNode)(t.name)},subgraphNames:new Set(t.subgraphNames)});case Ce.Kind.INTERFACE_TYPE_DEFINITION:return W(q({},n),{fieldDataByName:this.copyFieldDataByName(t.fieldDataByName,t.isInaccessible),implementedInterfaceTypeNames:new Set(t.implementedInterfaceTypeNames),isEntity:t.isEntity,isInaccessible:t.isInaccessible,kind:t.kind,node:{kind:t.kind,name:(0,Xr.stringToNameNode)(t.name)},requireFetchReasonsFieldNames:new Set,subgraphNames:new Set(t.subgraphNames)});case Ce.Kind.OBJECT_TYPE_DEFINITION:return W(q({},n),{fieldDataByName:this.copyFieldDataByName(t.fieldDataByName,t.isInaccessible),implementedInterfaceTypeNames:new Set(t.implementedInterfaceTypeNames),isEntity:t.isEntity,isInaccessible:t.isInaccessible,isRootType:t.isRootType,kind:t.kind,node:{kind:t.kind,name:(0,Xr.stringToNameNode)(t.renamedTypeName||t.name)},requireFetchReasonsFieldNames:new Set,renamedTypeName:t.renamedTypeName,subgraphNames:new Set(t.subgraphNames)});case Ce.Kind.SCALAR_TYPE_DEFINITION:return W(q({},n),{kind:t.kind,node:{kind:t.kind,name:(0,Xr.stringToNameNode)(t.name)},subgraphNames:new Set(t.subgraphNames)});case Ce.Kind.UNION_TYPE_DEFINITION:return W(q({},n),{kind:t.kind,node:{kind:t.kind,name:(0,Xr.stringToNameNode)(t.name)},memberByMemberTypeName:new Map(t.memberByMemberTypeName),subgraphNames:new Set(t.subgraphNames)})}}getParentTargetData({existingData:t,incomingData:n}){if(!t){let r=this.copyParentDefinitionData(n);return(0,De.isParentDataRootType)(r)&&(r.extensionType=YK.ExtensionType.NONE),r}return this.extractPersistedDirectives({data:t.persistedDirectivesData,directivesByName:n.directivesByName}),t}upsertParentDefinitionData(t,n){let r=this.entityInterfaceFederationDataByTypeName.get(t.name),i=this.parentDefinitionDataByTypeName.get(t.name),a=this.getParentTargetData({existingData:i,incomingData:t});this.recordTagNamesByCoords(a);let o=(0,De.isNodeDataInaccessible)(a);if(o&&this.inaccessibleCoords.add(a.name),r&&r.interfaceObjectSubgraphNames.has(n)){if(i&&i.kind!==Ce.Kind.INTERFACE_TYPE_DEFINITION){this.errors.push((0,Ue.incompatibleParentTypeMergeError)({existingData:i,incomingSubgraphName:n}));return}a.kind=Ce.Kind.INTERFACE_TYPE_DEFINITION,a.node.kind=Ce.Kind.INTERFACE_TYPE_DEFINITION}if(!i){this.parentDefinitionDataByTypeName.set(a.name,a);return}if(a.kind!==t.kind&&(!r||!r.interfaceObjectSubgraphNames.has(n)||a.kind!==Ce.Kind.INTERFACE_TYPE_DEFINITION||t.kind!==Ce.Kind.OBJECT_TYPE_DEFINITION)){this.errors.push((0,Ue.incompatibleParentTypeMergeError)({existingData:a,incomingNodeType:(0,ye.kindToNodeType)(t.kind),incomingSubgraphName:n}));return}switch((0,ye.addNewObjectValueMapEntries)(t.configureDescriptionDataBySubgraphName,a.configureDescriptionDataBySubgraphName),(0,De.setLongestDescription)(a,t),(0,De.setParentDataExtensionType)(a,t),a.kind){case Ce.Kind.ENUM_TYPE_DEFINITION:if(!(0,De.areKindsEqual)(a,t))return;a.appearances+=1,a.isInaccessible||(a.isInaccessible=o),(0,ye.addIterableToSet)({source:t.subgraphNames,target:a.subgraphNames});for(let l of t.enumValueDataByName.values())this.upsertEnumValueData(a.enumValueDataByName,l,o);return;case Ce.Kind.INPUT_OBJECT_TYPE_DEFINITION:if(!(0,De.areKindsEqual)(a,t))return;o&&!a.isInaccessible&&this.propagateInaccessibilityToExistingChildren(a),a.isInaccessible||(a.isInaccessible=o),(0,ye.addIterableToSet)({source:t.subgraphNames,target:a.subgraphNames});for(let l of t.inputValueDataByName.values())this.upsertInputValueData(a.inputValueDataByName,l,a.name,a.isInaccessible);return;case Ce.Kind.INTERFACE_TYPE_DEFINITION:case Ce.Kind.OBJECT_TYPE_DEFINITION:let u=t;o&&!a.isInaccessible&&this.propagateInaccessibilityToExistingChildren(a),a.isInaccessible||(a.isInaccessible=o),(0,ye.addIterableToSet)({source:u.implementedInterfaceTypeNames,target:a.implementedInterfaceTypeNames}),(0,ye.addIterableToSet)({source:u.subgraphNames,target:a.subgraphNames});for(let l of u.fieldDataByName.values())this.upsertFieldData(a.fieldDataByName,l,a.isInaccessible);return;case Ce.Kind.UNION_TYPE_DEFINITION:if(!(0,De.areKindsEqual)(a,t))return;(0,ye.addMapEntries)({source:t.memberByMemberTypeName,target:a.memberByMemberTypeName}),(0,ye.addIterableToSet)({source:t.subgraphNames,target:a.subgraphNames});return;default:(0,ye.addIterableToSet)({source:t.subgraphNames,target:a.subgraphNames});return}}propagateInaccessibilityToExistingChildren(t){switch(t.kind){case Ce.Kind.INPUT_OBJECT_TYPE_DEFINITION:for(let n of t.inputValueDataByName.values())this.inaccessibleCoords.add(n.federatedCoords);break;default:for(let n of t.fieldDataByName.values()){this.inaccessibleCoords.add(n.federatedCoords);for(let r of n.argumentDataByName.values())this.inaccessibleCoords.add(r.federatedCoords)}}}upsertPersistedDirectiveDefinitionData(t,n){let r=t.name,i=this.potentialPersistedDirectiveDefinitionDataByDirectiveName.get(r);if(!i){if(n>1)return;let a=new Map;for(let o of t.argumentDataByName.values())this.namedInputValueTypeNames.add(o.namedTypeName),this.upsertInputValueData(a,o,`@${t.name}`,!1);this.potentialPersistedDirectiveDefinitionDataByDirectiveName.set(r,{argumentDataByName:a,executableLocations:new Set(t.executableLocations),name:r,repeatable:t.repeatable,subgraphNames:new Set(t.subgraphNames),description:t.description});return}if(i.subgraphNames.size+1!==n){this.potentialPersistedDirectiveDefinitionDataByDirectiveName.delete(r);return}if((0,De.setMutualExecutableLocations)(i,t.executableLocations),i.executableLocations.size<1){this.potentialPersistedDirectiveDefinitionDataByDirectiveName.delete(r);return}for(let a of t.argumentDataByName.values())this.namedInputValueTypeNames.add((0,QK.getTypeNodeNamedTypeName)(a.type)),this.upsertInputValueData(i.argumentDataByName,a,`@${i.name}`,!1);(0,De.setLongestDescription)(i,t),i.repeatable&&(i.repeatable=t.repeatable),(0,ye.addIterableToSet)({source:t.subgraphNames,target:i.subgraphNames})}shouldUpdateFederatedFieldAbstractNamedType(t,n){if(!t)return!1;let r=this.concreteTypeNamesByAbstractTypeName.get(t);if(!r||r.size<1)return!1;for(let i of n)if(!r.has(i))return!1;return!0}updateTypeNodeNamedType(t,n){let r=t;for(let i=0;i1){this.errors.push((0,Ue.incompatibleFederatedFieldNamedTypeError)(t,n));continue}break}case Ce.Kind.UNION_TYPE_DEFINITION:{if(l){this.errors.push((0,Ue.incompatibleFederatedFieldNamedTypeError)(t,n));continue}l=p;break}default:{this.errors.push((0,Ue.incompatibleFederatedFieldNamedTypeError)(t,n));break}}}if(o.size<1&&!l){this.errors.push((0,Ue.incompatibleFederatedFieldNamedTypeError)(t,n));continue}let d=l;if(o.size>0){if(l){this.errors.push((0,Ue.incompatibleFederatedFieldNamedTypeError)(t,n));continue}for(let p of o.keys()){d=p;for(let[E,h]of o)if(p!==E&&!h.implementedInterfaceTypeNames.has(p)){d="";break}if(d)break}}if(!this.shouldUpdateFederatedFieldAbstractNamedType(d,u)){this.errors.push((0,Ue.incompatibleFederatedFieldNamedTypeError)(t,n));continue}a.namedTypeName=d,this.updateTypeNodeNamedType(a.type,d)}}federateInternalSubgraphData(){let t=0,n=!1;for(let r of this.internalSubgraphBySubgraphName.values()){t+=1,this.currentSubgraphName=r.name,this.isVersionTwo||(this.isVersionTwo=r.isVersionTwo),(0,Wfe.renameRootTypes)(this,r);for(let i of r.parentDefinitionDataByTypeName.values())this.upsertParentDefinitionData(i,r.name);if(!n){if(!r.persistedDirectiveDefinitionDataByDirectiveName.size){n=!0;continue}for(let i of r.persistedDirectiveDefinitionDataByDirectiveName.values())this.upsertPersistedDirectiveDefinitionData(i,t);this.potentialPersistedDirectiveDefinitionDataByDirectiveName.size<1&&(n=!0)}}this.handleDisparateFieldNamedTypes()}handleInterfaceObjectForInternalGraph({entityData:t,internalSubgraph:n,interfaceObjectData:r,interfaceObjectNode:i,resolvableKeyFieldSets:a,subgraphName:o}){let u=this.internalGraph.addOrUpdateNode(t.typeName),l=this.internalGraph.addEntityDataNode(t.typeName);for(let p of i.satisfiedFieldSets)u.satisfiedFieldSets.add(p),a.has(p)&&l.addTargetSubgraphByFieldSet(p,o);let d=r.fieldDatasBySubgraphName.get(o);for(let{name:p,namedTypeName:E}of d||[])this.internalGraph.addEdge(u,this.internalGraph.addOrUpdateNode(E),p);this.internalGraph.addEdge(i,u,t.typeName,!0),this.addValidPrimaryKeyTargetsFromInterfaceObject(n,i.typeName,t,u)}handleEntityInterfaces(){var t;for(let[n,r]of this.entityInterfaceFederationDataByTypeName){let i=(0,ye.getOrThrowError)(this.parentDefinitionDataByTypeName,n,Ae.PARENT_DEFINITION_DATA);if(i.kind===Ce.Kind.INTERFACE_TYPE_DEFINITION)for(let a of r.interfaceObjectSubgraphNames){let o=(0,ye.getOrThrowError)(this.internalSubgraphBySubgraphName,a,"internalSubgraphBySubgraphName"),u=o.configurationDataByTypeName,l=this.concreteTypeNamesByAbstractTypeName.get(n);if(!l)continue;let d=(0,ye.getOrThrowError)(u,n,"configurationDataByTypeName"),p=d.keys;if(!p)continue;d.entityInterfaceConcreteTypeNames=new Set(r.concreteTypeNames),this.internalGraph.setSubgraphName(a);let E=this.internalGraph.addOrUpdateNode(n,{isAbstract:!0});for(let h of l){let _=(0,ye.getOrThrowError)(this.parentDefinitionDataByTypeName,h,Ae.PARENT_DEFINITION_DATA);if(!(0,Zr.isObjectDefinitionData)(_))continue;let S=(0,ye.getOrThrowError)(this.entityDataByTypeName,h,"entityDataByTypeName");S.subgraphNames.add(a);let k=u.get(h);if(k)if((0,ye.addIterableToSet)({source:d.fieldNames,target:k.fieldNames}),!k.keys)k.keys=[...p];else e:for(let ee of p){for(let{selectionSet:oe}of k.keys)if(ee.selectionSet===oe)continue e;k.keys.push(ee)}else u.set(h,{fieldNames:new Set(d.fieldNames),isRootNode:!0,keys:[...p],typeName:h});let B=new Set;for(let ee of p.filter(oe=>!oe.disableEntityResolver))B.add(ee.selectionSet);let K=this.authorizationDataByParentTypeName.get(n),ne=(0,ye.getOrThrowError)(o.parentDefinitionDataByTypeName,n,"internalSubgraph.parentDefinitionDataByTypeName");if((0,Zr.isObjectDefinitionData)(ne)){for(let[ee,oe]of ne.fieldDataByName){let de=`${h}.${ee}`;(0,ye.getValueOrDefault)(this.fieldCoordsByNamedTypeName,oe.namedTypeName,()=>new Set).add(de);let me=K==null?void 0:K.fieldAuthDataByFieldName.get(ee);if(me){let H=(0,ye.getValueOrDefault)(this.authorizationDataByParentTypeName,h,()=>(0,Zr.newAuthorizationData)(h));(0,Zr.upsertFieldAuthorizationData)(H.fieldAuthDataByFieldName,me)||this.invalidORScopesCoords.add(de)}let pe=_.fieldDataByName.get(ee);if(pe){let H=(t=oe.isShareableBySubgraphName.get(a))!=null?t:!1;pe.isShareableBySubgraphName.set(a,H),pe.subgraphNames.add(a);let he=oe.externalFieldDataBySubgraphName.get(a);if(!he)continue;pe.externalFieldDataBySubgraphName.set(a,q({},he));continue}let ge=i.isInaccessible||_.isInaccessible||oe.isInaccessible;_.fieldDataByName.set(ee,this.copyFieldData(oe,ge))}this.handleInterfaceObjectForInternalGraph({internalSubgraph:o,subgraphName:a,interfaceObjectData:r,interfaceObjectNode:E,resolvableKeyFieldSets:B,entityData:S})}}}}}fieldDataToGraphFieldData(t){var n;return{externalSubgraphNames:new Set,name:t.name,namedTypeName:t.namedTypeName,isLeaf:(0,Zr.isNodeLeaf)((n=this.parentDefinitionDataByTypeName.get(t.namedTypeName))==null?void 0:n.kind),subgraphNames:t.subgraphNames}}getValidFlattenedPersistedDirectiveNodeArray(t){var i;let n=(0,Zr.getNodeCoords)(t),r=[];for(let[a,o]of t.persistedDirectivesData.directivesByName){if(a===Ae.SEMANTIC_NON_NULL&&(0,De.isFieldData)(t)){r.push((0,ye.generateSemanticNonNullDirective)((i=(0,ye.getFirstEntry)(t.nullLevelsBySubgraphName))!=null?i:new Set([0])));continue}let u=this.persistedDirectiveDefinitionByDirectiveName.get(a);if(u){if(o.length<2){r.push(...o);continue}if(!u.repeatable){this.errors.push((0,Ue.invalidRepeatedFederatedDirectiveErrorMessage)(a,n));continue}r.push(...o)}}return r}getRouterPersistedDirectiveNodes(t){let n=[...t.persistedDirectivesData.tagDirectiveByName.values()];return t.persistedDirectivesData.isDeprecated&&n.push((0,De.generateDeprecatedDirective)(t.persistedDirectivesData.deprecatedReason)),n.push(...this.getValidFlattenedPersistedDirectiveNodeArray(t)),n}getFederatedGraphNodeDescription(t){if(t.configureDescriptionDataBySubgraphName.size<1)return t.description;let n=[],r="";for(let[i,{propagate:a,description:o}]of t.configureDescriptionDataBySubgraphName)a&&(n.push(i),r=o);if(n.length===1)return(0,nl.getDescriptionFromString)(r);if(n.length<1)return t.description;this.errors.push((0,Ue.configureDescriptionPropagationError)((0,De.getDefinitionDataCoords)(t,!0),n))}getNodeForRouterSchemaByData(t){return t.node.name=(0,Xr.stringToNameNode)(t.name),t.node.description=this.getFederatedGraphNodeDescription(t),t.node.directives=this.getRouterPersistedDirectiveNodes(t),t.node}getNodeWithPersistedDirectivesByInputValueData(t){return t.node.name=(0,Xr.stringToNameNode)(t.name),t.node.type=t.type,t.node.description=this.getFederatedGraphNodeDescription(t),t.node.directives=this.getRouterPersistedDirectiveNodes(t),t.includeDefaultValue&&(t.node.defaultValue=t.defaultValue),t.node}getValidFieldArgumentNodes(t){let n=[],r=[],i=[],a=`${t.renamedParentTypeName}.${t.name}`;for(let[o,u]of t.argumentDataByName)t.subgraphNames.size===u.subgraphNames.size?(r.push(o),n.push(this.getNodeWithPersistedDirectivesByInputValueData(u))):(0,De.isTypeRequired)(u.type)&&i.push({inputValueName:o,missingSubgraphs:(0,ye.getEntriesNotInHashSet)(t.subgraphNames,u.subgraphNames),requiredSubgraphs:[...u.requiredSubgraphNames]});return i.length>0?this.errors.push((0,Ue.invalidRequiredInputValueError)(Ae.FIELD,a,i)):r.length>0&&((0,ye.getValueOrDefault)(this.fieldConfigurationByFieldCoords,a,()=>({argumentNames:r,fieldName:t.name,typeName:t.renamedParentTypeName})).argumentNames=r),n}getNodeWithPersistedDirectivesByFieldData(t,n){return t.node.arguments=n,t.node.name=(0,Xr.stringToNameNode)(t.name),t.node.type=t.type,t.node.description=this.getFederatedGraphNodeDescription(t),t.node.directives=this.getRouterPersistedDirectiveNodes(t),t.node}validateSemanticNonNull(t){let n;for(let r of t.nullLevelsBySubgraphName.values()){if(!n){n=r;continue}if(n.size!==r.size){this.errors.push((0,Ue.semanticNonNullInconsistentLevelsError)(t));return}for(let i of r)if(!n.has(i)){this.errors.push((0,Ue.semanticNonNullInconsistentLevelsError)(t));return}}}validateOneOfDirective({data:t,inputValueNodes:n,requiredFieldNames:r}){return t.directivesByName.has(Ae.ONE_OF)?r.size>0?(this.errors.push((0,Ue.oneOfRequiredFieldsError)({requiredFieldNames:Array.from(r),typeName:t.name})),!1):(n.length===1&&this.warnings.push((0,Xfe.singleFederatedInputFieldOneOfWarning)({fieldName:n[0].name.value,typeName:t.name})),!0):!0}pushParentDefinitionDataToDocumentDefinitions(t){for(let[n,r]of this.parentDefinitionDataByTypeName)switch(r.extensionType!==YK.ExtensionType.NONE&&this.errors.push((0,Ue.noBaseDefinitionForExtensionError)((0,ye.kindToNodeType)(r.kind),n)),r.kind){case Ce.Kind.ENUM_TYPE_DEFINITION:{if(rl.IGNORED_FEDERATED_TYPE_NAMES.has(n))break;let i=[],a=[],o=this.getEnumValueMergeMethod(n);(0,De.propagateAuthDirectives)(r,this.authorizationDataByParentTypeName.get(n));for(let u of r.enumValueDataByName.values()){let l=this.getNodeForRouterSchemaByData(u),d=(0,De.isNodeDataInaccessible)(u),p=W(q({},u.node),{directives:(0,De.getClientPersistedDirectiveNodes)(u)});switch(o){case De.MergeMethod.CONSISTENT:!d&&r.appearances>u.appearances&&this.errors.push((0,Ue.incompatibleSharedEnumError)(n)),i.push(l),d||a.push(p);break;case De.MergeMethod.INTERSECTION:r.appearances===u.appearances&&(i.push(l),d||a.push(p));break;default:i.push(l),d||a.push(p);break}}if(r.node.values=i,this.routerDefinitions.push(this.getNodeForRouterSchemaByData(r)),(0,De.isNodeDataInaccessible)(r)){this.validateReferencesOfInaccessibleType(r),this.internalGraph.setNodeInaccessible(r.name);break}if(a.length<1){this.errors.push((0,Ue.allChildDefinitionsAreInaccessibleError)((0,ye.kindToNodeType)(r.kind),n,Ae.ENUM_VALUE));break}this.clientDefinitions.push(W(q({},r.node),{directives:(0,De.getClientPersistedDirectiveNodes)(r),values:a}));break}case Ce.Kind.INPUT_OBJECT_TYPE_DEFINITION:{if(rl.IGNORED_FEDERATED_TYPE_NAMES.has(n))break;let i=new Array,a=new Array,o=new Array,u=new Set;for(let[l,d]of r.inputValueDataByName)if((0,De.isTypeRequired)(d.type)&&u.add(l),r.subgraphNames.size===d.subgraphNames.size){if(a.push(this.getNodeWithPersistedDirectivesByInputValueData(d)),(0,De.isNodeDataInaccessible)(d))continue;o.push(W(q({},d.node),{directives:(0,De.getClientPersistedDirectiveNodes)(d)}))}else(0,De.isTypeRequired)(d.type)&&i.push({inputValueName:l,missingSubgraphs:(0,ye.getEntriesNotInHashSet)(r.subgraphNames,d.subgraphNames),requiredSubgraphs:[...d.requiredSubgraphNames]});if(i.length>0){this.errors.push((0,Ue.invalidRequiredInputValueError)(Ae.INPUT_OBJECT,n,i,!1));break}if(!this.validateOneOfDirective({data:r,inputValueNodes:a,requiredFieldNames:u}))break;if(r.node.fields=a,this.routerDefinitions.push(this.getNodeForRouterSchemaByData(r)),(0,De.isNodeDataInaccessible)(r)){this.validateReferencesOfInaccessibleType(r);break}if(o.length<1){this.errors.push((0,Ue.allChildDefinitionsAreInaccessibleError)((0,ye.kindToNodeType)(r.kind),n,"Input field"));break}this.clientDefinitions.push(W(q({},r.node),{directives:(0,De.getClientPersistedDirectiveNodes)(r),fields:o}));break}case Ce.Kind.INTERFACE_TYPE_DEFINITION:case Ce.Kind.OBJECT_TYPE_DEFINITION:{let i=[],a=[],o=new Map,u=(0,De.newInvalidFieldNames)(),l=r.kind===Ce.Kind.OBJECT_TYPE_DEFINITION,d=this.authorizationDataByParentTypeName.get(n);(0,De.propagateAuthDirectives)(r,d);for(let[E,h]of r.fieldDataByName){(0,De.propagateFieldAuthDirectives)(h,d);let _=this.getValidFieldArgumentNodes(h);l&&(0,De.validateExternalAndShareable)(h,u),this.validateSemanticNonNull(h),i.push(this.getNodeWithPersistedDirectivesByFieldData(h,_)),!(0,De.isNodeDataInaccessible)(h)&&(a.push((0,De.getClientSchemaFieldNodeByFieldData)(h)),o.set(E,this.fieldDataToGraphFieldData(h)))}if(l&&(u.byShareable.size>0&&this.errors.push((0,Ue.invalidFieldShareabilityError)(r,u.byShareable)),u.subgraphNamesByExternalFieldName.size>0&&this.errors.push((0,Ue.allExternalFieldInstancesError)(n,u.subgraphNamesByExternalFieldName))),r.node.fields=i,this.internalGraph.initializeNode(n,o),r.implementedInterfaceTypeNames.size>0){t.push({data:r,clientSchemaFieldNodes:a});break}this.routerDefinitions.push(this.getNodeForRouterSchemaByData(r));let p=(0,zfe.isNodeQuery)(n);if((0,De.isNodeDataInaccessible)(r)){if(p){this.errors.push(Ue.inaccessibleQueryRootTypeError);break}this.validateReferencesOfInaccessibleType(r),this.internalGraph.setNodeInaccessible(r.name);break}if(a.length<1){let E=p?(0,Ue.noQueryRootTypeError)(!1):(0,Ue.allChildDefinitionsAreInaccessibleError)((0,ye.kindToNodeType)(r.kind),n,Ae.FIELD);this.errors.push(E);break}this.clientDefinitions.push(W(q({},r.node),{directives:(0,De.getClientPersistedDirectiveNodes)(r),fields:a}));break}case Ce.Kind.SCALAR_TYPE_DEFINITION:{if(rl.IGNORED_FEDERATED_TYPE_NAMES.has(n))break;if((0,De.propagateAuthDirectives)(r,this.authorizationDataByParentTypeName.get(n)),this.routerDefinitions.push(this.getNodeForRouterSchemaByData(r)),(0,De.isNodeDataInaccessible)(r)){this.validateReferencesOfInaccessibleType(r),this.internalGraph.setNodeInaccessible(r.name);break}this.clientDefinitions.push(W(q({},r.node),{directives:(0,De.getClientPersistedDirectiveNodes)(r)}));break}case Ce.Kind.UNION_TYPE_DEFINITION:{if(r.node.types=(0,Zr.mapToArrayOfValues)(r.memberByMemberTypeName),this.routerDefinitions.push(this.getNodeForRouterSchemaByData(r)),(0,De.isNodeDataInaccessible)(r)){this.validateReferencesOfInaccessibleType(r),this.internalGraph.setNodeInaccessible(r.name);break}let i=this.getClientSchemaUnionMembers(r);if(i.length<1){this.errors.push((0,Ue.allChildDefinitionsAreInaccessibleError)(Ae.UNION,n,"union member type"));break}this.clientDefinitions.push(W(q({},r.node),{directives:(0,De.getClientPersistedDirectiveNodes)(r),types:i}));break}}}pushNamedTypeAuthDataToFields(){var t;for(let[n,r]of this.authorizationDataByParentTypeName){if(!r.requiresAuthentication&&r.requiredScopes.length<1)continue;let i=this.fieldCoordsByNamedTypeName.get(n);if(i)for(let a of i){let o=a.split(Ae.LITERAL_PERIOD);switch(o.length){case 2:{let u=(0,ye.getValueOrDefault)(this.authorizationDataByParentTypeName,o[0],()=>(0,Zr.newAuthorizationData)(o[0])),l=(0,ye.getValueOrDefault)(u.fieldAuthDataByFieldName,o[1],()=>(0,Zr.newFieldAuthorizationData)(o[1]));(t=l.inheritedData).requiresAuthentication||(t.requiresAuthentication=r.requiresAuthentication),l.inheritedData.requiredScopes.length*r.requiredScopes.length>Mf.MAX_OR_SCOPES?this.invalidORScopesCoords.add(a):(l.inheritedData.requiredScopesByOR=(0,Zr.mergeRequiredScopesByAND)(l.inheritedData.requiredScopesByOR,r.requiredScopesByOR),l.inheritedData.requiredScopes=(0,Zr.mergeRequiredScopesByAND)(l.inheritedData.requiredScopes,r.requiredScopes));break}default:break}}}}federateSubgraphData(){this.federateInternalSubgraphData(),this.handleEntityInterfaces(),this.generateTagData(),Al(this,Rh,HK).call(this),this.pushNamedTypeAuthDataToFields()}validateInterfaceImplementationsAndPushToDocumentDefinitions(t){for(let{data:n,clientSchemaFieldNodes:r}of t){if(n.node.interfaces=this.getValidImplementedInterfaces(n),this.routerDefinitions.push(this.getNodeForRouterSchemaByData(n)),(0,De.isNodeDataInaccessible)(n)){this.validateReferencesOfInaccessibleType(n),this.internalGraph.setNodeInaccessible(n.name);continue}let i=[];for(let a of n.implementedInterfaceTypeNames)this.inaccessibleCoords.has(a)||i.push((0,Xr.stringToNamedTypeNode)(a));this.clientDefinitions.push(W(q({},n.node),{directives:(0,De.getClientPersistedDirectiveNodes)(n),fields:r,interfaces:i}))}}validatePathSegmentInaccessibility(t){if(!t)return!1;let r=t.split(Ae.LEFT_PARENTHESIS)[0].split(Ae.LITERAL_PERIOD),i=r[0];for(let a=0;a0&&this.errors.push((0,Ue.invalidReferencesOfInaccessibleTypeError)((0,ye.kindToNodeType)(t.kind),t.name,r))}validateQueryRootType(){let t=this.parentDefinitionDataByTypeName.get(Ae.QUERY);if(!t||t.kind!==Ce.Kind.OBJECT_TYPE_DEFINITION||t.fieldDataByName.size<1){this.errors.push((0,Ue.noQueryRootTypeError)());return}for(let n of t.fieldDataByName.values())if(!(0,De.isNodeDataInaccessible)(n))return;this.errors.push((0,Ue.noQueryRootTypeError)())}validateSubscriptionFieldConditionFieldPath(t,n,r,i,a){let o=t.split(Ae.LITERAL_PERIOD);if(o.length<1)return a.push((0,Ue.invalidSubscriptionFieldConditionFieldPathErrorMessage)(r,t)),[];let u=n;if(this.inaccessibleCoords.has(u.renamedTypeName))return a.push((0,Ue.inaccessibleSubscriptionFieldConditionFieldPathFieldErrorMessage)(r,t,o[0],u.renamedTypeName)),[];let l="";for(let d=0;d0?`.${p}`:p,u.kind!==Ce.Kind.OBJECT_TYPE_DEFINITION)return a.push((0,Ue.invalidSubscriptionFieldConditionFieldPathParentErrorMessage)(r,t,l)),[];let E=u.fieldDataByName.get(p);if(!E)return a.push((0,Ue.undefinedSubscriptionFieldConditionFieldPathFieldErrorMessage)(r,t,l,p,u.renamedTypeName)),[];let h=`${u.renamedTypeName}.${p}`;if(!E.subgraphNames.has(i))return a.push((0,Ue.invalidSubscriptionFieldConditionFieldPathFieldErrorMessage)(r,t,l,h,i)),[];if(this.inaccessibleCoords.has(h))return a.push((0,Ue.inaccessibleSubscriptionFieldConditionFieldPathFieldErrorMessage)(r,t,l,h)),[];if(Mf.BASE_SCALARS.has(E.namedTypeName)){u={kind:Ce.Kind.SCALAR_TYPE_DEFINITION,name:E.namedTypeName};continue}u=(0,ye.getOrThrowError)(this.parentDefinitionDataByTypeName,E.namedTypeName,Ae.PARENT_DEFINITION_DATA)}return(0,De.isLeafKind)(u.kind)?o:(a.push((0,Ue.nonLeafSubscriptionFieldConditionFieldPathFinalFieldErrorMessage)(r,t,o[o.length-1],(0,ye.kindToNodeType)(u.kind),u.name)),[])}validateSubscriptionFieldCondition(t,n,r,i,a,o,u){if(i>bh.MAX_SUBSCRIPTION_FILTER_DEPTH||this.isMaxDepth)return u.push((0,Ue.subscriptionFilterConditionDepthExceededErrorMessage)(a)),this.isMaxDepth=!0,!1;let l=!1,d=new Set([Ae.FIELD_PATH,Ae.VALUES]),p=new Set,E=new Set,h=[];for(let _ of t.fields){let S=_.name.value,k=a+`.${S}`;switch(S){case Ae.FIELD_PATH:{if(d.has(Ae.FIELD_PATH))d.delete(Ae.FIELD_PATH);else{l=!0,p.add(Ae.FIELD_PATH);break}if(_.value.kind!==Ce.Kind.STRING){h.push((0,Ue.invalidInputFieldTypeErrorMessage)(k,Ae.STRING,(0,ye.kindToNodeType)(_.value.kind))),l=!0;break}let B=this.validateSubscriptionFieldConditionFieldPath(_.value.value,r,k,o,h);if(B.length<1){l=!0;break}n.fieldPath=B;break}case Ae.VALUES:{if(d.has(Ae.VALUES))d.delete(Ae.VALUES);else{l=!0,p.add(Ae.VALUES);break}let B=_.value.kind;if(B==Ce.Kind.NULL||B==Ce.Kind.OBJECT){h.push((0,Ue.invalidInputFieldTypeErrorMessage)(k,Ae.LIST,(0,ye.kindToNodeType)(_.value.kind))),l=!0;break}if(B!==Ce.Kind.LIST){n.values=[(0,De.getSubscriptionFilterValue)(_.value)];break}let K=new Set,ne=[];for(let ee=0;ee<_.value.values.length;ee++){let oe=_.value.values[ee];if(oe.kind===Ce.Kind.OBJECT||oe.kind===Ce.Kind.LIST){l=!0,ne.push(ee);continue}K.add((0,De.getSubscriptionFilterValue)(oe))}if(ne.length>0){h.push((0,Ue.subscriptionFieldConditionInvalidValuesArrayErrorMessage)(k,ne));continue}if(K.size<1){l=!0,h.push((0,Ue.subscriptionFieldConditionEmptyValuesArrayErrorMessage)(k));continue}n.values=[...K];break}default:l=!0,E.add(S)}}return l?(u.push((0,Ue.subscriptionFieldConditionInvalidInputFieldErrorMessage)(a,[...d],[...p],[...E],h)),!1):!0}validateSubscriptionFilterCondition(t,n,r,i,a,o,u){if(i>bh.MAX_SUBSCRIPTION_FILTER_DEPTH||this.isMaxDepth)return u.push((0,Ue.subscriptionFilterConditionDepthExceededErrorMessage)(a)),this.isMaxDepth=!0,!1;if(i+=1,t.fields.length!==1)return u.push((0,Ue.subscriptionFilterConditionInvalidInputFieldNumberErrorMessage)(a,t.fields.length)),!1;let l=t.fields[0],d=l.name.value;if(!rl.SUBSCRIPTION_FILTER_INPUT_NAMES.has(d))return u.push((0,Ue.subscriptionFilterConditionInvalidInputFieldErrorMessage)(a,d)),!1;let p=a+`.${d}`;switch(l.value.kind){case Ce.Kind.OBJECT:switch(d){case Ae.IN_UPPER:return n.in={fieldPath:[],values:[]},this.validateSubscriptionFieldCondition(l.value,n.in,r,i,a+".IN",o,u);case Ae.NOT_UPPER:return n.not={},this.validateSubscriptionFilterCondition(l.value,n.not,r,i,a+".NOT",o,u);default:return u.push((0,Ue.subscriptionFilterConditionInvalidInputFieldTypeErrorMessage)(p,Ae.LIST,Ae.OBJECT)),!1}case Ce.Kind.LIST:{let E=[];switch(d){case Ae.AND_UPPER:{n.and=E;break}case Ae.OR_UPPER:{n.or=E;break}default:return u.push((0,Ue.subscriptionFilterConditionInvalidInputFieldTypeErrorMessage)(p,Ae.OBJECT,Ae.LIST)),!1}let h=l.value.values.length;if(h<1||h>5)return u.push((0,Ue.subscriptionFilterArrayConditionInvalidLengthErrorMessage)(p,h)),!1;let _=!0,S=[];for(let k=0;k0?(u.push((0,Ue.subscriptionFilterArrayConditionInvalidItemTypeErrorMessage)(p,S)),!1):_}default:{let E=rl.SUBSCRIPTION_FILTER_LIST_INPUT_NAMES.has(d)?Ae.LIST:Ae.OBJECT;return u.push((0,Ue.subscriptionFilterConditionInvalidInputFieldTypeErrorMessage)(p,E,(0,ye.kindToNodeType)(l.value.kind))),!1}}}validateSubscriptionFilterAndGenerateConfiguration(t,n,r,i,a,o){if(!t.arguments||t.arguments.length!==1)return;let u=t.arguments[0];if(u.value.kind!==Ce.Kind.OBJECT){this.errors.push((0,Ue.invalidSubscriptionFilterDirectiveError)(r,[(0,Ue.subscriptionFilterConditionInvalidInputFieldTypeErrorMessage)(Ae.CONDITION,Ae.OBJECT,(0,ye.kindToNodeType)(u.value.kind))]));return}let l={},d=[];if(!this.validateSubscriptionFilterCondition(u.value,l,n,0,Ae.CONDITION,o,d)){this.errors.push((0,Ue.invalidSubscriptionFilterDirectiveError)(r,d)),this.isMaxDepth=!1;return}(0,ye.getValueOrDefault)(this.fieldConfigurationByFieldCoords,r,()=>({argumentNames:[],fieldName:i,typeName:a})).subscriptionFilterCondition=l}validateSubscriptionFiltersAndGenerateConfiguration(){for(let[t,n]of this.subscriptionFilterDataByFieldPath){if(this.inaccessibleCoords.has(t))continue;let r=this.parentDefinitionDataByTypeName.get(n.fieldData.namedTypeName);if(!r){this.errors.push((0,Ue.invalidSubscriptionFilterDirectiveError)(t,[(0,Ue.subscriptionFilterNamedTypeErrorMessage)(n.fieldData.namedTypeName)]));continue}(0,De.isNodeDataInaccessible)(r)||r.kind===Ce.Kind.OBJECT_TYPE_DEFINITION&&this.validateSubscriptionFilterAndGenerateConfiguration(n.directive,r,t,n.fieldData.name,n.fieldData.renamedParentTypeName,n.directiveSubgraphName)}}buildFederationResult(){this.subscriptionFilterDataByFieldPath.size>0&&this.validateSubscriptionFiltersAndGenerateConfiguration(),this.invalidORScopesCoords.size>0&&this.errors.push((0,Ue.orScopesLimitError)(Mf.MAX_OR_SCOPES,[...this.invalidORScopesCoords]));for(let a of this.potentialPersistedDirectiveDefinitionDataByDirectiveName.values())(0,De.addValidPersistedDirectiveDefinitionNodeByData)(this.routerDefinitions,a,this.persistedDirectiveDefinitionByDirectiveName,this.errors);let t=[];this.pushParentDefinitionDataToDocumentDefinitions(t),this.validateInterfaceImplementationsAndPushToDocumentDefinitions(t),this.validateQueryRootType();for(let a of this.inaccessibleRequiredInputValueErrorByCoords.values())this.errors.push(a);if(this.errors.length>0)return{errors:this.errors,success:!1,warnings:this.warnings};if(!this.options.disableResolvabilityValidation&&this.internalSubgraphBySubgraphName.size>1){let a=this.internalGraph.validate();if(!a.success)return{errors:a.errors,success:!1,warnings:this.warnings}}let n={kind:Ce.Kind.DOCUMENT,definitions:this.routerDefinitions},r=(0,Ce.buildASTSchema)({kind:Ce.Kind.DOCUMENT,definitions:this.clientDefinitions},{assumeValid:!0,assumeValidSDL:!0}),i=new Map;for(let{configurationDataByTypeName:a,costs:o,directiveDefinitionByName:u,isVersionTwo:l,name:d,parentDefinitionDataByTypeName:p,schema:E,schemaNode:h}of this.internalSubgraphBySubgraphName.values())i.set(d,{configurationDataByTypeName:a,costs:o,directiveDefinitionByName:u,isVersionTwo:l,parentDefinitionDataByTypeName:p,schema:E,schemaNode:h});for(let a of this.authorizationDataByParentTypeName.values())(0,Zr.upsertAuthorizationConfiguration)(this.fieldConfigurationByFieldCoords,a);return q({directiveDefinitionByName:this.directiveDefinitionByName,fieldConfigurations:Array.from(this.fieldConfigurationByFieldCoords.values()),federatedGraphAST:n,federatedGraphSchema:(0,Ce.buildASTSchema)(n,{assumeValid:!0,assumeValidSDL:!0}),federatedGraphClientSchema:r,parentDefinitionDataByTypeName:this.parentDefinitionDataByTypeName,subgraphConfigBySubgraphName:i,success:!0,warnings:this.warnings},this.getClientSchemaObjectBoolean())}getClientSchemaObjectBoolean(){return this.inaccessibleCoords.size<1&&this.tagNamesByCoords.size<1?{}:{shouldIncludeClientSchema:!0}}handleChildTagExclusions(t,n,r,i){let a=n.size;for(let[o,u]of r){let l=(0,ye.getOrThrowError)(n,o,`${t.name}.childDataByChildName`);if((0,De.isNodeDataInaccessible)(l)){a-=1;continue}i.isDisjointFrom(u.tagNames)||((0,ye.getValueOrDefault)(l.persistedDirectivesData.directivesByName,Ae.INACCESSIBLE,()=>[(0,ye.generateSimpleDirective)(Ae.INACCESSIBLE)]),this.inaccessibleCoords.add(`${t.name}.${o}`),a-=1)}a<1&&(t.persistedDirectivesData.directivesByName.set(Ae.INACCESSIBLE,[(0,ye.generateSimpleDirective)(Ae.INACCESSIBLE)]),this.inaccessibleCoords.add(t.name))}handleChildTagInclusions(t,n,r,i){let a=n.size;for(let[o,u]of n){if((0,De.isNodeDataInaccessible)(u)){a-=1;continue}let l=r.get(o);(!l||i.isDisjointFrom(l.tagNames))&&((0,ye.getValueOrDefault)(u.persistedDirectivesData.directivesByName,Ae.INACCESSIBLE,()=>[(0,ye.generateSimpleDirective)(Ae.INACCESSIBLE)]),this.inaccessibleCoords.add(`${t.name}.${o}`),a-=1)}a<1&&(t.persistedDirectivesData.directivesByName.set(Ae.INACCESSIBLE,[(0,ye.generateSimpleDirective)(Ae.INACCESSIBLE)]),this.inaccessibleCoords.add(t.name))}buildFederationContractResult(t){if(this.isVersionTwo||this.routerDefinitions.push(Yu.INACCESSIBLE_DEFINITION),t.tagNamesToExclude.size>0)for(let[o,u]of this.parentTagDataByTypeName){let l=(0,ye.getOrThrowError)(this.parentDefinitionDataByTypeName,o,Ae.PARENT_DEFINITION_DATA);if(!(0,De.isNodeDataInaccessible)(l)){if(!t.tagNamesToExclude.isDisjointFrom(u.tagNames)){l.persistedDirectivesData.directivesByName.set(Ae.INACCESSIBLE,[(0,ye.generateSimpleDirective)(Ae.INACCESSIBLE)]),this.inaccessibleCoords.add(o);continue}if(!(u.childTagDataByChildName.size<1))switch(l.kind){case Ce.Kind.SCALAR_TYPE_DEFINITION:case Ce.Kind.UNION_TYPE_DEFINITION:break;case Ce.Kind.ENUM_TYPE_DEFINITION:{this.handleChildTagExclusions(l,l.enumValueDataByName,u.childTagDataByChildName,t.tagNamesToExclude);break}case Ce.Kind.INPUT_OBJECT_TYPE_DEFINITION:{this.handleChildTagExclusions(l,l.inputValueDataByName,u.childTagDataByChildName,t.tagNamesToExclude);break}default:{let d=l.fieldDataByName.size;for(let[p,E]of u.childTagDataByChildName){let h=(0,ye.getOrThrowError)(l.fieldDataByName,p,`${o}.fieldDataByFieldName`);if((0,De.isNodeDataInaccessible)(h)){d-=1;continue}if(!t.tagNamesToExclude.isDisjointFrom(E.tagNames)){(0,ye.getValueOrDefault)(h.persistedDirectivesData.directivesByName,Ae.INACCESSIBLE,()=>[(0,ye.generateSimpleDirective)(Ae.INACCESSIBLE)]),this.inaccessibleCoords.add(h.federatedCoords),d-=1;continue}for(let[_,S]of E.tagNamesByArgumentName){let k=(0,ye.getOrThrowError)(h.argumentDataByName,_,`${p}.argumentDataByArgumentName`);(0,De.isNodeDataInaccessible)(k)||t.tagNamesToExclude.isDisjointFrom(S)||((0,ye.getValueOrDefault)(k.persistedDirectivesData.directivesByName,Ae.INACCESSIBLE,()=>[(0,ye.generateSimpleDirective)(Ae.INACCESSIBLE)]),this.inaccessibleCoords.add(k.federatedCoords))}}d<1&&(l.persistedDirectivesData.directivesByName.set(Ae.INACCESSIBLE,[(0,ye.generateSimpleDirective)(Ae.INACCESSIBLE)]),this.inaccessibleCoords.add(o))}}}}else if(t.tagNamesToInclude.size>0)for(let[o,u]of this.parentDefinitionDataByTypeName){if((0,De.isNodeDataInaccessible)(u))continue;let l=this.parentTagDataByTypeName.get(o);if(!l){u.persistedDirectivesData.directivesByName.set(Ae.INACCESSIBLE,[(0,ye.generateSimpleDirective)(Ae.INACCESSIBLE)]),this.inaccessibleCoords.add(o);continue}if(t.tagNamesToInclude.isDisjointFrom(l.tagNames)){if(l.childTagDataByChildName.size<1){u.persistedDirectivesData.directivesByName.set(Ae.INACCESSIBLE,[(0,ye.generateSimpleDirective)(Ae.INACCESSIBLE)]),this.inaccessibleCoords.add(o);continue}switch(u.kind){case Ce.Kind.SCALAR_TYPE_DEFINITION:case Ce.Kind.UNION_TYPE_DEFINITION:continue;case Ce.Kind.ENUM_TYPE_DEFINITION:this.handleChildTagInclusions(u,u.enumValueDataByName,l.childTagDataByChildName,t.tagNamesToInclude);break;case Ce.Kind.INPUT_OBJECT_TYPE_DEFINITION:this.handleChildTagInclusions(u,u.inputValueDataByName,l.childTagDataByChildName,t.tagNamesToInclude);break;default:let d=u.fieldDataByName.size;for(let[p,E]of u.fieldDataByName){if((0,De.isNodeDataInaccessible)(E)){d-=1;continue}let h=l.childTagDataByChildName.get(p);(!h||t.tagNamesToInclude.isDisjointFrom(h.tagNames))&&((0,ye.getValueOrDefault)(E.persistedDirectivesData.directivesByName,Ae.INACCESSIBLE,()=>[(0,ye.generateSimpleDirective)(Ae.INACCESSIBLE)]),this.inaccessibleCoords.add(E.federatedCoords),d-=1)}d<1&&(u.persistedDirectivesData.directivesByName.set(Ae.INACCESSIBLE,[(0,ye.generateSimpleDirective)(Ae.INACCESSIBLE)]),this.inaccessibleCoords.add(o))}}}this.subscriptionFilterDataByFieldPath.size>0&&this.validateSubscriptionFiltersAndGenerateConfiguration();for(let o of this.potentialPersistedDirectiveDefinitionDataByDirectiveName.values())(0,De.addValidPersistedDirectiveDefinitionNodeByData)(this.routerDefinitions,o,this.persistedDirectiveDefinitionByDirectiveName,this.errors);let n=[];if(this.pushParentDefinitionDataToDocumentDefinitions(n),this.validateInterfaceImplementationsAndPushToDocumentDefinitions(n),this.validateQueryRootType(),this.errors.length>0)return{errors:this.errors,success:!1,warnings:this.warnings};let r={kind:Ce.Kind.DOCUMENT,definitions:this.routerDefinitions},i=(0,Ce.buildASTSchema)({kind:Ce.Kind.DOCUMENT,definitions:this.clientDefinitions},{assumeValid:!0,assumeValidSDL:!0}),a=new Map;for(let{configurationDataByTypeName:o,costs:u,directiveDefinitionByName:l,isVersionTwo:d,name:p,parentDefinitionDataByTypeName:E,schema:h,schemaNode:_}of this.internalSubgraphBySubgraphName.values())a.set(p,{configurationDataByTypeName:o,costs:u,directiveDefinitionByName:l,isVersionTwo:d,parentDefinitionDataByTypeName:E,schema:h,schemaNode:_});for(let o of this.authorizationDataByParentTypeName.values())(0,Zr.upsertAuthorizationConfiguration)(this.fieldConfigurationByFieldCoords,o);return q({directiveDefinitionByName:this.directiveDefinitionByName,fieldConfigurations:Array.from(this.fieldConfigurationByFieldCoords.values()),federatedGraphAST:r,federatedGraphSchema:(0,Ce.buildASTSchema)(r,{assumeValid:!0,assumeValidSDL:!0}),federatedGraphClientSchema:i,parentDefinitionDataByTypeName:this.parentDefinitionDataByTypeName,subgraphConfigBySubgraphName:a,success:!0,warnings:this.warnings},this.getClientSchemaObjectBoolean())}federateSubgraphsInternal(){return this.federateSubgraphData(),this.buildFederationResult()}};Rh=new WeakSet,HK=function(){var r;let t=new Set,n=new Set;for(let i of this.referencedPersistedDirectiveNames){let a=Mf.DIRECTIVE_DEFINITION_BY_NAME.get(i);if(!a)continue;let o=(r=rl.DEPENDENCIES_BY_DIRECTIVE_NAME.get(i))!=null?r:[];this.directiveDefinitionByName.set(i,a),rl.CLIENT_PERSISTED_DIRECTIVE_NAMES.has(i)&&(this.clientDefinitions.push(a),(0,ye.addIterableToSet)({source:o,target:t})),this.routerDefinitions.push(a),(0,ye.addIterableToSet)({source:o,target:n})}this.clientDefinitions.push(...t),this.routerDefinitions.push(...n)};il.FederationFactory=Ah;function Mb({options:e,subgraphs:t}){if(t.length<1)return{errors:[Ue.minimumSubgraphRequirementError],success:!1,warnings:[]};let n=(0,Hfe.batchNormalize)({subgraphs:t,options:e});if(!n.success)return{errors:n.errors,success:!1,warnings:n.warnings};let r=new Map,i=new Map;for(let[u,l]of n.internalSubgraphBySubgraphName)for(let[d,p]of l.entityInterfaces){let E=r.get(d);if(!E){r.set(d,(0,Zr.newEntityInterfaceFederationData)(p,u));continue}(0,Zr.upsertEntityInterfaceFederationData)(E,p,u)}let a=new Array,o=new Map;for(let[u,l]of r){let d=l.concreteTypeNames.size;for(let[p,E]of l.subgraphDataByTypeName){let h=(0,ye.getValueOrDefault)(o,p,()=>new Set);if((0,ye.addIterableToSet)({source:E.concreteTypeNames,target:h}),!E.isInterfaceObject){E.resolvable&&E.concreteTypeNames.size!==d&&(0,ye.getValueOrDefault)(i,u,()=>new Array).push({subgraphName:p,definedConcreteTypeNames:new Set(E.concreteTypeNames),requiredConcreteTypeNames:new Set(l.concreteTypeNames)});continue}(0,ye.addIterableToSet)({source:l.concreteTypeNames,target:h});let{parentDefinitionDataByTypeName:_}=(0,ye.getOrThrowError)(n.internalSubgraphBySubgraphName,p,"internalSubgraphBySubgraphName"),S=[];for(let k of l.concreteTypeNames)_.has(k)&&S.push(k);S.length>0&&a.push((0,Ue.invalidInterfaceObjectImplementationDefinitionsError)(u,p,S))}}for(let[u,l]of i){let d=new Array;for(let p of l){let E=o.get(p.subgraphName);if(!E){d.push(p);continue}let h=p.requiredConcreteTypeNames.intersection(E);p.requiredConcreteTypeNames.size!==h.size&&(p.definedConcreteTypeNames=h,d.push(p))}if(d.length>0){i.set(u,d);continue}i.delete(u)}return i.size>0&&a.push((0,Ue.undefinedEntityInterfaceImplementationsError)(i,r)),a.length>0?{errors:a,success:!1,warnings:n.warnings}:{federationFactory:new Ah({authorizationDataByParentTypeName:n.authorizationDataByParentTypeName,concreteTypeNamesByAbstractTypeName:n.concreteTypeNamesByAbstractTypeName,entityDataByTypeName:n.entityDataByTypeName,entityInterfaceFederationDataByTypeName:r,fieldCoordsByNamedTypeName:n.fieldCoordsByNamedTypeName,interfaceImplementationTypeNamesByInterfaceTypeName:n.interfaceImplementationTypeNamesByInterfaceTypeName,internalSubgraphBySubgraphName:n.internalSubgraphBySubgraphName,internalGraph:n.internalGraph,options:e,warnings:n.warnings}),success:!0,warnings:n.warnings}}function Zfe({options:e,subgraphs:t}){let n=Mb({options:e,subgraphs:t});return n.success?n.federationFactory.federateSubgraphsInternal():{errors:n.errors,success:!1,warnings:n.warnings}}function eme({options:e,subgraphs:t,tagOptionsByContractName:n}){let r=Mb({options:e,subgraphs:t});if(!r.success)return{errors:r.errors,success:!1,warnings:r.warnings};r.federationFactory.federateSubgraphData();let i=[(0,JK.cloneDeep)(r.federationFactory)],a=r.federationFactory.buildFederationResult();if(!a.success)return{errors:a.errors,success:!1,warnings:a.warnings};let o=n.size-1,u=new Map,l=0;for(let[d,p]of n){l!==o&&i.push((0,JK.cloneDeep)(i[l]));let E=i[l].buildFederationContractResult(p);u.set(d,E),l++}return W(q({},a),{federationResultByContractName:u})}function tme({contractTagOptions:e,options:t,subgraphs:n}){let r=Mb({options:t,subgraphs:n});return r.success?(r.federationFactory.federateSubgraphData(),r.federationFactory.buildFederationContractResult(e)):{errors:r.errors,success:!1,warnings:r.warnings}}});var Ph=F(qs=>{"use strict";m();T();N();Object.defineProperty(qs,"__esModule",{value:!0});qs.LATEST_ROUTER_COMPATIBILITY_VERSION=qs.ROUTER_COMPATIBILITY_VERSIONS=qs.ROUTER_COMPATIBILITY_VERSION_ONE=void 0;qs.ROUTER_COMPATIBILITY_VERSION_ONE="1";qs.ROUTER_COMPATIBILITY_VERSIONS=new Set([qs.ROUTER_COMPATIBILITY_VERSION_ONE]);qs.LATEST_ROUTER_COMPATIBILITY_VERSION="1"});var WK=F(xf=>{"use strict";m();T();N();Object.defineProperty(xf,"__esModule",{value:!0});xf.federateSubgraphs=nme;xf.federateSubgraphsWithContracts=rme;xf.federateSubgraphsContract=ime;var xb=zK(),qb=Ph();function nme({options:e,subgraphs:t,version:n=qb.ROUTER_COMPATIBILITY_VERSION_ONE}){switch(n){default:return(0,xb.federateSubgraphs)({options:e,subgraphs:t})}}function rme({options:e,subgraphs:t,tagOptionsByContractName:n,version:r=qb.ROUTER_COMPATIBILITY_VERSION_ONE}){switch(r){default:return(0,xb.federateSubgraphsWithContracts)({options:e,subgraphs:t,tagOptionsByContractName:n})}}function ime({contractTagOptions:e,options:t,subgraphs:n,version:r=qb.ROUTER_COMPATIBILITY_VERSION_ONE}){switch(r){default:return(0,xb.federateSubgraphsContract)({contractTagOptions:e,options:t,subgraphs:n})}}});var ZK=F(XK=>{"use strict";m();T();N();Object.defineProperty(XK,"__esModule",{value:!0})});var t1=F(e1=>{"use strict";m();T();N();Object.defineProperty(e1,"__esModule",{value:!0})});var n1=F(qf=>{"use strict";m();T();N();Object.defineProperty(qf,"__esModule",{value:!0});qf.normalizeSubgraphFromString=ame;qf.normalizeSubgraph=sme;qf.batchNormalize=ome;var Vb=Cb(),Kb=Ph();function ame({noLocation:e=!0,options:t,sdlString:n,version:r=Kb.ROUTER_COMPATIBILITY_VERSION_ONE}){switch(r){default:return(0,Vb.normalizeSubgraphFromString)({noLocation:e,options:t,sdlString:n})}}function sme({document:e,internalGraph:t,options:n,subgraphName:r,version:i=Kb.ROUTER_COMPATIBILITY_VERSION_ONE}){switch(i){default:return(0,Vb.normalizeSubgraph)({document:e,internalGraph:t,options:n,subgraphName:r})}}function ome({options:e,subgraphs:t,version:n=Kb.ROUTER_COMPATIBILITY_VERSION_ONE}){switch(n){default:return(0,Vb.batchNormalize)({options:e,subgraphs:t})}}});var i1=F(r1=>{"use strict";m();T();N();Object.defineProperty(r1,"__esModule",{value:!0})});var s1=F(a1=>{"use strict";m();T();N();Object.defineProperty(a1,"__esModule",{value:!0})});var u1=F(o1=>{"use strict";m();T();N();Object.defineProperty(o1,"__esModule",{value:!0})});var l1=F(c1=>{"use strict";m();T();N();Object.defineProperty(c1,"__esModule",{value:!0})});var p1=F(d1=>{"use strict";m();T();N();Object.defineProperty(d1,"__esModule",{value:!0})});var m1=F(f1=>{"use strict";m();T();N();Object.defineProperty(f1,"__esModule",{value:!0})});var T1=F(N1=>{"use strict";m();T();N();Object.defineProperty(N1,"__esModule",{value:!0})});var h1=F(E1=>{"use strict";m();T();N();Object.defineProperty(E1,"__esModule",{value:!0})});var y1=F(Fh=>{"use strict";m();T();N();Object.defineProperty(Fh,"__esModule",{value:!0});Fh.COMPOSITION_VERSION=void 0;Fh.COMPOSITION_VERSION="{{$COMPOSITION__VERSION}}"});var g1=F(I1=>{"use strict";m();T();N();Object.defineProperty(I1,"__esModule",{value:!0})});var v1=F(_1=>{"use strict";m();T();N();Object.defineProperty(_1,"__esModule",{value:!0})});var O1=F(S1=>{"use strict";m();T();N();Object.defineProperty(S1,"__esModule",{value:!0})});var b1=F(D1=>{"use strict";m();T();N();Object.defineProperty(D1,"__esModule",{value:!0})});var Lh=F(Xe=>{"use strict";m();T();N();var ume=Xe&&Xe.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),dt=Xe&&Xe.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&ume(t,e,n)};Object.defineProperty(Xe,"__esModule",{value:!0});dt(kr(),Xe);dt(uS(),Xe);dt(Ji(),Xe);dt(_x(),Xe);dt(WK(),Xe);dt(ZK(),Xe);dt(t1(),Xe);dt(n1(),Xe);dt(i1(),Xe);dt(s1(),Xe);dt(Pb(),Xe);dt(yb(),Xe);dt(Th(),Xe);dt(u1(),Xe);dt(l1(),Xe);dt(Sb(),Xe);dt(Ph(),Xe);dt(p1(),Xe);dt(Fb(),Xe);dt(Uu(),Xe);dt(tf(),Xe);dt(ed(),Xe);dt(m1(),Xe);dt(T1(),Xe);dt(h1(),Xe);dt(y1(),Xe);dt(g1(),Xe);dt(Zn(),Xe);dt(v1(),Xe);dt(Mr(),Xe);dt(lb(),Xe);dt(ku(),Xe);dt(nf(),Xe);dt(xE(),Xe);dt(qE(),Xe);dt(gd(),Xe);dt(MT(),Xe);dt(O1(),Xe);dt(xT(),Xe);dt(kb(),Xe);dt(ab(),Xe);dt(Ff(),Xe);dt(b1(),Xe);dt(mb(),Xe);dt(Oh(),Xe);dt(ub(),Xe);dt(Pf(),Xe);dt(Lf(),Xe)});var aNe={};lN(aNe,{buildRouterConfiguration:()=>iNe,federateSubgraphs:()=>rNe});m();T();N();var pl=gi(Lh());m();T();N();m();T();N();function jb(e){if(!e)return e;if(!URL.canParse(e))throw new Error("Invalid URL");let t=e.indexOf("?"),n=e.indexOf("#"),r=e;return t>0?r=r.slice(0,n>0?Math.min(t,n):t):n>0&&(r=r.slice(0,n)),r}m();T();N();m();T();N();var A1={};m();T();N();function R1(e){return e!=null}m();T();N();m();T();N();var Ch=gi(Oe(),1);m();T();N();m();T();N();function Ju(e){return wh(e,[])}function wh(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return cme(e,t);default:return String(e)}}function P1(e){return(e.name="GraphQLError")?e.toString():`${e.name}: ${e.message}; + ${e.stack}`}function cme(e,t){if(e===null)return"null";if(e instanceof Error)return e.name==="AggregateError"?P1(e)+` +`+F1(e.errors,t):P1(e);if(t.includes(e))return"[Circular]";let n=[...t,e];if(lme(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:wh(r,n)}else if(Array.isArray(e))return F1(e,n);return dme(e,n)}function lme(e){return typeof e.toJSON=="function"}function dme(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>3?"["+pme(e)+"]":"{ "+n.map(([i,a])=>i+": "+wh(a,t)).join(", ")+" }"}function F1(e,t){if(e.length===0)return"[]";if(t.length>3)return"[Array]";let n=e.length,r=[];for(let i=0;ifme.includes(t))}function Pd(e,t){t!=null&&t.originalError&&!(t.originalError instanceof Error)&&mme(t.originalError)&&(t.originalError=Pd(t.originalError.message,t.originalError));let n=Vf.GraphQLError,r=Vf.versionInfo.major>=16?new n(e,t):new n(e,t==null?void 0:t.nodes,t==null?void 0:t.source,t==null?void 0:t.positions,t==null?void 0:t.path,t==null?void 0:t.originalError,t==null?void 0:t.extensions);return t!=null&&t.coordinate&&r.coordinate==null&&Object.defineProperties(r,{coordinate:{value:t.coordinate,enumerable:!0,configurable:!0}}),r}m();T();N();function L1(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e}function w1(e){return typeof e=="object"&&e!==null}function C1(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function U1(e,t,n={}){var o;let r={},a=((o=t.arguments)!=null?o:[]).reduce((u,l)=>W(q({},u),{[l.name.value]:l}),{});for(let{name:u,type:l,defaultValue:d}of e.args){let p=a[u];if(!p){if(d!==void 0)r[u]=d;else if((0,La.isNonNullType)(l))throw Pd(`Argument "${u}" of required type "${Ju(l)}" was not provided.`,{nodes:[t]});continue}let E=p.value,h=E.kind===La.Kind.NULL;if(E.kind===La.Kind.VARIABLE){let S=E.name.value;if(n==null||!C1(n,S)){if(d!==void 0)r[u]=d;else if((0,La.isNonNullType)(l))throw Pd(`Argument "${u}" of required type "${Ju(l)}" was provided the variable "$${S}" which was not provided a runtime value.`,{nodes:[E]});continue}h=n[S]==null}if(h&&(0,La.isNonNullType)(l))throw Pd(`Argument "${u}" of non-null type "${Ju(l)}" must not be null.`,{nodes:[E]});let _=(0,La.valueFromAST)(E,l,n);if(_===void 0)throw Pd(`Argument "${u}" has invalid value ${(0,La.print)(E)}.`,{nodes:[E]});r[u]=_}return r}m();T();N();function Fd(e){let t=new WeakMap;return function(r){let i=t.get(r);if(i===void 0){let a=e(r);return t.set(r,a),a}return i}}function B1(e,t,n=["directives"]){var o;let r={};if(e.extensions){let u=e.extensions;for(let l of n)u=u==null?void 0:u[l];if(u!=null)for(let l in u){let d=u[l],p=l;if(Array.isArray(d))for(let E of d){let h=r[p];h||(h=[],r[p]=h),h.push(E)}else{let E=r[p];E||(E=[],r[p]=E),E.push(d)}}}let i=Fd(u=>JSON.stringify(u)),a=[];e.astNode&&a.push(e.astNode),e.extensionASTNodes&&a.push(...e.extensionASTNodes);for(let u of a)if((o=u.directives)!=null&&o.length)for(let l of u.directives){let d=l.name.value,p=r[d];p||(p=[],r[d]=p);let E=t==null?void 0:t.getDirective(d),h={};if(E&&(h=U1(E,l)),l.arguments)for(let _ of l.arguments){let S=_.name.value;if(h[S]==null){let k=E==null?void 0:E.args.find(B=>B.name===S);k&&(h[S]=(0,Ch.valueFromAST)(_.value,k.type))}h[S]==null&&(h[S]=(0,Ch.valueFromASTUntyped)(_.value))}if(a.length>0&&p.length>0){let _=i(h);if(p.some(S=>i(S)===_))continue}p.push(h)}return r}function $b(e,t=["directives"]){let n=B1(e,void 0,t);return Object.entries(n).map(([r,i])=>i==null?void 0:i.map(a=>({name:r,args:a}))).flat(1/0).filter(Boolean)}m();T();N();var ze=gi(Oe(),1);m();T();N();var ls=gi(Oe(),1);function ds(e){if((0,ls.isNonNullType)(e)){let t=ds(e.ofType);if(t.kind===ls.Kind.NON_NULL_TYPE)throw new Error(`Invalid type node ${Ju(e)}. Inner type of non-null type cannot be a non-null type.`);return{kind:ls.Kind.NON_NULL_TYPE,type:t}}else if((0,ls.isListType)(e))return{kind:ls.Kind.LIST_TYPE,type:ds(e.ofType)};return{kind:ls.Kind.NAMED_TYPE,name:{kind:ls.Kind.NAME,value:e.name}}}m();T();N();var Nr=gi(Oe(),1);m();T();N();var wa=gi(Oe(),1);function al(e){if(e===null)return{kind:wa.Kind.NULL};if(e===void 0)return null;if(Array.isArray(e)){let t=[];for(let n of e){let r=al(n);r!=null&&t.push(r)}return{kind:wa.Kind.LIST,values:t}}if(typeof e=="object"){if(e!=null&&e.toJSON)return al(e.toJSON());let t=[];for(let n in e){let r=e[n],i=al(r);i&&t.push({kind:wa.Kind.OBJECT_FIELD,name:{kind:wa.Kind.NAME,value:n},value:i})}return{kind:wa.Kind.OBJECT,fields:t}}if(typeof e=="boolean")return{kind:wa.Kind.BOOLEAN,value:e};if(typeof e=="bigint")return{kind:wa.Kind.INT,value:String(e)};if(typeof e=="number"&&isFinite(e)){let t=String(e);return Nme.test(t)?{kind:wa.Kind.INT,value:t}:{kind:wa.Kind.FLOAT,value:t}}if(typeof e=="string")return{kind:wa.Kind.STRING,value:e};throw new TypeError(`Cannot convert value to AST: ${e}.`)}var Nme=/^-?(?:0|[1-9][0-9]*)$/;function Hu(e,t){if((0,Nr.isNonNullType)(t)){let n=Hu(e,t.ofType);return(n==null?void 0:n.kind)===Nr.Kind.NULL?null:n}if(e===null)return{kind:Nr.Kind.NULL};if(e===void 0)return null;if((0,Nr.isListType)(t)){let n=t.ofType;if(L1(e)){let r=[];for(let i of e){let a=Hu(i,n);a!=null&&r.push(a)}return{kind:Nr.Kind.LIST,values:r}}return Hu(e,n)}if((0,Nr.isInputObjectType)(t)){if(!w1(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=Hu(e[r.name],r.type);i&&n.push({kind:Nr.Kind.OBJECT_FIELD,name:{kind:Nr.Kind.NAME,value:r.name},value:i})}return{kind:Nr.Kind.OBJECT,fields:n}}if((0,Nr.isLeafType)(t)){let n=t.serialize(e);return n==null?null:(0,Nr.isEnumType)(t)?{kind:Nr.Kind.ENUM,value:n}:t.name==="ID"&&typeof n=="string"&&Tme.test(n)?{kind:Nr.Kind.INT,value:n}:al(n)}console.assert(!1,"Unexpected input type: "+Ju(t))}var Tme=/^-?(?:0|[1-9][0-9]*)$/;m();T();N();var k1=gi(Oe(),1);function bi(e){var t;if((t=e.astNode)!=null&&t.description)return W(q({},e.astNode.description),{block:!0});if(e.description)return{kind:k1.Kind.STRING,value:e.description,block:!0}}m();T();N();var gKe=Fd(function(t){let n=Eme(t);return new Set([...n].map(r=>r.name))}),Eme=Fd(function(t){let n=Gb(t);return new Set(n.values())}),Gb=Fd(function(t){let n=new Map,r=t.getQueryType();r&&n.set("query",r);let i=t.getMutationType();i&&n.set("mutation",i);let a=t.getSubscriptionType();return a&&n.set("subscription",a),n});function hme(e,t={}){let n=t.pathToDirectivesInExtensions,r=e.getTypeMap(),i=yme(e,n),a=i!=null?[i]:[],o=e.getDirectives();for(let u of o)(0,ze.isSpecifiedDirective)(u)||a.push(Ime(u,e,n));for(let u in r){let l=r[u],d=(0,ze.isSpecifiedScalarType)(l),p=(0,ze.isIntrospectionType)(l);if(!(d||p))if((0,ze.isObjectType)(l))a.push(gme(l,e,n));else if((0,ze.isInterfaceType)(l))a.push(_me(l,e,n));else if((0,ze.isUnionType)(l))a.push(vme(l,e,n));else if((0,ze.isInputObjectType)(l))a.push(Sme(l,e,n));else if((0,ze.isEnumType)(l))a.push(Ome(l,e,n));else if((0,ze.isScalarType)(l))a.push(Dme(l,e,n));else throw new Error(`Unknown type ${l}.`)}return{kind:ze.Kind.DOCUMENT,definitions:a}}function M1(e,t={}){let n=hme(e,t);return(0,ze.print)(n)}function yme(e,t){let n=new Map([["query",void 0],["mutation",void 0],["subscription",void 0]]),r=[];if(e.astNode!=null&&r.push(e.astNode),e.extensionASTNodes!=null)for(let d of e.extensionASTNodes)r.push(d);for(let d of r)if(d.operationTypes)for(let p of d.operationTypes)n.set(p.operation,p);let i=Gb(e);for(let[d,p]of n){let E=i.get(d);if(E!=null){let h=ds(E);p!=null?p.type=h:n.set(d,{kind:ze.Kind.OPERATION_TYPE_DEFINITION,operation:d,type:h})}}let a=[...n.values()].filter(R1),o=ps(e,e,t);if(!a.length&&!o.length)return null;let u={kind:a.length?ze.Kind.SCHEMA_DEFINITION:ze.Kind.SCHEMA_EXTENSION,operationTypes:a,directives:o},l=bi(e);return l&&(u.description=l),u}function Ime(e,t,n){var r,i;return{kind:ze.Kind.DIRECTIVE_DEFINITION,description:bi(e),name:{kind:ze.Kind.NAME,value:e.name},arguments:(r=e.args)==null?void 0:r.map(a=>x1(a,t,n)),repeatable:e.isRepeatable,locations:((i=e.locations)==null?void 0:i.map(a=>({kind:ze.Kind.NAME,value:a})))||[]}}function ps(e,t,n){let r=[],i=$b(e,n),a;i!=null&&(a=V1(t,i));let o=null,u=null,l=null;if(a!=null&&(r=a.filter(d=>ze.specifiedDirectives.every(p=>p.name!==d.name.value)),o=a.find(d=>d.name.value==="deprecated"),u=a.find(d=>d.name.value==="specifiedBy"),l=a.find(d=>d.name.value==="oneOf")),e.deprecationReason!=null&&o==null&&(o=Rme(e.deprecationReason)),e.specifiedByUrl!=null||e.specifiedByURL!=null&&u==null){let p={url:e.specifiedByUrl||e.specifiedByURL};u=Kf("specifiedBy",p)}return e.isOneOf&&l==null&&(l=Kf("oneOf")),o!=null&&r.push(o),u!=null&&r.push(u),l!=null&&r.push(l),r}function x1(e,t,n){var r;return{kind:ze.Kind.INPUT_VALUE_DEFINITION,description:bi(e),name:{kind:ze.Kind.NAME,value:e.name},type:ds(e.type),defaultValue:e.defaultValue!==void 0&&(r=Hu(e.defaultValue,e.type))!=null?r:void 0,directives:ps(e,t,n)}}function gme(e,t,n){return{kind:ze.Kind.OBJECT_TYPE_DEFINITION,description:bi(e),name:{kind:ze.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(r=>q1(r,t,n)),interfaces:Object.values(e.getInterfaces()).map(r=>ds(r)),directives:ps(e,t,n)}}function _me(e,t,n){let r={kind:ze.Kind.INTERFACE_TYPE_DEFINITION,description:bi(e),name:{kind:ze.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(i=>q1(i,t,n)),directives:ps(e,t,n)};return"getInterfaces"in e&&(r.interfaces=Object.values(e.getInterfaces()).map(i=>ds(i))),r}function vme(e,t,n){return{kind:ze.Kind.UNION_TYPE_DEFINITION,description:bi(e),name:{kind:ze.Kind.NAME,value:e.name},directives:ps(e,t,n),types:e.getTypes().map(r=>ds(r))}}function Sme(e,t,n){return{kind:ze.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:bi(e),name:{kind:ze.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(r=>bme(r,t,n)),directives:ps(e,t,n)}}function Ome(e,t,n){return{kind:ze.Kind.ENUM_TYPE_DEFINITION,description:bi(e),name:{kind:ze.Kind.NAME,value:e.name},values:Object.values(e.getValues()).map(r=>Ame(r,t,n)),directives:ps(e,t,n)}}function Dme(e,t,n){let r=$b(e,n),i=V1(t,r),a=e.specifiedByUrl||e.specifiedByURL;if(a&&!i.some(o=>o.name.value==="specifiedBy")){let o={url:a};i.push(Kf("specifiedBy",o))}return{kind:ze.Kind.SCALAR_TYPE_DEFINITION,description:bi(e),name:{kind:ze.Kind.NAME,value:e.name},directives:i}}function q1(e,t,n){return{kind:ze.Kind.FIELD_DEFINITION,description:bi(e),name:{kind:ze.Kind.NAME,value:e.name},arguments:e.args.map(r=>x1(r,t,n)),type:ds(e.type),directives:ps(e,t,n)}}function bme(e,t,n){var r;return{kind:ze.Kind.INPUT_VALUE_DEFINITION,description:bi(e),name:{kind:ze.Kind.NAME,value:e.name},type:ds(e.type),directives:ps(e,t,n),defaultValue:(r=Hu(e.defaultValue,e.type))!=null?r:void 0}}function Ame(e,t,n){return{kind:ze.Kind.ENUM_VALUE_DEFINITION,description:bi(e),name:{kind:ze.Kind.NAME,value:e.name},directives:ps(e,t,n)}}function Rme(e){return Kf("deprecated",{reason:e},ze.GraphQLDeprecatedDirective)}function Kf(e,t,n){let r=[];for(let i in t){let a=t[i],o;if(n!=null){let u=n.args.find(l=>l.name===i);u&&(o=Hu(a,u.type))}o==null&&(o=al(a)),o!=null&&r.push({kind:ze.Kind.ARGUMENT,name:{kind:ze.Kind.NAME,value:i},value:o})}return{kind:ze.Kind.DIRECTIVE,name:{kind:ze.Kind.NAME,value:e},arguments:r}}function V1(e,t){let n=[];for(let{name:r,args:i}of t){let a=e==null?void 0:e.getDirective(r);n.push(Kf(r,i,a))}return n}var qd=gi(Lh(),1);m();T();N();m();T();N();m();T();N();m();T();N();m();T();N();m();T();N();function mn(e,t){if(!e)throw new Error(t)}var Pme=34028234663852886e22,Fme=-34028234663852886e22,Lme=4294967295,wme=2147483647,Cme=-2147483648;function Ld(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>wme||eLme||e<0)throw new Error("invalid uint 32: "+e)}function Uh(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>Pme||e({no:i.no,name:i.name,localName:e[i.no]})),r)}function Yb(e,t,n){let r=Object.create(null),i=Object.create(null),a=[];for(let o of t){let u=G1(o);a.push(u),r[o.name]=u,i[o.no]=u}return{typeName:e,values:a,findName(o){return r[o]},findNumber(o){return i[o]}}}function $1(e,t,n){let r={};for(let i of t){let a=G1(i);r[a.localName]=a.no,r[a.no]=a.localName}return Qb(r,e,t,n),r}function G1(e){return"localName"in e?e:Object.assign(Object.assign({},e),{localName:e.name})}m();T();N();m();T();N();var be=class{equals(t){return this.getType().runtime.util.equals(this.getType(),this,t)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(t,n){let r=this.getType(),i=r.runtime.bin,a=i.makeReadOptions(n);return i.readMessage(this,a.readerFactory(t),t.byteLength,a),this}fromJson(t,n){let r=this.getType(),i=r.runtime.json,a=i.makeReadOptions(n);return i.readMessage(r,t,a,this),this}fromJsonString(t,n){let r;try{r=JSON.parse(t)}catch(i){throw new Error(`cannot decode ${this.getType().typeName} from JSON: ${i instanceof Error?i.message:String(i)}`)}return this.fromJson(r,n)}toBinary(t){let n=this.getType(),r=n.runtime.bin,i=r.makeWriteOptions(t),a=i.writerFactory();return r.writeMessage(this,a,i),a.finish()}toJson(t){let n=this.getType(),r=n.runtime.json,i=r.makeWriteOptions(t);return r.writeMessage(this,i)}toJsonString(t){var n;let r=this.toJson(t);return JSON.stringify(r,null,(n=t==null?void 0:t.prettySpaces)!==null&&n!==void 0?n:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}};function Q1(e,t,n,r){var i;let a=(i=r==null?void 0:r.localName)!==null&&i!==void 0?i:t.substring(t.lastIndexOf(".")+1),o={[a]:function(u){e.util.initFields(this),e.util.initPartial(u,this)}}[a];return Object.setPrototypeOf(o.prototype,new be),Object.assign(o,{runtime:e,typeName:t,fields:e.util.newFieldList(n),fromBinary(u,l){return new o().fromBinary(u,l)},fromJson(u,l){return new o().fromJson(u,l)},fromJsonString(u,l){return new o().fromJsonString(u,l)},equals(u,l){return e.util.equals(o,u,l)}}),o}m();T();N();m();T();N();m();T();N();m();T();N();function J1(){let e=0,t=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<>4,!(n&128))return this.assertBounds(),[e,t];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(t|=(i&127)<>>a,u=!(!(o>>>7)&&t==0),l=(u?o|128:o)&255;if(n.push(l),!u)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),!!i){for(let a=3;a<31;a=a+7){let o=t>>>a,u=!!(o>>>7),l=(u?o|128:o)&255;if(n.push(l),!u)return}n.push(t>>>31&1)}}var Bh=4294967296;function Jb(e){let t=e[0]==="-";t&&(e=e.slice(1));let n=1e6,r=0,i=0;function a(o,u){let l=Number(e.slice(o,u));i*=n,r=r*n+l,r>=Bh&&(i=i+(r/Bh|0),r=r%Bh)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?z1(r,i):zb(r,i)}function H1(e,t){let n=zb(e,t),r=n.hi&2147483648;r&&(n=z1(n.lo,n.hi));let i=Hb(n.lo,n.hi);return r?"-"+i:i}function Hb(e,t){if({lo:e,hi:t}=Ume(e,t),t<=2097151)return String(Bh*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,u=i*2,l=1e7;return a>=l&&(o+=Math.floor(a/l),a%=l),o>=l&&(u+=Math.floor(o/l),o%=l),u.toString()+Y1(o)+Y1(a)}function Ume(e,t){return{lo:e>>>0,hi:t>>>0}}function zb(e,t){return{lo:e|0,hi:t|0}}function z1(e,t){return t=~t,e?e=~e+1:t+=1,zb(e,t)}var Y1=e=>{let t=String(e);return"0000000".slice(t.length)+t};function Wb(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e=e>>7;t.push(1)}}function W1(){let e=this.buf[this.pos++],t=e&127;if(!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let n=5;e&128&&n<10;n++)e=this.buf[this.pos++];if(e&128)throw new Error("invalid varint");return this.assertBounds(),t>>>0}function Bme(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(typeof D!="object"||typeof D.env!="object"||D.env.BUF_BIGINT_DISABLE!=="1")){let i=BigInt("-9223372036854775808"),a=BigInt("9223372036854775807"),o=BigInt("0"),u=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(l){let d=typeof l=="bigint"?l:BigInt(l);if(d>a||du||dmn(/^-?[0-9]+$/.test(i),`int64 invalid: ${i}`),r=i=>mn(/^[0-9]+$/.test(i),`uint64 invalid: ${i}`);return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),n(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),r(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),n(i),Jb(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),r(i),Jb(i)},dec(i,a){return H1(i,a)},uDec(i,a){return Hb(i,a)}}}var Ln=Bme();m();T();N();var Ee;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(Ee||(Ee={}));var Ca;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING"})(Ca||(Ca={}));function Vs(e,t,n){if(t===n)return!0;if(e==Ee.BYTES){if(!(t instanceof Uint8Array)||!(n instanceof Uint8Array)||t.length!==n.length)return!1;for(let r=0;r>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(jf(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return Ld(t),Wb(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let n=this.textEncoder.encode(t);return this.uint32(n.byteLength),this.raw(n)}float(t){Uh(t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,t,!0),this.raw(n)}double(t){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,t,!0),this.raw(n)}fixed32(t){jf(t);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t,!0),this.raw(n)}sfixed32(t){Ld(t);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),this.raw(n)}sint32(t){return Ld(t),t=(t<<1^t>>31)>>>0,Wb(t,this.buf),this}sfixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=Ln.enc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}fixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=Ln.uEnc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}int64(t){let n=Ln.enc(t);return kh(n.lo,n.hi,this.buf),this}sint64(t){let n=Ln.enc(t),r=n.hi>>31,i=n.lo<<1^r,a=(n.hi<<1|n.lo>>>31)^r;return kh(i,a,this.buf),this}uint64(t){let n=Ln.uEnc(t);return kh(n.lo,n.hi,this.buf),this}},qh=class{constructor(t,n){this.varint64=J1,this.uint32=W1,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=n!=null?n:new TextDecoder}tag(){let t=this.uint32(),n=t>>>3,r=t&7;if(n<=0||r<0||r>5)throw new Error("illegal tag: field no "+n+" wire type "+r);return[n,r]}skip(t){let n=this.pos;switch(t){case jn.Varint:for(;this.buf[this.pos++]&128;);break;case jn.Bit64:this.pos+=4;case jn.Bit32:this.pos+=4;break;case jn.LengthDelimited:let r=this.uint32();this.pos+=r;break;case jn.StartGroup:let i;for(;(i=this.tag()[1])!==jn.EndGroup;)this.skip(i);break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return Ln.dec(...this.varint64())}uint64(){return Ln.uDec(...this.varint64())}sint64(){let[t,n]=this.varint64(),r=-(t&1);return t=(t>>>1|(n&1)<<31)^r,n=n>>>1^r,Ln.dec(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Ln.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Ln.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),n=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(n,n+t)}string(){return this.textDecoder.decode(this.bytes())}};function X1(e,t,n,r){let i;return{typeName:t,extendee:n,get field(){if(!i){let a=typeof r=="function"?r():r;a.name=t.split(".").pop(),a.jsonName=`[${t}]`,i=e.util.newFieldList([a]).list()[0]}return i},runtime:e}}function Vh(e){let t=e.field.localName,n=Object.create(null);return n[t]=kme(e),[n,()=>n[t]]}function kme(e){let t=e.field;if(t.repeated)return[];if(t.default!==void 0)return t.default;switch(t.kind){case"enum":return t.T.values[0].no;case"scalar":return Ua(t.T,t.L);case"message":let n=t.T,r=new n;return n.fieldWrapper?n.fieldWrapper.unwrapField(r):r;case"map":throw"map fields are not allowed to be extensions"}}function Z1(e,t){if(!t.repeated&&(t.kind=="enum"||t.kind=="scalar")){for(let n=e.length-1;n>=0;--n)if(e[n].no==t.no)return[e[n]];return[]}return e.filter(n=>n.no===t.no)}m();T();N();m();T();N();var Ks="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Kh=[];for(let e=0;e>4,o=a,i=2;break;case 2:n[r++]=(o&15)<<4|(a&60)>>2,o=a,i=3;break;case 3:n[r++]=(o&3)<<6|a,i=0;break}}if(i==1)throw Error("invalid base64 string.");return n.subarray(0,r)},enc(e){let t="",n=0,r,i=0;for(let a=0;a>2],i=(r&3)<<4,n=1;break;case 1:t+=Ks[i|r>>4],i=(r&15)<<2,n=2;break;case 2:t+=Ks[i|r>>6],t+=Ks[r&63],n=0;break}return n&&(t+=Ks[i],t+="=",n==1&&(t+="=")),t}};m();T();N();function ej(e,t,n){nj(t,e);let r=t.runtime.bin.makeReadOptions(n),i=Z1(e.getType().runtime.bin.listUnknownFields(e),t.field),[a,o]=Vh(t);for(let u of i)t.runtime.bin.readField(a,r.readerFactory(u.data),t.field,u.wireType,r);return o()}function tj(e,t,n,r){nj(t,e);let i=t.runtime.bin.makeReadOptions(r),a=t.runtime.bin.makeWriteOptions(r);if(Zb(e,t)){let d=e.getType().runtime.bin.listUnknownFields(e).filter(p=>p.no!=t.field.no);e.getType().runtime.bin.discardUnknownFields(e);for(let p of d)e.getType().runtime.bin.onUnknownField(e,p.no,p.wireType,p.data)}let o=a.writerFactory(),u=t.field;!u.opt&&!u.repeated&&(u.kind=="enum"||u.kind=="scalar")&&(u=Object.assign(Object.assign({},t.field),{opt:!0})),t.runtime.bin.writeField(u,n,o,a);let l=i.readerFactory(o.finish());for(;l.posr.no==t.field.no)}function nj(e,t){mn(e.extendee.typeName==t.getType().typeName,`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}m();T();N();function jh(e,t){let n=e.localName;if(e.repeated)return t[n].length>0;if(e.oneof)return t[e.oneof.localName].case===n;switch(e.kind){case"enum":case"scalar":return e.opt||e.req?t[n]!==void 0:e.kind=="enum"?t[n]!==e.T.values[0].no:!Mh(e.T,t[n]);case"message":return t[n]!==void 0;case"map":return Object.keys(t[n]).length>0}}function eA(e,t){let n=e.localName,r=!e.opt&&!e.req;if(e.repeated)t[n]=[];else if(e.oneof)t[e.oneof.localName]={case:void 0};else switch(e.kind){case"map":t[n]={};break;case"enum":t[n]=r?e.T.values[0].no:void 0;break;case"scalar":t[n]=r?Ua(e.T,e.L):void 0;break;case"message":t[n]=void 0;break}}m();T();N();m();T();N();function Ba(e,t){if(e===null||typeof e!="object"||!Object.getOwnPropertyNames(be.prototype).every(r=>r in e&&typeof e[r]=="function"))return!1;let n=e.getType();return n===null||typeof n!="function"||!("typeName"in n)||typeof n.typeName!="string"?!1:t===void 0?!0:n.typeName==t.typeName}function $h(e,t){return Ba(t)||!e.fieldWrapper?t:e.fieldWrapper.wrapField(t)}var nje={"google.protobuf.DoubleValue":Ee.DOUBLE,"google.protobuf.FloatValue":Ee.FLOAT,"google.protobuf.Int64Value":Ee.INT64,"google.protobuf.UInt64Value":Ee.UINT64,"google.protobuf.Int32Value":Ee.INT32,"google.protobuf.UInt32Value":Ee.UINT32,"google.protobuf.BoolValue":Ee.BOOL,"google.protobuf.StringValue":Ee.STRING,"google.protobuf.BytesValue":Ee.BYTES};var rj={ignoreUnknownFields:!1},ij={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function Mme(e){return e?Object.assign(Object.assign({},rj),e):rj}function xme(e){return e?Object.assign(Object.assign({},ij),e):ij}var Yh=Symbol(),Gh=Symbol();function oj(){return{makeReadOptions:Mme,makeWriteOptions:xme,readMessage(e,t,n,r){if(t==null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message ${e.typeName} from JSON: ${fs(t)}`);r=r!=null?r:new e;let i=new Map,a=n.typeRegistry;for(let[o,u]of Object.entries(t)){let l=e.fields.findJsonName(o);if(l){if(l.oneof){if(u===null&&l.kind=="scalar")continue;let d=i.get(l.oneof);if(d!==void 0)throw new Error(`cannot decode message ${e.typeName} from JSON: multiple keys for oneof "${l.oneof.name}" present: "${d}", "${o}"`);i.set(l.oneof,o)}aj(r,u,l,n,e)}else{let d=!1;if(a!=null&&a.findExtension&&o.startsWith("[")&&o.endsWith("]")){let p=a.findExtension(o.substring(1,o.length-1));if(p&&p.extendee.typeName==e.typeName){d=!0;let[E,h]=Vh(p);aj(E,u,p.field,n,p),tj(r,p,h(),n)}}if(!d&&!n.ignoreUnknownFields)throw new Error(`cannot decode message ${e.typeName} from JSON: key "${o}" is unknown`)}}return r},writeMessage(e,t){let n=e.getType(),r={},i;try{for(i of n.fields.byNumber()){if(!jh(i,e)){if(i.req)throw"required field not set";if(!t.emitDefaultValues||!Vme(i))continue}let o=i.oneof?e[i.oneof.localName].value:e[i.localName],u=sj(i,o,t);u!==void 0&&(r[t.useProtoFieldName?i.name:i.jsonName]=u)}let a=t.typeRegistry;if(a!=null&&a.findExtensionFor)for(let o of n.runtime.bin.listUnknownFields(e)){let u=a.findExtensionFor(n.typeName,o.no);if(u&&Zb(e,u)){let l=ej(e,u,t),d=sj(u.field,l,t);d!==void 0&&(r[u.field.jsonName]=d)}}}catch(a){let o=i?`cannot encode field ${n.typeName}.${i.name} to JSON`:`cannot encode message ${n.typeName} to JSON`,u=a instanceof Error?a.message:String(a);throw new Error(o+(u.length>0?`: ${u}`:""))}return r},readScalar(e,t,n){return $f(e,t,n!=null?n:Ca.BIGINT,!0)},writeScalar(e,t,n){if(t!==void 0&&(n||Mh(e,t)))return Qh(e,t)},debug:fs}}function fs(e){if(e===null)return"null";switch(typeof e){case"object":return Array.isArray(e)?"array":"object";case"string":return e.length>100?"string":`"${e.split('"').join('\\"')}"`;default:return String(e)}}function aj(e,t,n,r,i){let a=n.localName;if(n.repeated){if(mn(n.kind!="map"),t===null)return;if(!Array.isArray(t))throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: ${fs(t)}`);let o=e[a];for(let u of t){if(u===null)throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: ${fs(u)}`);switch(n.kind){case"message":o.push(n.T.fromJson(u,r));break;case"enum":let l=tA(n.T,u,r.ignoreUnknownFields,!0);l!==Gh&&o.push(l);break;case"scalar":try{o.push($f(n.T,u,n.L,!0))}catch(d){let p=`cannot decode field ${i.typeName}.${n.name} from JSON: ${fs(u)}`;throw d instanceof Error&&d.message.length>0&&(p+=`: ${d.message}`),new Error(p)}break}}}else if(n.kind=="map"){if(t===null)return;if(typeof t!="object"||Array.isArray(t))throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: ${fs(t)}`);let o=e[a];for(let[u,l]of Object.entries(t)){if(l===null)throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: map value null`);let d;try{d=qme(n.K,u)}catch(p){let E=`cannot decode map key for field ${i.typeName}.${n.name} from JSON: ${fs(t)}`;throw p instanceof Error&&p.message.length>0&&(E+=`: ${p.message}`),new Error(E)}switch(n.V.kind){case"message":o[d]=n.V.T.fromJson(l,r);break;case"enum":let p=tA(n.V.T,l,r.ignoreUnknownFields,!0);p!==Gh&&(o[d]=p);break;case"scalar":try{o[d]=$f(n.V.T,l,Ca.BIGINT,!0)}catch(E){let h=`cannot decode map value for field ${i.typeName}.${n.name} from JSON: ${fs(t)}`;throw E instanceof Error&&E.message.length>0&&(h+=`: ${E.message}`),new Error(h)}break}}}else switch(n.oneof&&(e=e[n.oneof.localName]={case:a},a="value"),n.kind){case"message":let o=n.T;if(t===null&&o.typeName!="google.protobuf.Value")return;let u=e[a];Ba(u)?u.fromJson(t,r):(e[a]=u=o.fromJson(t,r),o.fieldWrapper&&!n.oneof&&(e[a]=o.fieldWrapper.unwrapField(u)));break;case"enum":let l=tA(n.T,t,r.ignoreUnknownFields,!1);switch(l){case Yh:eA(n,e);break;case Gh:break;default:e[a]=l;break}break;case"scalar":try{let d=$f(n.T,t,n.L,!1);switch(d){case Yh:eA(n,e);break;default:e[a]=d;break}}catch(d){let p=`cannot decode field ${i.typeName}.${n.name} from JSON: ${fs(t)}`;throw d instanceof Error&&d.message.length>0&&(p+=`: ${d.message}`),new Error(p)}break}}function qme(e,t){if(e===Ee.BOOL)switch(t){case"true":t=!0;break;case"false":t=!1;break}return $f(e,t,Ca.BIGINT,!0).toString()}function $f(e,t,n,r){if(t===null)return r?Ua(e,n):Yh;switch(e){case Ee.DOUBLE:case Ee.FLOAT:if(t==="NaN")return Number.NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(t===""||typeof t=="string"&&t.trim().length!==t.length||typeof t!="string"&&typeof t!="number")break;let i=Number(t);if(Number.isNaN(i)||!Number.isFinite(i))break;return e==Ee.FLOAT&&Uh(i),i;case Ee.INT32:case Ee.FIXED32:case Ee.SFIXED32:case Ee.SINT32:case Ee.UINT32:let a;if(typeof t=="number"?a=t:typeof t=="string"&&t.length>0&&t.trim().length===t.length&&(a=Number(t)),a===void 0)break;return e==Ee.UINT32||e==Ee.FIXED32?jf(a):Ld(a),a;case Ee.INT64:case Ee.SFIXED64:case Ee.SINT64:if(typeof t!="number"&&typeof t!="string")break;let o=Ln.parse(t);return n?o.toString():o;case Ee.FIXED64:case Ee.UINT64:if(typeof t!="number"&&typeof t!="string")break;let u=Ln.uParse(t);return n?u.toString():u;case Ee.BOOL:if(typeof t!="boolean")break;return t;case Ee.STRING:if(typeof t!="string")break;try{encodeURIComponent(t)}catch(l){throw new Error("invalid UTF8")}return t;case Ee.BYTES:if(t==="")return new Uint8Array(0);if(typeof t!="string")break;return Xb.dec(t)}throw new Error}function tA(e,t,n,r){if(t===null)return e.typeName=="google.protobuf.NullValue"?0:r?e.values[0].no:Yh;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":let i=e.findName(t);if(i!==void 0)return i.no;if(n)return Gh;break}throw new Error(`cannot decode enum ${e.typeName} from JSON: ${fs(t)}`)}function Vme(e){return e.repeated||e.kind=="map"?!0:!(e.oneof||e.kind=="message"||e.opt||e.req)}function sj(e,t,n){if(e.kind=="map"){mn(typeof t=="object"&&t!=null);let r={},i=Object.entries(t);switch(e.V.kind){case"scalar":for(let[o,u]of i)r[o.toString()]=Qh(e.V.T,u);break;case"message":for(let[o,u]of i)r[o.toString()]=u.toJson(n);break;case"enum":let a=e.V.T;for(let[o,u]of i)r[o.toString()]=nA(a,u,n.enumAsInteger);break}return n.emitDefaultValues||i.length>0?r:void 0}if(e.repeated){mn(Array.isArray(t));let r=[];switch(e.kind){case"scalar":for(let i=0;i0?r:void 0}switch(e.kind){case"scalar":return Qh(e.T,t);case"enum":return nA(e.T,t,n.enumAsInteger);case"message":return $h(e.T,t).toJson(n)}}function nA(e,t,n){var r;if(mn(typeof t=="number"),e.typeName=="google.protobuf.NullValue")return null;if(n)return t;let i=e.findNumber(t);return(r=i==null?void 0:i.name)!==null&&r!==void 0?r:t}function Qh(e,t){switch(e){case Ee.INT32:case Ee.SFIXED32:case Ee.SINT32:case Ee.FIXED32:case Ee.UINT32:return mn(typeof t=="number"),t;case Ee.FLOAT:case Ee.DOUBLE:return mn(typeof t=="number"),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case Ee.STRING:return mn(typeof t=="string"),t;case Ee.BOOL:return mn(typeof t=="boolean"),t;case Ee.UINT64:case Ee.FIXED64:case Ee.INT64:case Ee.SFIXED64:case Ee.SINT64:return mn(typeof t=="bigint"||typeof t=="string"||typeof t=="number"),t.toString();case Ee.BYTES:return mn(t instanceof Uint8Array),Xb.enc(t)}}m();T();N();var wd=Symbol("@bufbuild/protobuf/unknown-fields"),uj={readUnknownFields:!0,readerFactory:e=>new qh(e)},cj={writeUnknownFields:!0,writerFactory:()=>new xh};function Kme(e){return e?Object.assign(Object.assign({},uj),e):uj}function jme(e){return e?Object.assign(Object.assign({},cj),e):cj}function fj(){return{makeReadOptions:Kme,makeWriteOptions:jme,listUnknownFields(e){var t;return(t=e[wd])!==null&&t!==void 0?t:[]},discardUnknownFields(e){delete e[wd]},writeUnknownFields(e,t){let r=e[wd];if(r)for(let i of r)t.tag(i.no,i.wireType).raw(i.data)},onUnknownField(e,t,n,r){let i=e;Array.isArray(i[wd])||(i[wd]=[]),i[wd].push({no:t,wireType:n,data:r})},readMessage(e,t,n,r,i){let a=e.getType(),o=i?t.len:t.pos+n,u,l;for(;t.pos0&&(l=Gme),a){let h=e[o];if(r==jn.LengthDelimited&&u!=Ee.STRING&&u!=Ee.BYTES){let S=t.uint32()+t.pos;for(;t.posBa(h,E)?h:new E(h));else{let h=o[i];E.fieldWrapper?E.typeName==="google.protobuf.BytesValue"?a[i]=Qf(h):a[i]=h:a[i]=Ba(h,E)?h:new E(h)}break}}},equals(e,t,n){return t===n?!0:!t||!n?!1:e.fields.byMember().every(r=>{let i=t[r.localName],a=n[r.localName];if(r.repeated){if(i.length!==a.length)return!1;switch(r.kind){case"message":return i.every((o,u)=>r.T.equals(o,a[u]));case"scalar":return i.every((o,u)=>Vs(r.T,o,a[u]));case"enum":return i.every((o,u)=>Vs(Ee.INT32,o,a[u]))}throw new Error(`repeated cannot contain ${r.kind}`)}switch(r.kind){case"message":return r.T.equals(i,a);case"enum":return Vs(Ee.INT32,i,a);case"scalar":return Vs(r.T,i,a);case"oneof":if(i.case!==a.case)return!1;let o=r.findField(i.case);if(o===void 0)return!0;switch(o.kind){case"message":return o.T.equals(i.value,a.value);case"enum":return Vs(Ee.INT32,i.value,a.value);case"scalar":return Vs(o.T,i.value,a.value)}throw new Error(`oneof cannot contain ${o.kind}`);case"map":let u=Object.keys(i).concat(Object.keys(a));switch(r.V.kind){case"message":let l=r.V.T;return u.every(p=>l.equals(i[p],a[p]));case"enum":return u.every(p=>Vs(Ee.INT32,i[p],a[p]));case"scalar":let d=r.V.T;return u.every(p=>Vs(d,i[p],a[p]))}break}})},clone(e){let t=e.getType(),n=new t,r=n;for(let i of t.fields.byMember()){let a=e[i.localName],o;if(i.repeated)o=a.map(zh);else if(i.kind=="map"){o=r[i.localName];for(let[u,l]of Object.entries(a))o[u]=zh(l)}else i.kind=="oneof"?o=i.findField(a.case)?{case:a.case,value:zh(a.value)}:{case:void 0}:o=zh(a);r[i.localName]=o}for(let i of t.runtime.bin.listUnknownFields(e))t.runtime.bin.onUnknownField(r,i.no,i.wireType,i.data);return n}}}function zh(e){if(e===void 0)return e;if(Ba(e))return e.clone();if(e instanceof Uint8Array){let t=new Uint8Array(e.byteLength);return t.set(e),t}return e}function Qf(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function Tj(e,t,n){return{syntax:e,json:oj(),bin:fj(),util:Object.assign(Object.assign({},Nj()),{newFieldList:t,initFields:n}),makeMessageType(r,i,a){return Q1(this,r,i,a)},makeEnum:$1,makeEnumType:Yb,getEnumType:j1,makeExtension(r,i,a){return X1(this,r,i,a)}}}m();T();N();var Wh=class{constructor(t,n){this._fields=t,this._normalizer=n}findJsonName(t){if(!this.jsonNames){let n={};for(let r of this.list())n[r.jsonName]=n[r.name]=r;this.jsonNames=n}return this.jsonNames[t]}find(t){if(!this.numbers){let n={};for(let r of this.list())n[r.no]=r;this.numbers=n}return this.numbers[t]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((t,n)=>t.no-n.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];let t=this.members,n;for(let r of this.list())r.oneof?r.oneof!==n&&(n=r.oneof,t.push(n)):t.push(r)}return this.members}};m();T();N();m();T();N();m();T();N();function rA(e,t){let n=yj(e);return t?n:Wme(zme(n))}function Ej(e){return rA(e,!1)}var hj=yj;function yj(e){let t=!1,n=[];for(let r=0;r`${e}$`,zme=e=>Hme.has(e)?Ij(e):e,Wme=e=>Jme.has(e)?Ij(e):e;var Xh=class{constructor(t){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=t,this.localName=Ej(t)}addField(t){mn(t.oneof===this,`field ${t.name} not one of ${this.name}`),this.fields.push(t)}findField(t){if(!this._lookup){this._lookup=Object.create(null);for(let n=0;nnew Wh(e,t=>gj(t,!0)),e=>{for(let t of e.getType().fields.byMember()){if(t.opt)continue;let n=t.localName,r=e;if(t.repeated){r[n]=[];continue}switch(t.kind){case"oneof":r[n]={case:void 0};break;case"enum":r[n]=0;break;case"map":r[n]={};break;case"scalar":r[n]=Ua(t.T,t.L);break;case"message":break}}});var Cd;(function(e){e[e.OK=0]="OK",e[e.ERR=1]="ERR",e[e.ERR_NOT_FOUND=2]="ERR_NOT_FOUND",e[e.ERR_ALREADY_EXISTS=3]="ERR_ALREADY_EXISTS",e[e.ERR_INVALID_SUBGRAPH_SCHEMA=4]="ERR_INVALID_SUBGRAPH_SCHEMA",e[e.ERR_SUBGRAPH_COMPOSITION_FAILED=5]="ERR_SUBGRAPH_COMPOSITION_FAILED",e[e.ERR_SUBGRAPH_CHECK_FAILED=6]="ERR_SUBGRAPH_CHECK_FAILED",e[e.ERR_INVALID_LABELS=7]="ERR_INVALID_LABELS",e[e.ERR_ANALYTICS_DISABLED=8]="ERR_ANALYTICS_DISABLED",e[e.ERROR_NOT_AUTHENTICATED=9]="ERROR_NOT_AUTHENTICATED",e[e.ERR_OPENAI_DISABLED=10]="ERR_OPENAI_DISABLED",e[e.ERR_FREE_TRIAL_EXPIRED=11]="ERR_FREE_TRIAL_EXPIRED",e[e.ERROR_NOT_AUTHORIZED=12]="ERROR_NOT_AUTHORIZED",e[e.ERR_LIMIT_REACHED=13]="ERR_LIMIT_REACHED",e[e.ERR_DEPLOYMENT_FAILED=14]="ERR_DEPLOYMENT_FAILED",e[e.ERR_INVALID_NAME=15]="ERR_INVALID_NAME",e[e.ERR_UPGRADE_PLAN=16]="ERR_UPGRADE_PLAN",e[e.ERR_BAD_REQUEST=17]="ERR_BAD_REQUEST",e[e.ERR_SCHEMA_MISMATCH_WITH_APPROVED_PROPOSAL=18]="ERR_SCHEMA_MISMATCH_WITH_APPROVED_PROPOSAL"})(Cd||(Cd={}));w.util.setEnumType(Cd,"wg.cosmo.common.EnumStatusCode",[{no:0,name:"OK"},{no:1,name:"ERR"},{no:2,name:"ERR_NOT_FOUND"},{no:3,name:"ERR_ALREADY_EXISTS"},{no:4,name:"ERR_INVALID_SUBGRAPH_SCHEMA"},{no:5,name:"ERR_SUBGRAPH_COMPOSITION_FAILED"},{no:6,name:"ERR_SUBGRAPH_CHECK_FAILED"},{no:7,name:"ERR_INVALID_LABELS"},{no:8,name:"ERR_ANALYTICS_DISABLED"},{no:9,name:"ERROR_NOT_AUTHENTICATED"},{no:10,name:"ERR_OPENAI_DISABLED"},{no:11,name:"ERR_FREE_TRIAL_EXPIRED"},{no:12,name:"ERROR_NOT_AUTHORIZED"},{no:13,name:"ERR_LIMIT_REACHED"},{no:14,name:"ERR_DEPLOYMENT_FAILED"},{no:15,name:"ERR_INVALID_NAME"},{no:16,name:"ERR_UPGRADE_PLAN"},{no:17,name:"ERR_BAD_REQUEST"},{no:18,name:"ERR_SCHEMA_MISMATCH_WITH_APPROVED_PROPOSAL"}]);var js;(function(e){e[e.GRAPHQL_SUBSCRIPTION_PROTOCOL_WS=0]="GRAPHQL_SUBSCRIPTION_PROTOCOL_WS",e[e.GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE=1]="GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE",e[e.GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE_POST=2]="GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE_POST"})(js||(js={}));w.util.setEnumType(js,"wg.cosmo.common.GraphQLSubscriptionProtocol",[{no:0,name:"GRAPHQL_SUBSCRIPTION_PROTOCOL_WS"},{no:1,name:"GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE"},{no:2,name:"GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE_POST"}]);var $s;(function(e){e[e.GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO=0]="GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO",e[e.GRAPHQL_WEBSOCKET_SUBPROTOCOL_WS=1]="GRAPHQL_WEBSOCKET_SUBPROTOCOL_WS",e[e.GRAPHQL_WEBSOCKET_SUBPROTOCOL_TRANSPORT_WS=2]="GRAPHQL_WEBSOCKET_SUBPROTOCOL_TRANSPORT_WS"})($s||($s={}));w.util.setEnumType($s,"wg.cosmo.common.GraphQLWebsocketSubprotocol",[{no:0,name:"GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO"},{no:1,name:"GRAPHQL_WEBSOCKET_SUBPROTOCOL_WS"},{no:2,name:"GRAPHQL_WEBSOCKET_SUBPROTOCOL_TRANSPORT_WS"}]);var Fj=gi(Oe(),1);m();T();N();var iA;(function(e){e[e.RENDER_ARGUMENT_DEFAULT=0]="RENDER_ARGUMENT_DEFAULT",e[e.RENDER_ARGUMENT_AS_GRAPHQL_VALUE=1]="RENDER_ARGUMENT_AS_GRAPHQL_VALUE",e[e.RENDER_ARGUMENT_AS_ARRAY_CSV=2]="RENDER_ARGUMENT_AS_ARRAY_CSV"})(iA||(iA={}));w.util.setEnumType(iA,"wg.cosmo.node.v1.ArgumentRenderConfiguration",[{no:0,name:"RENDER_ARGUMENT_DEFAULT"},{no:1,name:"RENDER_ARGUMENT_AS_GRAPHQL_VALUE"},{no:2,name:"RENDER_ARGUMENT_AS_ARRAY_CSV"}]);var ol;(function(e){e[e.OBJECT_FIELD=0]="OBJECT_FIELD",e[e.FIELD_ARGUMENT=1]="FIELD_ARGUMENT"})(ol||(ol={}));w.util.setEnumType(ol,"wg.cosmo.node.v1.ArgumentSource",[{no:0,name:"OBJECT_FIELD"},{no:1,name:"FIELD_ARGUMENT"}]);var zu;(function(e){e[e.STATIC=0]="STATIC",e[e.GRAPHQL=1]="GRAPHQL",e[e.PUBSUB=2]="PUBSUB"})(zu||(zu={}));w.util.setEnumType(zu,"wg.cosmo.node.v1.DataSourceKind",[{no:0,name:"STATIC"},{no:1,name:"GRAPHQL"},{no:2,name:"PUBSUB"}]);var Yf;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.RESOLVE=1]="RESOLVE",e[e.REQUIRES=2]="REQUIRES"})(Yf||(Yf={}));w.util.setEnumType(Yf,"wg.cosmo.node.v1.LookupType",[{no:0,name:"LOOKUP_TYPE_UNSPECIFIED"},{no:1,name:"LOOKUP_TYPE_RESOLVE"},{no:2,name:"LOOKUP_TYPE_REQUIRES"}]);var Jf;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.QUERY=1]="QUERY",e[e.MUTATION=2]="MUTATION",e[e.SUBSCRIPTION=3]="SUBSCRIPTION"})(Jf||(Jf={}));w.util.setEnumType(Jf,"wg.cosmo.node.v1.OperationType",[{no:0,name:"OPERATION_TYPE_UNSPECIFIED"},{no:1,name:"OPERATION_TYPE_QUERY"},{no:2,name:"OPERATION_TYPE_MUTATION"},{no:3,name:"OPERATION_TYPE_SUBSCRIPTION"}]);var du;(function(e){e[e.PUBLISH=0]="PUBLISH",e[e.REQUEST=1]="REQUEST",e[e.SUBSCRIBE=2]="SUBSCRIBE"})(du||(du={}));w.util.setEnumType(du,"wg.cosmo.node.v1.EventType",[{no:0,name:"PUBLISH"},{no:1,name:"REQUEST"},{no:2,name:"SUBSCRIBE"}]);var Wu;(function(e){e[e.STATIC_CONFIGURATION_VARIABLE=0]="STATIC_CONFIGURATION_VARIABLE",e[e.ENV_CONFIGURATION_VARIABLE=1]="ENV_CONFIGURATION_VARIABLE",e[e.PLACEHOLDER_CONFIGURATION_VARIABLE=2]="PLACEHOLDER_CONFIGURATION_VARIABLE"})(Wu||(Wu={}));w.util.setEnumType(Wu,"wg.cosmo.node.v1.ConfigurationVariableKind",[{no:0,name:"STATIC_CONFIGURATION_VARIABLE"},{no:1,name:"ENV_CONFIGURATION_VARIABLE"},{no:2,name:"PLACEHOLDER_CONFIGURATION_VARIABLE"}]);var ul;(function(e){e[e.GET=0]="GET",e[e.POST=1]="POST",e[e.PUT=2]="PUT",e[e.DELETE=3]="DELETE",e[e.OPTIONS=4]="OPTIONS"})(ul||(ul={}));w.util.setEnumType(ul,"wg.cosmo.node.v1.HTTPMethod",[{no:0,name:"GET"},{no:1,name:"POST"},{no:2,name:"PUT"},{no:3,name:"DELETE"},{no:4,name:"OPTIONS"}]);var Gs=class Gs extends be{constructor(n){super();y(this,"id","");y(this,"name","");y(this,"routingUrl","");w.util.initPartial(n,this)}static fromBinary(n,r){return new Gs().fromBinary(n,r)}static fromJson(n,r){return new Gs().fromJson(n,r)}static fromJsonString(n,r){return new Gs().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Gs,n,r)}};y(Gs,"runtime",w),y(Gs,"typeName","wg.cosmo.node.v1.Subgraph"),y(Gs,"fields",w.util.newFieldList(()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"routing_url",kind:"scalar",T:9}]));var Zh=Gs,Qs=class Qs extends be{constructor(n){super();y(this,"configByFeatureFlagName",{});w.util.initPartial(n,this)}static fromBinary(n,r){return new Qs().fromBinary(n,r)}static fromJson(n,r){return new Qs().fromJson(n,r)}static fromJsonString(n,r){return new Qs().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Qs,n,r)}};y(Qs,"runtime",w),y(Qs,"typeName","wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs"),y(Qs,"fields",w.util.newFieldList(()=>[{no:1,name:"config_by_feature_flag_name",kind:"map",K:9,V:{kind:"message",T:sA}}]));var aA=Qs,Ys=class Ys extends be{constructor(n){super();y(this,"engineConfig");y(this,"version","");y(this,"subgraphs",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new Ys().fromBinary(n,r)}static fromJson(n,r){return new Ys().fromJson(n,r)}static fromJsonString(n,r){return new Ys().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Ys,n,r)}};y(Ys,"runtime",w),y(Ys,"typeName","wg.cosmo.node.v1.FeatureFlagRouterExecutionConfig"),y(Ys,"fields",w.util.newFieldList(()=>[{no:1,name:"engine_config",kind:"message",T:Ud},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"subgraphs",kind:"message",T:Zh,repeated:!0}]));var sA=Ys,Js=class Js extends be{constructor(n){super();y(this,"engineConfig");y(this,"version","");y(this,"subgraphs",[]);y(this,"featureFlagConfigs");y(this,"compatibilityVersion","");w.util.initPartial(n,this)}static fromBinary(n,r){return new Js().fromBinary(n,r)}static fromJson(n,r){return new Js().fromJson(n,r)}static fromJsonString(n,r){return new Js().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Js,n,r)}};y(Js,"runtime",w),y(Js,"typeName","wg.cosmo.node.v1.RouterConfig"),y(Js,"fields",w.util.newFieldList(()=>[{no:1,name:"engine_config",kind:"message",T:Ud},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"subgraphs",kind:"message",T:Zh,repeated:!0},{no:4,name:"feature_flag_configs",kind:"message",T:aA,opt:!0},{no:5,name:"compatibility_version",kind:"scalar",T:9}]));var Hf=Js,Hs=class Hs extends be{constructor(n){super();y(this,"code",Cd.OK);y(this,"details");w.util.initPartial(n,this)}static fromBinary(n,r){return new Hs().fromBinary(n,r)}static fromJson(n,r){return new Hs().fromJson(n,r)}static fromJsonString(n,r){return new Hs().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Hs,n,r)}};y(Hs,"runtime",w),y(Hs,"typeName","wg.cosmo.node.v1.Response"),y(Hs,"fields",w.util.newFieldList(()=>[{no:1,name:"code",kind:"enum",T:w.getEnumType(Cd)},{no:2,name:"details",kind:"scalar",T:9,opt:!0}]));var oA=Hs,zs=class zs extends be{constructor(n){super();y(this,"code",0);y(this,"message","");w.util.initPartial(n,this)}static fromBinary(n,r){return new zs().fromBinary(n,r)}static fromJson(n,r){return new zs().fromJson(n,r)}static fromJsonString(n,r){return new zs().fromJsonString(n,r)}static equals(n,r){return w.util.equals(zs,n,r)}};y(zs,"runtime",w),y(zs,"typeName","wg.cosmo.node.v1.ResponseStatus"),y(zs,"fields",w.util.newFieldList(()=>[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9}]));var _j=zs,Ws=class Ws extends be{constructor(n){super();y(this,"accountLimits");y(this,"graphPublicKey","");w.util.initPartial(n,this)}static fromBinary(n,r){return new Ws().fromBinary(n,r)}static fromJson(n,r){return new Ws().fromJson(n,r)}static fromJsonString(n,r){return new Ws().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Ws,n,r)}};y(Ws,"runtime",w),y(Ws,"typeName","wg.cosmo.node.v1.RegistrationInfo"),y(Ws,"fields",w.util.newFieldList(()=>[{no:1,name:"account_limits",kind:"message",T:cA},{no:2,name:"graph_public_key",kind:"scalar",T:9}]));var uA=Ws,Xs=class Xs extends be{constructor(n){super();y(this,"traceSamplingRate",0);w.util.initPartial(n,this)}static fromBinary(n,r){return new Xs().fromBinary(n,r)}static fromJson(n,r){return new Xs().fromJson(n,r)}static fromJsonString(n,r){return new Xs().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Xs,n,r)}};y(Xs,"runtime",w),y(Xs,"typeName","wg.cosmo.node.v1.AccountLimits"),y(Xs,"fields",w.util.newFieldList(()=>[{no:1,name:"trace_sampling_rate",kind:"scalar",T:2}]));var cA=Xs,Zs=class Zs extends be{constructor(t){super(),w.util.initPartial(t,this)}static fromBinary(t,n){return new Zs().fromBinary(t,n)}static fromJson(t,n){return new Zs().fromJson(t,n)}static fromJsonString(t,n){return new Zs().fromJsonString(t,n)}static equals(t,n){return w.util.equals(Zs,t,n)}};y(Zs,"runtime",w),y(Zs,"typeName","wg.cosmo.node.v1.SelfRegisterRequest"),y(Zs,"fields",w.util.newFieldList(()=>[]));var vj=Zs,eo=class eo extends be{constructor(n){super();y(this,"response");y(this,"registrationInfo");w.util.initPartial(n,this)}static fromBinary(n,r){return new eo().fromBinary(n,r)}static fromJson(n,r){return new eo().fromJson(n,r)}static fromJsonString(n,r){return new eo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(eo,n,r)}};y(eo,"runtime",w),y(eo,"typeName","wg.cosmo.node.v1.SelfRegisterResponse"),y(eo,"fields",w.util.newFieldList(()=>[{no:1,name:"response",kind:"message",T:oA},{no:2,name:"registrationInfo",kind:"message",T:uA,opt:!0}]));var Sj=eo,to=class to extends be{constructor(n){super();y(this,"defaultFlushInterval",Ln.zero);y(this,"datasourceConfigurations",[]);y(this,"fieldConfigurations",[]);y(this,"graphqlSchema","");y(this,"typeConfigurations",[]);y(this,"stringStorage",{});y(this,"graphqlClientSchema");w.util.initPartial(n,this)}static fromBinary(n,r){return new to().fromBinary(n,r)}static fromJson(n,r){return new to().fromJson(n,r)}static fromJsonString(n,r){return new to().fromJsonString(n,r)}static equals(n,r){return w.util.equals(to,n,r)}};y(to,"runtime",w),y(to,"typeName","wg.cosmo.node.v1.EngineConfiguration"),y(to,"fields",w.util.newFieldList(()=>[{no:1,name:"defaultFlushInterval",kind:"scalar",T:3},{no:2,name:"datasource_configurations",kind:"message",T:zf,repeated:!0},{no:3,name:"field_configurations",kind:"message",T:cm,repeated:!0},{no:4,name:"graphqlSchema",kind:"scalar",T:9},{no:5,name:"type_configurations",kind:"message",T:lA,repeated:!0},{no:6,name:"string_storage",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:7,name:"graphql_client_schema",kind:"scalar",T:9,opt:!0}]));var Ud=to,no=class no extends be{constructor(n){super();y(this,"kind",zu.STATIC);y(this,"rootNodes",[]);y(this,"childNodes",[]);y(this,"overrideFieldPathFromAlias",!1);y(this,"customGraphql");y(this,"customStatic");y(this,"directives",[]);y(this,"requestTimeoutSeconds",Ln.zero);y(this,"id","");y(this,"keys",[]);y(this,"provides",[]);y(this,"requires",[]);y(this,"customEvents");y(this,"entityInterfaces",[]);y(this,"interfaceObjects",[]);y(this,"costConfiguration");y(this,"entityCacheConfigurations",[]);y(this,"rootFieldCacheConfigurations",[]);y(this,"cachePopulateConfigurations",[]);y(this,"cacheInvalidateConfigurations",[]);y(this,"requestScopedFields",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new no().fromBinary(n,r)}static fromJson(n,r){return new no().fromJson(n,r)}static fromJsonString(n,r){return new no().fromJsonString(n,r)}static equals(n,r){return w.util.equals(no,n,r)}};y(no,"runtime",w),y(no,"typeName","wg.cosmo.node.v1.DataSourceConfiguration"),y(no,"fields",w.util.newFieldList(()=>[{no:1,name:"kind",kind:"enum",T:w.getEnumType(zu)},{no:2,name:"root_nodes",kind:"message",T:Bd,repeated:!0},{no:3,name:"child_nodes",kind:"message",T:Bd,repeated:!0},{no:4,name:"override_field_path_from_alias",kind:"scalar",T:8},{no:5,name:"custom_graphql",kind:"message",T:pm},{no:6,name:"custom_static",kind:"message",T:vA},{no:7,name:"directives",kind:"message",T:SA,repeated:!0},{no:8,name:"request_timeout_seconds",kind:"scalar",T:3},{no:9,name:"id",kind:"scalar",T:9},{no:10,name:"keys",kind:"message",T:sl,repeated:!0},{no:11,name:"provides",kind:"message",T:sl,repeated:!0},{no:12,name:"requires",kind:"message",T:sl,repeated:!0},{no:13,name:"custom_events",kind:"message",T:ll},{no:14,name:"entity_interfaces",kind:"message",T:kd,repeated:!0},{no:15,name:"interface_objects",kind:"message",T:kd,repeated:!0},{no:16,name:"cost_configuration",kind:"message",T:im},{no:17,name:"entity_cache_configurations",kind:"message",T:Xf,repeated:!0},{no:18,name:"root_field_cache_configurations",kind:"message",T:Zf,repeated:!0},{no:19,name:"cache_populate_configurations",kind:"message",T:nm,repeated:!0},{no:20,name:"cache_invalidate_configurations",kind:"message",T:rm,repeated:!0},{no:21,name:"request_scoped_fields",kind:"message",T:Wf,repeated:!0}]));var zf=no,ro=class ro extends be{constructor(n){super();y(this,"fieldName","");y(this,"typeName","");y(this,"l1Key","");w.util.initPartial(n,this)}static fromBinary(n,r){return new ro().fromBinary(n,r)}static fromJson(n,r){return new ro().fromJson(n,r)}static fromJsonString(n,r){return new ro().fromJsonString(n,r)}static equals(n,r){return w.util.equals(ro,n,r)}};y(ro,"runtime",w),y(ro,"typeName","wg.cosmo.node.v1.RequestScopedFieldConfiguration"),y(ro,"fields",w.util.newFieldList(()=>[{no:1,name:"field_name",kind:"scalar",T:9},{no:2,name:"type_name",kind:"scalar",T:9},{no:3,name:"l1_key",kind:"scalar",T:9}]));var Wf=ro,io=class io extends be{constructor(n){super();y(this,"typeName","");y(this,"maxAgeSeconds",Ln.zero);y(this,"includeHeaders",!1);y(this,"partialCacheLoad",!1);y(this,"shadowMode",!1);y(this,"notFoundCacheTtlSeconds",Ln.zero);w.util.initPartial(n,this)}static fromBinary(n,r){return new io().fromBinary(n,r)}static fromJson(n,r){return new io().fromJson(n,r)}static fromJsonString(n,r){return new io().fromJsonString(n,r)}static equals(n,r){return w.util.equals(io,n,r)}};y(io,"runtime",w),y(io,"typeName","wg.cosmo.node.v1.EntityCacheConfiguration"),y(io,"fields",w.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"max_age_seconds",kind:"scalar",T:3},{no:3,name:"include_headers",kind:"scalar",T:8},{no:4,name:"partial_cache_load",kind:"scalar",T:8},{no:5,name:"shadow_mode",kind:"scalar",T:8},{no:6,name:"not_found_cache_ttl_seconds",kind:"scalar",T:3}]));var Xf=io,ao=class ao extends be{constructor(n){super();y(this,"fieldName","");y(this,"maxAgeSeconds",Ln.zero);y(this,"includeHeaders",!1);y(this,"shadowMode",!1);y(this,"entityTypeName","");y(this,"entityKeyMappings",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new ao().fromBinary(n,r)}static fromJson(n,r){return new ao().fromJson(n,r)}static fromJsonString(n,r){return new ao().fromJsonString(n,r)}static equals(n,r){return w.util.equals(ao,n,r)}};y(ao,"runtime",w),y(ao,"typeName","wg.cosmo.node.v1.RootFieldCacheConfiguration"),y(ao,"fields",w.util.newFieldList(()=>[{no:1,name:"field_name",kind:"scalar",T:9},{no:2,name:"max_age_seconds",kind:"scalar",T:3},{no:3,name:"include_headers",kind:"scalar",T:8},{no:4,name:"shadow_mode",kind:"scalar",T:8},{no:5,name:"entity_type_name",kind:"scalar",T:9},{no:6,name:"entity_key_mappings",kind:"message",T:em,repeated:!0}]));var Zf=ao,so=class so extends be{constructor(n){super();y(this,"entityTypeName","");y(this,"fieldMappings",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new so().fromBinary(n,r)}static fromJson(n,r){return new so().fromJson(n,r)}static fromJsonString(n,r){return new so().fromJsonString(n,r)}static equals(n,r){return w.util.equals(so,n,r)}};y(so,"runtime",w),y(so,"typeName","wg.cosmo.node.v1.EntityKeyMapping"),y(so,"fields",w.util.newFieldList(()=>[{no:1,name:"entity_type_name",kind:"scalar",T:9},{no:2,name:"field_mappings",kind:"message",T:tm,repeated:!0}]));var em=so,oo=class oo extends be{constructor(n){super();y(this,"entityKeyField","");y(this,"argumentPath",[]);y(this,"isBatch",!1);w.util.initPartial(n,this)}static fromBinary(n,r){return new oo().fromBinary(n,r)}static fromJson(n,r){return new oo().fromJson(n,r)}static fromJsonString(n,r){return new oo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(oo,n,r)}};y(oo,"runtime",w),y(oo,"typeName","wg.cosmo.node.v1.EntityCacheFieldMapping"),y(oo,"fields",w.util.newFieldList(()=>[{no:1,name:"entity_key_field",kind:"scalar",T:9},{no:2,name:"argument_path",kind:"scalar",T:9,repeated:!0},{no:3,name:"is_batch",kind:"scalar",T:8}]));var tm=oo,uo=class uo extends be{constructor(n){super();y(this,"fieldName","");y(this,"operationType","");y(this,"maxAgeSeconds");y(this,"entityTypeName","");w.util.initPartial(n,this)}static fromBinary(n,r){return new uo().fromBinary(n,r)}static fromJson(n,r){return new uo().fromJson(n,r)}static fromJsonString(n,r){return new uo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(uo,n,r)}};y(uo,"runtime",w),y(uo,"typeName","wg.cosmo.node.v1.CachePopulateConfiguration"),y(uo,"fields",w.util.newFieldList(()=>[{no:1,name:"field_name",kind:"scalar",T:9},{no:2,name:"operation_type",kind:"scalar",T:9},{no:3,name:"max_age_seconds",kind:"scalar",T:3,opt:!0},{no:4,name:"entity_type_name",kind:"scalar",T:9}]));var nm=uo,co=class co extends be{constructor(n){super();y(this,"fieldName","");y(this,"operationType","");y(this,"entityTypeName","");w.util.initPartial(n,this)}static fromBinary(n,r){return new co().fromBinary(n,r)}static fromJson(n,r){return new co().fromJson(n,r)}static fromJsonString(n,r){return new co().fromJsonString(n,r)}static equals(n,r){return w.util.equals(co,n,r)}};y(co,"runtime",w),y(co,"typeName","wg.cosmo.node.v1.CacheInvalidateConfiguration"),y(co,"fields",w.util.newFieldList(()=>[{no:1,name:"field_name",kind:"scalar",T:9},{no:2,name:"operation_type",kind:"scalar",T:9},{no:3,name:"entity_type_name",kind:"scalar",T:9}]));var rm=co,lo=class lo extends be{constructor(n){super();y(this,"fieldWeights",[]);y(this,"listSizes",[]);y(this,"typeWeights",{});y(this,"directiveArgumentWeights",{});w.util.initPartial(n,this)}static fromBinary(n,r){return new lo().fromBinary(n,r)}static fromJson(n,r){return new lo().fromJson(n,r)}static fromJsonString(n,r){return new lo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(lo,n,r)}};y(lo,"runtime",w),y(lo,"typeName","wg.cosmo.node.v1.CostConfiguration"),y(lo,"fields",w.util.newFieldList(()=>[{no:1,name:"field_weights",kind:"message",T:am,repeated:!0},{no:2,name:"list_sizes",kind:"message",T:sm,repeated:!0},{no:3,name:"type_weights",kind:"map",K:9,V:{kind:"scalar",T:5}},{no:4,name:"directive_argument_weights",kind:"map",K:9,V:{kind:"scalar",T:5}}]));var im=lo,po=class po extends be{constructor(n){super();y(this,"typeName","");y(this,"fieldName","");y(this,"weight");y(this,"argumentWeights",{});w.util.initPartial(n,this)}static fromBinary(n,r){return new po().fromBinary(n,r)}static fromJson(n,r){return new po().fromJson(n,r)}static fromJsonString(n,r){return new po().fromJsonString(n,r)}static equals(n,r){return w.util.equals(po,n,r)}};y(po,"runtime",w),y(po,"typeName","wg.cosmo.node.v1.FieldWeightConfiguration"),y(po,"fields",w.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9},{no:3,name:"weight",kind:"scalar",T:5,opt:!0},{no:4,name:"argument_weights",kind:"map",K:9,V:{kind:"scalar",T:5}}]));var am=po,fo=class fo extends be{constructor(n){super();y(this,"typeName","");y(this,"fieldName","");y(this,"assumedSize");y(this,"slicingArguments",[]);y(this,"sizedFields",[]);y(this,"requireOneSlicingArgument");w.util.initPartial(n,this)}static fromBinary(n,r){return new fo().fromBinary(n,r)}static fromJson(n,r){return new fo().fromJson(n,r)}static fromJsonString(n,r){return new fo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(fo,n,r)}};y(fo,"runtime",w),y(fo,"typeName","wg.cosmo.node.v1.FieldListSizeConfiguration"),y(fo,"fields",w.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9},{no:3,name:"assumed_size",kind:"scalar",T:5,opt:!0},{no:4,name:"slicing_arguments",kind:"scalar",T:9,repeated:!0},{no:5,name:"sized_fields",kind:"scalar",T:9,repeated:!0},{no:6,name:"require_one_slicing_argument",kind:"scalar",T:8,opt:!0}]));var sm=fo,mo=class mo extends be{constructor(n){super();y(this,"name","");y(this,"sourceType",ol.OBJECT_FIELD);w.util.initPartial(n,this)}static fromBinary(n,r){return new mo().fromBinary(n,r)}static fromJson(n,r){return new mo().fromJson(n,r)}static fromJsonString(n,r){return new mo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(mo,n,r)}};y(mo,"runtime",w),y(mo,"typeName","wg.cosmo.node.v1.ArgumentConfiguration"),y(mo,"fields",w.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"source_type",kind:"enum",T:w.getEnumType(ol)}]));var om=mo,No=class No extends be{constructor(n){super();y(this,"requiredAndScopes",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new No().fromBinary(n,r)}static fromJson(n,r){return new No().fromJson(n,r)}static fromJsonString(n,r){return new No().fromJsonString(n,r)}static equals(n,r){return w.util.equals(No,n,r)}};y(No,"runtime",w),y(No,"typeName","wg.cosmo.node.v1.Scopes"),y(No,"fields",w.util.newFieldList(()=>[{no:1,name:"required_and_scopes",kind:"scalar",T:9,repeated:!0}]));var cl=No,To=class To extends be{constructor(n){super();y(this,"requiresAuthentication",!1);y(this,"requiredOrScopes",[]);y(this,"requiredOrScopesByOr",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new To().fromBinary(n,r)}static fromJson(n,r){return new To().fromJson(n,r)}static fromJsonString(n,r){return new To().fromJsonString(n,r)}static equals(n,r){return w.util.equals(To,n,r)}};y(To,"runtime",w),y(To,"typeName","wg.cosmo.node.v1.AuthorizationConfiguration"),y(To,"fields",w.util.newFieldList(()=>[{no:1,name:"requires_authentication",kind:"scalar",T:8},{no:2,name:"required_or_scopes",kind:"message",T:cl,repeated:!0},{no:3,name:"required_or_scopes_by_or",kind:"message",T:cl,repeated:!0}]));var um=To,Eo=class Eo extends be{constructor(n){super();y(this,"typeName","");y(this,"fieldName","");y(this,"argumentsConfiguration",[]);y(this,"authorizationConfiguration");y(this,"subscriptionFilterCondition");w.util.initPartial(n,this)}static fromBinary(n,r){return new Eo().fromBinary(n,r)}static fromJson(n,r){return new Eo().fromJson(n,r)}static fromJsonString(n,r){return new Eo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Eo,n,r)}};y(Eo,"runtime",w),y(Eo,"typeName","wg.cosmo.node.v1.FieldConfiguration"),y(Eo,"fields",w.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9},{no:3,name:"arguments_configuration",kind:"message",T:om,repeated:!0},{no:4,name:"authorization_configuration",kind:"message",T:um},{no:5,name:"subscription_filter_condition",kind:"message",T:Xu,opt:!0}]));var cm=Eo,ho=class ho extends be{constructor(n){super();y(this,"typeName","");y(this,"renameTo","");w.util.initPartial(n,this)}static fromBinary(n,r){return new ho().fromBinary(n,r)}static fromJson(n,r){return new ho().fromJson(n,r)}static fromJsonString(n,r){return new ho().fromJsonString(n,r)}static equals(n,r){return w.util.equals(ho,n,r)}};y(ho,"runtime",w),y(ho,"typeName","wg.cosmo.node.v1.TypeConfiguration"),y(ho,"fields",w.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"rename_to",kind:"scalar",T:9}]));var lA=ho,yo=class yo extends be{constructor(n){super();y(this,"typeName","");y(this,"fieldNames",[]);y(this,"externalFieldNames",[]);y(this,"requireFetchReasonsFieldNames",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new yo().fromBinary(n,r)}static fromJson(n,r){return new yo().fromJson(n,r)}static fromJsonString(n,r){return new yo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(yo,n,r)}};y(yo,"runtime",w),y(yo,"typeName","wg.cosmo.node.v1.TypeField"),y(yo,"fields",w.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_names",kind:"scalar",T:9,repeated:!0},{no:3,name:"external_field_names",kind:"scalar",T:9,repeated:!0},{no:4,name:"require_fetch_reasons_field_names",kind:"scalar",T:9,repeated:!0}]));var Bd=yo,Io=class Io extends be{constructor(n){super();y(this,"fieldName","");y(this,"typeName","");w.util.initPartial(n,this)}static fromBinary(n,r){return new Io().fromBinary(n,r)}static fromJson(n,r){return new Io().fromJson(n,r)}static fromJsonString(n,r){return new Io().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Io,n,r)}};y(Io,"runtime",w),y(Io,"typeName","wg.cosmo.node.v1.FieldCoordinates"),y(Io,"fields",w.util.newFieldList(()=>[{no:1,name:"field_name",kind:"scalar",T:9},{no:2,name:"type_name",kind:"scalar",T:9}]));var lm=Io,go=class go extends be{constructor(n){super();y(this,"fieldCoordinatesPath",[]);y(this,"fieldPath",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new go().fromBinary(n,r)}static fromJson(n,r){return new go().fromJson(n,r)}static fromJsonString(n,r){return new go().fromJsonString(n,r)}static equals(n,r){return w.util.equals(go,n,r)}};y(go,"runtime",w),y(go,"typeName","wg.cosmo.node.v1.FieldSetCondition"),y(go,"fields",w.util.newFieldList(()=>[{no:1,name:"field_coordinates_path",kind:"message",T:lm,repeated:!0},{no:2,name:"field_path",kind:"scalar",T:9,repeated:!0}]));var dm=go,_o=class _o extends be{constructor(n){super();y(this,"typeName","");y(this,"fieldName","");y(this,"selectionSet","");y(this,"disableEntityResolver",!1);y(this,"conditions",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new _o().fromBinary(n,r)}static fromJson(n,r){return new _o().fromJson(n,r)}static fromJsonString(n,r){return new _o().fromJsonString(n,r)}static equals(n,r){return w.util.equals(_o,n,r)}};y(_o,"runtime",w),y(_o,"typeName","wg.cosmo.node.v1.RequiredField"),y(_o,"fields",w.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9},{no:3,name:"selection_set",kind:"scalar",T:9},{no:4,name:"disable_entity_resolver",kind:"scalar",T:8},{no:5,name:"conditions",kind:"message",T:dm,repeated:!0}]));var sl=_o,vo=class vo extends be{constructor(n){super();y(this,"interfaceTypeName","");y(this,"concreteTypeNames",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new vo().fromBinary(n,r)}static fromJson(n,r){return new vo().fromJson(n,r)}static fromJsonString(n,r){return new vo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(vo,n,r)}};y(vo,"runtime",w),y(vo,"typeName","wg.cosmo.node.v1.EntityInterfaceConfiguration"),y(vo,"fields",w.util.newFieldList(()=>[{no:1,name:"interface_type_name",kind:"scalar",T:9},{no:2,name:"concrete_type_names",kind:"scalar",T:9,repeated:!0}]));var kd=vo,So=class So extends be{constructor(n){super();y(this,"url");y(this,"method",ul.GET);y(this,"header",{});y(this,"body");y(this,"query",[]);y(this,"urlEncodeBody",!1);y(this,"mtls");y(this,"baseUrl");y(this,"path");y(this,"httpProxyUrl");w.util.initPartial(n,this)}static fromBinary(n,r){return new So().fromBinary(n,r)}static fromJson(n,r){return new So().fromJson(n,r)}static fromJsonString(n,r){return new So().fromJsonString(n,r)}static equals(n,r){return w.util.equals(So,n,r)}};y(So,"runtime",w),y(So,"typeName","wg.cosmo.node.v1.FetchConfiguration"),y(So,"fields",w.util.newFieldList(()=>[{no:1,name:"url",kind:"message",T:ei},{no:2,name:"method",kind:"enum",T:w.getEnumType(ul)},{no:3,name:"header",kind:"map",K:9,V:{kind:"message",T:DA}},{no:4,name:"body",kind:"message",T:ei},{no:5,name:"query",kind:"message",T:OA,repeated:!0},{no:7,name:"url_encode_body",kind:"scalar",T:8},{no:8,name:"mtls",kind:"message",T:bA},{no:9,name:"base_url",kind:"message",T:ei},{no:10,name:"path",kind:"message",T:ei},{no:11,name:"http_proxy_url",kind:"message",T:ei,opt:!0}]));var dA=So,Oo=class Oo extends be{constructor(n){super();y(this,"statusCode",Ln.zero);y(this,"typeName","");y(this,"injectStatusCodeIntoBody",!1);w.util.initPartial(n,this)}static fromBinary(n,r){return new Oo().fromBinary(n,r)}static fromJson(n,r){return new Oo().fromJson(n,r)}static fromJsonString(n,r){return new Oo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Oo,n,r)}};y(Oo,"runtime",w),y(Oo,"typeName","wg.cosmo.node.v1.StatusCodeTypeMapping"),y(Oo,"fields",w.util.newFieldList(()=>[{no:1,name:"status_code",kind:"scalar",T:3},{no:2,name:"type_name",kind:"scalar",T:9},{no:3,name:"inject_status_code_into_body",kind:"scalar",T:8}]));var Oj=Oo,Do=class Do extends be{constructor(n){super();y(this,"fetch");y(this,"subscription");y(this,"federation");y(this,"upstreamSchema");y(this,"customScalarTypeFields",[]);y(this,"grpc");w.util.initPartial(n,this)}static fromBinary(n,r){return new Do().fromBinary(n,r)}static fromJson(n,r){return new Do().fromJson(n,r)}static fromJsonString(n,r){return new Do().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Do,n,r)}};y(Do,"runtime",w),y(Do,"typeName","wg.cosmo.node.v1.DataSourceCustom_GraphQL"),y(Do,"fields",w.util.newFieldList(()=>[{no:1,name:"fetch",kind:"message",T:dA},{no:2,name:"subscription",kind:"message",T:AA},{no:3,name:"federation",kind:"message",T:RA},{no:4,name:"upstream_schema",kind:"message",T:ym},{no:6,name:"custom_scalar_type_fields",kind:"message",T:PA,repeated:!0},{no:7,name:"grpc",kind:"message",T:Md}]));var pm=Do,bo=class bo extends be{constructor(n){super();y(this,"mapping");y(this,"protoSchema","");y(this,"plugin");w.util.initPartial(n,this)}static fromBinary(n,r){return new bo().fromBinary(n,r)}static fromJson(n,r){return new bo().fromJson(n,r)}static fromJsonString(n,r){return new bo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(bo,n,r)}};y(bo,"runtime",w),y(bo,"typeName","wg.cosmo.node.v1.GRPCConfiguration"),y(bo,"fields",w.util.newFieldList(()=>[{no:1,name:"mapping",kind:"message",T:fA},{no:2,name:"proto_schema",kind:"scalar",T:9},{no:3,name:"plugin",kind:"message",T:fm}]));var Md=bo,Ao=class Ao extends be{constructor(n){super();y(this,"repository","");y(this,"reference","");w.util.initPartial(n,this)}static fromBinary(n,r){return new Ao().fromBinary(n,r)}static fromJson(n,r){return new Ao().fromJson(n,r)}static fromJsonString(n,r){return new Ao().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Ao,n,r)}};y(Ao,"runtime",w),y(Ao,"typeName","wg.cosmo.node.v1.ImageReference"),y(Ao,"fields",w.util.newFieldList(()=>[{no:1,name:"repository",kind:"scalar",T:9},{no:2,name:"reference",kind:"scalar",T:9}]));var pA=Ao,Ro=class Ro extends be{constructor(n){super();y(this,"name","");y(this,"version","");y(this,"imageReference");w.util.initPartial(n,this)}static fromBinary(n,r){return new Ro().fromBinary(n,r)}static fromJson(n,r){return new Ro().fromJson(n,r)}static fromJsonString(n,r){return new Ro().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Ro,n,r)}};y(Ro,"runtime",w),y(Ro,"typeName","wg.cosmo.node.v1.PluginConfiguration"),y(Ro,"fields",w.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"image_reference",kind:"message",T:pA,opt:!0}]));var fm=Ro,Po=class Po extends be{constructor(n){super();y(this,"enabled",!1);w.util.initPartial(n,this)}static fromBinary(n,r){return new Po().fromBinary(n,r)}static fromJson(n,r){return new Po().fromJson(n,r)}static fromJsonString(n,r){return new Po().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Po,n,r)}};y(Po,"runtime",w),y(Po,"typeName","wg.cosmo.node.v1.SSLConfiguration"),y(Po,"fields",w.util.newFieldList(()=>[{no:1,name:"enabled",kind:"scalar",T:8}]));var Dj=Po,Fo=class Fo extends be{constructor(n){super();y(this,"version",0);y(this,"service","");y(this,"operationMappings",[]);y(this,"entityMappings",[]);y(this,"typeFieldMappings",[]);y(this,"enumMappings",[]);y(this,"resolveMappings",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new Fo().fromBinary(n,r)}static fromJson(n,r){return new Fo().fromJson(n,r)}static fromJsonString(n,r){return new Fo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Fo,n,r)}};y(Fo,"runtime",w),y(Fo,"typeName","wg.cosmo.node.v1.GRPCMapping"),y(Fo,"fields",w.util.newFieldList(()=>[{no:1,name:"version",kind:"scalar",T:5},{no:2,name:"service",kind:"scalar",T:9},{no:3,name:"operation_mappings",kind:"message",T:TA,repeated:!0},{no:4,name:"entity_mappings",kind:"message",T:EA,repeated:!0},{no:5,name:"type_field_mappings",kind:"message",T:yA,repeated:!0},{no:6,name:"enum_mappings",kind:"message",T:gA,repeated:!0},{no:7,name:"resolve_mappings",kind:"message",T:mA,repeated:!0}]));var fA=Fo,Lo=class Lo extends be{constructor(n){super();y(this,"type",Yf.UNSPECIFIED);y(this,"lookupMapping");y(this,"rpc","");y(this,"request","");y(this,"response","");w.util.initPartial(n,this)}static fromBinary(n,r){return new Lo().fromBinary(n,r)}static fromJson(n,r){return new Lo().fromJson(n,r)}static fromJsonString(n,r){return new Lo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Lo,n,r)}};y(Lo,"runtime",w),y(Lo,"typeName","wg.cosmo.node.v1.LookupMapping"),y(Lo,"fields",w.util.newFieldList(()=>[{no:1,name:"type",kind:"enum",T:w.getEnumType(Yf)},{no:2,name:"lookup_mapping",kind:"message",T:NA},{no:3,name:"rpc",kind:"scalar",T:9},{no:4,name:"request",kind:"scalar",T:9},{no:5,name:"response",kind:"scalar",T:9}]));var mA=Lo,wo=class wo extends be{constructor(n){super();y(this,"type","");y(this,"fieldMapping");w.util.initPartial(n,this)}static fromBinary(n,r){return new wo().fromBinary(n,r)}static fromJson(n,r){return new wo().fromJson(n,r)}static fromJsonString(n,r){return new wo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(wo,n,r)}};y(wo,"runtime",w),y(wo,"typeName","wg.cosmo.node.v1.LookupFieldMapping"),y(wo,"fields",w.util.newFieldList(()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"field_mapping",kind:"message",T:mm}]));var NA=wo,Co=class Co extends be{constructor(n){super();y(this,"type",Jf.UNSPECIFIED);y(this,"original","");y(this,"mapped","");y(this,"request","");y(this,"response","");w.util.initPartial(n,this)}static fromBinary(n,r){return new Co().fromBinary(n,r)}static fromJson(n,r){return new Co().fromJson(n,r)}static fromJsonString(n,r){return new Co().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Co,n,r)}};y(Co,"runtime",w),y(Co,"typeName","wg.cosmo.node.v1.OperationMapping"),y(Co,"fields",w.util.newFieldList(()=>[{no:1,name:"type",kind:"enum",T:w.getEnumType(Jf)},{no:2,name:"original",kind:"scalar",T:9},{no:3,name:"mapped",kind:"scalar",T:9},{no:4,name:"request",kind:"scalar",T:9},{no:5,name:"response",kind:"scalar",T:9}]));var TA=Co,Uo=class Uo extends be{constructor(n){super();y(this,"typeName","");y(this,"kind","");y(this,"key","");y(this,"rpc","");y(this,"request","");y(this,"response","");y(this,"requiredFieldMappings",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new Uo().fromBinary(n,r)}static fromJson(n,r){return new Uo().fromJson(n,r)}static fromJsonString(n,r){return new Uo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Uo,n,r)}};y(Uo,"runtime",w),y(Uo,"typeName","wg.cosmo.node.v1.EntityMapping"),y(Uo,"fields",w.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"kind",kind:"scalar",T:9},{no:3,name:"key",kind:"scalar",T:9},{no:4,name:"rpc",kind:"scalar",T:9},{no:5,name:"request",kind:"scalar",T:9},{no:6,name:"response",kind:"scalar",T:9},{no:7,name:"required_field_mappings",kind:"message",T:hA,repeated:!0}]));var EA=Uo,Bo=class Bo extends be{constructor(n){super();y(this,"fieldMapping");y(this,"rpc","");y(this,"request","");y(this,"response","");w.util.initPartial(n,this)}static fromBinary(n,r){return new Bo().fromBinary(n,r)}static fromJson(n,r){return new Bo().fromJson(n,r)}static fromJsonString(n,r){return new Bo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Bo,n,r)}};y(Bo,"runtime",w),y(Bo,"typeName","wg.cosmo.node.v1.RequiredFieldMapping"),y(Bo,"fields",w.util.newFieldList(()=>[{no:1,name:"field_mapping",kind:"message",T:mm},{no:2,name:"rpc",kind:"scalar",T:9},{no:3,name:"request",kind:"scalar",T:9},{no:4,name:"response",kind:"scalar",T:9}]));var hA=Bo,ko=class ko extends be{constructor(n){super();y(this,"type","");y(this,"fieldMappings",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new ko().fromBinary(n,r)}static fromJson(n,r){return new ko().fromJson(n,r)}static fromJsonString(n,r){return new ko().fromJsonString(n,r)}static equals(n,r){return w.util.equals(ko,n,r)}};y(ko,"runtime",w),y(ko,"typeName","wg.cosmo.node.v1.TypeFieldMapping"),y(ko,"fields",w.util.newFieldList(()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"field_mappings",kind:"message",T:mm,repeated:!0}]));var yA=ko,Mo=class Mo extends be{constructor(n){super();y(this,"original","");y(this,"mapped","");y(this,"argumentMappings",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new Mo().fromBinary(n,r)}static fromJson(n,r){return new Mo().fromJson(n,r)}static fromJsonString(n,r){return new Mo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Mo,n,r)}};y(Mo,"runtime",w),y(Mo,"typeName","wg.cosmo.node.v1.FieldMapping"),y(Mo,"fields",w.util.newFieldList(()=>[{no:1,name:"original",kind:"scalar",T:9},{no:2,name:"mapped",kind:"scalar",T:9},{no:3,name:"argument_mappings",kind:"message",T:IA,repeated:!0}]));var mm=Mo,xo=class xo extends be{constructor(n){super();y(this,"original","");y(this,"mapped","");w.util.initPartial(n,this)}static fromBinary(n,r){return new xo().fromBinary(n,r)}static fromJson(n,r){return new xo().fromJson(n,r)}static fromJsonString(n,r){return new xo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(xo,n,r)}};y(xo,"runtime",w),y(xo,"typeName","wg.cosmo.node.v1.ArgumentMapping"),y(xo,"fields",w.util.newFieldList(()=>[{no:1,name:"original",kind:"scalar",T:9},{no:2,name:"mapped",kind:"scalar",T:9}]));var IA=xo,qo=class qo extends be{constructor(n){super();y(this,"type","");y(this,"values",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new qo().fromBinary(n,r)}static fromJson(n,r){return new qo().fromJson(n,r)}static fromJsonString(n,r){return new qo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(qo,n,r)}};y(qo,"runtime",w),y(qo,"typeName","wg.cosmo.node.v1.EnumMapping"),y(qo,"fields",w.util.newFieldList(()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"values",kind:"message",T:_A,repeated:!0}]));var gA=qo,Vo=class Vo extends be{constructor(n){super();y(this,"original","");y(this,"mapped","");w.util.initPartial(n,this)}static fromBinary(n,r){return new Vo().fromBinary(n,r)}static fromJson(n,r){return new Vo().fromJson(n,r)}static fromJsonString(n,r){return new Vo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Vo,n,r)}};y(Vo,"runtime",w),y(Vo,"typeName","wg.cosmo.node.v1.EnumValueMapping"),y(Vo,"fields",w.util.newFieldList(()=>[{no:1,name:"original",kind:"scalar",T:9},{no:2,name:"mapped",kind:"scalar",T:9}]));var _A=Vo,Ko=class Ko extends be{constructor(n){super();y(this,"consumerName","");y(this,"streamName","");y(this,"consumerInactiveThreshold",0);w.util.initPartial(n,this)}static fromBinary(n,r){return new Ko().fromBinary(n,r)}static fromJson(n,r){return new Ko().fromJson(n,r)}static fromJsonString(n,r){return new Ko().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Ko,n,r)}};y(Ko,"runtime",w),y(Ko,"typeName","wg.cosmo.node.v1.NatsStreamConfiguration"),y(Ko,"fields",w.util.newFieldList(()=>[{no:1,name:"consumer_name",kind:"scalar",T:9},{no:2,name:"stream_name",kind:"scalar",T:9},{no:3,name:"consumer_inactive_threshold",kind:"scalar",T:5}]));var Nm=Ko,jo=class jo extends be{constructor(n){super();y(this,"engineEventConfiguration");y(this,"subjects",[]);y(this,"streamConfiguration");w.util.initPartial(n,this)}static fromBinary(n,r){return new jo().fromBinary(n,r)}static fromJson(n,r){return new jo().fromJson(n,r)}static fromJsonString(n,r){return new jo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(jo,n,r)}};y(jo,"runtime",w),y(jo,"typeName","wg.cosmo.node.v1.NatsEventConfiguration"),y(jo,"fields",w.util.newFieldList(()=>[{no:1,name:"engine_event_configuration",kind:"message",T:pu},{no:2,name:"subjects",kind:"scalar",T:9,repeated:!0},{no:3,name:"stream_configuration",kind:"message",T:Nm}]));var Tm=jo,$o=class $o extends be{constructor(n){super();y(this,"engineEventConfiguration");y(this,"topics",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new $o().fromBinary(n,r)}static fromJson(n,r){return new $o().fromJson(n,r)}static fromJsonString(n,r){return new $o().fromJsonString(n,r)}static equals(n,r){return w.util.equals($o,n,r)}};y($o,"runtime",w),y($o,"typeName","wg.cosmo.node.v1.KafkaEventConfiguration"),y($o,"fields",w.util.newFieldList(()=>[{no:1,name:"engine_event_configuration",kind:"message",T:pu},{no:2,name:"topics",kind:"scalar",T:9,repeated:!0}]));var Em=$o,Go=class Go extends be{constructor(n){super();y(this,"engineEventConfiguration");y(this,"channels",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new Go().fromBinary(n,r)}static fromJson(n,r){return new Go().fromJson(n,r)}static fromJsonString(n,r){return new Go().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Go,n,r)}};y(Go,"runtime",w),y(Go,"typeName","wg.cosmo.node.v1.RedisEventConfiguration"),y(Go,"fields",w.util.newFieldList(()=>[{no:1,name:"engine_event_configuration",kind:"message",T:pu},{no:2,name:"channels",kind:"scalar",T:9,repeated:!0}]));var hm=Go,Qo=class Qo extends be{constructor(n){super();y(this,"providerId","");y(this,"type",du.PUBLISH);y(this,"typeName","");y(this,"fieldName","");w.util.initPartial(n,this)}static fromBinary(n,r){return new Qo().fromBinary(n,r)}static fromJson(n,r){return new Qo().fromJson(n,r)}static fromJsonString(n,r){return new Qo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Qo,n,r)}};y(Qo,"runtime",w),y(Qo,"typeName","wg.cosmo.node.v1.EngineEventConfiguration"),y(Qo,"fields",w.util.newFieldList(()=>[{no:1,name:"provider_id",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:w.getEnumType(du)},{no:3,name:"type_name",kind:"scalar",T:9},{no:4,name:"field_name",kind:"scalar",T:9}]));var pu=Qo,Yo=class Yo extends be{constructor(n){super();y(this,"nats",[]);y(this,"kafka",[]);y(this,"redis",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new Yo().fromBinary(n,r)}static fromJson(n,r){return new Yo().fromJson(n,r)}static fromJsonString(n,r){return new Yo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Yo,n,r)}};y(Yo,"runtime",w),y(Yo,"typeName","wg.cosmo.node.v1.DataSourceCustomEvents"),y(Yo,"fields",w.util.newFieldList(()=>[{no:1,name:"nats",kind:"message",T:Tm,repeated:!0},{no:2,name:"kafka",kind:"message",T:Em,repeated:!0},{no:3,name:"redis",kind:"message",T:hm,repeated:!0}]));var ll=Yo,Jo=class Jo extends be{constructor(n){super();y(this,"data");w.util.initPartial(n,this)}static fromBinary(n,r){return new Jo().fromBinary(n,r)}static fromJson(n,r){return new Jo().fromJson(n,r)}static fromJsonString(n,r){return new Jo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Jo,n,r)}};y(Jo,"runtime",w),y(Jo,"typeName","wg.cosmo.node.v1.DataSourceCustom_Static"),y(Jo,"fields",w.util.newFieldList(()=>[{no:1,name:"data",kind:"message",T:ei}]));var vA=Jo,Ho=class Ho extends be{constructor(n){super();y(this,"kind",Wu.STATIC_CONFIGURATION_VARIABLE);y(this,"staticVariableContent","");y(this,"environmentVariableName","");y(this,"environmentVariableDefaultValue","");y(this,"placeholderVariableName","");w.util.initPartial(n,this)}static fromBinary(n,r){return new Ho().fromBinary(n,r)}static fromJson(n,r){return new Ho().fromJson(n,r)}static fromJsonString(n,r){return new Ho().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Ho,n,r)}};y(Ho,"runtime",w),y(Ho,"typeName","wg.cosmo.node.v1.ConfigurationVariable"),y(Ho,"fields",w.util.newFieldList(()=>[{no:1,name:"kind",kind:"enum",T:w.getEnumType(Wu)},{no:2,name:"static_variable_content",kind:"scalar",T:9},{no:3,name:"environment_variable_name",kind:"scalar",T:9},{no:4,name:"environment_variable_default_value",kind:"scalar",T:9},{no:5,name:"placeholder_variable_name",kind:"scalar",T:9}]));var ei=Ho,zo=class zo extends be{constructor(n){super();y(this,"directiveName","");y(this,"renameTo","");w.util.initPartial(n,this)}static fromBinary(n,r){return new zo().fromBinary(n,r)}static fromJson(n,r){return new zo().fromJson(n,r)}static fromJsonString(n,r){return new zo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(zo,n,r)}};y(zo,"runtime",w),y(zo,"typeName","wg.cosmo.node.v1.DirectiveConfiguration"),y(zo,"fields",w.util.newFieldList(()=>[{no:1,name:"directive_name",kind:"scalar",T:9},{no:2,name:"rename_to",kind:"scalar",T:9}]));var SA=zo,Wo=class Wo extends be{constructor(n){super();y(this,"name","");y(this,"value","");w.util.initPartial(n,this)}static fromBinary(n,r){return new Wo().fromBinary(n,r)}static fromJson(n,r){return new Wo().fromJson(n,r)}static fromJsonString(n,r){return new Wo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Wo,n,r)}};y(Wo,"runtime",w),y(Wo,"typeName","wg.cosmo.node.v1.URLQueryConfiguration"),y(Wo,"fields",w.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:9}]));var OA=Wo,Xo=class Xo extends be{constructor(n){super();y(this,"values",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new Xo().fromBinary(n,r)}static fromJson(n,r){return new Xo().fromJson(n,r)}static fromJsonString(n,r){return new Xo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Xo,n,r)}};y(Xo,"runtime",w),y(Xo,"typeName","wg.cosmo.node.v1.HTTPHeader"),y(Xo,"fields",w.util.newFieldList(()=>[{no:1,name:"values",kind:"message",T:ei,repeated:!0}]));var DA=Xo,Zo=class Zo extends be{constructor(n){super();y(this,"key");y(this,"cert");y(this,"insecureSkipVerify",!1);w.util.initPartial(n,this)}static fromBinary(n,r){return new Zo().fromBinary(n,r)}static fromJson(n,r){return new Zo().fromJson(n,r)}static fromJsonString(n,r){return new Zo().fromJsonString(n,r)}static equals(n,r){return w.util.equals(Zo,n,r)}};y(Zo,"runtime",w),y(Zo,"typeName","wg.cosmo.node.v1.MTLSConfiguration"),y(Zo,"fields",w.util.newFieldList(()=>[{no:1,name:"key",kind:"message",T:ei},{no:2,name:"cert",kind:"message",T:ei},{no:3,name:"insecureSkipVerify",kind:"scalar",T:8}]));var bA=Zo,eu=class eu extends be{constructor(n){super();y(this,"enabled",!1);y(this,"url");y(this,"useSSE");y(this,"protocol");y(this,"websocketSubprotocol");w.util.initPartial(n,this)}static fromBinary(n,r){return new eu().fromBinary(n,r)}static fromJson(n,r){return new eu().fromJson(n,r)}static fromJsonString(n,r){return new eu().fromJsonString(n,r)}static equals(n,r){return w.util.equals(eu,n,r)}};y(eu,"runtime",w),y(eu,"typeName","wg.cosmo.node.v1.GraphQLSubscriptionConfiguration"),y(eu,"fields",w.util.newFieldList(()=>[{no:1,name:"enabled",kind:"scalar",T:8},{no:2,name:"url",kind:"message",T:ei},{no:3,name:"useSSE",kind:"scalar",T:8,opt:!0},{no:4,name:"protocol",kind:"enum",T:w.getEnumType(js),opt:!0},{no:5,name:"websocketSubprotocol",kind:"enum",T:w.getEnumType($s),opt:!0}]));var AA=eu,tu=class tu extends be{constructor(n){super();y(this,"enabled",!1);y(this,"serviceSdl","");w.util.initPartial(n,this)}static fromBinary(n,r){return new tu().fromBinary(n,r)}static fromJson(n,r){return new tu().fromJson(n,r)}static fromJsonString(n,r){return new tu().fromJsonString(n,r)}static equals(n,r){return w.util.equals(tu,n,r)}};y(tu,"runtime",w),y(tu,"typeName","wg.cosmo.node.v1.GraphQLFederationConfiguration"),y(tu,"fields",w.util.newFieldList(()=>[{no:1,name:"enabled",kind:"scalar",T:8},{no:2,name:"serviceSdl",kind:"scalar",T:9}]));var RA=tu,nu=class nu extends be{constructor(n){super();y(this,"key","");w.util.initPartial(n,this)}static fromBinary(n,r){return new nu().fromBinary(n,r)}static fromJson(n,r){return new nu().fromJson(n,r)}static fromJsonString(n,r){return new nu().fromJsonString(n,r)}static equals(n,r){return w.util.equals(nu,n,r)}};y(nu,"runtime",w),y(nu,"typeName","wg.cosmo.node.v1.InternedString"),y(nu,"fields",w.util.newFieldList(()=>[{no:1,name:"key",kind:"scalar",T:9}]));var ym=nu,ru=class ru extends be{constructor(n){super();y(this,"typeName","");y(this,"fieldName","");w.util.initPartial(n,this)}static fromBinary(n,r){return new ru().fromBinary(n,r)}static fromJson(n,r){return new ru().fromJson(n,r)}static fromJsonString(n,r){return new ru().fromJsonString(n,r)}static equals(n,r){return w.util.equals(ru,n,r)}};y(ru,"runtime",w),y(ru,"typeName","wg.cosmo.node.v1.SingleTypeField"),y(ru,"fields",w.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9}]));var PA=ru,iu=class iu extends be{constructor(n){super();y(this,"fieldPath",[]);y(this,"json","");w.util.initPartial(n,this)}static fromBinary(n,r){return new iu().fromBinary(n,r)}static fromJson(n,r){return new iu().fromJson(n,r)}static fromJsonString(n,r){return new iu().fromJsonString(n,r)}static equals(n,r){return w.util.equals(iu,n,r)}};y(iu,"runtime",w),y(iu,"typeName","wg.cosmo.node.v1.SubscriptionFieldCondition"),y(iu,"fields",w.util.newFieldList(()=>[{no:1,name:"field_path",kind:"scalar",T:9,repeated:!0},{no:2,name:"json",kind:"scalar",T:9}]));var Im=iu,oa=class oa extends be{constructor(n){super();y(this,"and",[]);y(this,"in");y(this,"not");y(this,"or",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new oa().fromBinary(n,r)}static fromJson(n,r){return new oa().fromJson(n,r)}static fromJsonString(n,r){return new oa().fromJsonString(n,r)}static equals(n,r){return w.util.equals(oa,n,r)}};y(oa,"runtime",w),y(oa,"typeName","wg.cosmo.node.v1.SubscriptionFilterCondition"),y(oa,"fields",w.util.newFieldList(()=>[{no:1,name:"and",kind:"message",T:oa,repeated:!0},{no:2,name:"in",kind:"message",T:Im,opt:!0},{no:3,name:"not",kind:"message",T:oa,opt:!0},{no:4,name:"or",kind:"message",T:oa,repeated:!0}]));var Xu=oa,au=class au extends be{constructor(n){super();y(this,"operations",[]);w.util.initPartial(n,this)}static fromBinary(n,r){return new au().fromBinary(n,r)}static fromJson(n,r){return new au().fromJson(n,r)}static fromJsonString(n,r){return new au().fromJsonString(n,r)}static equals(n,r){return w.util.equals(au,n,r)}};y(au,"runtime",w),y(au,"typeName","wg.cosmo.node.v1.CacheWarmerOperations"),y(au,"fields",w.util.newFieldList(()=>[{no:1,name:"operations",kind:"message",T:FA,repeated:!0}]));var bj=au,su=class su extends be{constructor(n){super();y(this,"request");y(this,"client");w.util.initPartial(n,this)}static fromBinary(n,r){return new su().fromBinary(n,r)}static fromJson(n,r){return new su().fromJson(n,r)}static fromJsonString(n,r){return new su().fromJsonString(n,r)}static equals(n,r){return w.util.equals(su,n,r)}};y(su,"runtime",w),y(su,"typeName","wg.cosmo.node.v1.Operation"),y(su,"fields",w.util.newFieldList(()=>[{no:1,name:"request",kind:"message",T:LA},{no:2,name:"client",kind:"message",T:UA}]));var FA=su,ou=class ou extends be{constructor(n){super();y(this,"operationName","");y(this,"query","");y(this,"extensions");w.util.initPartial(n,this)}static fromBinary(n,r){return new ou().fromBinary(n,r)}static fromJson(n,r){return new ou().fromJson(n,r)}static fromJsonString(n,r){return new ou().fromJsonString(n,r)}static equals(n,r){return w.util.equals(ou,n,r)}};y(ou,"runtime",w),y(ou,"typeName","wg.cosmo.node.v1.OperationRequest"),y(ou,"fields",w.util.newFieldList(()=>[{no:1,name:"operation_name",kind:"scalar",T:9},{no:2,name:"query",kind:"scalar",T:9},{no:3,name:"extensions",kind:"message",T:wA}]));var LA=ou,uu=class uu extends be{constructor(n){super();y(this,"persistedQuery");w.util.initPartial(n,this)}static fromBinary(n,r){return new uu().fromBinary(n,r)}static fromJson(n,r){return new uu().fromJson(n,r)}static fromJsonString(n,r){return new uu().fromJsonString(n,r)}static equals(n,r){return w.util.equals(uu,n,r)}};y(uu,"runtime",w),y(uu,"typeName","wg.cosmo.node.v1.Extension"),y(uu,"fields",w.util.newFieldList(()=>[{no:1,name:"persisted_query",kind:"message",T:CA}]));var wA=uu,cu=class cu extends be{constructor(n){super();y(this,"sha256Hash","");y(this,"version",0);w.util.initPartial(n,this)}static fromBinary(n,r){return new cu().fromBinary(n,r)}static fromJson(n,r){return new cu().fromJson(n,r)}static fromJsonString(n,r){return new cu().fromJsonString(n,r)}static equals(n,r){return w.util.equals(cu,n,r)}};y(cu,"runtime",w),y(cu,"typeName","wg.cosmo.node.v1.PersistedQuery"),y(cu,"fields",w.util.newFieldList(()=>[{no:1,name:"sha256_hash",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:5}]));var CA=cu,lu=class lu extends be{constructor(n){super();y(this,"name","");y(this,"version","");w.util.initPartial(n,this)}static fromBinary(n,r){return new lu().fromBinary(n,r)}static fromJson(n,r){return new lu().fromJson(n,r)}static fromJsonString(n,r){return new lu().fromJsonString(n,r)}static equals(n,r){return w.util.equals(lu,n,r)}};y(lu,"runtime",w),y(lu,"typeName","wg.cosmo.node.v1.ClientInfo"),y(lu,"fields",w.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:9}]));var UA=lu;m();T();N();function BA(e){return new Error(`Normalization failed to return a ${e}.`)}function Aj(e){return new Error(`Invalid router compatibility version "${e}".`)}m();T();N();var xd=gi(Lh(),1);function Xme(e){if(!e.conditions)return;let t=[];for(let n of e.conditions){let r=[];for(let i of n.fieldCoordinatesPath){let a=i.split(".");if(a.length!==2)throw new Error(`fatal: malformed conditional field coordinates "${i}" for field set "${e.selectionSet}".`);r.push(new lm({fieldName:a[1],typeName:a[0]}))}t.push(new dm({fieldCoordinatesPath:r,fieldPath:n.fieldPath}))}return t}function kA(e,t,n){if(e)for(let r of e){let i=Xme(r);t.push(new sl(q(q({typeName:n,fieldName:r.fieldName,selectionSet:r.selectionSet},r.disableEntityResolver?{disableEntityResolver:!0}:{}),i?{conditions:i}:{})))}}function MA(e){switch(e){case"publish":return du.PUBLISH;case"request":return du.REQUEST;case"subscribe":return du.SUBSCRIBE}}function Rj(e){var n;let t={rootNodes:[],childNodes:[],keys:[],provides:[],events:new ll({nats:[],kafka:[],redis:[]}),requires:[],entityInterfaces:[],interfaceObjects:[],requestScopedFields:[],entityCacheConfigurations:[],rootFieldCacheConfigurations:[],cachePopulateConfigurations:[],cacheInvalidateConfigurations:[]};for(let r of e.values()){let i=r.typeName,a=[...r.fieldNames],o=new Bd({fieldNames:a,typeName:i});if(r.externalFieldNames&&r.externalFieldNames.size>0&&(o.externalFieldNames=[...r.externalFieldNames]),r.requireFetchReasonsFieldNames&&r.requireFetchReasonsFieldNames.length>0&&(o.requireFetchReasonsFieldNames=[...r.requireFetchReasonsFieldNames]),r.isRootNode?t.rootNodes.push(o):t.childNodes.push(o),r.entityInterfaceConcreteTypeNames){let p=new kd({interfaceTypeName:i,concreteTypeNames:[...r.entityInterfaceConcreteTypeNames]});r.isInterfaceObject?t.interfaceObjects.push(p):t.entityInterfaces.push(p)}kA(r.keys,t.keys,i),kA(r.provides,t.provides,i),kA(r.requires,t.requires,i);let u=[],l=[],d=[];for(let p of(n=r.events)!=null?n:[])switch(p.providerType){case xd.PROVIDER_TYPE_KAFKA:{l.push(new Em({engineEventConfiguration:new pu({fieldName:p.fieldName,providerId:p.providerId,type:MA(p.type),typeName:i}),topics:p.topics}));break}case xd.PROVIDER_TYPE_NATS:{u.push(new Tm(q({engineEventConfiguration:new pu({fieldName:p.fieldName,providerId:p.providerId,type:MA(p.type),typeName:i}),subjects:p.subjects},p.streamConfiguration?{streamConfiguration:new Nm({consumerInactiveThreshold:p.streamConfiguration.consumerInactiveThreshold,consumerName:p.streamConfiguration.consumerName,streamName:p.streamConfiguration.streamName})}:{})));break}case xd.PROVIDER_TYPE_REDIS:{d.push(new hm({engineEventConfiguration:new pu({fieldName:p.fieldName,providerId:p.providerId,type:MA(p.type),typeName:i}),channels:p.channels}));break}default:throw new Error("Fatal: Unknown event provider.")}if(t.events.nats.push(...u),t.events.kafka.push(...l),t.events.redis.push(...d),r.entityCacheConfigurations)for(let p of r.entityCacheConfigurations)t.entityCacheConfigurations.push(new Xf({typeName:p.typeName,maxAgeSeconds:BigInt(p.maxAgeSeconds),notFoundCacheTtlSeconds:BigInt(p.notFoundCacheTtlSeconds),includeHeaders:p.includeHeaders,partialCacheLoad:p.partialCacheLoad,shadowMode:p.shadowMode}));if(r.rootFieldCacheConfigurations)for(let p of r.rootFieldCacheConfigurations)t.rootFieldCacheConfigurations.push(new Zf({fieldName:p.fieldName,maxAgeSeconds:BigInt(p.maxAgeSeconds),includeHeaders:p.includeHeaders,shadowMode:p.shadowMode,entityTypeName:p.entityTypeName,entityKeyMappings:p.entityKeyMappings.map(E=>new em({entityTypeName:E.entityTypeName,fieldMappings:E.fieldMappings.map(h=>new tm({entityKeyField:h.entityKeyField,argumentPath:h.argumentPath,isBatch:h.isBatch||!1}))}))}));if(r.cachePopulateConfigurations)for(let p of r.cachePopulateConfigurations)t.cachePopulateConfigurations.push(new nm({fieldName:p.fieldName,operationType:p.operationType,entityTypeName:p.entityTypeName,maxAgeSeconds:p.maxAgeSeconds==null?void 0:BigInt(p.maxAgeSeconds)}));if(r.cacheInvalidateConfigurations)for(let p of r.cacheInvalidateConfigurations)t.cacheInvalidateConfigurations.push(new rm({fieldName:p.fieldName,operationType:p.operationType,entityTypeName:p.entityTypeName}));if(r.requestScopedFields)for(let p of r.requestScopedFields)t.requestScopedFields.push(new Wf({fieldName:p.fieldName,typeName:p.typeName,l1Key:p.l1Key}))}return t}function Pj(e){var n,r;let t=[];for(let i of e){let a=i.argumentNames.map(p=>new om({name:p,sourceType:ol.FIELD_ARGUMENT})),o=new cm({argumentsConfiguration:a,fieldName:i.fieldName,typeName:i.typeName}),u=((n=i.requiredScopes)==null?void 0:n.map(p=>new cl({requiredAndScopes:p})))||[],l=((r=i.requiredScopesByOR)==null?void 0:r.map(p=>new cl({requiredAndScopes:p})))||[],d=u.length>0;if((i.requiresAuthentication||d)&&(o.authorizationConfiguration=new um({requiresAuthentication:i.requiresAuthentication||d,requiredOrScopes:u,requiredOrScopesByOr:l})),i.subscriptionFilterCondition){let p=new Xu;ey(p,i.subscriptionFilterCondition),o.subscriptionFilterCondition=p}t.push(o)}return t}function ey(e,t){if(t.and!==void 0){let n=[];for(let r of t.and){let i=new Xu;ey(i,r),n.push(i)}e.and=n;return}if(t.in!==void 0){e.in=new Im({fieldPath:t.in.fieldPath,json:JSON.stringify(t.in.values)});return}if(t.not!==void 0){e.not=new Xu,ey(e.not,t.not);return}if(t.or!==void 0){let n=[];for(let r of t.or){let i=new Xu;ey(i,r),n.push(i)}e.or=n;return}throw new Error("Fatal: Incoming SubscriptionCondition object was malformed.")}function Zme(e){if(e&&!(e.fieldWeights.size===0&&e.listSizes.size===0&&e.typeWeights.size===0&&e.directiveArgumentWeights.size===0))return new im({fieldWeights:[...e.fieldWeights.values()].map(t=>new am(W(q({},t),{argumentWeights:Object.fromEntries(t.argumentWeights)}))),listSizes:[...e.listSizes.values()].map(t=>new sm(t)),typeWeights:Object.fromEntries(e.typeWeights),directiveArgumentWeights:Object.fromEntries(e.directiveArgumentWeights)})}var dl;(function(e){e[e.Plugin=0]="Plugin",e[e.Standard=1]="Standard",e[e.GRPC=2]="GRPC"})(dl||(dl={}));var eNe=(e,t)=>{let n=stringHash(t);return e.stringStorage[n]=t,new ym({key:n})},tNe=e=>{switch(e){case"ws":return js.GRAPHQL_SUBSCRIPTION_PROTOCOL_WS;case"sse":return js.GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE;case"sse_post":return js.GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE_POST}},nNe=e=>{switch(e){case"auto":return $s.GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO;case"graphql-ws":return $s.GRAPHQL_WEBSOCKET_SUBPROTOCOL_WS;case"graphql-transport-ws":return $s.GRAPHQL_WEBSOCKET_SUBPROTOCOL_TRANSPORT_WS}},Lj=function(e){if(!qd.ROUTER_COMPATIBILITY_VERSIONS.has(e.routerCompatibilityVersion))throw Aj(e.routerCompatibilityVersion);let t=new Ud({defaultFlushInterval:BigInt(500),datasourceConfigurations:[],fieldConfigurations:[],graphqlSchema:"",stringStorage:{},typeConfigurations:[]});for(let n of e.subgraphs){if(!n.configurationDataByTypeName)throw BA("ConfigurationDataByTypeName");if(!n.schema)throw BA("GraphQLSchema");let r={enabled:!0},i=eNe(t,M1((0,Fj.lexicographicSortSchema)(n.schema))),{childNodes:a,entityInterfaces:o,events:u,interfaceObjects:l,keys:d,provides:p,requestScopedFields:E,requires:h,rootNodes:_,entityCacheConfigurations:S,rootFieldCacheConfigurations:k,cachePopulateConfigurations:B,cacheInvalidateConfigurations:K}=Rj(n.configurationDataByTypeName),ne;switch(n.kind){case dl.Standard:{r.enabled=!0,r.protocol=tNe(n.subscriptionProtocol||"ws"),r.websocketSubprotocol=nNe(n.websocketSubprotocol||"auto"),r.url=new ei({kind:Wu.STATIC_CONFIGURATION_VARIABLE,staticVariableContent:n.subscriptionUrl||n.url});break}case dl.Plugin:{ne=new Md({mapping:n.mapping,protoSchema:n.protoSchema,plugin:new fm({name:n.name,version:n.version,imageReference:n.imageReference})});break}case dl.GRPC:{ne=new Md({mapping:n.mapping,protoSchema:n.protoSchema});break}}let ee,oe,de;if(u.kafka.length>0||u.nats.length>0||u.redis.length>0){ee=zu.PUBSUB,de=new ll({kafka:u.kafka,nats:u.nats,redis:u.redis});let pe=he=>qd.ROOT_TYPE_NAMES.has(he.typeName),ge=0,H=0;for(;ge<_.length;){let he=_[ge];pe(he)?_[H++]=he:a.push(he),ge++}_.length=H}else ee=zu.GRAPHQL,oe=new pm({customScalarTypeFields:[],federation:{enabled:!0,serviceSdl:n.sdl},upstreamSchema:i,grpc:ne,fetch:{url:new ei({kind:Wu.STATIC_CONFIGURATION_VARIABLE,staticVariableContent:n.url}),method:ul.POST,header:{},body:{},baseUrl:{},path:{}},subscription:r});let me=new zf({id:n.id,childNodes:a,costConfiguration:Zme(n.costs),customEvents:de,customGraphql:oe,directives:[],entityInterfaces:o,interfaceObjects:l,keys:d,kind:ee,overrideFieldPathFromAlias:!0,provides:p,requestScopedFields:E,requestTimeoutSeconds:BigInt(10),requires:h,rootNodes:_,entityCacheConfigurations:S,rootFieldCacheConfigurations:k,cachePopulateConfigurations:B,cacheInvalidateConfigurations:K});t.datasourceConfigurations.push(me)}return t.fieldConfigurations=Pj(e.fieldConfigurations),t.graphqlSchema=e.federatedSDL,e.federatedClientSDL!==""&&(t.graphqlClientSchema=e.federatedClientSDL),new Hf({engineConfig:t,version:e.schemaVersionId,subgraphs:e.subgraphs.map(n=>({id:n.id,name:n.name,routingUrl:n.url})),compatibilityVersion:`${e.routerCompatibilityVersion}:${qd.COMPOSITION_VERSION}`})};m();T();N();var fl=gi(Oe());function wj(e){let t;try{t=(0,fl.parse)(e.schema)}catch(n){throw new Error(`could not parse schema for Graph ${e.name}: ${n}`)}return{definitions:t,name:e.name,url:e.url}}function rNe(e){let t=(0,pl.federateSubgraphs)({subgraphs:e.map(wj),version:pl.LATEST_ROUTER_COMPATIBILITY_VERSION});if(!t.success)throw new Error(`could not federate schema: ${t.errors.map(n=>n.message).join(", ")}`);return{fieldConfigurations:t.fieldConfigurations,sdl:(0,fl.print)(t.federatedGraphAST)}}function iNe(e){let t=(0,pl.federateSubgraphs)({subgraphs:e.map(wj),version:pl.LATEST_ROUTER_COMPATIBILITY_VERSION});if(!t.success)throw new Error(`could not federate schema: ${t.errors.map(r=>r.message).join(", ")}`);return Lj({federatedClientSDL:(0,fl.printSchema)(t.federatedGraphClientSchema),federatedSDL:(0,fl.printSchema)(t.federatedGraphSchema),fieldConfigurations:t.fieldConfigurations,routerCompatibilityVersion:pl.LATEST_ROUTER_COMPATIBILITY_VERSION,schemaVersionId:"",subgraphs:e.map((r,i)=>{var l,d;let a=t.subgraphConfigBySubgraphName.get(r.name),o=a==null?void 0:a.schema,u=a==null?void 0:a.configurationDataByTypeName;return{kind:dl.Standard,id:`${i}`,name:r.name,url:jb(r.url),sdl:r.schema,subscriptionUrl:jb((l=r.subscription_url)!=null?l:r.url),subscriptionProtocol:(d=r.subscription_protocol)!=null?d:"ws",websocketSubprotocol:r.subscription_protocol==="ws"?r.websocketSubprotocol||"auto":void 0,schema:o,configurationDataByTypeName:u}})}).toJsonString()}return dN(aNe);})(); /*! Bundled license information: @jspm/core/nodelibs/browser/buffer.js: diff --git a/composition/AGENTS.md b/composition/AGENTS.md new file mode 100644 index 0000000000..5410c78174 --- /dev/null +++ b/composition/AGENTS.md @@ -0,0 +1,92 @@ +# AGENTS.md — Composition Library + +## Working on Entity Caching + +When modifying entity caching logic, understand these invariants: + +### The Key Mapping Pipeline + +The flow from @key to router cache config is: + +``` +@key(fields: "...") on entity type + ↓ +extractKeyFieldSets() → KeyFieldSetData { documentNode, normalizedFieldSet, isUnresolvable } + ↓ +keyFieldSetDatasByTypeName: Map> + ↓ +validateKeyFieldSets() → keyFieldPathsByTypeNameByFieldSet (per-key dot-notation paths) + ↓ +extractPerKeyFieldPaths() → Array<{normalizedFieldSet, isUnresolvable, fieldPaths: Set}> + ↓ +buildArgumentKeyMappings() → EntityKeyMappingConfig[] (one per fully-satisfiable key) + ↓ +RootFieldCacheConfig.entityKeyMappings → serialized to protobuf → router +``` + +Each `@key` is evaluated independently. `validateKeyFieldSets()` produces dot-notation paths (e.g., `"store.id"` from `@key(fields: "store { id }")`). `extractPerKeyFieldPaths()` groups these paths per key. `buildArgumentKeyMappings()` attempts argument mapping against each key separately and emits an `EntityKeyMappingConfig` for every fully-satisfiable key. + +### Key Rule: Alternative Keys Are Independent + +Entity types can have multiple @key directives representing ALTERNATIVE keys (not combined keys): + +```graphql +type Product @key(fields: "id") @key(fields: "sku region") { ... } +``` + +These are independent — a resolver only needs to satisfy ONE key. Each key is evaluated separately and all fully-satisfiable keys produce their own `EntityKeyMappingConfig`. + +### Key Rule: Nested Keys Use Dot-Notation Paths + +`@key(fields: "store { id }")` means the entity is identified by `store.id` — a path through an object. The pipeline converts the normalized field set `"store { id }"` into the dot-notation path `"store.id"`. The `@openfed__is` directive references these paths directly: `@openfed__is(fields: "store.id")`. `FieldMappingConfig.entityKeyField` stores the dot-notation path string. + +### Where Key Data Lives + +| Stage | Location | What It Holds | +| -------------- | -------------------------------------------------------------------- | --------------------------------------------------------- | +| Per-subgraph | `keyFieldSetDatasByTypeName` | Full AST + metadata per key | +| Cross-subgraph | `entityDataByTypeName[t].keyFieldSetDatasBySubgraphName` | Keys grouped by subgraph | +| Router config | `configurationData.keys` | `RequiredFieldConfiguration[]` with selection set strings | +| Cache config | `configurationData.rootFieldCacheConfigurations[].entityKeyMappings` | Argument→key field mappings | + +### Entity Caching Validation Rules + +| Rule | What | Where | +| ---- | -------------------------------------------------------------------------------- | ------------------------ | +| 1 | @openfed\_\_entityCache requires @key | Phase 1 | +| 3 | maxAge must be positive | Phase 1 | +| 4 | @openfed\_\_queryCache only on Query fields | Phase 2 | +| 5 | @openfed\_\_queryCache return type must have @key | Phase 2 | +| 6 | @openfed\_\_queryCache return type must have @openfed\_\_entityCache | Phase 2 | +| 7 | Warning: incomplete key mapping (non-list only) | Phase 2 | +| 9 | @openfed\_\_queryCache maxAge must be positive | Phase 2 | +| 10 | @openfed\_\_is only with @openfed\_\_queryCache | Phase 2 | +| 11 | `@openfed__is(fields: "...")` must reference an existing `@key` field path | buildArgumentKeyMappings | +| 12 | No duplicate key field mappings | buildArgumentKeyMappings | +| 13 | Warning: redundant @openfed\_\_is when arg name matches key field | buildArgumentKeyMappings | +| 14 | @openfed\_\_cacheInvalidate only on Mutation/Subscription | Phase 2 | +| 16 | @openfed\_\_cacheInvalidate and @openfed\_\_cachePopulate are mutually exclusive | Phase 2 | + +### Protobuf Mapping + +TypeScript types serialize to proto messages in `shared/src/router-config/graphql-configuration.ts`: + +- `EntityCacheConfig` → `EntityCacheConfiguration` +- `RootFieldCacheConfig` → `RootFieldCacheConfiguration` +- `FieldMappingConfig` → `EntityCacheFieldMapping` +- `CachePopulateConfig` → `CachePopulateConfiguration` +- `CacheInvalidateConfig` → `CacheInvalidateConfiguration` + +Proto definitions in `proto/wg/cosmo/node/v1/node.proto`. + +### Test Expectations + +- Always pass `version: ROUTER_COMPATIBILITY_VERSION_ONE` to `batchNormalize` +- Use `getConfigForType()` helper for config extraction tests +- Assert exact config structure with `toStrictEqual()` +- Entity caching tests live in `tests/v1/directives/entity-caching.test.ts` + +### What's NOT Tested (Gaps) + +- Input object arguments mapping to key fields (multi-element `argumentPath`) +- Mixed resolvable/unresolvable keys on same type with caching diff --git a/composition/CLAUDE.md b/composition/CLAUDE.md new file mode 100644 index 0000000000..c9a72537b9 --- /dev/null +++ b/composition/CLAUDE.md @@ -0,0 +1,269 @@ +# CLAUDE.md — Composition Library + +Focus of this doc: entity caching, `@key` internals, and the composition→router +pipeline details. +For general code style, naming, test, review, and process conventions, see +[COMPOSITION_CONVENTIONS.md](./COMPOSITION_CONVENTIONS.md). +For the public API surface, see [README.md](./README.md). +For the high-level pipeline walkthrough, see [ARCHITECTURE.md](./ARCHITECTURE.md). +For entity-caching invariants specifically, see [AGENTS.md](./AGENTS.md). + +## What This Is + +The composition library normalizes and validates GraphQL subgraph schemas for federated composition. It takes individual subgraph SDL documents, validates them against federation rules, and produces `ConfigurationData` objects consumed by the Cosmo router. + +## Key Architecture + +### Entry Points + +- **`batchNormalize({ subgraphs, options })`** — Main entry. Iterates subgraphs, calls `normalizeSubgraph()` on each, aggregates entity data across subgraphs. +- **`normalize(document)`** — Single-subgraph normalization. + +### Core File: `src/v1/normalization/normalization-factory.ts` + +~4,900 lines. The `NormalizationFactory` class holds all state for a normalization pass. Key properties: + +| Property | Type | Purpose | +| -------------------------------- | --------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `parentDefinitionDataByTypeName` | `Map` | Central type registry — all objects, interfaces, scalars, enums, unions, input objects | +| `keyFieldSetDatasByTypeName` | `Map>` | Entity type → (normalized field set string → parsed key metadata) | +| `keyFieldNamesByParentTypeName` | `Map>` | Entity type → top-level field names participating in any @key | +| `entityCacheConfigByTypeName` | `Map` | @openfed\_\_entityCache directives (lookup during cache validation) | +| `configurationDataByTypeName` | `Map` | Final router configuration output | + +### Normalization Pipeline + +1. **AST Walking** (`walkers.ts`) — Extract schema definitions, type definitions, directives +2. **Key Extraction** (`extractKeyFieldSets()`) — Parse @key directives into `KeyFieldSetData` +3. **Key Validation** (`validateKeyFieldSets()` in `utils.ts`) — Validate field existence, types, no arguments +4. **External Key Evaluation** (`evaluateExternalKeyFields()`) — Validate @external key fields +5. **Entity Cache Validation** (`validateAndExtractEntityCachingConfigs()`) — Three-phase cache directive processing +6. **Configuration Output** — Attach validated configs to `ConfigurationData` + +## @key Directive — How Keys Work + +### Data Structures + +```typescript +// src/v1/normalization/types.ts +type KeyFieldSetData = { + documentNode: DocumentNode; // Parsed GraphQL AST of the selection set + isUnresolvable: boolean; // true when @key(resolvable: false) + normalizedFieldSet: string; // Canonical form: "id" or "id region" or "store { id }" + rawFieldSet: string; // Original string from SDL +}; +``` + +`keyFieldSetDatasByTypeName` is a two-level map: `TypeName → normalizedFieldSet → KeyFieldSetData`. The normalized field set string serves as both the map key and the canonical representation. + +### Normalization of Field Sets + +Raw `@key(fields: "...")` string → `safeParse('{' + rawFieldSet + '}')` → `DocumentNode` → `getNormalizedFieldSet()` which lexicographically sorts, prints, normalizes whitespace, and strips outer braces. + +Examples: + +- `"id"` → `"id"` +- `"name id"` → `"id name"` (sorted) +- `"store { id }"` → `"store { id }"` + +The `documentNode` preserves the full nested AST structure. The `normalizedFieldSet` string is a flattened canonical representation. + +### Key Shapes + +| Shape | Example | How It's Stored | +| ------------ | --------------------------------------- | --------------------------------------- | +| Single field | `@key(fields: "id")` | normalizedFieldSet: `"id"` | +| Composite | `@key(fields: "id region")` | normalizedFieldSet: `"id region"` | +| Nested | `@key(fields: "store { id }")` | normalizedFieldSet: `"store { id }"` | +| Deep nested | `@key(fields: "a { b { c } }")` | normalizedFieldSet: `"a { b { c } }"` | +| Mixed | `@key(fields: "id store { id }")` | normalizedFieldSet: `"id store { id }"` | +| Unresolvable | `@key(fields: "id", resolvable: false)` | isUnresolvable: true | + +### Key Validation Rules (in `utils.ts:validateKeyFieldSets`) + +- All fields in selection set must exist on the type +- No arguments on key fields +- No duplicate fields within a single key +- Nested selections must be on OBJECT types (not INTERFACE/UNION) +- Leaf fields must be scalars +- No inline fragments + +### Router Configuration Output + +Each validated @key becomes a `RequiredFieldConfiguration`: + +```typescript +{ fieldName: "", selectionSet: "id", disableEntityResolver?: true } +``` + +Stored in `configurationData.keys` array — one entry per @key directive. + +## Entity Caching — Current State and Known Limitations + +### Directive Hierarchy + +``` +@openfed__entityCache(maxAge: Int!) → on OBJECT types (entities with @key) +@openfed__queryCache(maxAge: Int!) → on Query fields returning cached entities +@openfed__cachePopulate(maxAge?: Int) → on Mutation/Subscription fields +@openfed__cacheInvalidate → on Mutation/Subscription fields +@openfed__is(fields: String!) → on argument definitions (maps arg → key field) +``` + +### Cache Validation (`validateAndExtractEntityCachingConfigs`) + +The entry method delegates to two helpers: + +- `extractEntityCacheDirectives` — reads @openfed\_\_entityCache off object types. + Must run first because the root-field helpers look entity types up in `entityCacheConfigByTypeName`. +- `processRootFieldCacheDirectives` — walks root types (Query/Mutation/Subscription) and dispatches + to `extractQueryCacheConfig`, `extractCacheInvalidateConfig`, `extractCachePopulateConfig`, and + `validateIsDirectivePlacement` per field. + +Configs attach directly to `ConfigurationData` keyed by the iteration's `parentTypeName` so renamed +root types (e.g., `schema { query: MyQuery }`) survive through to the router. + +Validation behavior is encoded in `tests/v1/directives/entity-caching.test.ts` and +`tests/v1/directives/entity-cache-mapping-rules.test.ts`. + +### Key Mapping Pipeline (`buildArgumentKeyMappings`) + +The `buildArgumentKeyMappings` method implements type-aware argument-to-key mapping. +Behavior is encoded in `tests/v1/directives/entity-cache-mapping-rules.test.ts`. + +**Per-key independent evaluation:** +Each `@key` directive is evaluated independently. +For `@key(fields: "id") @key(fields: "sku region")`, +the pipeline attempts argument mapping against each key separately. +ALL fully-satisfiable keys are emitted as separate `EntityKeyMappingConfig` entries. + +**Type checking:** + +- Auto-mapping compares types strictly — named type, list shape, AND `NonNull` parity must all match. + Mismatch → warning, mapping skipped. + A nullable input cannot auto-map to a non-null key field because the cache key could not be formed from a null input. +- Explicit `@openfed__is` compares named types and list shape strictly, + but nullability differences are tolerated (a nullable argument can target a non-null key field). + The user takes responsibility for handling null inputs. + Named-type or list-shape mismatch → error. +- See `entity-cache-mapping-rules.test.ts` for canonical examples + (rule 15b: explicit nullable-arg lenient; rules 40/40b/40c: nested auto-mapping strict). + +**Nested key paths:** +`@key(fields: "store { id }")` produces path `"store.id"`. +`@openfed__is(fields: "store.id")` maps an argument to that path. +Type checking resolves the leaf field type from the entity's AST. + +**Input object decomposition:** +`@openfed__is(fields: "id sku")` with an input object argument decomposes into +per-field mappings: `argumentPath: ["key", "id"]`, `argumentPath: ["key", "sku"]`. +Nested input objects map recursively to nested key structures. + +**Batch / list detection:** +List-returning fields with list arguments produce `isBatch: true` on `FieldMappingConfig`. +Multiple list arguments on the same field are rejected. + +**Extra non-key argument detection:** +Arguments not mapped to any key field → error for explicit `@openfed__is`, warning for auto-mapping. +All mappings for that key are discarded (cache key would be incomplete). + +### @openfed\_\_is Directive + +`@openfed__is(fields: String!)` — note the argument name is `fields` (plural), matching the `FIELDS` constant. +The `IS_DEFINITION` in `directive-definitions.ts` and `IS_DEFINITION_DATA` in `directive-definition-data.ts` +must both use `FIELDS`. +The `buildArgumentKeyMappingsV2` reads `arg.name.value === FIELDS` to extract @openfed\_\_is values. + +**Gotcha**: A previous bug used `FIELD` (singular) instead of `FIELDS` (plural), +silently breaking all @openfed\_\_is extraction. +Always verify the constant name matches the directive definition. + +### @openfed\_\_requestScoped Directive + +`@openfed__requestScoped(key: String!)` on `FIELD_DEFINITION` — single mandatory argument. +Extracted by `extractRequestScopedFields()` in `normalization-factory.ts`. +Produces `RequestScopedFieldConfig` on the datasource's `ConfigurationData`. + +**Symmetric semantics**: there is no receiver/provider distinction. Every field +annotated with `@openfed__requestScoped(key: "X")` in the same subgraph shares the same L1 +entry under `l1Key = "{subgraphName}.X"`. Whichever field resolves first populates +L1; subsequent fields with the same key inject from L1 and may skip their fetch. + +**Validation**: + +- `key` is mandatory (enforced by `REQUEST_SCOPED_DEFINITION_DATA.requiredArgumentNames`) +- Composition emits a `requestScopedSingleFieldWarning` when a key is used on only + one field in the subgraph — the directive is meaningless without a second reader + +### Pipeline: Composition → Router + +Changes to `FieldMappingConfig` (like adding `isBatch`) must be wired through: + +1. `composition/src/router-configuration/types.ts` — TypeScript type +2. `proto/wg/cosmo/node/v1/node.proto` — Protobuf message +3. `connect/src/wg/cosmo/node/v1/node_pb.ts` — Generated TS proto class +4. `shared/src/router-config/graphql-configuration.ts` — Proto serialization +5. `router/core/factoryresolver.go` — Go plan mapping +6. `composition-go/generate.sh` — Rebuild JS bundle + +Missing any step causes the field to silently drop from the config JSON. +Debug path: if a field is correct in composition output but missing in the final `config.json`, +check shared package serialization first. + +### Router-Tests Config Regeneration + +The `router-tests/entity_caching/testdata/config.json` is generated by a Go tool using the +composition-go bundle: + +``` +cd router-tests/entity_caching && make compose +``` + +This reads subgraph schemas from `subgraphs/*/subgraph/schema.graphqls` and writes the config +via `composition.BuildRouterConfiguration`. After changing shared/composition code, you must: + +1. Rebuild composition: `cd composition && pnpm build` +2. Rebuild shared: `cd shared && pnpm build` +3. Regenerate composition-go bundle: `cd composition-go && bash generate.sh` +4. Regenerate router-tests config: `cd router-tests/entity_caching && make compose` + +### Playground Integration + +The playground is embedded in the router binary via `//go:embed graphiql.html`. +To update it: + +``` +cd playground && pnpm build:router +``` + +This builds a single-file HTML bundle and copies it to `router/internal/graphiql/graphiql.html`. +Then restart the router to pick up the new playground. + +The playground exposes a per-request cache control dropdown (enabled / L2-only / L1-only / disabled) +that injects `X-WG-Disable-Entity-Cache*` headers transparently via a ref (not the fetcher dep array) +to avoid re-creating the fetcher and resetting the response state on mode change. + +## File Map + +| File | Purpose | +| -------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `src/v1/normalization/normalization-factory.ts` | Main normalization class (~4900 lines) | +| `src/v1/normalization/walkers.ts` | AST visitor entry points | +| `src/v1/normalization/utils.ts` | `validateKeyFieldSets()` and field set validation | +| `src/v1/normalization/types.ts` | `KeyFieldSetData`, `FieldSetData`, etc. | +| `src/v1/constants/directive-definitions.ts` | Directive AST definitions (@key, @openfed**entityCache, @openfed**queryCache, @openfed\_\_is, etc.) | +| `src/router-configuration/types.ts` | Output types: `ConfigurationData`, `EntityCacheConfig`, `FieldMappingConfig`, etc. | +| `src/errors/errors.ts` | Error message factories | +| `src/v1/warnings/warnings.ts` | Warning message factories | +| `src/utils/string-constants.ts` | Shared string constants (KEY, ENTITY_CACHE, QUERY_CACHE, IS, etc.) | +| `tests/v1/directives/entity-caching.test.ts` | Entity caching tests (45 tests) | +| `tests/v1/directives/entity-cache-mapping-rules.test.ts` | Type-aware mapping rules (76 tests) | +| `tests/v1/entities.test.ts` | Entity and @key tests (~1945 lines) | +| `tests/v1/directives/fieldset-directives.test.ts` | @key field set validation tests | + +## Test Patterns and Commands + +Moved to [COMPOSITION_CONVENTIONS.md §6 (Tests)](./COMPOSITION_CONVENTIONS.md#6-tests) +and [§9 (Build, lint, format)](./COMPOSITION_CONVENTIONS.md#9-build-lint-format). +The top-level [CLAUDE.md](../CLAUDE.md) commands cheatsheet also covers the +cross-package workflow (composition + shared + composition-go + router-tests). diff --git a/composition/COMPOSITION_CONVENTIONS.md b/composition/COMPOSITION_CONVENTIONS.md new file mode 100644 index 0000000000..ac151af575 --- /dev/null +++ b/composition/COMPOSITION_CONVENTIONS.md @@ -0,0 +1,538 @@ +# COMPOSITION_CONVENTIONS.md — Composition Package + +Source-of-truth for how code in `composition/` is expected to look and evolve. +Derived from the last 40 merged PRs touching this package (#1892 → #2648, +May 2025 → Mar 2026) and the review discussions on each. +Newer feedback takes precedence when guidance conflicts. +Older PR numbers are cited where the pattern originated or was first enforced. + +Companion docs: [README.md](./README.md) (public contract), +[ARCHITECTURE.md](./ARCHITECTURE.md) (pipeline deep-dive), +[CLAUDE.md](./CLAUDE.md) (entity caching + @key internals), +[AGENTS.md](./AGENTS.md) (entity caching invariants). + +## 1. Package layout + +``` +composition/src/ +├── index.ts # public exports — minimal, additive +├── buildASTSchema/ # schema construction helpers +├── errors/ # error factories + typed param interfaces +├── federation/ # shared federation types (public result shapes) +├── normalization/ # shared normalization types +├── resolvability-graph/ # reachability validation (graph.ts, walker/) +├── router-compatibility-version/ # ROUTER_COMPATIBILITY_VERSION_ONE +├── router-configuration/types.ts # ConfigurationData + cache/field mapping types +├── schema-building/ # build router + client schemas from merged model +├── subgraph/types.ts # Subgraph, SubgraphConfig, InternalSubgraph +├── types/ # shared branded/alias types (SubgraphName, ...) +├── utils/ # string-constants.ts, params.ts, shared helpers +├── v1/ # router-compatibility-version=1 implementation +│ ├── constants/ # split into dedicated modules (see §3) +│ │ ├── constants.ts +│ │ ├── directive-definitions.ts +│ │ ├── integers.ts +│ │ ├── non-directive-definitions.ts +│ │ ├── strings.ts +│ │ └── type-nodes.ts +│ ├── federation/ # federation-factory.ts + params +│ ├── normalization/ # normalization-factory.ts + walkers + utils +│ ├── schema-building/ +│ ├── subgraph/ +│ ├── utils/ +│ └── warnings/ +└── warnings/ # shared warning types + +composition/tests/v1/ # mirrors v1/ layout +├── directives/ # one file per directive (authorization, entity-caching, ...) +├── types/ # per-GraphQL-type tests (interfaces, unions, ...) +├── utils/ # shared test helpers + SDL fragments +└── test-data/ +``` + +**Rules:** + +- Router-compatibility-version-scoped code lives under `v1/`. + Add `v2/` siblings when version 2 work starts. + Do not mix v1 and v-neutral code in the same module. +- Public types (`FederationResult`, `FederationSuccess`, `FederationFailure`, + `Subgraph`, `SubgraphConfig`, `ConfigurationData`) live in version-neutral + directories (`federation/`, `subgraph/`, `router-configuration/`) — they are + the package's ABI and must stay stable across version implementations. +- When adding a new directive, put its data in `v1/constants/directive-definitions.ts`, + its string constants in `v1/constants/strings.ts` or `src/utils/string-constants.ts`, + its extraction logic in `v1/normalization/`, and its tests in a dedicated file + under `tests/v1/directives/` (PR #2290 #2307 #2348). + +## 2. Public API surface + +Entry points (see `src/index.ts` and `ARCHITECTURE.md §1`): + +- `federateSubgraphs({ subgraphs, version?, options? })` +- `federateSubgraphsWithContracts(...)` +- `federateSubgraphsContract(...)` +- `normalizeSubgraph(...)` +- `batchNormalize({ subgraphs, version })` + +**Rules:** + +- `federateSubgraphs` takes an **options object**, never positional arguments (PR #2648). + New flags go on that options object, not as extra positional params. +- When adding an option (e.g. `disableResolvabilityValidation`, `ignoreExternalKeys`), + wire it through **every** public path — `federateSubgraphs`, + `federateSubgraphsWithContracts`, `federateSubgraphsContract` — and add a + direct regression test per path (PR #2595). +- Options construction is duplicated easily between call-sites; + build the options object **once** in a local constant and reuse (PR #2595). +- `FederationResult` is a discriminated union of `FederationSuccess` and + `FederationFailure` on `success: true | false`. + Both share `success` and `warnings`. +- New fields on `FederationSuccess` are allowed when they are **optional** + (e.g. `schemaNode`, `shouldIncludeClientSchema` — PR #2325 #2330). +- Update `README.md` in the **same PR** as any API-shape change. + README is part of the public contract, not documentation-after-the-fact (PR #2648). + +## 3. Naming and constants + +These rules came up repeatedly in review — expect feedback if you break them. + +### 3.1 Use typed name aliases, not raw `string` + +Prefer the aliases defined in `src/types/`: `FieldName`, `FieldCoords`, +`SubgraphName`, `TypeName`, `NodeType` (PR #2117 introduced the aliases; +PR #2307 #2330 #2338 expanded adoption). + +```ts +// good +const keyFieldNamesByParentTypeName: Map>; +function invalidSubgraph(name: SubgraphName): string; + +// bad — untyped strings +const keyFieldNamesByParentTypeName: Map>; +``` + +**Exception:** when the value is semantically not one of those entities (e.g. an +array of error-message strings), type it as `Array` — do NOT reuse +`Array` just because strings-to-strings (PR #2338). + +### 3.2 Align alias types across related structs + +If `Subgraph.name: SubgraphName`, then `InternalSubgraph.name` should be +`SubgraphName` too — don't let one side drift to `string` (PR #2338). +Apply the same rule to per-subgraph collections: prefer +`Map` / `Set` over `Map` in +fields like `externalFieldDataBySubgraphName`, `keyFieldSetDatasBySubgraphName`, +`configureDescriptionDataBySubgraphName`, `interfaceObjectSubgraphs` +(PR #2117). + +### 3.3 Use named constants for magic strings + +Define named constants for any string literal that appears in the AST or +directive-argument logic (PR #2348, #2307). +Examples: `LITERAL_PERIOD`, `TYPENAME`, `FIELDS`, `KEY`, `ENTITY_CACHE`. + +Live in: + +- `src/utils/string-constants.ts` — shared across versions +- `src/v1/constants/strings.ts` — v1-scoped + +**Gotcha:** the `@openfed__is` directive argument is **`fields`** (plural) — +constant name is `FIELDS`. +A past bug used `FIELD` (singular) and silently broke extraction (see +`CLAUDE.md` §"@openfed\_\_is Directive"). + +### 3.4 Test constants must match source constants + +If the source constant is `CONNECT_CONFIGURE_RESOLVER`, the test export is +`CONNECT_CONFIGURE_RESOLVER_DIRECTIVE` — not `CONNECT_FIELD_RESOLVER_DIRECTIVE` +(PR #2290). +Naming drift between `src/` and `tests/` trips grep and refactors. + +### 3.5 `Array` over `T[]` in exported signatures + +Use `Array` rather than `string[]` in exported function signatures and +type definitions, matching the existing style (PR #2449). + +## 4. Directive handling + +Directives are declared as `DirectiveDefinitionData` objects and consumed from a +single registry. + +**Per directive, you touch:** + +1. `src/v1/constants/directive-definitions.ts` — `DirectiveDefinitionNode` + (the AST representation, with `locations`). +2. `src/v1/normalization/directive-definition-data.ts` — `*_DEFINITION_DATA` + object with `argumentTypeNodeByName`, `requiredArgumentNames`, + `optionalArgumentNames`, `isRepeatable`, `locations`. +3. `src/v1/constants/strings.ts` — directive name + argument name constants. +4. `src/v1/normalization/utils.ts` (or dedicated file) — extraction logic. +5. `tests/v1/directives/.test.ts` — tests. + +**Rules:** + +- Every argument declared in `argumentTypeNodeByName` must also appear in either + `requiredArgumentNames` or `optionalArgumentNames` — missing entries were flagged + in review as an incomplete definition (PR #2290: NATS_SUBSCRIBE example). +- Directive-definition _shapes_ were consolidated to `DirectiveDefinitionNode` + (PR #2307). + Don't invent parallel representations. +- Persisted-directive extraction is **centralized** — route new persisted + directives through the shared extractor rather than adding bespoke traversal + (PR #2307). +- Directive-injection is **selective**: only inject the definitions a subgraph + actually uses (PR #2307). + When adding a new directive, decide whether it is always injected or + conditionally-injected, and wire it into the selective-injection mechanism. +- **Two sources of truth must agree.** + A directive has both a `*_DEFINITION` (AST node in `v1/constants/` or + `v1/utils/constants.ts`) and a `*_DEFINITION_DATA` (normalization struct in + `v1/normalization/directive-definition-data.ts`). + Their `isRepeatable` and `locations` must match. + PR #2225 flagged `ONE_OF_DEFINITION` (repeatable: true) vs + `ONE_OF_DEFINITION_DATA` (repeatable: false) as a merge blocker — the + federation and normalization layers disagreed silently. +- **Persisted directive repeatability is enforced** against + `NON_REPEATABLE_PERSISTED_DIRECTIVES`. + Check this list when declaring a new directive as non-repeatable. +- **Internal federation directives use the `openfed__` prefix** + (`@openfed__requireFetchReasons`, `@openfed__configureDescription`, + `@openfed__fieldSet`). + Use the same prefix for new internal-only directives (PR #2170 #2256). +- **EDFS directives follow `edfs__`** — + `edfs__natsPublish`, `edfs__kafkaSubscribe`, `edfs__redisPublish`, + `edfs__redisSubscribe` (PR #1810). + Adding a new provider means constants + normalization factory + proto + + router + full test coverage in one coherent pass. + +## 5. Error and warning factories + +Errors and warnings live in `src/errors/errors.ts` and `src/v1/warnings/warnings.ts` +as **factory functions**. + +**Rules:** + +- **Typed param objects over positional arguments** for any factory with 2+ params. + This migration began in PR #2279 (`incompatibleParentKindMergeError` → + `incompatibleParentTypeMergeError` with `IncompatibleParentTypeMergeErrorParams`) + and is now the default; PR #2348 enforces it on new factories. + Define a `*Params` interface next to the factory and export it alongside: + + ```ts + export type NonExternalConditionalFieldErrorParams = { + fieldCoordinates: string; + path: string; + // ... + }; + export function nonExternalConditionalFieldError( + params: NonExternalConditionalFieldErrorParams, + ): Error { ... } + ``` + +- **Error messages expand with step-by-step guidance** for user-facing remediation + when the fix is non-obvious (PR #2456). + Treat errors as documentation for people hitting them. +- **Multi-line error formatting** is intentional. + Keep `\n` and indentation as written — `composition-go/index.global.js` bundles + literal strings and diffs against them (PR #2456). +- When a warning receives a collection that the caller may mutate later, pass a + **shallow copy** (`[...arr]`) to decouple the reference (PR #2449). +- **Deep-copy Maps of Sets/Maps** when threading per-subgraph state through + field-data copies (PR #2221). + Assigning by reference leaks mutations across copies and corrupts federation + output. + Canonical pattern: + + ```ts + // good + nullLevelsBySubgraphName: new Map( + Array.from(src.nullLevelsBySubgraphName, ([k, v]) => [k, new Set(v)]), + ), + // bad — shared reference + nullLevelsBySubgraphName: src.nullLevelsBySubgraphName, + ``` + +- When introducing a new error, flag the `README.md §Contributing` note: + "GraphQL types begin with a capital letter for clarity" (Enum, Input Object, + Interface, Object, Scalar, Union) — apply this to **all** error messages you + write or edit (PR #2648 README). + +## 6. Tests + +Tests run on **vitest** (`npx vitest run`). +Helper SDL fragments live in `tests/v1/utils/` and are named with two-letter +scheme constants (`fnaa`, `fnab`, `jaaa`, `jaab`, ...) — exported from the test +file and composed into scenarios. + +### 6.1 Assertions + +- **`toStrictEqual` on whole configs**, not field-by-field. + See `getConfigForType()` helper pattern in `AGENTS.md`. +- **Compare errors strictly** — do not substring-match error messages. + "Main issue is the tests do not strictly compare errors" was an explicit + `CHANGES_REQUESTED` review (Aenimus, PR #2470). +- **`federateSubgraphsSuccess` is not self-asserting** — always include + `expect(success).toBe(true)` even if the helper name implies it (PR #2298). +- Always pass `ROUTER_COMPATIBILITY_VERSION_ONE` to `batchNormalize`. +- **Use the success/failure helpers, not raw `federateSubgraphs`.** + Prefer `federateSubgraphsSuccess` / `federateSubgraphsFailure` / + `normalizeSubgraphSuccess` / `normalizeSubgraphFailure` + (Aenimus on PR #1997: "A great opportunity to update to + `federateSubgraphSuccess` ;)"; also on PR #1810 events tests). +- **Normalize SDL before string comparison.** + Direct string equality on multi-line SDL strings is brittle across whitespace + and directive-order changes. + Define a small `expectClientSchema(actual, expected)` helper that normalizes + both sides once (PR #2232). +- **For directive-emission tests, assert both server SDL and client SDL.** + The client schema is produced via `printSchemaWithDirectives` and may include + or exclude directives differently from the server schema (PR #2232). +- **Use exported constants (`QUERY`, `MUTATION`, `SUBSCRIPTION`) in tests** + rather than the literal string `'Query'` / `'Mutation'` / `'Subscription'` + (PR #2232). + +### 6.2 Test titles + +- **Title must match behavior.** + "…returns an error" is wrong if the test asserts success (PR #2298). +- **No typos.** + "will included" → "will be included", "frm" → "from" were blockers (PR #2298). +- Fix title grammar as part of the PR that changed the behavior the test covers, + not in a follow-up. + +### 6.3 Test hygiene + +- **No duplicate tests.** + Copy-paste with identical subgraphs, description, and assertions is a merge + blocker (PR #2454 — two identical `@authenticated` tests). + Either delete the duplicate or diff the scenario. +- **No unused SDL constants.** + If `fpaa`/`fpab` are defined but no test references them, delete or wire them up + (PR #2454). +- **One file per directive** under `tests/v1/directives/`. + Use the existing naming (`entity-caching.test.ts`, `authorization-directives.test.ts`, + `connect-configure-resolver.test.ts`). + +### 6.4 Coverage + +- Codecov reports on PRs but does not block merges — the project coverage floor + is ~40%. + Aim for coverage of **your change**, not the whole repo (PR #2470 had 8.8% + patch coverage and still merged after review). +- When adding a new option or public path, add a dedicated regression test + rather than relying on incidental coverage (PR #2595). +- **Refactor-only PRs still need tests.** + "Should we write some tests?" was an explicit `CHANGES_REQUESTED` on PR #2013 + (a chore/refactor PR). + "chore:"-prefixed PRs are not exempt from the test expectation. +- **Integration tests for new options** should cover both the enabled and the + disabled case with proper setup and cleanup — see the + `disableResolvabilityValidation` test pattern in PR #2065. + +## 7. Walkers and graph code + +`src/resolvability-graph/` and the walkers under +`src/v1/normalization/walkers.ts` return result objects. +Feedback on PR #2240 #2298 #2568 crystallized these rules: + +- When adding a new return field (e.g. `isExternal`, `areDescendantsResolved`), + propagate it through **every** call-site — don't fix one branch and leave the + shared/concrete branches silently dropping the value. +- For paths whose existence depends on traversal history (nested entities, + shared root fields), add an explicit code comment stating the invariant: + `// The path may not exist from the root walker due to nested entities.` + (Aenimus review, PR #2499). +- Extend `VisitNodeResult` / `VisitEntityParams` rather than piggy-backing a + boolean on an existing field. +- **Construct param objects once and reuse.** + `NodeResolutionData` takes a `NodeResolutionDataParams` object, not a raw + `GraphNode`. + Building the param object once and passing it through every call site keeps + types honest under strict checking (PR #2240). +- **Watch for accumulator initializers with short-circuit operators.** + `let removeDescendantPaths: boolean | undefined = undefined;` followed by + `removeDescendantPaths &&= isRevisitedNode` stays `undefined` forever — + the `&&=` operator never writes to a falsy LHS. + Initialize to `true` when accumulating "all branches agreed" state + (PR #2240). +- **Reset per-parent visitor flags** (e.g. `isParentObjectProtected`) before + processing each type. + `extractDirectives` early-returns on directive-free nodes, so flags from a + previous parent can leak into unrelated types and mark fields incorrectly + (PR #2225). +- **Use switch-case block scoping.** + Wrap case bodies in `{ ... }` when declaring local variables — otherwise + the declarations are accessible in sibling cases and cause subtle bugs. + Flagged on the `Kind.INPUT_OBJECT_TYPE_DEFINITION` @oneOf validation (PR #2225). +- **Federated emission across subgraphs must be deterministic.** + When collapsing per-subgraph data (e.g. `nullLevelsBySubgraphName`, + `configureDescriptionDataBySubgraphName`) into a single emitted directive, + compute a **deterministic union** across all subgraphs. + Using `getFirstEntry(map)` produces order-dependent output and different + federated schemas across runs (PR #2221). + +### 7.1 Collection helpers + +- **Do not use `Set.prototype.intersection`** — not available across all + supported runtimes. + Prefer `new Set([...a].filter((x) => b.has(x)))` (PR #2117). +- Prefer `Array` over `T[]` in signatures (see §3.5). + +## 8. Pipeline consistency (composition → router) + +This is the single most common source of silently-dropped functionality. +See `CLAUDE.md §"Pipeline: Composition → Router"` for the canonical list. +Summary of the steps **every** config-type change must touch: + +1. `composition/src/router-configuration/types.ts` — TS type. +2. `composition/` extraction logic. +3. `proto/wg/cosmo/node/v1/node.proto` — protobuf (use `reserved` for removed fields). +4. `make generate-go` — regenerates Go proto. +5. `connect/src/wg/cosmo/node/v1/node_pb.ts` — generated TS proto class. +6. `shared/src/router-config/graphql-configuration.ts` — proto serialization. +7. `router/core/factoryresolver.go` — proto → planner metadata. +8. `composition-go/generate.sh` — rebuild JS bundle (rebuild `composition` + + `shared` first). +9. `router-tests/entity_caching && make compose` — regenerate integration config. + +**If a field appears in composition output but is missing from the router config +JSON, check the shared-package serializer first.** + +## 9. Build, lint, format + +See `package.json` — scripts are authoritative. + +- `pnpm build` → `rm -rf dist && tsc`. +- `pnpm test` → `vitest run`. +- `pnpm lint` → `prettier --check .` (read-only). +- `pnpm format` → `prettier --write .` (writes). +- `pnpm lint:fix` → runs eslint with `--fix` then `pnpm format`. + +**Rules:** + +- **Keep `format` as write-only and `lint` as check-only.** + Don't mix `-w` and `-c` flags on a single prettier call (PR #2579). +- When adding a Makefile target, add it to `.PHONY` (PR #2405 flagged the + controlplane Makefile; same rule applies here). +- Dependency bumps (e.g. `@graphql-tools/utils` 10 → 11, `vitest` 2 → 3) + live in their own PR (PR #2114 #2495). + Don't fold them into feature work. +- **Use POSIX shell commands in `build` scripts**, not cross-platform Node + wrappers. + Canonical form: `"build": "rm -rf dist && tsc"` (PR #2219 removed `del-cli` + across the workspace). + CI runs bash; + contributors on Windows use WSL. + Don't reintroduce `del-cli` or similar wrappers as dev-dependencies. + +## 10. Contributing and review workflow + +Observed patterns from the 20-PR sample: + +- **@coderabbitai** provides automated review. + Its findings are advisory; + the maintainer (primarily **@Aenimus** for the TS side) still gates merges. +- **CHANGES_REQUESTED → iterate → APPROVED** is normal. + PR #2470 went through three rounds before landing. +- **Cross-team approval** is split: composition/TS reviewer approves the TS + changes (`"From composition/TS perspective, LGTM!"`), router/protographic + reviewer approves the Go/proto side separately. + Tag both in cross-cutting PRs. +- **Revert PRs** use the `fix:` prefix, not `revert:` (PR #2328: + `fix: revert propagating schema extension node to router`). +- Commit/PR title convention: + - `feat:` new functionality + - `fix:` bug fix (including reverts) + - `chore:` refactor, test additions, internal propagation + - `docs(composition):` README / ARCHITECTURE / doc changes + +## 11. Refactoring discipline + +- **Extract duplicated logic.** + `buildSubgraphConfigMap()` and the config-building blocks in + `buildFederationResult` / `buildFederationContractResult` were flagged as + copy-paste duplicates (PR #2307). + Before duplicating a block across two federation paths, extract a helper. +- **Avoid `as any` casts.** + They pass type-checking at the cost of refactor safety (PR #2307 review). + Prefer distributive conditionals or overloads; + accept the cast only when the alternative is materially more complex, and + document why. +- **Don't leave unused constructor parameters.** + If `NormalizationFactory` takes `CompositionOptions` but never reads + `this.options`, either remove the parameter or add a comment explaining the + intent for future use (PR #2595 review). +- **Don't mix unrelated changes in one PR.** + PR #2013 was flagged for incidentally bringing in Redis/EDFS constants + (`CHANNEL`, `EDFS_REDIS_*`) that had nothing to do with the inheritable-directive + refactor it claimed to do. + Rebase cleanly or split the PR when you notice drift. +- **Name parameters descriptively.** + `removeInheritedDirectives` was flagged as ambiguous — + `excludeInheritedDirectiveNames` (or similar) makes the filter semantics + explicit (PR #2013). + +## 12. Documentation updates + +Triggers that require a doc edit in the same PR: + +| Change | Update | +| -------------------------------------------------------- | ---------------------------------------------- | +| Public API signature (`federateSubgraphs`, result types) | `README.md` | +| Pipeline structure, new stage, new directive family | `ARCHITECTURE.md` | +| Entity-caching behavior | `CLAUDE.md` + `AGENTS.md` | +| New convention surfaced in review | this file (`COMPOSITION_CONVENTIONS.md`) | +| New error message | `README.md §Contributing` capitalization check | + +## 13. Quick reference — things reviewers will block on + +These are the concrete issues that caused `CHANGES_REQUESTED` in the sample. +Fix them before asking for review, not after. + +- Tests using substring match on errors instead of strict comparison. +- Missing `expect(success).toBe(true)` after `federateSubgraphsSuccess`. +- Test title that describes an error but asserts success. +- Typos in test titles ("will included", "frm"). +- Duplicate test cases (identical subgraphs + description + assertions). +- Unused SDL constants in a test file. +- Magic string literals where a `*_CONSTANT` exists. +- `string[]` where `Array` is the house style. +- `as any` casts without justification. +- Positional args on 2+-param error factories (should be a typed param object). +- Missing `optionalArgumentNames`/`requiredArgumentNames` entries for a declared + directive argument. +- Forgetting to update `README.md` when changing `federateSubgraphs` shape. +- Forgetting any step in the composition → router pipeline (silent config drop). +- Mixing `-w` and `-c` flags on prettier scripts. +- New flag added to one of `federateSubgraphs` / `...WithContracts` / + `...Contract` but not the other two. +- `isRepeatable` / `locations` disagreement between `*_DEFINITION` and + `*_DEFINITION_DATA` for the same directive. +- Per-subgraph `Map`/`Set` assigned by reference instead of deep-copied. +- Federated emission that picks `getFirstEntry(...)` instead of computing a + deterministic union across subgraphs. +- `Set.prototype.intersection` used (not universally supported — use + `[...a].filter(x => b.has(x))`). +- Switch case body declaring `let`/`const` without `{ ... }` block scope. +- Per-parent visitor flag (e.g. `isParentObjectProtected`) not reset between + types. +- Positional-argument error factory where the rest of the codebase uses + `*Params` object parameters. +- Test using `federateSubgraphs(...)` directly instead of the + `federateSubgraphsSuccess` / `Failure` helper. +- SDL string-equality assertion without a normalization helper. +- `'Query'` / `'Mutation'` / `'Subscription'` literal in a test instead of the + exported `QUERY` / `MUTATION` / `SUBSCRIPTION` constant. +- Directive-emission test that only asserts the server SDL and ignores the + client SDL. +- Chore/refactor PR without any tests (PR #2013). +- Unrelated changes folded into a focused PR (flagged on PR #2013; split or + rebase). +- `build` script reintroducing `del-cli` or similar wrapper (should be + `rm -rf dist && tsc`). + +--- + +**Sample:** 40 merged PRs, #1892 → #2648 (May 2025 → March 2026). +When this doc and the referenced PRs disagree, the newer PR wins — +open a PR to update this file rather than silently deviating. diff --git a/composition/src/errors/errors.ts b/composition/src/errors/errors.ts index cdbc701cf1..03c10b7f3a 100644 --- a/composition/src/errors/errors.ts +++ b/composition/src/errors/errors.ts @@ -1705,6 +1705,288 @@ export function oneOfRequiredFieldsError({ requiredFieldNames, typeName }: OneOf ); } +// Entity caching directive error messages. +// These are reported during composition when subgraph schemas use entity caching directives +// incorrectly. Each error corresponds to a validation rule in validateAndExtractEntityCachingConfigs(). + +// @openfed__entityCache requires the type to be a federation entity (must have @key) +export function entityCacheWithoutKeyErrorMessage(typeName: string): string { + return `Type "${typeName}" has @openfed__entityCache but no @key directive.`; +} + +// @openfed__queryCache must only be defined on fields of the root query type. +// Mutation/Subscription fields use @openfed__cachePopulate or @openfed__cacheInvalidate. +// The root query type may be renamed via `schema { query: MyQuery }`; this validation runs +// after resolving the canonical root type, so the field coords reported here reflect the +// declared (possibly renamed) type. +export function queryCacheOnNonQueryFieldErrorMessage(fieldCoords: string): string { + return ( + `@openfed__queryCache must only be defined on fields of the root query type; found on "${fieldCoords}".` + + ` Use @openfed__cachePopulate or @openfed__cacheInvalidate on mutation or subscription fields.` + ); +} + +// @openfed__queryCache requires the return type to be a federation entity — non-entity types have no @key for cache key construction +export function queryCacheOnNonEntityReturnTypeErrorMessage(fieldCoords: string, returnType: string): string { + return ( + `Field "${fieldCoords}" has @openfed__queryCache but returns non-entity type "${returnType}".` + + ` @openfed__queryCache requires the return type to be an entity with @key.` + ); +} + +// Shared validation for maxAge across @openfed__entityCache, @openfed__queryCache, and @openfed__cachePopulate +export function maxAgeNotPositiveIntegerErrorMessage(directiveName: string, value: number): string { + return `@${directiveName} maxAge must be a positive integer, got "${value}".`; +} + +// Validation for @openfed__entityCache negativeCacheTTL. 0 disables negative caching; negative values rejected. +export function negativeCacheTTLNotNonNegativeIntegerErrorMessage(directiveName: string, value: number): string { + return `@${directiveName} negativeCacheTTL must be a non-negative integer, got "${value}".`; +} + +// @openfed__is maps arguments to @key fields — it's meaningless without @openfed__queryCache since only @openfed__queryCache uses argument-to-key mappings +export function isWithoutQueryCacheErrorMessage(argumentName: string, fieldCoords: string): string { + return `@openfed__is on argument "${argumentName}" of field "${fieldCoords}" has no effect without @openfed__queryCache.`; +} + +// @openfed__is(fields: "...") must reference a field that appears in the entity's @key directive +export function isReferencesUnknownKeyFieldErrorMessage( + isField: string, + argumentName: string, + fieldCoords: string, + entityType: string, +): string { + return ( + `@openfed__is(fields: "${isField}") on argument "${argumentName}" of field "${fieldCoords}"` + + ` references unknown @key field "${isField}" on type "${entityType}".` + ); +} + +// Each @key field may only be mapped to one argument — duplicates would create ambiguous cache keys +export function duplicateKeyFieldMappingErrorMessage(fieldCoords: string, keyField: string): string { + return `Multiple arguments on field "${fieldCoords}" map to @key field "${keyField}".`; +} + +// @openfed__cacheInvalidate is for side-effect operations — Query fields should use @openfed__queryCache instead +export function cacheInvalidateOnNonMutationSubscriptionFieldErrorMessage(fieldCoords: string): string { + return `@openfed__cacheInvalidate is only valid on Mutation or Subscription fields, found on "${fieldCoords}".`; +} + +// @openfed__cacheInvalidate needs to know which entity to evict — non-entity return types have no cache key +export function cacheInvalidateOnNonEntityReturnTypeErrorMessage(fieldCoords: string, returnType: string): string { + return `Field "${fieldCoords}" has @openfed__cacheInvalidate but returns non-entity type "${returnType}".`; +} + +// @openfed__cachePopulate is for side-effect operations — Query fields should use @openfed__queryCache instead +export function cachePopulateOnNonMutationSubscriptionFieldErrorMessage(fieldCoords: string): string { + return `@openfed__cachePopulate is only valid on Mutation or Subscription fields, found on "${fieldCoords}".`; +} + +// @openfed__cachePopulate needs to know which entity to write — non-entity return types have no cache key +export function cachePopulateOnNonEntityReturnTypeErrorMessage(fieldCoords: string, returnType: string): string { + return `Field "${fieldCoords}" has @openfed__cachePopulate but returns non-entity type "${returnType}".`; +} + +// A field cannot both populate and invalidate — these are contradictory cache operations +export function cacheInvalidateAndPopulateMutualExclusionErrorMessage(fieldCoords: string): string { + return ( + `Field "${fieldCoords}" has both @openfed__cacheInvalidate and @openfed__cachePopulate.` + + ` A field must use one or the other, not both.` + ); +} + +export function explicitTypeMismatchErrorMessage( + argumentName: string, + fieldCoords: string, + argumentType: string, + isField: string, + entityType: string, + keyFieldType: string, +): string { + return `Argument "${argumentName}" on field "${fieldCoords}" has type "${argumentType}" but @openfed__is(fields: "${isField}") targets @key field "${isField}" of type "${keyFieldType}" on entity "${entityType}".`; +} + +export function nonKeyFieldSpecErrorMessage( + argumentName: string, + fieldCoords: string, + isField: string, + entityType: string, +): string { + return `Argument "${argumentName}" on field "${fieldCoords}" uses @openfed__is(fields: "${isField}"), but "${isField}" is not a @key field on entity "${entityType}". @openfed__is can only target fields that are part of a @key.`; +} + +export function listArgumentToScalarKeySpecErrorMessage( + argumentName: string, + fieldCoords: string, + argumentType: string, + isField: string, + entityType: string, + keyFieldType: string, +): string { + return ( + `Argument "${argumentName}" on field "${fieldCoords}" has type "${argumentType}" but @openfed__is(fields: "${isField}") targets @key field "${isField}" of type "${keyFieldType}" on entity "${entityType}".` + + ' List arguments can only map to scalar key fields when the field returns a list of entities, or to list key fields when the key field itself is a list type.' + ); +} + +export function scalarArgumentToListKeySpecErrorMessage( + argumentName: string, + fieldCoords: string, + argumentType: string, + isField: string, + entityType: string, + keyFieldType: string, +): string { + return ( + `Argument "${argumentName}" on field "${fieldCoords}" has type "${argumentType}" but @openfed__is(fields: "${isField}") targets @key field "${isField}" of type "${keyFieldType}" on entity "${entityType}".` + + ' A scalar argument cannot map to a list key field.' + ); +} + +export function explicitIncompleteCompositeKeyErrorMessage( + fieldCoords: string, + argumentName: string, + mappedField: string, + entityType: string, + compositeKey: string, + missingField: string, +): string { + return `Field "${fieldCoords}" has argument "${argumentName}" with @openfed__is mapping to @key field "${mappedField}" on entity "${entityType}", but composite @key "${compositeKey}" is incomplete because no argument maps to required key field "${missingField}".`; +} + +export function explicitSingularAdditionalNonKeyArgumentErrorMessage( + fieldCoords: string, + argumentName: string, + keyField: string, + entityType: string, + extraArgument: string, +): string { + return `Field "${fieldCoords}" has argument "${argumentName}" with @openfed__is mapping to @key field "${keyField}" on entity "${entityType}", but also has additional argument "${extraArgument}" which is not mapped to a key field. All arguments must be key arguments — additional arguments may filter the response, making the cache key incomplete.`; +} + +export function explicitCompositeAdditionalNonKeyArgumentErrorMessage( + fieldCoords: string, + firstArgument: string, + secondArgument: string, + compositeKey: string, + entityType: string, + extraArgument: string, +): string { + return `Field "${fieldCoords}" has arguments "${firstArgument}" and "${secondArgument}" with @openfed__is mappings covering composite @key "${compositeKey}" on entity "${entityType}", but also has additional argument "${extraArgument}" which is not mapped to a key field. All arguments must be key arguments — additional arguments may filter the response, making the cache key incomplete.`; +} + +export function batchListValuedKeyRequiresNestedListsErrorMessage( + fieldCoords: string, + isField: string, + entityType: string, + actualType: string, +): string { + return `Field "${fieldCoords}" returns a list of entities, so cache lookup is a batch lookup and requires one key value per entity. Because @openfed__is(fields: "${isField}") targets list-valued @key field "${isField}" on entity "${entityType}", the argument must provide a list of tag lists (e.g., "[[String!]!]!"), not ${actualType}.`; +} + +export function explicitBatchAdditionalNonKeyArgumentErrorMessage( + fieldCoords: string, + argumentName: string, + keyField: string, + entityType: string, + extraArgument: string, +): string { + return `Field "${fieldCoords}" returns a list of entities, so cache lookup is a batch lookup and requires a single key input that determines the returned entities. Argument "${argumentName}" uses @openfed__is to map to @key field "${keyField}" on entity "${entityType}", but additional argument "${extraArgument}" is not mapped to a key field and may filter the response, so the batch key would be incomplete.`; +} + +export function explicitScalarArgumentsCannotEstablishBatchMappingErrorMessage( + fieldCoords: string, + entityType: string, +): string { + return `Field "${fieldCoords}" returns a list of entities, so cache lookup is a batch lookup and requires one key value per entity. Scalar arguments with @openfed__is mapping to @key fields on entity "${entityType}" cannot provide a batch of keys, so they cannot establish cache key mappings for this field. Use list arguments for batch cache lookups.`; +} + +export function multipleListArgumentsBatchFactoryMessage(fieldCoords: string, entityType: string): string { + return ( + `Field "${fieldCoords}" has multiple list arguments mapping to @key fields on entity "${entityType}".` + + ' Batch cache lookups require a single list argument.' + + ' For composite keys, use a single list of input objects instead.' + ); +} + +export function inputObjectCompositeTypeMismatchErrorMessage( + argumentName: string, + fieldCoords: string, + keyFields: string, + entityType: string, + inputType: string, + inputFieldName: string, + inputFieldType: string, + entityFieldPath: string, + entityFieldType: string, +): string { + return ( + `Argument "${argumentName}" on field "${fieldCoords}" uses @openfed__is(fields: "${keyFields}") mapping to composite @key on entity "${entityType}",` + + ` but input type "${inputType}" field "${inputFieldName}" has type "${inputFieldType}"` + + ` which does not match key field "${entityFieldPath}" of type "${entityFieldType}".` + ); +} + +export function inputObjectCompositeMissingFieldErrorMessage( + argumentName: string, + fieldCoords: string, + keyFields: string, + entityType: string, + inputType: string, + missingFieldName: string, +): string { + return ( + `Argument "${argumentName}" on field "${fieldCoords}" uses @openfed__is(fields: "${keyFields}") mapping to composite @key on entity "${entityType}",` + + ` but input type "${inputType}" is missing required key field "${missingFieldName}".` + ); +} + +export function nestedInputObjectTypeMismatchErrorMessage( + argumentName: string, + fieldCoords: string, + keyFields: string, + entityType: string, + inputType: string, + inputFieldName: string, + inputFieldType: string, + entityFieldPath: string, + entityFieldType: string, +): string { + return ( + `Argument "${argumentName}" on field "${fieldCoords}" maps to nested @key "${keyFields}" on entity "${entityType}",` + + ` but input type "${inputType}" field "${inputFieldName}" has type "${inputFieldType}"` + + ` which does not match key field "${entityFieldPath}" of type "${entityFieldType}".` + ); +} + +export function nestedInputObjectMissingFieldErrorMessage( + argumentName: string, + fieldCoords: string, + keyFields: string, + entityType: string, + inputType: string, + missingFieldName: string, +): string { + return ( + `Argument "${argumentName}" on field "${fieldCoords}" maps to nested @key "${keyFields}" on entity "${entityType}",` + + ` but input type "${inputType}" is missing required key field "${missingFieldName}".` + ); +} + +export function nonInputArgumentCannotTargetCompositeKeyErrorMessage( + argumentName: string, + fieldCoords: string, + keyFields: string, + entityType: string, + argumentType: string, +): string { + return ( + `Argument "${argumentName}" on field "${fieldCoords}" uses @openfed__is(fields: "${keyFields}") targeting composite @key on entity "${entityType}",` + + ` but argument type "${argumentType}" does not provide nested fields for each key field.` + + ' Use separate arguments or an input object that matches the composite key shape.' + ); +} + export function listSizeInvalidSlicingArgumentErrorMessage( directiveCoords: DirectiveArgumentCoords, argumentName: ArgumentName, diff --git a/composition/src/router-configuration/types.ts b/composition/src/router-configuration/types.ts index c966c632bf..8156c4be02 100644 --- a/composition/src/router-configuration/types.ts +++ b/composition/src/router-configuration/types.ts @@ -86,6 +86,17 @@ export type RequiredFieldConfiguration = { disableEntityResolver?: boolean; }; +export type RequestScopedFieldConfig = { + fieldName: FieldName; + typeName: TypeName; + // L1 cache key used to store/lookup this field's value for the duration of a request. + // Format: "{subgraphName}.{key}" where `key` is the @openfed__requestScoped(key:) argument. + // All fields in the same subgraph declaring @openfed__requestScoped with the same key share + // the same L1 entry — the first one to resolve populates it, subsequent ones inject + // from it (subject to widening checks and alias-aware normalization). + l1Key: string; +}; + export type ConfigurationData = { fieldNames: Set; isRootNode: boolean; @@ -97,7 +108,88 @@ export type ConfigurationData = { provides?: RequiredFieldConfiguration[]; keys?: RequiredFieldConfiguration[]; requireFetchReasonsFieldNames?: Array; + requestScopedFields?: Array; requires?: RequiredFieldConfiguration[]; + // Entity caching configuration — attached during composition when subgraph schemas + // use entity caching directives. These are serialized into the router configuration + // and consumed by the router's entity cache module at runtime. + // + // entityCacheConfigurations: attached to the entity type's ConfigurationData (e.g., "Product") + // rootFieldCacheConfigurations: attached to the Query type's ConfigurationData + // cachePopulateConfigurations: attached to the Mutation/Subscription type's ConfigurationData + // cacheInvalidateConfigurations: attached to the Mutation/Subscription type's ConfigurationData + entityCacheConfigurations?: Array; + rootFieldCacheConfigurations?: Array; + cachePopulateConfigurations?: Array; + cacheInvalidateConfigurations?: Array; +}; + +// Extracted from @openfed__entityCache(maxAge: Int!, negativeCacheTTL: Int, includeHeaders: Boolean, partialCacheLoad: Boolean, shadowMode: Boolean) +// on OBJECT types. Defines per-entity cache TTL and behavior. +export type EntityCacheConfig = { + typeName: TypeName; + maxAgeSeconds: number; + // TTL (in seconds) for caching "not found" entity responses (entity returned null + // from _entities without errors). 0 disables negative caching; composition rejects + // negative values at validation time. + notFoundCacheTtlSeconds: number; + // When true, request headers are included in the cache key (useful for user-specific entities) + includeHeaders: boolean; + // When true, allows partial cache hits — the router fetches only missing entities from the subgraph + partialCacheLoad: boolean; + // When true, the cache runs in shadow mode — cache reads/writes happen but responses always come from the subgraph. + // Useful for warming caches or validating cache correctness without affecting production traffic. + shadowMode: boolean; +}; + +// Extracted from @openfed__queryCache(maxAge: Int!, includeHeaders: Boolean, shadowMode: Boolean) +// on Query fields. Tells the router which query fields can serve entities from cache. +export type RootFieldCacheConfig = { + fieldName: FieldName; + maxAgeSeconds: number; + includeHeaders: boolean; + shadowMode: boolean; + // The entity type this query field returns (must have @openfed__entityCache) + entityTypeName: TypeName; + // Maps query arguments to entity @key fields so the router can construct cache keys from query arguments. + // Empty for list-returning fields (cache reads are skipped; only cache writes/population apply). + entityKeyMappings: Array; +}; + +// Groups field mappings for a single entity type returned by a @openfed__queryCache field. +export type EntityKeyMappingConfig = { + entityTypeName: TypeName; + fieldMappings: Array; +}; + +// Maps a single query argument to an entity's @key field. +// Example: query { product(productId: ID!) @openfed__queryCache } with @openfed__is(fields: "id") on productId +// → entityKeyField: "id", argumentPath: ["productId"] +// When the argument name matches the @key field name, auto-mapping occurs without @openfed__is. +export type FieldMappingConfig = { + entityKeyField: FieldName; + argumentPath: Array; + isBatch?: boolean; +}; + +// Extracted from @openfed__cachePopulate(maxAge: Int) on Mutation/Subscription fields. +// Tells the router to populate the entity cache with the mutation's return value. +// maxAgeSeconds overrides the entity's default TTL when provided. +// entityTypeName identifies which cached entity this populate targets — derived from +// the field's return type, which composition validates must be an @openfed__entityCache-marked entity. +export type CachePopulateConfig = { + fieldName: FieldName; + operationType: string; + entityTypeName: TypeName; + maxAgeSeconds?: number; +}; + +// Extracted from @openfed__cacheInvalidate on Mutation/Subscription fields. +// Tells the router to evict the returned entity from the cache after the operation completes. +export type CacheInvalidateConfig = { + fieldName: FieldName; + operationType: string; + entityTypeName: TypeName; }; export type Costs = { diff --git a/composition/src/utils/string-constants.ts b/composition/src/utils/string-constants.ts index 9fb84d8dbf..ba12869d50 100644 --- a/composition/src/utils/string-constants.ts +++ b/composition/src/utils/string-constants.ts @@ -10,6 +10,8 @@ export const AUTHENTICATED = 'authenticated'; export const ARGUMENT_DEFINITION_UPPER = 'ARGUMENT_DEFINITION'; export const BOOLEAN = 'boolean'; export const BOOLEAN_SCALAR = 'Boolean'; +export const CACHE_INVALIDATE = 'openfed__cacheInvalidate'; +export const CACHE_POPULATE = 'openfed__cachePopulate'; export const CHANNEL = 'channel'; export const CHANNELS = 'channels'; export const COMPOSE_DIRECTIVE = 'composeDirective'; @@ -41,6 +43,7 @@ export const EDFS_REDIS_PUBLISH = 'edfs__redisPublish'; export const EDFS_REDIS_SUBSCRIBE = 'edfs__redisSubscribe'; export const ENTITIES = 'entities'; export const ENTITIES_FIELD = '_entities'; +export const ENTITY_CACHE = 'openfed__entityCache'; export const ENTITY_UNION = '_Entity'; export const ENUM = 'Enum'; export const ENUM_UPPER = 'ENUM'; @@ -65,9 +68,10 @@ export const FROM = 'from'; export const HYPHEN_JOIN = `\n -`; export const ID_SCALAR = 'ID'; export const IMPORT = 'import'; -export const IN_UPPER = 'IN'; export const INACCESSIBLE = 'inaccessible'; +export const INCLUDE_HEADERS = 'includeHeaders'; export const INLINE_FRAGMENT = 'inlineFragment'; +export const IN_UPPER = 'IN'; export const INLINE_FRAGMENT_UPPER = 'INLINE_FRAGMENT'; export const INPUT = 'Input'; export const INPUT_FIELD = 'Input field'; @@ -79,6 +83,7 @@ export const INT_SCALAR = 'Int'; export const INTERFACE = `Interface`; export const INTERFACE_UPPER = 'INTERFACE'; export const INTERFACE_OBJECT = 'interfaceObject'; +export const IS = 'openfed__is'; export const KEY = 'key'; export const LEFT_PARENTHESIS = '('; export const LEVELS = 'levels'; @@ -87,9 +92,12 @@ export const LIST_SIZE = 'listSize'; export const LINK_IMPORT = 'link__Import'; export const LINK_PURPOSE = 'link__Purpose'; export const LIST = 'list'; +export const LITERAL_OPEN_BRACE = '{'; export const LITERAL_SPACE = ' '; export const LITERAL_NEW_LINE = '\n'; export const LITERAL_PERIOD = '.'; +export const MAX_AGE = 'maxAge'; +export const NEGATIVE_CACHE_TTL = 'negativeCacheTTL'; export const NUMBER = 'number'; export const MUTATION = 'Mutation'; export const MUTATION_UPPER = 'MUTATION'; @@ -114,14 +122,17 @@ export const OVERRIDE = 'override'; export const PARENT_DEFINITION_DATA = 'parentDefinitionDataByTypeName'; export const PARENT_DEFINITION_DATA_MAP = 'parentDefinitionDataByParentTypeName'; export const PARENT_EXTENSION_DATA_MAP = 'parentExtensionDataByParentTypeName'; +export const PARTIAL_CACHE_LOAD = 'partialCacheLoad'; export const PROVIDER_ID = 'providerId'; export const PROVIDES = 'provides'; export const PUBLISH = 'publish'; export const QUERY = 'Query'; +export const QUERY_CACHE = 'openfed__queryCache'; export const QUERY_UPPER = 'QUERY'; export const QUOTATION_JOIN = `", "`; export const REASON = 'reason'; export const REQUEST = 'request'; +export const REQUEST_SCOPED = 'openfed__requestScoped'; export const REQUIRE_FETCH_REASONS = 'openfed__requireFetchReasons'; export const REQUIRE_ONE_SLICING_ARGUMENT = 'requireOneSlicingArgument'; export const REQUIRES = 'requires'; @@ -138,6 +149,7 @@ export const SELECTION_REPRESENTATION = ' { ... }'; export const SEMANTIC_NON_NULL = 'semanticNonNull'; export const SERVICE_OBJECT = '_Service'; export const SERVICE_FIELD = '_service'; +export const SHADOW_MODE = 'shadowMode'; export const SHAREABLE = 'shareable'; export const SIZED_FIELDS = 'sizedFields'; export const SLICING_ARGUMENTS = 'slicingArguments'; diff --git a/composition/src/v1/constants/constants.ts b/composition/src/v1/constants/constants.ts index a9139c23c8..e3ac1f539b 100644 --- a/composition/src/v1/constants/constants.ts +++ b/composition/src/v1/constants/constants.ts @@ -2,6 +2,8 @@ import { type DirectiveDefinitionNode } from 'graphql'; import { AUTHENTICATED, BOOLEAN_SCALAR, + CACHE_INVALIDATE, + CACHE_POPULATE, COMPOSE_DIRECTIVE, CONFIGURE_CHILD_DESCRIPTIONS, CONFIGURE_DESCRIPTION, @@ -15,6 +17,7 @@ import { EDFS_NATS_SUBSCRIBE, EDFS_REDIS_PUBLISH, EDFS_REDIS_SUBSCRIBE, + ENTITY_CACHE, EXTENDS, EXTERNAL, FIELD_SET_SCALAR, @@ -23,12 +26,15 @@ import { INACCESSIBLE, INT_SCALAR, INTERFACE_OBJECT, + IS, KEY, LINK, LIST_SIZE, ONE_OF, OVERRIDE, PROVIDES, + QUERY_CACHE, + REQUEST_SCOPED, REQUIRE_FETCH_REASONS, REQUIRES, REQUIRES_SCOPES, @@ -43,12 +49,15 @@ import { import { type DirectiveName } from '../../types/types'; import { AUTHENTICATED_DEFINITION, + CACHE_INVALIDATE_DEFINITION, + CACHE_POPULATE_DEFINITION, COMPOSE_DIRECTIVE_DEFINITION, CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION, CONFIGURE_DESCRIPTION_DEFINITION, CONNECT_FIELD_RESOLVER_DEFINITION, COST_DEFINITION, DEPRECATED_DEFINITION, + ENTITY_CACHE_DEFINITION, EDFS_KAFKA_PUBLISH_DEFINITION, EDFS_KAFKA_SUBSCRIBE_DEFINITION, EDFS_NATS_PUBLISH_DEFINITION, @@ -60,12 +69,15 @@ import { EXTERNAL_DEFINITION, INACCESSIBLE_DEFINITION, INTERFACE_OBJECT_DEFINITION, + IS_DEFINITION, KEY_DEFINITION, LINK_DEFINITION, LIST_SIZE_DEFINITION, ONE_OF_DEFINITION, OVERRIDE_DEFINITION, PROVIDES_DEFINITION, + QUERY_CACHE_DEFINITION, + REQUEST_SCOPED_DEFINITION, REQUIRE_FETCH_REASONS_DEFINITION, REQUIRES_DEFINITION, REQUIRES_SCOPES_DEFINITION, @@ -81,6 +93,8 @@ export const DIRECTIVE_DEFINITION_BY_NAME: ReadonlyMap([ [AUTHENTICATED, AUTHENTICATED_DEFINITION], + [CACHE_INVALIDATE, CACHE_INVALIDATE_DEFINITION], + [CACHE_POPULATE, CACHE_POPULATE_DEFINITION], [COMPOSE_DIRECTIVE, COMPOSE_DIRECTIVE_DEFINITION], [CONFIGURE_DESCRIPTION, CONFIGURE_DESCRIPTION_DEFINITION], [CONFIGURE_CHILD_DESCRIPTIONS, CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION], @@ -94,16 +108,20 @@ export const DIRECTIVE_DEFINITION_BY_NAME: ReadonlyMap([CHANNELS]), }; +export const REQUEST_SCOPED_DEFINITION_DATA: DirectiveDefinitionData = { + argumentTypeNodeByName: new Map([ + [ + KEY, + { + name: KEY, + typeNode: REQUIRED_STRING_TYPE_NODE, + }, + ], + ]), + isRepeatable: false, + locations: new Set([FIELD_DEFINITION_UPPER]), + name: REQUEST_SCOPED, + node: REQUEST_SCOPED_DEFINITION, + optionalArgumentNames: new Set(), + requiredArgumentNames: new Set([KEY]), +}; + export const REQUIRE_FETCH_REASONS_DEFINITION_DATA: DirectiveDefinitionData = { argumentTypeNodeByName: new Map(), isRepeatable: true, @@ -916,3 +955,133 @@ export const TAG_DEFINITION_DATA: DirectiveDefinitionData = { optionalArgumentNames: new Set(), requiredArgumentNames: new Set([NAME]), }; + +export const CACHE_INVALIDATE_DEFINITION_DATA: DirectiveDefinitionData = { + argumentTypeNodeByName: new Map([]), + isRepeatable: false, + locations: new Set([FIELD_DEFINITION_UPPER]), + name: CACHE_INVALIDATE, + node: CACHE_INVALIDATE_DEFINITION, + optionalArgumentNames: new Set(), + requiredArgumentNames: new Set(), +}; + +export const CACHE_POPULATE_DEFINITION_DATA: DirectiveDefinitionData = { + argumentTypeNodeByName: new Map([ + [ + MAX_AGE, + { + name: MAX_AGE, + typeNode: stringToNamedTypeNode(INT_SCALAR), + }, + ], + ]), + isRepeatable: false, + locations: new Set([FIELD_DEFINITION_UPPER]), + name: CACHE_POPULATE, + node: CACHE_POPULATE_DEFINITION, + optionalArgumentNames: new Set([MAX_AGE]), + requiredArgumentNames: new Set(), +}; + +export const ENTITY_CACHE_DEFINITION_DATA: DirectiveDefinitionData = { + argumentTypeNodeByName: new Map([ + [ + MAX_AGE, + { + name: MAX_AGE, + typeNode: REQUIRED_INT_TYPE_NODE, + }, + ], + [ + NEGATIVE_CACHE_TTL, + { + name: NEGATIVE_CACHE_TTL, + typeNode: stringToNamedTypeNode(INT_SCALAR), + defaultValue: { kind: Kind.INT, value: '0' }, + }, + ], + [ + INCLUDE_HEADERS, + { + name: INCLUDE_HEADERS, + typeNode: stringToNamedTypeNode(BOOLEAN_SCALAR), + defaultValue: { kind: Kind.BOOLEAN, value: false }, + }, + ], + [ + PARTIAL_CACHE_LOAD, + { + name: PARTIAL_CACHE_LOAD, + typeNode: stringToNamedTypeNode(BOOLEAN_SCALAR), + defaultValue: { kind: Kind.BOOLEAN, value: false }, + }, + ], + [ + SHADOW_MODE, + { + name: SHADOW_MODE, + typeNode: stringToNamedTypeNode(BOOLEAN_SCALAR), + defaultValue: { kind: Kind.BOOLEAN, value: false }, + }, + ], + ]), + isRepeatable: false, + locations: new Set([OBJECT_UPPER]), + name: ENTITY_CACHE, + node: ENTITY_CACHE_DEFINITION, + optionalArgumentNames: new Set([NEGATIVE_CACHE_TTL, INCLUDE_HEADERS, PARTIAL_CACHE_LOAD, SHADOW_MODE]), + requiredArgumentNames: new Set([MAX_AGE]), +}; + +export const IS_DEFINITION_DATA: DirectiveDefinitionData = { + argumentTypeNodeByName: new Map([ + [ + FIELDS, + { + name: FIELDS, + typeNode: REQUIRED_STRING_TYPE_NODE, + }, + ], + ]), + isRepeatable: false, + locations: new Set([ARGUMENT_DEFINITION_UPPER]), + name: IS, + node: IS_DEFINITION, + optionalArgumentNames: new Set(), + requiredArgumentNames: new Set([FIELDS]), +}; + +export const QUERY_CACHE_DEFINITION_DATA: DirectiveDefinitionData = { + argumentTypeNodeByName: new Map([ + [ + MAX_AGE, + { + name: MAX_AGE, + typeNode: REQUIRED_INT_TYPE_NODE, + }, + ], + [ + INCLUDE_HEADERS, + { + name: INCLUDE_HEADERS, + typeNode: stringToNamedTypeNode(BOOLEAN_SCALAR), + defaultValue: { kind: Kind.BOOLEAN, value: false }, + }, + ], + [ + SHADOW_MODE, + { + name: SHADOW_MODE, + typeNode: stringToNamedTypeNode(BOOLEAN_SCALAR), + defaultValue: { kind: Kind.BOOLEAN, value: false }, + }, + ], + ]), + isRepeatable: false, + locations: new Set([FIELD_DEFINITION_UPPER]), + name: QUERY_CACHE, + node: QUERY_CACHE_DEFINITION, + optionalArgumentNames: new Set([INCLUDE_HEADERS, SHADOW_MODE]), + requiredArgumentNames: new Set([MAX_AGE]), +}; diff --git a/composition/src/v1/normalization/normalization-factory.ts b/composition/src/v1/normalization/normalization-factory.ts index 8fb43f8762..ff008b5d76 100644 --- a/composition/src/v1/normalization/normalization-factory.ts +++ b/composition/src/v1/normalization/normalization-factory.ts @@ -173,6 +173,35 @@ import { unknownTypeInFieldSetErrorMessage, unparsableFieldSetErrorMessage, unparsableFieldSetSelectionErrorMessage, + entityCacheWithoutKeyErrorMessage, + queryCacheOnNonQueryFieldErrorMessage, + queryCacheOnNonEntityReturnTypeErrorMessage, + maxAgeNotPositiveIntegerErrorMessage, + negativeCacheTTLNotNonNegativeIntegerErrorMessage, + isWithoutQueryCacheErrorMessage, + isReferencesUnknownKeyFieldErrorMessage, + duplicateKeyFieldMappingErrorMessage, + cacheInvalidateOnNonMutationSubscriptionFieldErrorMessage, + cacheInvalidateOnNonEntityReturnTypeErrorMessage, + cachePopulateOnNonMutationSubscriptionFieldErrorMessage, + cachePopulateOnNonEntityReturnTypeErrorMessage, + cacheInvalidateAndPopulateMutualExclusionErrorMessage, + explicitTypeMismatchErrorMessage, + nonKeyFieldSpecErrorMessage, + listArgumentToScalarKeySpecErrorMessage, + scalarArgumentToListKeySpecErrorMessage, + explicitIncompleteCompositeKeyErrorMessage, + explicitSingularAdditionalNonKeyArgumentErrorMessage, + explicitCompositeAdditionalNonKeyArgumentErrorMessage, + batchListValuedKeyRequiresNestedListsErrorMessage, + explicitBatchAdditionalNonKeyArgumentErrorMessage, + explicitScalarArgumentsCannotEstablishBatchMappingErrorMessage, + multipleListArgumentsBatchFactoryMessage, + inputObjectCompositeTypeMismatchErrorMessage, + inputObjectCompositeMissingFieldErrorMessage, + nestedInputObjectTypeMismatchErrorMessage, + nestedInputObjectMissingFieldErrorMessage, + nonInputArgumentCannotTargetCompositeKeyErrorMessage, } from '../../errors/errors'; import { DEPENDENCIES_BY_DIRECTIVE_NAME, @@ -184,10 +213,14 @@ import { buildASTSchema } from '../../buildASTSchema/buildASTSchema'; import { type ConfigurationData, type Costs, + type EntityCacheConfig, + type EntityKeyMappingConfig, type EventConfiguration, type FieldListSizeConfiguration, + type FieldMappingConfig, type FieldWeightConfiguration, type NatsEventType, + type RequestScopedFieldConfig, type RequiredFieldConfiguration, } from '../../router-configuration/types'; import { printTypeNode } from '@graphql-tools/merge'; @@ -199,7 +232,14 @@ import { fieldAlreadyProvidedWarning, invalidExternalFieldWarning, invalidOverrideTargetSubgraphNameWarning, + incompleteQueryCacheKeyMappingWarning, + autoMappingTypeMismatchWarning, + autoMappingAdditionalNonKeyArgumentWarning, + autoBatchAdditionalNonKeyArgumentWarning, + queryCacheReturnEntityMissingEntityCacheWarning, + redundantIsDirectiveWarning, nonExternalConditionalFieldWarning, + requestScopedSingleFieldWarning, singleSubgraphInputFieldOneOfWarning, unimplementedInterfaceOutputTypeWarning, } from '../warnings/warnings'; @@ -274,6 +314,8 @@ import { ASSUMED_SIZE, AUTHENTICATED, BOOLEAN_SCALAR, + CACHE_INVALIDATE, + CACHE_POPULATE, CHANNEL, CHANNELS, CONFIGURE_DESCRIPTION, @@ -289,6 +331,7 @@ import { EDFS_NATS_STREAM_CONFIGURATION, EDFS_NATS_SUBSCRIBE, EDFS_PUBLISH_RESULT, + ENTITY_CACHE, EDFS_REDIS_PUBLISH, EDFS_REDIS_SUBSCRIBE, ENTITIES_FIELD, @@ -298,20 +341,28 @@ import { EXTERNAL, FIELD_SET_SCALAR, FIELDS, + FIRST_ORDINAL, FLOAT_SCALAR, HYPHEN_JOIN, ID_SCALAR, INACCESSIBLE, + INCLUDE_HEADERS, INHERITABLE_DIRECTIVE_NAMES, INPUT_FIELD, INT_SCALAR, INTERFACE_OBJECT, + IS, KEY, LEVELS, LINK_IMPORT, LINK_PURPOSE, LIST_SIZE, + LITERAL_OPEN_BRACE, + LITERAL_PERIOD, + LITERAL_SPACE, + MAX_AGE, MUTATION, + NEGATIVE_CACHE_TTL, NON_NULLABLE_BOOLEAN, NON_NULLABLE_EDFS_PUBLISH_EVENT_RESULT, NON_NULLABLE_INT, @@ -320,6 +371,7 @@ import { ONE_OF, OPERATION_TO_DEFAULT, OVERRIDE, + PARTIAL_CACHE_LOAD, PROPAGATE, PROVIDER_ID, PROVIDER_TYPE_KAFKA, @@ -327,9 +379,11 @@ import { PROVIDER_TYPE_REDIS, PUBLISH, QUERY, + QUERY_CACHE, REQUEST, REQUIRE_FETCH_REASONS, REQUIRE_ONE_SLICING_ARGUMENT, + REQUEST_SCOPED, REQUIRES_SCOPES, RESOLVABLE, ROOT_TYPE_NAMES, @@ -339,6 +393,7 @@ import { SECURITY, SEMANTIC_NON_NULL, SERVICE_FIELD, + SHADOW_MODE, SHAREABLE, SIZED_FIELDS, SLICING_ARGUMENTS, @@ -437,7 +492,7 @@ export function normalizeSubgraph({ export class NormalizationFactory { argumentName = ''; - authorizationDataByParentTypeName = new Map(); + authorizationDataByParentTypeName = new Map(); concreteTypeNamesByAbstractTypeName = new Map>(); conditionalFieldDataByCoords = new Map(); configurationDataByTypeName = new Map(); @@ -453,9 +508,22 @@ export class NormalizationFactory { directiveDefinitionDataByName = initializeDirectiveDefinitionDatas(); doesParentRequireFetchReasons = false; edfsDirectiveReferences = new Set(); + // Populated in Phase 1 of validateAndExtractEntityCachingConfigs(). + // Used as a lookup in Phase 2 to verify that @openfed__queryCache/@openfed__cacheInvalidate/@openfed__cachePopulate + // fields return entity types that have opted into caching. + entityCacheConfigByTypeName = new Map< + TypeName, + { + maxAgeSeconds: number; + notFoundCacheTtlSeconds: number; + includeHeaders: boolean; + partialCacheLoad: boolean; + shadowMode: boolean; + } + >(); errors = new Array(); - entityDataByTypeName = new Map(); - entityInterfaceDataByTypeName = new Map(); + entityDataByTypeName = new Map(); + entityInterfaceDataByTypeName = new Map(); eventsConfigurations = new Map(); fieldSetDataByTypeName = new Map(); interfaceImplementationTypeNamesByInterfaceTypeName = new Map>(); @@ -1233,7 +1301,7 @@ export class NormalizationFactory { if (weightArg.value.kind !== Kind.INT) { const directiveCoords = `@${directiveName}(${argNode.name.value}: ...)`; this.errors.push( - invalidDirectiveError(COST, directiveCoords, '1st', [ + invalidDirectiveError(COST, directiveCoords, FIRST_ORDINAL, [ invalidArgumentValueErrorMessage(print(weightArg.value), `@${COST}`, WEIGHT, 'Int!'), ]), ); @@ -3536,6 +3604,1636 @@ export class NormalizationFactory { } } + extractRequestScopedFields() { + // Gather fields annotated with @openfed__requestScoped across all types in this subgraph. + // A field is both a reader and writer of the coordinate L1 — no receiver/provider. + // Fields with the same `key` share the same L1 entry: whichever is resolved first + // populates it, subsequent ones inject from it. + type Collected = { + typeName: string; + fieldName: string; + fieldCoords: string; + key: string; + l1Key: string; + }; + const collected: Array = []; + const keyToCoordsList = new Map>(); + + for (const [, parentData] of this.parentDefinitionDataByTypeName) { + if (parentData.kind !== Kind.OBJECT_TYPE_DEFINITION && parentData.kind !== Kind.INTERFACE_TYPE_DEFINITION) { + continue; + } + const typeName = getParentTypeName(parentData); + for (const [fieldName, fieldData] of parentData.fieldDataByName) { + const directives = fieldData.directivesByName.get(REQUEST_SCOPED); + if (!directives || directives.length < 1) { + continue; + } + const directive = directives[0]; + const fieldCoords = `${typeName}.${fieldName}`; + // `key` is mandatory (enforced by directive definition validation upstream), + // but defend against malformed AST just in case. + let key: string | undefined; + if (directive.arguments) { + for (const arg of directive.arguments) { + if (arg.name.value === KEY && arg.value.kind === Kind.STRING) { + key = (arg.value as StringValueNode).value; + } + } + } + if (!key) { + continue; + } + const l1Key = `${this.subgraphName}.${key}`; + collected.push({ typeName, fieldName, fieldCoords, key, l1Key }); + const list = keyToCoordsList.get(key); + if (list) { + list.push(fieldCoords); + } else { + keyToCoordsList.set(key, [fieldCoords]); + } + } + } + + if (collected.length === 0) { + return; + } + + // Warn when a key is used on only one field — @openfed__requestScoped is meaningless + // unless ≥ 2 fields share the key (there'd be no second reader to benefit). + for (const [key, coordsList] of keyToCoordsList) { + if (coordsList.length < 2) { + this.warnings.push( + requestScopedSingleFieldWarning({ + subgraphName: this.subgraphName, + key, + fieldCoords: coordsList[0], + }), + ); + } + } + + // Group by type and attach to configurationData. + const byType = new Map>(); + for (const c of collected) { + const list = byType.get(c.typeName) ?? []; + list.push({ + fieldName: c.fieldName, + typeName: c.typeName, + l1Key: c.l1Key, + }); + byType.set(c.typeName, list); + } + for (const [typeName, fields] of byType) { + const configurationData = getValueOrDefault(this.configurationDataByTypeName, typeName, () => + newConfigurationData(false, typeName), + ); + configurationData.requestScopedFields = fields; + } + } + + // Reads an INT-typed argument off a directive node; returns undefined when the argument + // is absent or not an INT literal. Narrowing via `arg.value.kind === Kind.INT` is required + // before accessing `.value` — otherwise variables and other AST nodes silently coerce to NaN. + private extractCacheIntArg(directive: ConstDirectiveNode, argName: string): number | undefined { + if (!directive.arguments) { + return undefined; + } + for (const arg of directive.arguments) { + if (arg.name.value === argName && arg.value.kind === Kind.INT) { + return parseInt(arg.value.value, 10); + } + } + return undefined; + } + + // Reads a BOOLEAN-typed argument off a directive node; returns false when absent or non-boolean. + // The directive definitions default these flags to false, matching this fallback. + private extractCacheBoolArg(directive: ConstDirectiveNode, argName: string): boolean { + if (!directive.arguments) { + return false; + } + for (const arg of directive.arguments) { + if (arg.name.value === argName && arg.value.kind === Kind.BOOLEAN) { + return arg.value.value; + } + } + return false; + } + + // Returns the ConfigurationData entry for a type, creating it if missing. + // Cache attachment must never silently drop — if the entry doesn't exist yet it's because + // the type contributes nothing else to the router config (e.g., a Mutation type with only + // a single @openfed__cacheInvalidate field). Creating it on demand is the same pattern used by + // addValidKeyFieldSetConfigurations and extractRequestScopedFields. + private getCacheConfigurationData(typeName: string, isEntity: boolean): ConfigurationData { + return getValueOrDefault(this.configurationDataByTypeName, typeName, () => + newConfigurationData(isEntity, typeName), + ); + } + + /* + * Validates and extracts entity caching directive configurations from the subgraph schema. + * + * Entity caching allows the router to cache resolved entities (types with @key) in an external + * store (e.g., Redis) and serve subsequent requests from cache instead of re-fetching from subgraphs. + * + * Five directives work together to control caching behavior: + * + * @openfed__entityCache(maxAge: Int!) — on OBJECT types: marks an entity type as cacheable + * @openfed__queryCache(maxAge: Int!) — on Query fields: enables cache reads for a query that returns a cached entity + * @openfed__cacheInvalidate — on Mutation/Subscription fields: evicts the returned entity from cache + * @openfed__cachePopulate(maxAge: Int) — on Mutation/Subscription fields: writes the returned entity into cache + * @openfed__is(fields: String!) — on arguments: maps a query argument to an entity @key field for cache key construction + * + * Validation behavior is encoded in the entity-caching test suite: + * `tests/v1/directives/entity-caching.test.ts` and + * `tests/v1/directives/entity-cache-mapping-rules.test.ts`. + * + * @openfed__entityCache must be extracted first because the root-field directives validate that the + * return entity type has @openfed__entityCache via the entityCacheConfigByTypeName lookup. + * + * All ConfigurationData attachments are keyed by the renamed root type name from the iteration + * (e.g., "MyQuery" when the schema declares `schema { query: MyQuery }`) — never by the literal + * "Query"/"Mutation"/"Subscription" — to preserve renamed-root-type semantics. Attachment is + * direct (no buffer-then-attach step) so renamed types can't drift and configs can't silently drop. + */ + validateAndExtractEntityCachingConfigs() { + this.extractEntityCacheDirectives(); + this.processRootFieldCacheDirectives(); + } + + extractEntityCacheDirectives() { + for (const [typeName, parentData] of this.parentDefinitionDataByTypeName) { + if (parentData.kind !== Kind.OBJECT_TYPE_DEFINITION) { + continue; + } + const entityCacheDirectives = parentData.directivesByName.get(ENTITY_CACHE); + if (!entityCacheDirectives) { + continue; + } + if (!this.keyFieldSetDatasByTypeName.has(typeName)) { + this.errors.push( + invalidDirectiveError(ENTITY_CACHE, typeName, FIRST_ORDINAL, [entityCacheWithoutKeyErrorMessage(typeName)]), + ); + continue; + } + const directive = entityCacheDirectives[0]; + const maxAgeSeconds = this.extractCacheIntArg(directive, MAX_AGE) ?? 0; + const notFoundCacheTtlSeconds = this.extractCacheIntArg(directive, NEGATIVE_CACHE_TTL) ?? 0; + const includeHeaders = this.extractCacheBoolArg(directive, INCLUDE_HEADERS); + const partialCacheLoad = this.extractCacheBoolArg(directive, PARTIAL_CACHE_LOAD); + const shadowMode = this.extractCacheBoolArg(directive, SHADOW_MODE); + if (maxAgeSeconds <= 0) { + this.errors.push( + invalidDirectiveError(ENTITY_CACHE, typeName, FIRST_ORDINAL, [ + maxAgeNotPositiveIntegerErrorMessage(ENTITY_CACHE, maxAgeSeconds), + ]), + ); + continue; + } + if (notFoundCacheTtlSeconds < 0) { + this.errors.push( + invalidDirectiveError(ENTITY_CACHE, typeName, FIRST_ORDINAL, [ + negativeCacheTTLNotNonNegativeIntegerErrorMessage(ENTITY_CACHE, notFoundCacheTtlSeconds), + ]), + ); + continue; + } + const config: EntityCacheConfig = { + typeName, + maxAgeSeconds, + notFoundCacheTtlSeconds, + includeHeaders, + partialCacheLoad, + shadowMode, + }; + this.entityCacheConfigByTypeName.set(typeName, config); + const configData = this.getCacheConfigurationData(typeName, true); + if (!configData.entityCacheConfigurations) { + configData.entityCacheConfigurations = []; + } + configData.entityCacheConfigurations.push(config); + } + } + + processRootFieldCacheDirectives() { + for (const [parentTypeName, parentData] of this.parentDefinitionDataByTypeName) { + if (parentData.kind !== Kind.OBJECT_TYPE_DEFINITION) { + continue; + } + const operationType = this.getOperationTypeNodeForRootTypeName(parentTypeName); + if (!operationType) { + continue; + } + + for (const [fieldName, fieldData] of parentData.fieldDataByName) { + const fieldCoords = `${parentTypeName}.${fieldName}`; + const hasQueryCache = fieldData.directivesByName.has(QUERY_CACHE); + const hasCacheInvalidate = fieldData.directivesByName.has(CACHE_INVALIDATE); + const hasCachePopulate = fieldData.directivesByName.has(CACHE_POPULATE); + + if (hasCacheInvalidate && hasCachePopulate) { + this.errors.push( + invalidDirectiveError(CACHE_INVALIDATE, fieldCoords, FIRST_ORDINAL, [ + cacheInvalidateAndPopulateMutualExclusionErrorMessage(fieldCoords), + ]), + ); + continue; + } + + if (hasQueryCache) { + this.extractQueryCacheConfig(parentTypeName, fieldName, fieldData, operationType); + } + if (hasCacheInvalidate) { + this.extractCacheInvalidateConfig(parentTypeName, fieldName, fieldData, operationType); + } + if (hasCachePopulate) { + this.extractCachePopulateConfig(parentTypeName, fieldName, fieldData, operationType); + } + this.validateIsDirectivePlacement(fieldCoords, fieldData, hasQueryCache); + } + } + } + + extractQueryCacheConfig( + parentTypeName: string, + fieldName: string, + fieldData: FieldData, + operationType: OperationTypeNode, + ) { + const fieldCoords = `${parentTypeName}.${fieldName}`; + if (operationType !== OperationTypeNode.QUERY) { + this.errors.push( + invalidDirectiveError(QUERY_CACHE, fieldCoords, FIRST_ORDINAL, [ + queryCacheOnNonQueryFieldErrorMessage(fieldCoords), + ]), + ); + return; + } + const returnTypeName = getTypeNodeNamedTypeName(fieldData.node.type); + if (!this.keyFieldSetDatasByTypeName.has(returnTypeName)) { + this.errors.push( + invalidDirectiveError(QUERY_CACHE, fieldCoords, FIRST_ORDINAL, [ + queryCacheOnNonEntityReturnTypeErrorMessage(fieldCoords, returnTypeName), + ]), + ); + return; + } + const queryCacheDirective = fieldData.directivesByName.get(QUERY_CACHE)![0]; + const maxAgeSeconds = this.extractCacheIntArg(queryCacheDirective, MAX_AGE) ?? 0; + const includeHeaders = this.extractCacheBoolArg(queryCacheDirective, INCLUDE_HEADERS); + const shadowModeValue = this.extractCacheBoolArg(queryCacheDirective, SHADOW_MODE); + if (maxAgeSeconds <= 0) { + this.errors.push( + invalidDirectiveError(QUERY_CACHE, fieldCoords, FIRST_ORDINAL, [ + maxAgeNotPositiveIntegerErrorMessage(QUERY_CACHE, maxAgeSeconds), + ]), + ); + return; + } + + // Bug (a): the return entity must have @openfed__entityCache — otherwise there is no L1/L2 + // backing store for queryCache to read from. Warn and skip extraction. + // The warning is only actionable when the return type is an OBJECT — @openfed__entityCache is + // OBJECT-only (extractEntityCacheDirectives() skips interfaces/unions), so emitting the warning + // for an interface/union return would point the user at an impossible remediation. For those + // cases we skip the prereq check; the mapping pipeline handles the non-object path. + const returnTypeData = this.parentDefinitionDataByTypeName.get(returnTypeName); + const isObjectReturn = returnTypeData?.kind === Kind.OBJECT_TYPE_DEFINITION; + if (isObjectReturn && !this.entityCacheConfigByTypeName.has(returnTypeName)) { + this.warnings.push( + queryCacheReturnEntityMissingEntityCacheWarning({ + subgraphName: this.subgraphName, + fieldCoords, + entityType: returnTypeName, + }), + ); + return; + } + + const isListReturn = isTypeNodeListType(fieldData.node.type); + const keyFieldSets = this.keyFieldSetDatasByTypeName.get(returnTypeName); + const mappings = this.buildArgumentKeyMappings(fieldData, fieldCoords, returnTypeName, keyFieldSets, isListReturn); + + const configData = this.getCacheConfigurationData(parentTypeName, false); + if (!configData.rootFieldCacheConfigurations) { + configData.rootFieldCacheConfigurations = []; + } + configData.rootFieldCacheConfigurations.push({ + fieldName, + maxAgeSeconds, + includeHeaders, + shadowMode: shadowModeValue, + entityTypeName: returnTypeName, + entityKeyMappings: mappings, + }); + } + + extractCacheInvalidateConfig( + parentTypeName: string, + fieldName: string, + fieldData: FieldData, + operationType: OperationTypeNode, + ) { + const fieldCoords = `${parentTypeName}.${fieldName}`; + if (operationType !== OperationTypeNode.MUTATION && operationType !== OperationTypeNode.SUBSCRIPTION) { + this.errors.push( + invalidDirectiveError(CACHE_INVALIDATE, fieldCoords, FIRST_ORDINAL, [ + cacheInvalidateOnNonMutationSubscriptionFieldErrorMessage(fieldCoords), + ]), + ); + return; + } + const returnTypeName = getTypeNodeNamedTypeName(fieldData.node.type); + if (!this.keyFieldSetDatasByTypeName.has(returnTypeName) || !this.entityCacheConfigByTypeName.has(returnTypeName)) { + this.errors.push( + invalidDirectiveError(CACHE_INVALIDATE, fieldCoords, FIRST_ORDINAL, [ + cacheInvalidateOnNonEntityReturnTypeErrorMessage(fieldCoords, returnTypeName), + ]), + ); + return; + } + const configData = this.getCacheConfigurationData(parentTypeName, false); + if (!configData.cacheInvalidateConfigurations) { + configData.cacheInvalidateConfigurations = []; + } + configData.cacheInvalidateConfigurations.push({ + fieldName, + operationType: operationType === OperationTypeNode.MUTATION ? MUTATION : SUBSCRIPTION, + entityTypeName: returnTypeName, + }); + } + + extractCachePopulateConfig( + parentTypeName: string, + fieldName: string, + fieldData: FieldData, + operationType: OperationTypeNode, + ) { + const fieldCoords = `${parentTypeName}.${fieldName}`; + if (operationType !== OperationTypeNode.MUTATION && operationType !== OperationTypeNode.SUBSCRIPTION) { + this.errors.push( + invalidDirectiveError(CACHE_POPULATE, fieldCoords, FIRST_ORDINAL, [ + cachePopulateOnNonMutationSubscriptionFieldErrorMessage(fieldCoords), + ]), + ); + return; + } + const returnTypeName = getTypeNodeNamedTypeName(fieldData.node.type); + if (!this.keyFieldSetDatasByTypeName.has(returnTypeName) || !this.entityCacheConfigByTypeName.has(returnTypeName)) { + this.errors.push( + invalidDirectiveError(CACHE_POPULATE, fieldCoords, FIRST_ORDINAL, [ + cachePopulateOnNonEntityReturnTypeErrorMessage(fieldCoords, returnTypeName), + ]), + ); + return; + } + // maxAge is optional for @openfed__cachePopulate; when absent the router falls back to the entity's + // @openfed__entityCache TTL. When provided, it must be positive. + const cachePopulateDirective = fieldData.directivesByName.get(CACHE_POPULATE)![0]; + const maxAgeRaw = this.extractCacheIntArg(cachePopulateDirective, MAX_AGE); + let maxAgeSeconds: number | undefined; + if (maxAgeRaw !== undefined) { + if (maxAgeRaw <= 0) { + this.errors.push( + invalidDirectiveError(CACHE_POPULATE, fieldCoords, FIRST_ORDINAL, [ + maxAgeNotPositiveIntegerErrorMessage(CACHE_POPULATE, maxAgeRaw), + ]), + ); + return; + } + maxAgeSeconds = maxAgeRaw; + } + const configData = this.getCacheConfigurationData(parentTypeName, false); + if (!configData.cachePopulateConfigurations) { + configData.cachePopulateConfigurations = []; + } + configData.cachePopulateConfigurations.push({ + fieldName, + operationType: operationType === OperationTypeNode.MUTATION ? MUTATION : SUBSCRIPTION, + entityTypeName: returnTypeName, + maxAgeSeconds, + }); + } + + // Enforces the top-level placement rule for @openfed__is: the field must also declare @openfed__queryCache. + // Deeper @openfed__is validation (path resolution, composite decomposition, type checking) lives in + // buildArgumentKeyMappings. + validateIsDirectivePlacement(fieldCoords: string, fieldData: FieldData, hasQueryCache: boolean) { + if (hasQueryCache) { + return; + } + for (const [argumentName, argumentData] of fieldData.argumentDataByName) { + if (!argumentData.directivesByName.has(IS)) { + continue; + } + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${argumentName}: ...)`, FIRST_ORDINAL, [ + isWithoutQueryCacheErrorMessage(argumentName, fieldCoords), + ]), + ); + } + } + + // Extracts key field info from a key's DocumentNode AST. + // Returns an array of { path: "store.id", typeNode: TypeNode } for each leaf field. + extractKeyFieldInfos( + documentNode: DocumentNode, + entityTypeName: string, + ): Array<{ path: string; typeNode: TypeNode }> { + const result: Array<{ path: string; typeNode: TypeNode }> = []; + const operationDef = documentNode.definitions[0]; + if (!operationDef || !('selectionSet' in operationDef) || !operationDef.selectionSet) { + return result; + } + + const walkSelections = (selections: readonly any[], currentTypeName: string, pathPrefix: string) => { + for (const selection of selections) { + if (selection.kind !== Kind.FIELD) { + continue; + } + const fieldName = selection.name.value; + const fieldPath = pathPrefix ? `${pathPrefix}.${fieldName}` : fieldName; + + // Look up the field type on the current parent type + const parentData = this.parentDefinitionDataByTypeName.get(currentTypeName); + if (!parentData || !('fieldDataByName' in parentData)) { + continue; + } + const fieldData = parentData.fieldDataByName.get(fieldName); + if (!fieldData) { + continue; + } + + if (selection.selectionSet && selection.selectionSet.selections.length > 0) { + // Nested: recurse into the named type + const nestedTypeName = getTypeNodeNamedTypeName(fieldData.node.type); + walkSelections(selection.selectionSet.selections, nestedTypeName, fieldPath); + } else { + // Leaf field + result.push({ path: fieldPath, typeNode: fieldData.node.type }); + } + } + }; + + walkSelections(operationDef.selectionSet.selections, entityTypeName, ''); + return result; + } + + // Returns the named type name after stripping NonNull and List wrappers. + getNamedTypeName(typeNode: TypeNode): string { + if (typeNode.kind === Kind.NAMED_TYPE) { + return typeNode.name.value; + } + return this.getNamedTypeName(typeNode.type); + } + + // Unwraps one layer of list: [T!]! -> T!, [[T!]!]! -> [T!]! + unwrapListType(typeNode: TypeNode): TypeNode { + if (typeNode.kind === Kind.LIST_TYPE) { + return typeNode.type; + } + if (typeNode.kind === Kind.NON_NULL_TYPE) { + const inner = this.unwrapListType(typeNode.type); + // If inner changed (was a list), return the unwrapped version without non-null wrapper + if (inner !== typeNode.type) { + return inner; + } + } + return typeNode; + } + + // Compare named types (unwrapping NonNull wrappers only, not list wrappers). + namedTypesMatch(a: TypeNode, b: TypeNode): boolean { + return this.getNamedTypeName(a) === this.getNamedTypeName(b); + } + + // Check if both types have matching list structure. + listStructureMatches(a: TypeNode, b: TypeNode): boolean { + const aIsList = isTypeNodeListType(a); + const bIsList = isTypeNodeListType(b); + return aIsList === bIsList; + } + + // Structurally compare two TypeNodes: named type AND list/NonNull wrapping must match. + // Used at nested composite-key leaves where a printer-level mismatch (e.g., "[ID!]!" vs "ID") + // must be rejected even though the named type ("ID") agrees. + typesMatchIncludingListShape(expected: TypeNode, got: TypeNode): boolean { + if (expected.kind !== got.kind) { + return false; + } + if (expected.kind === Kind.NAMED_TYPE) { + return expected.name.value === (got as typeof expected).name.value; + } + if (expected.kind === Kind.NON_NULL_TYPE || expected.kind === Kind.LIST_TYPE) { + return this.typesMatchIncludingListShape(expected.type, (got as typeof expected).type); + } + return false; + } + + // Get @openfed__is field value from an argument's directives. + getIsFieldValue(argumentData: InputValueData): string | undefined { + const isDirectives = argumentData.directivesByName.get(IS); + if (!isDirectives || isDirectives.length < 1) { + return undefined; + } + const isDirective = isDirectives[0]; + if (isDirective.arguments) { + for (const arg of isDirective.arguments) { + if (arg.name.value === FIELDS && arg.value.kind === Kind.STRING) { + return (arg.value as StringValueNode).value; + } + } + } + return undefined; + } + + // Validates and builds nested input object mappings against key field infos. + // Returns field mappings or null on error (errors already pushed). + validateNestedInputObjectMapping( + argumentName: string, + fieldCoords: string, + entityTypeName: string, + keyFieldInfos: Array<{ path: string; typeNode: TypeNode }>, + normalizedFieldSet: string, + inputTypeName: string, + argumentPathPrefix: string[], + isBatch: boolean, + isNested: boolean, + entityKeyPathPrefix: string = '', + ): FieldMappingConfig[] | null { + const inputData = this.parentDefinitionDataByTypeName.get(inputTypeName); + if (!inputData || inputData.kind !== Kind.INPUT_OBJECT_TYPE_DEFINITION) { + return null; + } + + // Group key field infos by top-level field name for the current level + const topLevelGroups = new Map>(); + for (const info of keyFieldInfos) { + const dotIndex = info.path.indexOf(LITERAL_PERIOD); + const topField = dotIndex >= 0 ? info.path.substring(0, dotIndex) : info.path; + const restPath = dotIndex >= 0 ? info.path.substring(dotIndex + 1) : ''; + if (!topLevelGroups.has(topField)) { + topLevelGroups.set(topField, []); + } + topLevelGroups.get(topField)!.push({ ...info, restPath }); + } + + const fieldMappings: FieldMappingConfig[] = []; + + for (const [topField, infos] of topLevelGroups) { + const inputFieldData = inputData.inputValueDataByName.get(topField); + if (!inputFieldData) { + // Missing field in input type + if (isNested) { + this.errors.push( + invalidDirectiveError(QUERY_CACHE, fieldCoords, FIRST_ORDINAL, [ + nestedInputObjectMissingFieldErrorMessage( + argumentName, + fieldCoords, + normalizedFieldSet, + entityTypeName, + inputTypeName, + topField, + ), + ]), + ); + } else { + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${argumentName}: ...)`, FIRST_ORDINAL, [ + inputObjectCompositeMissingFieldErrorMessage( + argumentName, + fieldCoords, + normalizedFieldSet, + entityTypeName, + inputTypeName, + topField, + ), + ]), + ); + } + return null; + } + + const fullEntityKeyPath = entityKeyPathPrefix ? `${entityKeyPathPrefix}.${topField}` : topField; + const hasNestedFields = infos.some((i) => i.restPath !== ''); + if (hasNestedFields) { + // Recurse into nested input object + const nestedInfos = infos.map((i) => ({ path: i.restPath, typeNode: i.typeNode })); + const nestedInputTypeName = this.getNamedTypeName(inputFieldData.type); + const nestedMappings = this.validateNestedInputObjectMapping( + argumentName, + fieldCoords, + entityTypeName, + nestedInfos, + normalizedFieldSet, + nestedInputTypeName, + [...argumentPathPrefix, topField], + isBatch, + true, + fullEntityKeyPath, + ); + if (!nestedMappings) { + return null; + } + fieldMappings.push(...nestedMappings); + } else { + // Leaf: check type match — both named type AND list/NonNull wrapping must agree. + // Bug (c): prior code compared only named types, letting `[ID!]!` be satisfied by `ID`. + const keyTypeNode = infos[0].typeNode; + if (!this.typesMatchIncludingListShape(keyTypeNode, inputFieldData.type)) { + // Resolve the entity field's parent type for the error message + // We need to walk the full entity key path to find the parent of the leaf + const fullPath = entityKeyPathPrefix ? `${entityKeyPathPrefix}.${topField}` : topField; + const pathParts = fullPath.split(LITERAL_PERIOD); + let currentType = entityTypeName; + for (let i = 0; i < pathParts.length - 1; i++) { + const pd = this.parentDefinitionDataByTypeName.get(currentType); + if (pd && 'fieldDataByName' in pd) { + const fd = pd.fieldDataByName.get(pathParts[i]); + if (fd) { + currentType = getTypeNodeNamedTypeName(fd.node.type); + } + } + } + const entityFieldCoords = `${currentType}.${pathParts[pathParts.length - 1]}`; + if (isNested) { + this.errors.push( + invalidDirectiveError(QUERY_CACHE, fieldCoords, FIRST_ORDINAL, [ + nestedInputObjectTypeMismatchErrorMessage( + argumentName, + fieldCoords, + normalizedFieldSet, + entityTypeName, + inputTypeName, + topField, + printTypeNode(inputFieldData.node.type), + entityFieldCoords, + printTypeNode(keyTypeNode), + ), + ]), + ); + } else { + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${argumentName}: ...)`, FIRST_ORDINAL, [ + inputObjectCompositeTypeMismatchErrorMessage( + argumentName, + fieldCoords, + normalizedFieldSet, + entityTypeName, + inputTypeName, + topField, + printTypeNode(inputFieldData.node.type), + entityFieldCoords, + printTypeNode(keyTypeNode), + ), + ]), + ); + } + return null; + } + const mapping: FieldMappingConfig = { + entityKeyField: fullEntityKeyPath, + argumentPath: [...argumentPathPrefix, topField], + }; + if (isBatch) { + mapping.isBatch = true; + } + fieldMappings.push(mapping); + } + } + + return fieldMappings; + } + + // The main mapping builder. Evaluates each @key independently and emits all satisfiable keys. + buildArgumentKeyMappings( + fieldData: FieldData, + fieldCoords: string, + entityTypeName: string, + keyFieldSets: Map | undefined, + isListReturn: boolean, + ): EntityKeyMappingConfig[] { + if (!keyFieldSets || keyFieldSets.size === 0) { + return []; + } + + type ArgumentInfo = { + name: string; + data: InputValueData; + isFieldValue: string | undefined; // @openfed__is(fields: "...") value + isList: boolean; + typeNode: TypeNode; + }; + + const argumentInfos: ArgumentInfo[] = []; + for (const [argumentName, argumentData] of fieldData.argumentDataByName) { + argumentInfos.push({ + name: argumentName, + data: argumentData, + isFieldValue: this.getIsFieldValue(argumentData), + isList: isTypeNodeListType(argumentData.type), + typeNode: argumentData.type, + }); + } + + if (this.hasAnyExplicitIs(fieldData)) { + return this.buildExplicitMappings(fieldCoords, entityTypeName, keyFieldSets, isListReturn, argumentInfos); + } + return this.buildAutoMappings(fieldCoords, entityTypeName, keyFieldSets, isListReturn, argumentInfos); + } + + hasAnyExplicitIs(fieldData: FieldData): boolean { + for (const [, argumentData] of fieldData.argumentDataByName) { + const isDirectives = argumentData.directivesByName.get(IS); + if (isDirectives && isDirectives.length > 0) { + return true; + } + } + return false; + } + + buildExplicitMappings( + fieldCoords: string, + entityTypeName: string, + keyFieldSets: Map, + isListReturn: boolean, + argumentInfos: Array<{ + name: string; + data: InputValueData; + isFieldValue: string | undefined; + isList: boolean; + typeNode: TypeNode; + }>, + ): EntityKeyMappingConfig[] { + // Collect all @openfed__is field values and their infos across ALL keys + const allKeyFieldInfosByKey = new Map>(); + // Build a set of ALL key field paths across all keys + const allKeyFieldPaths = new Set(); + // Also build a map from field path -> key field info for type lookups + const fieldInfoByPath = new Map(); + // Track which fields exist on the entity (not necessarily key fields) + const entityFieldNames = new Set(); + const entityParentData = this.parentDefinitionDataByTypeName.get(entityTypeName); + if (entityParentData && 'fieldDataByName' in entityParentData) { + for (const fname of entityParentData.fieldDataByName.keys()) { + entityFieldNames.add(fname); + } + } + + for (const [normalizedFieldSet, keyData] of keyFieldSets) { + const infos = this.extractKeyFieldInfos(keyData.documentNode, entityTypeName); + allKeyFieldInfosByKey.set(normalizedFieldSet, infos); + for (const info of infos) { + allKeyFieldPaths.add(info.path); + fieldInfoByPath.set(info.path, { typeNode: info.typeNode }); + } + } + + // Process each argument with @openfed__is + const explicitMappings: Array<{ + argumentName: string; + isFieldValue: string; + argumentInfo: (typeof argumentInfos)[0]; + }> = []; + const compositeMappings: EntityKeyMappingConfig[] = []; + const mappedKeyFields = new Set(); + + for (const argInfo of argumentInfos) { + if (!argInfo.isFieldValue) { + continue; + } + + const isFieldValue = argInfo.isFieldValue; + + // Check if @openfed__is targets multiple fields (composite key via input object) + const isCompositeIsSpec = isFieldValue.includes(LITERAL_SPACE); + + if (isCompositeIsSpec) { + const errorCount = this.errors.length; + const mappings = this.buildCompositeIsMapping(fieldCoords, entityTypeName, keyFieldSets, isListReturn, argInfo); + if (this.errors.length > errorCount) { + return []; + } + for (const mapping of mappings) { + for (const fieldMapping of mapping.fieldMappings) { + mappedKeyFields.add(fieldMapping.entityKeyField); + } + } + compositeMappings.push(...mappings); + continue; + } + + // Check if the field exists on the entity at all but is not a key field + const topLevelFieldName = isFieldValue.split(LITERAL_PERIOD)[0]; + if (!allKeyFieldPaths.has(isFieldValue)) { + if (entityFieldNames.has(topLevelFieldName) && !isFieldValue.includes(LITERAL_PERIOD)) { + // Field exists but is not a key field + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${argInfo.name}: ...)`, FIRST_ORDINAL, [ + nonKeyFieldSpecErrorMessage(argInfo.name, fieldCoords, isFieldValue, entityTypeName), + ]), + ); + } else { + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${argInfo.name}: ...)`, FIRST_ORDINAL, [ + isReferencesUnknownKeyFieldErrorMessage(isFieldValue, argInfo.name, fieldCoords, entityTypeName), + ]), + ); + } + return []; + } + + // Duplicate check + if (mappedKeyFields.has(isFieldValue)) { + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${argInfo.name}: ...)`, FIRST_ORDINAL, [ + duplicateKeyFieldMappingErrorMessage(fieldCoords, isFieldValue), + ]), + ); + return []; + } + + const keyFieldTypeNode = fieldInfoByPath.get(isFieldValue)!.typeNode; + const argTypeNode = argInfo.typeNode; + + // Type checking + if (isListReturn) { + // Batch mode + if (isTypeNodeListType(keyFieldTypeNode)) { + // Key field is a list - need list-of-lists argument + if (!argInfo.isList) { + // Scalar arg to list key in batch + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${argInfo.name}: ...)`, FIRST_ORDINAL, [ + batchListValuedKeyRequiresNestedListsErrorMessage( + fieldCoords, + isFieldValue, + entityTypeName, + `a scalar tag of type "${printTypeNode(argTypeNode)}"`, + ), + ]), + ); + return []; + } + // List arg but is it list-of-lists? + const unwrapped = this.unwrapListType(argTypeNode); + if (!isTypeNodeListType(unwrapped)) { + // Single list, not list of lists + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${argInfo.name}: ...)`, FIRST_ORDINAL, [ + batchListValuedKeyRequiresNestedListsErrorMessage( + fieldCoords, + isFieldValue, + entityTypeName, + `a single tag list of type "${printTypeNode(argTypeNode)}"`, + ), + ]), + ); + return []; + } + // List of lists - check inner type matches + const innerType = this.unwrapListType(unwrapped); + if (!this.namedTypesMatch(innerType, keyFieldTypeNode)) { + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${argInfo.name}: ...)`, FIRST_ORDINAL, [ + explicitTypeMismatchErrorMessage( + argInfo.name, + fieldCoords, + printTypeNode(argTypeNode), + isFieldValue, + entityTypeName, + printTypeNode(keyFieldTypeNode), + ), + ]), + ); + return []; + } + } else { + // Key field is scalar - need list argument with matching element type + if (argInfo.isList) { + // Check element type + const unwrapped = this.unwrapListType(argTypeNode); + if (!this.namedTypesMatch(unwrapped, keyFieldTypeNode)) { + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${argInfo.name}: ...)`, FIRST_ORDINAL, [ + explicitTypeMismatchErrorMessage( + argInfo.name, + fieldCoords, + printTypeNode(argTypeNode), + isFieldValue, + entityTypeName, + printTypeNode(keyFieldTypeNode), + ), + ]), + ); + return []; + } + } else { + // Scalar arg in batch mode - could still be valid as a scalar @openfed__is, we'll check later + } + } + } else { + // Singular mode + const argIsList = argInfo.isList; + const keyIsList = isTypeNodeListType(keyFieldTypeNode); + + if (argIsList && !keyIsList) { + // List arg to scalar key on singular return + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${argInfo.name}: ...)`, FIRST_ORDINAL, [ + listArgumentToScalarKeySpecErrorMessage( + argInfo.name, + fieldCoords, + printTypeNode(argTypeNode), + isFieldValue, + entityTypeName, + printTypeNode(keyFieldTypeNode), + ), + ]), + ); + return []; + } + + if (!argIsList && keyIsList) { + // Scalar arg to list key on singular return + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${argInfo.name}: ...)`, FIRST_ORDINAL, [ + scalarArgumentToListKeySpecErrorMessage( + argInfo.name, + fieldCoords, + printTypeNode(argTypeNode), + isFieldValue, + entityTypeName, + printTypeNode(keyFieldTypeNode), + ), + ]), + ); + return []; + } + + // Named type comparison (handles both scalar-scalar and list-list) + if (!this.namedTypesMatch(argTypeNode, keyFieldTypeNode)) { + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${argInfo.name}: ...)`, FIRST_ORDINAL, [ + explicitTypeMismatchErrorMessage( + argInfo.name, + fieldCoords, + printTypeNode(argTypeNode), + isFieldValue, + entityTypeName, + printTypeNode(keyFieldTypeNode), + ), + ]), + ); + return []; + } + } + + // Bug (b): @openfed__is(fields: "X") on argument "X" duplicates what auto-mapping would produce. + // This is a lint/noise issue — mapping is still extracted. + // + // Only emit the warning when auto-mapping WOULD have produced the same mapping: + // - Singular return: auto-map requires matching list shape; we already verified named types + // and list shape above, so if arg/key list shape agrees auto-map would succeed. + // - List return: auto-map only batch-maps when the arg is a list AND the key field is scalar + // (argIsList && !keyIsList). When the key field is list-valued, auto-map skips the field + // (see buildAutoMappings: keyIsList path on isListReturn marks keyFullyMapped=false), so + // @openfed__is is REQUIRED and must not be flagged redundant. + if (argInfo.name === isFieldValue) { + const keyIsList = isTypeNodeListType(keyFieldTypeNode); + const argIsList = argInfo.isList; + let autoMapWouldProduceSameMapping: boolean; + if (!isListReturn) { + autoMapWouldProduceSameMapping = argIsList === keyIsList; + } else { + autoMapWouldProduceSameMapping = argIsList && !keyIsList; + } + if (autoMapWouldProduceSameMapping) { + this.warnings.push( + redundantIsDirectiveWarning({ + subgraphName: this.subgraphName, + argumentName: argInfo.name, + fieldCoords, + keyField: isFieldValue, + entityType: entityTypeName, + }), + ); + } + } + + mappedKeyFields.add(isFieldValue); + explicitMappings.push({ argumentName: argInfo.name, isFieldValue, argumentInfo: argInfo }); + } + + if (explicitMappings.length === 0) { + return compositeMappings; + } + + // Check for duplicate: argument name matches a key field that's already explicitly mapped + for (const argInfo of argumentInfos) { + if (argInfo.isFieldValue) { + continue; // Skip @openfed__is arguments + } + if (mappedKeyFields.has(argInfo.name)) { + // This argument would auto-map to a key field that's already explicitly mapped + this.errors.push( + invalidDirectiveError( + IS, + `${fieldCoords}(${argumentInfos.find((a) => a.isFieldValue === argInfo.name)!.name}: ...)`, + FIRST_ORDINAL, + [duplicateKeyFieldMappingErrorMessage(fieldCoords, argInfo.name)], + ), + ); + return []; + } + } + + // Check for batch mode: all explicit mappings on list return + if (isListReturn) { + // Check for extra non-key arguments FIRST (not @openfed__is and not a key field in any key) + const extraArgs = argumentInfos.filter((a) => !a.isFieldValue && !allKeyFieldPaths.has(a.name)); + if (extraArgs.length > 0) { + const firstExplicit = explicitMappings[0]; + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${firstExplicit.argumentName}: ...)`, FIRST_ORDINAL, [ + explicitBatchAdditionalNonKeyArgumentErrorMessage( + fieldCoords, + firstExplicit.argumentName, + firstExplicit.isFieldValue, + entityTypeName, + extraArgs[0].name, + ), + ]), + ); + return []; + } + + // Check if all explicit args are scalars + const allScalar = explicitMappings.every((m) => !m.argumentInfo.isList); + const listMappings = explicitMappings.filter((m) => m.argumentInfo.isList); + + if (allScalar) { + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${explicitMappings[0].argumentName}: ...)`, FIRST_ORDINAL, [ + explicitScalarArgumentsCannotEstablishBatchMappingErrorMessage(fieldCoords, entityTypeName), + ]), + ); + return []; + } + + if (listMappings.length > 1) { + this.errors.push( + invalidDirectiveError(QUERY_CACHE, fieldCoords, FIRST_ORDINAL, [ + multipleListArgumentsBatchFactoryMessage(fieldCoords, entityTypeName), + ]), + ); + return []; + } + } + + // Check for extra non-key arguments globally (args not @openfed__is and not a key field in any key) + const globalExtraArgs = argumentInfos.filter((a) => !a.isFieldValue && !allKeyFieldPaths.has(a.name)); + if (globalExtraArgs.length > 0) { + if (!isListReturn) { + // Find which key the explicit mappings target + let targetKeyNormalized: string | undefined; + for (const [normalizedFieldSet] of keyFieldSets) { + const keyInfos = allKeyFieldInfosByKey.get(normalizedFieldSet)!; + const keyPaths = new Set(keyInfos.map((i) => i.path)); + if (explicitMappings.every((m) => keyPaths.has(m.isFieldValue))) { + targetKeyNormalized = normalizedFieldSet; + break; + } + } + + if (explicitMappings.length === 1 && targetKeyNormalized && !targetKeyNormalized.includes(LITERAL_SPACE)) { + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${explicitMappings[0].argumentName}: ...)`, FIRST_ORDINAL, [ + explicitSingularAdditionalNonKeyArgumentErrorMessage( + fieldCoords, + explicitMappings[0].argumentName, + explicitMappings[0].isFieldValue, + entityTypeName, + globalExtraArgs[0].name, + ), + ]), + ); + } else if (targetKeyNormalized) { + const isArgNames = explicitMappings.map((m) => m.argumentName); + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${isArgNames[0]}: ...)`, FIRST_ORDINAL, [ + explicitCompositeAdditionalNonKeyArgumentErrorMessage( + fieldCoords, + isArgNames[0], + isArgNames[1] || isArgNames[0], + targetKeyNormalized, + entityTypeName, + globalExtraArgs[0].name, + ), + ]), + ); + } + return []; + } else { + const firstExplicit = explicitMappings[0]; + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${firstExplicit.argumentName}: ...)`, FIRST_ORDINAL, [ + explicitBatchAdditionalNonKeyArgumentErrorMessage( + fieldCoords, + firstExplicit.argumentName, + firstExplicit.isFieldValue, + entityTypeName, + globalExtraArgs[0].name, + ), + ]), + ); + return []; + } + } + + // Now try to find satisfiable keys + const results: EntityKeyMappingConfig[] = []; + for (const normalizedFieldSet of keyFieldSets.keys()) { + const keyInfos = allKeyFieldInfosByKey.get(normalizedFieldSet)!; + const keyPaths = new Set(keyInfos.map((i) => i.path)); + + // Check which explicit mappings target this key + const explicitForThisKey = explicitMappings.filter((m) => keyPaths.has(m.isFieldValue)); + + // Check that ALL fields of this key are mapped (explicit or auto) + const autoMappedForKey: Array<{ argumentName: string; keyPath: string; argInfo: (typeof argumentInfos)[0] }> = []; + const unmappedFields: string[] = []; + let keyFullySatisfied = true; + + for (const info of keyInfos) { + // Is it covered by an explicit mapping? + if (explicitForThisKey.some((m) => m.isFieldValue === info.path)) { + continue; + } + // Try auto-mapping + const autoMapped = argumentInfos.find((a) => !a.isFieldValue && a.name === info.path); + if ( + autoMapped && + this.namedTypesMatch(autoMapped.typeNode, info.typeNode) && + isTypeNodeListType(autoMapped.typeNode) === isTypeNodeListType(info.typeNode) + ) { + autoMappedForKey.push({ argumentName: autoMapped.name, keyPath: info.path, argInfo: autoMapped }); + } else { + unmappedFields.push(info.path); + keyFullySatisfied = false; + } + } + + if (!keyFullySatisfied) { + // If this key has explicit mappings targeting it but is incomplete, error + if (explicitForThisKey.length > 0 && unmappedFields.length > 0) { + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${explicitForThisKey[0].argumentName}: ...)`, FIRST_ORDINAL, [ + explicitIncompleteCompositeKeyErrorMessage( + fieldCoords, + explicitForThisKey[0].argumentName, + explicitForThisKey[0].isFieldValue, + entityTypeName, + normalizedFieldSet, + unmappedFields[0], + ), + ]), + ); + return []; + } + continue; + } + + // Build field mappings in key field info order + const fieldMappings: FieldMappingConfig[] = []; + for (const info of keyInfos) { + const explicitMatch = explicitForThisKey.find((m) => m.isFieldValue === info.path); + if (explicitMatch) { + const mapping: FieldMappingConfig = { + entityKeyField: explicitMatch.isFieldValue, + argumentPath: [explicitMatch.argumentName], + }; + if (isListReturn && explicitMatch.argumentInfo.isList) { + mapping.isBatch = true; + } + fieldMappings.push(mapping); + continue; + } + const autoMatch = autoMappedForKey.find((a) => a.keyPath === info.path); + if (autoMatch) { + const mapping: FieldMappingConfig = { + entityKeyField: autoMatch.keyPath, + argumentPath: [autoMatch.argumentName], + }; + if (isListReturn && autoMatch.argInfo.isList) { + mapping.isBatch = true; + } + fieldMappings.push(mapping); + } + } + + if (fieldMappings.length > 0) { + results.push({ entityTypeName, fieldMappings }); + } + } + + // Each key remains its own EntityKeyMappingConfig — the router evaluates them + // independently (OR semantics). Do NOT merge single-field results. + return [...compositeMappings, ...results]; + } + + buildCompositeIsMapping( + fieldCoords: string, + entityTypeName: string, + keyFieldSets: Map, + isListReturn: boolean, + argInfo: { + name: string; + data: InputValueData; + isFieldValue: string | undefined; + isList: boolean; + typeNode: TypeNode; + }, + ): EntityKeyMappingConfig[] { + const isFieldValue = argInfo.isFieldValue!; + const { documentNode } = safeParse('{' + isFieldValue + '}'); + const normalizedIsFieldValue = documentNode ? getNormalizedFieldSet(documentNode) : isFieldValue; + + // Find the matching key + for (const [normalizedFieldSet, keyData] of keyFieldSets) { + if (normalizedFieldSet !== normalizedIsFieldValue) { + continue; + } + + const keyInfos = this.extractKeyFieldInfos(keyData.documentNode, entityTypeName); + const argTypeName = this.getNamedTypeName(argInfo.typeNode); + + // Check if argument is an input object type + const inputData = this.parentDefinitionDataByTypeName.get(argTypeName); + if (!inputData || inputData.kind !== Kind.INPUT_OBJECT_TYPE_DEFINITION) { + // Non-input argument targeting composite key + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${argInfo.name}: ...)`, FIRST_ORDINAL, [ + nonInputArgumentCannotTargetCompositeKeyErrorMessage( + argInfo.name, + fieldCoords, + isFieldValue, + entityTypeName, + printTypeNode(argInfo.typeNode), + ), + ]), + ); + return []; + } + + const isBatch = isListReturn && argInfo.isList; + const isNestedKey = normalizedFieldSet.includes(LITERAL_OPEN_BRACE); + + const fieldMappings = this.validateNestedInputObjectMapping( + argInfo.name, + fieldCoords, + entityTypeName, + keyInfos, + normalizedFieldSet, + argTypeName, + [argInfo.name], + isBatch, + isNestedKey, + ); + + if (!fieldMappings) { + return []; + } + + return [{ entityTypeName, fieldMappings }]; + } + + // Key not found + this.errors.push( + invalidDirectiveError(IS, `${fieldCoords}(${argInfo.name}: ...)`, FIRST_ORDINAL, [ + isReferencesUnknownKeyFieldErrorMessage(isFieldValue, argInfo.name, fieldCoords, entityTypeName), + ]), + ); + return []; + } + + invalidateAutoMappingWithExtraArgument( + argumentInfos: Array<{ name: string }>, + allKeyFieldPaths: Set, + mappedArgumentNames: Set, + isListReturn: boolean, + fieldCoords: string, + entityTypeName: string, + argumentName: string | undefined, + keyField: string | undefined, + emitWarning: boolean = true, + ): boolean { + const extraArgs = argumentInfos.filter((a) => !allKeyFieldPaths.has(a.name) && !mappedArgumentNames.has(a.name)); + if (extraArgs.length < 1 || !argumentName || !keyField) { + return false; + } + if (!emitWarning) { + return true; + } + if (isListReturn) { + this.warnings.push( + autoBatchAdditionalNonKeyArgumentWarning({ + subgraphName: this.subgraphName, + fieldCoords, + argumentName, + keyField, + entityType: entityTypeName, + extraArgument: extraArgs[0].name, + }), + ); + } else { + this.warnings.push( + autoMappingAdditionalNonKeyArgumentWarning({ + subgraphName: this.subgraphName, + argumentName, + fieldCoords, + keyField, + entityType: entityTypeName, + extraArgument: extraArgs[0].name, + }), + ); + } + return true; + } + + buildAutoMappings( + fieldCoords: string, + entityTypeName: string, + keyFieldSets: Map, + isListReturn: boolean, + argumentInfos: Array<{ + name: string; + data: InputValueData; + isFieldValue: string | undefined; + isList: boolean; + typeNode: TypeNode; + }>, + ): EntityKeyMappingConfig[] { + const results: EntityKeyMappingConfig[] = []; + let typeMismatchWarningEmitted = false; + + // Gather ALL key field paths across all keys to determine which args are "non-key" + const allKeyFieldPaths = new Set(); + for (const [, keyData] of keyFieldSets) { + const infos = this.extractKeyFieldInfos(keyData.documentNode, entityTypeName); + for (const info of infos) { + allKeyFieldPaths.add(info.path); + } + } + + // Try nested input object auto-mapping first: + // arguments whose named type is an input object matching a nested key structure. + for (const [normalizedFieldSet, keyData] of keyFieldSets) { + if (!normalizedFieldSet.includes(LITERAL_OPEN_BRACE)) { + continue; // Only for nested keys + } + + const keyInfos = this.extractKeyFieldInfos(keyData.documentNode, entityTypeName); + if (keyInfos.length === 0) { + continue; + } + + // Check if there's an argument whose name matches the top-level field of the key + // and whose type is an input object + const topFields = new Set(); + for (const info of keyInfos) { + const topField = info.path.split(LITERAL_PERIOD)[0]; + topFields.add(topField); + } + + // If there's exactly one top-level field and an argument with that name + if (topFields.size === 1) { + const topFieldName = [...topFields][0]; + const matchingArg = argumentInfos.find((a) => a.name === topFieldName); + if (matchingArg) { + const argTypeName = this.getNamedTypeName(matchingArg.typeNode); + const inputData = this.parentDefinitionDataByTypeName.get(argTypeName); + if (inputData && inputData.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION) { + // Re-root key infos relative to the top field + const nestedInfos = keyInfos.map((info) => ({ + path: info.path.substring(topFieldName.length + 1), + typeNode: info.typeNode, + })); + + const isBatch = isListReturn && matchingArg.isList; + const fieldMappings = this.validateNestedInputObjectMapping( + matchingArg.name, + fieldCoords, + entityTypeName, + nestedInfos, + normalizedFieldSet, + argTypeName, + [matchingArg.name], + isBatch, + true, + topFieldName, + ); + + if (fieldMappings) { + if ( + this.invalidateAutoMappingWithExtraArgument( + argumentInfos, + allKeyFieldPaths, + new Set([matchingArg.name]), + isListReturn, + fieldCoords, + entityTypeName, + matchingArg.name, + fieldMappings[0]?.entityKeyField, + false, + ) + ) { + results.length = 0; + continue; + } + results.push({ entityTypeName, fieldMappings }); + } + // Whether it succeeded or failed, we handled this key + continue; + } + } + } + } + + // Per-key independent evaluation for flat keys. + // Two classes of failure: + // (1) Per-key failure (type mismatch on a field) → continue to the next @key; earlier + // satisfiable @keys (including the nested ones above) are preserved. + // (2) Global-invalidation failure (extra non-key argument — singular OR batch rule violation) + // → clear ALL accumulated mappings and stop evaluating further keys. This preserves the + // pre-bug-(d) behavior where an extra non-key argument rejects the whole set because the + // cache key would be incomplete. + let globallyInvalidated = false; + for (const keyData of keyFieldSets.values()) { + if (globallyInvalidated) { + break; + } + const keyInfos = this.extractKeyFieldInfos(keyData.documentNode, entityTypeName); + if (keyInfos.length === 0) { + continue; + } + + const fieldMappings: FieldMappingConfig[] = []; + let keyFullyMapped = true; + let keyFailed = false; + let firstMatchedArg: string | undefined; + let firstMatchedKeyField: string | undefined; + let unmappedField: string | undefined; + let scalarMatchedOnListReturn = false; + + for (const keyInfo of keyInfos) { + const fieldName = keyInfo.path; + const matchingArg = argumentInfos.find((a) => a.name === fieldName); + + if (!matchingArg) { + keyFullyMapped = false; + unmappedField = fieldName; + continue; + } + + const argTypeNode = matchingArg.typeNode; + const keyTypeNode = keyInfo.typeNode; + const argIsList = matchingArg.isList; + const keyIsList = isTypeNodeListType(keyTypeNode); + + if (!this.namedTypesMatch(argTypeNode, keyTypeNode) || (argIsList !== keyIsList && !isListReturn)) { + if (!typeMismatchWarningEmitted) { + this.warnings.push( + autoMappingTypeMismatchWarning({ + subgraphName: this.subgraphName, + argumentName: matchingArg.name, + fieldCoords, + argumentType: printTypeNode(argTypeNode), + keyField: fieldName, + entityType: entityTypeName, + keyFieldType: printTypeNode(keyTypeNode), + }), + ); + typeMismatchWarningEmitted = true; + } + // Bug (d): a failed candidate on this @key must not abort the remaining @key alternatives. + // Mark this key as unmappable and let the outer loop move on to the next @key. + keyFullyMapped = false; + keyFailed = true; + break; + } + + if (!firstMatchedArg) { + firstMatchedArg = matchingArg.name; + firstMatchedKeyField = fieldName; + } + + if (isListReturn) { + if (argIsList) { + if (keyIsList) { + keyFullyMapped = false; + continue; + } + fieldMappings.push({ + entityKeyField: fieldName, + argumentPath: [matchingArg.name], + isBatch: true, + }); + } else { + // Scalar arg on list return - skip auto-mapping (no batch) + scalarMatchedOnListReturn = true; + keyFullyMapped = false; + continue; + } + } else { + fieldMappings.push({ + entityKeyField: fieldName, + argumentPath: [matchingArg.name], + }); + } + } + + // Bug (d): type mismatch on this @key aborted the inner loop — skip to the next @key + // without emitting further warnings or blocking other alternatives. + if (keyFailed) { + continue; + } + + // Check for extra non-key arguments (args not in ANY key across all keys) + const extraArgs = argumentInfos.filter((a) => !allKeyFieldPaths.has(a.name)); + + // On list return, if a scalar matched but was skipped and there are extra args, warn. + // Class (2): an extra non-key argument on a list-return field rejects the whole mapping set. + if ( + isListReturn && + scalarMatchedOnListReturn && + extraArgs.length > 0 && + firstMatchedArg && + firstMatchedKeyField + ) { + this.warnings.push( + autoBatchAdditionalNonKeyArgumentWarning({ + subgraphName: this.subgraphName, + fieldCoords, + argumentName: firstMatchedArg, + keyField: firstMatchedKeyField, + entityType: entityTypeName, + extraArgument: extraArgs[0].name, + }), + ); + // Class (2) global invalidation: clear accumulated results and stop evaluating further keys. + results.length = 0; + globallyInvalidated = true; + continue; + } + + if (!keyFullyMapped && fieldMappings.length > 0 && unmappedField) { + if (!isListReturn) { + this.warnings.push( + incompleteQueryCacheKeyMappingWarning({ + subgraphName: this.subgraphName, + fieldCoords, + entityType: entityTypeName, + unmappedKeyField: unmappedField, + }), + ); + } + continue; + } + + if (keyFullyMapped && fieldMappings.length > 0) { + if ( + this.invalidateAutoMappingWithExtraArgument( + argumentInfos, + allKeyFieldPaths, + new Set(fieldMappings.map((m) => m.argumentPath[0])), + isListReturn, + fieldCoords, + entityTypeName, + firstMatchedArg, + firstMatchedKeyField, + ) + ) { + // Class (2) global invalidation: an extra non-key argument on a fully-mapped key + // (list or singular return) must suppress auto-mapping across all @key alternatives, + // including earlier accumulated nested-key results. A per-key `continue` would leave + // mappings tied to a result set still filtered by an unkeyed argument — unsafe. + results.length = 0; + globallyInvalidated = true; + continue; + } + + results.push({ entityTypeName, fieldMappings }); + } + } + + // Each key remains its own EntityKeyMappingConfig — the router evaluates them + // independently (OR semantics). Do NOT merge single-field results. + return results; + } + getValidFlattenedDirectiveArray( directivesByName: Map, directiveCoords: string, @@ -3559,7 +5257,7 @@ export class NormalizationFactory { if (!handledDirectiveNames.has(directiveName)) { handledDirectiveNames.add(directiveName); this.errors.push( - invalidDirectiveError(directiveName, directiveCoords, '1st', [ + invalidDirectiveError(directiveName, directiveCoords, FIRST_ORDINAL, [ invalidRepeatedDirectiveErrorMessage(directiveName), ]), ); @@ -4121,6 +5819,10 @@ export class NormalizationFactory { this.addValidConditionalFieldSetConfigurations(); // this is where @key configurations are added to the ConfigurationData this.addValidKeyFieldSetConfigurations(); + // this is where @openfed__requestScoped configurations are added to the ConfigurationData + this.extractRequestScopedFields(); + // Extract and validate entity caching directives + this.validateAndExtractEntityCachingConfigs(); // Check that explicitly defined operations types are valid objects and that their fields are also valid for (const operationType of Object.values(OperationTypeNode)) { const operationTypeNode = this.schemaData.operationTypes.get(operationType); diff --git a/composition/src/v1/normalization/utils.ts b/composition/src/v1/normalization/utils.ts index 10b4504e61..4c5e4365ad 100644 --- a/composition/src/v1/normalization/utils.ts +++ b/composition/src/v1/normalization/utils.ts @@ -26,16 +26,20 @@ import { import { getTypeNodeNamedTypeName } from '../../schema-building/ast'; import { AUTHENTICATED_DEFINITION_DATA, + CACHE_INVALIDATE_DEFINITION_DATA, + CACHE_POPULATE_DEFINITION_DATA, COMPOSE_DIRECTIVE_DEFINITION_DATA, CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION_DATA, CONFIGURE_DESCRIPTION_DEFINITION_DATA, CONNECT_FIELD_RESOLVER_DEFINITION_DATA, COST_DEFINITION_DATA, DEPRECATED_DEFINITION_DATA, + ENTITY_CACHE_DEFINITION_DATA, EXTENDS_DEFINITION_DATA, EXTERNAL_DEFINITION_DATA, INACCESSIBLE_DEFINITION_DATA, INTERFACE_OBJECT_DEFINITION_DATA, + IS_DEFINITION_DATA, KAFKA_PUBLISH_DEFINITION_DATA, KAFKA_SUBSCRIBE_DEFINITION_DATA, KEY_DEFINITION_DATA, @@ -47,9 +51,11 @@ import { ONE_OF_DEFINITION_DATA, OVERRIDE_DEFINITION_DATA, PROVIDES_DEFINITION_DATA, + QUERY_CACHE_DEFINITION_DATA, REDIS_PUBLISH_DEFINITION_DATA, REDIS_SUBSCRIBE_DEFINITION_DATA, REQUIRE_FETCH_REASONS_DEFINITION_DATA, + REQUEST_SCOPED_DEFINITION_DATA, REQUIRES_DEFINITION_DATA, REQUIRES_SCOPES_DEFINITION_DATA, SEMANTIC_NON_NULL_DATA, @@ -60,6 +66,8 @@ import { } from './directive-definition-data'; import { AUTHENTICATED, + CACHE_INVALIDATE, + CACHE_POPULATE, COMPOSE_DIRECTIVE, CONFIGURE_CHILD_DESCRIPTIONS, CONFIGURE_DESCRIPTION, @@ -73,11 +81,13 @@ import { EDFS_NATS_SUBSCRIBE, EDFS_REDIS_PUBLISH, EDFS_REDIS_SUBSCRIBE, + ENTITY_CACHE, EXTENDS, EXTERNAL, FIELDS, INACCESSIBLE, INTERFACE_OBJECT, + IS, KEY, LINK, LIST_SIZE, @@ -86,6 +96,8 @@ import { OVERRIDE, PROVIDES, QUERY, + QUERY_CACHE, + REQUEST_SCOPED, REQUIRE_FETCH_REASONS, REQUIRES, REQUIRES_SCOPES, @@ -433,6 +445,8 @@ export function validateArgumentTemplateReferences( export function initializeDirectiveDefinitionDatas(): Map { return new Map([ [AUTHENTICATED, AUTHENTICATED_DEFINITION_DATA], + [CACHE_INVALIDATE, CACHE_INVALIDATE_DEFINITION_DATA], + [CACHE_POPULATE, CACHE_POPULATE_DEFINITION_DATA], [COMPOSE_DIRECTIVE, COMPOSE_DIRECTIVE_DEFINITION_DATA], [CONFIGURE_DESCRIPTION, CONFIGURE_DESCRIPTION_DEFINITION_DATA], [CONFIGURE_CHILD_DESCRIPTIONS, CONFIGURE_CHILD_DESCRIPTIONS_DEFINITION_DATA], @@ -446,16 +460,20 @@ export function initializeDirectiveDefinitionDatas(): Map { + // ═══════════════════════════════════════════════════════════════════════════ + // @openfed__queryCache + @openfed__is mapping edge cases + // ═══════════════════════════════════════════════════════════════════════════ + + describe('@openfed__queryCache + @openfed__is edge cases', () => { + test('1. @openfed__queryCache on field with NO arguments — should succeed with empty mappings', () => { + // A Query field with @openfed__queryCache but zero arguments cannot construct a cache key. + // Expect: succeeds (cache population still works), empty mappings. + const config = getConfigForType( + subgraph(` + type Query { + latestProduct: Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toStrictEqual([ + { + fieldName: 'latestProduct', + maxAgeSeconds: 30, + includeHeaders: false, + shadowMode: false, + entityTypeName: 'Product', + entityKeyMappings: [], + }, + ] satisfies RootFieldCacheConfig[]); + }); + + test('2. @openfed__queryCache on field returning nullable entity (Product not Product!) — should succeed', () => { + // Nullable return type should still work — the entity type name is extracted + // by unwrapping NonNull wrappers. + const config = getConfigForType( + subgraph(` + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toHaveLength(1); + expect(config!.rootFieldCacheConfigurations![0].entityTypeName).toBe('Product'); + // Auto-mapping should still work + expect(config!.rootFieldCacheConfigurations![0].entityKeyMappings).toHaveLength(1); + }); + + test('3. @openfed__queryCache on field returning union type — should error (union is not an entity)', () => { + // A union type itself doesn't have @key, so it's not an entity. + // Expect: error about non-entity return type. + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { + item(id: ID!): Item @openfed__queryCache(maxAge: 30) + } + union Item = Product | Service + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + type Service @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + description: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + }); + + test('4. @openfed__queryCache on field returning interface type — should error (interface is not a keyed entity)', () => { + // An interface can't have @key in federation v1-style, so it's not an entity. + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { + node(id: ID!): Node @openfed__queryCache(maxAge: 30) + } + interface Node { + id: ID! + } + type Product implements Node @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + }); + + test('5. @openfed__is(fields: "id") on argument WITHOUT @openfed__queryCache — should error', () => { + // @openfed__is only makes sense for cache key construction. Without @openfed__queryCache, it's meaningless. + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { + product(pid: ID! @openfed__is(fields: "id")): Product + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(pid: ...)', FIRST_ORDINAL, [ + isWithoutQueryCacheErrorMessage('pid', 'Query.product'), + ]), + ); + }); + + test('6. @openfed__is(fields: "id id") — composition error about unknown @key field', () => { + // The "id id" fields value is a single field-set string. The field-set + // validator resolves it against @key(fields: "id") on Product and reports + // an unknown-key-field error rather than accepting a duplicate mapping. + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { + product(key: ProductKey! @openfed__is(fields: "id id")): Product @openfed__queryCache(maxAge: 30) + } + input ProductKey { + id: ID! + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0].message).toContain( + '@openfed__is(fields: "id id") on argument "key" of field "Query.product" references unknown @key field "id id" on type "Product".', + ); + }); + }); + + // ═══════════════════════════════════════════════════════════════════════════ + // @openfed__entityCache edge cases + // ═══════════════════════════════════════════════════════════════════════════ + + describe('@openfed__entityCache edge cases', () => { + test('7. @openfed__entityCache on type with multiple @key directives — config should still have one entityCacheConfig', () => { + // Multiple @key directives on same type, single @openfed__entityCache. The entity has + // multiple ways to be identified, but only one cache TTL config. + const config = getConfigForType( + subgraph(` + type Query { product(id: ID!): Product } + type Product @key(fields: "id") @key(fields: "sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + `), + 'Product', + ); + expect(config).toBeDefined(); + // Should have exactly one entityCacheConfig regardless of multiple keys + expect(config!.entityCacheConfigurations).toHaveLength(1); + expect(config!.entityCacheConfigurations![0].maxAgeSeconds).toBe(60); + }); + + test('8. @openfed__entityCache with very large maxAge (Int32 max) — should accept', () => { + // Very large TTL. GraphQL `Int` is 32-bit signed, so 2^31-1 = 2147483647 is the max. + // Previously this test used 999999999999, which is outside GraphQL Int range and would + // be rejected by the spec-compliant parser — shadowing the intent of the "large but valid + // TTL" check. + // Expect: succeeds, config has the exact value. + const config = getConfigForType( + subgraph(` + type Query { product(id: ID!): Product } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 2147483647) { + id: ID! + name: String! + } + `), + 'Product', + ); + expect(config).toBeDefined(); + expect(config!.entityCacheConfigurations).toHaveLength(1); + expect(config!.entityCacheConfigurations![0].maxAgeSeconds).toBe(2147483647); + }); + + test('9. @openfed__entityCache on type with ONLY unresolvable @key(resolvable: false) — should succeed', () => { + // An entity with only unresolvable keys still has @key, so @openfed__entityCache should be accepted. + // The router uses the key to construct cache keys even if it can't resolve the entity. + const { schema } = normalizeSubgraphSuccess( + subgraph(` + type Query { dummy: String! } + type Product @key(fields: "id", resolvable: false) @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(schema).toBeDefined(); + }); + + test('10. Multiple @openfed__entityCache on same type — composition error (non-repeatable)', () => { + // @openfed__entityCache is not marked repeatable. Declaring it twice on + // the same type must produce the standard "not repeatable" composition + // error, not silently pick one TTL. + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { product(id: ID!): Product } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) @openfed__entityCache(maxAge: 120) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0].message).toContain( + 'The definition for the directive "@openfed__entityCache" does not define it as repeatable, but it is declared more than once on these coordinates.', + ); + }); + }); + + // ═══════════════════════════════════════════════════════════════════════════ + // Multiple @key + @openfed__queryCache mapping edge cases + // ═══════════════════════════════════════════════════════════════════════════ + + describe('multiple @key + @openfed__queryCache mapping', () => { + test('11. Two @key directives, argument satisfies both — both keys should produce mappings', () => { + // @key(fields: "id") and @key(fields: "id sku") — argument "id" satisfies the first key fully. + // The second key needs both "id" and "sku", and only "id" is provided. + // Expect: one fully-mapped key (for "id"), the second key is incomplete so it's skipped. + const config = getConfigForType( + subgraph(` + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @key(fields: "id sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + const rfcs = config!.rootFieldCacheConfigurations!; + expect(rfcs).toHaveLength(1); + // The first key "id" should be fully satisfied + const fullMappings = rfcs[0].entityKeyMappings.filter((m) => m.fieldMappings.length > 0); + expect(fullMappings).toHaveLength(1); + // At least one mapping should map "id" to "id" + const hasIdMapping = fullMappings.some((m) => + m.fieldMappings.some((f) => f.entityKeyField === 'id' && f.argumentPath[0] === 'id'), + ); + expect(hasIdMapping).toBe(true); + }); + + // BUG: Two independent @key directives (@key(fields: "id") and @key(fields: "sku")) + // each produce a single-field EntityKeyMappingConfig. But buildAutoMappings() at lines + // 4921-4931 merges all single-field results into ONE EntityKeyMappingConfig with both + // field mappings. This makes the router treat them as a composite key (AND semantics: + // both "id" AND "sku" must match) instead of independent keys (OR semantics: either + // "id" OR "sku" can be used for a cache hit). The merge is wrong — independent keys + // should remain separate EntityKeyMappingConfig entries. + test('12. Two @key directives, arguments satisfy both fully — should produce two key mappings', () => { + const config = getConfigForType( + subgraph(` + type Query { + product(id: ID!, sku: String!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @key(fields: "sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + const mappings = config!.rootFieldCacheConfigurations![0].entityKeyMappings; + // Both keys should be fully satisfied as SEPARATE entries + expect(mappings).toHaveLength(2); + }); + }); + + // ═══════════════════════════════════════════════════════════════════════════ + // Nested key edge cases + // ═══════════════════════════════════════════════════════════════════════════ + + describe('nested key edge cases', () => { + test('13. @key(fields: "store { id }") with @openfed__is(fields: "store.id") on scalar arg', () => { + // Nested key path: "store.id" — the @openfed__is targets it with dot notation. + // Expect: succeeds, mapping has entityKeyField "store.id". + const config = getConfigForType( + subgraph(` + type Query { + product(storeId: ID! @openfed__is(fields: "store.id")): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "store { id }") @openfed__entityCache(maxAge: 60) { + store: Store! + name: String! + } + type Store { + id: ID! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + const mappings = config!.rootFieldCacheConfigurations![0].entityKeyMappings; + expect(mappings).toHaveLength(1); + expect(mappings[0].fieldMappings).toHaveLength(1); + expect(mappings[0].fieldMappings[0].entityKeyField).toBe('store.id'); + expect(mappings[0].fieldMappings[0].argumentPath).toStrictEqual(['storeId']); + }); + + test('14. @key with deeply nested field (3 levels)', () => { + // @key(fields: "a { b { c } }") — deep nesting. + // Expect: succeeds with key. + const { schema } = normalizeSubgraphSuccess( + subgraph(` + type Query { thing(id: ID!): Thing } + type Thing @key(fields: "a { b { c } }") @openfed__entityCache(maxAge: 60) { + a: A! + } + type A { + b: B! + } + type B { + c: ID! + } + `), + version, + ); + expect(schema).toBeDefined(); + }); + }); + + // ═══════════════════════════════════════════════════════════════════════════ + // @openfed__is with input objects + // ═══════════════════════════════════════════════════════════════════════════ + + describe('@openfed__is with input objects', () => { + test('15. @openfed__is(fields: "id sku") with input object having EXTRA fields — succeeds, extra field ignored', () => { + // Extra non-key fields on the input object are tolerated when the + // @openfed__is spec names only the key fields. The mapping is emitted + // exactly for "id" and "sku"; the "extra" field is not part of the + // cache key. Any future change that starts rejecting this case, or + // starts including "extra" in the mapping, must update this assertion. + const sg = subgraph(` + type Query { + product(key: ProductKey! @openfed__is(fields: "id sku")): Product @openfed__queryCache(maxAge: 30) + } + input ProductKey { + id: ID! + sku: String! + extra: String! + } + type Product @key(fields: "id sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + `); + const result = batchNormalize({ subgraphs: [sg], version }); + expect(result.success).toBe(true); + const internal = (result as BatchNormalizationSuccess).internalSubgraphBySubgraphName.get(sg.name); + const queryConfig = internal!.configurationDataByTypeName.get(QUERY as TypeName); + expect(queryConfig?.rootFieldCacheConfigurations).toEqual([ + { + fieldName: 'product', + maxAgeSeconds: 30, + includeHeaders: false, + shadowMode: false, + entityTypeName: 'Product', + entityKeyMappings: [ + { + entityTypeName: 'Product', + fieldMappings: [ + { entityKeyField: 'id', argumentPath: ['key', 'id'] }, + { entityKeyField: 'sku', argumentPath: ['key', 'sku'] }, + ], + }, + ], + }, + ]); + }); + + test('16. @openfed__is(fields: "id sku") with input object MISSING one field — composition error', () => { + // The input object is missing "sku", so the @openfed__is spec cannot be + // satisfied. This must produce an explicit error naming the missing field. + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { + product(key: ProductKey! @openfed__is(fields: "id sku")): Product @openfed__queryCache(maxAge: 30) + } + input ProductKey { + id: ID! + } + type Product @key(fields: "id sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0].message).toContain( + 'Argument "key" on field "Query.product" uses @openfed__is(fields: "id sku") mapping to composite @key on entity "Product", but input type "ProductKey" is missing required key field "sku".', + ); + }); + }); + + // ═══════════════════════════════════════════════════════════════════════════ + // @openfed__requestScoped edge cases + // ═══════════════════════════════════════════════════════════════════════════ + + describe('@openfed__requestScoped edge cases', () => { + test('17. @openfed__requestScoped requires key — missing key is a failure', () => { + // key is mandatory. + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { + currentUser: User @openfed__requestScoped + user: User @openfed__requestScoped(key: "u") + } + type User @key(fields: "id") { + id: ID! + name: String! + } + `), + version, + ); + // The error is from the directive definition validation — key is required. + expect(errors).toHaveLength(1); + }); + + test('18. @openfed__requestScoped with ≥ 2 fields sharing the same key — no warning, l1Key subgraph-prefixed', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Query { + me: User @openfed__requestScoped(key: "me") + } + type Article @key(fields: "id") { + id: ID! + viewer: User @openfed__requestScoped(key: "me") + } + type User @key(fields: "id") { + id: ID! + name: String! + } + `), + version, + ); + // No single-field warning because both fields declare key: "me" + expect(warnings).toHaveLength(0); + + const config = getConfigForType( + subgraph(` + type Query { + me: User @openfed__requestScoped(key: "me") + } + type Article @key(fields: "id") { + id: ID! + viewer: User @openfed__requestScoped(key: "me") + } + type User @key(fields: "id") { + id: ID! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + expect(config!.requestScopedFields).toBeDefined(); + expect(config!.requestScopedFields).toHaveLength(1); + expect(config!.requestScopedFields![0].l1Key).toBe('subgraph-a.me'); + }); + + test('19. @openfed__requestScoped on a non-entity type field — should succeed when ≥ 2 fields share the key', () => { + // @openfed__requestScoped is on FIELD_DEFINITION, works on any object type field. + const config = getConfigForType( + subgraph(` + type Query { + currentLocale: String @openfed__requestScoped(key: "locale") + } + type Article @key(fields: "id") { + id: ID! + articleLocale: String @openfed__requestScoped(key: "locale") + } + `), + QUERY, + ); + expect(config).toBeDefined(); + expect(config!.requestScopedFields).toBeDefined(); + expect(config!.requestScopedFields).toHaveLength(1); + expect(config!.requestScopedFields![0].fieldName).toBe('currentLocale'); + expect(config!.requestScopedFields![0].l1Key).toBe('subgraph-a.locale'); + }); + + test('20. @openfed__requestScoped with only one field declaring a key — warning emitted', () => { + // Single-field @openfed__requestScoped is meaningless (no second reader to benefit). + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Query { + currentUser: User @openfed__requestScoped(key: "lonely") + } + type User @key(fields: "id") { + id: ID! + name: String! + } + `), + version, + ); + expect(warnings).toHaveLength(1); + expect(warnings[0]).toStrictEqual( + requestScopedSingleFieldWarning({ + subgraphName: 'subgraph-a', + key: 'lonely', + fieldCoords: 'Query.currentUser', + }), + ); + }); + + test('21. Multiple @openfed__requestScoped on same field — not repeatable, should fail', () => { + // @openfed__requestScoped is NOT repeatable. + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { + currentUser: User @openfed__requestScoped(key: "a") @openfed__requestScoped(key: "b") + } + type User @key(fields: "id") { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + }); + }); + + // ═══════════════════════════════════════════════════════════════════════════ + // @openfed__cacheInvalidate / @openfed__cachePopulate edge cases + // ═══════════════════════════════════════════════════════════════════════════ + + describe('@openfed__cacheInvalidate/@openfed__cachePopulate edge cases', () => { + test('22. @openfed__cachePopulate(maxAge: -1) — should error', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { dummy: String! } + type Mutation { + createProduct(name: String!): Product @openfed__cachePopulate(maxAge: -1) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(CACHE_POPULATE, 'Mutation.createProduct', FIRST_ORDINAL, [ + maxAgeNotPositiveIntegerErrorMessage(CACHE_POPULATE, -1), + ]), + ); + }); + + test('23. @openfed__cacheInvalidate returning a list type — should succeed', () => { + // Mutation returning [Product]! with @openfed__cacheInvalidate. The named type is still "Product". + // getTypeNodeNamedTypeName unwraps list and NonNull wrappers. + const { schema } = normalizeSubgraphSuccess( + subgraph(` + type Query { dummy: String! } + type Mutation { + deleteProducts(ids: [ID!]!): [Product!]! @openfed__cacheInvalidate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(schema).toBeDefined(); + }); + + test('24. @openfed__cacheInvalidate on Subscription field — should succeed', () => { + // The code allows both Mutation and Subscription for @openfed__cacheInvalidate. + const config = getConfigForType( + subgraph(` + type Query { dummy: String! } + type Subscription { + productDeleted: Product @openfed__cacheInvalidate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + SUBSCRIPTION, + ); + expect(config).toBeDefined(); + expect(config!.cacheInvalidateConfigurations).toStrictEqual([ + { + fieldName: 'productDeleted', + operationType: SUBSCRIPTION, + entityTypeName: 'Product', + }, + ] satisfies CacheInvalidateConfig[]); + }); + + test('25. @openfed__cachePopulate on Subscription returning a non-entity type — should error', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { dummy: String! } + type Subscription { + eventOccurred: Event @openfed__cachePopulate + } + type Event { + id: ID! + message: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(CACHE_POPULATE, 'Subscription.eventOccurred', FIRST_ORDINAL, [ + cachePopulateOnNonEntityReturnTypeErrorMessage('Subscription.eventOccurred', 'Event'), + ]), + ); + }); + }); + + // ═══════════════════════════════════════════════════════════════════════════ + // Cross-directive interactions + // ═══════════════════════════════════════════════════════════════════════════ + + describe('cross-directive interactions', () => { + test('26. @openfed__queryCache + @openfed__entityCache on same field — @openfed__queryCache is on the Query field, @openfed__entityCache on the type', () => { + // This is the normal usage pattern, not actually on the "same field". + // Verify the combined config is correct. + const sg = subgraph(` + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `); + const result = batchNormalize({ subgraphs: [sg], version }) as BatchNormalizationSuccess; + expect(result.success).toBe(true); + const internal = result.internalSubgraphBySubgraphName.get(sg.name)!; + + // Product type should have entityCacheConfig + const productConfig = internal.configurationDataByTypeName.get('Product' as TypeName); + expect(productConfig!.entityCacheConfigurations).toHaveLength(1); + expect(productConfig!.entityCacheConfigurations![0].maxAgeSeconds).toBe(60); + + // Query type should have rootFieldCacheConfig + const queryConfig = internal.configurationDataByTypeName.get(QUERY as TypeName); + expect(queryConfig!.rootFieldCacheConfigurations).toHaveLength(1); + expect(queryConfig!.rootFieldCacheConfigurations![0].maxAgeSeconds).toBe(30); + }); + + test('27. @openfed__entityCache + @openfed__requestScoped on same type — both should be present in config', () => { + // An entity can be both cacheable and have request-scoped fields. + // Two fields share the "session" key so no single-field warning. + const sg = subgraph(` + type Query { + user(id: ID!): User @openfed__queryCache(maxAge: 30) + activeSession: String @openfed__requestScoped(key: "session") + } + type User @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + currentSession: String @openfed__requestScoped(key: "session") + } + `); + const result = batchNormalize({ subgraphs: [sg], version }) as BatchNormalizationSuccess; + expect(result.success).toBe(true); + const internal = result.internalSubgraphBySubgraphName.get(sg.name)!; + const userConfig = internal.configurationDataByTypeName.get('User' as TypeName); + expect(userConfig).toBeDefined(); + // Should have entity cache config + expect(userConfig!.entityCacheConfigurations).toHaveLength(1); + // Should have request-scoped fields + expect(userConfig!.requestScopedFields).toBeDefined(); + expect(userConfig!.requestScopedFields).toHaveLength(1); + expect(userConfig!.requestScopedFields![0].fieldName).toBe('currentSession'); + expect(userConfig!.requestScopedFields![0].l1Key).toBe('subgraph-a.session'); + }); + + test('28. Both @openfed__cachePopulate and @openfed__queryCache on same field — should this be rejected?', () => { + // @openfed__queryCache is only valid on Query fields, @openfed__cachePopulate only on Mutation/Subscription. + // They can't be on the same field since a field can only be on one root type. + // But what if someone puts @openfed__cachePopulate on a Query field? That's caught by rule 17. + // What about @openfed__queryCache on a Mutation field? That's caught by rule 4. + // So this combination is inherently impossible on the same field. + // Let's verify the error for @openfed__queryCache on Mutation with @openfed__cachePopulate: + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { dummy: String! } + type Mutation { + createProduct(name: String!): Product @openfed__queryCache(maxAge: 30) @openfed__cachePopulate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + // Should error about @openfed__queryCache on non-Query field + expect(errors).toHaveLength(1); + }); + }); + + // ═══════════════════════════════════════════════════════════════════════════ + // Auto-mapping traps + // ═══════════════════════════════════════════════════════════════════════════ + + describe('auto-mapping traps', () => { + test('29. Argument named "id" with type [ID!]! (list) on singular return — should NOT auto-map', () => { + // The argument "id" matches the key field name "id", but the argument is a list + // while the return type is singular. For singular returns, a list argument can't + // map to a scalar key field (type mismatch). + const sg = subgraph(` + type Query { + product(id: [ID!]!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `); + const result = batchNormalize({ subgraphs: [sg], version }) as BatchNormalizationSuccess; + expect(result.success).toBe(true); + const internal = result.internalSubgraphBySubgraphName.get(sg.name)!; + const queryConfig = internal.configurationDataByTypeName.get(QUERY as TypeName); + expect(queryConfig).toBeDefined(); + const rfcs = queryConfig!.rootFieldCacheConfigurations!; + expect(rfcs).toHaveLength(1); + // The mapping should be empty because [ID!]! can't map to scalar ID! on singular return + expect(rfcs[0].entityKeyMappings).toHaveLength(0); + }); + + test('30. Argument named "id" with nullable type ID mapping to key field id: ID! — should auto-map', () => { + // Nullability differences should be ignored per the mapping rules. + // Nullable ID arg → non-null ID! key field should still auto-map. + const config = getConfigForType( + subgraph(` + type Query { + product(id: ID): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + const mappings = config!.rootFieldCacheConfigurations![0].entityKeyMappings; + // Should auto-map despite nullability difference + expect(mappings).toHaveLength(1); + expect(mappings[0].fieldMappings).toHaveLength(1); + expect(mappings[0].fieldMappings[0].entityKeyField).toBe('id'); + }); + + test('31. Entity with @key(fields: "type") — "type" is a valid field name, should work', () => { + // "type" is a valid GraphQL field name that happens to be a keyword in some contexts. + // It should not conflict with __typename. + const config = getConfigForType( + subgraph(` + type Query { + product(type: String!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "type") @openfed__entityCache(maxAge: 60) { + type: String! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + const mappings = config!.rootFieldCacheConfigurations![0].entityKeyMappings; + expect(mappings).toHaveLength(1); + expect(mappings[0].fieldMappings[0].entityKeyField).toBe('type'); + }); + + test('32. Argument type mismatch: arg is String!, key field is ID! — should skip auto-mapping with warning', () => { + // Auto-mapping compares named types (unwrapping NonNull). String != ID. + // Expect: auto-mapping is skipped, warning emitted. + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Query { + product(id: String!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + // Should produce a type mismatch warning + expect(warnings).toHaveLength(1); + }); + }); + + // ═══════════════════════════════════════════════════════════════════════════ + // Batch / list edge cases + // ═══════════════════════════════════════════════════════════════════════════ + + describe('batch / list edge cases', () => { + test('33. List return with list argument — should produce isBatch mapping', () => { + // products(ids: [ID!]!): [Product!]! with @openfed__queryCache — batch lookup. + // The argument "ids" doesn't match key field "id" by name, so we need @openfed__is. + const config = getConfigForType( + subgraph(` + type Query { + products(ids: [ID!]! @openfed__is(fields: "id")): [Product!]! @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + const rfcs = config!.rootFieldCacheConfigurations!; + expect(rfcs).toHaveLength(1); + const mappings = rfcs[0].entityKeyMappings; + expect(mappings).toHaveLength(1); + expect(mappings[0].fieldMappings).toHaveLength(1); + expect(mappings[0].fieldMappings[0].isBatch).toBe(true); + }); + + test('34. List return with scalar argument — should not establish batch mapping', () => { + // products(category: String!): [Product!]! with @openfed__queryCache — scalar arg can't batch. + // Auto-mapping won't find "category" in @key(fields: "id"), so no mapping. + const config = getConfigForType( + subgraph(` + type Query { + products(category: String!): [Product!]! @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + const rfcs = config!.rootFieldCacheConfigurations!; + expect(rfcs).toHaveLength(1); + // No mappings since "category" doesn't match any key field + expect(rfcs[0].entityKeyMappings).toHaveLength(0); + }); + + test('35. List return with auto-mapped list argument named "id" — should produce isBatch', () => { + // products(id: [ID!]!): [Product!]! — "id" matches key field "id", list arg, list return. + // Should auto-map with isBatch: true. + const config = getConfigForType( + subgraph(` + type Query { + products(id: [ID!]!): [Product!]! @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + const rfcs = config!.rootFieldCacheConfigurations!; + expect(rfcs).toHaveLength(1); + const mappings = rfcs[0].entityKeyMappings; + expect(mappings).toHaveLength(1); + expect(mappings[0].fieldMappings[0].isBatch).toBe(true); + }); + }); + + // ═══════════════════════════════════════════════════════════════════════════ + // Phase 3 attachment edge cases + // ═══════════════════════════════════════════════════════════════════════════ + + describe('config attachment edge cases', () => { + test('36. @openfed__cachePopulate config goes to correct operation type (Mutation vs Subscription)', () => { + // Verify that @openfed__cachePopulate on Mutation goes to "Mutation" config and + // @openfed__cachePopulate on Subscription goes to "Subscription" config. + // BUG CHECK: The code in Phase 3 uses `cp.operationType` as the key into + // configurationDataByTypeName. The operationTypeString is set to "Mutation" + // or "Subscription" — but when operationType is SUBSCRIPTION, the string is set to + // "Subscription" only if the operationType is not MUTATION. + // Let's check: operationTypeString = operationType === OperationTypeNode.MUTATION ? MUTATION : SUBSCRIPTION + // This means for Query it would be "Subscription" — but Query fields with @openfed__cachePopulate + // are already rejected by rule 17. So this is fine for valid inputs. + + // Test Subscription specifically + const config = getConfigForType( + subgraph(` + type Query { dummy: String! } + type Subscription { + newProduct: Product @openfed__cachePopulate(maxAge: 120) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + SUBSCRIPTION, + ); + expect(config).toBeDefined(); + expect(config!.cachePopulateConfigurations).toHaveLength(1); + expect(config!.cachePopulateConfigurations![0].operationType).toBe(SUBSCRIPTION); + expect(config!.cachePopulateConfigurations![0].maxAgeSeconds).toBe(120); + }); + + test('37. @openfed__cacheInvalidate config uses correct entityTypeName from return type', () => { + // Verify the entityTypeName is correctly set even when the return type is wrapped. + const config = getConfigForType( + subgraph(` + type Query { dummy: String! } + type Mutation { + deleteProduct(id: ID!): Product @openfed__cacheInvalidate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + MUTATION, + ); + expect(config).toBeDefined(); + expect(config!.cacheInvalidateConfigurations).toHaveLength(1); + expect(config!.cacheInvalidateConfigurations![0].entityTypeName).toBe('Product'); + }); + + test('38. Multiple @openfed__queryCache fields on same Query type — all get configs', () => { + // Two different query fields with @openfed__queryCache returning different entities. + const config = getConfigForType( + subgraph(` + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + user(id: ID!): User @openfed__queryCache(maxAge: 45) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + type User @key(fields: "id") @openfed__entityCache(maxAge: 90) { + id: ID! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toHaveLength(2); + const fieldNames = config!.rootFieldCacheConfigurations!.map((r) => r.fieldName).sort(); + expect(fieldNames).toStrictEqual(['product', 'user']); + }); + + test('39. Multiple mutations with different cache directives — all get correct configs', () => { + const sg = subgraph(` + type Query { dummy: String! } + type Mutation { + updateProduct(id: ID!): Product @openfed__cacheInvalidate + createProduct(name: String!): Product @openfed__cachePopulate(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `); + const result = batchNormalize({ subgraphs: [sg], version }) as BatchNormalizationSuccess; + expect(result.success).toBe(true); + const internal = result.internalSubgraphBySubgraphName.get(sg.name)!; + const mutConfig = internal.configurationDataByTypeName.get(MUTATION as TypeName); + expect(mutConfig).toBeDefined(); + expect(mutConfig!.cacheInvalidateConfigurations).toHaveLength(1); + expect(mutConfig!.cacheInvalidateConfigurations![0].fieldName).toBe('updateProduct'); + expect(mutConfig!.cachePopulateConfigurations).toHaveLength(1); + expect(mutConfig!.cachePopulateConfigurations![0].fieldName).toBe('createProduct'); + }); + }); + + // ═══════════════════════════════════════════════════════════════════════════ + // Potential silent corruption scenarios + // ═══════════════════════════════════════════════════════════════════════════ + + describe('potential silent corruption', () => { + test('40. @openfed__entityCache without maxAge argument — should error (maxAge is required)', () => { + // If the directive definition makes maxAge required, parsing should fail. + // But if it somehow gets through, the code defaults maxAgeSeconds to 0 which would + // be caught by the <= 0 check. + const sg = subgraph(` + type Query { product(id: ID!): Product } + type Product @key(fields: "id") @openfed__entityCache { + id: ID! + name: String! + } + `); + const result = batchNormalize({ subgraphs: [sg], version }); + // Should fail because maxAge is required + expect(result.success).toBe(false); + }); + + test('41. @openfed__queryCache maxAge as float (3.5) — should be parsed as 0 and error', () => { + // maxAge is Int!, a float value should either fail parsing or be treated as 0. + const sg = subgraph(` + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 3.5) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `); + const result = batchNormalize({ subgraphs: [sg], version }); + // A float value for an Int! field should fail at some point + expect(result.success).toBe(false); + }); + + test('42. @openfed__is on argument of non-Query field without @openfed__queryCache — error about @openfed__is without @openfed__queryCache', () => { + // @openfed__is without @openfed__queryCache on a Mutation argument — should still error about @openfed__is placement. + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { dummy: String! } + type Mutation { + updateProduct(pid: ID! @openfed__is(fields: "id")): Product @openfed__cacheInvalidate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + // Should have error about @openfed__is without @openfed__queryCache + expect(errors).toHaveLength(1); + }); + + test('43. @openfed__queryCache on field returning entity with @key but entity has NO fields matching any argument — empty mappings, no warning', () => { + // product(name: String!): Product — "name" is not a key field. + // Should succeed with empty mappings and no warning (this is already tested, just double-checking). + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Query { + product(name: String!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(warnings).toHaveLength(0); + }); + + test('44. @openfed__queryCache with very large maxAge but @openfed__entityCache with very small maxAge — no error about TTL mismatch', () => { + // The query cache TTL (3600) is much larger than the entity cache TTL (1). + // This means cached query results would reference entities that expired long ago. + // No validation exists for this — it's a logical error but not caught. + const config = getConfigForType( + subgraph(` + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 3600) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 1) { + id: ID! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + // Succeeds without warning — the router would serve stale query cache entries + // that reference long-expired entity cache entries. This is a potential foot-gun + // but not necessarily a bug — just worth noting. + expect(config!.rootFieldCacheConfigurations![0].maxAgeSeconds).toBe(3600); + }); + + test('45. @openfed__queryCache on field returning entity that exists only in another subgraph', () => { + // The entity type Product is defined in subgraph-b but not in subgraph-a. + // However, subgraph-a references it as a return type and adds @openfed__queryCache. + // Expectation updated (bug a fix): without @openfed__entityCache on Product, the + // queryCache config is NOT extracted — we warn the subgraph author that they need + // to either add @openfed__entityCache or remove @openfed__queryCache. + const sg = subgraph(` + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") { + id: ID! + } + `); + const config = getConfigForType(sg, QUERY); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toBeUndefined(); + }); + }); +}); diff --git a/composition/tests/v1/directives/entity-cache-mapping-rules.test.ts b/composition/tests/v1/directives/entity-cache-mapping-rules.test.ts new file mode 100644 index 0000000000..c9695dc570 --- /dev/null +++ b/composition/tests/v1/directives/entity-cache-mapping-rules.test.ts @@ -0,0 +1,2903 @@ +import { describe, expect, test } from 'vitest'; +import { + type BatchNormalizationSuccess, + FIRST_ORDINAL, + invalidDirectiveError, + IS, + parse, + QUERY, + QUERY_CACHE, + RootFieldCacheConfig, + ROUTER_COMPATIBILITY_VERSION_ONE, + type Subgraph, + type TypeName, +} from '../../../src'; +import { batchNormalize } from '../../../src/v1/normalization/normalization-factory'; +import { + duplicateKeyFieldMappingErrorMessage, + invalidRepeatedDirectiveErrorMessage, + isReferencesUnknownKeyFieldErrorMessage, + queryCacheOnNonEntityReturnTypeErrorMessage, + queryCacheOnNonQueryFieldErrorMessage, +} from '../../../src/errors/errors'; +import { + incompleteQueryCacheKeyMappingWarning, + queryCacheReturnEntityMissingEntityCacheWarning, + redundantIsDirectiveWarning, +} from '../../../src/v1/warnings/warnings'; +import { normalizeSubgraphFailure, normalizeSubgraphSuccess } from '../../utils/utils'; + +const version = ROUTER_COMPATIBILITY_VERSION_ONE; + +function subgraph(sdl: string, name = 'subgraph-a'): Subgraph { + return { name, url: '', definitions: parse(sdl) }; +} + +function getConfigForType(sg: Subgraph, typeName: string) { + const result = batchNormalize({ subgraphs: [sg], version }) as BatchNormalizationSuccess; + expect(result.success).toBe(true); + const internal = result.internalSubgraphBySubgraphName.get(sg.name); + expect(internal).toBeDefined(); + return internal!.configurationDataByTypeName.get(typeName as TypeName); +} + +function getSingleQueryRootFieldConfig(sdl: string, fieldName: string) { + const config = getConfigForType(subgraph(sdl), QUERY); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toHaveLength(1); + expect(config!.rootFieldCacheConfigurations![0].fieldName).toBe(fieldName); + return config!.rootFieldCacheConfigurations![0]; +} + +function autoMappingTypeMismatchWarningMessage( + argumentName: string, + fieldCoords: string, + argumentType: string, + keyField: string, + entityType: string, + keyFieldType: string, +) { + return `Argument "${argumentName}" on field "${fieldCoords}" has type "${argumentType}" but @key field "${keyField}" on entity "${entityType}" has type "${keyFieldType}". Auto-mapping skipped due to type mismatch.`; +} + +function explicitTypeMismatchErrorMessage( + argumentName: string, + fieldCoords: string, + argumentType: string, + isField: string, + entityType: string, + keyFieldType: string, +) { + return `Argument "${argumentName}" on field "${fieldCoords}" has type "${argumentType}" but @openfed__is(fields: "${isField}") targets @key field "${isField}" of type "${keyFieldType}" on entity "${entityType}".`; +} + +function unknownKeyFieldSpecErrorMessage( + argumentName: string, + fieldCoords: string, + isField: string, + entityType: string, +) { + return `Argument "${argumentName}" on field "${fieldCoords}" uses @openfed__is(fields: "${isField}") but "${isField}" is not a field in any @key on entity "${entityType}".`; +} + +function nonKeyFieldSpecErrorMessage(argumentName: string, fieldCoords: string, isField: string, entityType: string) { + return `Argument "${argumentName}" on field "${fieldCoords}" uses @openfed__is(fields: "${isField}"), but "${isField}" is not a @key field on entity "${entityType}". @openfed__is can only target fields that are part of a @key.`; +} + +function listArgumentToScalarKeySpecErrorMessage( + argumentName: string, + fieldCoords: string, + argumentType: string, + isField: string, + entityType: string, + keyFieldType: string, +) { + return ( + `Argument "${argumentName}" on field "${fieldCoords}" has type "${argumentType}" but @openfed__is(fields: "${isField}") targets @key field "${isField}" of type "${keyFieldType}" on entity "${entityType}".` + + ' List arguments can only map to scalar key fields when the field returns a list of entities, or to list key fields when the key field itself is a list type.' + ); +} + +function scalarArgumentToListKeySpecErrorMessage( + argumentName: string, + fieldCoords: string, + argumentType: string, + isField: string, + entityType: string, + keyFieldType: string, +) { + return ( + `Argument "${argumentName}" on field "${fieldCoords}" has type "${argumentType}" but @openfed__is(fields: "${isField}") targets @key field "${isField}" of type "${keyFieldType}" on entity "${entityType}".` + + ' A scalar argument cannot map to a list key field.' + ); +} + +function implicitIncompleteCompositeKeyWarningMessage( + argumentName: string, + fieldCoords: string, + keyField: string, + entityType: string, + compositeKey: string, + missingField: string, +) { + return `Argument "${argumentName}" on field "${fieldCoords}" matches @key field "${keyField}" on entity "${entityType}", but composite @key "${compositeKey}" is incomplete because no argument maps to required key field "${missingField}". Auto-mapping skipped — all fields of a composite key must be mapped.`; +} + +function explicitIncompleteCompositeKeyErrorMessage( + fieldCoords: string, + argumentName: string, + mappedField: string, + entityType: string, + compositeKey: string, + missingField: string, +) { + return `Field "${fieldCoords}" has argument "${argumentName}" with @openfed__is mapping to @key field "${mappedField}" on entity "${entityType}", but composite @key "${compositeKey}" is incomplete because no argument maps to required key field "${missingField}".`; +} + +function autoMappingAdditionalNonKeyArgumentWarningMessage( + argumentName: string, + fieldCoords: string, + keyField: string, + entityType: string, + extraArgument: string, +) { + return `Argument "${argumentName}" on field "${fieldCoords}" matches @key field "${keyField}" on entity "${entityType}", but field has additional argument "${extraArgument}" which is not mapped to a key field. Auto-mapping skipped — all arguments must be key arguments because additional arguments may filter the response, making the cache key incomplete.`; +} + +function explicitSingularAdditionalNonKeyArgumentErrorMessage( + fieldCoords: string, + argumentName: string, + keyField: string, + entityType: string, + extraArgument: string, +) { + return `Field "${fieldCoords}" has argument "${argumentName}" with @openfed__is mapping to @key field "${keyField}" on entity "${entityType}", but also has additional argument "${extraArgument}" which is not mapped to a key field. All arguments must be key arguments — additional arguments may filter the response, making the cache key incomplete.`; +} + +function explicitCompositeAdditionalNonKeyArgumentErrorMessage( + fieldCoords: string, + firstArgument: string, + secondArgument: string, + compositeKey: string, + entityType: string, + extraArgument: string, +) { + return `Field "${fieldCoords}" has arguments "${firstArgument}" and "${secondArgument}" with @openfed__is mappings covering composite @key "${compositeKey}" on entity "${entityType}", but also has additional argument "${extraArgument}" which is not mapped to a key field. All arguments must be key arguments — additional arguments may filter the response, making the cache key incomplete.`; +} + +function batchListValuedKeyRequiresNestedListsErrorMessage( + fieldCoords: string, + isField: string, + entityType: string, + actualType: string, +) { + return `Field "${fieldCoords}" returns a list of entities, so cache lookup is a batch lookup and requires one key value per entity. Because @openfed__is(fields: "${isField}") targets list-valued @key field "${isField}" on entity "${entityType}", the argument must provide a list of tag lists (e.g., "[[String!]!]!"), not ${actualType}.`; +} + +function explicitBatchAdditionalNonKeyArgumentErrorMessage( + fieldCoords: string, + argumentName: string, + keyField: string, + entityType: string, + extraArgument: string, +) { + return `Field "${fieldCoords}" returns a list of entities, so cache lookup is a batch lookup and requires a single key input that determines the returned entities. Argument "${argumentName}" uses @openfed__is to map to @key field "${keyField}" on entity "${entityType}", but additional argument "${extraArgument}" is not mapped to a key field and may filter the response, so the batch key would be incomplete.`; +} + +function autoBatchAdditionalNonKeyArgumentWarningMessage( + fieldCoords: string, + argumentName: string, + keyField: string, + entityType: string, + extraArgument: string, +) { + return `Field "${fieldCoords}" returns a list of entities, so cache lookup is a batch lookup and requires a single key input that determines the returned entities. Argument "${argumentName}" matches @key field "${keyField}" on entity "${entityType}", but additional argument "${extraArgument}" is not mapped to a key field and may filter the response, so auto-mapping is skipped because the batch key would be incomplete.`; +} + +function explicitScalarArgumentsCannotEstablishBatchMappingErrorMessage(fieldCoords: string, entityType: string) { + return `Field "${fieldCoords}" returns a list of entities, so cache lookup is a batch lookup and requires one key value per entity. Scalar arguments with @openfed__is mapping to @key fields on entity "${entityType}" cannot provide a batch of keys, so they cannot establish cache key mappings for this field. Use list arguments for batch cache lookups.`; +} + +function multipleListArgumentsBatchFactoryMessage(fieldCoords: string, entityType: string) { + return ( + `Field "${fieldCoords}" has multiple list arguments mapping to @key fields on entity "${entityType}".` + + ' Batch cache lookups require a single list argument.' + + ' For composite keys, use a single list of input objects instead.' + ); +} + +function inputObjectCompositeTypeMismatchErrorMessage( + argumentName: string, + fieldCoords: string, + keyFields: string, + entityType: string, + inputType: string, + inputFieldName: string, + inputFieldType: string, + entityFieldPath: string, + entityFieldType: string, +) { + return ( + `Argument "${argumentName}" on field "${fieldCoords}" uses @openfed__is(fields: "${keyFields}") mapping to composite @key on entity "${entityType}",` + + ` but input type "${inputType}" field "${inputFieldName}" has type "${inputFieldType}"` + + ` which does not match key field "${entityFieldPath}" of type "${entityFieldType}".` + ); +} + +function inputObjectCompositeMissingFieldErrorMessage( + argumentName: string, + fieldCoords: string, + keyFields: string, + entityType: string, + inputType: string, + missingFieldName: string, +) { + return ( + `Argument "${argumentName}" on field "${fieldCoords}" uses @openfed__is(fields: "${keyFields}") mapping to composite @key on entity "${entityType}",` + + ` but input type "${inputType}" is missing required key field "${missingFieldName}".` + ); +} + +function nestedInputObjectTypeMismatchErrorMessage( + argumentName: string, + fieldCoords: string, + keyFields: string, + entityType: string, + inputType: string, + inputFieldName: string, + inputFieldType: string, + entityFieldPath: string, + entityFieldType: string, +) { + return ( + `Argument "${argumentName}" on field "${fieldCoords}" maps to nested @key "${keyFields}" on entity "${entityType}",` + + ` but input type "${inputType}" field "${inputFieldName}" has type "${inputFieldType}"` + + ` which does not match key field "${entityFieldPath}" of type "${entityFieldType}".` + ); +} + +function nestedInputObjectMissingFieldErrorMessage( + argumentName: string, + fieldCoords: string, + keyFields: string, + entityType: string, + inputType: string, + missingFieldName: string, +) { + return ( + `Argument "${argumentName}" on field "${fieldCoords}" maps to nested @key "${keyFields}" on entity "${entityType}",` + + ` but input type "${inputType}" is missing required key field "${missingFieldName}".` + ); +} + +function nonInputArgumentCannotTargetCompositeKeyErrorMessage( + argumentName: string, + fieldCoords: string, + keyFields: string, + entityType: string, + argumentType: string, +) { + return ( + `Argument "${argumentName}" on field "${fieldCoords}" uses @openfed__is(fields: "${keyFields}") targeting composite @key on entity "${entityType}",` + + ` but argument type "${argumentType}" does not provide nested fields for each key field.` + + ' Use separate arguments or an input object that matches the composite key shape.' + ); +} + +describe('Entity cache mapping rules tests', () => { + describe('message factory coverage', () => { + test('shared mapping-rule message factories produce the documented text', () => { + expect(queryCacheOnNonEntityReturnTypeErrorMessage('Query.product', 'Result')).toBe( + 'Field "Query.product" has @openfed__queryCache but returns non-entity type "Result". @openfed__queryCache requires the return type to be an entity with @key.', + ); + expect(queryCacheOnNonQueryFieldErrorMessage('Mutation.updateProduct')).toBe( + '@openfed__queryCache must only be defined on fields of the root query type; found on "Mutation.updateProduct".' + + ' Use @openfed__cachePopulate or @openfed__cacheInvalidate on mutation or subscription fields.', + ); + expect(invalidRepeatedDirectiveErrorMessage(QUERY_CACHE)).toBe( + 'The definition for the directive "@openfed__queryCache" does not define it as repeatable, but it is declared more than once on these coordinates.', + ); + expect(isReferencesUnknownKeyFieldErrorMessage('unknown', 'pid', 'Query.product', 'Product')).toBe( + '@openfed__is(fields: "unknown") on argument "pid" of field "Query.product" references unknown @key field "unknown" on type "Product".', + ); + expect(duplicateKeyFieldMappingErrorMessage('Query.product', 'id')).toBe( + 'Multiple arguments on field "Query.product" map to @key field "id".', + ); + expect(multipleListArgumentsBatchFactoryMessage('Query.products', 'Product')).toBe( + 'Field "Query.products" has multiple list arguments mapping to @key fields on entity "Product". Batch cache lookups require a single list argument. For composite keys, use a single list of input objects instead.', + ); + expect(autoMappingTypeMismatchWarningMessage('id', 'Query.product', 'String!', 'id', 'Product', 'ID!')).toBe( + 'Argument "id" on field "Query.product" has type "String!" but @key field "id" on entity "Product" has type "ID!". Auto-mapping skipped due to type mismatch.', + ); + expect(explicitTypeMismatchErrorMessage('pid', 'Query.product', 'String!', 'id', 'Product', 'ID!')).toBe( + 'Argument "pid" on field "Query.product" has type "String!" but @openfed__is(fields: "id") targets @key field "id" of type "ID!" on entity "Product".', + ); + expect(unknownKeyFieldSpecErrorMessage('pid', 'Query.product', 'unknown', 'Product')).toBe( + 'Argument "pid" on field "Query.product" uses @openfed__is(fields: "unknown") but "unknown" is not a field in any @key on entity "Product".', + ); + expect(nonKeyFieldSpecErrorMessage('pname', 'Query.product', 'name', 'Product')).toBe( + 'Argument "pname" on field "Query.product" uses @openfed__is(fields: "name"), but "name" is not a @key field on entity "Product". @openfed__is can only target fields that are part of a @key.', + ); + expect( + implicitIncompleteCompositeKeyWarningMessage('id', 'Query.product', 'id', 'Product', 'id region', 'region'), + ).toBe( + 'Argument "id" on field "Query.product" matches @key field "id" on entity "Product", but composite @key "id region" is incomplete because no argument maps to required key field "region". Auto-mapping skipped — all fields of a composite key must be mapped.', + ); + expect( + explicitBatchAdditionalNonKeyArgumentErrorMessage('Query.products', 'ids', 'id', 'Product', 'category'), + ).toBe( + 'Field "Query.products" returns a list of entities, so cache lookup is a batch lookup and requires a single key input that determines the returned entities. Argument "ids" uses @openfed__is to map to @key field "id" on entity "Product", but additional argument "category" is not mapped to a key field and may filter the response, so the batch key would be incomplete.', + ); + expect( + incompleteQueryCacheKeyMappingWarning({ + subgraphName: 'subgraph-a', + fieldCoords: 'Query.product', + entityType: 'Product', + unmappedKeyField: 'region', + }).message, + ).toBe( + 'Field "Query.product" has @openfed__queryCache returning "Product" but @key field "region" cannot be mapped to any argument. Cache reads are disabled for this field (cache writes/population still work). Add an argument named "region" or use @openfed__is(fields: "region") to enable cache reads.', + ); + }); + }); + + describe('prerequisite rules', () => { + test('rule 0a: error when @openfed__queryCache is declared on a field that returns a non-entity type', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Result { + success: Boolean! + } + + type Query { + product(id: ID!): Result @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(QUERY_CACHE, 'Query.product', FIRST_ORDINAL, [ + queryCacheOnNonEntityReturnTypeErrorMessage('Query.product', 'Result'), + ]), + ); + }); + + // Expectation updated to new correct behavior: @openfed__queryCache on a field returning + // a @key entity without @openfed__entityCache emits a warning and does NOT extract any + // queryCache config — there is no entity-cache backing store to point at. + test('rule 0b: @openfed__queryCache on a @key entity without @openfed__entityCache warns and extracts no config', () => { + const sdl = ` + type Product @key(fields: "id") { + id: ID! + name: String! + } + + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + `; + + const { warnings } = normalizeSubgraphSuccess(subgraph(sdl), version); + expect(warnings).toHaveLength(1); + expect(warnings[0]).toStrictEqual( + queryCacheReturnEntityMissingEntityCacheWarning({ + subgraphName: 'subgraph-a', + fieldCoords: 'Query.product', + entityType: 'Product', + }), + ); + + const config = getConfigForType(subgraph(sdl), QUERY); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toBeUndefined(); + }); + + test('rule 0b-positive: @openfed__queryCache on a @key entity WITH @openfed__entityCache extracts the config and emits no warning', () => { + const sdl = ` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + `; + + const { warnings } = normalizeSubgraphSuccess(subgraph(sdl), version); + expect(warnings).toHaveLength(0); + + const rootFieldConfig = getSingleQueryRootFieldConfig(sdl, 'product'); + expect(rootFieldConfig).toStrictEqual({ + fieldName: 'product', + maxAgeSeconds: 30, + includeHeaders: false, + shadowMode: false, + entityTypeName: 'Product', + entityKeyMappings: [ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['id'] }], + }, + ], + } satisfies RootFieldCacheConfig); + }); + + test('rule 0c: error when @openfed__queryCache is declared on a non-Query root field', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Mutation { + updateProduct(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(QUERY_CACHE, 'Mutation.updateProduct', FIRST_ORDINAL, [ + queryCacheOnNonQueryFieldErrorMessage('Mutation.updateProduct'), + ]), + ); + }); + + test('rule 0d: error when @openfed__queryCache is declared more than once on the same Query field', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + } + + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(QUERY_CACHE, 'Query.product', FIRST_ORDINAL, [ + invalidRepeatedDirectiveErrorMessage(QUERY_CACHE), + ]), + ); + }); + }); + + describe('singular return: auto-mapping', () => { + test('rule 1: exact scalar type match emits a single entity key mapping', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['id'] }], + }, + ]); + }); + + test('rule 2: String argument for an ID key field is skipped with an auto-mapping warning', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(id: String!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(1); + expect(warnings[0].subgraph.name).toBe('subgraph-a'); + expect(warnings[0].message).toBe( + autoMappingTypeMismatchWarningMessage('id', 'Query.product', 'String!', 'id', 'Product', 'ID!'), + ); + }); + + test('rule 3: Int argument for an ID key field is skipped with an auto-mapping warning', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(id: Int!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + autoMappingTypeMismatchWarningMessage('id', 'Query.product', 'Int!', 'id', 'Product', 'ID!'), + ); + }); + + test('rule 4: Int argument for a String key field is skipped with an auto-mapping warning', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Product @key(fields: "sku") @openfed__entityCache(maxAge: 60) { + sku: String! + name: String! + } + + type Query { + product(sku: Int!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + autoMappingTypeMismatchWarningMessage('sku', 'Query.product', 'Int!', 'sku', 'Product', 'String!'), + ); + }); + + test('rule 5: exact enum type match emits a composite key mapping', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + enum Region { + US + EU + APAC + } + + type Product @key(fields: "id region") @openfed__entityCache(maxAge: 60) { + id: ID! + region: Region! + name: String! + } + + type Query { + product(id: ID!, region: Region!): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [ + { entityKeyField: 'id', argumentPath: ['id'] }, + { entityKeyField: 'region', argumentPath: ['region'] }, + ], + }, + ]); + }); + + test('rule 6: enum auto-mapping is skipped when the argument enum differs from the key enum', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + enum Region { + US + EU + } + + enum Zone { + NORTH + SOUTH + } + + type Product @key(fields: "region") @openfed__entityCache(maxAge: 60) { + region: Region! + name: String! + } + + type Query { + product(region: Zone!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + autoMappingTypeMismatchWarningMessage('region', 'Query.product', 'Zone!', 'region', 'Product', 'Region!'), + ); + }); + + test('rule 7: enum-vs-scalar auto-mapping mismatch is skipped with a warning', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + enum Status { + ACTIVE + INACTIVE + } + + type Product @key(fields: "status") @openfed__entityCache(maxAge: 60) { + status: Status! + name: String! + } + + type Query { + product(status: String!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + autoMappingTypeMismatchWarningMessage('status', 'Query.product', 'String!', 'status', 'Product', 'Status!'), + ); + }); + + test('rule 8: exact custom scalar match emits a single entity key mapping', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + scalar UUID + + type Product @key(fields: "uid") @openfed__entityCache(maxAge: 60) { + uid: UUID! + name: String! + } + + type Query { + product(uid: UUID!): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'uid', argumentPath: ['uid'] }], + }, + ]); + }); + + test('rule 9: custom scalar auto-mapping is skipped when the argument scalar differs from the key scalar', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + scalar UUID + scalar GUID + + type Product @key(fields: "uid") @openfed__entityCache(maxAge: 60) { + uid: UUID! + name: String! + } + + type Query { + product(uid: GUID!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + autoMappingTypeMismatchWarningMessage('uid', 'Query.product', 'GUID!', 'uid', 'Product', 'UUID!'), + ); + }); + + test('rule 10: custom-scalar-vs-built-in-scalar auto-mapping mismatch is skipped with a warning', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + scalar UUID + + type Product @key(fields: "uid") @openfed__entityCache(maxAge: 60) { + uid: UUID! + name: String! + } + + type Query { + product(uid: String!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + autoMappingTypeMismatchWarningMessage('uid', 'Query.product', 'String!', 'uid', 'Product', 'UUID!'), + ); + }); + + test('rule 11: a nullable argument can map to a non-null key field when the named type matches', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(id: ID): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['id'] }], + }, + ]); + }); + + test('rule 12: a non-null argument can map to a nullable key field when the named type matches', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "sku") @openfed__entityCache(maxAge: 60) { + sku: String + name: String! + } + + type Query { + product(sku: String!): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'sku', argumentPath: ['sku'] }], + }, + ]); + }); + + test('rule 13: a list argument cannot auto-map to a scalar key field on a singular return', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(id: [ID!]!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + autoMappingTypeMismatchWarningMessage('id', 'Query.product', '[ID!]!', 'id', 'Product', 'ID!'), + ); + }); + + test('rule 13b: a list argument can auto-map to a list-valued key field on a singular return', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "tags") @openfed__entityCache(maxAge: 60) { + tags: [String!]! + name: String! + } + + type Query { + product(tags: [String!]!): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'tags', argumentPath: ['tags'] }], + }, + ]); + }); + + test('rule 25: a Boolean key field can be auto-mapped when the argument type is also Boolean', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Feature @key(fields: "name enabled") @openfed__entityCache(maxAge: 60) { + name: String! + enabled: Boolean! + } + + type Query { + feature(name: String!, enabled: Boolean!): Feature @openfed__queryCache(maxAge: 30) + } + `, + 'feature', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Feature', + fieldMappings: [ + { entityKeyField: 'enabled', argumentPath: ['enabled'] }, + { entityKeyField: 'name', argumentPath: ['name'] }, + ], + }, + ]); + }); + + test('rule 26: Float-vs-Int auto-mapping mismatch is skipped with a warning', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Product @key(fields: "weight") @openfed__entityCache(maxAge: 60) { + weight: Float! + name: String! + } + + type Query { + product(weight: Int!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + autoMappingTypeMismatchWarningMessage('weight', 'Query.product', 'Int!', 'weight', 'Product', 'Float!'), + ); + }); + + test('rule 27: if no key is satisfiable, composition emits no mappings and no warning', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(name: String!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(0); + + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(name: String!): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([]); + }); + }); + + describe('singular return: explicit @openfed__is(fields: ...)', () => { + test('rule 14: explicit @openfed__is(fields: "id") maps a differently named argument to a scalar key field', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(pid: ID! @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['pid'] }], + }, + ]); + }); + + test('rule 15: explicit @openfed__is(fields: "id") rejects a type mismatch instead of silently skipping it', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(pid: String! @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(pid: ...)', FIRST_ORDINAL, [ + explicitTypeMismatchErrorMessage('pid', 'Query.product', 'String!', 'id', 'Product', 'ID!'), + ]), + ); + }); + + test('rule 15a: explicit @openfed__is(fields: "unknown") errors when the target is not present in any @key', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(pid: ID! @openfed__is(fields: "unknown")): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(pid: ...)', FIRST_ORDINAL, [ + isReferencesUnknownKeyFieldErrorMessage('unknown', 'pid', 'Query.product', 'Product'), + ]), + ); + }); + + test('rule 15a-i: explicit @openfed__is(fields: "name") errors when the target exists on the entity but is not part of any @key', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(pname: String! @openfed__is(fields: "name")): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(pname: ...)', FIRST_ORDINAL, [ + nonKeyFieldSpecErrorMessage('pname', 'Query.product', 'name', 'Product'), + ]), + ); + }); + + test('rule 15a-ii: explicit @openfed__is cannot map two arguments to the same key field', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(pid: ID! @openfed__is(fields: "id"), altId: ID! @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(altId: ...)', FIRST_ORDINAL, [ + duplicateKeyFieldMappingErrorMessage('Query.product', 'id'), + ]), + ); + }); + + test('rule 15b: explicit @openfed__is accepts a nullable argument for a non-null key field when the named type matches', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(pid: ID @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['pid'] }], + }, + ]); + }); + + test('rule 15c: explicit list argument cannot target a scalar key field on a singular return', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(pids: [ID!]! @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(pids: ...)', FIRST_ORDINAL, [ + listArgumentToScalarKeySpecErrorMessage('pids', 'Query.product', '[ID!]!', 'id', 'Product', 'ID!'), + ]), + ); + }); + + test('rule 15d: explicit list argument can target a list-valued key field on a singular return', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "tags") @openfed__entityCache(maxAge: 60) { + tags: [String!]! + name: String! + } + + type Query { + product(tags: [String!]! @openfed__is(fields: "tags")): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'tags', argumentPath: ['tags'] }], + }, + ]); + }); + + test('rule 15e: explicit list argument rejects a list-valued key field when the element types differ', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "tags") @openfed__entityCache(maxAge: 60) { + tags: [String!]! + name: String! + } + + type Query { + product(tags: [Int!]! @openfed__is(fields: "tags")): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(tags: ...)', FIRST_ORDINAL, [ + explicitTypeMismatchErrorMessage('tags', 'Query.product', '[Int!]!', 'tags', 'Product', '[String!]!'), + ]), + ); + }); + + // Expectation updated (bug b fix): redundant @openfed__is(fields: "id") on argument "id" + // now emits a warning — auto-mapping produces the same result, so the directive is noise. + test('rule 28: redundant @openfed__is(fields: "id") on matching argument name emits a redundancy warning', () => { + const sdl = ` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(id: ID! @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 30) + } + `; + + const { warnings } = normalizeSubgraphSuccess(subgraph(sdl), version); + + expect(warnings).toHaveLength(1); + expect(warnings[0]).toStrictEqual( + redundantIsDirectiveWarning({ + subgraphName: 'subgraph-a', + argumentName: 'id', + fieldCoords: 'Query.product', + keyField: 'id', + entityType: 'Product', + }), + ); + + const rootFieldConfig = getSingleQueryRootFieldConfig(sdl, 'product'); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['id'] }], + }, + ]); + }); + + test('rule 15f: explicit scalar argument cannot target a list-valued key field on a singular return', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "tags") @openfed__entityCache(maxAge: 60) { + tags: [String!]! + name: String! + } + + type Query { + product(tag: String! @openfed__is(fields: "tags")): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(tag: ...)', FIRST_ORDINAL, [ + scalarArgumentToListKeySpecErrorMessage('tag', 'Query.product', 'String!', 'tags', 'Product', '[String!]!'), + ]), + ); + }); + }); + + describe('nested, composite, alternative, and unresolvable keys', () => { + test('rule 16: a nested key leaf can be targeted with explicit @openfed__is(fields: "store.id")', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Store { + id: ID! + } + + type Product @key(fields: "store { id }") @openfed__entityCache(maxAge: 60) { + store: Store! + name: String! + } + + type Query { + product(storeId: ID! @openfed__is(fields: "store.id")): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'store.id', argumentPath: ['storeId'] }], + }, + ]); + }); + + test('rule 17: explicit nested @openfed__is mapping rejects a type mismatch against the nested leaf field', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Store { + id: ID! + } + + type Product @key(fields: "store { id }") @openfed__entityCache(maxAge: 60) { + store: Store! + name: String! + } + + type Query { + product(storeId: Int! @openfed__is(fields: "store.id")): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(storeId: ...)', FIRST_ORDINAL, [ + explicitTypeMismatchErrorMessage('storeId', 'Query.product', 'Int!', 'store.id', 'Product', 'ID!'), + ]), + ); + }); + + test('rule 18: a composite key emits a mapping when all fields are matched with correct types', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id region") @openfed__entityCache(maxAge: 60) { + id: ID! + region: String! + name: String! + } + + type Query { + product(id: ID!, region: String!): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [ + { entityKeyField: 'id', argumentPath: ['id'] }, + { entityKeyField: 'region', argumentPath: ['region'] }, + ], + }, + ]); + }); + + test('rule 19: if one composite-key argument has an auto-mapping type mismatch, the key becomes unsatisfiable', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Product @key(fields: "id region") @openfed__entityCache(maxAge: 60) { + id: ID! + region: String! + name: String! + } + + type Query { + product(id: Int!, region: String!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + autoMappingTypeMismatchWarningMessage('id', 'Query.product', 'Int!', 'id', 'Product', 'ID!'), + ); + }); + + test('rule 19b: implicit composite-key mapping is skipped when one required key field is missing', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Product @key(fields: "id region") @openfed__entityCache(maxAge: 60) { + id: ID! + region: String! + name: String! + } + + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(1); + expect(warnings[0]).toStrictEqual( + incompleteQueryCacheKeyMappingWarning({ + subgraphName: 'subgraph-a', + fieldCoords: 'Query.product', + entityType: 'Product', + unmappedKeyField: 'region', + }), + ); + + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id region") @openfed__entityCache(maxAge: 60) { + id: ID! + region: String! + name: String! + } + + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([]); + }); + + test('rule 19c: explicit partial composite-key mapping fails when one required key field is still missing', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id region") @openfed__entityCache(maxAge: 60) { + id: ID! + region: String! + name: String! + } + + type Query { + product(pid: ID! @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(pid: ...)', FIRST_ORDINAL, [ + explicitIncompleteCompositeKeyErrorMessage('Query.product', 'pid', 'id', 'Product', 'id region', 'region'), + ]), + ); + }); + + test('rule 19d: explicit mappings can satisfy all fields of a composite key', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id region") @openfed__entityCache(maxAge: 60) { + id: ID! + region: String! + name: String! + } + + type Query { + product(pid: ID! @openfed__is(fields: "id"), area: String! @openfed__is(fields: "region")): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [ + { entityKeyField: 'id', argumentPath: ['pid'] }, + { entityKeyField: 'region', argumentPath: ['area'] }, + ], + }, + ]); + }); + + test('rule 19e: explicit composite-key mappings reject a type mismatch on any mapped field', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id region") @openfed__entityCache(maxAge: 60) { + id: ID! + region: String! + name: String! + } + + type Query { + product(pid: Int! @openfed__is(fields: "id"), area: String! @openfed__is(fields: "region")): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(pid: ...)', FIRST_ORDINAL, [ + explicitTypeMismatchErrorMessage('pid', 'Query.product', 'Int!', 'id', 'Product', 'ID!'), + ]), + ); + }); + + test('rule 19f: multiple keys are evaluated independently and all satisfiable keys are emitted', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id region") @key(fields: "sku") @openfed__entityCache(maxAge: 60) { + id: ID! + region: String! + sku: String! + name: String! + } + + type Query { + product(id: ID!, region: String!, sku: String!): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [ + { entityKeyField: 'id', argumentPath: ['id'] }, + { entityKeyField: 'region', argumentPath: ['region'] }, + ], + }, + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'sku', argumentPath: ['sku'] }], + }, + ]); + }); + + test('rule 19g: implicit composite-key mapping is skipped when the field also has an extra non-key argument', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Product @key(fields: "id region") @openfed__entityCache(maxAge: 60) { + id: ID! + region: String! + name: String! + } + + type Query { + product(id: ID!, region: String!, category: String!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + autoMappingAdditionalNonKeyArgumentWarningMessage('id', 'Query.product', 'id', 'Product', 'category'), + ); + }); + + test('rule 19g-i: explicit composite-key mappings cannot coexist with an extra non-key argument on a singular return', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id region") @openfed__entityCache(maxAge: 60) { + id: ID! + region: String! + name: String! + } + + type Query { + product( + pid: ID! @openfed__is(fields: "id") + area: String! @openfed__is(fields: "region") + category: String! + ): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(pid: ...)', FIRST_ORDINAL, [ + explicitCompositeAdditionalNonKeyArgumentErrorMessage( + 'Query.product', + 'pid', + 'area', + 'id region', + 'Product', + 'category', + ), + ]), + ); + }); + + test('rule 20: if one alternative key is satisfiable, it is emitted without warning', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Product @key(fields: "id") @key(fields: "sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + + type Query { + product(sku: String!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(0); + + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id") @key(fields: "sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + + type Query { + product(sku: String!): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'sku', argumentPath: ['sku'] }], + }, + ]); + }); + + // Expectation updated to new correct behavior: a failed auto-map candidate on one @key + // must not abort evaluation of the remaining @key alternatives. The "sku" key still maps. + test('rule 21: an auto-mapping type mismatch on one @key does NOT block alternative-key mappings', () => { + const sdl = ` + type Product @key(fields: "id") @key(fields: "sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + + type Query { + product(id: String!, sku: String!): Product @openfed__queryCache(maxAge: 30) + } + `; + + const { warnings } = normalizeSubgraphSuccess(subgraph(sdl), version); + + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + autoMappingTypeMismatchWarningMessage('id', 'Query.product', 'String!', 'id', 'Product', 'ID!'), + ); + + const rootFieldConfig = getSingleQueryRootFieldConfig(sdl, 'product'); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'sku', argumentPath: ['sku'] }], + }, + ]); + }); + + test('rule 22: flat and nested fields can be combined in one composite key mapping', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Store { + id: ID! + name: String! + } + + type Product @key(fields: "id store { id }") @openfed__entityCache(maxAge: 60) { + id: ID! + store: Store! + name: String! + } + + type Query { + product(id: ID!, storeId: ID! @openfed__is(fields: "store.id")): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [ + { entityKeyField: 'id', argumentPath: ['id'] }, + { entityKeyField: 'store.id', argumentPath: ['storeId'] }, + ], + }, + ]); + }); + + test('rule 24: resolvable: false does not prevent other matching keys from being used', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id") @key(fields: "sku", resolvable: false) @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['id'] }], + }, + ]); + }); + + test('rule 24b: resolvable: false keys still participate in auto-mapping', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id") @key(fields: "sku", resolvable: false) @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + + type Query { + product(id: ID!, sku: String!): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + // Each @key is an independent alternative (OR semantics), so two separate mappings are emitted. + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['id'] }], + }, + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'sku', argumentPath: ['sku'] }], + }, + ]); + }); + + test('rule 24c: resolvable: false keys remain eligible for explicit @openfed__is mapping', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id") @key(fields: "sku", resolvable: false) @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + + type Query { + product(id: ID!, productSku: String! @openfed__is(fields: "sku")): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + // Each @key is an independent alternative (OR semantics), so two separate mappings are emitted. + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['id'] }], + }, + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'sku', argumentPath: ['productSku'] }], + }, + ]); + }); + }); + + describe('nested keys', () => { + test('rule 23: a deeply nested @key leaf can be targeted with @openfed__is(fields: "a.b.c.value")', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type C { + value: String! + } + + type B { + c: C! + } + + type A { + b: B! + } + + type Product @key(fields: "a { b { c { value } } }") @openfed__entityCache(maxAge: 60) { + a: A! + name: String! + } + + type Query { + product(val: String! @openfed__is(fields: "a.b.c.value")): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'a.b.c.value', argumentPath: ['val'] }], + }, + ]); + }); + + test('rule 23b: deeply nested @openfed__is mapping validates the leaf field type, not just the path string', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type C { + value: String! + } + + type B { + c: C! + } + + type A { + b: B! + } + + type Product @key(fields: "a { b { c { value } } }") @openfed__entityCache(maxAge: 60) { + a: A! + name: String! + } + + type Query { + product(val: Int! @openfed__is(fields: "a.b.c.value")): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(val: ...)', FIRST_ORDINAL, [ + explicitTypeMismatchErrorMessage('val', 'Query.product', 'Int!', 'a.b.c.value', 'Product', 'String!'), + ]), + ); + }); + }); + + describe('list-return batch mappings', () => { + test('rule 29: a non-key scalar argument on a list-return field emits no mapping and no warning', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + products(category: String!): [Product!]! @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(0); + + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + products(category: String!): [Product!]! @openfed__queryCache(maxAge: 30) + } + `, + 'products', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([]); + }); + + test('rule 29b: an explicit list argument establishes a batch cache mapping for a scalar key field', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + products(ids: [ID!]! @openfed__is(fields: "id")): [Product!]! @openfed__queryCache(maxAge: 30) + } + `, + 'products', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['ids'], isBatch: true }], + }, + ]); + }); + + test('rule 29c: an auto-mapped list argument establishes a batch cache mapping for a scalar key field', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + products(id: [ID!]!): [Product!]! @openfed__queryCache(maxAge: 30) + } + `, + 'products', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['id'], isBatch: true }], + }, + ]); + }); + + test('rule 29e: a composite batch key cannot use multiple separate list arguments', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + + type Query { + products(ids: [ID!]! @openfed__is(fields: "id"), skus: [String!]! @openfed__is(fields: "sku")): [Product!]! @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(QUERY_CACHE, 'Query.products', FIRST_ORDINAL, [ + multipleListArgumentsBatchFactoryMessage('Query.products', 'Product'), + ]), + ); + }); + + test('rule 15g: list return plus a single list argument is not enough for a list-valued key field', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "tags") @openfed__entityCache(maxAge: 60) { + tags: [String!]! + name: String! + } + + type Query { + products(tags: [String!]! @openfed__is(fields: "tags")): [Product!]! @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.products(tags: ...)', FIRST_ORDINAL, [ + batchListValuedKeyRequiresNestedListsErrorMessage( + 'Query.products', + 'tags', + 'Product', + 'a single tag list of type "[String!]!"', + ), + ]), + ); + }); + + test('rule 15h: list return plus a scalar argument is not enough for a list-valued key field', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "tags") @openfed__entityCache(maxAge: 60) { + tags: [String!]! + name: String! + } + + type Query { + products(tag: String! @openfed__is(fields: "tags")): [Product!]! @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.products(tag: ...)', FIRST_ORDINAL, [ + batchListValuedKeyRequiresNestedListsErrorMessage( + 'Query.products', + 'tags', + 'Product', + 'a scalar tag of type "String!"', + ), + ]), + ); + }); + + test('rule 15i: list return plus a list-of-list argument can batch-map a list-valued key field', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "tags") @openfed__entityCache(maxAge: 60) { + tags: [String!]! + name: String! + } + + type Query { + products(tags: [[String!]!]! @openfed__is(fields: "tags")): [Product!]! @openfed__queryCache(maxAge: 30) + } + `, + 'products', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'tags', argumentPath: ['tags'], isBatch: true }], + }, + ]); + }); + + test('rule 29f: an explicit list-return batch mapping rejects type mismatches', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + products(ids: [String!]! @openfed__is(fields: "id")): [Product!]! @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.products(ids: ...)', FIRST_ORDINAL, [ + explicitTypeMismatchErrorMessage('ids', 'Query.products', '[String!]!', 'id', 'Product', 'ID!'), + ]), + ); + }); + + test('rule 29g: explicit batch mapping cannot coexist with an extra non-key list filter argument', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + products(ids: [ID!]! @openfed__is(fields: "id"), category: String!): [Product!]! @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.products(ids: ...)', FIRST_ORDINAL, [ + explicitBatchAdditionalNonKeyArgumentErrorMessage('Query.products', 'ids', 'id', 'Product', 'category'), + ]), + ); + }); + + test('rule 29h: auto batch mapping is skipped when the field also has an extra non-key argument', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + products(id: [ID!]!, category: String!): [Product!]! @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + autoBatchAdditionalNonKeyArgumentWarningMessage('Query.products', 'id', 'id', 'Product', 'category'), + ); + }); + + test('rule 29i: explicit scalar @openfed__is mappings cannot establish cache keys for a list-returning field', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id region") @openfed__entityCache(maxAge: 60) { + id: ID! + region: String! + name: String! + } + + type Query { + products(pid: ID! @openfed__is(fields: "id"), area: String! @openfed__is(fields: "region")): [Product!]! @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.products(pid: ...)', FIRST_ORDINAL, [ + explicitScalarArgumentsCannotEstablishBatchMappingErrorMessage('Query.products', 'Product'), + ]), + ); + }); + + test('rule 29j: explicit @openfed__is plus an extra non-key argument is rejected on a list-return field', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + products(pid: ID! @openfed__is(fields: "id"), category: String!): [Product!]! @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.products(pid: ...)', FIRST_ORDINAL, [ + explicitBatchAdditionalNonKeyArgumentErrorMessage('Query.products', 'pid', 'id', 'Product', 'category'), + ]), + ); + }); + + test('rule 29k: auto-mapped key arguments are skipped on a list-return field when an extra non-key argument is present', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + products(id: ID!, category: String!): [Product!]! @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + autoBatchAdditionalNonKeyArgumentWarningMessage('Query.products', 'id', 'id', 'Product', 'category'), + ); + }); + }); + + describe('mixed key and non-key arguments on singular returns', () => { + test('rule 33: explicit @openfed__is plus an extra non-key argument is rejected on a singular return', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(pid: ID! @openfed__is(fields: "id"), category: String!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(pid: ...)', FIRST_ORDINAL, [ + explicitSingularAdditionalNonKeyArgumentErrorMessage('Query.product', 'pid', 'id', 'Product', 'category'), + ]), + ); + }); + + test('rule 33b: auto-mapped singular key is skipped when the field also has an extra non-key argument', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(id: ID!, category: String!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + autoMappingAdditionalNonKeyArgumentWarningMessage('id', 'Query.product', 'id', 'Product', 'category'), + ); + + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(id: ID!, category: String!): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([]); + }); + }); + + describe('input-object mappings', () => { + test('rule 29d-a: a flat singular argument cannot map to multiple key fields via @openfed__is(fields: "id sku")', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Product @key(fields: "id sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + + type Query { + product(key: ID! @openfed__is(fields: "id sku")): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(key: ...)', FIRST_ORDINAL, [ + nonInputArgumentCannotTargetCompositeKeyErrorMessage('key', 'Query.product', 'id sku', 'Product', 'ID!'), + ]), + ); + }); + + test('rule 29d: a list of input objects can map to a composite key via @openfed__is(fields: "id sku")', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + input ProductKeyInput { + id: ID! + sku: String! + } + + type Product @key(fields: "id sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + + type Query { + products(keys: [ProductKeyInput!]! @openfed__is(fields: "id sku")): [Product!]! @openfed__queryCache(maxAge: 30) + } + `, + 'products', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [ + { entityKeyField: 'id', argumentPath: ['keys', 'id'], isBatch: true }, + { entityKeyField: 'sku', argumentPath: ['keys', 'sku'], isBatch: true }, + ], + }, + ]); + }); + + test('rule 29d-ii: an input-object list argument without @openfed__is(fields: "...") does not auto-map to a composite key', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + input ProductKeyInput { + id: ID! + sku: String! + } + + type Product @key(fields: "id sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + + type Query { + products(keys: [ProductKeyInput!]!): [Product!]! @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(warnings).toHaveLength(0); + + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + input ProductKeyInput { + id: ID! + sku: String! + } + + type Product @key(fields: "id sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + + type Query { + products(keys: [ProductKeyInput!]!): [Product!]! @openfed__queryCache(maxAge: 30) + } + `, + 'products', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([]); + }); + + test('rule 29d-iii: @openfed__is(fields: "id sku") rejects input-object field type mismatches on list returns', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + input ProductKeyInput { + id: String! + sku: String! + } + + type Product @key(fields: "id sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + + type Query { + products(keys: [ProductKeyInput!]! @openfed__is(fields: "id sku")): [Product!]! @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.products(keys: ...)', FIRST_ORDINAL, [ + inputObjectCompositeTypeMismatchErrorMessage( + 'keys', + 'Query.products', + 'id sku', + 'Product', + 'ProductKeyInput', + 'id', + 'String!', + 'Product.id', + 'ID!', + ), + ]), + ); + }); + + test('rule 29d-iv: @openfed__is(fields: "id sku") rejects input objects that omit required key fields on list returns', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + input ProductKeyInput { + id: ID! + } + + type Product @key(fields: "id sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + + type Query { + products(keys: [ProductKeyInput!]! @openfed__is(fields: "id sku")): [Product!]! @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.products(keys: ...)', FIRST_ORDINAL, [ + inputObjectCompositeMissingFieldErrorMessage( + 'keys', + 'Query.products', + 'id sku', + 'Product', + 'ProductKeyInput', + 'sku', + ), + ]), + ); + }); + + test('rule 29d-v: a singular input object can map to a composite key via @openfed__is(fields: "id sku")', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + input ProductKeyInput { + id: ID! + sku: String! + } + + type Product @key(fields: "id sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + + type Query { + product(key: ProductKeyInput! @openfed__is(fields: "id sku")): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [ + { entityKeyField: 'id', argumentPath: ['key', 'id'] }, + { entityKeyField: 'sku', argumentPath: ['key', 'sku'] }, + ], + }, + ]); + }); + + test('rule 30: a nested input object can recursively auto-map to a nested key structure', () => { + const rootFieldConfig = getSingleQueryRootFieldConfig( + ` + type Location { + id: ID! + region: String! + } + + type Store { + id: ID! + location: Location! + } + + input LocationInput { + id: ID! + region: String! + } + + input StoreInput { + id: ID! + location: LocationInput! + } + + type Product @key(fields: "store { id location { id region } }") @openfed__entityCache(maxAge: 60) { + store: Store! + name: String! + } + + type Query { + product(store: StoreInput!): Product @openfed__queryCache(maxAge: 30) + } + `, + 'product', + ); + + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [ + { entityKeyField: 'store.id', argumentPath: ['store', 'id'] }, + { entityKeyField: 'store.location.id', argumentPath: ['store', 'location', 'id'] }, + { entityKeyField: 'store.location.region', argumentPath: ['store', 'location', 'region'] }, + ], + }, + ]); + }); + + test('rule 31: nested input-object mapping reports nested leaf type mismatches precisely', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Location { + id: ID! + region: String! + } + + type Store { + id: ID! + location: Location! + } + + input LocationInput { + id: Int! + region: String! + } + + input StoreInput { + id: ID! + location: LocationInput! + } + + type Product @key(fields: "store { id location { id region } }") @openfed__entityCache(maxAge: 60) { + store: Store! + name: String! + } + + type Query { + product(store: StoreInput!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(QUERY_CACHE, 'Query.product', FIRST_ORDINAL, [ + nestedInputObjectTypeMismatchErrorMessage( + 'store', + 'Query.product', + 'store { id location { id region } }', + 'Product', + 'LocationInput', + 'id', + 'Int!', + 'Location.id', + 'ID!', + ), + ]), + ); + }); + + test('rule 32: nested input-object mapping reports missing nested key fields precisely', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Location { + id: ID! + region: String! + } + + type Store { + id: ID! + location: Location! + } + + input LocationInput { + id: ID! + } + + input StoreInput { + id: ID! + location: LocationInput! + } + + type Product @key(fields: "store { id location { id region } }") @openfed__entityCache(maxAge: 60) { + store: Store! + name: String! + } + + type Query { + product(store: StoreInput!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(QUERY_CACHE, 'Query.product', FIRST_ORDINAL, [ + nestedInputObjectMissingFieldErrorMessage( + 'store', + 'Query.product', + 'store { id location { id region } }', + 'Product', + 'LocationInput', + 'region', + ), + ]), + ); + }); + + test('rule 36: redundant @openfed__is on an argument that already auto-maps emits a warning (mapping still extracted)', () => { + // Bug (b): `@openfed__is(fields: "id")` on argument `id` is redundant — auto-map would produce the same result. + const sdl = ` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(id: ID! @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 30) + } + `; + + const { warnings } = normalizeSubgraphSuccess(subgraph(sdl), version); + expect(warnings).toHaveLength(1); + expect(warnings[0]).toStrictEqual( + redundantIsDirectiveWarning({ + subgraphName: 'subgraph-a', + argumentName: 'id', + fieldCoords: 'Query.product', + keyField: 'id', + entityType: 'Product', + }), + ); + + // Mapping is still extracted — redundancy is a lint, not a correctness break. + const rootFieldConfig = getSingleQueryRootFieldConfig(sdl, 'product'); + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['id'] }], + }, + ]); + }); + + test('rule 36-positive: @openfed__is renaming a differently-named argument to a key field is NOT redundant', () => { + // Sanity: when arg name differs from key field, @openfed__is is required and not a warning. + const sdl = ` + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + + type Query { + product(pid: ID! @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 30) + } + `; + + const { warnings } = normalizeSubgraphSuccess(subgraph(sdl), version); + expect(warnings).toHaveLength(0); + + const rootFieldConfig = getSingleQueryRootFieldConfig(sdl, 'product'); + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['pid'] }], + }, + ]); + }); + + test('rule 34: nested composite-key leaf checks list/NonNull wrapping in addition to named type', () => { + // Bug (c): key expects `[ID!]!` at the leaf; input has scalar `ID`. Old code only compared named types + // and silently accepted the shape mismatch. New code rejects it. + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Location { + id: [ID!]! + region: String! + } + + type Store { + id: ID! + location: Location! + } + + input LocationInput { + id: ID! + region: String! + } + + input StoreInput { + id: ID! + location: LocationInput! + } + + type Product @key(fields: "store { id location { id region } }") @openfed__entityCache(maxAge: 60) { + store: Store! + name: String! + } + + type Query { + product(store: StoreInput!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(QUERY_CACHE, 'Query.product', FIRST_ORDINAL, [ + nestedInputObjectTypeMismatchErrorMessage( + 'store', + 'Query.product', + 'store { id location { id region } }', + 'Product', + 'LocationInput', + 'id', + 'ID!', + 'Location.id', + '[ID!]!', + ), + ]), + ); + }); + + test('rule 34-positive: nested composite-key leaf with matching list shape succeeds', () => { + const sdl = ` + type Location { + id: [ID!]! + region: String! + } + + type Store { + id: ID! + location: Location! + } + + input LocationInput { + id: [ID!]! + region: String! + } + + input StoreInput { + id: ID! + location: LocationInput! + } + + type Product @key(fields: "store { id location { id region } }") @openfed__entityCache(maxAge: 60) { + store: Store! + name: String! + } + + type Query { + product(store: StoreInput!): Product @openfed__queryCache(maxAge: 30) + } + `; + + const { warnings } = normalizeSubgraphSuccess(subgraph(sdl), version); + expect(warnings).toHaveLength(0); + + const rootFieldConfig = getSingleQueryRootFieldConfig(sdl, 'product'); + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [ + { entityKeyField: 'store.id', argumentPath: ['store', 'id'] }, + { entityKeyField: 'store.location.id', argumentPath: ['store', 'location', 'id'] }, + { entityKeyField: 'store.location.region', argumentPath: ['store', 'location', 'region'] }, + ], + }, + ]); + }); + + test('rule 35: a failed auto-map on one @key does not abort evaluation of remaining @keys (missing arg)', () => { + // Bug (d): the first @key has no matching arg (region missing); the second @key still auto-maps. + const sdl = ` + type Product @key(fields: "id region") @key(fields: "sku") @openfed__entityCache(maxAge: 60) { + id: ID! + region: String! + sku: String! + name: String! + } + + type Query { + product(id: ID!, sku: String!): Product @openfed__queryCache(maxAge: 30) + } + `; + + const { warnings } = normalizeSubgraphSuccess(subgraph(sdl), version); + // Incomplete composite key warning for the "id region" key — NOT a fatal abort. + expect(warnings).toHaveLength(1); + expect(warnings[0]).toStrictEqual( + incompleteQueryCacheKeyMappingWarning({ + subgraphName: 'subgraph-a', + fieldCoords: 'Query.product', + entityType: 'Product', + unmappedKeyField: 'region', + }), + ); + + const rootFieldConfig = getSingleQueryRootFieldConfig(sdl, 'product'); + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'sku', argumentPath: ['sku'] }], + }, + ]); + }); + + test('rule 35b: when NO @key auto-maps, no mappings are emitted', () => { + // Sanity: bug (d)'s "overall failure only if NO key auto-maps" — here both keys fail to map. + const sdl = ` + type Product @key(fields: "id") @key(fields: "sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + + type Query { + product(foo: String!): Product @openfed__queryCache(maxAge: 30) + } + `; + + const rootFieldConfig = getSingleQueryRootFieldConfig(sdl, 'product'); + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([]); + }); + + // Codex P1 #1 regression: the missing-@openfed__entityCache warning only applies to OBJECT + // returns. @openfed__entityCache is OBJECT-only, so flagging an interface/union return with + // the same remediation ("add @openfed__entityCache to the type") would be unactionable. + test('rule 37: @openfed__queryCache on an entity-interface return without @openfed__entityCache does not emit the missing-entityCache warning', () => { + const sdl = ` + interface Product @key(fields: "id") { + id: ID! + } + + type Book implements Product @key(fields: "id") { + id: ID! + title: String! + } + + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + `; + + const { warnings } = normalizeSubgraphSuccess(subgraph(sdl), version); + // Must NOT emit queryCacheReturnEntityMissingEntityCacheWarning for an interface return — + // users cannot add @openfed__entityCache to an interface. + for (const w of warnings) { + expect(w.message).not.toContain('has no @openfed__entityCache directive'); + } + }); + + test('rule 37b: @openfed__queryCache on a list-of-entity-interface return without @openfed__entityCache does not emit the missing-entityCache warning', () => { + const sdl = ` + interface Product @key(fields: "id") { + id: ID! + } + + type Book implements Product @key(fields: "id") { + id: ID! + title: String! + } + + type Query { + products(id: ID!): [Product!]! @openfed__queryCache(maxAge: 30) + } + `; + + const { warnings } = normalizeSubgraphSuccess(subgraph(sdl), version); + for (const w of warnings) { + expect(w.message).not.toContain('has no @openfed__entityCache directive'); + } + }); + + // Codex P1 #2 regression: on a list-return field with a list-valued key field, auto-mapping + // cannot batch-map (buildAutoMappings skips `argIsList && keyIsList` on list returns). The + // explicit @openfed__is is REQUIRED — redundantIsDirectiveWarning must not fire. + test('rule 38: @openfed__is is NOT redundant when the key field is list-valued on a list-return field', () => { + const sdl = ` + type Product @key(fields: "tags") @openfed__entityCache(maxAge: 60) { + tags: [String!]! + name: String! + } + + type Query { + products(tags: [[String!]!]! @openfed__is(fields: "tags")): [Product!]! @openfed__queryCache(maxAge: 30) + } + `; + + const { warnings } = normalizeSubgraphSuccess(subgraph(sdl), version); + // No redundancy warning — auto-map cannot reach the list-key path on a list return. + for (const w of warnings) { + expect(w.message).not.toContain('is redundant and can be removed'); + } + + const rootFieldConfig = getSingleQueryRootFieldConfig(sdl, 'products'); + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'tags', argumentPath: ['tags'], isBatch: true }], + }, + ]); + }); + + // Codex P1 #3 regression: with one satisfiable nested @key AND one flat @key that hits the + // "extra non-key argument" global-invalidation path, NO auto-mapping may survive. The + // singular-return rule (extra non-key arg → reject whole set) must hold. + test('rule 39: an extra non-key argument globally invalidates all auto-mappings, including earlier nested-key results', () => { + const sdl = ` + input StoreInput { + id: ID! + region: String! + } + + type Product + @key(fields: "store { id region }") + @key(fields: "id") + @openfed__entityCache(maxAge: 60) { + id: ID! + store: StoreRef! + name: String! + } + + type StoreRef { + id: ID! + region: String! + } + + type Query { + product(store: StoreInput!, id: ID!, extra: String!): Product @openfed__queryCache(maxAge: 30) + } + `; + + const { warnings } = normalizeSubgraphSuccess(subgraph(sdl), version); + // Must include the auto-mapping "additional argument" warning for the flat key. + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + autoMappingAdditionalNonKeyArgumentWarningMessage('id', 'Query.product', 'id', 'Product', 'store'), + ); + + // Crucial assertion: NO mappings survive — the nested-key success must not leak through. + const rootFieldConfig = getSingleQueryRootFieldConfig(sdl, 'product'); + expect(rootFieldConfig.entityKeyMappings).toStrictEqual([]); + }); + + // Codex P2 #2 regression: pinning pure-nullability-only mismatches for typesMatchIncludingListShape. + // The helper is used in buildExplicitMappings nested composite-key leaves, where strict list-shape + // comparison (including NonNull wrapping) applies — any nullability difference must be rejected. + test('rule 40: nested composite-key leaf rejects nullable-vs-non-null scalar mismatch (ID vs ID!)', () => { + // key leaf requires `ID!`, input supplies `ID` — must be rejected. + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Store { + id: ID! + region: String! + } + + input StoreInput { + id: ID + region: String! + } + + type Product @key(fields: "store { id region }") @openfed__entityCache(maxAge: 60) { + store: Store! + name: String! + } + + type Query { + product(store: StoreInput!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors.length).toBeGreaterThan(0); + }); + + test('rule 40b: nested composite-key leaf rejects inner-list nullability mismatch ([ID]! vs [ID!]!)', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Store { + ids: [ID!]! + region: String! + } + + input StoreInput { + ids: [ID]! + region: String! + } + + type Product @key(fields: "store { ids region }") @openfed__entityCache(maxAge: 60) { + store: Store! + name: String! + } + + type Query { + product(store: StoreInput!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors.length).toBeGreaterThan(0); + }); + + test('rule 40c: nested composite-key leaf rejects outer-list nullability mismatch ([ID!] vs [ID!]!)', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Store { + ids: [ID!]! + region: String! + } + + input StoreInput { + ids: [ID!] + region: String! + } + + type Product @key(fields: "store { ids region }") @openfed__entityCache(maxAge: 60) { + store: Store! + name: String! + } + + type Query { + product(store: StoreInput!): Product @openfed__queryCache(maxAge: 30) + } + `), + version, + ); + + expect(errors.length).toBeGreaterThan(0); + }); + }); +}); diff --git a/composition/tests/v1/directives/entity-caching.test.ts b/composition/tests/v1/directives/entity-caching.test.ts new file mode 100644 index 0000000000..dad6eb3160 --- /dev/null +++ b/composition/tests/v1/directives/entity-caching.test.ts @@ -0,0 +1,1600 @@ +import { describe, expect, test } from 'vitest'; +import { + BatchNormalizationSuccess, + CACHE_INVALIDATE, + CACHE_POPULATE, + CacheInvalidateConfig, + CachePopulateConfig, + DIRECTIVE_DEFINITION_BY_NAME, + ENTITY_CACHE, + EntityCacheConfig, + entityCacheWithoutKeyErrorMessage, + FIRST_ORDINAL, + invalidDirectiveError, + IS, + isReferencesUnknownKeyFieldErrorMessage, + isWithoutQueryCacheErrorMessage, + duplicateKeyFieldMappingErrorMessage, + maxAgeNotPositiveIntegerErrorMessage, + MUTATION, + parse, + QUERY, + QUERY_CACHE, + queryCacheOnNonEntityReturnTypeErrorMessage, + queryCacheOnNonQueryFieldErrorMessage, + REQUEST_SCOPED, + REQUEST_SCOPED_DEFINITION, + RootFieldCacheConfig, + ROUTER_COMPATIBILITY_VERSION_ONE, + Subgraph, + subgraphValidationError, + SUBSCRIPTION, + TypeName, + cacheInvalidateOnNonMutationSubscriptionFieldErrorMessage, + cacheInvalidateOnNonEntityReturnTypeErrorMessage, + cachePopulateOnNonMutationSubscriptionFieldErrorMessage, + cachePopulateOnNonEntityReturnTypeErrorMessage, + cacheInvalidateAndPopulateMutualExclusionErrorMessage, +} from '../../../src'; +import { SCHEMA_QUERY_DEFINITION } from '../utils/utils'; +import { batchNormalize } from '../../../src/v1/normalization/normalization-factory'; +import { + federateSubgraphsSuccess, + normalizeString, + normalizeSubgraphFailure, + normalizeSubgraphSuccess, + schemaToSortedNormalizedString, +} from '../../utils/utils'; + +const version = ROUTER_COMPATIBILITY_VERSION_ONE; + +// Helper: creates a Subgraph object from an inline SDL string. +// Keeps each test self-contained while avoiding repetitive boilerplate. +function subgraph(sdl: string, name = 'subgraph-a'): Subgraph { + return { name, url: '', definitions: parse(sdl) }; +} + +// Helper: runs batchNormalize and returns the ConfigurationData for a given type. +// Used by config-extraction tests that need to inspect the generated router configuration. +// Pins ROUTER_COMPATIBILITY_VERSION_ONE explicitly — relying on the default masks breakage +// when the default changes in the future. +function getConfigForType(sg: Subgraph, typeName: string) { + const result = batchNormalize({ + subgraphs: [sg], + version: ROUTER_COMPATIBILITY_VERSION_ONE, + }) as BatchNormalizationSuccess; + expect(result.success).toBe(true); + const internal = result.internalSubgraphBySubgraphName.get(sg.name); + expect(internal).toBeDefined(); + return internal!.configurationDataByTypeName.get(typeName as TypeName); +} + +describe('Entity caching directive tests', () => { + // ─── @openfed__entityCache ───────────────────────────────────────────────────────────── + // @openfed__entityCache marks an entity type as cacheable. It requires @key (so the router + // can construct cache keys) and a positive maxAge (TTL in seconds). + + describe('@openfed__entityCache', () => { + test('error: @openfed__entityCache without @key — the router needs @key fields to construct cache keys', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { product(id: ID!): Product } + # Product has @openfed__entityCache but no @key — there's no cache key to use + type Product @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(ENTITY_CACHE, 'Product', FIRST_ORDINAL, [entityCacheWithoutKeyErrorMessage('Product')]), + ); + }); + + test('error: maxAge of zero — TTL must be at least 1 second', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { product(id: ID!): Product } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 0) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(ENTITY_CACHE, 'Product', FIRST_ORDINAL, [ + maxAgeNotPositiveIntegerErrorMessage(ENTITY_CACHE, 0), + ]), + ); + }); + + test('error: negative maxAge', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { product(id: ID!): Product } + type Product @key(fields: "id") @openfed__entityCache(maxAge: -5) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(ENTITY_CACHE, 'Product', FIRST_ORDINAL, [ + maxAgeNotPositiveIntegerErrorMessage(ENTITY_CACHE, -5), + ]), + ); + }); + + test('success: valid @openfed__entityCache with @key normalizes without errors', () => { + const { schema } = normalizeSubgraphSuccess( + subgraph(` + type Query { product(id: ID!): Product } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(schema).toBeDefined(); + }); + + test('config: @openfed__entityCache with defaults produces correct EntityCacheConfig', () => { + // Only maxAge is required; includeHeaders, partialCacheLoad, shadowMode default to false + const config = getConfigForType( + subgraph(` + type Query { product(id: ID!): Product } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + 'Product', + ); + expect(config).toBeDefined(); + expect(config!.entityCacheConfigurations).toStrictEqual([ + { + typeName: 'Product', + maxAgeSeconds: 60, + notFoundCacheTtlSeconds: 0, + includeHeaders: false, + partialCacheLoad: false, + shadowMode: false, + }, + ] satisfies EntityCacheConfig[]); + }); + + test('config: @openfed__entityCache with all options enabled', () => { + // includeHeaders: cache key includes request headers (user-specific caching) + // partialCacheLoad: fetch only missing entities from subgraph on partial cache hit + // shadowMode: cache reads/writes happen but responses always come from subgraph + const config = getConfigForType( + subgraph(` + type Query { product(id: ID!): Product } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 120, includeHeaders: true, partialCacheLoad: true, shadowMode: true) { + id: ID! + name: String! + } + `), + 'Product', + ); + expect(config).toBeDefined(); + expect(config!.entityCacheConfigurations).toStrictEqual([ + { + typeName: 'Product', + maxAgeSeconds: 120, + notFoundCacheTtlSeconds: 0, + includeHeaders: true, + partialCacheLoad: true, + shadowMode: true, + }, + ] satisfies EntityCacheConfig[]); + }); + + test('config: @openfed__entityCache negativeCacheTTL propagates to notFoundCacheTtlSeconds', () => { + // negativeCacheTTL caches "not found" entity responses (null from _entities without errors) + // for the specified TTL in seconds. 0 (default) disables negative caching. + const config = getConfigForType( + subgraph(` + type Query { product(id: ID!): Product } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 300, negativeCacheTTL: 10) { + id: ID! + name: String! + } + `), + 'Product', + ); + expect(config).toBeDefined(); + expect(config!.entityCacheConfigurations).toStrictEqual([ + { + typeName: 'Product', + maxAgeSeconds: 300, + notFoundCacheTtlSeconds: 10, + includeHeaders: false, + partialCacheLoad: false, + shadowMode: false, + }, + ] satisfies EntityCacheConfig[]); + }); + + test('error: @openfed__entityCache negativeCacheTTL must be non-negative', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { product(id: ID!): Product } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 300, negativeCacheTTL: -1) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toBeDefined(); + expect(errors!.some((e) => e.message.includes('negativeCacheTTL must be a non-negative integer'))).toBe(true); + }); + }); + + // ─── @openfed__queryCache ────────────────────────────────────────────────────────────── + // @openfed__queryCache on a Query field tells the router to serve the returned entity from cache. + // The return type must be an entity with @openfed__entityCache. Query arguments are mapped to + // @key fields (automatically by name, or explicitly via @openfed__is) to construct cache keys. + + describe('@openfed__queryCache', () => { + test('error: @openfed__queryCache on a Mutation field — only Query fields support cache reads', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { dummy: String! } + type Mutation { + updateProduct(id: ID!): Product @openfed__queryCache(maxAge: 60) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(QUERY_CACHE, 'Mutation.updateProduct', FIRST_ORDINAL, [ + queryCacheOnNonQueryFieldErrorMessage('Mutation.updateProduct'), + ]), + ); + }); + + test('error: return type is not a federation entity (no @key)', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 60) + } + # Product has no @key — it's not an entity, so there's no cache key + type Product { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(QUERY_CACHE, 'Query.product', FIRST_ORDINAL, [ + queryCacheOnNonEntityReturnTypeErrorMessage('Query.product', 'Product'), + ]), + ); + }); + + // Expectation updated (bug a fix): @openfed__queryCache on a @key entity without + // @openfed__entityCache warns and does NOT extract a queryCache config — the cache + // would have no entity-cache backing store. + test('warning: return entity omits @openfed__entityCache — queryCache config is NOT extracted', () => { + const config = getConfigForType( + subgraph(` + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 60) + } + type Product @key(fields: "id") { + id: ID! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toBeUndefined(); + }); + + test('error: maxAge of zero', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 0) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(QUERY_CACHE, 'Query.product', FIRST_ORDINAL, [ + maxAgeNotPositiveIntegerErrorMessage(QUERY_CACHE, 0), + ]), + ); + }); + + test("success: argument name doesn't match any @key field — no mappings and no warning", () => { + // No argument can satisfy the @key, so composition emits no cache-key mappings and stays silent. + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Query { + product(name: String!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(warnings).toHaveLength(0); + }); + + test('no warning for list return type — lists skip key mapping entirely', () => { + // List-returning fields can populate the cache with each entity in the response, + // but can't do key-based lookups, so missing key mappings are expected and not warned. + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Query { + products: [Product] @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(warnings).toHaveLength(0); + }); + + test('success: argument name matches @key field — auto-mapped without @openfed__is', () => { + // The "id" argument automatically maps to the @key(fields: "id") field + const { schema, warnings } = normalizeSubgraphSuccess( + subgraph(` + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(schema).toBeDefined(); + expect(warnings).toHaveLength(0); + }); + + test('config: auto-mapped argument produces correct RootFieldCacheConfig', () => { + // product(id: ID!) with @key(fields: "id") → auto-maps "id" argument to "id" key field + const config = getConfigForType( + subgraph(` + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toStrictEqual([ + { + fieldName: 'product', + maxAgeSeconds: 30, + includeHeaders: false, + shadowMode: false, + entityTypeName: 'Product', + entityKeyMappings: [ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['id'] }], + }, + ], + }, + ] satisfies RootFieldCacheConfig[]); + }); + + test('config: @openfed__queryCache with includeHeaders and shadowMode', () => { + const config = getConfigForType( + subgraph(` + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30, includeHeaders: true, shadowMode: true) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toStrictEqual([ + { + fieldName: 'product', + maxAgeSeconds: 30, + includeHeaders: true, + shadowMode: true, + entityTypeName: 'Product', + entityKeyMappings: [ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['id'] }], + }, + ], + }, + ] satisfies RootFieldCacheConfig[]); + }); + + test('config: auto-mapped composite @key produces multiple fieldMappings', () => { + const config = getConfigForType( + subgraph(` + type Query { + product(id: ID!, region: String!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id region") @openfed__entityCache(maxAge: 60) { + id: ID! + region: String! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toStrictEqual([ + { + fieldName: 'product', + maxAgeSeconds: 30, + includeHeaders: false, + shadowMode: false, + entityTypeName: 'Product', + entityKeyMappings: [ + { + entityTypeName: 'Product', + fieldMappings: [ + { entityKeyField: 'id', argumentPath: ['id'] }, + { entityKeyField: 'region', argumentPath: ['region'] }, + ], + }, + ], + }, + ] satisfies RootFieldCacheConfig[]); + }); + + test('config: nested auto-mapping is discarded when the field has an extra argument', () => { + const config = getConfigForType( + subgraph(` + type Query { + product(store: StoreKey!, filter: String): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "store { id }") @openfed__entityCache(maxAge: 60) { + store: Store! + name: String! + } + type Store { + id: ID! + } + input StoreKey { + id: ID! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toStrictEqual([ + { + fieldName: 'product', + maxAgeSeconds: 30, + includeHeaders: false, + shadowMode: false, + entityTypeName: 'Product', + entityKeyMappings: [], + }, + ] satisfies RootFieldCacheConfig[]); + }); + + test('config: composite @key with mixed auto and @openfed__is mapping', () => { + const config = getConfigForType( + subgraph(` + type Query { + product(id: ID!, loc: String! @openfed__is(fields: "region")): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id region") @openfed__entityCache(maxAge: 60) { + id: ID! + region: String! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + const mappings = config!.rootFieldCacheConfigurations![0].entityKeyMappings[0].fieldMappings; + // Sort by entityKeyField so the assertion is order-independent without losing exhaustiveness. + const sorted = [...mappings].sort((a, b) => a.entityKeyField.localeCompare(b.entityKeyField)); + expect(sorted).toStrictEqual([ + { entityKeyField: 'id', argumentPath: ['id'] }, + { entityKeyField: 'region', argumentPath: ['loc'] }, + ]); + }); + }); + + // ─── @openfed__is ────────────────────────────────────────────────────────────────────── + // @openfed__is(fields: "keyField") on a query argument explicitly maps it to a @key field. + // Useful when the argument name differs from the key field name, + // e.g., product(pid: ID! @openfed__is(fields: "id")) maps "pid" to the @key field "id". + + describe('@openfed__is', () => { + test('error: @openfed__is without @openfed__queryCache on the field — @openfed__is only makes sense for cache key construction', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { + product(pid: ID! @openfed__is(fields: "id")): Product + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(pid: ...)', FIRST_ORDINAL, [ + isWithoutQueryCacheErrorMessage('pid', 'Query.product'), + ]), + ); + }); + + test('error: @openfed__is references a field not in @key', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { + product(pid: ID! @openfed__is(fields: "unknown")): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(pid: ...)', FIRST_ORDINAL, [ + isReferencesUnknownKeyFieldErrorMessage('unknown', 'pid', 'Query.product', 'Product'), + ]), + ); + }); + + test('error: two arguments map to the same @key field — ambiguous cache key', () => { + // "id" auto-maps to @key field "id", then "otherId" also maps to "id" via @openfed__is + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { + product(id: ID!, otherId: ID! @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(IS, 'Query.product(otherId: ...)', FIRST_ORDINAL, [ + duplicateKeyFieldMappingErrorMessage('Query.product', 'id'), + ]), + ); + }); + + // Expectation updated (bug b fix): redundant @openfed__is(fields: "id") on argument + // named "id" now emits a warning (the directive duplicates the auto-map). + test('warning: redundant @openfed__is(fields: "id") on argument named "id" emits a redundancy warning', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Query { + product(id: ID! @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(warnings).toHaveLength(1); + expect(warnings[0].message).toBe( + `Argument "id" on field "Query.product" has @openfed__is(fields: "id"), but "id" already auto-maps to` + + ` @key field "id" on entity "Product". The @openfed__is directive is redundant and can be removed.`, + ); + }); + + test('success: @openfed__is maps differently-named argument to @key field', () => { + // "pid" doesn't match @key field "id", so @openfed__is(fields: "id") is required + const { schema, warnings } = normalizeSubgraphSuccess( + subgraph(` + type Query { + product(pid: ID! @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(schema).toBeDefined(); + expect(warnings).toHaveLength(0); + }); + + test('config: @openfed__is mapping produces argumentPath with the original argument name', () => { + // product(pid: ID! @openfed__is(fields: "id")) → entityKeyField: "id", argumentPath: ["pid"] + const config = getConfigForType( + subgraph(` + type Query { + product(pid: ID! @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toStrictEqual([ + { + fieldName: 'product', + maxAgeSeconds: 30, + includeHeaders: false, + shadowMode: false, + entityTypeName: 'Product', + entityKeyMappings: [ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['pid'] }], + }, + ], + }, + ] satisfies RootFieldCacheConfig[]); + }); + + test('config: @openfed__is can map scalar and composite keys on the same field', () => { + const config = getConfigForType( + subgraph(` + type Query { + product( + pid: ID! @openfed__is(fields: "id") + storeKey: ProductStoreKey! @openfed__is(fields: "store { id }") + ): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @key(fields: "store { id }") @openfed__entityCache(maxAge: 60) { + id: ID! + store: Store! + name: String! + } + type Store { + id: ID! + } + input ProductStoreKey { + store: StoreKey! + } + input StoreKey { + id: ID! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toStrictEqual([ + { + fieldName: 'product', + maxAgeSeconds: 30, + includeHeaders: false, + shadowMode: false, + entityTypeName: 'Product', + entityKeyMappings: [ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'store.id', argumentPath: ['storeKey', 'store', 'id'] }], + }, + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['pid'] }], + }, + ], + }, + ] satisfies RootFieldCacheConfig[]); + }); + + test('config: composite @openfed__is matches reordered flat @key fields', () => { + const config = getConfigForType( + subgraph(` + type Query { + product(key: ProductKey! @openfed__is(fields: "sku id")): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id sku") @openfed__entityCache(maxAge: 60) { + id: ID! + sku: String! + name: String! + } + input ProductKey { + sku: String! + id: ID! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toStrictEqual([ + { + fieldName: 'product', + maxAgeSeconds: 30, + includeHeaders: false, + shadowMode: false, + entityTypeName: 'Product', + entityKeyMappings: [ + { + entityTypeName: 'Product', + fieldMappings: [ + { entityKeyField: 'id', argumentPath: ['key', 'id'] }, + { entityKeyField: 'sku', argumentPath: ['key', 'sku'] }, + ], + }, + ], + }, + ] satisfies RootFieldCacheConfig[]); + }); + + test('config: compound flat @key with @openfed__is on both args', () => { + const config = getConfigForType( + subgraph(` + type Query { + product(pid: ID! @openfed__is(fields: "id"), loc: String! @openfed__is(fields: "region")): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id region") @openfed__entityCache(maxAge: 60) { + id: ID! + region: String! + name: String! + } + `), + QUERY, + ); + expect(config).toBeDefined(); + const mappings = config!.rootFieldCacheConfigurations![0].entityKeyMappings[0].fieldMappings; + const sorted = [...mappings].sort((a, b) => a.entityKeyField.localeCompare(b.entityKeyField)); + expect(sorted).toStrictEqual([ + { entityKeyField: 'id', argumentPath: ['pid'] }, + { entityKeyField: 'region', argumentPath: ['loc'] }, + ]); + }); + + test('success: nested @key fields do not auto-map from unrelated flat arguments and emit no warning', () => { + const { warnings } = normalizeSubgraphSuccess( + subgraph(` + type Query { + product(storeId: ID!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "store { id }") @openfed__entityCache(maxAge: 60) { + store: Store! + name: String! + } + type Store { + id: ID! + } + `), + version, + ); + expect(warnings).toHaveLength(0); + }); + }); + + // ─── @openfed__cacheInvalidate ───────────────────────────────────────────────────────── + // @openfed__cacheInvalidate on a Mutation/Subscription field tells the router to evict the + // returned entity from the cache after the operation completes. + + describe('@openfed__cacheInvalidate', () => { + test('error: @openfed__cacheInvalidate on a Query field — eviction only applies to side-effect operations', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { + product(id: ID!): Product @openfed__cacheInvalidate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(CACHE_INVALIDATE, 'Query.product', FIRST_ORDINAL, [ + cacheInvalidateOnNonMutationSubscriptionFieldErrorMessage('Query.product'), + ]), + ); + }); + + test('error: return type is not a cached entity — nothing to evict', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { dummy: String! } + type Mutation { + updateProduct(id: ID!): Result @openfed__cacheInvalidate + } + type Result { success: Boolean! } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(CACHE_INVALIDATE, 'Mutation.updateProduct', FIRST_ORDINAL, [ + cacheInvalidateOnNonEntityReturnTypeErrorMessage('Mutation.updateProduct', 'Result'), + ]), + ); + }); + + test('error: both @openfed__cacheInvalidate and @openfed__cachePopulate on same field — mutually exclusive', () => { + // A mutation can't both evict and write to the cache for the same entity + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { dummy: String! } + type Mutation { + updateProduct(id: ID!): Product @openfed__cacheInvalidate @openfed__cachePopulate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(CACHE_INVALIDATE, 'Mutation.updateProduct', FIRST_ORDINAL, [ + cacheInvalidateAndPopulateMutualExclusionErrorMessage('Mutation.updateProduct'), + ]), + ); + }); + + test('success: @openfed__cacheInvalidate on Mutation returning a cached entity', () => { + const { schema } = normalizeSubgraphSuccess( + subgraph(` + type Query { dummy: String! } + type Mutation { + updateProduct(id: ID!): Product @openfed__cacheInvalidate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(schema).toBeDefined(); + }); + + test('config: produces CacheInvalidateConfig on the Mutation type', () => { + const config = getConfigForType( + subgraph(` + type Query { dummy: String! } + type Mutation { + updateProduct(id: ID!): Product @openfed__cacheInvalidate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + MUTATION, + ); + expect(config).toBeDefined(); + expect(config!.cacheInvalidateConfigurations).toStrictEqual([ + { + fieldName: 'updateProduct', + operationType: MUTATION, + entityTypeName: 'Product', + }, + ] satisfies CacheInvalidateConfig[]); + }); + + test('success: @openfed__cacheInvalidate on Subscription returning a cached entity', () => { + const { schema } = normalizeSubgraphSuccess( + subgraph(` + type Query { dummy: String! } + type Subscription { + itemUpdated: Product @openfed__cacheInvalidate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(schema).toBeDefined(); + }); + + test('config: produces CacheInvalidateConfig on the Subscription type', () => { + const config = getConfigForType( + subgraph(` + type Query { dummy: String! } + type Subscription { + itemUpdated: Product @openfed__cacheInvalidate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + SUBSCRIPTION, + ); + expect(config).toBeDefined(); + expect(config!.cacheInvalidateConfigurations).toStrictEqual([ + { + fieldName: 'itemUpdated', + operationType: SUBSCRIPTION, + entityTypeName: 'Product', + }, + ] satisfies CacheInvalidateConfig[]); + }); + + test('error: return entity has @key but no @openfed__entityCache — must opt into caching', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { dummy: String! } + type Mutation { + updateProduct(id: ID!): Product @openfed__cacheInvalidate + } + type Product @key(fields: "id") { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(CACHE_INVALIDATE, 'Mutation.updateProduct', FIRST_ORDINAL, [ + cacheInvalidateOnNonEntityReturnTypeErrorMessage('Mutation.updateProduct', 'Product'), + ]), + ); + }); + }); + + // ─── @openfed__cachePopulate ─────────────────────────────────────────────────────────── + // @openfed__cachePopulate on a Mutation/Subscription field tells the router to write the + // returned entity into the cache. Optional maxAge overrides the entity's default TTL. + + describe('@openfed__cachePopulate', () => { + test('error: @openfed__cachePopulate on a Query field — population only applies to side-effect operations', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { + product(id: ID!): Product @openfed__cachePopulate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(CACHE_POPULATE, 'Query.product', FIRST_ORDINAL, [ + cachePopulateOnNonMutationSubscriptionFieldErrorMessage('Query.product'), + ]), + ); + }); + + test('error: return type is not a cached entity — nothing to populate', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { dummy: String! } + type Mutation { + createProduct(name: String!): Result @openfed__cachePopulate + } + type Result { success: Boolean! } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(CACHE_POPULATE, 'Mutation.createProduct', FIRST_ORDINAL, [ + cachePopulateOnNonEntityReturnTypeErrorMessage('Mutation.createProduct', 'Result'), + ]), + ); + }); + + test('error: maxAge of zero — if provided, must be positive', () => { + const { errors } = normalizeSubgraphFailure( + subgraph(` + type Query { dummy: String! } + type Mutation { + createProduct(name: String!): Product @openfed__cachePopulate(maxAge: 0) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(errors).toHaveLength(1); + expect(errors[0]).toStrictEqual( + invalidDirectiveError(CACHE_POPULATE, 'Mutation.createProduct', FIRST_ORDINAL, [ + maxAgeNotPositiveIntegerErrorMessage(CACHE_POPULATE, 0), + ]), + ); + }); + + test('config: invalid maxAge does not produce a config (regression)', () => { + // Regression: invalid maxAge previously still pushed a config entry. + // Since composition now fails outright on maxAge: 0, assert the failure surface: + // exactly one error, and it is the invalidDirectiveError for @openfed__cachePopulate. + // The pre-fix bug was that validation failed but the config entry was still emitted + // — which is unobservable on the BatchNormalizationFailure public surface. Asserting + // the failure shape pins the precondition that guards the previously-leaky path. + const result = batchNormalize({ + subgraphs: [ + subgraph(` + type Query { dummy: String! } + type Mutation { + createProduct(name: String!): Product @openfed__cachePopulate(maxAge: 0) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + ], + version: ROUTER_COMPATIBILITY_VERSION_ONE, + }); + expect(result.success).toBe(false); + if (result.success) return; + expect(result.errors).toHaveLength(1); + expect(result.errors[0]).toStrictEqual( + subgraphValidationError('subgraph-a', [ + invalidDirectiveError(CACHE_POPULATE, 'Mutation.createProduct', FIRST_ORDINAL, [ + maxAgeNotPositiveIntegerErrorMessage(CACHE_POPULATE, 0), + ]), + ]), + ); + }); + + test("success: @openfed__cachePopulate without maxAge — uses the entity's default TTL", () => { + const { schema } = normalizeSubgraphSuccess( + subgraph(` + type Query { dummy: String! } + type Mutation { + createProduct(name: String!): Product @openfed__cachePopulate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(schema).toBeDefined(); + }); + + test('success: @openfed__cachePopulate with explicit maxAge override', () => { + const { schema } = normalizeSubgraphSuccess( + subgraph(` + type Query { dummy: String! } + type Mutation { + createProduct(name: String!): Product @openfed__cachePopulate(maxAge: 120) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(schema).toBeDefined(); + }); + + test('config: without maxAge — maxAgeSeconds is undefined (falls back to entity default)', () => { + const config = getConfigForType( + subgraph(` + type Query { dummy: String! } + type Mutation { + createProduct(name: String!): Product @openfed__cachePopulate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + MUTATION, + ); + expect(config).toBeDefined(); + expect(config!.cachePopulateConfigurations).toStrictEqual([ + { + fieldName: 'createProduct', + operationType: MUTATION, + entityTypeName: 'Product', + maxAgeSeconds: undefined, + }, + ] satisfies CachePopulateConfig[]); + }); + + test('config: with explicit maxAge override', () => { + const config = getConfigForType( + subgraph(` + type Query { dummy: String! } + type Mutation { + createProduct(name: String!): Product @openfed__cachePopulate(maxAge: 120) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + MUTATION, + ); + expect(config).toBeDefined(); + expect(config!.cachePopulateConfigurations).toStrictEqual([ + { + fieldName: 'createProduct', + operationType: MUTATION, + entityTypeName: 'Product', + maxAgeSeconds: 120, + }, + ] satisfies CachePopulateConfig[]); + }); + + test('success: @openfed__cachePopulate on Subscription field', () => { + const { schema } = normalizeSubgraphSuccess( + subgraph(` + type Query { dummy: String! } + type Subscription { + itemCreated: Product @openfed__cachePopulate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + version, + ); + expect(schema).toBeDefined(); + }); + + test('config: @openfed__cachePopulate on Subscription produces correct config', () => { + const config = getConfigForType( + subgraph(` + type Query { dummy: String! } + type Subscription { + itemCreated: Product @openfed__cachePopulate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + SUBSCRIPTION, + ); + expect(config).toBeDefined(); + expect(config!.cachePopulateConfigurations).toStrictEqual([ + { + fieldName: 'itemCreated', + operationType: SUBSCRIPTION, + entityTypeName: 'Product', + maxAgeSeconds: undefined, + }, + ] satisfies CachePopulateConfig[]); + }); + }); + + // ─── Federation ─────────────────────────────────────────────────────────────── + // Entity caching directives are subgraph-local — they don't affect federation composition. + // The federated schema should contain the merged types without caching directive artifacts. + + describe('federation', () => { + test('caching directives on one subgraph compose cleanly with a non-caching subgraph', () => { + const cachingSubgraph = subgraph(` + type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `); + const reviewsSubgraph = subgraph( + ` + type Query { + reviews(productId: ID!): [String!]! + } + type Product @key(fields: "id") { + id: ID! + } + `, + 'subgraph-b', + ); + + const { federatedGraphSchema, success } = federateSubgraphsSuccess([cachingSubgraph, reviewsSubgraph], version); + expect(success).toBe(true); + expect(schemaToSortedNormalizedString(federatedGraphSchema)).toBe( + normalizeString( + SCHEMA_QUERY_DEFINITION + + ` + type Product { + id: ID! + name: String! + } + + type Query { + product(id: ID!): Product + reviews(productId: ID!): [String!]! + } + `, + ), + ); + }); + + test('both subgraphs define @openfed__entityCache on the same entity with different TTLs', () => { + const subgraphA = subgraph(` + type Query { product(id: ID!): Product } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `); + const subgraphB = subgraph( + ` + type Query { productByPrice(price: Float!): Product } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 30) { + id: ID! + price: Float! + } + `, + 'subgraph-b', + ); + + const { federatedGraphSchema, success } = federateSubgraphsSuccess([subgraphA, subgraphB], version); + expect(success).toBe(true); + expect(schemaToSortedNormalizedString(federatedGraphSchema)).toBe( + normalizeString( + SCHEMA_QUERY_DEFINITION + + ` + type Product { + id: ID! + name: String! + price: Float! + } + + type Query { + product(id: ID!): Product + productByPrice(price: Float!): Product + } + `, + ), + ); + }); + }); + + // ─── edge cases ─────────────────────────────────────────────────────────────── + // Pin behavior for schema shapes that don't fit the happy-path assumptions in the + // validation method: renamed root types, @inaccessible entities, @key(resolvable: false), + // and @interfaceObject. These regressions are easy to introduce because they look like + // valid OBJECT_TYPE_DEFINITIONs at the AST level. + + describe('edge cases', () => { + // Composition supports `schema { query: MyQuery, mutation: MyMutation, subscription: MySubscription }`. + // Phase 2 captures parentTypeName from the iteration (which is the renamed name) and Phase 1/2 + // attach configs via parentTypeName — never via literal "Query"/"Mutation"/"Subscription". + // A regression here would silently drop every cache config when the schema renames a root type. + + test('config: @openfed__queryCache on a renamed Query root type attaches to the renamed type', () => { + const config = getConfigForType( + subgraph(` + schema { query: MyQuery } + type MyQuery { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + 'MyQuery', + ); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toStrictEqual([ + { + fieldName: 'product', + maxAgeSeconds: 30, + includeHeaders: false, + shadowMode: false, + entityTypeName: 'Product', + entityKeyMappings: [ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['id'] }], + }, + ], + }, + ]); + }); + + test('config: @openfed__cachePopulate on a renamed Mutation root type attaches to the renamed type', () => { + const config = getConfigForType( + subgraph(` + schema { query: MyQuery, mutation: MyMutation } + type MyQuery { product(id: ID!): Product } + type MyMutation { + updateProduct(id: ID!, name: String!): Product @openfed__cachePopulate(maxAge: 120) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + 'MyMutation', + ); + expect(config).toBeDefined(); + expect(config!.cachePopulateConfigurations).toStrictEqual([ + { + fieldName: 'updateProduct', + operationType: MUTATION, + entityTypeName: 'Product', + maxAgeSeconds: 120, + }, + ]); + }); + + test('config: @openfed__cacheInvalidate on a renamed Subscription root type attaches to the renamed type', () => { + const config = getConfigForType( + subgraph(` + schema { query: MyQuery, subscription: MySubscription } + type MyQuery { product(id: ID!): Product } + type MySubscription { + productDeleted: Product! @openfed__cacheInvalidate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + 'MySubscription', + ); + expect(config).toBeDefined(); + expect(config!.cacheInvalidateConfigurations).toStrictEqual([ + { + fieldName: 'productDeleted', + operationType: SUBSCRIPTION, + entityTypeName: 'Product', + }, + ]); + }); + + // @key(resolvable: false) means "this subgraph references the entity but cannot resolve it + // by key from the entities federation field." @openfed__entityCache currently still applies because + // the @key is present — the router can still construct a cache key from the SDL. If we ever + // want to forbid this combination, change Phase 1's `keyFieldSetDatasByTypeName.has(typeName)` + // check to also require at least one resolvable key. + + test('config: @openfed__entityCache on a type with only @key(resolvable: false) is currently accepted', () => { + const config = getConfigForType( + subgraph(` + type Query { product(id: ID!): Product } + type Product @key(fields: "id", resolvable: false) @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + 'Product', + ); + expect(config).toBeDefined(); + expect(config!.entityCacheConfigurations).toStrictEqual([ + { + typeName: 'Product', + maxAgeSeconds: 60, + notFoundCacheTtlSeconds: 0, + includeHeaders: false, + partialCacheLoad: false, + shadowMode: false, + }, + ]); + }); + + // @interfaceObject types are OBJECT_TYPE_DEFINITIONs at the AST level (so Phase 1's filter + // accepts them) but the router treats them as interface representations. Their cache semantics + // aren't defined by the spec yet — pin the current behavior so a future change is intentional. + + test('config: @openfed__entityCache on an @interfaceObject type is currently accepted', () => { + const config = getConfigForType( + subgraph(` + type Query { product(id: ID!): Product } + type Product @key(fields: "id") @interfaceObject @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + 'Product', + ); + expect(config).toBeDefined(); + expect(config!.entityCacheConfigurations).toStrictEqual([ + { + typeName: 'Product', + maxAgeSeconds: 60, + notFoundCacheTtlSeconds: 0, + includeHeaders: false, + partialCacheLoad: false, + shadowMode: false, + }, + ]); + }); + }); + + // ─── @openfed__requestScoped registry membership ───────────────────────────────────────── + // The DIRECTIVE_DEFINITION_BY_NAME registry is the lookup used by normalization to resolve + // directive AST definitions by name. A missing entry silently breaks discovery. + describe('@openfed__requestScoped registry', () => { + test('DIRECTIVE_DEFINITION_BY_NAME[REQUEST_SCOPED] is the REQUEST_SCOPED_DEFINITION AST node', () => { + expect(DIRECTIVE_DEFINITION_BY_NAME.get(REQUEST_SCOPED)).toBe(REQUEST_SCOPED_DEFINITION); + }); + + test('success: @openfed__requestScoped directive is materialized in the normalized subgraph output', () => { + // The registry map DIRECTIVE_DEFINITION_BY_NAME is consumed by + // NormalizationFactory#addDirectiveDefinitionsToDocument when producing the normalized + // output: every directive name seen in the SDL (tracked in referencedDirectiveNames) + // is looked up in the registry, and the resolved AST node is set into + // directiveDefinitionByName. If REQUEST_SCOPED is missing from the registry, the + // resulting NormalizationSuccess.directiveDefinitionByName will NOT contain it — + // this assertion fails under that regression. + const { directiveDefinitionByName } = normalizeSubgraphSuccess( + subgraph(` + type Query { + product(id: ID!): Product + other(id: ID!): Product + } + type Product @key(fields: "id") { + id: ID! @openfed__requestScoped(key: "productId") + name: String! @openfed__requestScoped(key: "productName") + } + `), + version, + ); + expect(directiveDefinitionByName.has(REQUEST_SCOPED)).toBe(true); + expect(directiveDefinitionByName.get(REQUEST_SCOPED)).toBe(REQUEST_SCOPED_DEFINITION); + }); + }); + + // ─── Renamed root types ────────────────────────────────────────────────────── + // Regression coverage: when a subgraph explicitly renames its root operation types + // via `schema { query: MyQueryRoot mutation: MyMutationRoot }` (or via + // `extend schema { ... }`), cache directives on those root fields must be extracted. + // The first walker pass (`upsertDirectiveSchemaAndEntityDefinitions`) populates + // `operationTypeNodeByTypeName` from every `OperationTypeDefinition` node (inside + // SchemaDefinition and SchemaExtension), which runs before + // `validateAndExtractEntityCachingConfigs()`. If that walker population is ever + // removed or re-ordered, every cache config attached to renamed root types would + // silently drop. These tests pin that wiring. + describe('renamed root operation types', () => { + test('config: @openfed__queryCache on a renamed Query root is extracted', () => { + const config = getConfigForType( + subgraph(` + schema { query: MyQueryRoot } + type MyQueryRoot { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + 'MyQueryRoot', + ); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toStrictEqual([ + { + fieldName: 'product', + maxAgeSeconds: 30, + includeHeaders: false, + shadowMode: false, + entityTypeName: 'Product', + entityKeyMappings: [ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['id'] }], + }, + ], + }, + ] satisfies RootFieldCacheConfig[]); + }); + + test('config: @openfed__queryCache on a renamed Query root via schema extension', () => { + const config = getConfigForType( + subgraph(` + extend schema { query: MyQueryRoot } + type MyQueryRoot { + product(id: ID!): Product @openfed__queryCache(maxAge: 30) + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + 'MyQueryRoot', + ); + expect(config).toBeDefined(); + expect(config!.rootFieldCacheConfigurations).toStrictEqual([ + { + fieldName: 'product', + maxAgeSeconds: 30, + includeHeaders: false, + shadowMode: false, + entityTypeName: 'Product', + entityKeyMappings: [ + { + entityTypeName: 'Product', + fieldMappings: [{ entityKeyField: 'id', argumentPath: ['id'] }], + }, + ], + }, + ] satisfies RootFieldCacheConfig[]); + }); + + test('config: @openfed__cacheInvalidate on a renamed Mutation root is extracted', () => { + const config = getConfigForType( + subgraph(` + schema { query: MyQueryRoot mutation: MyMutationRoot } + type MyQueryRoot { + product(id: ID!): Product + } + type MyMutationRoot { + deleteProduct(id: ID!): Product @openfed__cacheInvalidate + } + type Product @key(fields: "id") @openfed__entityCache(maxAge: 60) { + id: ID! + name: String! + } + `), + 'MyMutationRoot', + ); + expect(config).toBeDefined(); + expect(config!.cacheInvalidateConfigurations).toStrictEqual([ + { + fieldName: 'deleteProduct', + operationType: MUTATION, + entityTypeName: 'Product', + }, + ] satisfies CacheInvalidateConfig[]); + }); + }); +}); diff --git a/connect-go/gen/proto/wg/cosmo/node/v1/node.pb.go b/connect-go/gen/proto/wg/cosmo/node/v1/node.pb.go index 1f782ed2c0..1ed923eae4 100644 --- a/connect-go/gen/proto/wg/cosmo/node/v1/node.pb.go +++ b/connect-go/gen/proto/wg/cosmo/node/v1/node.pb.go @@ -1070,8 +1070,15 @@ type DataSourceConfiguration struct { EntityInterfaces []*EntityInterfaceConfiguration `protobuf:"bytes,14,rep,name=entity_interfaces,json=entityInterfaces,proto3" json:"entity_interfaces,omitempty"` InterfaceObjects []*EntityInterfaceConfiguration `protobuf:"bytes,15,rep,name=interface_objects,json=interfaceObjects,proto3" json:"interface_objects,omitempty"` CostConfiguration *CostConfiguration `protobuf:"bytes,16,opt,name=cost_configuration,json=costConfiguration,proto3" json:"cost_configuration,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // Entity caching configurations (from composition directives) + EntityCacheConfigurations []*EntityCacheConfiguration `protobuf:"bytes,17,rep,name=entity_cache_configurations,json=entityCacheConfigurations,proto3" json:"entity_cache_configurations,omitempty"` + RootFieldCacheConfigurations []*RootFieldCacheConfiguration `protobuf:"bytes,18,rep,name=root_field_cache_configurations,json=rootFieldCacheConfigurations,proto3" json:"root_field_cache_configurations,omitempty"` + CachePopulateConfigurations []*CachePopulateConfiguration `protobuf:"bytes,19,rep,name=cache_populate_configurations,json=cachePopulateConfigurations,proto3" json:"cache_populate_configurations,omitempty"` + CacheInvalidateConfigurations []*CacheInvalidateConfiguration `protobuf:"bytes,20,rep,name=cache_invalidate_configurations,json=cacheInvalidateConfigurations,proto3" json:"cache_invalidate_configurations,omitempty"` + // Request-scoped field configurations (from @openfed__requestScoped directive) + RequestScopedFields []*RequestScopedFieldConfiguration `protobuf:"bytes,21,rep,name=request_scoped_fields,json=requestScopedFields,proto3" json:"request_scoped_fields,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DataSourceConfiguration) Reset() { @@ -1216,6 +1223,525 @@ func (x *DataSourceConfiguration) GetCostConfiguration() *CostConfiguration { return nil } +func (x *DataSourceConfiguration) GetEntityCacheConfigurations() []*EntityCacheConfiguration { + if x != nil { + return x.EntityCacheConfigurations + } + return nil +} + +func (x *DataSourceConfiguration) GetRootFieldCacheConfigurations() []*RootFieldCacheConfiguration { + if x != nil { + return x.RootFieldCacheConfigurations + } + return nil +} + +func (x *DataSourceConfiguration) GetCachePopulateConfigurations() []*CachePopulateConfiguration { + if x != nil { + return x.CachePopulateConfigurations + } + return nil +} + +func (x *DataSourceConfiguration) GetCacheInvalidateConfigurations() []*CacheInvalidateConfiguration { + if x != nil { + return x.CacheInvalidateConfigurations + } + return nil +} + +func (x *DataSourceConfiguration) GetRequestScopedFields() []*RequestScopedFieldConfiguration { + if x != nil { + return x.RequestScopedFields + } + return nil +} + +// Per-field declaration for @openfed__requestScoped. All fields in the same subgraph declaring +// @openfed__requestScoped(key: "X") share L1 key "{subgraphName}.X". The first field to resolve +// populates L1; subsequent fields with the same key inject from L1 and can skip their +// fetch when all required sub-fields are present. +type RequestScopedFieldConfiguration struct { + state protoimpl.MessageState `protogen:"open.v1"` + FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` + TypeName string `protobuf:"bytes,2,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` + L1Key string `protobuf:"bytes,3,opt,name=l1_key,json=l1Key,proto3" json:"l1_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RequestScopedFieldConfiguration) Reset() { + *x = RequestScopedFieldConfiguration{} + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RequestScopedFieldConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestScopedFieldConfiguration) ProtoMessage() {} + +func (x *RequestScopedFieldConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RequestScopedFieldConfiguration.ProtoReflect.Descriptor instead. +func (*RequestScopedFieldConfiguration) Descriptor() ([]byte, []int) { + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{12} +} + +func (x *RequestScopedFieldConfiguration) GetFieldName() string { + if x != nil { + return x.FieldName + } + return "" +} + +func (x *RequestScopedFieldConfiguration) GetTypeName() string { + if x != nil { + return x.TypeName + } + return "" +} + +func (x *RequestScopedFieldConfiguration) GetL1Key() string { + if x != nil { + return x.L1Key + } + return "" +} + +type EntityCacheConfiguration struct { + state protoimpl.MessageState `protogen:"open.v1"` + TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` + // TTL for cached entity values. Required: composition rejects values <= 0, + // so omit (zero) does not occur in practice. Interpreted in seconds. + MaxAgeSeconds int64 `protobuf:"varint,2,opt,name=max_age_seconds,json=maxAgeSeconds,proto3" json:"max_age_seconds,omitempty"` + IncludeHeaders bool `protobuf:"varint,3,opt,name=include_headers,json=includeHeaders,proto3" json:"include_headers,omitempty"` + PartialCacheLoad bool `protobuf:"varint,4,opt,name=partial_cache_load,json=partialCacheLoad,proto3" json:"partial_cache_load,omitempty"` + ShadowMode bool `protobuf:"varint,5,opt,name=shadow_mode,json=shadowMode,proto3" json:"shadow_mode,omitempty"` + // TTL for caching "not found" entity responses (entity returned null from + // _entities without errors). Omit or 0 disables negative caching and null + // responses are not cached. Positive values are seconds. Composition rejects + // negative values at schema validation time. + NotFoundCacheTtlSeconds int64 `protobuf:"varint,6,opt,name=not_found_cache_ttl_seconds,json=notFoundCacheTtlSeconds,proto3" json:"not_found_cache_ttl_seconds,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EntityCacheConfiguration) Reset() { + *x = EntityCacheConfiguration{} + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EntityCacheConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntityCacheConfiguration) ProtoMessage() {} + +func (x *EntityCacheConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EntityCacheConfiguration.ProtoReflect.Descriptor instead. +func (*EntityCacheConfiguration) Descriptor() ([]byte, []int) { + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{13} +} + +func (x *EntityCacheConfiguration) GetTypeName() string { + if x != nil { + return x.TypeName + } + return "" +} + +func (x *EntityCacheConfiguration) GetMaxAgeSeconds() int64 { + if x != nil { + return x.MaxAgeSeconds + } + return 0 +} + +func (x *EntityCacheConfiguration) GetIncludeHeaders() bool { + if x != nil { + return x.IncludeHeaders + } + return false +} + +func (x *EntityCacheConfiguration) GetPartialCacheLoad() bool { + if x != nil { + return x.PartialCacheLoad + } + return false +} + +func (x *EntityCacheConfiguration) GetShadowMode() bool { + if x != nil { + return x.ShadowMode + } + return false +} + +func (x *EntityCacheConfiguration) GetNotFoundCacheTtlSeconds() int64 { + if x != nil { + return x.NotFoundCacheTtlSeconds + } + return 0 +} + +type RootFieldCacheConfiguration struct { + state protoimpl.MessageState `protogen:"open.v1"` + FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` + // TTL for cached root-field responses. Required: composition rejects values + // <= 0. Interpreted in seconds. + MaxAgeSeconds int64 `protobuf:"varint,2,opt,name=max_age_seconds,json=maxAgeSeconds,proto3" json:"max_age_seconds,omitempty"` + IncludeHeaders bool `protobuf:"varint,3,opt,name=include_headers,json=includeHeaders,proto3" json:"include_headers,omitempty"` + ShadowMode bool `protobuf:"varint,4,opt,name=shadow_mode,json=shadowMode,proto3" json:"shadow_mode,omitempty"` + EntityTypeName string `protobuf:"bytes,5,opt,name=entity_type_name,json=entityTypeName,proto3" json:"entity_type_name,omitempty"` + EntityKeyMappings []*EntityKeyMapping `protobuf:"bytes,6,rep,name=entity_key_mappings,json=entityKeyMappings,proto3" json:"entity_key_mappings,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RootFieldCacheConfiguration) Reset() { + *x = RootFieldCacheConfiguration{} + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RootFieldCacheConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RootFieldCacheConfiguration) ProtoMessage() {} + +func (x *RootFieldCacheConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RootFieldCacheConfiguration.ProtoReflect.Descriptor instead. +func (*RootFieldCacheConfiguration) Descriptor() ([]byte, []int) { + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{14} +} + +func (x *RootFieldCacheConfiguration) GetFieldName() string { + if x != nil { + return x.FieldName + } + return "" +} + +func (x *RootFieldCacheConfiguration) GetMaxAgeSeconds() int64 { + if x != nil { + return x.MaxAgeSeconds + } + return 0 +} + +func (x *RootFieldCacheConfiguration) GetIncludeHeaders() bool { + if x != nil { + return x.IncludeHeaders + } + return false +} + +func (x *RootFieldCacheConfiguration) GetShadowMode() bool { + if x != nil { + return x.ShadowMode + } + return false +} + +func (x *RootFieldCacheConfiguration) GetEntityTypeName() string { + if x != nil { + return x.EntityTypeName + } + return "" +} + +func (x *RootFieldCacheConfiguration) GetEntityKeyMappings() []*EntityKeyMapping { + if x != nil { + return x.EntityKeyMappings + } + return nil +} + +type EntityKeyMapping struct { + state protoimpl.MessageState `protogen:"open.v1"` + EntityTypeName string `protobuf:"bytes,1,opt,name=entity_type_name,json=entityTypeName,proto3" json:"entity_type_name,omitempty"` + FieldMappings []*EntityCacheFieldMapping `protobuf:"bytes,2,rep,name=field_mappings,json=fieldMappings,proto3" json:"field_mappings,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EntityKeyMapping) Reset() { + *x = EntityKeyMapping{} + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EntityKeyMapping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntityKeyMapping) ProtoMessage() {} + +func (x *EntityKeyMapping) ProtoReflect() protoreflect.Message { + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EntityKeyMapping.ProtoReflect.Descriptor instead. +func (*EntityKeyMapping) Descriptor() ([]byte, []int) { + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{15} +} + +func (x *EntityKeyMapping) GetEntityTypeName() string { + if x != nil { + return x.EntityTypeName + } + return "" +} + +func (x *EntityKeyMapping) GetFieldMappings() []*EntityCacheFieldMapping { + if x != nil { + return x.FieldMappings + } + return nil +} + +type EntityCacheFieldMapping struct { + state protoimpl.MessageState `protogen:"open.v1"` + EntityKeyField string `protobuf:"bytes,1,opt,name=entity_key_field,json=entityKeyField,proto3" json:"entity_key_field,omitempty"` + ArgumentPath []string `protobuf:"bytes,2,rep,name=argument_path,json=argumentPath,proto3" json:"argument_path,omitempty"` + IsBatch bool `protobuf:"varint,3,opt,name=is_batch,json=isBatch,proto3" json:"is_batch,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EntityCacheFieldMapping) Reset() { + *x = EntityCacheFieldMapping{} + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EntityCacheFieldMapping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntityCacheFieldMapping) ProtoMessage() {} + +func (x *EntityCacheFieldMapping) ProtoReflect() protoreflect.Message { + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EntityCacheFieldMapping.ProtoReflect.Descriptor instead. +func (*EntityCacheFieldMapping) Descriptor() ([]byte, []int) { + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{16} +} + +func (x *EntityCacheFieldMapping) GetEntityKeyField() string { + if x != nil { + return x.EntityKeyField + } + return "" +} + +func (x *EntityCacheFieldMapping) GetArgumentPath() []string { + if x != nil { + return x.ArgumentPath + } + return nil +} + +func (x *EntityCacheFieldMapping) GetIsBatch() bool { + if x != nil { + return x.IsBatch + } + return false +} + +type CachePopulateConfiguration struct { + state protoimpl.MessageState `protogen:"open.v1"` + FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` + OperationType string `protobuf:"bytes,2,opt,name=operation_type,json=operationType,proto3" json:"operation_type,omitempty"` + // Optional override TTL for mutation/subscription populate writes. When omit, + // falls back to the target entity's max_age_seconds (for subscriptions) or + // the cache's default TTL (for mutations). Zero is treated as "no override". + // Composition rejects negative values. + MaxAgeSeconds *int64 `protobuf:"varint,3,opt,name=max_age_seconds,json=maxAgeSeconds,proto3,oneof" json:"max_age_seconds,omitempty"` + EntityTypeName string `protobuf:"bytes,4,opt,name=entity_type_name,json=entityTypeName,proto3" json:"entity_type_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CachePopulateConfiguration) Reset() { + *x = CachePopulateConfiguration{} + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CachePopulateConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CachePopulateConfiguration) ProtoMessage() {} + +func (x *CachePopulateConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CachePopulateConfiguration.ProtoReflect.Descriptor instead. +func (*CachePopulateConfiguration) Descriptor() ([]byte, []int) { + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{17} +} + +func (x *CachePopulateConfiguration) GetFieldName() string { + if x != nil { + return x.FieldName + } + return "" +} + +func (x *CachePopulateConfiguration) GetOperationType() string { + if x != nil { + return x.OperationType + } + return "" +} + +func (x *CachePopulateConfiguration) GetMaxAgeSeconds() int64 { + if x != nil && x.MaxAgeSeconds != nil { + return *x.MaxAgeSeconds + } + return 0 +} + +func (x *CachePopulateConfiguration) GetEntityTypeName() string { + if x != nil { + return x.EntityTypeName + } + return "" +} + +type CacheInvalidateConfiguration struct { + state protoimpl.MessageState `protogen:"open.v1"` + FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` + OperationType string `protobuf:"bytes,2,opt,name=operation_type,json=operationType,proto3" json:"operation_type,omitempty"` + EntityTypeName string `protobuf:"bytes,3,opt,name=entity_type_name,json=entityTypeName,proto3" json:"entity_type_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CacheInvalidateConfiguration) Reset() { + *x = CacheInvalidateConfiguration{} + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CacheInvalidateConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CacheInvalidateConfiguration) ProtoMessage() {} + +func (x *CacheInvalidateConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CacheInvalidateConfiguration.ProtoReflect.Descriptor instead. +func (*CacheInvalidateConfiguration) Descriptor() ([]byte, []int) { + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{18} +} + +func (x *CacheInvalidateConfiguration) GetFieldName() string { + if x != nil { + return x.FieldName + } + return "" +} + +func (x *CacheInvalidateConfiguration) GetOperationType() string { + if x != nil { + return x.OperationType + } + return "" +} + +func (x *CacheInvalidateConfiguration) GetEntityTypeName() string { + if x != nil { + return x.EntityTypeName + } + return "" +} + type CostConfiguration struct { state protoimpl.MessageState `protogen:"open.v1"` FieldWeights []*FieldWeightConfiguration `protobuf:"bytes,1,rep,name=field_weights,json=fieldWeights,proto3" json:"field_weights,omitempty"` @@ -1228,7 +1754,7 @@ type CostConfiguration struct { func (x *CostConfiguration) Reset() { *x = CostConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[12] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1240,7 +1766,7 @@ func (x *CostConfiguration) String() string { func (*CostConfiguration) ProtoMessage() {} func (x *CostConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[12] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1253,7 +1779,7 @@ func (x *CostConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use CostConfiguration.ProtoReflect.Descriptor instead. func (*CostConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{12} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{19} } func (x *CostConfiguration) GetFieldWeights() []*FieldWeightConfiguration { @@ -1296,7 +1822,7 @@ type FieldWeightConfiguration struct { func (x *FieldWeightConfiguration) Reset() { *x = FieldWeightConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[13] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1308,7 +1834,7 @@ func (x *FieldWeightConfiguration) String() string { func (*FieldWeightConfiguration) ProtoMessage() {} func (x *FieldWeightConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[13] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1321,7 +1847,7 @@ func (x *FieldWeightConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use FieldWeightConfiguration.ProtoReflect.Descriptor instead. func (*FieldWeightConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{13} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{20} } func (x *FieldWeightConfiguration) GetTypeName() string { @@ -1366,7 +1892,7 @@ type FieldListSizeConfiguration struct { func (x *FieldListSizeConfiguration) Reset() { *x = FieldListSizeConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[14] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1378,7 +1904,7 @@ func (x *FieldListSizeConfiguration) String() string { func (*FieldListSizeConfiguration) ProtoMessage() {} func (x *FieldListSizeConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[14] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1391,7 +1917,7 @@ func (x *FieldListSizeConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use FieldListSizeConfiguration.ProtoReflect.Descriptor instead. func (*FieldListSizeConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{14} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{21} } func (x *FieldListSizeConfiguration) GetTypeName() string { @@ -1446,7 +1972,7 @@ type ArgumentConfiguration struct { func (x *ArgumentConfiguration) Reset() { *x = ArgumentConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[15] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1458,7 +1984,7 @@ func (x *ArgumentConfiguration) String() string { func (*ArgumentConfiguration) ProtoMessage() {} func (x *ArgumentConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[15] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1471,7 +1997,7 @@ func (x *ArgumentConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use ArgumentConfiguration.ProtoReflect.Descriptor instead. func (*ArgumentConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{15} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{22} } func (x *ArgumentConfiguration) GetName() string { @@ -1497,7 +2023,7 @@ type Scopes struct { func (x *Scopes) Reset() { *x = Scopes{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[16] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1509,7 +2035,7 @@ func (x *Scopes) String() string { func (*Scopes) ProtoMessage() {} func (x *Scopes) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[16] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1522,7 +2048,7 @@ func (x *Scopes) ProtoReflect() protoreflect.Message { // Deprecated: Use Scopes.ProtoReflect.Descriptor instead. func (*Scopes) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{16} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{23} } func (x *Scopes) GetRequiredAndScopes() []string { @@ -1543,7 +2069,7 @@ type AuthorizationConfiguration struct { func (x *AuthorizationConfiguration) Reset() { *x = AuthorizationConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[17] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1555,7 +2081,7 @@ func (x *AuthorizationConfiguration) String() string { func (*AuthorizationConfiguration) ProtoMessage() {} func (x *AuthorizationConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[17] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1568,7 +2094,7 @@ func (x *AuthorizationConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use AuthorizationConfiguration.ProtoReflect.Descriptor instead. func (*AuthorizationConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{17} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{24} } func (x *AuthorizationConfiguration) GetRequiresAuthentication() bool { @@ -1605,7 +2131,7 @@ type FieldConfiguration struct { func (x *FieldConfiguration) Reset() { *x = FieldConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[18] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1617,7 +2143,7 @@ func (x *FieldConfiguration) String() string { func (*FieldConfiguration) ProtoMessage() {} func (x *FieldConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[18] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1630,7 +2156,7 @@ func (x *FieldConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use FieldConfiguration.ProtoReflect.Descriptor instead. func (*FieldConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{18} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{25} } func (x *FieldConfiguration) GetTypeName() string { @@ -1678,7 +2204,7 @@ type TypeConfiguration struct { func (x *TypeConfiguration) Reset() { *x = TypeConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[19] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1690,7 +2216,7 @@ func (x *TypeConfiguration) String() string { func (*TypeConfiguration) ProtoMessage() {} func (x *TypeConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[19] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1703,7 +2229,7 @@ func (x *TypeConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use TypeConfiguration.ProtoReflect.Descriptor instead. func (*TypeConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{19} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{26} } func (x *TypeConfiguration) GetTypeName() string { @@ -1732,7 +2258,7 @@ type TypeField struct { func (x *TypeField) Reset() { *x = TypeField{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[20] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1744,7 +2270,7 @@ func (x *TypeField) String() string { func (*TypeField) ProtoMessage() {} func (x *TypeField) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[20] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1757,7 +2283,7 @@ func (x *TypeField) ProtoReflect() protoreflect.Message { // Deprecated: Use TypeField.ProtoReflect.Descriptor instead. func (*TypeField) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{20} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{27} } func (x *TypeField) GetTypeName() string { @@ -1798,7 +2324,7 @@ type FieldCoordinates struct { func (x *FieldCoordinates) Reset() { *x = FieldCoordinates{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[21] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1810,7 +2336,7 @@ func (x *FieldCoordinates) String() string { func (*FieldCoordinates) ProtoMessage() {} func (x *FieldCoordinates) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[21] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1823,7 +2349,7 @@ func (x *FieldCoordinates) ProtoReflect() protoreflect.Message { // Deprecated: Use FieldCoordinates.ProtoReflect.Descriptor instead. func (*FieldCoordinates) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{21} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{28} } func (x *FieldCoordinates) GetFieldName() string { @@ -1850,7 +2376,7 @@ type FieldSetCondition struct { func (x *FieldSetCondition) Reset() { *x = FieldSetCondition{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[22] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1862,7 +2388,7 @@ func (x *FieldSetCondition) String() string { func (*FieldSetCondition) ProtoMessage() {} func (x *FieldSetCondition) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[22] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1875,7 +2401,7 @@ func (x *FieldSetCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use FieldSetCondition.ProtoReflect.Descriptor instead. func (*FieldSetCondition) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{22} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{29} } func (x *FieldSetCondition) GetFieldCoordinatesPath() []*FieldCoordinates { @@ -1905,7 +2431,7 @@ type RequiredField struct { func (x *RequiredField) Reset() { *x = RequiredField{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[23] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1917,7 +2443,7 @@ func (x *RequiredField) String() string { func (*RequiredField) ProtoMessage() {} func (x *RequiredField) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[23] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1930,7 +2456,7 @@ func (x *RequiredField) ProtoReflect() protoreflect.Message { // Deprecated: Use RequiredField.ProtoReflect.Descriptor instead. func (*RequiredField) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{23} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{30} } func (x *RequiredField) GetTypeName() string { @@ -1978,7 +2504,7 @@ type EntityInterfaceConfiguration struct { func (x *EntityInterfaceConfiguration) Reset() { *x = EntityInterfaceConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[24] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1990,7 +2516,7 @@ func (x *EntityInterfaceConfiguration) String() string { func (*EntityInterfaceConfiguration) ProtoMessage() {} func (x *EntityInterfaceConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[24] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2003,7 +2529,7 @@ func (x *EntityInterfaceConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use EntityInterfaceConfiguration.ProtoReflect.Descriptor instead. func (*EntityInterfaceConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{24} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{31} } func (x *EntityInterfaceConfiguration) GetInterfaceTypeName() string { @@ -2046,7 +2572,7 @@ type FetchConfiguration struct { func (x *FetchConfiguration) Reset() { *x = FetchConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[25] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2058,7 +2584,7 @@ func (x *FetchConfiguration) String() string { func (*FetchConfiguration) ProtoMessage() {} func (x *FetchConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[25] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2071,7 +2597,7 @@ func (x *FetchConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use FetchConfiguration.ProtoReflect.Descriptor instead. func (*FetchConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{25} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{32} } func (x *FetchConfiguration) GetUrl() *ConfigurationVariable { @@ -2155,7 +2681,7 @@ type StatusCodeTypeMapping struct { func (x *StatusCodeTypeMapping) Reset() { *x = StatusCodeTypeMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[26] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2167,7 +2693,7 @@ func (x *StatusCodeTypeMapping) String() string { func (*StatusCodeTypeMapping) ProtoMessage() {} func (x *StatusCodeTypeMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[26] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2180,7 +2706,7 @@ func (x *StatusCodeTypeMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusCodeTypeMapping.ProtoReflect.Descriptor instead. func (*StatusCodeTypeMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{26} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{33} } func (x *StatusCodeTypeMapping) GetStatusCode() int64 { @@ -2218,7 +2744,7 @@ type DataSourceCustom_GraphQL struct { func (x *DataSourceCustom_GraphQL) Reset() { *x = DataSourceCustom_GraphQL{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[27] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2230,7 +2756,7 @@ func (x *DataSourceCustom_GraphQL) String() string { func (*DataSourceCustom_GraphQL) ProtoMessage() {} func (x *DataSourceCustom_GraphQL) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[27] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2243,7 +2769,7 @@ func (x *DataSourceCustom_GraphQL) ProtoReflect() protoreflect.Message { // Deprecated: Use DataSourceCustom_GraphQL.ProtoReflect.Descriptor instead. func (*DataSourceCustom_GraphQL) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{27} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{34} } func (x *DataSourceCustom_GraphQL) GetFetch() *FetchConfiguration { @@ -2299,7 +2825,7 @@ type GRPCConfiguration struct { func (x *GRPCConfiguration) Reset() { *x = GRPCConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[28] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2311,7 +2837,7 @@ func (x *GRPCConfiguration) String() string { func (*GRPCConfiguration) ProtoMessage() {} func (x *GRPCConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[28] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2324,7 +2850,7 @@ func (x *GRPCConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use GRPCConfiguration.ProtoReflect.Descriptor instead. func (*GRPCConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{28} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{35} } func (x *GRPCConfiguration) GetMapping() *GRPCMapping { @@ -2358,7 +2884,7 @@ type ImageReference struct { func (x *ImageReference) Reset() { *x = ImageReference{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[29] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2370,7 +2896,7 @@ func (x *ImageReference) String() string { func (*ImageReference) ProtoMessage() {} func (x *ImageReference) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[29] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2383,7 +2909,7 @@ func (x *ImageReference) ProtoReflect() protoreflect.Message { // Deprecated: Use ImageReference.ProtoReflect.Descriptor instead. func (*ImageReference) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{29} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{36} } func (x *ImageReference) GetRepository() string { @@ -2413,7 +2939,7 @@ type PluginConfiguration struct { func (x *PluginConfiguration) Reset() { *x = PluginConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[30] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2425,7 +2951,7 @@ func (x *PluginConfiguration) String() string { func (*PluginConfiguration) ProtoMessage() {} func (x *PluginConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[30] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2438,7 +2964,7 @@ func (x *PluginConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use PluginConfiguration.ProtoReflect.Descriptor instead. func (*PluginConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{30} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{37} } func (x *PluginConfiguration) GetName() string { @@ -2472,7 +2998,7 @@ type SSLConfiguration struct { func (x *SSLConfiguration) Reset() { *x = SSLConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[31] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2484,7 +3010,7 @@ func (x *SSLConfiguration) String() string { func (*SSLConfiguration) ProtoMessage() {} func (x *SSLConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[31] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2497,7 +3023,7 @@ func (x *SSLConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use SSLConfiguration.ProtoReflect.Descriptor instead. func (*SSLConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{31} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{38} } func (x *SSLConfiguration) GetEnabled() bool { @@ -2530,7 +3056,7 @@ type GRPCMapping struct { func (x *GRPCMapping) Reset() { *x = GRPCMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[32] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2542,7 +3068,7 @@ func (x *GRPCMapping) String() string { func (*GRPCMapping) ProtoMessage() {} func (x *GRPCMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[32] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2555,7 +3081,7 @@ func (x *GRPCMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use GRPCMapping.ProtoReflect.Descriptor instead. func (*GRPCMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{32} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{39} } func (x *GRPCMapping) GetVersion() int32 { @@ -2626,7 +3152,7 @@ type LookupMapping struct { func (x *LookupMapping) Reset() { *x = LookupMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[33] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2638,7 +3164,7 @@ func (x *LookupMapping) String() string { func (*LookupMapping) ProtoMessage() {} func (x *LookupMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[33] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2651,7 +3177,7 @@ func (x *LookupMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use LookupMapping.ProtoReflect.Descriptor instead. func (*LookupMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{33} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{40} } func (x *LookupMapping) GetType() LookupType { @@ -2702,7 +3228,7 @@ type LookupFieldMapping struct { func (x *LookupFieldMapping) Reset() { *x = LookupFieldMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[34] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2714,7 +3240,7 @@ func (x *LookupFieldMapping) String() string { func (*LookupFieldMapping) ProtoMessage() {} func (x *LookupFieldMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[34] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2727,7 +3253,7 @@ func (x *LookupFieldMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use LookupFieldMapping.ProtoReflect.Descriptor instead. func (*LookupFieldMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{34} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{41} } func (x *LookupFieldMapping) GetType() string { @@ -2763,7 +3289,7 @@ type OperationMapping struct { func (x *OperationMapping) Reset() { *x = OperationMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[35] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2775,7 +3301,7 @@ func (x *OperationMapping) String() string { func (*OperationMapping) ProtoMessage() {} func (x *OperationMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[35] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2788,7 +3314,7 @@ func (x *OperationMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use OperationMapping.ProtoReflect.Descriptor instead. func (*OperationMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{35} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{42} } func (x *OperationMapping) GetType() OperationType { @@ -2849,7 +3375,7 @@ type EntityMapping struct { func (x *EntityMapping) Reset() { *x = EntityMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[36] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2861,7 +3387,7 @@ func (x *EntityMapping) String() string { func (*EntityMapping) ProtoMessage() {} func (x *EntityMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[36] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2874,7 +3400,7 @@ func (x *EntityMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use EntityMapping.ProtoReflect.Descriptor instead. func (*EntityMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{36} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{43} } func (x *EntityMapping) GetTypeName() string { @@ -2942,7 +3468,7 @@ type RequiredFieldMapping struct { func (x *RequiredFieldMapping) Reset() { *x = RequiredFieldMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[37] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2954,7 +3480,7 @@ func (x *RequiredFieldMapping) String() string { func (*RequiredFieldMapping) ProtoMessage() {} func (x *RequiredFieldMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[37] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2967,7 +3493,7 @@ func (x *RequiredFieldMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use RequiredFieldMapping.ProtoReflect.Descriptor instead. func (*RequiredFieldMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{37} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{44} } func (x *RequiredFieldMapping) GetFieldMapping() *FieldMapping { @@ -3011,7 +3537,7 @@ type TypeFieldMapping struct { func (x *TypeFieldMapping) Reset() { *x = TypeFieldMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[38] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3023,7 +3549,7 @@ func (x *TypeFieldMapping) String() string { func (*TypeFieldMapping) ProtoMessage() {} func (x *TypeFieldMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[38] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3036,7 +3562,7 @@ func (x *TypeFieldMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use TypeFieldMapping.ProtoReflect.Descriptor instead. func (*TypeFieldMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{38} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{45} } func (x *TypeFieldMapping) GetType() string { @@ -3068,7 +3594,7 @@ type FieldMapping struct { func (x *FieldMapping) Reset() { *x = FieldMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[39] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3080,7 +3606,7 @@ func (x *FieldMapping) String() string { func (*FieldMapping) ProtoMessage() {} func (x *FieldMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[39] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3093,7 +3619,7 @@ func (x *FieldMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use FieldMapping.ProtoReflect.Descriptor instead. func (*FieldMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{39} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{46} } func (x *FieldMapping) GetOriginal() string { @@ -3130,7 +3656,7 @@ type ArgumentMapping struct { func (x *ArgumentMapping) Reset() { *x = ArgumentMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[40] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3142,7 +3668,7 @@ func (x *ArgumentMapping) String() string { func (*ArgumentMapping) ProtoMessage() {} func (x *ArgumentMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[40] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[47] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3155,7 +3681,7 @@ func (x *ArgumentMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use ArgumentMapping.ProtoReflect.Descriptor instead. func (*ArgumentMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{40} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{47} } func (x *ArgumentMapping) GetOriginal() string { @@ -3182,7 +3708,7 @@ type EnumMapping struct { func (x *EnumMapping) Reset() { *x = EnumMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[41] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3194,7 +3720,7 @@ func (x *EnumMapping) String() string { func (*EnumMapping) ProtoMessage() {} func (x *EnumMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[41] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[48] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3207,7 +3733,7 @@ func (x *EnumMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use EnumMapping.ProtoReflect.Descriptor instead. func (*EnumMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{41} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{48} } func (x *EnumMapping) GetType() string { @@ -3234,7 +3760,7 @@ type EnumValueMapping struct { func (x *EnumValueMapping) Reset() { *x = EnumValueMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[42] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3246,7 +3772,7 @@ func (x *EnumValueMapping) String() string { func (*EnumValueMapping) ProtoMessage() {} func (x *EnumValueMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[42] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[49] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3259,7 +3785,7 @@ func (x *EnumValueMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use EnumValueMapping.ProtoReflect.Descriptor instead. func (*EnumValueMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{42} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{49} } func (x *EnumValueMapping) GetOriginal() string { @@ -3287,7 +3813,7 @@ type NatsStreamConfiguration struct { func (x *NatsStreamConfiguration) Reset() { *x = NatsStreamConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[43] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3299,7 +3825,7 @@ func (x *NatsStreamConfiguration) String() string { func (*NatsStreamConfiguration) ProtoMessage() {} func (x *NatsStreamConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[43] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[50] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3312,7 +3838,7 @@ func (x *NatsStreamConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use NatsStreamConfiguration.ProtoReflect.Descriptor instead. func (*NatsStreamConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{43} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{50} } func (x *NatsStreamConfiguration) GetConsumerName() string { @@ -3347,7 +3873,7 @@ type NatsEventConfiguration struct { func (x *NatsEventConfiguration) Reset() { *x = NatsEventConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[44] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3359,7 +3885,7 @@ func (x *NatsEventConfiguration) String() string { func (*NatsEventConfiguration) ProtoMessage() {} func (x *NatsEventConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[44] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[51] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3372,7 +3898,7 @@ func (x *NatsEventConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use NatsEventConfiguration.ProtoReflect.Descriptor instead. func (*NatsEventConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{44} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{51} } func (x *NatsEventConfiguration) GetEngineEventConfiguration() *EngineEventConfiguration { @@ -3406,7 +3932,7 @@ type KafkaEventConfiguration struct { func (x *KafkaEventConfiguration) Reset() { *x = KafkaEventConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[45] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3418,7 +3944,7 @@ func (x *KafkaEventConfiguration) String() string { func (*KafkaEventConfiguration) ProtoMessage() {} func (x *KafkaEventConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[45] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[52] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3431,7 +3957,7 @@ func (x *KafkaEventConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use KafkaEventConfiguration.ProtoReflect.Descriptor instead. func (*KafkaEventConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{45} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{52} } func (x *KafkaEventConfiguration) GetEngineEventConfiguration() *EngineEventConfiguration { @@ -3458,7 +3984,7 @@ type RedisEventConfiguration struct { func (x *RedisEventConfiguration) Reset() { *x = RedisEventConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[46] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3470,7 +3996,7 @@ func (x *RedisEventConfiguration) String() string { func (*RedisEventConfiguration) ProtoMessage() {} func (x *RedisEventConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[46] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[53] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3483,7 +4009,7 @@ func (x *RedisEventConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use RedisEventConfiguration.ProtoReflect.Descriptor instead. func (*RedisEventConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{46} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{53} } func (x *RedisEventConfiguration) GetEngineEventConfiguration() *EngineEventConfiguration { @@ -3512,7 +4038,7 @@ type EngineEventConfiguration struct { func (x *EngineEventConfiguration) Reset() { *x = EngineEventConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[47] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3524,7 +4050,7 @@ func (x *EngineEventConfiguration) String() string { func (*EngineEventConfiguration) ProtoMessage() {} func (x *EngineEventConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[47] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[54] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3537,7 +4063,7 @@ func (x *EngineEventConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use EngineEventConfiguration.ProtoReflect.Descriptor instead. func (*EngineEventConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{47} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{54} } func (x *EngineEventConfiguration) GetProviderId() string { @@ -3579,7 +4105,7 @@ type DataSourceCustomEvents struct { func (x *DataSourceCustomEvents) Reset() { *x = DataSourceCustomEvents{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[48] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3591,7 +4117,7 @@ func (x *DataSourceCustomEvents) String() string { func (*DataSourceCustomEvents) ProtoMessage() {} func (x *DataSourceCustomEvents) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[48] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[55] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3604,7 +4130,7 @@ func (x *DataSourceCustomEvents) ProtoReflect() protoreflect.Message { // Deprecated: Use DataSourceCustomEvents.ProtoReflect.Descriptor instead. func (*DataSourceCustomEvents) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{48} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{55} } func (x *DataSourceCustomEvents) GetNats() []*NatsEventConfiguration { @@ -3637,7 +4163,7 @@ type DataSourceCustom_Static struct { func (x *DataSourceCustom_Static) Reset() { *x = DataSourceCustom_Static{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[49] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3649,7 +4175,7 @@ func (x *DataSourceCustom_Static) String() string { func (*DataSourceCustom_Static) ProtoMessage() {} func (x *DataSourceCustom_Static) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[49] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[56] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3662,7 +4188,7 @@ func (x *DataSourceCustom_Static) ProtoReflect() protoreflect.Message { // Deprecated: Use DataSourceCustom_Static.ProtoReflect.Descriptor instead. func (*DataSourceCustom_Static) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{49} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{56} } func (x *DataSourceCustom_Static) GetData() *ConfigurationVariable { @@ -3685,7 +4211,7 @@ type ConfigurationVariable struct { func (x *ConfigurationVariable) Reset() { *x = ConfigurationVariable{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[50] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3697,7 +4223,7 @@ func (x *ConfigurationVariable) String() string { func (*ConfigurationVariable) ProtoMessage() {} func (x *ConfigurationVariable) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[50] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[57] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3710,7 +4236,7 @@ func (x *ConfigurationVariable) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfigurationVariable.ProtoReflect.Descriptor instead. func (*ConfigurationVariable) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{50} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{57} } func (x *ConfigurationVariable) GetKind() ConfigurationVariableKind { @@ -3758,7 +4284,7 @@ type DirectiveConfiguration struct { func (x *DirectiveConfiguration) Reset() { *x = DirectiveConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[51] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3770,7 +4296,7 @@ func (x *DirectiveConfiguration) String() string { func (*DirectiveConfiguration) ProtoMessage() {} func (x *DirectiveConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[51] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[58] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3783,7 +4309,7 @@ func (x *DirectiveConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use DirectiveConfiguration.ProtoReflect.Descriptor instead. func (*DirectiveConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{51} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{58} } func (x *DirectiveConfiguration) GetDirectiveName() string { @@ -3810,7 +4336,7 @@ type URLQueryConfiguration struct { func (x *URLQueryConfiguration) Reset() { *x = URLQueryConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[52] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3822,7 +4348,7 @@ func (x *URLQueryConfiguration) String() string { func (*URLQueryConfiguration) ProtoMessage() {} func (x *URLQueryConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[52] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[59] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3835,7 +4361,7 @@ func (x *URLQueryConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use URLQueryConfiguration.ProtoReflect.Descriptor instead. func (*URLQueryConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{52} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{59} } func (x *URLQueryConfiguration) GetName() string { @@ -3861,7 +4387,7 @@ type HTTPHeader struct { func (x *HTTPHeader) Reset() { *x = HTTPHeader{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[53] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3873,7 +4399,7 @@ func (x *HTTPHeader) String() string { func (*HTTPHeader) ProtoMessage() {} func (x *HTTPHeader) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[53] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[60] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3886,7 +4412,7 @@ func (x *HTTPHeader) ProtoReflect() protoreflect.Message { // Deprecated: Use HTTPHeader.ProtoReflect.Descriptor instead. func (*HTTPHeader) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{53} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{60} } func (x *HTTPHeader) GetValues() []*ConfigurationVariable { @@ -3907,7 +4433,7 @@ type MTLSConfiguration struct { func (x *MTLSConfiguration) Reset() { *x = MTLSConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[54] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3919,7 +4445,7 @@ func (x *MTLSConfiguration) String() string { func (*MTLSConfiguration) ProtoMessage() {} func (x *MTLSConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[54] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[61] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3932,7 +4458,7 @@ func (x *MTLSConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use MTLSConfiguration.ProtoReflect.Descriptor instead. func (*MTLSConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{54} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{61} } func (x *MTLSConfiguration) GetKey() *ConfigurationVariable { @@ -3970,7 +4496,7 @@ type GraphQLSubscriptionConfiguration struct { func (x *GraphQLSubscriptionConfiguration) Reset() { *x = GraphQLSubscriptionConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[55] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3982,7 +4508,7 @@ func (x *GraphQLSubscriptionConfiguration) String() string { func (*GraphQLSubscriptionConfiguration) ProtoMessage() {} func (x *GraphQLSubscriptionConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[55] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[62] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3995,7 +4521,7 @@ func (x *GraphQLSubscriptionConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use GraphQLSubscriptionConfiguration.ProtoReflect.Descriptor instead. func (*GraphQLSubscriptionConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{55} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{62} } func (x *GraphQLSubscriptionConfiguration) GetEnabled() bool { @@ -4043,7 +4569,7 @@ type GraphQLFederationConfiguration struct { func (x *GraphQLFederationConfiguration) Reset() { *x = GraphQLFederationConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[56] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4055,7 +4581,7 @@ func (x *GraphQLFederationConfiguration) String() string { func (*GraphQLFederationConfiguration) ProtoMessage() {} func (x *GraphQLFederationConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[56] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[63] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4068,7 +4594,7 @@ func (x *GraphQLFederationConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use GraphQLFederationConfiguration.ProtoReflect.Descriptor instead. func (*GraphQLFederationConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{56} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{63} } func (x *GraphQLFederationConfiguration) GetEnabled() bool { @@ -4095,7 +4621,7 @@ type InternedString struct { func (x *InternedString) Reset() { *x = InternedString{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[57] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4107,7 +4633,7 @@ func (x *InternedString) String() string { func (*InternedString) ProtoMessage() {} func (x *InternedString) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[57] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[64] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4120,7 +4646,7 @@ func (x *InternedString) ProtoReflect() protoreflect.Message { // Deprecated: Use InternedString.ProtoReflect.Descriptor instead. func (*InternedString) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{57} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{64} } func (x *InternedString) GetKey() string { @@ -4140,7 +4666,7 @@ type SingleTypeField struct { func (x *SingleTypeField) Reset() { *x = SingleTypeField{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[58] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4152,7 +4678,7 @@ func (x *SingleTypeField) String() string { func (*SingleTypeField) ProtoMessage() {} func (x *SingleTypeField) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[58] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[65] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4165,7 +4691,7 @@ func (x *SingleTypeField) ProtoReflect() protoreflect.Message { // Deprecated: Use SingleTypeField.ProtoReflect.Descriptor instead. func (*SingleTypeField) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{58} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{65} } func (x *SingleTypeField) GetTypeName() string { @@ -4192,7 +4718,7 @@ type SubscriptionFieldCondition struct { func (x *SubscriptionFieldCondition) Reset() { *x = SubscriptionFieldCondition{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[59] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4204,7 +4730,7 @@ func (x *SubscriptionFieldCondition) String() string { func (*SubscriptionFieldCondition) ProtoMessage() {} func (x *SubscriptionFieldCondition) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[59] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[66] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4217,7 +4743,7 @@ func (x *SubscriptionFieldCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscriptionFieldCondition.ProtoReflect.Descriptor instead. func (*SubscriptionFieldCondition) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{59} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{66} } func (x *SubscriptionFieldCondition) GetFieldPath() []string { @@ -4246,7 +4772,7 @@ type SubscriptionFilterCondition struct { func (x *SubscriptionFilterCondition) Reset() { *x = SubscriptionFilterCondition{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[60] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4258,7 +4784,7 @@ func (x *SubscriptionFilterCondition) String() string { func (*SubscriptionFilterCondition) ProtoMessage() {} func (x *SubscriptionFilterCondition) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[60] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[67] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4271,7 +4797,7 @@ func (x *SubscriptionFilterCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscriptionFilterCondition.ProtoReflect.Descriptor instead. func (*SubscriptionFilterCondition) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{60} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{67} } func (x *SubscriptionFilterCondition) GetAnd() []*SubscriptionFilterCondition { @@ -4311,7 +4837,7 @@ type CacheWarmerOperations struct { func (x *CacheWarmerOperations) Reset() { *x = CacheWarmerOperations{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[61] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4323,7 +4849,7 @@ func (x *CacheWarmerOperations) String() string { func (*CacheWarmerOperations) ProtoMessage() {} func (x *CacheWarmerOperations) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[61] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[68] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4336,7 +4862,7 @@ func (x *CacheWarmerOperations) ProtoReflect() protoreflect.Message { // Deprecated: Use CacheWarmerOperations.ProtoReflect.Descriptor instead. func (*CacheWarmerOperations) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{61} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{68} } func (x *CacheWarmerOperations) GetOperations() []*Operation { @@ -4356,7 +4882,7 @@ type Operation struct { func (x *Operation) Reset() { *x = Operation{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[62] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4368,7 +4894,7 @@ func (x *Operation) String() string { func (*Operation) ProtoMessage() {} func (x *Operation) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[62] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[69] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4381,7 +4907,7 @@ func (x *Operation) ProtoReflect() protoreflect.Message { // Deprecated: Use Operation.ProtoReflect.Descriptor instead. func (*Operation) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{62} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{69} } func (x *Operation) GetRequest() *OperationRequest { @@ -4409,7 +4935,7 @@ type OperationRequest struct { func (x *OperationRequest) Reset() { *x = OperationRequest{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[63] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4421,7 +4947,7 @@ func (x *OperationRequest) String() string { func (*OperationRequest) ProtoMessage() {} func (x *OperationRequest) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[63] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[70] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4434,7 +4960,7 @@ func (x *OperationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use OperationRequest.ProtoReflect.Descriptor instead. func (*OperationRequest) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{63} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{70} } func (x *OperationRequest) GetOperationName() string { @@ -4467,7 +4993,7 @@ type Extension struct { func (x *Extension) Reset() { *x = Extension{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[64] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4479,7 +5005,7 @@ func (x *Extension) String() string { func (*Extension) ProtoMessage() {} func (x *Extension) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[64] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[71] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4492,7 +5018,7 @@ func (x *Extension) ProtoReflect() protoreflect.Message { // Deprecated: Use Extension.ProtoReflect.Descriptor instead. func (*Extension) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{64} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{71} } func (x *Extension) GetPersistedQuery() *PersistedQuery { @@ -4512,7 +5038,7 @@ type PersistedQuery struct { func (x *PersistedQuery) Reset() { *x = PersistedQuery{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[65] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4524,7 +5050,7 @@ func (x *PersistedQuery) String() string { func (*PersistedQuery) ProtoMessage() {} func (x *PersistedQuery) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[65] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[72] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4537,7 +5063,7 @@ func (x *PersistedQuery) ProtoReflect() protoreflect.Message { // Deprecated: Use PersistedQuery.ProtoReflect.Descriptor instead. func (*PersistedQuery) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{65} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{72} } func (x *PersistedQuery) GetSha256Hash() string { @@ -4564,7 +5090,7 @@ type ClientInfo struct { func (x *ClientInfo) Reset() { *x = ClientInfo{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[66] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4576,7 +5102,7 @@ func (x *ClientInfo) String() string { func (*ClientInfo) ProtoMessage() {} func (x *ClientInfo) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[66] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[73] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4589,7 +5115,7 @@ func (x *ClientInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientInfo.ProtoReflect.Descriptor instead. func (*ClientInfo) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{66} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{73} } func (x *ClientInfo) GetName() string { @@ -4661,7 +5187,7 @@ const file_wg_cosmo_node_v1_node_proto_rawDesc = "" + "\x12StringStorageEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\x18\n" + - "\x16_graphql_client_schema\"\xce\b\n" + + "\x16_graphql_client_schema\"\x81\r\n" + "\x17DataSourceConfiguration\x124\n" + "\x04kind\x18\x01 \x01(\x0e2 .wg.cosmo.node.v1.DataSourceKindR\x04kind\x12:\n" + "\n" + @@ -4683,7 +5209,53 @@ const file_wg_cosmo_node_v1_node_proto_rawDesc = "" + "\rcustom_events\x18\r \x01(\v2(.wg.cosmo.node.v1.DataSourceCustomEventsR\fcustomEvents\x12[\n" + "\x11entity_interfaces\x18\x0e \x03(\v2..wg.cosmo.node.v1.EntityInterfaceConfigurationR\x10entityInterfaces\x12[\n" + "\x11interface_objects\x18\x0f \x03(\v2..wg.cosmo.node.v1.EntityInterfaceConfigurationR\x10interfaceObjects\x12R\n" + - "\x12cost_configuration\x18\x10 \x01(\v2#.wg.cosmo.node.v1.CostConfigurationR\x11costConfiguration\"\x98\x04\n" + + "\x12cost_configuration\x18\x10 \x01(\v2#.wg.cosmo.node.v1.CostConfigurationR\x11costConfiguration\x12j\n" + + "\x1bentity_cache_configurations\x18\x11 \x03(\v2*.wg.cosmo.node.v1.EntityCacheConfigurationR\x19entityCacheConfigurations\x12t\n" + + "\x1froot_field_cache_configurations\x18\x12 \x03(\v2-.wg.cosmo.node.v1.RootFieldCacheConfigurationR\x1crootFieldCacheConfigurations\x12p\n" + + "\x1dcache_populate_configurations\x18\x13 \x03(\v2,.wg.cosmo.node.v1.CachePopulateConfigurationR\x1bcachePopulateConfigurations\x12v\n" + + "\x1fcache_invalidate_configurations\x18\x14 \x03(\v2..wg.cosmo.node.v1.CacheInvalidateConfigurationR\x1dcacheInvalidateConfigurations\x12e\n" + + "\x15request_scoped_fields\x18\x15 \x03(\v21.wg.cosmo.node.v1.RequestScopedFieldConfigurationR\x13requestScopedFields\"\x88\x01\n" + + "\x1fRequestScopedFieldConfiguration\x12\x1d\n" + + "\n" + + "field_name\x18\x01 \x01(\tR\tfieldName\x12\x1b\n" + + "\ttype_name\x18\x02 \x01(\tR\btypeName\x12\x15\n" + + "\x06l1_key\x18\x03 \x01(\tR\x05l1KeyJ\x04\b\x04\x10\x05R\fresolve_from\"\xb1\x02\n" + + "\x18EntityCacheConfiguration\x12\x1b\n" + + "\ttype_name\x18\x01 \x01(\tR\btypeName\x12&\n" + + "\x0fmax_age_seconds\x18\x02 \x01(\x03R\rmaxAgeSeconds\x12'\n" + + "\x0finclude_headers\x18\x03 \x01(\bR\x0eincludeHeaders\x12,\n" + + "\x12partial_cache_load\x18\x04 \x01(\bR\x10partialCacheLoad\x12\x1f\n" + + "\vshadow_mode\x18\x05 \x01(\bR\n" + + "shadowMode\x12<\n" + + "\x1bnot_found_cache_ttl_seconds\x18\x06 \x01(\x03R\x17notFoundCacheTtlSecondsR\x1anegative_cache_ttl_seconds\"\xac\x02\n" + + "\x1bRootFieldCacheConfiguration\x12\x1d\n" + + "\n" + + "field_name\x18\x01 \x01(\tR\tfieldName\x12&\n" + + "\x0fmax_age_seconds\x18\x02 \x01(\x03R\rmaxAgeSeconds\x12'\n" + + "\x0finclude_headers\x18\x03 \x01(\bR\x0eincludeHeaders\x12\x1f\n" + + "\vshadow_mode\x18\x04 \x01(\bR\n" + + "shadowMode\x12(\n" + + "\x10entity_type_name\x18\x05 \x01(\tR\x0eentityTypeName\x12R\n" + + "\x13entity_key_mappings\x18\x06 \x03(\v2\".wg.cosmo.node.v1.EntityKeyMappingR\x11entityKeyMappings\"\x8e\x01\n" + + "\x10EntityKeyMapping\x12(\n" + + "\x10entity_type_name\x18\x01 \x01(\tR\x0eentityTypeName\x12P\n" + + "\x0efield_mappings\x18\x02 \x03(\v2).wg.cosmo.node.v1.EntityCacheFieldMappingR\rfieldMappings\"\x83\x01\n" + + "\x17EntityCacheFieldMapping\x12(\n" + + "\x10entity_key_field\x18\x01 \x01(\tR\x0eentityKeyField\x12#\n" + + "\rargument_path\x18\x02 \x03(\tR\fargumentPath\x12\x19\n" + + "\bis_batch\x18\x03 \x01(\bR\aisBatch\"\xcd\x01\n" + + "\x1aCachePopulateConfiguration\x12\x1d\n" + + "\n" + + "field_name\x18\x01 \x01(\tR\tfieldName\x12%\n" + + "\x0eoperation_type\x18\x02 \x01(\tR\roperationType\x12+\n" + + "\x0fmax_age_seconds\x18\x03 \x01(\x03H\x00R\rmaxAgeSeconds\x88\x01\x01\x12(\n" + + "\x10entity_type_name\x18\x04 \x01(\tR\x0eentityTypeNameB\x12\n" + + "\x10_max_age_seconds\"\x8e\x01\n" + + "\x1cCacheInvalidateConfiguration\x12\x1d\n" + + "\n" + + "field_name\x18\x01 \x01(\tR\tfieldName\x12%\n" + + "\x0eoperation_type\x18\x02 \x01(\tR\roperationType\x12(\n" + + "\x10entity_type_name\x18\x03 \x01(\tR\x0eentityTypeName\"\x98\x04\n" + "\x11CostConfiguration\x12O\n" + "\rfield_weights\x18\x01 \x03(\v2*.wg.cosmo.node.v1.FieldWeightConfigurationR\ffieldWeights\x12K\n" + "\n" + @@ -5018,7 +5590,7 @@ func file_wg_cosmo_node_v1_node_proto_rawDescGZIP() []byte { } var file_wg_cosmo_node_v1_node_proto_enumTypes = make([]protoimpl.EnumInfo, 8) -var file_wg_cosmo_node_v1_node_proto_msgTypes = make([]protoimpl.MessageInfo, 73) +var file_wg_cosmo_node_v1_node_proto_msgTypes = make([]protoimpl.MessageInfo, 80) var file_wg_cosmo_node_v1_node_proto_goTypes = []any{ (ArgumentRenderConfiguration)(0), // 0: wg.cosmo.node.v1.ArgumentRenderConfiguration (ArgumentSource)(0), // 1: wg.cosmo.node.v1.ArgumentSource @@ -5040,178 +5612,192 @@ var file_wg_cosmo_node_v1_node_proto_goTypes = []any{ (*SelfRegisterResponse)(nil), // 17: wg.cosmo.node.v1.SelfRegisterResponse (*EngineConfiguration)(nil), // 18: wg.cosmo.node.v1.EngineConfiguration (*DataSourceConfiguration)(nil), // 19: wg.cosmo.node.v1.DataSourceConfiguration - (*CostConfiguration)(nil), // 20: wg.cosmo.node.v1.CostConfiguration - (*FieldWeightConfiguration)(nil), // 21: wg.cosmo.node.v1.FieldWeightConfiguration - (*FieldListSizeConfiguration)(nil), // 22: wg.cosmo.node.v1.FieldListSizeConfiguration - (*ArgumentConfiguration)(nil), // 23: wg.cosmo.node.v1.ArgumentConfiguration - (*Scopes)(nil), // 24: wg.cosmo.node.v1.Scopes - (*AuthorizationConfiguration)(nil), // 25: wg.cosmo.node.v1.AuthorizationConfiguration - (*FieldConfiguration)(nil), // 26: wg.cosmo.node.v1.FieldConfiguration - (*TypeConfiguration)(nil), // 27: wg.cosmo.node.v1.TypeConfiguration - (*TypeField)(nil), // 28: wg.cosmo.node.v1.TypeField - (*FieldCoordinates)(nil), // 29: wg.cosmo.node.v1.FieldCoordinates - (*FieldSetCondition)(nil), // 30: wg.cosmo.node.v1.FieldSetCondition - (*RequiredField)(nil), // 31: wg.cosmo.node.v1.RequiredField - (*EntityInterfaceConfiguration)(nil), // 32: wg.cosmo.node.v1.EntityInterfaceConfiguration - (*FetchConfiguration)(nil), // 33: wg.cosmo.node.v1.FetchConfiguration - (*StatusCodeTypeMapping)(nil), // 34: wg.cosmo.node.v1.StatusCodeTypeMapping - (*DataSourceCustom_GraphQL)(nil), // 35: wg.cosmo.node.v1.DataSourceCustom_GraphQL - (*GRPCConfiguration)(nil), // 36: wg.cosmo.node.v1.GRPCConfiguration - (*ImageReference)(nil), // 37: wg.cosmo.node.v1.ImageReference - (*PluginConfiguration)(nil), // 38: wg.cosmo.node.v1.PluginConfiguration - (*SSLConfiguration)(nil), // 39: wg.cosmo.node.v1.SSLConfiguration - (*GRPCMapping)(nil), // 40: wg.cosmo.node.v1.GRPCMapping - (*LookupMapping)(nil), // 41: wg.cosmo.node.v1.LookupMapping - (*LookupFieldMapping)(nil), // 42: wg.cosmo.node.v1.LookupFieldMapping - (*OperationMapping)(nil), // 43: wg.cosmo.node.v1.OperationMapping - (*EntityMapping)(nil), // 44: wg.cosmo.node.v1.EntityMapping - (*RequiredFieldMapping)(nil), // 45: wg.cosmo.node.v1.RequiredFieldMapping - (*TypeFieldMapping)(nil), // 46: wg.cosmo.node.v1.TypeFieldMapping - (*FieldMapping)(nil), // 47: wg.cosmo.node.v1.FieldMapping - (*ArgumentMapping)(nil), // 48: wg.cosmo.node.v1.ArgumentMapping - (*EnumMapping)(nil), // 49: wg.cosmo.node.v1.EnumMapping - (*EnumValueMapping)(nil), // 50: wg.cosmo.node.v1.EnumValueMapping - (*NatsStreamConfiguration)(nil), // 51: wg.cosmo.node.v1.NatsStreamConfiguration - (*NatsEventConfiguration)(nil), // 52: wg.cosmo.node.v1.NatsEventConfiguration - (*KafkaEventConfiguration)(nil), // 53: wg.cosmo.node.v1.KafkaEventConfiguration - (*RedisEventConfiguration)(nil), // 54: wg.cosmo.node.v1.RedisEventConfiguration - (*EngineEventConfiguration)(nil), // 55: wg.cosmo.node.v1.EngineEventConfiguration - (*DataSourceCustomEvents)(nil), // 56: wg.cosmo.node.v1.DataSourceCustomEvents - (*DataSourceCustom_Static)(nil), // 57: wg.cosmo.node.v1.DataSourceCustom_Static - (*ConfigurationVariable)(nil), // 58: wg.cosmo.node.v1.ConfigurationVariable - (*DirectiveConfiguration)(nil), // 59: wg.cosmo.node.v1.DirectiveConfiguration - (*URLQueryConfiguration)(nil), // 60: wg.cosmo.node.v1.URLQueryConfiguration - (*HTTPHeader)(nil), // 61: wg.cosmo.node.v1.HTTPHeader - (*MTLSConfiguration)(nil), // 62: wg.cosmo.node.v1.MTLSConfiguration - (*GraphQLSubscriptionConfiguration)(nil), // 63: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration - (*GraphQLFederationConfiguration)(nil), // 64: wg.cosmo.node.v1.GraphQLFederationConfiguration - (*InternedString)(nil), // 65: wg.cosmo.node.v1.InternedString - (*SingleTypeField)(nil), // 66: wg.cosmo.node.v1.SingleTypeField - (*SubscriptionFieldCondition)(nil), // 67: wg.cosmo.node.v1.SubscriptionFieldCondition - (*SubscriptionFilterCondition)(nil), // 68: wg.cosmo.node.v1.SubscriptionFilterCondition - (*CacheWarmerOperations)(nil), // 69: wg.cosmo.node.v1.CacheWarmerOperations - (*Operation)(nil), // 70: wg.cosmo.node.v1.Operation - (*OperationRequest)(nil), // 71: wg.cosmo.node.v1.OperationRequest - (*Extension)(nil), // 72: wg.cosmo.node.v1.Extension - (*PersistedQuery)(nil), // 73: wg.cosmo.node.v1.PersistedQuery - (*ClientInfo)(nil), // 74: wg.cosmo.node.v1.ClientInfo - nil, // 75: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.ConfigByFeatureFlagNameEntry - nil, // 76: wg.cosmo.node.v1.EngineConfiguration.StringStorageEntry - nil, // 77: wg.cosmo.node.v1.CostConfiguration.TypeWeightsEntry - nil, // 78: wg.cosmo.node.v1.CostConfiguration.DirectiveArgumentWeightsEntry - nil, // 79: wg.cosmo.node.v1.FieldWeightConfiguration.ArgumentWeightsEntry - nil, // 80: wg.cosmo.node.v1.FetchConfiguration.HeaderEntry - (common.EnumStatusCode)(0), // 81: wg.cosmo.common.EnumStatusCode - (common.GraphQLSubscriptionProtocol)(0), // 82: wg.cosmo.common.GraphQLSubscriptionProtocol - (common.GraphQLWebsocketSubprotocol)(0), // 83: wg.cosmo.common.GraphQLWebsocketSubprotocol + (*RequestScopedFieldConfiguration)(nil), // 20: wg.cosmo.node.v1.RequestScopedFieldConfiguration + (*EntityCacheConfiguration)(nil), // 21: wg.cosmo.node.v1.EntityCacheConfiguration + (*RootFieldCacheConfiguration)(nil), // 22: wg.cosmo.node.v1.RootFieldCacheConfiguration + (*EntityKeyMapping)(nil), // 23: wg.cosmo.node.v1.EntityKeyMapping + (*EntityCacheFieldMapping)(nil), // 24: wg.cosmo.node.v1.EntityCacheFieldMapping + (*CachePopulateConfiguration)(nil), // 25: wg.cosmo.node.v1.CachePopulateConfiguration + (*CacheInvalidateConfiguration)(nil), // 26: wg.cosmo.node.v1.CacheInvalidateConfiguration + (*CostConfiguration)(nil), // 27: wg.cosmo.node.v1.CostConfiguration + (*FieldWeightConfiguration)(nil), // 28: wg.cosmo.node.v1.FieldWeightConfiguration + (*FieldListSizeConfiguration)(nil), // 29: wg.cosmo.node.v1.FieldListSizeConfiguration + (*ArgumentConfiguration)(nil), // 30: wg.cosmo.node.v1.ArgumentConfiguration + (*Scopes)(nil), // 31: wg.cosmo.node.v1.Scopes + (*AuthorizationConfiguration)(nil), // 32: wg.cosmo.node.v1.AuthorizationConfiguration + (*FieldConfiguration)(nil), // 33: wg.cosmo.node.v1.FieldConfiguration + (*TypeConfiguration)(nil), // 34: wg.cosmo.node.v1.TypeConfiguration + (*TypeField)(nil), // 35: wg.cosmo.node.v1.TypeField + (*FieldCoordinates)(nil), // 36: wg.cosmo.node.v1.FieldCoordinates + (*FieldSetCondition)(nil), // 37: wg.cosmo.node.v1.FieldSetCondition + (*RequiredField)(nil), // 38: wg.cosmo.node.v1.RequiredField + (*EntityInterfaceConfiguration)(nil), // 39: wg.cosmo.node.v1.EntityInterfaceConfiguration + (*FetchConfiguration)(nil), // 40: wg.cosmo.node.v1.FetchConfiguration + (*StatusCodeTypeMapping)(nil), // 41: wg.cosmo.node.v1.StatusCodeTypeMapping + (*DataSourceCustom_GraphQL)(nil), // 42: wg.cosmo.node.v1.DataSourceCustom_GraphQL + (*GRPCConfiguration)(nil), // 43: wg.cosmo.node.v1.GRPCConfiguration + (*ImageReference)(nil), // 44: wg.cosmo.node.v1.ImageReference + (*PluginConfiguration)(nil), // 45: wg.cosmo.node.v1.PluginConfiguration + (*SSLConfiguration)(nil), // 46: wg.cosmo.node.v1.SSLConfiguration + (*GRPCMapping)(nil), // 47: wg.cosmo.node.v1.GRPCMapping + (*LookupMapping)(nil), // 48: wg.cosmo.node.v1.LookupMapping + (*LookupFieldMapping)(nil), // 49: wg.cosmo.node.v1.LookupFieldMapping + (*OperationMapping)(nil), // 50: wg.cosmo.node.v1.OperationMapping + (*EntityMapping)(nil), // 51: wg.cosmo.node.v1.EntityMapping + (*RequiredFieldMapping)(nil), // 52: wg.cosmo.node.v1.RequiredFieldMapping + (*TypeFieldMapping)(nil), // 53: wg.cosmo.node.v1.TypeFieldMapping + (*FieldMapping)(nil), // 54: wg.cosmo.node.v1.FieldMapping + (*ArgumentMapping)(nil), // 55: wg.cosmo.node.v1.ArgumentMapping + (*EnumMapping)(nil), // 56: wg.cosmo.node.v1.EnumMapping + (*EnumValueMapping)(nil), // 57: wg.cosmo.node.v1.EnumValueMapping + (*NatsStreamConfiguration)(nil), // 58: wg.cosmo.node.v1.NatsStreamConfiguration + (*NatsEventConfiguration)(nil), // 59: wg.cosmo.node.v1.NatsEventConfiguration + (*KafkaEventConfiguration)(nil), // 60: wg.cosmo.node.v1.KafkaEventConfiguration + (*RedisEventConfiguration)(nil), // 61: wg.cosmo.node.v1.RedisEventConfiguration + (*EngineEventConfiguration)(nil), // 62: wg.cosmo.node.v1.EngineEventConfiguration + (*DataSourceCustomEvents)(nil), // 63: wg.cosmo.node.v1.DataSourceCustomEvents + (*DataSourceCustom_Static)(nil), // 64: wg.cosmo.node.v1.DataSourceCustom_Static + (*ConfigurationVariable)(nil), // 65: wg.cosmo.node.v1.ConfigurationVariable + (*DirectiveConfiguration)(nil), // 66: wg.cosmo.node.v1.DirectiveConfiguration + (*URLQueryConfiguration)(nil), // 67: wg.cosmo.node.v1.URLQueryConfiguration + (*HTTPHeader)(nil), // 68: wg.cosmo.node.v1.HTTPHeader + (*MTLSConfiguration)(nil), // 69: wg.cosmo.node.v1.MTLSConfiguration + (*GraphQLSubscriptionConfiguration)(nil), // 70: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration + (*GraphQLFederationConfiguration)(nil), // 71: wg.cosmo.node.v1.GraphQLFederationConfiguration + (*InternedString)(nil), // 72: wg.cosmo.node.v1.InternedString + (*SingleTypeField)(nil), // 73: wg.cosmo.node.v1.SingleTypeField + (*SubscriptionFieldCondition)(nil), // 74: wg.cosmo.node.v1.SubscriptionFieldCondition + (*SubscriptionFilterCondition)(nil), // 75: wg.cosmo.node.v1.SubscriptionFilterCondition + (*CacheWarmerOperations)(nil), // 76: wg.cosmo.node.v1.CacheWarmerOperations + (*Operation)(nil), // 77: wg.cosmo.node.v1.Operation + (*OperationRequest)(nil), // 78: wg.cosmo.node.v1.OperationRequest + (*Extension)(nil), // 79: wg.cosmo.node.v1.Extension + (*PersistedQuery)(nil), // 80: wg.cosmo.node.v1.PersistedQuery + (*ClientInfo)(nil), // 81: wg.cosmo.node.v1.ClientInfo + nil, // 82: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.ConfigByFeatureFlagNameEntry + nil, // 83: wg.cosmo.node.v1.EngineConfiguration.StringStorageEntry + nil, // 84: wg.cosmo.node.v1.CostConfiguration.TypeWeightsEntry + nil, // 85: wg.cosmo.node.v1.CostConfiguration.DirectiveArgumentWeightsEntry + nil, // 86: wg.cosmo.node.v1.FieldWeightConfiguration.ArgumentWeightsEntry + nil, // 87: wg.cosmo.node.v1.FetchConfiguration.HeaderEntry + (common.EnumStatusCode)(0), // 88: wg.cosmo.common.EnumStatusCode + (common.GraphQLSubscriptionProtocol)(0), // 89: wg.cosmo.common.GraphQLSubscriptionProtocol + (common.GraphQLWebsocketSubprotocol)(0), // 90: wg.cosmo.common.GraphQLWebsocketSubprotocol } var file_wg_cosmo_node_v1_node_proto_depIdxs = []int32{ - 75, // 0: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.config_by_feature_flag_name:type_name -> wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.ConfigByFeatureFlagNameEntry + 82, // 0: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.config_by_feature_flag_name:type_name -> wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.ConfigByFeatureFlagNameEntry 18, // 1: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfig.engine_config:type_name -> wg.cosmo.node.v1.EngineConfiguration 8, // 2: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfig.subgraphs:type_name -> wg.cosmo.node.v1.Subgraph 18, // 3: wg.cosmo.node.v1.RouterConfig.engine_config:type_name -> wg.cosmo.node.v1.EngineConfiguration 8, // 4: wg.cosmo.node.v1.RouterConfig.subgraphs:type_name -> wg.cosmo.node.v1.Subgraph 9, // 5: wg.cosmo.node.v1.RouterConfig.feature_flag_configs:type_name -> wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs - 81, // 6: wg.cosmo.node.v1.Response.code:type_name -> wg.cosmo.common.EnumStatusCode + 88, // 6: wg.cosmo.node.v1.Response.code:type_name -> wg.cosmo.common.EnumStatusCode 15, // 7: wg.cosmo.node.v1.RegistrationInfo.account_limits:type_name -> wg.cosmo.node.v1.AccountLimits 12, // 8: wg.cosmo.node.v1.SelfRegisterResponse.response:type_name -> wg.cosmo.node.v1.Response 14, // 9: wg.cosmo.node.v1.SelfRegisterResponse.registrationInfo:type_name -> wg.cosmo.node.v1.RegistrationInfo 19, // 10: wg.cosmo.node.v1.EngineConfiguration.datasource_configurations:type_name -> wg.cosmo.node.v1.DataSourceConfiguration - 26, // 11: wg.cosmo.node.v1.EngineConfiguration.field_configurations:type_name -> wg.cosmo.node.v1.FieldConfiguration - 27, // 12: wg.cosmo.node.v1.EngineConfiguration.type_configurations:type_name -> wg.cosmo.node.v1.TypeConfiguration - 76, // 13: wg.cosmo.node.v1.EngineConfiguration.string_storage:type_name -> wg.cosmo.node.v1.EngineConfiguration.StringStorageEntry + 33, // 11: wg.cosmo.node.v1.EngineConfiguration.field_configurations:type_name -> wg.cosmo.node.v1.FieldConfiguration + 34, // 12: wg.cosmo.node.v1.EngineConfiguration.type_configurations:type_name -> wg.cosmo.node.v1.TypeConfiguration + 83, // 13: wg.cosmo.node.v1.EngineConfiguration.string_storage:type_name -> wg.cosmo.node.v1.EngineConfiguration.StringStorageEntry 2, // 14: wg.cosmo.node.v1.DataSourceConfiguration.kind:type_name -> wg.cosmo.node.v1.DataSourceKind - 28, // 15: wg.cosmo.node.v1.DataSourceConfiguration.root_nodes:type_name -> wg.cosmo.node.v1.TypeField - 28, // 16: wg.cosmo.node.v1.DataSourceConfiguration.child_nodes:type_name -> wg.cosmo.node.v1.TypeField - 35, // 17: wg.cosmo.node.v1.DataSourceConfiguration.custom_graphql:type_name -> wg.cosmo.node.v1.DataSourceCustom_GraphQL - 57, // 18: wg.cosmo.node.v1.DataSourceConfiguration.custom_static:type_name -> wg.cosmo.node.v1.DataSourceCustom_Static - 59, // 19: wg.cosmo.node.v1.DataSourceConfiguration.directives:type_name -> wg.cosmo.node.v1.DirectiveConfiguration - 31, // 20: wg.cosmo.node.v1.DataSourceConfiguration.keys:type_name -> wg.cosmo.node.v1.RequiredField - 31, // 21: wg.cosmo.node.v1.DataSourceConfiguration.provides:type_name -> wg.cosmo.node.v1.RequiredField - 31, // 22: wg.cosmo.node.v1.DataSourceConfiguration.requires:type_name -> wg.cosmo.node.v1.RequiredField - 56, // 23: wg.cosmo.node.v1.DataSourceConfiguration.custom_events:type_name -> wg.cosmo.node.v1.DataSourceCustomEvents - 32, // 24: wg.cosmo.node.v1.DataSourceConfiguration.entity_interfaces:type_name -> wg.cosmo.node.v1.EntityInterfaceConfiguration - 32, // 25: wg.cosmo.node.v1.DataSourceConfiguration.interface_objects:type_name -> wg.cosmo.node.v1.EntityInterfaceConfiguration - 20, // 26: wg.cosmo.node.v1.DataSourceConfiguration.cost_configuration:type_name -> wg.cosmo.node.v1.CostConfiguration - 21, // 27: wg.cosmo.node.v1.CostConfiguration.field_weights:type_name -> wg.cosmo.node.v1.FieldWeightConfiguration - 22, // 28: wg.cosmo.node.v1.CostConfiguration.list_sizes:type_name -> wg.cosmo.node.v1.FieldListSizeConfiguration - 77, // 29: wg.cosmo.node.v1.CostConfiguration.type_weights:type_name -> wg.cosmo.node.v1.CostConfiguration.TypeWeightsEntry - 78, // 30: wg.cosmo.node.v1.CostConfiguration.directive_argument_weights:type_name -> wg.cosmo.node.v1.CostConfiguration.DirectiveArgumentWeightsEntry - 79, // 31: wg.cosmo.node.v1.FieldWeightConfiguration.argument_weights:type_name -> wg.cosmo.node.v1.FieldWeightConfiguration.ArgumentWeightsEntry - 1, // 32: wg.cosmo.node.v1.ArgumentConfiguration.source_type:type_name -> wg.cosmo.node.v1.ArgumentSource - 24, // 33: wg.cosmo.node.v1.AuthorizationConfiguration.required_or_scopes:type_name -> wg.cosmo.node.v1.Scopes - 24, // 34: wg.cosmo.node.v1.AuthorizationConfiguration.required_or_scopes_by_or:type_name -> wg.cosmo.node.v1.Scopes - 23, // 35: wg.cosmo.node.v1.FieldConfiguration.arguments_configuration:type_name -> wg.cosmo.node.v1.ArgumentConfiguration - 25, // 36: wg.cosmo.node.v1.FieldConfiguration.authorization_configuration:type_name -> wg.cosmo.node.v1.AuthorizationConfiguration - 68, // 37: wg.cosmo.node.v1.FieldConfiguration.subscription_filter_condition:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition - 29, // 38: wg.cosmo.node.v1.FieldSetCondition.field_coordinates_path:type_name -> wg.cosmo.node.v1.FieldCoordinates - 30, // 39: wg.cosmo.node.v1.RequiredField.conditions:type_name -> wg.cosmo.node.v1.FieldSetCondition - 58, // 40: wg.cosmo.node.v1.FetchConfiguration.url:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 7, // 41: wg.cosmo.node.v1.FetchConfiguration.method:type_name -> wg.cosmo.node.v1.HTTPMethod - 80, // 42: wg.cosmo.node.v1.FetchConfiguration.header:type_name -> wg.cosmo.node.v1.FetchConfiguration.HeaderEntry - 58, // 43: wg.cosmo.node.v1.FetchConfiguration.body:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 60, // 44: wg.cosmo.node.v1.FetchConfiguration.query:type_name -> wg.cosmo.node.v1.URLQueryConfiguration - 62, // 45: wg.cosmo.node.v1.FetchConfiguration.mtls:type_name -> wg.cosmo.node.v1.MTLSConfiguration - 58, // 46: wg.cosmo.node.v1.FetchConfiguration.base_url:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 58, // 47: wg.cosmo.node.v1.FetchConfiguration.path:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 58, // 48: wg.cosmo.node.v1.FetchConfiguration.http_proxy_url:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 33, // 49: wg.cosmo.node.v1.DataSourceCustom_GraphQL.fetch:type_name -> wg.cosmo.node.v1.FetchConfiguration - 63, // 50: wg.cosmo.node.v1.DataSourceCustom_GraphQL.subscription:type_name -> wg.cosmo.node.v1.GraphQLSubscriptionConfiguration - 64, // 51: wg.cosmo.node.v1.DataSourceCustom_GraphQL.federation:type_name -> wg.cosmo.node.v1.GraphQLFederationConfiguration - 65, // 52: wg.cosmo.node.v1.DataSourceCustom_GraphQL.upstream_schema:type_name -> wg.cosmo.node.v1.InternedString - 66, // 53: wg.cosmo.node.v1.DataSourceCustom_GraphQL.custom_scalar_type_fields:type_name -> wg.cosmo.node.v1.SingleTypeField - 36, // 54: wg.cosmo.node.v1.DataSourceCustom_GraphQL.grpc:type_name -> wg.cosmo.node.v1.GRPCConfiguration - 40, // 55: wg.cosmo.node.v1.GRPCConfiguration.mapping:type_name -> wg.cosmo.node.v1.GRPCMapping - 38, // 56: wg.cosmo.node.v1.GRPCConfiguration.plugin:type_name -> wg.cosmo.node.v1.PluginConfiguration - 37, // 57: wg.cosmo.node.v1.PluginConfiguration.image_reference:type_name -> wg.cosmo.node.v1.ImageReference - 43, // 58: wg.cosmo.node.v1.GRPCMapping.operation_mappings:type_name -> wg.cosmo.node.v1.OperationMapping - 44, // 59: wg.cosmo.node.v1.GRPCMapping.entity_mappings:type_name -> wg.cosmo.node.v1.EntityMapping - 46, // 60: wg.cosmo.node.v1.GRPCMapping.type_field_mappings:type_name -> wg.cosmo.node.v1.TypeFieldMapping - 49, // 61: wg.cosmo.node.v1.GRPCMapping.enum_mappings:type_name -> wg.cosmo.node.v1.EnumMapping - 41, // 62: wg.cosmo.node.v1.GRPCMapping.resolve_mappings:type_name -> wg.cosmo.node.v1.LookupMapping - 3, // 63: wg.cosmo.node.v1.LookupMapping.type:type_name -> wg.cosmo.node.v1.LookupType - 42, // 64: wg.cosmo.node.v1.LookupMapping.lookup_mapping:type_name -> wg.cosmo.node.v1.LookupFieldMapping - 47, // 65: wg.cosmo.node.v1.LookupFieldMapping.field_mapping:type_name -> wg.cosmo.node.v1.FieldMapping - 4, // 66: wg.cosmo.node.v1.OperationMapping.type:type_name -> wg.cosmo.node.v1.OperationType - 45, // 67: wg.cosmo.node.v1.EntityMapping.required_field_mappings:type_name -> wg.cosmo.node.v1.RequiredFieldMapping - 47, // 68: wg.cosmo.node.v1.RequiredFieldMapping.field_mapping:type_name -> wg.cosmo.node.v1.FieldMapping - 47, // 69: wg.cosmo.node.v1.TypeFieldMapping.field_mappings:type_name -> wg.cosmo.node.v1.FieldMapping - 48, // 70: wg.cosmo.node.v1.FieldMapping.argument_mappings:type_name -> wg.cosmo.node.v1.ArgumentMapping - 50, // 71: wg.cosmo.node.v1.EnumMapping.values:type_name -> wg.cosmo.node.v1.EnumValueMapping - 55, // 72: wg.cosmo.node.v1.NatsEventConfiguration.engine_event_configuration:type_name -> wg.cosmo.node.v1.EngineEventConfiguration - 51, // 73: wg.cosmo.node.v1.NatsEventConfiguration.stream_configuration:type_name -> wg.cosmo.node.v1.NatsStreamConfiguration - 55, // 74: wg.cosmo.node.v1.KafkaEventConfiguration.engine_event_configuration:type_name -> wg.cosmo.node.v1.EngineEventConfiguration - 55, // 75: wg.cosmo.node.v1.RedisEventConfiguration.engine_event_configuration:type_name -> wg.cosmo.node.v1.EngineEventConfiguration - 5, // 76: wg.cosmo.node.v1.EngineEventConfiguration.type:type_name -> wg.cosmo.node.v1.EventType - 52, // 77: wg.cosmo.node.v1.DataSourceCustomEvents.nats:type_name -> wg.cosmo.node.v1.NatsEventConfiguration - 53, // 78: wg.cosmo.node.v1.DataSourceCustomEvents.kafka:type_name -> wg.cosmo.node.v1.KafkaEventConfiguration - 54, // 79: wg.cosmo.node.v1.DataSourceCustomEvents.redis:type_name -> wg.cosmo.node.v1.RedisEventConfiguration - 58, // 80: wg.cosmo.node.v1.DataSourceCustom_Static.data:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 6, // 81: wg.cosmo.node.v1.ConfigurationVariable.kind:type_name -> wg.cosmo.node.v1.ConfigurationVariableKind - 58, // 82: wg.cosmo.node.v1.HTTPHeader.values:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 58, // 83: wg.cosmo.node.v1.MTLSConfiguration.key:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 58, // 84: wg.cosmo.node.v1.MTLSConfiguration.cert:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 58, // 85: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration.url:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 82, // 86: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration.protocol:type_name -> wg.cosmo.common.GraphQLSubscriptionProtocol - 83, // 87: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration.websocketSubprotocol:type_name -> wg.cosmo.common.GraphQLWebsocketSubprotocol - 68, // 88: wg.cosmo.node.v1.SubscriptionFilterCondition.and:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition - 67, // 89: wg.cosmo.node.v1.SubscriptionFilterCondition.in:type_name -> wg.cosmo.node.v1.SubscriptionFieldCondition - 68, // 90: wg.cosmo.node.v1.SubscriptionFilterCondition.not:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition - 68, // 91: wg.cosmo.node.v1.SubscriptionFilterCondition.or:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition - 70, // 92: wg.cosmo.node.v1.CacheWarmerOperations.operations:type_name -> wg.cosmo.node.v1.Operation - 71, // 93: wg.cosmo.node.v1.Operation.request:type_name -> wg.cosmo.node.v1.OperationRequest - 74, // 94: wg.cosmo.node.v1.Operation.client:type_name -> wg.cosmo.node.v1.ClientInfo - 72, // 95: wg.cosmo.node.v1.OperationRequest.extensions:type_name -> wg.cosmo.node.v1.Extension - 73, // 96: wg.cosmo.node.v1.Extension.persisted_query:type_name -> wg.cosmo.node.v1.PersistedQuery - 10, // 97: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.ConfigByFeatureFlagNameEntry.value:type_name -> wg.cosmo.node.v1.FeatureFlagRouterExecutionConfig - 61, // 98: wg.cosmo.node.v1.FetchConfiguration.HeaderEntry.value:type_name -> wg.cosmo.node.v1.HTTPHeader - 16, // 99: wg.cosmo.node.v1.NodeService.SelfRegister:input_type -> wg.cosmo.node.v1.SelfRegisterRequest - 17, // 100: wg.cosmo.node.v1.NodeService.SelfRegister:output_type -> wg.cosmo.node.v1.SelfRegisterResponse - 100, // [100:101] is the sub-list for method output_type - 99, // [99:100] is the sub-list for method input_type - 99, // [99:99] is the sub-list for extension type_name - 99, // [99:99] is the sub-list for extension extendee - 0, // [0:99] is the sub-list for field type_name + 35, // 15: wg.cosmo.node.v1.DataSourceConfiguration.root_nodes:type_name -> wg.cosmo.node.v1.TypeField + 35, // 16: wg.cosmo.node.v1.DataSourceConfiguration.child_nodes:type_name -> wg.cosmo.node.v1.TypeField + 42, // 17: wg.cosmo.node.v1.DataSourceConfiguration.custom_graphql:type_name -> wg.cosmo.node.v1.DataSourceCustom_GraphQL + 64, // 18: wg.cosmo.node.v1.DataSourceConfiguration.custom_static:type_name -> wg.cosmo.node.v1.DataSourceCustom_Static + 66, // 19: wg.cosmo.node.v1.DataSourceConfiguration.directives:type_name -> wg.cosmo.node.v1.DirectiveConfiguration + 38, // 20: wg.cosmo.node.v1.DataSourceConfiguration.keys:type_name -> wg.cosmo.node.v1.RequiredField + 38, // 21: wg.cosmo.node.v1.DataSourceConfiguration.provides:type_name -> wg.cosmo.node.v1.RequiredField + 38, // 22: wg.cosmo.node.v1.DataSourceConfiguration.requires:type_name -> wg.cosmo.node.v1.RequiredField + 63, // 23: wg.cosmo.node.v1.DataSourceConfiguration.custom_events:type_name -> wg.cosmo.node.v1.DataSourceCustomEvents + 39, // 24: wg.cosmo.node.v1.DataSourceConfiguration.entity_interfaces:type_name -> wg.cosmo.node.v1.EntityInterfaceConfiguration + 39, // 25: wg.cosmo.node.v1.DataSourceConfiguration.interface_objects:type_name -> wg.cosmo.node.v1.EntityInterfaceConfiguration + 27, // 26: wg.cosmo.node.v1.DataSourceConfiguration.cost_configuration:type_name -> wg.cosmo.node.v1.CostConfiguration + 21, // 27: wg.cosmo.node.v1.DataSourceConfiguration.entity_cache_configurations:type_name -> wg.cosmo.node.v1.EntityCacheConfiguration + 22, // 28: wg.cosmo.node.v1.DataSourceConfiguration.root_field_cache_configurations:type_name -> wg.cosmo.node.v1.RootFieldCacheConfiguration + 25, // 29: wg.cosmo.node.v1.DataSourceConfiguration.cache_populate_configurations:type_name -> wg.cosmo.node.v1.CachePopulateConfiguration + 26, // 30: wg.cosmo.node.v1.DataSourceConfiguration.cache_invalidate_configurations:type_name -> wg.cosmo.node.v1.CacheInvalidateConfiguration + 20, // 31: wg.cosmo.node.v1.DataSourceConfiguration.request_scoped_fields:type_name -> wg.cosmo.node.v1.RequestScopedFieldConfiguration + 23, // 32: wg.cosmo.node.v1.RootFieldCacheConfiguration.entity_key_mappings:type_name -> wg.cosmo.node.v1.EntityKeyMapping + 24, // 33: wg.cosmo.node.v1.EntityKeyMapping.field_mappings:type_name -> wg.cosmo.node.v1.EntityCacheFieldMapping + 28, // 34: wg.cosmo.node.v1.CostConfiguration.field_weights:type_name -> wg.cosmo.node.v1.FieldWeightConfiguration + 29, // 35: wg.cosmo.node.v1.CostConfiguration.list_sizes:type_name -> wg.cosmo.node.v1.FieldListSizeConfiguration + 84, // 36: wg.cosmo.node.v1.CostConfiguration.type_weights:type_name -> wg.cosmo.node.v1.CostConfiguration.TypeWeightsEntry + 85, // 37: wg.cosmo.node.v1.CostConfiguration.directive_argument_weights:type_name -> wg.cosmo.node.v1.CostConfiguration.DirectiveArgumentWeightsEntry + 86, // 38: wg.cosmo.node.v1.FieldWeightConfiguration.argument_weights:type_name -> wg.cosmo.node.v1.FieldWeightConfiguration.ArgumentWeightsEntry + 1, // 39: wg.cosmo.node.v1.ArgumentConfiguration.source_type:type_name -> wg.cosmo.node.v1.ArgumentSource + 31, // 40: wg.cosmo.node.v1.AuthorizationConfiguration.required_or_scopes:type_name -> wg.cosmo.node.v1.Scopes + 31, // 41: wg.cosmo.node.v1.AuthorizationConfiguration.required_or_scopes_by_or:type_name -> wg.cosmo.node.v1.Scopes + 30, // 42: wg.cosmo.node.v1.FieldConfiguration.arguments_configuration:type_name -> wg.cosmo.node.v1.ArgumentConfiguration + 32, // 43: wg.cosmo.node.v1.FieldConfiguration.authorization_configuration:type_name -> wg.cosmo.node.v1.AuthorizationConfiguration + 75, // 44: wg.cosmo.node.v1.FieldConfiguration.subscription_filter_condition:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition + 36, // 45: wg.cosmo.node.v1.FieldSetCondition.field_coordinates_path:type_name -> wg.cosmo.node.v1.FieldCoordinates + 37, // 46: wg.cosmo.node.v1.RequiredField.conditions:type_name -> wg.cosmo.node.v1.FieldSetCondition + 65, // 47: wg.cosmo.node.v1.FetchConfiguration.url:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 7, // 48: wg.cosmo.node.v1.FetchConfiguration.method:type_name -> wg.cosmo.node.v1.HTTPMethod + 87, // 49: wg.cosmo.node.v1.FetchConfiguration.header:type_name -> wg.cosmo.node.v1.FetchConfiguration.HeaderEntry + 65, // 50: wg.cosmo.node.v1.FetchConfiguration.body:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 67, // 51: wg.cosmo.node.v1.FetchConfiguration.query:type_name -> wg.cosmo.node.v1.URLQueryConfiguration + 69, // 52: wg.cosmo.node.v1.FetchConfiguration.mtls:type_name -> wg.cosmo.node.v1.MTLSConfiguration + 65, // 53: wg.cosmo.node.v1.FetchConfiguration.base_url:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 65, // 54: wg.cosmo.node.v1.FetchConfiguration.path:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 65, // 55: wg.cosmo.node.v1.FetchConfiguration.http_proxy_url:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 40, // 56: wg.cosmo.node.v1.DataSourceCustom_GraphQL.fetch:type_name -> wg.cosmo.node.v1.FetchConfiguration + 70, // 57: wg.cosmo.node.v1.DataSourceCustom_GraphQL.subscription:type_name -> wg.cosmo.node.v1.GraphQLSubscriptionConfiguration + 71, // 58: wg.cosmo.node.v1.DataSourceCustom_GraphQL.federation:type_name -> wg.cosmo.node.v1.GraphQLFederationConfiguration + 72, // 59: wg.cosmo.node.v1.DataSourceCustom_GraphQL.upstream_schema:type_name -> wg.cosmo.node.v1.InternedString + 73, // 60: wg.cosmo.node.v1.DataSourceCustom_GraphQL.custom_scalar_type_fields:type_name -> wg.cosmo.node.v1.SingleTypeField + 43, // 61: wg.cosmo.node.v1.DataSourceCustom_GraphQL.grpc:type_name -> wg.cosmo.node.v1.GRPCConfiguration + 47, // 62: wg.cosmo.node.v1.GRPCConfiguration.mapping:type_name -> wg.cosmo.node.v1.GRPCMapping + 45, // 63: wg.cosmo.node.v1.GRPCConfiguration.plugin:type_name -> wg.cosmo.node.v1.PluginConfiguration + 44, // 64: wg.cosmo.node.v1.PluginConfiguration.image_reference:type_name -> wg.cosmo.node.v1.ImageReference + 50, // 65: wg.cosmo.node.v1.GRPCMapping.operation_mappings:type_name -> wg.cosmo.node.v1.OperationMapping + 51, // 66: wg.cosmo.node.v1.GRPCMapping.entity_mappings:type_name -> wg.cosmo.node.v1.EntityMapping + 53, // 67: wg.cosmo.node.v1.GRPCMapping.type_field_mappings:type_name -> wg.cosmo.node.v1.TypeFieldMapping + 56, // 68: wg.cosmo.node.v1.GRPCMapping.enum_mappings:type_name -> wg.cosmo.node.v1.EnumMapping + 48, // 69: wg.cosmo.node.v1.GRPCMapping.resolve_mappings:type_name -> wg.cosmo.node.v1.LookupMapping + 3, // 70: wg.cosmo.node.v1.LookupMapping.type:type_name -> wg.cosmo.node.v1.LookupType + 49, // 71: wg.cosmo.node.v1.LookupMapping.lookup_mapping:type_name -> wg.cosmo.node.v1.LookupFieldMapping + 54, // 72: wg.cosmo.node.v1.LookupFieldMapping.field_mapping:type_name -> wg.cosmo.node.v1.FieldMapping + 4, // 73: wg.cosmo.node.v1.OperationMapping.type:type_name -> wg.cosmo.node.v1.OperationType + 52, // 74: wg.cosmo.node.v1.EntityMapping.required_field_mappings:type_name -> wg.cosmo.node.v1.RequiredFieldMapping + 54, // 75: wg.cosmo.node.v1.RequiredFieldMapping.field_mapping:type_name -> wg.cosmo.node.v1.FieldMapping + 54, // 76: wg.cosmo.node.v1.TypeFieldMapping.field_mappings:type_name -> wg.cosmo.node.v1.FieldMapping + 55, // 77: wg.cosmo.node.v1.FieldMapping.argument_mappings:type_name -> wg.cosmo.node.v1.ArgumentMapping + 57, // 78: wg.cosmo.node.v1.EnumMapping.values:type_name -> wg.cosmo.node.v1.EnumValueMapping + 62, // 79: wg.cosmo.node.v1.NatsEventConfiguration.engine_event_configuration:type_name -> wg.cosmo.node.v1.EngineEventConfiguration + 58, // 80: wg.cosmo.node.v1.NatsEventConfiguration.stream_configuration:type_name -> wg.cosmo.node.v1.NatsStreamConfiguration + 62, // 81: wg.cosmo.node.v1.KafkaEventConfiguration.engine_event_configuration:type_name -> wg.cosmo.node.v1.EngineEventConfiguration + 62, // 82: wg.cosmo.node.v1.RedisEventConfiguration.engine_event_configuration:type_name -> wg.cosmo.node.v1.EngineEventConfiguration + 5, // 83: wg.cosmo.node.v1.EngineEventConfiguration.type:type_name -> wg.cosmo.node.v1.EventType + 59, // 84: wg.cosmo.node.v1.DataSourceCustomEvents.nats:type_name -> wg.cosmo.node.v1.NatsEventConfiguration + 60, // 85: wg.cosmo.node.v1.DataSourceCustomEvents.kafka:type_name -> wg.cosmo.node.v1.KafkaEventConfiguration + 61, // 86: wg.cosmo.node.v1.DataSourceCustomEvents.redis:type_name -> wg.cosmo.node.v1.RedisEventConfiguration + 65, // 87: wg.cosmo.node.v1.DataSourceCustom_Static.data:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 6, // 88: wg.cosmo.node.v1.ConfigurationVariable.kind:type_name -> wg.cosmo.node.v1.ConfigurationVariableKind + 65, // 89: wg.cosmo.node.v1.HTTPHeader.values:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 65, // 90: wg.cosmo.node.v1.MTLSConfiguration.key:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 65, // 91: wg.cosmo.node.v1.MTLSConfiguration.cert:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 65, // 92: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration.url:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 89, // 93: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration.protocol:type_name -> wg.cosmo.common.GraphQLSubscriptionProtocol + 90, // 94: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration.websocketSubprotocol:type_name -> wg.cosmo.common.GraphQLWebsocketSubprotocol + 75, // 95: wg.cosmo.node.v1.SubscriptionFilterCondition.and:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition + 74, // 96: wg.cosmo.node.v1.SubscriptionFilterCondition.in:type_name -> wg.cosmo.node.v1.SubscriptionFieldCondition + 75, // 97: wg.cosmo.node.v1.SubscriptionFilterCondition.not:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition + 75, // 98: wg.cosmo.node.v1.SubscriptionFilterCondition.or:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition + 77, // 99: wg.cosmo.node.v1.CacheWarmerOperations.operations:type_name -> wg.cosmo.node.v1.Operation + 78, // 100: wg.cosmo.node.v1.Operation.request:type_name -> wg.cosmo.node.v1.OperationRequest + 81, // 101: wg.cosmo.node.v1.Operation.client:type_name -> wg.cosmo.node.v1.ClientInfo + 79, // 102: wg.cosmo.node.v1.OperationRequest.extensions:type_name -> wg.cosmo.node.v1.Extension + 80, // 103: wg.cosmo.node.v1.Extension.persisted_query:type_name -> wg.cosmo.node.v1.PersistedQuery + 10, // 104: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.ConfigByFeatureFlagNameEntry.value:type_name -> wg.cosmo.node.v1.FeatureFlagRouterExecutionConfig + 68, // 105: wg.cosmo.node.v1.FetchConfiguration.HeaderEntry.value:type_name -> wg.cosmo.node.v1.HTTPHeader + 16, // 106: wg.cosmo.node.v1.NodeService.SelfRegister:input_type -> wg.cosmo.node.v1.SelfRegisterRequest + 17, // 107: wg.cosmo.node.v1.NodeService.SelfRegister:output_type -> wg.cosmo.node.v1.SelfRegisterResponse + 107, // [107:108] is the sub-list for method output_type + 106, // [106:107] is the sub-list for method input_type + 106, // [106:106] is the sub-list for extension type_name + 106, // [106:106] is the sub-list for extension extendee + 0, // [0:106] is the sub-list for field type_name } func init() { file_wg_cosmo_node_v1_node_proto_init() } @@ -5223,20 +5809,21 @@ func file_wg_cosmo_node_v1_node_proto_init() { file_wg_cosmo_node_v1_node_proto_msgTypes[4].OneofWrappers = []any{} file_wg_cosmo_node_v1_node_proto_msgTypes[9].OneofWrappers = []any{} file_wg_cosmo_node_v1_node_proto_msgTypes[10].OneofWrappers = []any{} - file_wg_cosmo_node_v1_node_proto_msgTypes[13].OneofWrappers = []any{} - file_wg_cosmo_node_v1_node_proto_msgTypes[14].OneofWrappers = []any{} - file_wg_cosmo_node_v1_node_proto_msgTypes[18].OneofWrappers = []any{} + file_wg_cosmo_node_v1_node_proto_msgTypes[17].OneofWrappers = []any{} + file_wg_cosmo_node_v1_node_proto_msgTypes[20].OneofWrappers = []any{} + file_wg_cosmo_node_v1_node_proto_msgTypes[21].OneofWrappers = []any{} file_wg_cosmo_node_v1_node_proto_msgTypes[25].OneofWrappers = []any{} - file_wg_cosmo_node_v1_node_proto_msgTypes[30].OneofWrappers = []any{} - file_wg_cosmo_node_v1_node_proto_msgTypes[55].OneofWrappers = []any{} - file_wg_cosmo_node_v1_node_proto_msgTypes[60].OneofWrappers = []any{} + file_wg_cosmo_node_v1_node_proto_msgTypes[32].OneofWrappers = []any{} + file_wg_cosmo_node_v1_node_proto_msgTypes[37].OneofWrappers = []any{} + file_wg_cosmo_node_v1_node_proto_msgTypes[62].OneofWrappers = []any{} + file_wg_cosmo_node_v1_node_proto_msgTypes[67].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_wg_cosmo_node_v1_node_proto_rawDesc), len(file_wg_cosmo_node_v1_node_proto_rawDesc)), NumEnums: 8, - NumMessages: 73, + NumMessages: 80, NumExtensions: 0, NumServices: 1, }, diff --git a/connect/src/wg/cosmo/graphqlmetrics/v1/graphqlmetrics-GraphQLMetricsService_connectquery.ts b/connect/src/wg/cosmo/graphqlmetrics/v1/graphqlmetrics-GraphQLMetricsService_connectquery.ts new file mode 100644 index 0000000000..bfd2418ce3 --- /dev/null +++ b/connect/src/wg/cosmo/graphqlmetrics/v1/graphqlmetrics-GraphQLMetricsService_connectquery.ts @@ -0,0 +1,39 @@ +// https://protobuf.dev/programming-guides/style/ + +// @generated by protoc-gen-connect-query v1.4.1 with parameter "target=ts" +// @generated from file wg/cosmo/graphqlmetrics/v1/graphqlmetrics.proto (package wg.cosmo.graphqlmetrics.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { MethodKind } from "@bufbuild/protobuf"; +import { PublishAggregatedGraphQLRequestMetricsRequest, PublishAggregatedGraphQLRequestMetricsResponse, PublishGraphQLRequestMetricsRequest, PublishOperationCoverageReportResponse } from "./graphqlmetrics_pb.js"; + +/** + * PublishGraphQLMetrics publishes the GraphQL metrics to the metrics service + * + * @generated from rpc wg.cosmo.graphqlmetrics.v1.GraphQLMetricsService.PublishGraphQLMetrics + */ +export const publishGraphQLMetrics = { + localName: "publishGraphQLMetrics", + name: "PublishGraphQLMetrics", + kind: MethodKind.Unary, + I: PublishGraphQLRequestMetricsRequest, + O: PublishOperationCoverageReportResponse, + service: { + typeName: "wg.cosmo.graphqlmetrics.v1.GraphQLMetricsService" + } +} as const; + +/** + * @generated from rpc wg.cosmo.graphqlmetrics.v1.GraphQLMetricsService.PublishAggregatedGraphQLMetrics + */ +export const publishAggregatedGraphQLMetrics = { + localName: "publishAggregatedGraphQLMetrics", + name: "PublishAggregatedGraphQLMetrics", + kind: MethodKind.Unary, + I: PublishAggregatedGraphQLRequestMetricsRequest, + O: PublishAggregatedGraphQLRequestMetricsResponse, + service: { + typeName: "wg.cosmo.graphqlmetrics.v1.GraphQLMetricsService" + } +} as const; diff --git a/connect/src/wg/cosmo/graphqlmetrics/v1/graphqlmetrics_connect.ts b/connect/src/wg/cosmo/graphqlmetrics/v1/graphqlmetrics_connect.ts new file mode 100644 index 0000000000..cf59307f2f --- /dev/null +++ b/connect/src/wg/cosmo/graphqlmetrics/v1/graphqlmetrics_connect.ts @@ -0,0 +1,39 @@ +// https://protobuf.dev/programming-guides/style/ + +// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts" +// @generated from file wg/cosmo/graphqlmetrics/v1/graphqlmetrics.proto (package wg.cosmo.graphqlmetrics.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { PublishAggregatedGraphQLRequestMetricsRequest, PublishAggregatedGraphQLRequestMetricsResponse, PublishGraphQLRequestMetricsRequest, PublishOperationCoverageReportResponse } from "./graphqlmetrics_pb.js"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service wg.cosmo.graphqlmetrics.v1.GraphQLMetricsService + */ +export const GraphQLMetricsService = { + typeName: "wg.cosmo.graphqlmetrics.v1.GraphQLMetricsService", + methods: { + /** + * PublishGraphQLMetrics publishes the GraphQL metrics to the metrics service + * + * @generated from rpc wg.cosmo.graphqlmetrics.v1.GraphQLMetricsService.PublishGraphQLMetrics + */ + publishGraphQLMetrics: { + name: "PublishGraphQLMetrics", + I: PublishGraphQLRequestMetricsRequest, + O: PublishOperationCoverageReportResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc wg.cosmo.graphqlmetrics.v1.GraphQLMetricsService.PublishAggregatedGraphQLMetrics + */ + publishAggregatedGraphQLMetrics: { + name: "PublishAggregatedGraphQLMetrics", + I: PublishAggregatedGraphQLRequestMetricsRequest, + O: PublishAggregatedGraphQLRequestMetricsResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/connect/src/wg/cosmo/graphqlmetrics/v1/graphqlmetrics_pb.ts b/connect/src/wg/cosmo/graphqlmetrics/v1/graphqlmetrics_pb.ts new file mode 100644 index 0000000000..8a168ebf15 --- /dev/null +++ b/connect/src/wg/cosmo/graphqlmetrics/v1/graphqlmetrics_pb.ts @@ -0,0 +1,751 @@ +// https://protobuf.dev/programming-guides/style/ + +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file wg/cosmo/graphqlmetrics/v1/graphqlmetrics.proto (package wg.cosmo.graphqlmetrics.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; + +/** + * @generated from enum wg.cosmo.graphqlmetrics.v1.OperationType + */ +export enum OperationType { + /** + * @generated from enum value: QUERY = 0; + */ + QUERY = 0, + + /** + * @generated from enum value: MUTATION = 1; + */ + MUTATION = 1, + + /** + * @generated from enum value: SUBSCRIPTION = 2; + */ + SUBSCRIPTION = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(OperationType) +proto3.util.setEnumType(OperationType, "wg.cosmo.graphqlmetrics.v1.OperationType", [ + { no: 0, name: "QUERY" }, + { no: 1, name: "MUTATION" }, + { no: 2, name: "SUBSCRIPTION" }, +]); + +/** + * @generated from message wg.cosmo.graphqlmetrics.v1.RequestInfo + */ +export class RequestInfo extends Message { + /** + * @generated from field: int32 StatusCode = 1; + */ + StatusCode = 0; + + /** + * @generated from field: bool error = 2; + */ + error = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.graphqlmetrics.v1.RequestInfo"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "StatusCode", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "error", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RequestInfo { + return new RequestInfo().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RequestInfo { + return new RequestInfo().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RequestInfo { + return new RequestInfo().fromJsonString(jsonString, options); + } + + static equals(a: RequestInfo | PlainMessage | undefined, b: RequestInfo | PlainMessage | undefined): boolean { + return proto3.util.equals(RequestInfo, a, b); + } +} + +/** + * @generated from message wg.cosmo.graphqlmetrics.v1.SchemaUsageInfo + */ +export class SchemaUsageInfo extends Message { + /** + * RequestDocument is the fully normalized GraphQL request document + * + * @generated from field: string RequestDocument = 1; + */ + RequestDocument = ""; + + /** + * TypeFieldMetrics is the list of used fields in the request document + * + * @generated from field: repeated wg.cosmo.graphqlmetrics.v1.TypeFieldUsageInfo TypeFieldMetrics = 2; + */ + TypeFieldMetrics: TypeFieldUsageInfo[] = []; + + /** + * OperationInfo is the operation info + * + * @generated from field: wg.cosmo.graphqlmetrics.v1.OperationInfo OperationInfo = 3; + */ + OperationInfo?: OperationInfo; + + /** + * SchemaInfo is the schema info + * + * @generated from field: wg.cosmo.graphqlmetrics.v1.SchemaInfo SchemaInfo = 4; + */ + SchemaInfo?: SchemaInfo; + + /** + * ClientInfo is the client info + * + * @generated from field: wg.cosmo.graphqlmetrics.v1.ClientInfo ClientInfo = 5; + */ + ClientInfo?: ClientInfo; + + /** + * RequestInfo is the request info + * + * @generated from field: wg.cosmo.graphqlmetrics.v1.RequestInfo RequestInfo = 6; + */ + RequestInfo?: RequestInfo; + + /** + * Attributes is a map of attributes that can be used to filter the metrics + * + * @generated from field: map Attributes = 7; + */ + Attributes: { [key: string]: string } = {}; + + /** + * ArgumentMetrics is the list of used arguments in the request document + * + * @generated from field: repeated wg.cosmo.graphqlmetrics.v1.ArgumentUsageInfo ArgumentMetrics = 8; + */ + ArgumentMetrics: ArgumentUsageInfo[] = []; + + /** + * InputMetrics is the list of used input fields in the request document + * + * @generated from field: repeated wg.cosmo.graphqlmetrics.v1.InputUsageInfo InputMetrics = 9; + */ + InputMetrics: InputUsageInfo[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.graphqlmetrics.v1.SchemaUsageInfo"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "RequestDocument", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "TypeFieldMetrics", kind: "message", T: TypeFieldUsageInfo, repeated: true }, + { no: 3, name: "OperationInfo", kind: "message", T: OperationInfo }, + { no: 4, name: "SchemaInfo", kind: "message", T: SchemaInfo }, + { no: 5, name: "ClientInfo", kind: "message", T: ClientInfo }, + { no: 6, name: "RequestInfo", kind: "message", T: RequestInfo }, + { no: 7, name: "Attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + { no: 8, name: "ArgumentMetrics", kind: "message", T: ArgumentUsageInfo, repeated: true }, + { no: 9, name: "InputMetrics", kind: "message", T: InputUsageInfo, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SchemaUsageInfo { + return new SchemaUsageInfo().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SchemaUsageInfo { + return new SchemaUsageInfo().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SchemaUsageInfo { + return new SchemaUsageInfo().fromJsonString(jsonString, options); + } + + static equals(a: SchemaUsageInfo | PlainMessage | undefined, b: SchemaUsageInfo | PlainMessage | undefined): boolean { + return proto3.util.equals(SchemaUsageInfo, a, b); + } +} + +/** + * @generated from message wg.cosmo.graphqlmetrics.v1.SchemaUsageInfoAggregation + */ +export class SchemaUsageInfoAggregation extends Message { + /** + * @generated from field: wg.cosmo.graphqlmetrics.v1.SchemaUsageInfo SchemaUsage = 1; + */ + SchemaUsage?: SchemaUsageInfo; + + /** + * @generated from field: uint64 RequestCount = 2; + */ + RequestCount = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.graphqlmetrics.v1.SchemaUsageInfoAggregation"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "SchemaUsage", kind: "message", T: SchemaUsageInfo }, + { no: 2, name: "RequestCount", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SchemaUsageInfoAggregation { + return new SchemaUsageInfoAggregation().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SchemaUsageInfoAggregation { + return new SchemaUsageInfoAggregation().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SchemaUsageInfoAggregation { + return new SchemaUsageInfoAggregation().fromJsonString(jsonString, options); + } + + static equals(a: SchemaUsageInfoAggregation | PlainMessage | undefined, b: SchemaUsageInfoAggregation | PlainMessage | undefined): boolean { + return proto3.util.equals(SchemaUsageInfoAggregation, a, b); + } +} + +/** + * @generated from message wg.cosmo.graphqlmetrics.v1.ClientInfo + */ +export class ClientInfo extends Message { + /** + * Name is the GraphQL client name obtained from the request header + * + * @generated from field: string Name = 1; + */ + Name = ""; + + /** + * Version is the GraphQL client version obtained from the request header + * + * @generated from field: string Version = 2; + */ + Version = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.graphqlmetrics.v1.ClientInfo"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "Name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "Version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ClientInfo { + return new ClientInfo().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ClientInfo { + return new ClientInfo().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ClientInfo { + return new ClientInfo().fromJsonString(jsonString, options); + } + + static equals(a: ClientInfo | PlainMessage | undefined, b: ClientInfo | PlainMessage | undefined): boolean { + return proto3.util.equals(ClientInfo, a, b); + } +} + +/** + * @generated from message wg.cosmo.graphqlmetrics.v1.OperationInfo + */ +export class OperationInfo extends Message { + /** + * Hash is the hash of the request document and the operation name + * + * @generated from field: string Hash = 1; + */ + Hash = ""; + + /** + * Name is the operation name + * + * @generated from field: string Name = 2; + */ + Name = ""; + + /** + * Type is the operation type + * + * @generated from field: wg.cosmo.graphqlmetrics.v1.OperationType Type = 3; + */ + Type = OperationType.QUERY; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.graphqlmetrics.v1.OperationInfo"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "Hash", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "Name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "Type", kind: "enum", T: proto3.getEnumType(OperationType) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): OperationInfo { + return new OperationInfo().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): OperationInfo { + return new OperationInfo().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): OperationInfo { + return new OperationInfo().fromJsonString(jsonString, options); + } + + static equals(a: OperationInfo | PlainMessage | undefined, b: OperationInfo | PlainMessage | undefined): boolean { + return proto3.util.equals(OperationInfo, a, b); + } +} + +/** + * FederatedGraphID and OrganizationID are transport over JWT + * + * @generated from message wg.cosmo.graphqlmetrics.v1.SchemaInfo + */ +export class SchemaInfo extends Message { + /** + * Version is the schema version + * + * @generated from field: string Version = 3; + */ + Version = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.graphqlmetrics.v1.SchemaInfo"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 3, name: "Version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SchemaInfo { + return new SchemaInfo().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SchemaInfo { + return new SchemaInfo().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SchemaInfo { + return new SchemaInfo().fromJsonString(jsonString, options); + } + + static equals(a: SchemaInfo | PlainMessage | undefined, b: SchemaInfo | PlainMessage | undefined): boolean { + return proto3.util.equals(SchemaInfo, a, b); + } +} + +/** + * @generated from message wg.cosmo.graphqlmetrics.v1.TypeFieldUsageInfo + */ +export class TypeFieldUsageInfo extends Message { + /** + * Path is the path to the field in the request document but without the root type query, mutation, or subscription + * + * @generated from field: repeated string Path = 1; + */ + Path: string[] = []; + + /** + * TypeNames is the list of enclosing type names of the field + * + * @generated from field: repeated string TypeNames = 2; + */ + TypeNames: string[] = []; + + /** + * SubgraphIDs is the list of datasource IDs (e.g subgraph ID) that the field is used from + * + * @generated from field: repeated string SubgraphIDs = 3; + */ + SubgraphIDs: string[] = []; + + /** + * Count is the number of times the field is used. Useful for batching at client side. + * + * @generated from field: uint64 Count = 4; + */ + Count = protoInt64.zero; + + /** + * NamedType is the underlying type of the field + * + * @generated from field: string NamedType = 5; + */ + NamedType = ""; + + /** + * IndirectInterfaceField is true if the field is an interface field that is used through an implementing type + * + * @generated from field: bool IndirectInterfaceField = 6; + */ + IndirectInterfaceField = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.graphqlmetrics.v1.TypeFieldUsageInfo"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "Path", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 2, name: "TypeNames", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 3, name: "SubgraphIDs", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 4, name: "Count", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 5, name: "NamedType", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "IndirectInterfaceField", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TypeFieldUsageInfo { + return new TypeFieldUsageInfo().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TypeFieldUsageInfo { + return new TypeFieldUsageInfo().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TypeFieldUsageInfo { + return new TypeFieldUsageInfo().fromJsonString(jsonString, options); + } + + static equals(a: TypeFieldUsageInfo | PlainMessage | undefined, b: TypeFieldUsageInfo | PlainMessage | undefined): boolean { + return proto3.util.equals(TypeFieldUsageInfo, a, b); + } +} + +/** + * @generated from message wg.cosmo.graphqlmetrics.v1.ArgumentUsageInfo + */ +export class ArgumentUsageInfo extends Message { + /** + * Path is the path to the field in the request document but without the root type query, mutation, or subscription + * + * @generated from field: repeated string Path = 1; + */ + Path: string[] = []; + + /** + * TypeName is the enclosing type name of the argument + * + * @generated from field: string TypeName = 2; + */ + TypeName = ""; + + /** + * Count is the number of times the argument is used. Useful for batching at client side. + * + * @generated from field: uint64 Count = 3; + */ + Count = protoInt64.zero; + + /** + * NamedType is the underlying type of the argument + * + * @generated from field: string NamedType = 4; + */ + NamedType = ""; + + /** + * SubgraphIDs is the list of datasource IDs (e.g subgraph ID) that the argument is used from + * + * @generated from field: repeated string SubgraphIDs = 5; + */ + SubgraphIDs: string[] = []; + + /** + * IsNull indicates whether this argument was explicitly set to null + * This is critical for detecting breaking changes when optional arguments become required + * + * @generated from field: bool IsNull = 6; + */ + IsNull = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.graphqlmetrics.v1.ArgumentUsageInfo"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "Path", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 2, name: "TypeName", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "Count", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 4, name: "NamedType", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "SubgraphIDs", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 6, name: "IsNull", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ArgumentUsageInfo { + return new ArgumentUsageInfo().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ArgumentUsageInfo { + return new ArgumentUsageInfo().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ArgumentUsageInfo { + return new ArgumentUsageInfo().fromJsonString(jsonString, options); + } + + static equals(a: ArgumentUsageInfo | PlainMessage | undefined, b: ArgumentUsageInfo | PlainMessage | undefined): boolean { + return proto3.util.equals(ArgumentUsageInfo, a, b); + } +} + +/** + * @generated from message wg.cosmo.graphqlmetrics.v1.InputUsageInfo + */ +export class InputUsageInfo extends Message { + /** + * Path is the path to the field in the request document but without the root type query, mutation, or subscription + * + * @generated from field: repeated string Path = 1; + */ + Path: string[] = []; + + /** + * TypeName is the enclosing type name of the argument + * + * @generated from field: string TypeName = 2; + */ + TypeName = ""; + + /** + * Count is the number of times the argument is used. Useful for batching at client side. + * + * @generated from field: uint64 Count = 3; + */ + Count = protoInt64.zero; + + /** + * NamedType is the underlying type of the input field + * + * @generated from field: string NamedType = 4; + */ + NamedType = ""; + + /** + * EnumValues is an empty list if the input field is not an enum, otherwise it contains the list of used enum values + * + * @generated from field: repeated string EnumValues = 5; + */ + EnumValues: string[] = []; + + /** + * SubgraphIDs is the list of datasource IDs (e.g subgraph ID) that the input is used from + * + * @generated from field: repeated string SubgraphIDs = 6; + */ + SubgraphIDs: string[] = []; + + /** + * IsNull indicates whether this input was explicitly or implicitly null + * This is critical for detecting breaking changes when optional fields become required + * + * @generated from field: bool IsNull = 7; + */ + IsNull = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.graphqlmetrics.v1.InputUsageInfo"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "Path", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 2, name: "TypeName", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "Count", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 4, name: "NamedType", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "EnumValues", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 6, name: "SubgraphIDs", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 7, name: "IsNull", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): InputUsageInfo { + return new InputUsageInfo().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): InputUsageInfo { + return new InputUsageInfo().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): InputUsageInfo { + return new InputUsageInfo().fromJsonString(jsonString, options); + } + + static equals(a: InputUsageInfo | PlainMessage | undefined, b: InputUsageInfo | PlainMessage | undefined): boolean { + return proto3.util.equals(InputUsageInfo, a, b); + } +} + +/** + * @generated from message wg.cosmo.graphqlmetrics.v1.PublishGraphQLRequestMetricsRequest + */ +export class PublishGraphQLRequestMetricsRequest extends Message { + /** + * @generated from field: repeated wg.cosmo.graphqlmetrics.v1.SchemaUsageInfo SchemaUsage = 1; + */ + SchemaUsage: SchemaUsageInfo[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.graphqlmetrics.v1.PublishGraphQLRequestMetricsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "SchemaUsage", kind: "message", T: SchemaUsageInfo, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishGraphQLRequestMetricsRequest { + return new PublishGraphQLRequestMetricsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishGraphQLRequestMetricsRequest { + return new PublishGraphQLRequestMetricsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishGraphQLRequestMetricsRequest { + return new PublishGraphQLRequestMetricsRequest().fromJsonString(jsonString, options); + } + + static equals(a: PublishGraphQLRequestMetricsRequest | PlainMessage | undefined, b: PublishGraphQLRequestMetricsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishGraphQLRequestMetricsRequest, a, b); + } +} + +/** + * @generated from message wg.cosmo.graphqlmetrics.v1.PublishOperationCoverageReportResponse + */ +export class PublishOperationCoverageReportResponse extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.graphqlmetrics.v1.PublishOperationCoverageReportResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishOperationCoverageReportResponse { + return new PublishOperationCoverageReportResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishOperationCoverageReportResponse { + return new PublishOperationCoverageReportResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishOperationCoverageReportResponse { + return new PublishOperationCoverageReportResponse().fromJsonString(jsonString, options); + } + + static equals(a: PublishOperationCoverageReportResponse | PlainMessage | undefined, b: PublishOperationCoverageReportResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishOperationCoverageReportResponse, a, b); + } +} + +/** + * @generated from message wg.cosmo.graphqlmetrics.v1.PublishAggregatedGraphQLRequestMetricsRequest + */ +export class PublishAggregatedGraphQLRequestMetricsRequest extends Message { + /** + * @generated from field: repeated wg.cosmo.graphqlmetrics.v1.SchemaUsageInfoAggregation Aggregation = 1; + */ + Aggregation: SchemaUsageInfoAggregation[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.graphqlmetrics.v1.PublishAggregatedGraphQLRequestMetricsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "Aggregation", kind: "message", T: SchemaUsageInfoAggregation, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishAggregatedGraphQLRequestMetricsRequest { + return new PublishAggregatedGraphQLRequestMetricsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishAggregatedGraphQLRequestMetricsRequest { + return new PublishAggregatedGraphQLRequestMetricsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishAggregatedGraphQLRequestMetricsRequest { + return new PublishAggregatedGraphQLRequestMetricsRequest().fromJsonString(jsonString, options); + } + + static equals(a: PublishAggregatedGraphQLRequestMetricsRequest | PlainMessage | undefined, b: PublishAggregatedGraphQLRequestMetricsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishAggregatedGraphQLRequestMetricsRequest, a, b); + } +} + +/** + * @generated from message wg.cosmo.graphqlmetrics.v1.PublishAggregatedGraphQLRequestMetricsResponse + */ +export class PublishAggregatedGraphQLRequestMetricsResponse extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.graphqlmetrics.v1.PublishAggregatedGraphQLRequestMetricsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishAggregatedGraphQLRequestMetricsResponse { + return new PublishAggregatedGraphQLRequestMetricsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishAggregatedGraphQLRequestMetricsResponse { + return new PublishAggregatedGraphQLRequestMetricsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishAggregatedGraphQLRequestMetricsResponse { + return new PublishAggregatedGraphQLRequestMetricsResponse().fromJsonString(jsonString, options); + } + + static equals(a: PublishAggregatedGraphQLRequestMetricsResponse | PlainMessage | undefined, b: PublishAggregatedGraphQLRequestMetricsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishAggregatedGraphQLRequestMetricsResponse, a, b); + } +} + diff --git a/connect/src/wg/cosmo/node/v1/node_pb.ts b/connect/src/wg/cosmo/node/v1/node_pb.ts index 574f362b4c..5e679a9c55 100644 --- a/connect/src/wg/cosmo/node/v1/node_pb.ts +++ b/connect/src/wg/cosmo/node/v1/node_pb.ts @@ -843,6 +843,35 @@ export class DataSourceConfiguration extends Message { */ costConfiguration?: CostConfiguration; + /** + * Entity caching configurations (from composition directives) + * + * @generated from field: repeated wg.cosmo.node.v1.EntityCacheConfiguration entity_cache_configurations = 17; + */ + entityCacheConfigurations: EntityCacheConfiguration[] = []; + + /** + * @generated from field: repeated wg.cosmo.node.v1.RootFieldCacheConfiguration root_field_cache_configurations = 18; + */ + rootFieldCacheConfigurations: RootFieldCacheConfiguration[] = []; + + /** + * @generated from field: repeated wg.cosmo.node.v1.CachePopulateConfiguration cache_populate_configurations = 19; + */ + cachePopulateConfigurations: CachePopulateConfiguration[] = []; + + /** + * @generated from field: repeated wg.cosmo.node.v1.CacheInvalidateConfiguration cache_invalidate_configurations = 20; + */ + cacheInvalidateConfigurations: CacheInvalidateConfiguration[] = []; + + /** + * Request-scoped field configurations (from @openfed__requestScoped directive) + * + * @generated from field: repeated wg.cosmo.node.v1.RequestScopedFieldConfiguration request_scoped_fields = 21; + */ + requestScopedFields: RequestScopedFieldConfiguration[] = []; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -867,6 +896,11 @@ export class DataSourceConfiguration extends Message { { no: 14, name: "entity_interfaces", kind: "message", T: EntityInterfaceConfiguration, repeated: true }, { no: 15, name: "interface_objects", kind: "message", T: EntityInterfaceConfiguration, repeated: true }, { no: 16, name: "cost_configuration", kind: "message", T: CostConfiguration }, + { no: 17, name: "entity_cache_configurations", kind: "message", T: EntityCacheConfiguration, repeated: true }, + { no: 18, name: "root_field_cache_configurations", kind: "message", T: RootFieldCacheConfiguration, repeated: true }, + { no: 19, name: "cache_populate_configurations", kind: "message", T: CachePopulateConfiguration, repeated: true }, + { no: 20, name: "cache_invalidate_configurations", kind: "message", T: CacheInvalidateConfiguration, repeated: true }, + { no: 21, name: "request_scoped_fields", kind: "message", T: RequestScopedFieldConfiguration, repeated: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DataSourceConfiguration { @@ -886,6 +920,406 @@ export class DataSourceConfiguration extends Message { } } +/** + * Per-field declaration for @openfed__requestScoped. All fields in the same subgraph declaring + * @openfed__requestScoped(key: "X") share L1 key "{subgraphName}.X". The first field to resolve + * populates L1; subsequent fields with the same key inject from L1 and can skip their + * fetch when all required sub-fields are present. + * + * @generated from message wg.cosmo.node.v1.RequestScopedFieldConfiguration + */ +export class RequestScopedFieldConfiguration extends Message { + /** + * @generated from field: string field_name = 1; + */ + fieldName = ""; + + /** + * @generated from field: string type_name = 2; + */ + typeName = ""; + + /** + * @generated from field: string l1_key = 3; + */ + l1Key = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.node.v1.RequestScopedFieldConfiguration"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "field_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "type_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "l1_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RequestScopedFieldConfiguration { + return new RequestScopedFieldConfiguration().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RequestScopedFieldConfiguration { + return new RequestScopedFieldConfiguration().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RequestScopedFieldConfiguration { + return new RequestScopedFieldConfiguration().fromJsonString(jsonString, options); + } + + static equals(a: RequestScopedFieldConfiguration | PlainMessage | undefined, b: RequestScopedFieldConfiguration | PlainMessage | undefined): boolean { + return proto3.util.equals(RequestScopedFieldConfiguration, a, b); + } +} + +/** + * @generated from message wg.cosmo.node.v1.EntityCacheConfiguration + */ +export class EntityCacheConfiguration extends Message { + /** + * @generated from field: string type_name = 1; + */ + typeName = ""; + + /** + * TTL for cached entity values. Required: composition rejects values <= 0, + * so omit (zero) does not occur in practice. Interpreted in seconds. + * + * @generated from field: int64 max_age_seconds = 2; + */ + maxAgeSeconds = protoInt64.zero; + + /** + * @generated from field: bool include_headers = 3; + */ + includeHeaders = false; + + /** + * @generated from field: bool partial_cache_load = 4; + */ + partialCacheLoad = false; + + /** + * @generated from field: bool shadow_mode = 5; + */ + shadowMode = false; + + /** + * TTL for caching "not found" entity responses (entity returned null from + * _entities without errors). Omit or 0 disables negative caching and null + * responses are not cached. Positive values are seconds. Composition rejects + * negative values at schema validation time. + * + * @generated from field: int64 not_found_cache_ttl_seconds = 6; + */ + notFoundCacheTtlSeconds = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.node.v1.EntityCacheConfiguration"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "max_age_seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "include_headers", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 4, name: "partial_cache_load", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 5, name: "shadow_mode", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 6, name: "not_found_cache_ttl_seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): EntityCacheConfiguration { + return new EntityCacheConfiguration().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): EntityCacheConfiguration { + return new EntityCacheConfiguration().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): EntityCacheConfiguration { + return new EntityCacheConfiguration().fromJsonString(jsonString, options); + } + + static equals(a: EntityCacheConfiguration | PlainMessage | undefined, b: EntityCacheConfiguration | PlainMessage | undefined): boolean { + return proto3.util.equals(EntityCacheConfiguration, a, b); + } +} + +/** + * @generated from message wg.cosmo.node.v1.RootFieldCacheConfiguration + */ +export class RootFieldCacheConfiguration extends Message { + /** + * @generated from field: string field_name = 1; + */ + fieldName = ""; + + /** + * TTL for cached root-field responses. Required: composition rejects values + * <= 0. Interpreted in seconds. + * + * @generated from field: int64 max_age_seconds = 2; + */ + maxAgeSeconds = protoInt64.zero; + + /** + * @generated from field: bool include_headers = 3; + */ + includeHeaders = false; + + /** + * @generated from field: bool shadow_mode = 4; + */ + shadowMode = false; + + /** + * @generated from field: string entity_type_name = 5; + */ + entityTypeName = ""; + + /** + * @generated from field: repeated wg.cosmo.node.v1.EntityKeyMapping entity_key_mappings = 6; + */ + entityKeyMappings: EntityKeyMapping[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.node.v1.RootFieldCacheConfiguration"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "field_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "max_age_seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "include_headers", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 4, name: "shadow_mode", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 5, name: "entity_type_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "entity_key_mappings", kind: "message", T: EntityKeyMapping, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RootFieldCacheConfiguration { + return new RootFieldCacheConfiguration().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RootFieldCacheConfiguration { + return new RootFieldCacheConfiguration().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RootFieldCacheConfiguration { + return new RootFieldCacheConfiguration().fromJsonString(jsonString, options); + } + + static equals(a: RootFieldCacheConfiguration | PlainMessage | undefined, b: RootFieldCacheConfiguration | PlainMessage | undefined): boolean { + return proto3.util.equals(RootFieldCacheConfiguration, a, b); + } +} + +/** + * @generated from message wg.cosmo.node.v1.EntityKeyMapping + */ +export class EntityKeyMapping extends Message { + /** + * @generated from field: string entity_type_name = 1; + */ + entityTypeName = ""; + + /** + * @generated from field: repeated wg.cosmo.node.v1.EntityCacheFieldMapping field_mappings = 2; + */ + fieldMappings: EntityCacheFieldMapping[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.node.v1.EntityKeyMapping"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "entity_type_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "field_mappings", kind: "message", T: EntityCacheFieldMapping, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): EntityKeyMapping { + return new EntityKeyMapping().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): EntityKeyMapping { + return new EntityKeyMapping().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): EntityKeyMapping { + return new EntityKeyMapping().fromJsonString(jsonString, options); + } + + static equals(a: EntityKeyMapping | PlainMessage | undefined, b: EntityKeyMapping | PlainMessage | undefined): boolean { + return proto3.util.equals(EntityKeyMapping, a, b); + } +} + +/** + * @generated from message wg.cosmo.node.v1.EntityCacheFieldMapping + */ +export class EntityCacheFieldMapping extends Message { + /** + * @generated from field: string entity_key_field = 1; + */ + entityKeyField = ""; + + /** + * @generated from field: repeated string argument_path = 2; + */ + argumentPath: string[] = []; + + /** + * @generated from field: bool is_batch = 3; + */ + isBatch = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.node.v1.EntityCacheFieldMapping"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "entity_key_field", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "argument_path", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 3, name: "is_batch", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): EntityCacheFieldMapping { + return new EntityCacheFieldMapping().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): EntityCacheFieldMapping { + return new EntityCacheFieldMapping().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): EntityCacheFieldMapping { + return new EntityCacheFieldMapping().fromJsonString(jsonString, options); + } + + static equals(a: EntityCacheFieldMapping | PlainMessage | undefined, b: EntityCacheFieldMapping | PlainMessage | undefined): boolean { + return proto3.util.equals(EntityCacheFieldMapping, a, b); + } +} + +/** + * @generated from message wg.cosmo.node.v1.CachePopulateConfiguration + */ +export class CachePopulateConfiguration extends Message { + /** + * @generated from field: string field_name = 1; + */ + fieldName = ""; + + /** + * @generated from field: string operation_type = 2; + */ + operationType = ""; + + /** + * Optional override TTL for mutation/subscription populate writes. When omit, + * falls back to the target entity's max_age_seconds (for subscriptions) or + * the cache's default TTL (for mutations). Zero is treated as "no override". + * Composition rejects negative values. + * + * @generated from field: optional int64 max_age_seconds = 3; + */ + maxAgeSeconds?: bigint; + + /** + * @generated from field: string entity_type_name = 4; + */ + entityTypeName = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.node.v1.CachePopulateConfiguration"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "field_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "operation_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "max_age_seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true }, + { no: 4, name: "entity_type_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CachePopulateConfiguration { + return new CachePopulateConfiguration().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CachePopulateConfiguration { + return new CachePopulateConfiguration().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CachePopulateConfiguration { + return new CachePopulateConfiguration().fromJsonString(jsonString, options); + } + + static equals(a: CachePopulateConfiguration | PlainMessage | undefined, b: CachePopulateConfiguration | PlainMessage | undefined): boolean { + return proto3.util.equals(CachePopulateConfiguration, a, b); + } +} + +/** + * @generated from message wg.cosmo.node.v1.CacheInvalidateConfiguration + */ +export class CacheInvalidateConfiguration extends Message { + /** + * @generated from field: string field_name = 1; + */ + fieldName = ""; + + /** + * @generated from field: string operation_type = 2; + */ + operationType = ""; + + /** + * @generated from field: string entity_type_name = 3; + */ + entityTypeName = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wg.cosmo.node.v1.CacheInvalidateConfiguration"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "field_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "operation_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "entity_type_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CacheInvalidateConfiguration { + return new CacheInvalidateConfiguration().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CacheInvalidateConfiguration { + return new CacheInvalidateConfiguration().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CacheInvalidateConfiguration { + return new CacheInvalidateConfiguration().fromJsonString(jsonString, options); + } + + static equals(a: CacheInvalidateConfiguration | PlainMessage | undefined, b: CacheInvalidateConfiguration | PlainMessage | undefined): boolean { + return proto3.util.equals(CacheInvalidateConfiguration, a, b); + } +} + /** * @generated from message wg.cosmo.node.v1.CostConfiguration */ diff --git a/demo/Makefile b/demo/Makefile index 365f38e172..834a1ca12a 100644 --- a/demo/Makefile +++ b/demo/Makefile @@ -44,6 +44,9 @@ plugin-build-ci: plugin-build-ci-go-binary plugin-build-ci-bun-binary cp -a pkg/subgraphs/projects/bin/* ../router/plugins/projects/bin/ cp -a pkg/subgraphs/courses/bin/* ../router/plugins/courses/bin/ +compose-cache: + $(wgc_router_ci) compose -i ./graph-cache-only.yaml -o ./config-cache-only.json + standalone-compose: $(wgc_router) compose -i ./graph-with-standalone.yaml -o ./configWithStandalone.json pnpx prettier ./configWithStandalone.json -w diff --git a/demo/cmd/all/main.go b/demo/cmd/all/main.go index 0d885a0d95..4a3686901a 100644 --- a/demo/cmd/all/main.go +++ b/demo/cmd/all/main.go @@ -20,6 +20,9 @@ var ( mood = flag.Int("mood", 4008, "Port for mood subgraph") countries = flag.Int("countries", 4009, "Port for countries subgraph") productsFeatureSubgraph = flag.Int("products_fg", 4010, "Port for products feature subgraph") + cacheGraph = flag.Int("cachegraph", 4012, "Port for cachegraph subgraph") + cacheGraphExt = flag.Int("cachegraph_ext", 4013, "Port for cachegraph-ext subgraph") + viewerSubgraph = flag.Int("viewer", 4014, "Port for viewer subgraph") ) func main() { @@ -35,6 +38,9 @@ func main() { Mood: *mood, Countries: *countries, ProductsFG: *productsFeatureSubgraph, + CacheGraph: *cacheGraph, + CacheGraphExt: *cacheGraphExt, + Viewer: *viewerSubgraph, }, EnableDebug: *debug, GetPubSubName: func(name string) string { diff --git a/demo/cmd/cache-demo/main.go b/demo/cmd/cache-demo/main.go new file mode 100644 index 0000000000..f1ee16cc48 --- /dev/null +++ b/demo/cmd/cache-demo/main.go @@ -0,0 +1,55 @@ +// cache-demo runs only the cache-related subgraphs without requiring NATS. +package main + +import ( + "log" + "net/http" + "strconv" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/handler" + "github.com/99designs/gqlgen/graphql/handler/transport" + "github.com/99designs/gqlgen/graphql/playground" + "golang.org/x/sync/errgroup" + + "github.com/wundergraph/cosmo/demo/pkg/injector" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph_ext" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/viewer" +) + +func main() { + servers := []*http.Server{ + gqlServer("cachegraph", 4012, cachegraph.NewSchema()), + gqlServer("cachegraph-ext", 4013, cachegraph_ext.NewSchema()), + viewerServer(4014), + } + + log.Println("Cache demo subgraphs starting (no NATS required):") + log.Println(" cachegraph: http://localhost:4012/") + log.Println(" cachegraph-ext: http://localhost:4013/") + log.Println(" viewer: http://localhost:4014/") + + g := new(errgroup.Group) + for _, srv := range servers { + g.Go(srv.ListenAndServe) + } + log.Fatal(g.Wait()) +} + +func gqlServer(name string, port int, schema graphql.ExecutableSchema) *http.Server { + srv := handler.New(schema) + srv.AddTransport(transport.POST{}) + srv.AddTransport(transport.GET{}) + mux := http.NewServeMux() + mux.Handle("/", playground.Handler(name, "/graphql")) + mux.Handle("/graphql", srv) + return &http.Server{Addr: ":" + strconv.Itoa(port), Handler: injector.Latency(injector.HTTP(mux))} +} + +func viewerServer(port int) *http.Server { + mux := http.NewServeMux() + mux.Handle("/", playground.Handler("viewer", "/graphql")) + mux.Handle("/graphql", viewer.NewHandler()) + return &http.Server{Addr: ":" + strconv.Itoa(port), Handler: injector.Latency(injector.HTTP(mux))} +} diff --git a/demo/cmd/cachegraph/main.go b/demo/cmd/cachegraph/main.go new file mode 100644 index 0000000000..50381505e7 --- /dev/null +++ b/demo/cmd/cachegraph/main.go @@ -0,0 +1,52 @@ +package main + +import ( + "context" + "fmt" + "log" + "net/http" + "os" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/handler/debug" + "github.com/99designs/gqlgen/graphql/playground" + "github.com/ravilushqa/otelgqlgen" + "github.com/rs/cors" + "github.com/wundergraph/cosmo/demo/pkg/injector" + "github.com/wundergraph/cosmo/demo/pkg/otel" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph" + "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" +) + +const ( + defaultPort = "4012" + serviceName = "cachegraph" +) + +func main() { + otel.InitTracing(context.Background(), otel.Options{ServiceName: serviceName}) + port := os.Getenv("PORT") + if port == "" { + port = defaultPort + } + + srv := subgraphs.NewDemoServer(cachegraph.NewSchema()) + srv.Use(&debug.Tracer{}) + srv.Use(otelgqlgen.Middleware(otelgqlgen.WithCreateSpanFromFields(func(ctx *graphql.FieldContext) bool { + return true + }))) + + c := cors.New(cors.Options{ + AllowedOrigins: []string{"*"}, + AllowedHeaders: []string{"*"}, + }) + + http.Handle("/", c.Handler(playground.Handler("GraphQL playground", "/graphql"))) + http.Handle("/graphql", injector.HTTP(c.Handler(otelhttp.NewHandler(srv, "", otelhttp.WithSpanNameFormatter(func(_operation string, r *http.Request) string { + return fmt.Sprintf("%s %s", r.Method, r.URL.Path) + }))))) + + log.Printf("connect to http://localhost:%s/ for GraphQL playground", port) + log.Fatal(http.ListenAndServe(":"+port, nil)) +} diff --git a/demo/config-cache-only.json b/demo/config-cache-only.json new file mode 100644 index 0000000000..eead639dc4 --- /dev/null +++ b/demo/config-cache-only.json @@ -0,0 +1 @@ +{"engineConfig":{"defaultFlushInterval":"500","datasourceConfigurations":[{"kind":"GRAPHQL","rootNodes":[{"typeName":"Query","fieldNames":["article","articles","articlesByIds","articleBySlug","listing","listings","venue","venues","userProfile","catalog","catalogs","metric"]},{"typeName":"Mutation","fieldNames":["updateArticle","createArticle","deleteListing"]},{"typeName":"UserProfile","fieldNames":["id","username","email","role"]},{"typeName":"Catalog","fieldNames":["id","name","category","itemCount"]},{"typeName":"Metric","fieldNames":["id","name","value","unit"]},{"typeName":"Personalized","fieldNames":["id"]},{"typeName":"Viewer","fieldNames":["id","recommendedArticles"]},{"typeName":"Article","fieldNames":["id","slug","title","body","authorName","publishedAt","tags"]},{"typeName":"Listing","fieldNames":["sellerId","sku","title","price","currency","inStock"]},{"typeName":"Venue","fieldNames":["address","name","capacity","city"]}],"childNodes":[{"typeName":"Address","fieldNames":["id"]}],"overrideFieldPathFromAlias":true,"customGraphql":{"fetch":{"url":{"staticVariableContent":"http://localhost:4012/graphql"},"method":"POST","body":{},"baseUrl":{},"path":{}},"subscription":{"enabled":true,"url":{"staticVariableContent":"http://localhost:4012/graphql"},"protocol":"GRAPHQL_SUBSCRIPTION_PROTOCOL_WS","websocketSubprotocol":"GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO"},"federation":{"enabled":true,"serviceSdl":"extend schema\n @link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\"@key\"]\n )\n\ndirective @openfed__entityCache(\n maxAge: Int!\n includeHeaders: Boolean = false\n partialCacheLoad: Boolean = false\n shadowMode: Boolean = false\n) on OBJECT\n\ndirective @openfed__queryCache(\n maxAge: Int!\n includeHeaders: Boolean = false\n shadowMode: Boolean = false\n) on FIELD_DEFINITION\n\ndirective @openfed__cacheInvalidate on FIELD_DEFINITION\n\ndirective @openfed__cachePopulate(maxAge: Int) on FIELD_DEFINITION\n\ndirective @openfed__is(fields: String!) on ARGUMENT_DEFINITION\n\ntype Query {\n \"\"\"Simple key lookup\"\"\"\n article(id: ID!): Article @openfed__queryCache(maxAge: 120)\n \"\"\"List query\"\"\"\n articles: [Article!]! @openfed__queryCache(maxAge: 120)\n \"\"\"Batch lookup with @openfed__is\"\"\"\n articlesByIds(ids: [ID!]! @openfed__is(fields: \"id\")): [Article!]! @openfed__queryCache(maxAge: 120)\n \"\"\"Argument remapping via @openfed__is\"\"\"\n articleBySlug(slug: String! @openfed__is(fields: \"slug\")): Article @openfed__queryCache(maxAge: 120)\n\n \"\"\"Composite key lookup via input object with @openfed__is\"\"\"\n listing(key: ListingKey! @openfed__is(fields: \"sellerId sku\")): Listing @openfed__queryCache(maxAge: 60)\n \"\"\"List of all listings\"\"\"\n listings: [Listing!]! @openfed__queryCache(maxAge: 60)\n\n \"\"\"Nested key lookup with @openfed__is and input object\"\"\"\n venue(location: VenueLocationKey! @openfed__is(fields: \"address { id }\")): Venue @openfed__queryCache(maxAge: 180)\n \"\"\"List of all venues\"\"\"\n venues: [Venue!]! @openfed__queryCache(maxAge: 180)\n\n \"\"\"Per-user profile (cache varies by Authorization header)\"\"\"\n userProfile(id: ID!): UserProfile @openfed__queryCache(maxAge: 60, includeHeaders: true)\n\n \"\"\"Single catalog entry\"\"\"\n catalog(id: ID!): Catalog @openfed__queryCache(maxAge: 120)\n \"\"\"All catalog entries (for partial cache load testing)\"\"\"\n catalogs: [Catalog!]! @openfed__queryCache(maxAge: 120)\n\n \"\"\"Single metric (shadow mode - always fetches from subgraph, compares with cache)\"\"\"\n metric(id: ID!): Metric @openfed__queryCache(maxAge: 300, shadowMode: true)\n}\n\ntype Mutation {\n updateArticle(id: ID!, title: String!): Article @openfed__cacheInvalidate\n createArticle(title: String!, body: String!, authorName: String!): Article! @openfed__cachePopulate(maxAge: 30)\n deleteListing(key: ListingKey!): Listing @openfed__cacheInvalidate\n}\n\n\"\"\"Per-user caching: includeHeaders makes the cache key include a hash of forwarded headers (e.g. Authorization)\"\"\"\ntype UserProfile @key(fields: \"id\") @openfed__entityCache(maxAge: 60, includeHeaders: true) {\n id: ID!\n username: String!\n email: String!\n role: String!\n}\n\n\"\"\"Partial cache load: when some entities are cached and others aren't, only the missing ones are fetched\"\"\"\ntype Catalog @key(fields: \"id\") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) {\n id: ID!\n name: String!\n category: String!\n itemCount: Int!\n}\n\n\"\"\"Shadow mode: always fetches from subgraph but compares with cache for staleness detection\"\"\"\ntype Metric @key(fields: \"id\") @openfed__entityCache(maxAge: 300, shadowMode: true) {\n id: ID!\n name: String!\n value: Float!\n unit: String!\n}\n\ninput ListingKey {\n sellerId: ID!\n sku: String!\n}\n\ninput VenueLocationKey {\n address: VenueAddressKey!\n}\n\ninput VenueAddressKey {\n id: ID!\n}\n\ninterface Personalized @key(fields: \"id\") {\n id: ID!\n}\n\ntype Viewer @key(fields: \"id\") {\n id: ID!\n recommendedArticles: [Article!]!\n}\n\ntype Article implements Personalized @key(fields: \"id\") @key(fields: \"slug\") @openfed__entityCache(maxAge: 120) {\n id: ID!\n slug: String!\n title: String!\n body: String!\n authorName: String!\n publishedAt: String!\n tags: [String!]!\n}\n\ntype Listing @key(fields: \"sellerId sku\") @openfed__entityCache(maxAge: 60) {\n sellerId: ID!\n sku: String!\n title: String!\n price: Float!\n currency: String!\n inStock: Boolean!\n}\n\ntype Address {\n id: ID!\n}\n\ntype Venue @key(fields: \"address { id }\") @openfed__entityCache(maxAge: 180) {\n address: Address!\n name: String!\n capacity: Int!\n city: String!\n}\n"},"upstreamSchema":{"key":"fabc39bc398d33faa5e52491a3a5aa91a8058d1f"}},"requestTimeoutSeconds":"10","id":"0","keys":[{"typeName":"UserProfile","selectionSet":"id"},{"typeName":"Catalog","selectionSet":"id"},{"typeName":"Metric","selectionSet":"id"},{"typeName":"Personalized","selectionSet":"id"},{"typeName":"Viewer","selectionSet":"id"},{"typeName":"Article","selectionSet":"id"},{"typeName":"Article","selectionSet":"slug"},{"typeName":"Listing","selectionSet":"sellerId sku"},{"typeName":"Venue","selectionSet":"address { id }"}],"entityInterfaces":[{"interfaceTypeName":"Personalized","concreteTypeNames":["Article"]}],"entityCacheConfigurations":[{"typeName":"UserProfile","maxAgeSeconds":"60","includeHeaders":true},{"typeName":"Catalog","maxAgeSeconds":"120","partialCacheLoad":true},{"typeName":"Metric","maxAgeSeconds":"300","shadowMode":true},{"typeName":"Article","maxAgeSeconds":"120"},{"typeName":"Listing","maxAgeSeconds":"60"},{"typeName":"Venue","maxAgeSeconds":"180"}],"rootFieldCacheConfigurations":[{"fieldName":"article","maxAgeSeconds":"120","entityTypeName":"Article","entityKeyMappings":[{"entityTypeName":"Article","fieldMappings":[{"entityKeyField":"id","argumentPath":["id"]}]}]},{"fieldName":"articles","maxAgeSeconds":"120","entityTypeName":"Article"},{"fieldName":"articlesByIds","maxAgeSeconds":"120","entityTypeName":"Article","entityKeyMappings":[{"entityTypeName":"Article","fieldMappings":[{"entityKeyField":"id","argumentPath":["ids"],"isBatch":true}]}]},{"fieldName":"articleBySlug","maxAgeSeconds":"120","entityTypeName":"Article","entityKeyMappings":[{"entityTypeName":"Article","fieldMappings":[{"entityKeyField":"slug","argumentPath":["slug"]}]}]},{"fieldName":"listing","maxAgeSeconds":"60","entityTypeName":"Listing","entityKeyMappings":[{"entityTypeName":"Listing","fieldMappings":[{"entityKeyField":"sellerId","argumentPath":["key","sellerId"]},{"entityKeyField":"sku","argumentPath":["key","sku"]}]}]},{"fieldName":"listings","maxAgeSeconds":"60","entityTypeName":"Listing"},{"fieldName":"venue","maxAgeSeconds":"180","entityTypeName":"Venue","entityKeyMappings":[{"entityTypeName":"Venue","fieldMappings":[{"entityKeyField":"address.id","argumentPath":["location","address","id"]}]}]},{"fieldName":"venues","maxAgeSeconds":"180","entityTypeName":"Venue"},{"fieldName":"userProfile","maxAgeSeconds":"60","includeHeaders":true,"entityTypeName":"UserProfile","entityKeyMappings":[{"entityTypeName":"UserProfile","fieldMappings":[{"entityKeyField":"id","argumentPath":["id"]}]}]},{"fieldName":"catalog","maxAgeSeconds":"120","entityTypeName":"Catalog","entityKeyMappings":[{"entityTypeName":"Catalog","fieldMappings":[{"entityKeyField":"id","argumentPath":["id"]}]}]},{"fieldName":"catalogs","maxAgeSeconds":"120","entityTypeName":"Catalog"},{"fieldName":"metric","maxAgeSeconds":"300","shadowMode":true,"entityTypeName":"Metric","entityKeyMappings":[{"entityTypeName":"Metric","fieldMappings":[{"entityKeyField":"id","argumentPath":["id"]}]}]}],"cachePopulateConfigurations":[{"fieldName":"createArticle","operationType":"Mutation","maxAgeSeconds":"30","entityTypeName":"Article"}],"cacheInvalidateConfigurations":[{"fieldName":"updateArticle","operationType":"Mutation","entityTypeName":"Article"},{"fieldName":"deleteListing","operationType":"Mutation","entityTypeName":"Listing"}]},{"kind":"GRAPHQL","rootNodes":[{"typeName":"Article","fieldNames":["id","viewCount","rating","reviewSummary","relatedArticles","personalizedRecommendation"],"externalFieldNames":["currentViewer"]},{"typeName":"Viewer","fieldNames":["id"],"externalFieldNames":["name"]},{"typeName":"Catalog","fieldNames":["id","description","lastUpdated"]}],"overrideFieldPathFromAlias":true,"customGraphql":{"fetch":{"url":{"staticVariableContent":"http://localhost:4013/graphql"},"method":"POST","body":{},"baseUrl":{},"path":{}},"subscription":{"enabled":true,"url":{"staticVariableContent":"http://localhost:4013/graphql"},"protocol":"GRAPHQL_SUBSCRIPTION_PROTOCOL_WS","websocketSubprotocol":"GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO"},"federation":{"enabled":true,"serviceSdl":"extend schema\n @link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\"@key\", \"@external\", \"@requires\"]\n )\n\ndirective @openfed__entityCache(\n maxAge: Int!\n includeHeaders: Boolean = false\n partialCacheLoad: Boolean = false\n shadowMode: Boolean = false\n) on OBJECT\n\ntype Article @key(fields: \"id\") @openfed__entityCache(maxAge: 90) {\n id: ID!\n currentViewer: Viewer @external\n viewCount: Int!\n rating: Float!\n reviewSummary: String!\n relatedArticles: [Article!]!\n personalizedRecommendation: String! @requires(fields: \"currentViewer { id name }\")\n}\n\ntype Viewer @key(fields: \"id\") {\n id: ID!\n name: String! @external\n}\n\n\"\"\"Extends Catalog with description from a second subgraph (for partial cache load testing)\"\"\"\ntype Catalog @key(fields: \"id\") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) {\n id: ID!\n description: String!\n lastUpdated: String!\n}\n"},"upstreamSchema":{"key":"a2cd2a1b7cb5ebae92f1c56df2d8c7d3a56d19e1"}},"requestTimeoutSeconds":"10","id":"1","keys":[{"typeName":"Article","selectionSet":"id"},{"typeName":"Viewer","selectionSet":"id"},{"typeName":"Catalog","selectionSet":"id"}],"requires":[{"typeName":"Article","fieldName":"personalizedRecommendation","selectionSet":"currentViewer { id name }"}],"entityCacheConfigurations":[{"typeName":"Article","maxAgeSeconds":"90"},{"typeName":"Catalog","maxAgeSeconds":"120","partialCacheLoad":true}]},{"kind":"GRAPHQL","rootNodes":[{"typeName":"Personalized","fieldNames":["id","currentViewer"]},{"typeName":"Viewer","fieldNames":["id","name","email"]},{"typeName":"Query","fieldNames":["currentViewer"]},{"typeName":"Article","fieldNames":["id","currentViewer"]}],"overrideFieldPathFromAlias":true,"customGraphql":{"fetch":{"url":{"staticVariableContent":"http://localhost:4014/graphql"},"method":"POST","body":{},"baseUrl":{},"path":{}},"subscription":{"enabled":true,"url":{"staticVariableContent":"http://localhost:4014/graphql"},"protocol":"GRAPHQL_SUBSCRIPTION_PROTOCOL_WS","websocketSubprotocol":"GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO"},"federation":{"enabled":true,"serviceSdl":"extend schema\n @link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\"@key\", \"@interfaceObject\", \"@inaccessible\"]\n )\n\ndirective @openfed__requestScoped(key: String!) on FIELD_DEFINITION\n\n# Symmetric @openfed__requestScoped: both Query.currentViewer and Personalized.currentViewer\n# declare key: \"currentViewer\". Their L1 cache entry is \"viewer.currentViewer\".\n# Whichever is resolved first populates L1; subsequent fields with the same key\n# inject from L1 and skip the fetch.\ntype Personalized @key(fields: \"id\") @interfaceObject {\n id: ID!\n currentViewer: Viewer @inaccessible @openfed__requestScoped(key: \"currentViewer\")\n}\n\ntype Viewer @key(fields: \"id\") {\n id: ID!\n name: String!\n email: String!\n}\n\ntype Query {\n currentViewer: Viewer @openfed__requestScoped(key: \"currentViewer\")\n}\n"},"upstreamSchema":{"key":"9ee951b49b83d66e073d83402d78cd8078181571"}},"requestTimeoutSeconds":"10","id":"2","keys":[{"typeName":"Personalized","selectionSet":"id"},{"typeName":"Viewer","selectionSet":"id"},{"typeName":"Article","selectionSet":"id"}],"interfaceObjects":[{"interfaceTypeName":"Personalized","concreteTypeNames":["Article"]}],"requestScopedFields":[{"fieldName":"currentViewer","typeName":"Personalized","l1Key":"viewer.currentViewer"},{"fieldName":"currentViewer","typeName":"Query","l1Key":"viewer.currentViewer"}]}],"fieldConfigurations":[{"typeName":"Query","fieldName":"article","argumentsConfiguration":[{"name":"id","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Query","fieldName":"articlesByIds","argumentsConfiguration":[{"name":"ids","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Query","fieldName":"articleBySlug","argumentsConfiguration":[{"name":"slug","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Query","fieldName":"listing","argumentsConfiguration":[{"name":"key","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Query","fieldName":"venue","argumentsConfiguration":[{"name":"location","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Query","fieldName":"userProfile","argumentsConfiguration":[{"name":"id","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Query","fieldName":"catalog","argumentsConfiguration":[{"name":"id","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Query","fieldName":"metric","argumentsConfiguration":[{"name":"id","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Mutation","fieldName":"updateArticle","argumentsConfiguration":[{"name":"id","sourceType":"FIELD_ARGUMENT"},{"name":"title","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Mutation","fieldName":"createArticle","argumentsConfiguration":[{"name":"title","sourceType":"FIELD_ARGUMENT"},{"name":"body","sourceType":"FIELD_ARGUMENT"},{"name":"authorName","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Mutation","fieldName":"deleteListing","argumentsConfiguration":[{"name":"key","sourceType":"FIELD_ARGUMENT"}]}],"graphqlSchema":"schema {\n query: Query\n mutation: Mutation\n}\n\ndirective @inaccessible on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION\n\ntype Query {\n \"\"\"Simple key lookup\"\"\"\n article(id: ID!): Article\n \"\"\"List query\"\"\"\n articles: [Article!]!\n \"\"\"Batch lookup with @openfed__is\"\"\"\n articlesByIds(ids: [ID!]!): [Article!]!\n \"\"\"Argument remapping via @openfed__is\"\"\"\n articleBySlug(slug: String!): Article\n \"\"\"Composite key lookup via input object with @openfed__is\"\"\"\n listing(key: ListingKey!): Listing\n \"\"\"List of all listings\"\"\"\n listings: [Listing!]!\n \"\"\"Nested key lookup with @openfed__is and input object\"\"\"\n venue(location: VenueLocationKey!): Venue\n \"\"\"List of all venues\"\"\"\n venues: [Venue!]!\n \"\"\"Per-user profile (cache varies by Authorization header)\"\"\"\n userProfile(id: ID!): UserProfile\n \"\"\"Single catalog entry\"\"\"\n catalog(id: ID!): Catalog\n \"\"\"All catalog entries (for partial cache load testing)\"\"\"\n catalogs: [Catalog!]!\n \"\"\"\n Single metric (shadow mode - always fetches from subgraph, compares with cache)\n \"\"\"\n metric(id: ID!): Metric\n currentViewer: Viewer\n}\n\ntype Mutation {\n updateArticle(id: ID!, title: String!): Article\n createArticle(title: String!, body: String!, authorName: String!): Article!\n deleteListing(key: ListingKey!): Listing\n}\n\n\"\"\"\nPer-user caching: includeHeaders makes the cache key include a hash of forwarded headers (e.g. Authorization)\n\"\"\"\ntype UserProfile {\n id: ID!\n username: String!\n email: String!\n role: String!\n}\n\n\"\"\"\nPartial cache load: when some entities are cached and others aren't, only the missing ones are fetched\n\"\"\"\ntype Catalog {\n id: ID!\n name: String!\n category: String!\n itemCount: Int!\n description: String!\n lastUpdated: String!\n}\n\n\"\"\"\nShadow mode: always fetches from subgraph but compares with cache for staleness detection\n\"\"\"\ntype Metric {\n id: ID!\n name: String!\n value: Float!\n unit: String!\n}\n\ninput ListingKey {\n sellerId: ID!\n sku: String!\n}\n\ninput VenueLocationKey {\n address: VenueAddressKey!\n}\n\ninput VenueAddressKey {\n id: ID!\n}\n\ninterface Personalized {\n id: ID!\n currentViewer: Viewer @inaccessible\n}\n\ntype Viewer {\n id: ID!\n recommendedArticles: [Article!]!\n name: String!\n email: String!\n}\n\ntype Listing {\n sellerId: ID!\n sku: String!\n title: String!\n price: Float!\n currency: String!\n inStock: Boolean!\n}\n\ntype Address {\n id: ID!\n}\n\ntype Venue {\n address: Address!\n name: String!\n capacity: Int!\n city: String!\n}\n\ntype Article implements Personalized {\n id: ID!\n slug: String!\n title: String!\n body: String!\n authorName: String!\n publishedAt: String!\n tags: [String!]!\n currentViewer: Viewer\n viewCount: Int!\n rating: Float!\n reviewSummary: String!\n relatedArticles: [Article!]!\n personalizedRecommendation: String!\n}","stringStorage":{"fabc39bc398d33faa5e52491a3a5aa91a8058d1f":"schema {\n query: Query\n mutation: Mutation\n}\n\ndirective @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT\n\ndirective @link(as: String, for: link__Purpose, import: [link__Import], url: String!) repeatable on SCHEMA\n\ndirective @openfed__cacheInvalidate on FIELD_DEFINITION\n\ndirective @openfed__cachePopulate(maxAge: Int) on FIELD_DEFINITION\n\ndirective @openfed__entityCache(includeHeaders: Boolean = false, maxAge: Int!, negativeCacheTTL: Int = 0, partialCacheLoad: Boolean = false, shadowMode: Boolean = false) on OBJECT\n\ndirective @openfed__is(fields: String!) on ARGUMENT_DEFINITION\n\ndirective @openfed__queryCache(includeHeaders: Boolean = false, maxAge: Int!, shadowMode: Boolean = false) on FIELD_DEFINITION\n\ntype Address {\n id: ID!\n}\n\ntype Article implements Personalized @key(fields: \"id\") @key(fields: \"slug\") @openfed__entityCache(maxAge: 120) {\n authorName: String!\n body: String!\n id: ID!\n publishedAt: String!\n slug: String!\n tags: [String!]!\n title: String!\n}\n\n\"\"\"\nPartial cache load: when some entities are cached and others aren't, only the missing ones are fetched\n\"\"\"\ntype Catalog @key(fields: \"id\") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) {\n category: String!\n id: ID!\n itemCount: Int!\n name: String!\n}\n\ntype Listing @key(fields: \"sellerId sku\") @openfed__entityCache(maxAge: 60) {\n currency: String!\n inStock: Boolean!\n price: Float!\n sellerId: ID!\n sku: String!\n title: String!\n}\n\ninput ListingKey {\n sellerId: ID!\n sku: String!\n}\n\n\"\"\"\nShadow mode: always fetches from subgraph but compares with cache for staleness detection\n\"\"\"\ntype Metric @key(fields: \"id\") @openfed__entityCache(maxAge: 300, shadowMode: true) {\n id: ID!\n name: String!\n unit: String!\n value: Float!\n}\n\ntype Mutation {\n createArticle(authorName: String!, body: String!, title: String!): Article! @openfed__cachePopulate(maxAge: 30)\n deleteListing(key: ListingKey!): Listing @openfed__cacheInvalidate\n updateArticle(id: ID!, title: String!): Article @openfed__cacheInvalidate\n}\n\ninterface Personalized @key(fields: \"id\") {\n id: ID!\n}\n\ntype Query {\n \"\"\"Simple key lookup\"\"\"\n article(id: ID!): Article @openfed__queryCache(maxAge: 120)\n \"\"\"Argument remapping via @openfed__is\"\"\"\n articleBySlug(slug: String! @openfed__is(fields: \"slug\")): Article @openfed__queryCache(maxAge: 120)\n \"\"\"List query\"\"\"\n articles: [Article!]! @openfed__queryCache(maxAge: 120)\n \"\"\"Batch lookup with @openfed__is\"\"\"\n articlesByIds(ids: [ID!]! @openfed__is(fields: \"id\")): [Article!]! @openfed__queryCache(maxAge: 120)\n \"\"\"Single catalog entry\"\"\"\n catalog(id: ID!): Catalog @openfed__queryCache(maxAge: 120)\n \"\"\"All catalog entries (for partial cache load testing)\"\"\"\n catalogs: [Catalog!]! @openfed__queryCache(maxAge: 120)\n \"\"\"Composite key lookup via input object with @openfed__is\"\"\"\n listing(key: ListingKey! @openfed__is(fields: \"sellerId sku\")): Listing @openfed__queryCache(maxAge: 60)\n \"\"\"List of all listings\"\"\"\n listings: [Listing!]! @openfed__queryCache(maxAge: 60)\n \"\"\"\n Single metric (shadow mode - always fetches from subgraph, compares with cache)\n \"\"\"\n metric(id: ID!): Metric @openfed__queryCache(maxAge: 300, shadowMode: true)\n \"\"\"Per-user profile (cache varies by Authorization header)\"\"\"\n userProfile(id: ID!): UserProfile @openfed__queryCache(maxAge: 60, includeHeaders: true)\n \"\"\"Nested key lookup with @openfed__is and input object\"\"\"\n venue(location: VenueLocationKey! @openfed__is(fields: \"address { id }\")): Venue @openfed__queryCache(maxAge: 180)\n \"\"\"List of all venues\"\"\"\n venues: [Venue!]! @openfed__queryCache(maxAge: 180)\n}\n\n\"\"\"\nPer-user caching: includeHeaders makes the cache key include a hash of forwarded headers (e.g. Authorization)\n\"\"\"\ntype UserProfile @key(fields: \"id\") @openfed__entityCache(maxAge: 60, includeHeaders: true) {\n email: String!\n id: ID!\n role: String!\n username: String!\n}\n\ntype Venue @key(fields: \"address { id }\") @openfed__entityCache(maxAge: 180) {\n address: Address!\n capacity: Int!\n city: String!\n name: String!\n}\n\ninput VenueAddressKey {\n id: ID!\n}\n\ninput VenueLocationKey {\n address: VenueAddressKey!\n}\n\ntype Viewer @key(fields: \"id\") {\n id: ID!\n recommendedArticles: [Article!]!\n}\n\nscalar link__Import\n\nenum link__Purpose {\n EXECUTION\n SECURITY\n}\n\nscalar openfed__FieldSet","a2cd2a1b7cb5ebae92f1c56df2d8c7d3a56d19e1":"directive @external on FIELD_DEFINITION | OBJECT\n\ndirective @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT\n\ndirective @link(as: String, for: link__Purpose, import: [link__Import], url: String!) repeatable on SCHEMA\n\ndirective @openfed__entityCache(includeHeaders: Boolean = false, maxAge: Int!, negativeCacheTTL: Int = 0, partialCacheLoad: Boolean = false, shadowMode: Boolean = false) on OBJECT\n\ndirective @requires(fields: openfed__FieldSet!) on FIELD_DEFINITION\n\ntype Article @key(fields: \"id\") @openfed__entityCache(maxAge: 90) {\n currentViewer: Viewer @external\n id: ID!\n personalizedRecommendation: String! @requires(fields: \"currentViewer { id name }\")\n rating: Float!\n relatedArticles: [Article!]!\n reviewSummary: String!\n viewCount: Int!\n}\n\n\"\"\"\nExtends Catalog with description from a second subgraph (for partial cache load testing)\n\"\"\"\ntype Catalog @key(fields: \"id\") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) {\n description: String!\n id: ID!\n lastUpdated: String!\n}\n\ntype Viewer @key(fields: \"id\") {\n id: ID!\n name: String! @external\n}\n\nscalar link__Import\n\nenum link__Purpose {\n EXECUTION\n SECURITY\n}\n\nscalar openfed__FieldSet","9ee951b49b83d66e073d83402d78cd8078181571":"schema {\n query: Query\n}\n\ndirective @inaccessible on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION\n\ndirective @interfaceObject on OBJECT\n\ndirective @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT\n\ndirective @link(as: String, for: link__Purpose, import: [link__Import], url: String!) repeatable on SCHEMA\n\ndirective @openfed__requestScoped(key: String!) on FIELD_DEFINITION\n\ntype Personalized @key(fields: \"id\") @interfaceObject {\n currentViewer: Viewer @inaccessible @openfed__requestScoped(key: \"currentViewer\")\n id: ID!\n}\n\ntype Query {\n currentViewer: Viewer @openfed__requestScoped(key: \"currentViewer\")\n}\n\ntype Viewer @key(fields: \"id\") {\n email: String!\n id: ID!\n name: String!\n}\n\nscalar link__Import\n\nenum link__Purpose {\n EXECUTION\n SECURITY\n}\n\nscalar openfed__FieldSet"},"graphqlClientSchema":"schema {\n query: Query\n mutation: Mutation\n}\n\ntype Query {\n \"\"\"Simple key lookup\"\"\"\n article(id: ID!): Article\n \"\"\"List query\"\"\"\n articles: [Article!]!\n \"\"\"Batch lookup with @openfed__is\"\"\"\n articlesByIds(ids: [ID!]!): [Article!]!\n \"\"\"Argument remapping via @openfed__is\"\"\"\n articleBySlug(slug: String!): Article\n \"\"\"Composite key lookup via input object with @openfed__is\"\"\"\n listing(key: ListingKey!): Listing\n \"\"\"List of all listings\"\"\"\n listings: [Listing!]!\n \"\"\"Nested key lookup with @openfed__is and input object\"\"\"\n venue(location: VenueLocationKey!): Venue\n \"\"\"List of all venues\"\"\"\n venues: [Venue!]!\n \"\"\"Per-user profile (cache varies by Authorization header)\"\"\"\n userProfile(id: ID!): UserProfile\n \"\"\"Single catalog entry\"\"\"\n catalog(id: ID!): Catalog\n \"\"\"All catalog entries (for partial cache load testing)\"\"\"\n catalogs: [Catalog!]!\n \"\"\"\n Single metric (shadow mode - always fetches from subgraph, compares with cache)\n \"\"\"\n metric(id: ID!): Metric\n currentViewer: Viewer\n}\n\ntype Mutation {\n updateArticle(id: ID!, title: String!): Article\n createArticle(title: String!, body: String!, authorName: String!): Article!\n deleteListing(key: ListingKey!): Listing\n}\n\n\"\"\"\nPer-user caching: includeHeaders makes the cache key include a hash of forwarded headers (e.g. Authorization)\n\"\"\"\ntype UserProfile {\n id: ID!\n username: String!\n email: String!\n role: String!\n}\n\n\"\"\"\nPartial cache load: when some entities are cached and others aren't, only the missing ones are fetched\n\"\"\"\ntype Catalog {\n id: ID!\n name: String!\n category: String!\n itemCount: Int!\n description: String!\n lastUpdated: String!\n}\n\n\"\"\"\nShadow mode: always fetches from subgraph but compares with cache for staleness detection\n\"\"\"\ntype Metric {\n id: ID!\n name: String!\n value: Float!\n unit: String!\n}\n\ninput ListingKey {\n sellerId: ID!\n sku: String!\n}\n\ninput VenueLocationKey {\n address: VenueAddressKey!\n}\n\ninput VenueAddressKey {\n id: ID!\n}\n\ninterface Personalized {\n id: ID!\n}\n\ntype Viewer {\n id: ID!\n recommendedArticles: [Article!]!\n name: String!\n email: String!\n}\n\ntype Listing {\n sellerId: ID!\n sku: String!\n title: String!\n price: Float!\n currency: String!\n inStock: Boolean!\n}\n\ntype Address {\n id: ID!\n}\n\ntype Venue {\n address: Address!\n name: String!\n capacity: Int!\n city: String!\n}\n\ntype Article implements Personalized {\n id: ID!\n slug: String!\n title: String!\n body: String!\n authorName: String!\n publishedAt: String!\n tags: [String!]!\n currentViewer: Viewer\n viewCount: Int!\n rating: Float!\n reviewSummary: String!\n relatedArticles: [Article!]!\n personalizedRecommendation: String!\n}"},"version":"00000000-0000-0000-0000-000000000000","subgraphs":[{"id":"0","name":"cachegraph","routingUrl":"http://localhost:4012/graphql"},{"id":"1","name":"cachegraph-ext","routingUrl":"http://localhost:4013/graphql"},{"id":"2","name":"viewer","routingUrl":"http://localhost:4014/graphql"}],"compatibilityVersion":"1:{{$COMPOSITION__VERSION}}"} \ No newline at end of file diff --git a/demo/go.mod b/demo/go.mod index 208d1cdb72..211017df79 100644 --- a/demo/go.mod +++ b/demo/go.mod @@ -9,14 +9,15 @@ require ( github.com/nats-io/nats.go v1.35.0 github.com/ravilushqa/otelgqlgen v0.13.1 github.com/rs/cors v1.11.0 + github.com/stretchr/testify v1.11.1 github.com/vektah/gqlparser/v2 v2.5.30 github.com/wundergraph/cosmo/composition-go v0.0.0-20250820135159-bf8852195d3f github.com/wundergraph/cosmo/router v0.0.0-20260318232543-0e5fa811a191 github.com/wundergraph/cosmo/router-tests v0.0.0-20260318232543-0e5fa811a191 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 - go.opentelemetry.io/otel v1.36.0 + go.opentelemetry.io/otel v1.39.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0 - go.opentelemetry.io/otel/sdk v1.36.0 + go.opentelemetry.io/otel/sdk v1.39.0 go.uber.org/atomic v1.11.0 go.uber.org/zap v1.27.0 golang.org/x/sync v0.17.0 @@ -123,6 +124,7 @@ require ( github.com/prometheus/procfs v0.15.1 // indirect github.com/r3labs/sse/v2 v2.8.1 // indirect github.com/redis/go-redis/v9 v9.7.3 // indirect + github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/rs/xid v1.5.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect @@ -132,7 +134,6 @@ require ( github.com/sosodev/duration v1.3.1 // indirect github.com/spf13/cast v1.7.1 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/stretchr/testify v1.11.1 // indirect github.com/tidwall/gjson v1.18.0 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect @@ -153,7 +154,6 @@ require ( github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 // indirect github.com/yosida95/uritemplate/v3 v3.0.2 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib v1.16.1 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.23.0 // indirect go.opentelemetry.io/contrib/propagators/jaeger v1.23.0 // indirect @@ -162,9 +162,9 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.50.0 // indirect - go.opentelemetry.io/otel/metric v1.36.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.36.0 // indirect - go.opentelemetry.io/otel/trace v1.36.0 // indirect + go.opentelemetry.io/otel/metric v1.39.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect + go.opentelemetry.io/otel/trace v1.39.0 // indirect go.opentelemetry.io/proto/otlp v1.4.0 // indirect go.uber.org/automaxprocs v1.5.3 // indirect go.uber.org/multierr v1.11.0 // indirect @@ -174,7 +174,7 @@ require ( golang.org/x/exp v0.0.0-20250813145105-42675adae3e6 // indirect golang.org/x/mod v0.29.0 // indirect golang.org/x/net v0.46.0 // indirect - golang.org/x/sys v0.37.0 // indirect + golang.org/x/sys v0.39.0 // indirect golang.org/x/text v0.30.0 // indirect golang.org/x/time v0.9.0 // indirect golang.org/x/tools v0.38.0 // indirect @@ -188,5 +188,26 @@ require ( rogchap.com/v8go v0.9.0 // indirect ) +// Keep otel pinned to the same versions as router/go.mod. Upstream v1.40+ renames +// attributes we rely on, so the require line picks v1.39.0 but every transitive +// is pinned to v1.28.0 via the replace block below (mirrors router/go.mod:178-194). +replace ( + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp => go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 + go.opentelemetry.io/contrib/propagators/b3 => go.opentelemetry.io/contrib/propagators/b3 v1.23.0 + go.opentelemetry.io/contrib/propagators/jaeger => go.opentelemetry.io/contrib/propagators/jaeger v1.23.0 + go.opentelemetry.io/otel => go.opentelemetry.io/otel v1.28.0 + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc => go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0 + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp => go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.44.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace => go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.1 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc => go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.1 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp => go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.23.1 + go.opentelemetry.io/otel/exporters/prometheus => go.opentelemetry.io/otel/exporters/prometheus v0.50.0 + go.opentelemetry.io/otel/metric => go.opentelemetry.io/otel/metric v1.28.0 + go.opentelemetry.io/otel/sdk => go.opentelemetry.io/otel/sdk v1.28.0 + go.opentelemetry.io/otel/sdk/metric => go.opentelemetry.io/otel/sdk/metric v1.28.0 + go.opentelemetry.io/otel/trace => go.opentelemetry.io/otel/trace v1.28.0 + go.opentelemetry.io/proto/otlp => go.opentelemetry.io/proto/otlp v1.1.0 +) + // if the below line is uncommented, it breaks 'make dc-subgraphs-demo' // replace github.com/wundergraph/cosmo/router => ../router diff --git a/demo/go.sum b/demo/go.sum index def336f529..9d9880b412 100644 --- a/demo/go.sum +++ b/demo/go.sum @@ -296,8 +296,8 @@ github.com/redis/go-redis/v9 v9.7.3 h1:YpPyAayJV+XErNsatSElgRZZVCwXX9QzkKYNvO7x0 github.com/redis/go-redis/v9 v9.7.3/go.mod h1:bGUrSggJ9X9GUmZpZNEOQKaANxSGgOEBRltRTZHSvrA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= -github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= @@ -396,40 +396,38 @@ github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= -go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/contrib v1.16.1 h1:EpASvVyGx6/ZTlmXzxYfTMZxHROelCeXXa2uLiwltcs= go.opentelemetry.io/contrib v1.16.1/go.mod h1:gIzjwWFoGazJmtCaDgViqOSJPde2mCWzv60o0bWPcZs= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= go.opentelemetry.io/contrib/propagators/b3 v1.23.0 h1:aaIGWc5JdfRGpCafLRxMJbD65MfTa206AwSKkvGS0Hg= go.opentelemetry.io/contrib/propagators/b3 v1.23.0/go.mod h1:Gyz7V7XghvwTq+mIhLFlTgcc03UDroOg8vezs4NLhwU= go.opentelemetry.io/contrib/propagators/jaeger v1.23.0 h1:KFxfTCTkH1usVFzDaWzbmNdFX7ybUTCtkLsUTww0nG4= go.opentelemetry.io/contrib/propagators/jaeger v1.23.0/go.mod h1:xU+81opGquQICJGzwscLXAQLnIPWI+q7Zu4AQSrgXf8= -go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg= -go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0 h1:jd0+5t/YynESZqsSyPz+7PAFdEop0dlN0+PkyHYo8oI= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0/go.mod h1:U707O40ee1FpQGyhvqnzmCJm1Wh6OX6GGBVn0E6Uyyk= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.44.0 h1:bflGWrfYyuulcdxf14V6n9+CoQcu5SAAdHmDPAJnlps= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.44.0/go.mod h1:qcTO4xHAxZLaLxPd60TdE88rxtItPHgHWqOhOGRr0as= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 h1:Vh5HayB/0HHfOQA7Ctx69E/Y/DcQSMPpKANYVMQ7fBA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0/go.mod h1:cpgtDBaqD/6ok/UG0jT15/uKjAY8mRA53diogHBg3UI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.1 h1:o8iWeVFa1BcLtVEV0LzrCxV2/55tB3xLxADr6Kyoey4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.1/go.mod h1:SEVfdK4IoBnbT2FXNM/k8yC08MrfbhWk3U4ljM8B3HE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.1 h1:p3A5+f5l9e/kuEBwLOrnpkIDHQFlHmbiVxMURWRK6gQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.1/go.mod h1:OClrnXUjBqQbInvjJFjYSnMxBSCXBF8r3b34WqjiIrQ= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0 h1:wpMfgF8E1rkrT1Z6meFh1NDtownE9Ii3n3X2GJYjsaU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0/go.mod h1:wAy0T/dUbs468uOlkT31xjvqQgEVXv58BRFWEgn5v/0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.23.1 h1:cfuy3bXmLJS7M1RZmAL6SuhGtKUp2KEsrm00OlAXkq4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.23.1/go.mod h1:22jr92C6KwlwItJmQzfixzQM3oyyuYLCfHiMY+rpsPU= go.opentelemetry.io/otel/exporters/prometheus v0.50.0 h1:2Ewsda6hejmbhGFyUvWZjUThC98Cf8Zy6g0zkIimOng= go.opentelemetry.io/otel/exporters/prometheus v0.50.0/go.mod h1:pMm5PkUo5YwbLiuEf7t2xg4wbP0/eSJrMxIMxKosynY= -go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE= -go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs= -go.opentelemetry.io/otel/sdk v1.36.0 h1:b6SYIuLRs88ztox4EyrvRti80uXIFy+Sqzoh9kFULbs= -go.opentelemetry.io/otel/sdk v1.36.0/go.mod h1:+lC+mTgD+MUWfjJubi2vvXWcVxyr9rmlshZni72pXeY= -go.opentelemetry.io/otel/sdk/metric v1.36.0 h1:r0ntwwGosWGaa0CrSt8cuNuTcccMXERFwHX4dThiPis= -go.opentelemetry.io/otel/sdk/metric v1.36.0/go.mod h1:qTNOhFDfKRwX0yXOqJYegL5WRaW376QbB7P4Pb0qva4= -go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w= -go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA= -go.opentelemetry.io/proto/otlp v1.4.0 h1:TA9WRvW6zMwP+Ssb6fLoUIuirti1gGbP28GcKG1jgeg= -go.opentelemetry.io/proto/otlp v1.4.0/go.mod h1:PPBWZIP98o2ElSqI35IHfu7hIhSwvc5N38Jw8pXuGFY= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08= +go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= +go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= @@ -493,8 +491,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= -golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= +golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/demo/graph-cache-only.yaml b/demo/graph-cache-only.yaml new file mode 100644 index 0000000000..bb44db59fd --- /dev/null +++ b/demo/graph-cache-only.yaml @@ -0,0 +1,14 @@ +version: 1 +subgraphs: + - name: cachegraph + routing_url: http://localhost:4012/graphql + schema: + file: ./pkg/subgraphs/cachegraph/subgraph/schema.graphqls + - name: cachegraph-ext + routing_url: http://localhost:4013/graphql + schema: + file: ./pkg/subgraphs/cachegraph_ext/subgraph/schema.graphqls + - name: viewer + routing_url: http://localhost:4014/graphql + schema: + file: ./pkg/subgraphs/viewer/subgraph/schema.graphqls diff --git a/demo/graph.yaml b/demo/graph.yaml index 8d130eed28..d70a67a101 100644 --- a/demo/graph.yaml +++ b/demo/graph.yaml @@ -40,6 +40,10 @@ subgraphs: routing_url: http://localhost:4009/graphql schema: file: ./pkg/subgraphs/countries/subgraph/schema.graphqls + - name: cachegraph + routing_url: http://localhost:4012/graphql + schema: + file: ./pkg/subgraphs/cachegraph/subgraph/schema.graphqls - name: employeeupdated schema: file: ./pkg/subgraphs/employeeupdated/subgraph/schema.graphqls diff --git a/demo/pkg/injector/latency.go b/demo/pkg/injector/latency.go new file mode 100644 index 0000000000..ea4a6813ae --- /dev/null +++ b/demo/pkg/injector/latency.go @@ -0,0 +1,29 @@ +package injector + +import ( + "log" + "net/http" + "strconv" + "time" +) + +// ArtificialLatencyHeader lets the playground or any client inject fake latency +// into a demo subgraph response. Value is milliseconds as an integer, bounded +// at 10000. Intended for demos where local subgraphs are too fast to make +// caching benefits visible. +const ArtificialLatencyHeader = "X-Artificial-Latency" + +// Latency wraps a handler and sleeps for the number of milliseconds specified +// in the X-Artificial-Latency request header before passing the request down. +// Invalid values are silently ignored. +func Latency(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if v := r.Header.Get(ArtificialLatencyHeader); v != "" { + if ms, err := strconv.Atoi(v); err == nil && ms > 0 && ms <= 10000 { + log.Printf("[latency] %s %s sleep %dms prefix=%q", r.Method, r.Host, ms, r.Header.Get("X-WG-Cache-Key-Prefix")) + time.Sleep(time.Duration(ms) * time.Millisecond) + } + } + next.ServeHTTP(w, r) + }) +} diff --git a/demo/pkg/subgraphs/cachegraph/cachegraph.go b/demo/pkg/subgraphs/cachegraph/cachegraph.go new file mode 100644 index 0000000000..ba407cc9f9 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph/cachegraph.go @@ -0,0 +1,12 @@ +package cachegraph + +import ( + "github.com/99designs/gqlgen/graphql" + + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph/subgraph" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph/subgraph/generated" +) + +func NewSchema() graphql.ExecutableSchema { + return generated.NewExecutableSchema(generated.Config{Resolvers: subgraph.NewResolver()}) +} diff --git a/demo/pkg/subgraphs/cachegraph/generate.go b/demo/pkg/subgraphs/cachegraph/generate.go new file mode 100644 index 0000000000..f2e485a8c2 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph/generate.go @@ -0,0 +1,2 @@ +//go:generate go run github.com/99designs/gqlgen generate +package cachegraph diff --git a/demo/pkg/subgraphs/cachegraph/gqlgen.yml b/demo/pkg/subgraphs/cachegraph/gqlgen.yml new file mode 100644 index 0000000000..07d1eeac61 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph/gqlgen.yml @@ -0,0 +1,55 @@ +# Where are all the schema files located? globs are supported eg src/**/*.graphqls +schema: + - subgraph/*.graphqls + +# Where should the generated server code go? +exec: + filename: subgraph/generated/generated.go + package: generated + +federation: + filename: subgraph/generated/federation.go + package: generated + version: 2 + options: + explicit_requires: true + +# Where should any generated models go? +model: + filename: subgraph/model/models_gen.go + package: model + +# Where should the resolver implementations go? +resolver: + layout: follow-schema + dir: subgraph + package: subgraph + +directives: + openfed__entityCache: + skip_runtime: true + openfed__queryCache: + skip_runtime: true + openfed__cacheInvalidate: + skip_runtime: true + openfed__cachePopulate: + skip_runtime: true + openfed__is: + skip_runtime: true + +models: + Viewer: + fields: + recommendedArticles: + resolver: true + ID: + model: + - github.com/99designs/gqlgen/graphql.ID + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + Int: + model: + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 diff --git a/demo/pkg/subgraphs/cachegraph/subgraph/auth_profiles.go b/demo/pkg/subgraphs/cachegraph/subgraph/auth_profiles.go new file mode 100644 index 0000000000..9ce71737b0 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph/subgraph/auth_profiles.go @@ -0,0 +1,12 @@ +package subgraph + +// userProfileIDByAuthorizationToken maps the demo Authorization bearer tokens to +// user ids. Used by the UserProfile resolver to vary its response per caller so +// that @openfed__queryCache(includeHeaders: true) has a detectable signal. +// Kept in a separate file so gqlgen's regen of schema.resolvers.go does not +// touch it. +var userProfileIDByAuthorizationToken = map[string]string{ + "Bearer token-alice": "u1", + "Bearer token-bob": "u2", + "Bearer token-charlie": "u3", +} diff --git a/demo/pkg/subgraphs/cachegraph/subgraph/data.go b/demo/pkg/subgraphs/cachegraph/subgraph/data.go new file mode 100644 index 0000000000..aea537e503 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph/subgraph/data.go @@ -0,0 +1,336 @@ +package subgraph + +import ( + "fmt" + "sort" + "sync" + "time" + + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph/subgraph/model" +) + +// defaultArticles is the seed data for a fresh article store. Each Resolver +// clones this so mutations are isolated per server instance. +var defaultArticles = []*model.Article{ + { + ID: "1", + Slug: "introduction-to-graphql-caching", + Title: "Introduction to GraphQL Caching", + Body: "Entity caching allows you to cache resolved entities at the subgraph level.", + AuthorName: "Alice", + PublishedAt: "2025-01-15T10:00:00Z", + Tags: []string{"graphql", "caching", "federation"}, + }, + { + ID: "2", + Slug: "advanced-federation-patterns", + Title: "Advanced Federation Patterns", + Body: "Learn how to use composite keys and nested keys in federation.", + AuthorName: "Bob", + PublishedAt: "2025-02-20T14:30:00Z", + Tags: []string{"federation", "advanced"}, + }, + { + ID: "3", + Slug: "cache-invalidation-strategies", + Title: "Cache Invalidation Strategies", + Body: "Explore different approaches to invalidating cached entities.", + AuthorName: "Charlie", + PublishedAt: "2025-03-10T09:00:00Z", + Tags: []string{"caching", "patterns"}, + }, + { + ID: "4", + Slug: "performance-tuning-with-entity-caching", + Title: "Performance Tuning with Entity Caching", + Body: "How to get the most out of entity caching in production.", + AuthorName: "Alice", + PublishedAt: "2025-04-01T11:00:00Z", + Tags: []string{"performance", "caching"}, + }, +} + +// recommendedArticlesByViewer is read-only seed data — different users get +// different recommendations. Shared across stores because it is never mutated. +var recommendedArticlesByViewer = map[string][]string{ + "v1": {"2", "3"}, // Alice → Advanced Federation + Cache Invalidation + "v2": {"1", "4"}, // Bob → Intro to Caching + Performance Tuning + "v3": {"1", "2", "3"}, // Charlie → all except Performance Tuning +} + +type listingKey struct { + SellerID string + SKU string +} + +// defaultListings is the seed data for a fresh listing store. +func defaultListings() map[listingKey]*model.Listing { + return map[listingKey]*model.Listing{ + {SellerID: "s1", SKU: "WIDGET-01"}: { + SellerID: "s1", + Sku: "WIDGET-01", + Title: "Premium Widget", + Price: 29.99, + Currency: "USD", + InStock: true, + }, + {SellerID: "s1", SKU: "GADGET-02"}: { + SellerID: "s1", + Sku: "GADGET-02", + Title: "Deluxe Gadget", + Price: 49.99, + Currency: "USD", + InStock: true, + }, + {SellerID: "s2", SKU: "GIZMO-01"}: { + SellerID: "s2", + Sku: "GIZMO-01", + Title: "Compact Gizmo", + Price: 19.50, + Currency: "EUR", + InStock: false, + }, + {SellerID: "s2", SKU: "THING-03"}: { + SellerID: "s2", + Sku: "THING-03", + Title: "Multi-Purpose Thing", + Price: 9.99, + Currency: "EUR", + InStock: true, + }, + } +} + +// articleStore is a mutex-guarded store for mutable article data. Used by the +// query, mutation, entity, and viewer resolvers. +type articleStore struct { + mu sync.RWMutex + articles []*model.Article +} + +func newArticleStore() *articleStore { + return &articleStore{articles: cloneArticles(defaultArticles)} +} + +func (s *articleStore) all() []*model.Article { + s.mu.RLock() + defer s.mu.RUnlock() + return cloneArticles(s.articles) +} + +func (s *articleStore) find(id string) *model.Article { + s.mu.RLock() + defer s.mu.RUnlock() + for _, a := range s.articles { + if a.ID == id { + return cloneArticle(a) + } + } + return nil +} + +func (s *articleStore) findBySlug(slug string) *model.Article { + s.mu.RLock() + defer s.mu.RUnlock() + for _, a := range s.articles { + if a.Slug == slug { + return cloneArticle(a) + } + } + return nil +} + +func (s *articleStore) byIDs(ids []string) []*model.Article { + idSet := make(map[string]struct{}, len(ids)) + for _, id := range ids { + idSet[id] = struct{}{} + } + s.mu.RLock() + defer s.mu.RUnlock() + var out []*model.Article + for _, a := range s.articles { + if _, ok := idSet[a.ID]; ok { + out = append(out, cloneArticle(a)) + } + } + return out +} + +func (s *articleStore) update(id, title string) *model.Article { + s.mu.Lock() + defer s.mu.Unlock() + for _, a := range s.articles { + if a.ID == id { + a.Title = title + return cloneArticle(a) + } + } + return nil +} + +func (s *articleStore) create(title, body, authorName string) *model.Article { + s.mu.Lock() + defer s.mu.Unlock() + id := fmt.Sprintf("%d", len(s.articles)+1) + a := &model.Article{ + ID: id, + Slug: "article-" + id, + Title: title, + Body: body, + AuthorName: authorName, + PublishedAt: time.Now().Format(time.RFC3339), + Tags: []string{}, + } + s.articles = append(s.articles, a) + return cloneArticle(a) +} + +func (s *articleStore) recommendedForViewer(viewerID string) []*model.Article { + ids := recommendedArticlesByViewer[viewerID] + if len(ids) == 0 { + return nil + } + s.mu.RLock() + defer s.mu.RUnlock() + var out []*model.Article + for _, id := range ids { + for _, a := range s.articles { + if a.ID == id { + out = append(out, cloneArticle(a)) + break + } + } + } + return out +} + +// listingStore is a mutex-guarded store for mutable listing data. +type listingStore struct { + mu sync.RWMutex + listings map[listingKey]*model.Listing +} + +func newListingStore() *listingStore { + return &listingStore{listings: defaultListings()} +} + +func (s *listingStore) get(sellerID, sku string) *model.Listing { + s.mu.RLock() + defer s.mu.RUnlock() + if l, ok := s.listings[listingKey{SellerID: sellerID, SKU: sku}]; ok { + return cloneListing(l) + } + return nil +} + +func (s *listingStore) all() []*model.Listing { + s.mu.RLock() + defer s.mu.RUnlock() + out := make([]*model.Listing, 0, len(s.listings)) + for _, l := range s.listings { + out = append(out, cloneListing(l)) + } + return out +} + +func (s *listingStore) delete(sellerID, sku string) *model.Listing { + k := listingKey{SellerID: sellerID, SKU: sku} + s.mu.Lock() + defer s.mu.Unlock() + l, ok := s.listings[k] + if !ok { + return nil + } + delete(s.listings, k) + return cloneListing(l) +} + +func cloneArticle(a *model.Article) *model.Article { + if a == nil { + return nil + } + c := *a + if a.Tags != nil { + c.Tags = append([]string(nil), a.Tags...) + } + return &c +} + +func cloneArticles(in []*model.Article) []*model.Article { + out := make([]*model.Article, len(in)) + for i, a := range in { + out[i] = cloneArticle(a) + } + return out +} + +func cloneListing(l *model.Listing) *model.Listing { + if l == nil { + return nil + } + c := *l + return &c +} + +// --- read-only seed data below (no writers) --- + +var venuesData = map[string]*model.Venue{ + "v1": { + Address: &model.Address{ID: "v1"}, + Name: "Grand Conference Hall", + Capacity: 500, + City: "Berlin", + }, + "v2": { + Address: &model.Address{ID: "v2"}, + Name: "Innovation Hub", + Capacity: 150, + City: "Munich", + }, + "v3": { + Address: &model.Address{ID: "v3"}, + Name: "Tech Campus Auditorium", + Capacity: 1000, + City: "Hamburg", + }, +} + +func allVenues() []*model.Venue { + out := make([]*model.Venue, 0, len(venuesData)) + for _, v := range venuesData { + out = append(out, v) + } + return out +} + +// UserProfile data — keyed by user ID, returns different data based on role +var userProfilesData = map[string]*model.UserProfile{ + "u1": {ID: "u1", Username: "alice", Email: "alice@example.com", Role: "admin"}, + "u2": {ID: "u2", Username: "bob", Email: "bob@example.com", Role: "editor"}, + "u3": {ID: "u3", Username: "charlie", Email: "charlie@example.com", Role: "viewer"}, +} + +// Catalog data — for partial cache load testing +var catalogsData = map[string]*model.Catalog{ + "c1": {ID: "c1", Name: "Electronics", Category: "tech", ItemCount: 342}, + "c2": {ID: "c2", Name: "Books", Category: "media", ItemCount: 1205}, + "c3": {ID: "c3", Name: "Clothing", Category: "fashion", ItemCount: 567}, +} + +func allCatalogs() []*model.Catalog { + out := make([]*model.Catalog, 0, len(catalogsData)) + for _, c := range catalogsData { + out = append(out, c) + } + sort.Slice(out, func(i, j int) bool { + return out[i].ID < out[j].ID + }) + return out +} + +// Metric data — for shadow mode testing +var metricsData = map[string]*model.Metric{ + "m1": {ID: "m1", Name: "requests_per_second", Value: 1523.7, Unit: "req/s"}, + "m2": {ID: "m2", Name: "error_rate", Value: 0.23, Unit: "percent"}, + "m3": {ID: "m3", Name: "p99_latency", Value: 42.5, Unit: "ms"}, +} diff --git a/demo/pkg/subgraphs/cachegraph/subgraph/data_race_test.go b/demo/pkg/subgraphs/cachegraph/subgraph/data_race_test.go new file mode 100644 index 0000000000..0898176ac3 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph/subgraph/data_race_test.go @@ -0,0 +1,160 @@ +package subgraph + +import ( + "context" + "fmt" + "sync" + "testing" + "time" + + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph/subgraph/model" +) + +// TestArticleStoreNoRace hammers an articleStore with concurrent readers, +// writers, and deletions for ~100ms. Run with `go test -race` to catch any +// unsynchronized access. Failure with -race manifests as a runtime "DATA RACE" +// report, not a test-level assertion. +func TestArticleStoreNoRace(t *testing.T) { + t.Parallel() + + store := newArticleStore() + start := make(chan struct{}) + var deadline time.Time + + var wg sync.WaitGroup + for w := range 4 { + wg.Go(func() { + <-start + for i := 0; time.Now().Before(deadline); i++ { + _ = store.create( + fmt.Sprintf("writer-%d-%d", w, i), + "body", + "author", + ) + } + }) + } + + for range 4 { + wg.Go(func() { + <-start + for time.Now().Before(deadline) { + _ = store.all() + _ = store.find("1") + _ = store.byIDs([]string{"1", "2", "3"}) + _ = store.recommendedForViewer("v1") + } + }) + } + + for range 2 { + wg.Go(func() { + <-start + for time.Now().Before(deadline) { + _ = store.update("1", "updated-title") + } + }) + } + + deadline = time.Now().Add(100 * time.Millisecond) + close(start) + wg.Wait() +} + +// TestListingStoreNoRace hammers a single listingStore with concurrent +// readers and deletions for ~100ms. Run with `go test -race` to catch any +// unsynchronized access. +func TestListingStoreNoRace(t *testing.T) { + t.Parallel() + + store := newListingStore() + start := make(chan struct{}) + var deadline time.Time + + var wg sync.WaitGroup + for range 4 { + wg.Go(func() { + <-start + for time.Now().Before(deadline) { + _ = store.all() + _ = store.get("s1", "WIDGET-01") + _ = store.get("s2", "GIZMO-01") + } + }) + } + + // Writers: attempt to delete the same keys repeatedly on the shared store. + // Delete is idempotent once the key is gone, so the read paths still see a + // shrinking-then-empty map while concurrent iteration happens in all(). + for range 2 { + wg.Go(func() { + <-start + for time.Now().Before(deadline) { + _ = store.delete("s1", "WIDGET-01") + _ = store.delete("s1", "GADGET-02") + _ = store.delete("s2", "GIZMO-01") + _ = store.delete("s2", "THING-03") + } + }) + } + + deadline = time.Now().Add(100 * time.Millisecond) + close(start) + wg.Wait() +} + +// TestResolverPathNoRace drives concurrent read + write traffic through the +// generated gqlgen resolver layer (mutationResolver / queryResolver / +// viewerResolver) for ~100ms. This guards against regressions where a resolver +// bypasses the mutex-guarded stores (e.g. by reintroducing a package-level +// global). Run with `go test -race` to catch any unsynchronized access. +func TestResolverPathNoRace(t *testing.T) { + t.Parallel() + + root := NewResolver() + mut := &mutationResolver{root} + qry := &queryResolver{root} + vwr := &viewerResolver{root} + ctx := context.Background() + start := make(chan struct{}) + var deadline time.Time + + var wg sync.WaitGroup + + // Writers: exercise every mutation resolver. + for w := range 4 { + wg.Go(func() { + <-start + for i := 0; time.Now().Before(deadline); i++ { + _, _ = mut.CreateArticle( + ctx, + fmt.Sprintf("resolver-writer-%d-%d", w, i), + "body", + "author", + ) + _, _ = mut.UpdateArticle(ctx, "1", fmt.Sprintf("updated-%d-%d", w, i)) + _, _ = mut.DeleteListing(ctx, model.ListingKey{SellerID: "s1", Sku: "WIDGET-01"}) + } + }) + } + + // Readers: exercise every query resolver plus the viewer field resolver. + viewer := &model.Viewer{ID: "v1"} + for range 8 { + wg.Go(func() { + <-start + for time.Now().Before(deadline) { + _, _ = qry.Article(ctx, "1") + _, _ = qry.Articles(ctx) + _, _ = qry.ArticlesByIds(ctx, []string{"1", "2", "3"}) + _, _ = qry.Listing(ctx, model.ListingKey{SellerID: "s1", Sku: "WIDGET-01"}) + _, _ = qry.Listings(ctx) + _, _ = vwr.RecommendedArticles(ctx, viewer) + } + }) + } + + deadline = time.Now().Add(100 * time.Millisecond) + close(start) + wg.Wait() +} diff --git a/demo/pkg/subgraphs/cachegraph/subgraph/data_test.go b/demo/pkg/subgraphs/cachegraph/subgraph/data_test.go new file mode 100644 index 0000000000..1efa8b517c --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph/subgraph/data_test.go @@ -0,0 +1,28 @@ +package subgraph + +import ( + "testing" +) + +func TestAllCatalogsReturnsStableIDOrder(t *testing.T) { + expected := []string{"c1", "c2", "c3"} + for attempt := 0; attempt < 200; attempt++ { + catalogs := allCatalogs() + + if len(catalogs) != len(expected) { + t.Fatalf("expected %d catalogs, got %d", len(expected), len(catalogs)) + } + + for index, id := range expected { + if catalogs[index].ID != id { + t.Fatalf( + "attempt %d: expected catalog %d to be %s, got %s", + attempt, + index, + id, + catalogs[index].ID, + ) + } + } + } +} diff --git a/demo/pkg/subgraphs/cachegraph/subgraph/entity.resolvers.go b/demo/pkg/subgraphs/cachegraph/subgraph/entity.resolvers.go new file mode 100644 index 0000000000..441bcaaffd --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph/subgraph/entity.resolvers.go @@ -0,0 +1,66 @@ +package subgraph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.76 + +import ( + "context" + + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph/subgraph/generated" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph/subgraph/model" +) + +// FindArticleByID is the resolver for the findArticleByID field. +func (r *entityResolver) FindArticleByID(ctx context.Context, id string) (*model.Article, error) { + return r.articles.find(id), nil +} + +// FindArticleBySlug is the resolver for the findArticleBySlug field. +func (r *entityResolver) FindArticleBySlug(ctx context.Context, slug string) (*model.Article, error) { + return r.articles.findBySlug(slug), nil +} + +// FindCatalogByID is the resolver for the findCatalogByID field. +func (r *entityResolver) FindCatalogByID(ctx context.Context, id string) (*model.Catalog, error) { + return catalogsData[id], nil +} + +// FindListingBySellerIDAndSku is the resolver for the findListingBySellerIDAndSku field. +func (r *entityResolver) FindListingBySellerIDAndSku(ctx context.Context, sellerID string, sku string) (*model.Listing, error) { + return r.listings.get(sellerID, sku), nil +} + +// FindMetricByID is the resolver for the findMetricByID field. +func (r *entityResolver) FindMetricByID(ctx context.Context, id string) (*model.Metric, error) { + return metricsData[id], nil +} + +// FindPersonalizedByID is the resolver for the findPersonalizedByID field. +// Returns the Article matching the ID (Article implements Personalized). +func (r *entityResolver) FindPersonalizedByID(ctx context.Context, id string) (model.Personalized, error) { + if a := r.articles.find(id); a != nil { + return a, nil + } + return nil, nil +} + +// FindUserProfileByID is the resolver for the findUserProfileByID field. +func (r *entityResolver) FindUserProfileByID(ctx context.Context, id string) (*model.UserProfile, error) { + return userProfilesData[id], nil +} + +// FindVenueByAddressID is the resolver for the findVenueByAddressID field. +func (r *entityResolver) FindVenueByAddressID(ctx context.Context, addressID string) (*model.Venue, error) { + return venuesData[addressID], nil +} + +// FindViewerByID is the resolver for the findViewerByID field. +func (r *entityResolver) FindViewerByID(ctx context.Context, id string) (*model.Viewer, error) { + return &model.Viewer{ID: id}, nil +} + +// Entity returns generated.EntityResolver implementation. +func (r *Resolver) Entity() generated.EntityResolver { return &entityResolver{r} } + +type entityResolver struct{ *Resolver } diff --git a/demo/pkg/subgraphs/cachegraph/subgraph/generated/federation.go b/demo/pkg/subgraphs/cachegraph/subgraph/generated/federation.go new file mode 100644 index 0000000000..2c3f3b1adf --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph/subgraph/generated/federation.go @@ -0,0 +1,676 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "strings" + "sync" + + "github.com/99designs/gqlgen/plugin/federation/fedruntime" +) + +var ( + ErrUnknownType = errors.New("unknown type") + ErrTypeNotFound = errors.New("type not found") +) + +func (ec *executionContext) __resolve__service(ctx context.Context) (fedruntime.Service, error) { + if ec.DisableIntrospection { + return fedruntime.Service{}, errors.New("federated introspection disabled") + } + + var sdl []string + + for _, src := range sources { + if src.BuiltIn { + continue + } + sdl = append(sdl, src.Input) + } + + return fedruntime.Service{ + SDL: strings.Join(sdl, "\n"), + }, nil +} + +func (ec *executionContext) __resolve_entities(ctx context.Context, representations []map[string]any) []fedruntime.Entity { + list := make([]fedruntime.Entity, len(representations)) + + repsMap := ec.buildRepresentationGroups(ctx, representations) + + switch len(repsMap) { + case 0: + return list + case 1: + for typeName, reps := range repsMap { + ec.resolveEntityGroup(ctx, typeName, reps, list) + } + return list + default: + var g sync.WaitGroup + g.Add(len(repsMap)) + for typeName, reps := range repsMap { + go func(typeName string, reps []EntityWithIndex) { + ec.resolveEntityGroup(ctx, typeName, reps, list) + g.Done() + }(typeName, reps) + } + g.Wait() + return list + } +} + +type EntityWithIndex struct { + // The index in the original representation array + index int + entity EntityRepresentation +} + +// EntityRepresentation is the JSON representation of an entity sent by the Router +// used as the inputs for us to resolve. +// +// We make it a map because we know the top level JSON is always an object. +type EntityRepresentation map[string]any + +// We group entities by typename so that we can parallelize their resolution. +// This is particularly helpful when there are entity groups in multi mode. +func (ec *executionContext) buildRepresentationGroups( + ctx context.Context, + representations []map[string]any, +) map[string][]EntityWithIndex { + repsMap := make(map[string][]EntityWithIndex) + for i, rep := range representations { + typeName, ok := rep["__typename"].(string) + if !ok { + // If there is no __typename, we just skip the representation; + // we just won't be resolving these unknown types. + ec.Error(ctx, errors.New("__typename must be an existing string")) + continue + } + + repsMap[typeName] = append(repsMap[typeName], EntityWithIndex{ + index: i, + entity: rep, + }) + } + + return repsMap +} + +func (ec *executionContext) resolveEntityGroup( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) { + if isMulti(typeName) { + err := ec.resolveManyEntities(ctx, typeName, reps, list) + if err != nil { + ec.Error(ctx, err) + } + } else { + // if there are multiple entities to resolve, parallelize (similar to + // graphql.FieldSet.Dispatch) + var e sync.WaitGroup + e.Add(len(reps)) + for i, rep := range reps { + i, rep := i, rep + go func(i int, rep EntityWithIndex) { + entity, err := ec.resolveEntity(ctx, typeName, rep.entity) + if err != nil { + ec.Error(ctx, err) + } else { + list[rep.index] = entity + } + e.Done() + }(i, rep) + } + e.Wait() + } +} + +func isMulti(typeName string) bool { + switch typeName { + default: + return false + } +} + +func (ec *executionContext) resolveEntity( + ctx context.Context, + typeName string, + rep EntityRepresentation, +) (e fedruntime.Entity, err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + case "Article": + resolverName, err := entityResolverNameForArticle(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Article": %w`, err) + } + switch resolverName { + + case "findArticleByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findArticleByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindArticleByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Article": %w`, err) + } + + return entity, nil + case "findArticleBySlug": + id0, err := ec.unmarshalNString2string(ctx, rep["slug"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findArticleBySlug(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindArticleBySlug(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Article": %w`, err) + } + + return entity, nil + } + case "Catalog": + resolverName, err := entityResolverNameForCatalog(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Catalog": %w`, err) + } + switch resolverName { + + case "findCatalogByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findCatalogByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindCatalogByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Catalog": %w`, err) + } + + return entity, nil + } + case "Listing": + resolverName, err := entityResolverNameForListing(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Listing": %w`, err) + } + switch resolverName { + + case "findListingBySellerIDAndSku": + id0, err := ec.unmarshalNID2string(ctx, rep["sellerId"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findListingBySellerIDAndSku(): %w`, err) + } + id1, err := ec.unmarshalNString2string(ctx, rep["sku"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 1 for findListingBySellerIDAndSku(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindListingBySellerIDAndSku(ctx, id0, id1) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Listing": %w`, err) + } + + return entity, nil + } + case "Metric": + resolverName, err := entityResolverNameForMetric(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Metric": %w`, err) + } + switch resolverName { + + case "findMetricByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findMetricByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindMetricByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Metric": %w`, err) + } + + return entity, nil + } + case "Personalized": + resolverName, err := entityResolverNameForPersonalized(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Personalized": %w`, err) + } + switch resolverName { + + case "findPersonalizedByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findPersonalizedByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindPersonalizedByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Personalized": %w`, err) + } + + return entity, nil + } + case "UserProfile": + resolverName, err := entityResolverNameForUserProfile(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "UserProfile": %w`, err) + } + switch resolverName { + + case "findUserProfileByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findUserProfileByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindUserProfileByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "UserProfile": %w`, err) + } + + return entity, nil + } + case "Venue": + resolverName, err := entityResolverNameForVenue(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Venue": %w`, err) + } + switch resolverName { + + case "findVenueByAddressID": + id0, err := ec.unmarshalNID2string(ctx, rep["address"].(map[string]any)["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findVenueByAddressID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindVenueByAddressID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Venue": %w`, err) + } + + return entity, nil + } + case "Viewer": + resolverName, err := entityResolverNameForViewer(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Viewer": %w`, err) + } + switch resolverName { + + case "findViewerByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findViewerByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindViewerByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Viewer": %w`, err) + } + + return entity, nil + } + + } + return nil, fmt.Errorf("%w: %s", ErrUnknownType, typeName) +} + +func (ec *executionContext) resolveManyEntities( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) (err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + + default: + return errors.New("unknown type: " + typeName) + } +} + +func entityResolverNameForArticle(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Article", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Article", ErrTypeNotFound)) + break + } + return "findArticleByID", nil + } + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["slug"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"slug\" for Article", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Article", ErrTypeNotFound)) + break + } + return "findArticleBySlug", nil + } + return "", fmt.Errorf("%w for Article due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForCatalog(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Catalog", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Catalog", ErrTypeNotFound)) + break + } + return "findCatalogByID", nil + } + return "", fmt.Errorf("%w for Catalog due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForListing(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["sellerId"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"sellerId\" for Listing", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + m = rep + val, ok = m["sku"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"sku\" for Listing", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Listing", ErrTypeNotFound)) + break + } + return "findListingBySellerIDAndSku", nil + } + return "", fmt.Errorf("%w for Listing due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForMetric(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Metric", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Metric", ErrTypeNotFound)) + break + } + return "findMetricByID", nil + } + return "", fmt.Errorf("%w for Metric due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForPersonalized(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Personalized", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Personalized", ErrTypeNotFound)) + break + } + return "findPersonalizedByID", nil + } + return "", fmt.Errorf("%w for Personalized due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForUserProfile(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for UserProfile", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for UserProfile", ErrTypeNotFound)) + break + } + return "findUserProfileByID", nil + } + return "", fmt.Errorf("%w for UserProfile due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForVenue(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["address"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"address\" for Venue", ErrTypeNotFound)) + break + } + if m, ok = val.(map[string]any); !ok { + // nested field value is not a map[string]interface so don't use it + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to nested Key Field \"address\" value not matching map[string]any for Venue", ErrTypeNotFound)) + break + } + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Venue", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Venue", ErrTypeNotFound)) + break + } + return "findVenueByAddressID", nil + } + return "", fmt.Errorf("%w for Venue due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForViewer(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Viewer", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Viewer", ErrTypeNotFound)) + break + } + return "findViewerByID", nil + } + return "", fmt.Errorf("%w for Viewer due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} diff --git a/demo/pkg/subgraphs/cachegraph/subgraph/generated/generated.go b/demo/pkg/subgraphs/cachegraph/subgraph/generated/generated.go new file mode 100644 index 0000000000..b5eb54dc39 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph/subgraph/generated/generated.go @@ -0,0 +1,10038 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "bytes" + "context" + "errors" + "fmt" + "strconv" + "sync" + "sync/atomic" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/introspection" + "github.com/99designs/gqlgen/plugin/federation/fedruntime" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph/subgraph/model" +) + +// region ************************** generated!.gotpl ************************** + +// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. +func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { + return &executableSchema{ + schema: cfg.Schema, + resolvers: cfg.Resolvers, + directives: cfg.Directives, + complexity: cfg.Complexity, + } +} + +type Config struct { + Schema *ast.Schema + Resolvers ResolverRoot + Directives DirectiveRoot + Complexity ComplexityRoot +} + +type ResolverRoot interface { + Entity() EntityResolver + Mutation() MutationResolver + Query() QueryResolver + Viewer() ViewerResolver +} + +type DirectiveRoot struct { +} + +type ComplexityRoot struct { + Address struct { + ID func(childComplexity int) int + } + + Article struct { + AuthorName func(childComplexity int) int + Body func(childComplexity int) int + ID func(childComplexity int) int + PublishedAt func(childComplexity int) int + Slug func(childComplexity int) int + Tags func(childComplexity int) int + Title func(childComplexity int) int + } + + Catalog struct { + Category func(childComplexity int) int + ID func(childComplexity int) int + ItemCount func(childComplexity int) int + Name func(childComplexity int) int + } + + Entity struct { + FindArticleByID func(childComplexity int, id string) int + FindArticleBySlug func(childComplexity int, slug string) int + FindCatalogByID func(childComplexity int, id string) int + FindListingBySellerIDAndSku func(childComplexity int, sellerID string, sku string) int + FindMetricByID func(childComplexity int, id string) int + FindPersonalizedByID func(childComplexity int, id string) int + FindUserProfileByID func(childComplexity int, id string) int + FindVenueByAddressID func(childComplexity int, addressID string) int + FindViewerByID func(childComplexity int, id string) int + } + + Listing struct { + Currency func(childComplexity int) int + InStock func(childComplexity int) int + Price func(childComplexity int) int + SellerID func(childComplexity int) int + Sku func(childComplexity int) int + Title func(childComplexity int) int + } + + Metric struct { + ID func(childComplexity int) int + Name func(childComplexity int) int + Unit func(childComplexity int) int + Value func(childComplexity int) int + } + + Mutation struct { + CreateArticle func(childComplexity int, title string, body string, authorName string) int + DeleteListing func(childComplexity int, key model.ListingKey) int + UpdateArticle func(childComplexity int, id string, title string) int + } + + Query struct { + Article func(childComplexity int, id string) int + ArticleBySlug func(childComplexity int, slug string) int + Articles func(childComplexity int) int + ArticlesByIds func(childComplexity int, ids []string) int + Catalog func(childComplexity int, id string) int + Catalogs func(childComplexity int) int + Listing func(childComplexity int, key model.ListingKey) int + Listings func(childComplexity int) int + Metric func(childComplexity int, id string) int + UserProfile func(childComplexity int, id string) int + Venue func(childComplexity int, location model.VenueLocationKey) int + Venues func(childComplexity int) int + __resolve__service func(childComplexity int) int + __resolve_entities func(childComplexity int, representations []map[string]any) int + } + + UserProfile struct { + Email func(childComplexity int) int + ID func(childComplexity int) int + Role func(childComplexity int) int + Username func(childComplexity int) int + } + + Venue struct { + Address func(childComplexity int) int + Capacity func(childComplexity int) int + City func(childComplexity int) int + Name func(childComplexity int) int + } + + Viewer struct { + ID func(childComplexity int) int + RecommendedArticles func(childComplexity int) int + } + + _Service struct { + SDL func(childComplexity int) int + } +} + +type EntityResolver interface { + FindArticleByID(ctx context.Context, id string) (*model.Article, error) + FindArticleBySlug(ctx context.Context, slug string) (*model.Article, error) + FindCatalogByID(ctx context.Context, id string) (*model.Catalog, error) + FindListingBySellerIDAndSku(ctx context.Context, sellerID string, sku string) (*model.Listing, error) + FindMetricByID(ctx context.Context, id string) (*model.Metric, error) + FindPersonalizedByID(ctx context.Context, id string) (model.Personalized, error) + FindUserProfileByID(ctx context.Context, id string) (*model.UserProfile, error) + FindVenueByAddressID(ctx context.Context, addressID string) (*model.Venue, error) + FindViewerByID(ctx context.Context, id string) (*model.Viewer, error) +} +type MutationResolver interface { + UpdateArticle(ctx context.Context, id string, title string) (*model.Article, error) + CreateArticle(ctx context.Context, title string, body string, authorName string) (*model.Article, error) + DeleteListing(ctx context.Context, key model.ListingKey) (*model.Listing, error) +} +type QueryResolver interface { + Article(ctx context.Context, id string) (*model.Article, error) + Articles(ctx context.Context) ([]*model.Article, error) + ArticlesByIds(ctx context.Context, ids []string) ([]*model.Article, error) + ArticleBySlug(ctx context.Context, slug string) (*model.Article, error) + Listing(ctx context.Context, key model.ListingKey) (*model.Listing, error) + Listings(ctx context.Context) ([]*model.Listing, error) + Venue(ctx context.Context, location model.VenueLocationKey) (*model.Venue, error) + Venues(ctx context.Context) ([]*model.Venue, error) + UserProfile(ctx context.Context, id string) (*model.UserProfile, error) + Catalog(ctx context.Context, id string) (*model.Catalog, error) + Catalogs(ctx context.Context) ([]*model.Catalog, error) + Metric(ctx context.Context, id string) (*model.Metric, error) +} +type ViewerResolver interface { + RecommendedArticles(ctx context.Context, obj *model.Viewer) ([]*model.Article, error) +} + +type executableSchema struct { + schema *ast.Schema + resolvers ResolverRoot + directives DirectiveRoot + complexity ComplexityRoot +} + +func (e *executableSchema) Schema() *ast.Schema { + if e.schema != nil { + return e.schema + } + return parsedSchema +} + +func (e *executableSchema) Complexity(ctx context.Context, typeName, field string, childComplexity int, rawArgs map[string]any) (int, bool) { + ec := executionContext{nil, e, 0, 0, nil} + _ = ec + switch typeName + "." + field { + + case "Address.id": + if e.complexity.Address.ID == nil { + break + } + + return e.complexity.Address.ID(childComplexity), true + + case "Article.authorName": + if e.complexity.Article.AuthorName == nil { + break + } + + return e.complexity.Article.AuthorName(childComplexity), true + + case "Article.body": + if e.complexity.Article.Body == nil { + break + } + + return e.complexity.Article.Body(childComplexity), true + + case "Article.id": + if e.complexity.Article.ID == nil { + break + } + + return e.complexity.Article.ID(childComplexity), true + + case "Article.publishedAt": + if e.complexity.Article.PublishedAt == nil { + break + } + + return e.complexity.Article.PublishedAt(childComplexity), true + + case "Article.slug": + if e.complexity.Article.Slug == nil { + break + } + + return e.complexity.Article.Slug(childComplexity), true + + case "Article.tags": + if e.complexity.Article.Tags == nil { + break + } + + return e.complexity.Article.Tags(childComplexity), true + + case "Article.title": + if e.complexity.Article.Title == nil { + break + } + + return e.complexity.Article.Title(childComplexity), true + + case "Catalog.category": + if e.complexity.Catalog.Category == nil { + break + } + + return e.complexity.Catalog.Category(childComplexity), true + + case "Catalog.id": + if e.complexity.Catalog.ID == nil { + break + } + + return e.complexity.Catalog.ID(childComplexity), true + + case "Catalog.itemCount": + if e.complexity.Catalog.ItemCount == nil { + break + } + + return e.complexity.Catalog.ItemCount(childComplexity), true + + case "Catalog.name": + if e.complexity.Catalog.Name == nil { + break + } + + return e.complexity.Catalog.Name(childComplexity), true + + case "Entity.findArticleByID": + if e.complexity.Entity.FindArticleByID == nil { + break + } + + args, err := ec.field_Entity_findArticleByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindArticleByID(childComplexity, args["id"].(string)), true + + case "Entity.findArticleBySlug": + if e.complexity.Entity.FindArticleBySlug == nil { + break + } + + args, err := ec.field_Entity_findArticleBySlug_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindArticleBySlug(childComplexity, args["slug"].(string)), true + + case "Entity.findCatalogByID": + if e.complexity.Entity.FindCatalogByID == nil { + break + } + + args, err := ec.field_Entity_findCatalogByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindCatalogByID(childComplexity, args["id"].(string)), true + + case "Entity.findListingBySellerIDAndSku": + if e.complexity.Entity.FindListingBySellerIDAndSku == nil { + break + } + + args, err := ec.field_Entity_findListingBySellerIDAndSku_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindListingBySellerIDAndSku(childComplexity, args["sellerID"].(string), args["sku"].(string)), true + + case "Entity.findMetricByID": + if e.complexity.Entity.FindMetricByID == nil { + break + } + + args, err := ec.field_Entity_findMetricByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindMetricByID(childComplexity, args["id"].(string)), true + + case "Entity.findPersonalizedByID": + if e.complexity.Entity.FindPersonalizedByID == nil { + break + } + + args, err := ec.field_Entity_findPersonalizedByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindPersonalizedByID(childComplexity, args["id"].(string)), true + + case "Entity.findUserProfileByID": + if e.complexity.Entity.FindUserProfileByID == nil { + break + } + + args, err := ec.field_Entity_findUserProfileByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindUserProfileByID(childComplexity, args["id"].(string)), true + + case "Entity.findVenueByAddressID": + if e.complexity.Entity.FindVenueByAddressID == nil { + break + } + + args, err := ec.field_Entity_findVenueByAddressID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindVenueByAddressID(childComplexity, args["addressID"].(string)), true + + case "Entity.findViewerByID": + if e.complexity.Entity.FindViewerByID == nil { + break + } + + args, err := ec.field_Entity_findViewerByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindViewerByID(childComplexity, args["id"].(string)), true + + case "Listing.currency": + if e.complexity.Listing.Currency == nil { + break + } + + return e.complexity.Listing.Currency(childComplexity), true + + case "Listing.inStock": + if e.complexity.Listing.InStock == nil { + break + } + + return e.complexity.Listing.InStock(childComplexity), true + + case "Listing.price": + if e.complexity.Listing.Price == nil { + break + } + + return e.complexity.Listing.Price(childComplexity), true + + case "Listing.sellerId": + if e.complexity.Listing.SellerID == nil { + break + } + + return e.complexity.Listing.SellerID(childComplexity), true + + case "Listing.sku": + if e.complexity.Listing.Sku == nil { + break + } + + return e.complexity.Listing.Sku(childComplexity), true + + case "Listing.title": + if e.complexity.Listing.Title == nil { + break + } + + return e.complexity.Listing.Title(childComplexity), true + + case "Metric.id": + if e.complexity.Metric.ID == nil { + break + } + + return e.complexity.Metric.ID(childComplexity), true + + case "Metric.name": + if e.complexity.Metric.Name == nil { + break + } + + return e.complexity.Metric.Name(childComplexity), true + + case "Metric.unit": + if e.complexity.Metric.Unit == nil { + break + } + + return e.complexity.Metric.Unit(childComplexity), true + + case "Metric.value": + if e.complexity.Metric.Value == nil { + break + } + + return e.complexity.Metric.Value(childComplexity), true + + case "Mutation.createArticle": + if e.complexity.Mutation.CreateArticle == nil { + break + } + + args, err := ec.field_Mutation_createArticle_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateArticle(childComplexity, args["title"].(string), args["body"].(string), args["authorName"].(string)), true + + case "Mutation.deleteListing": + if e.complexity.Mutation.DeleteListing == nil { + break + } + + args, err := ec.field_Mutation_deleteListing_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteListing(childComplexity, args["key"].(model.ListingKey)), true + + case "Mutation.updateArticle": + if e.complexity.Mutation.UpdateArticle == nil { + break + } + + args, err := ec.field_Mutation_updateArticle_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateArticle(childComplexity, args["id"].(string), args["title"].(string)), true + + case "Query.article": + if e.complexity.Query.Article == nil { + break + } + + args, err := ec.field_Query_article_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Article(childComplexity, args["id"].(string)), true + + case "Query.articleBySlug": + if e.complexity.Query.ArticleBySlug == nil { + break + } + + args, err := ec.field_Query_articleBySlug_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.ArticleBySlug(childComplexity, args["slug"].(string)), true + + case "Query.articles": + if e.complexity.Query.Articles == nil { + break + } + + return e.complexity.Query.Articles(childComplexity), true + + case "Query.articlesByIds": + if e.complexity.Query.ArticlesByIds == nil { + break + } + + args, err := ec.field_Query_articlesByIds_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.ArticlesByIds(childComplexity, args["ids"].([]string)), true + + case "Query.catalog": + if e.complexity.Query.Catalog == nil { + break + } + + args, err := ec.field_Query_catalog_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Catalog(childComplexity, args["id"].(string)), true + + case "Query.catalogs": + if e.complexity.Query.Catalogs == nil { + break + } + + return e.complexity.Query.Catalogs(childComplexity), true + + case "Query.listing": + if e.complexity.Query.Listing == nil { + break + } + + args, err := ec.field_Query_listing_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Listing(childComplexity, args["key"].(model.ListingKey)), true + + case "Query.listings": + if e.complexity.Query.Listings == nil { + break + } + + return e.complexity.Query.Listings(childComplexity), true + + case "Query.metric": + if e.complexity.Query.Metric == nil { + break + } + + args, err := ec.field_Query_metric_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Metric(childComplexity, args["id"].(string)), true + + case "Query.userProfile": + if e.complexity.Query.UserProfile == nil { + break + } + + args, err := ec.field_Query_userProfile_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.UserProfile(childComplexity, args["id"].(string)), true + + case "Query.venue": + if e.complexity.Query.Venue == nil { + break + } + + args, err := ec.field_Query_venue_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Venue(childComplexity, args["location"].(model.VenueLocationKey)), true + + case "Query.venues": + if e.complexity.Query.Venues == nil { + break + } + + return e.complexity.Query.Venues(childComplexity), true + + case "Query._service": + if e.complexity.Query.__resolve__service == nil { + break + } + + return e.complexity.Query.__resolve__service(childComplexity), true + + case "Query._entities": + if e.complexity.Query.__resolve_entities == nil { + break + } + + args, err := ec.field_Query__entities_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.__resolve_entities(childComplexity, args["representations"].([]map[string]any)), true + + case "UserProfile.email": + if e.complexity.UserProfile.Email == nil { + break + } + + return e.complexity.UserProfile.Email(childComplexity), true + + case "UserProfile.id": + if e.complexity.UserProfile.ID == nil { + break + } + + return e.complexity.UserProfile.ID(childComplexity), true + + case "UserProfile.role": + if e.complexity.UserProfile.Role == nil { + break + } + + return e.complexity.UserProfile.Role(childComplexity), true + + case "UserProfile.username": + if e.complexity.UserProfile.Username == nil { + break + } + + return e.complexity.UserProfile.Username(childComplexity), true + + case "Venue.address": + if e.complexity.Venue.Address == nil { + break + } + + return e.complexity.Venue.Address(childComplexity), true + + case "Venue.capacity": + if e.complexity.Venue.Capacity == nil { + break + } + + return e.complexity.Venue.Capacity(childComplexity), true + + case "Venue.city": + if e.complexity.Venue.City == nil { + break + } + + return e.complexity.Venue.City(childComplexity), true + + case "Venue.name": + if e.complexity.Venue.Name == nil { + break + } + + return e.complexity.Venue.Name(childComplexity), true + + case "Viewer.id": + if e.complexity.Viewer.ID == nil { + break + } + + return e.complexity.Viewer.ID(childComplexity), true + + case "Viewer.recommendedArticles": + if e.complexity.Viewer.RecommendedArticles == nil { + break + } + + return e.complexity.Viewer.RecommendedArticles(childComplexity), true + + case "_Service.sdl": + if e.complexity._Service.SDL == nil { + break + } + + return e.complexity._Service.SDL(childComplexity), true + + } + return 0, false +} + +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + opCtx := graphql.GetOperationContext(ctx) + ec := executionContext{opCtx, e, 0, 0, make(chan graphql.DeferredResult)} + inputUnmarshalMap := graphql.BuildUnmarshalerMap( + ec.unmarshalInputListingKey, + ec.unmarshalInputVenueAddressKey, + ec.unmarshalInputVenueLocationKey, + ) + first := true + + switch opCtx.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + var response graphql.Response + var data graphql.Marshaler + if first { + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data = ec._Query(ctx, opCtx.Operation.SelectionSet) + } else { + if atomic.LoadInt32(&ec.pendingDeferred) > 0 { + result := <-ec.deferredResults + atomic.AddInt32(&ec.pendingDeferred, -1) + data = result.Result + response.Path = result.Path + response.Label = result.Label + response.Errors = result.Errors + } else { + return nil + } + } + var buf bytes.Buffer + data.MarshalGQL(&buf) + response.Data = buf.Bytes() + if atomic.LoadInt32(&ec.deferred) > 0 { + hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 + response.HasNext = &hasNext + } + + return &response + } + case ast.Mutation: + return func(ctx context.Context) *graphql.Response { + if !first { + return nil + } + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data := ec._Mutation(ctx, opCtx.Operation.SelectionSet) + var buf bytes.Buffer + data.MarshalGQL(&buf) + + return &graphql.Response{ + Data: buf.Bytes(), + } + } + + default: + return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) + } +} + +type executionContext struct { + *graphql.OperationContext + *executableSchema + deferred int32 + pendingDeferred int32 + deferredResults chan graphql.DeferredResult +} + +func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) { + atomic.AddInt32(&ec.pendingDeferred, 1) + go func() { + ctx := graphql.WithFreshResponseContext(dg.Context) + dg.FieldSet.Dispatch(ctx) + ds := graphql.DeferredResult{ + Path: dg.Path, + Label: dg.Label, + Result: dg.FieldSet, + Errors: graphql.GetErrors(ctx), + } + // null fields should bubble up + if dg.FieldSet.Invalids > 0 { + ds.Result = graphql.Null + } + ec.deferredResults <- ds + }() +} + +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(ec.Schema()), nil +} + +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil +} + +var sources = []*ast.Source{ + {Name: "../schema.graphqls", Input: `extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key"] + ) + +directive @openfed__entityCache( + maxAge: Int! + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT + +directive @openfed__queryCache( + maxAge: Int! + includeHeaders: Boolean = false + shadowMode: Boolean = false +) on FIELD_DEFINITION + +directive @openfed__cacheInvalidate on FIELD_DEFINITION + +directive @openfed__cachePopulate(maxAge: Int) on FIELD_DEFINITION + +directive @openfed__is(fields: String!) on ARGUMENT_DEFINITION + +type Query { + """Simple key lookup""" + article(id: ID!): Article @openfed__queryCache(maxAge: 120) + """List query""" + articles: [Article!]! @openfed__queryCache(maxAge: 120) + """Batch lookup with @openfed__is""" + articlesByIds(ids: [ID!]! @openfed__is(fields: "id")): [Article!]! @openfed__queryCache(maxAge: 120) + """Argument remapping via @openfed__is""" + articleBySlug(slug: String! @openfed__is(fields: "slug")): Article @openfed__queryCache(maxAge: 120) + + """Composite key lookup via input object with @openfed__is""" + listing(key: ListingKey! @openfed__is(fields: "sellerId sku")): Listing @openfed__queryCache(maxAge: 60) + """List of all listings""" + listings: [Listing!]! @openfed__queryCache(maxAge: 60) + + """Nested key lookup with @openfed__is and input object""" + venue(location: VenueLocationKey! @openfed__is(fields: "address { id }")): Venue @openfed__queryCache(maxAge: 180) + """List of all venues""" + venues: [Venue!]! @openfed__queryCache(maxAge: 180) + + """Per-user profile (cache varies by Authorization header)""" + userProfile(id: ID!): UserProfile @openfed__queryCache(maxAge: 60, includeHeaders: true) + + """Single catalog entry""" + catalog(id: ID!): Catalog @openfed__queryCache(maxAge: 120) + """All catalog entries (for partial cache load testing)""" + catalogs: [Catalog!]! @openfed__queryCache(maxAge: 120) + + """Single metric (shadow mode - always fetches from subgraph, compares with cache)""" + metric(id: ID!): Metric @openfed__queryCache(maxAge: 300, shadowMode: true) +} + +type Mutation { + updateArticle(id: ID!, title: String!): Article @openfed__cacheInvalidate + createArticle(title: String!, body: String!, authorName: String!): Article! @openfed__cachePopulate(maxAge: 30) + deleteListing(key: ListingKey!): Listing @openfed__cacheInvalidate +} + +"""Per-user caching: includeHeaders makes the cache key include a hash of forwarded headers (e.g. Authorization)""" +type UserProfile @key(fields: "id") @openfed__entityCache(maxAge: 60, includeHeaders: true) { + id: ID! + username: String! + email: String! + role: String! +} + +"""Partial cache load: when some entities are cached and others aren't, only the missing ones are fetched""" +type Catalog @key(fields: "id") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) { + id: ID! + name: String! + category: String! + itemCount: Int! +} + +"""Shadow mode: always fetches from subgraph but compares with cache for staleness detection""" +type Metric @key(fields: "id") @openfed__entityCache(maxAge: 300, shadowMode: true) { + id: ID! + name: String! + value: Float! + unit: String! +} + +input ListingKey { + sellerId: ID! + sku: String! +} + +input VenueLocationKey { + address: VenueAddressKey! +} + +input VenueAddressKey { + id: ID! +} + +interface Personalized @key(fields: "id") { + id: ID! +} + +type Viewer @key(fields: "id") { + id: ID! + recommendedArticles: [Article!]! +} + +type Article implements Personalized @key(fields: "id") @key(fields: "slug") @openfed__entityCache(maxAge: 120) { + id: ID! + slug: String! + title: String! + body: String! + authorName: String! + publishedAt: String! + tags: [String!]! +} + +type Listing @key(fields: "sellerId sku") @openfed__entityCache(maxAge: 60) { + sellerId: ID! + sku: String! + title: String! + price: Float! + currency: String! + inStock: Boolean! +} + +type Address { + id: ID! +} + +type Venue @key(fields: "address { id }") @openfed__entityCache(maxAge: 180) { + address: Address! + name: String! + capacity: Int! + city: String! +} +`, BuiltIn: false}, + {Name: "../../federation/directives.graphql", Input: ` + directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM + directive @composeDirective(name: String!) repeatable on SCHEMA + directive @extends on OBJECT | INTERFACE + directive @external on OBJECT | FIELD_DEFINITION + directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE + directive @inaccessible on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + directive @interfaceObject on OBJECT + directive @link(import: [String!], url: String!) repeatable on SCHEMA + directive @override(from: String!, label: String) on FIELD_DEFINITION + directive @policy(policies: [[federation__Policy!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @provides(fields: FieldSet!) on FIELD_DEFINITION + directive @requires(fields: FieldSet!) on FIELD_DEFINITION + directive @requiresScopes(scopes: [[federation__Scope!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @shareable repeatable on FIELD_DEFINITION | OBJECT + directive @tag(name: String!) repeatable on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + scalar _Any + scalar FieldSet + scalar federation__Policy + scalar federation__Scope +`, BuiltIn: true}, + {Name: "../../federation/entity.graphql", Input: ` +# a union of all types that use the @key directive +union _Entity = Article | Catalog | Listing | Metric | UserProfile | Venue | Viewer + +# fake type to build resolver interfaces for users to implement +type Entity { + findArticleByID(id: ID!,): Article! + findArticleBySlug(slug: String!,): Article! + findCatalogByID(id: ID!,): Catalog! + findListingBySellerIDAndSku(sellerID: ID!,sku: String!,): Listing! + findMetricByID(id: ID!,): Metric! + findPersonalizedByID(id: ID!,): Personalized! + findUserProfileByID(id: ID!,): UserProfile! + findVenueByAddressID(addressID: ID!,): Venue! + findViewerByID(id: ID!,): Viewer! +} + +type _Service { + sdl: String +} + +extend type Query { + _entities(representations: [_Any!]!): [_Entity]! + _service: _Service! +} +`, BuiltIn: true}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Entity_findArticleByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findArticleByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findArticleByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findArticleBySlug_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findArticleBySlug_argsSlug(ctx, rawArgs) + if err != nil { + return nil, err + } + args["slug"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findArticleBySlug_argsSlug( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["slug"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("slug")) + if tmp, ok := rawArgs["slug"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findCatalogByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findCatalogByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findCatalogByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findListingBySellerIDAndSku_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findListingBySellerIDAndSku_argsSellerID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["sellerID"] = arg0 + arg1, err := ec.field_Entity_findListingBySellerIDAndSku_argsSku(ctx, rawArgs) + if err != nil { + return nil, err + } + args["sku"] = arg1 + return args, nil +} +func (ec *executionContext) field_Entity_findListingBySellerIDAndSku_argsSellerID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["sellerID"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("sellerID")) + if tmp, ok := rawArgs["sellerID"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findListingBySellerIDAndSku_argsSku( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["sku"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("sku")) + if tmp, ok := rawArgs["sku"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findMetricByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findMetricByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findMetricByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findPersonalizedByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findPersonalizedByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findPersonalizedByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findUserProfileByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findUserProfileByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findUserProfileByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findVenueByAddressID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findVenueByAddressID_argsAddressID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["addressID"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findVenueByAddressID_argsAddressID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["addressID"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("addressID")) + if tmp, ok := rawArgs["addressID"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findViewerByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findViewerByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findViewerByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_createArticle_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Mutation_createArticle_argsTitle(ctx, rawArgs) + if err != nil { + return nil, err + } + args["title"] = arg0 + arg1, err := ec.field_Mutation_createArticle_argsBody(ctx, rawArgs) + if err != nil { + return nil, err + } + args["body"] = arg1 + arg2, err := ec.field_Mutation_createArticle_argsAuthorName(ctx, rawArgs) + if err != nil { + return nil, err + } + args["authorName"] = arg2 + return args, nil +} +func (ec *executionContext) field_Mutation_createArticle_argsTitle( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["title"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("title")) + if tmp, ok := rawArgs["title"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_createArticle_argsBody( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["body"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("body")) + if tmp, ok := rawArgs["body"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_createArticle_argsAuthorName( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["authorName"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("authorName")) + if tmp, ok := rawArgs["authorName"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_deleteListing_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Mutation_deleteListing_argsKey(ctx, rawArgs) + if err != nil { + return nil, err + } + args["key"] = arg0 + return args, nil +} +func (ec *executionContext) field_Mutation_deleteListing_argsKey( + ctx context.Context, + rawArgs map[string]any, +) (model.ListingKey, error) { + if _, ok := rawArgs["key"]; !ok { + var zeroVal model.ListingKey + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + if tmp, ok := rawArgs["key"]; ok { + return ec.unmarshalNListingKey2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐListingKey(ctx, tmp) + } + + var zeroVal model.ListingKey + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateArticle_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Mutation_updateArticle_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + arg1, err := ec.field_Mutation_updateArticle_argsTitle(ctx, rawArgs) + if err != nil { + return nil, err + } + args["title"] = arg1 + return args, nil +} +func (ec *executionContext) field_Mutation_updateArticle_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateArticle_argsTitle( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["title"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("title")) + if tmp, ok := rawArgs["title"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query___type_argsName(ctx, rawArgs) + if err != nil { + return nil, err + } + args["name"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query___type_argsName( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["name"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["name"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query__entities_argsRepresentations(ctx, rawArgs) + if err != nil { + return nil, err + } + args["representations"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query__entities_argsRepresentations( + ctx context.Context, + rawArgs map[string]any, +) ([]map[string]any, error) { + if _, ok := rawArgs["representations"]; !ok { + var zeroVal []map[string]any + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) + if tmp, ok := rawArgs["representations"]; ok { + return ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) + } + + var zeroVal []map[string]any + return zeroVal, nil +} + +func (ec *executionContext) field_Query_articleBySlug_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_articleBySlug_argsSlug(ctx, rawArgs) + if err != nil { + return nil, err + } + args["slug"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_articleBySlug_argsSlug( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["slug"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("slug")) + if tmp, ok := rawArgs["slug"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query_article_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_article_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_article_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query_articlesByIds_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_articlesByIds_argsIds(ctx, rawArgs) + if err != nil { + return nil, err + } + args["ids"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_articlesByIds_argsIds( + ctx context.Context, + rawArgs map[string]any, +) ([]string, error) { + if _, ok := rawArgs["ids"]; !ok { + var zeroVal []string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("ids")) + if tmp, ok := rawArgs["ids"]; ok { + return ec.unmarshalNID2ᚕstringᚄ(ctx, tmp) + } + + var zeroVal []string + return zeroVal, nil +} + +func (ec *executionContext) field_Query_catalog_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_catalog_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_catalog_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query_listing_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_listing_argsKey(ctx, rawArgs) + if err != nil { + return nil, err + } + args["key"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_listing_argsKey( + ctx context.Context, + rawArgs map[string]any, +) (model.ListingKey, error) { + if _, ok := rawArgs["key"]; !ok { + var zeroVal model.ListingKey + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + if tmp, ok := rawArgs["key"]; ok { + return ec.unmarshalNListingKey2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐListingKey(ctx, tmp) + } + + var zeroVal model.ListingKey + return zeroVal, nil +} + +func (ec *executionContext) field_Query_metric_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_metric_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_metric_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query_userProfile_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_userProfile_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_userProfile_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query_venue_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_venue_argsLocation(ctx, rawArgs) + if err != nil { + return nil, err + } + args["location"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_venue_argsLocation( + ctx context.Context, + rawArgs map[string]any, +) (model.VenueLocationKey, error) { + if _, ok := rawArgs["location"]; !ok { + var zeroVal model.VenueLocationKey + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("location")) + if tmp, ok := rawArgs["location"]; ok { + return ec.unmarshalNVenueLocationKey2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐVenueLocationKey(ctx, tmp) + } + + var zeroVal model.VenueLocationKey + return zeroVal, nil +} + +func (ec *executionContext) field___Directive_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Directive_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Directive_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Field_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Field_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Field_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_enumValues_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_enumValues_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_fields_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_fields_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _Address_id(ctx context.Context, field graphql.CollectedField, obj *model.Address) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Address_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Address_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Address", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_id(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_slug(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_slug(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Slug, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_slug(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_title(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_title(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Title, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_title(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_body(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_body(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Body, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_body(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_authorName(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_authorName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.AuthorName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_authorName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_publishedAt(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_publishedAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.PublishedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_publishedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_tags(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_tags(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Tags, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Catalog_id(ctx context.Context, field graphql.CollectedField, obj *model.Catalog) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Catalog_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Catalog_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Catalog", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Catalog_name(ctx context.Context, field graphql.CollectedField, obj *model.Catalog) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Catalog_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Catalog_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Catalog", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Catalog_category(ctx context.Context, field graphql.CollectedField, obj *model.Catalog) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Catalog_category(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Category, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Catalog_category(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Catalog", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Catalog_itemCount(ctx context.Context, field graphql.CollectedField, obj *model.Catalog) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Catalog_itemCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ItemCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Catalog_itemCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Catalog", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_findArticleByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findArticleByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindArticleByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Article) + fc.Result = res + return ec.marshalNArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐArticle(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findArticleByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "slug": + return ec.fieldContext_Article_slug(ctx, field) + case "title": + return ec.fieldContext_Article_title(ctx, field) + case "body": + return ec.fieldContext_Article_body(ctx, field) + case "authorName": + return ec.fieldContext_Article_authorName(ctx, field) + case "publishedAt": + return ec.fieldContext_Article_publishedAt(ctx, field) + case "tags": + return ec.fieldContext_Article_tags(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findArticleByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findArticleBySlug(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findArticleBySlug(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindArticleBySlug(rctx, fc.Args["slug"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Article) + fc.Result = res + return ec.marshalNArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐArticle(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findArticleBySlug(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "slug": + return ec.fieldContext_Article_slug(ctx, field) + case "title": + return ec.fieldContext_Article_title(ctx, field) + case "body": + return ec.fieldContext_Article_body(ctx, field) + case "authorName": + return ec.fieldContext_Article_authorName(ctx, field) + case "publishedAt": + return ec.fieldContext_Article_publishedAt(ctx, field) + case "tags": + return ec.fieldContext_Article_tags(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findArticleBySlug_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findCatalogByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findCatalogByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindCatalogByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Catalog) + fc.Result = res + return ec.marshalNCatalog2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐCatalog(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findCatalogByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Catalog_id(ctx, field) + case "name": + return ec.fieldContext_Catalog_name(ctx, field) + case "category": + return ec.fieldContext_Catalog_category(ctx, field) + case "itemCount": + return ec.fieldContext_Catalog_itemCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Catalog", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findCatalogByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findListingBySellerIDAndSku(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findListingBySellerIDAndSku(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindListingBySellerIDAndSku(rctx, fc.Args["sellerID"].(string), fc.Args["sku"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Listing) + fc.Result = res + return ec.marshalNListing2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐListing(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findListingBySellerIDAndSku(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "sellerId": + return ec.fieldContext_Listing_sellerId(ctx, field) + case "sku": + return ec.fieldContext_Listing_sku(ctx, field) + case "title": + return ec.fieldContext_Listing_title(ctx, field) + case "price": + return ec.fieldContext_Listing_price(ctx, field) + case "currency": + return ec.fieldContext_Listing_currency(ctx, field) + case "inStock": + return ec.fieldContext_Listing_inStock(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Listing", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findListingBySellerIDAndSku_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findMetricByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findMetricByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindMetricByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Metric) + fc.Result = res + return ec.marshalNMetric2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐMetric(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findMetricByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Metric_id(ctx, field) + case "name": + return ec.fieldContext_Metric_name(ctx, field) + case "value": + return ec.fieldContext_Metric_value(ctx, field) + case "unit": + return ec.fieldContext_Metric_unit(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metric", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findMetricByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findPersonalizedByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findPersonalizedByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindPersonalizedByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.Personalized) + fc.Result = res + return ec.marshalNPersonalized2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐPersonalized(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findPersonalizedByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findPersonalizedByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findUserProfileByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findUserProfileByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindUserProfileByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.UserProfile) + fc.Result = res + return ec.marshalNUserProfile2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐUserProfile(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findUserProfileByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_UserProfile_id(ctx, field) + case "username": + return ec.fieldContext_UserProfile_username(ctx, field) + case "email": + return ec.fieldContext_UserProfile_email(ctx, field) + case "role": + return ec.fieldContext_UserProfile_role(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserProfile", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findUserProfileByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findVenueByAddressID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findVenueByAddressID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindVenueByAddressID(rctx, fc.Args["addressID"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Venue) + fc.Result = res + return ec.marshalNVenue2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐVenue(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findVenueByAddressID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "address": + return ec.fieldContext_Venue_address(ctx, field) + case "name": + return ec.fieldContext_Venue_name(ctx, field) + case "capacity": + return ec.fieldContext_Venue_capacity(ctx, field) + case "city": + return ec.fieldContext_Venue_city(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Venue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findVenueByAddressID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findViewerByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findViewerByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindViewerByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Viewer) + fc.Result = res + return ec.marshalNViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐViewer(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findViewerByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Viewer_id(ctx, field) + case "recommendedArticles": + return ec.fieldContext_Viewer_recommendedArticles(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Viewer", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findViewerByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Listing_sellerId(ctx context.Context, field graphql.CollectedField, obj *model.Listing) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Listing_sellerId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SellerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Listing_sellerId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Listing", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Listing_sku(ctx context.Context, field graphql.CollectedField, obj *model.Listing) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Listing_sku(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Sku, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Listing_sku(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Listing", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Listing_title(ctx context.Context, field graphql.CollectedField, obj *model.Listing) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Listing_title(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Title, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Listing_title(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Listing", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Listing_price(ctx context.Context, field graphql.CollectedField, obj *model.Listing) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Listing_price(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Price, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(float64) + fc.Result = res + return ec.marshalNFloat2float64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Listing_price(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Listing", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Float does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Listing_currency(ctx context.Context, field graphql.CollectedField, obj *model.Listing) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Listing_currency(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Currency, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Listing_currency(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Listing", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Listing_inStock(ctx context.Context, field graphql.CollectedField, obj *model.Listing) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Listing_inStock(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.InStock, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Listing_inStock(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Listing", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metric_id(ctx context.Context, field graphql.CollectedField, obj *model.Metric) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metric_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metric_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metric", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metric_name(ctx context.Context, field graphql.CollectedField, obj *model.Metric) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metric_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metric_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metric", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metric_value(ctx context.Context, field graphql.CollectedField, obj *model.Metric) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metric_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(float64) + fc.Result = res + return ec.marshalNFloat2float64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metric_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metric", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Float does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metric_unit(ctx context.Context, field graphql.CollectedField, obj *model.Metric) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metric_unit(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Unit, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metric_unit(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metric", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateArticle(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateArticle(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateArticle(rctx, fc.Args["id"].(string), fc.Args["title"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Article) + fc.Result = res + return ec.marshalOArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐArticle(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateArticle(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "slug": + return ec.fieldContext_Article_slug(ctx, field) + case "title": + return ec.fieldContext_Article_title(ctx, field) + case "body": + return ec.fieldContext_Article_body(ctx, field) + case "authorName": + return ec.fieldContext_Article_authorName(ctx, field) + case "publishedAt": + return ec.fieldContext_Article_publishedAt(ctx, field) + case "tags": + return ec.fieldContext_Article_tags(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateArticle_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createArticle(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createArticle(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateArticle(rctx, fc.Args["title"].(string), fc.Args["body"].(string), fc.Args["authorName"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Article) + fc.Result = res + return ec.marshalNArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐArticle(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createArticle(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "slug": + return ec.fieldContext_Article_slug(ctx, field) + case "title": + return ec.fieldContext_Article_title(ctx, field) + case "body": + return ec.fieldContext_Article_body(ctx, field) + case "authorName": + return ec.fieldContext_Article_authorName(ctx, field) + case "publishedAt": + return ec.fieldContext_Article_publishedAt(ctx, field) + case "tags": + return ec.fieldContext_Article_tags(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createArticle_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteListing(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteListing(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteListing(rctx, fc.Args["key"].(model.ListingKey)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Listing) + fc.Result = res + return ec.marshalOListing2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐListing(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteListing(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "sellerId": + return ec.fieldContext_Listing_sellerId(ctx, field) + case "sku": + return ec.fieldContext_Listing_sku(ctx, field) + case "title": + return ec.fieldContext_Listing_title(ctx, field) + case "price": + return ec.fieldContext_Listing_price(ctx, field) + case "currency": + return ec.fieldContext_Listing_currency(ctx, field) + case "inStock": + return ec.fieldContext_Listing_inStock(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Listing", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteListing_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_article(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_article(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Article(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Article) + fc.Result = res + return ec.marshalOArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐArticle(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_article(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "slug": + return ec.fieldContext_Article_slug(ctx, field) + case "title": + return ec.fieldContext_Article_title(ctx, field) + case "body": + return ec.fieldContext_Article_body(ctx, field) + case "authorName": + return ec.fieldContext_Article_authorName(ctx, field) + case "publishedAt": + return ec.fieldContext_Article_publishedAt(ctx, field) + case "tags": + return ec.fieldContext_Article_tags(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_article_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_articles(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_articles(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Articles(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Article) + fc.Result = res + return ec.marshalNArticle2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐArticleᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_articles(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "slug": + return ec.fieldContext_Article_slug(ctx, field) + case "title": + return ec.fieldContext_Article_title(ctx, field) + case "body": + return ec.fieldContext_Article_body(ctx, field) + case "authorName": + return ec.fieldContext_Article_authorName(ctx, field) + case "publishedAt": + return ec.fieldContext_Article_publishedAt(ctx, field) + case "tags": + return ec.fieldContext_Article_tags(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_articlesByIds(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_articlesByIds(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().ArticlesByIds(rctx, fc.Args["ids"].([]string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Article) + fc.Result = res + return ec.marshalNArticle2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐArticleᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_articlesByIds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "slug": + return ec.fieldContext_Article_slug(ctx, field) + case "title": + return ec.fieldContext_Article_title(ctx, field) + case "body": + return ec.fieldContext_Article_body(ctx, field) + case "authorName": + return ec.fieldContext_Article_authorName(ctx, field) + case "publishedAt": + return ec.fieldContext_Article_publishedAt(ctx, field) + case "tags": + return ec.fieldContext_Article_tags(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_articlesByIds_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_articleBySlug(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_articleBySlug(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().ArticleBySlug(rctx, fc.Args["slug"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Article) + fc.Result = res + return ec.marshalOArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐArticle(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_articleBySlug(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "slug": + return ec.fieldContext_Article_slug(ctx, field) + case "title": + return ec.fieldContext_Article_title(ctx, field) + case "body": + return ec.fieldContext_Article_body(ctx, field) + case "authorName": + return ec.fieldContext_Article_authorName(ctx, field) + case "publishedAt": + return ec.fieldContext_Article_publishedAt(ctx, field) + case "tags": + return ec.fieldContext_Article_tags(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_articleBySlug_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_listing(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_listing(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Listing(rctx, fc.Args["key"].(model.ListingKey)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Listing) + fc.Result = res + return ec.marshalOListing2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐListing(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_listing(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "sellerId": + return ec.fieldContext_Listing_sellerId(ctx, field) + case "sku": + return ec.fieldContext_Listing_sku(ctx, field) + case "title": + return ec.fieldContext_Listing_title(ctx, field) + case "price": + return ec.fieldContext_Listing_price(ctx, field) + case "currency": + return ec.fieldContext_Listing_currency(ctx, field) + case "inStock": + return ec.fieldContext_Listing_inStock(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Listing", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_listing_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_listings(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_listings(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Listings(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Listing) + fc.Result = res + return ec.marshalNListing2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐListingᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_listings(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "sellerId": + return ec.fieldContext_Listing_sellerId(ctx, field) + case "sku": + return ec.fieldContext_Listing_sku(ctx, field) + case "title": + return ec.fieldContext_Listing_title(ctx, field) + case "price": + return ec.fieldContext_Listing_price(ctx, field) + case "currency": + return ec.fieldContext_Listing_currency(ctx, field) + case "inStock": + return ec.fieldContext_Listing_inStock(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Listing", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_venue(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_venue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Venue(rctx, fc.Args["location"].(model.VenueLocationKey)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Venue) + fc.Result = res + return ec.marshalOVenue2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐVenue(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_venue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "address": + return ec.fieldContext_Venue_address(ctx, field) + case "name": + return ec.fieldContext_Venue_name(ctx, field) + case "capacity": + return ec.fieldContext_Venue_capacity(ctx, field) + case "city": + return ec.fieldContext_Venue_city(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Venue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_venue_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_venues(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_venues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Venues(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Venue) + fc.Result = res + return ec.marshalNVenue2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐVenueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_venues(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "address": + return ec.fieldContext_Venue_address(ctx, field) + case "name": + return ec.fieldContext_Venue_name(ctx, field) + case "capacity": + return ec.fieldContext_Venue_capacity(ctx, field) + case "city": + return ec.fieldContext_Venue_city(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Venue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_userProfile(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_userProfile(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().UserProfile(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.UserProfile) + fc.Result = res + return ec.marshalOUserProfile2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐUserProfile(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_userProfile(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_UserProfile_id(ctx, field) + case "username": + return ec.fieldContext_UserProfile_username(ctx, field) + case "email": + return ec.fieldContext_UserProfile_email(ctx, field) + case "role": + return ec.fieldContext_UserProfile_role(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserProfile", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_userProfile_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_catalog(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_catalog(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Catalog(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Catalog) + fc.Result = res + return ec.marshalOCatalog2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐCatalog(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_catalog(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Catalog_id(ctx, field) + case "name": + return ec.fieldContext_Catalog_name(ctx, field) + case "category": + return ec.fieldContext_Catalog_category(ctx, field) + case "itemCount": + return ec.fieldContext_Catalog_itemCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Catalog", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_catalog_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_catalogs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_catalogs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Catalogs(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Catalog) + fc.Result = res + return ec.marshalNCatalog2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐCatalogᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_catalogs(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Catalog_id(ctx, field) + case "name": + return ec.fieldContext_Catalog_name(ctx, field) + case "category": + return ec.fieldContext_Catalog_category(ctx, field) + case "itemCount": + return ec.fieldContext_Catalog_itemCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Catalog", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_metric(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_metric(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Metric(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Metric) + fc.Result = res + return ec.marshalOMetric2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐMetric(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_metric(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Metric_id(ctx, field) + case "name": + return ec.fieldContext_Metric_name(ctx, field) + case "value": + return ec.fieldContext_Metric_value(ctx, field) + case "unit": + return ec.fieldContext_Metric_unit(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metric", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_metric_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__entities(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve_entities(ctx, fc.Args["representations"].([]map[string]any)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]fedruntime.Entity) + fc.Result = res + return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__entities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type _Entity does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query__entities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__service(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve__service(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(fedruntime.Service) + fc.Result = res + return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__service(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "sdl": + return ec.fieldContext__Service_sdl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___schema(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserProfile_id(ctx context.Context, field graphql.CollectedField, obj *model.UserProfile) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserProfile_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserProfile_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserProfile", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserProfile_username(ctx context.Context, field graphql.CollectedField, obj *model.UserProfile) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserProfile_username(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Username, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserProfile_username(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserProfile", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserProfile_email(ctx context.Context, field graphql.CollectedField, obj *model.UserProfile) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserProfile_email(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Email, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserProfile_email(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserProfile", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserProfile_role(ctx context.Context, field graphql.CollectedField, obj *model.UserProfile) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserProfile_role(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Role, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserProfile_role(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserProfile", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Venue_address(ctx context.Context, field graphql.CollectedField, obj *model.Venue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Venue_address(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Address, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Address) + fc.Result = res + return ec.marshalNAddress2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐAddress(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Venue_address(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Venue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Address_id(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Address", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Venue_name(ctx context.Context, field graphql.CollectedField, obj *model.Venue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Venue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Venue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Venue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Venue_capacity(ctx context.Context, field graphql.CollectedField, obj *model.Venue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Venue_capacity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Capacity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Venue_capacity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Venue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Venue_city(ctx context.Context, field graphql.CollectedField, obj *model.Venue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Venue_city(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.City, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Venue_city(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Venue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Viewer_id(ctx context.Context, field graphql.CollectedField, obj *model.Viewer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Viewer_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Viewer_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Viewer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Viewer_recommendedArticles(ctx context.Context, field graphql.CollectedField, obj *model.Viewer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Viewer_recommendedArticles(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Viewer().RecommendedArticles(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Article) + fc.Result = res + return ec.marshalNArticle2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐArticleᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Viewer_recommendedArticles(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Viewer", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "slug": + return ec.fieldContext_Article_slug(ctx, field) + case "title": + return ec.fieldContext_Article_title(ctx, field) + case "body": + return ec.fieldContext_Article_body(ctx, field) + case "authorName": + return ec.fieldContext_Article_authorName(ctx, field) + case "publishedAt": + return ec.fieldContext_Article_publishedAt(ctx, field) + case "tags": + return ec.fieldContext_Article_tags(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext__Service_sdl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SDL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext__Service_sdl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "_Service", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsRepeatable, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Locations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __DirectiveLocation does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Directive_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Field_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_isOneOf(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_isOneOf(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsOneOf(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_isOneOf(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +func (ec *executionContext) unmarshalInputListingKey(ctx context.Context, obj any) (model.ListingKey, error) { + var it model.ListingKey + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"sellerId", "sku"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "sellerId": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sellerId")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.SellerID = data + case "sku": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sku")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Sku = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputVenueAddressKey(ctx context.Context, obj any) (model.VenueAddressKey, error) { + var it model.VenueAddressKey + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"id"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.ID = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputVenueLocationKey(ctx context.Context, obj any) (model.VenueLocationKey, error) { + var it model.VenueLocationKey + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"address"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "address": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("address")) + data, err := ec.unmarshalNVenueAddressKey2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐVenueAddressKey(ctx, v) + if err != nil { + return it, err + } + it.Address = data + } + } + + return it, nil +} + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +func (ec *executionContext) _Personalized(ctx context.Context, sel ast.SelectionSet, obj model.Personalized) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case model.Article: + return ec._Article(ctx, sel, &obj) + case *model.Article: + if obj == nil { + return graphql.Null + } + return ec._Article(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, obj fedruntime.Entity) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case model.Article: + return ec._Article(ctx, sel, &obj) + case *model.Article: + if obj == nil { + return graphql.Null + } + return ec._Article(ctx, sel, obj) + case model.Viewer: + return ec._Viewer(ctx, sel, &obj) + case *model.Viewer: + if obj == nil { + return graphql.Null + } + return ec._Viewer(ctx, sel, obj) + case model.Venue: + return ec._Venue(ctx, sel, &obj) + case *model.Venue: + if obj == nil { + return graphql.Null + } + return ec._Venue(ctx, sel, obj) + case model.UserProfile: + return ec._UserProfile(ctx, sel, &obj) + case *model.UserProfile: + if obj == nil { + return graphql.Null + } + return ec._UserProfile(ctx, sel, obj) + case model.Metric: + return ec._Metric(ctx, sel, &obj) + case *model.Metric: + if obj == nil { + return graphql.Null + } + return ec._Metric(ctx, sel, obj) + case model.Listing: + return ec._Listing(ctx, sel, &obj) + case *model.Listing: + if obj == nil { + return graphql.Null + } + return ec._Listing(ctx, sel, obj) + case model.Catalog: + return ec._Catalog(ctx, sel, &obj) + case *model.Catalog: + if obj == nil { + return graphql.Null + } + return ec._Catalog(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var addressImplementors = []string{"Address"} + +func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, obj *model.Address) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, addressImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Address") + case "id": + out.Values[i] = ec._Address_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var articleImplementors = []string{"Article", "Personalized", "_Entity"} + +func (ec *executionContext) _Article(ctx context.Context, sel ast.SelectionSet, obj *model.Article) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, articleImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Article") + case "id": + out.Values[i] = ec._Article_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "slug": + out.Values[i] = ec._Article_slug(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "title": + out.Values[i] = ec._Article_title(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "body": + out.Values[i] = ec._Article_body(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "authorName": + out.Values[i] = ec._Article_authorName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "publishedAt": + out.Values[i] = ec._Article_publishedAt(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "tags": + out.Values[i] = ec._Article_tags(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var catalogImplementors = []string{"Catalog", "_Entity"} + +func (ec *executionContext) _Catalog(ctx context.Context, sel ast.SelectionSet, obj *model.Catalog) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, catalogImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Catalog") + case "id": + out.Values[i] = ec._Catalog_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._Catalog_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "category": + out.Values[i] = ec._Catalog_category(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "itemCount": + out.Values[i] = ec._Catalog_itemCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var entityImplementors = []string{"Entity"} + +func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Entity", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Entity") + case "findArticleByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findArticleByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findArticleBySlug": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findArticleBySlug(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findCatalogByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findCatalogByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findListingBySellerIDAndSku": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findListingBySellerIDAndSku(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findMetricByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findMetricByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findPersonalizedByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findPersonalizedByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findUserProfileByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findUserProfileByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findVenueByAddressID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findVenueByAddressID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findViewerByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findViewerByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var listingImplementors = []string{"Listing", "_Entity"} + +func (ec *executionContext) _Listing(ctx context.Context, sel ast.SelectionSet, obj *model.Listing) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, listingImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Listing") + case "sellerId": + out.Values[i] = ec._Listing_sellerId(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "sku": + out.Values[i] = ec._Listing_sku(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "title": + out.Values[i] = ec._Listing_title(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "price": + out.Values[i] = ec._Listing_price(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "currency": + out.Values[i] = ec._Listing_currency(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "inStock": + out.Values[i] = ec._Listing_inStock(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var metricImplementors = []string{"Metric", "_Entity"} + +func (ec *executionContext) _Metric(ctx context.Context, sel ast.SelectionSet, obj *model.Metric) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, metricImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Metric") + case "id": + out.Values[i] = ec._Metric_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._Metric_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "value": + out.Values[i] = ec._Metric_value(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "unit": + out.Values[i] = ec._Metric_unit(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var mutationImplementors = []string{"Mutation"} + +func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Mutation", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Mutation") + case "updateArticle": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateArticle(ctx, field) + }) + case "createArticle": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createArticle(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteListing": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteListing(ctx, field) + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var queryImplementors = []string{"Query"} + +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "article": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_article(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "articles": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_articles(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "articlesByIds": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_articlesByIds(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "articleBySlug": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_articleBySlug(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "listing": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_listing(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "listings": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_listings(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "venue": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_venue(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "venues": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_venues(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "userProfile": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_userProfile(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "catalog": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_catalog(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "catalogs": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_catalogs(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "metric": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_metric(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "_entities": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__entities(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "_service": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__service(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "__type": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) + case "__schema": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var userProfileImplementors = []string{"UserProfile", "_Entity"} + +func (ec *executionContext) _UserProfile(ctx context.Context, sel ast.SelectionSet, obj *model.UserProfile) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userProfileImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("UserProfile") + case "id": + out.Values[i] = ec._UserProfile_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "username": + out.Values[i] = ec._UserProfile_username(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "email": + out.Values[i] = ec._UserProfile_email(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "role": + out.Values[i] = ec._UserProfile_role(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var venueImplementors = []string{"Venue", "_Entity"} + +func (ec *executionContext) _Venue(ctx context.Context, sel ast.SelectionSet, obj *model.Venue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, venueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Venue") + case "address": + out.Values[i] = ec._Venue_address(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._Venue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "capacity": + out.Values[i] = ec._Venue_capacity(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "city": + out.Values[i] = ec._Venue_city(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var viewerImplementors = []string{"Viewer", "_Entity"} + +func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, obj *model.Viewer) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, viewerImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Viewer") + case "id": + out.Values[i] = ec._Viewer_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "recommendedArticles": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Viewer_recommendedArticles(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var _ServiceImplementors = []string{"_Service"} + +func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("_Service") + case "sdl": + out.Values[i] = ec.__Service_sdl(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __DirectiveImplementors = []string{"__Directive"} + +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "isRepeatable": + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __EnumValueImplementors = []string{"__EnumValue"} + +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __FieldImplementors = []string{"__Field"} + +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __InputValueImplementors = []string{"__InputValue"} + +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___InputValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___InputValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __SchemaImplementors = []string{"__Schema"} + +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Schema") + case "description": + out.Values[i] = ec.___Schema_description(ctx, field, obj) + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __TypeImplementors = []string{"__Type"} + +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "specifiedByURL": + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + case "isOneOf": + out.Values[i] = ec.___Type_isOneOf(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +// endregion **************************** object.gotpl **************************** + +// region ***************************** type.gotpl ***************************** + +func (ec *executionContext) marshalNAddress2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐAddress(ctx context.Context, sel ast.SelectionSet, v *model.Address) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Address(ctx, sel, v) +} + +func (ec *executionContext) marshalNArticle2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐArticle(ctx context.Context, sel ast.SelectionSet, v model.Article) graphql.Marshaler { + return ec._Article(ctx, sel, &v) +} + +func (ec *executionContext) marshalNArticle2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐArticleᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Article) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐArticle(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐArticle(ctx context.Context, sel ast.SelectionSet, v *model.Article) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Article(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNCatalog2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐCatalog(ctx context.Context, sel ast.SelectionSet, v model.Catalog) graphql.Marshaler { + return ec._Catalog(ctx, sel, &v) +} + +func (ec *executionContext) marshalNCatalog2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐCatalogᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Catalog) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNCatalog2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐCatalog(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNCatalog2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐCatalog(ctx context.Context, sel ast.SelectionSet, v *model.Catalog) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Catalog(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNFieldSet2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v any) (float64, error) { + res, err := graphql.UnmarshalFloatContext(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { + _ = sel + res := graphql.MarshalFloatContext(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return graphql.WrapContextMarshaler(ctx, res) +} + +func (ec *executionContext) unmarshalNID2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalID(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalID(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNID2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNID2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNID2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNID2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v any) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { + _ = sel + res := graphql.MarshalInt(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNListing2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐListing(ctx context.Context, sel ast.SelectionSet, v model.Listing) graphql.Marshaler { + return ec._Listing(ctx, sel, &v) +} + +func (ec *executionContext) marshalNListing2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐListingᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Listing) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNListing2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐListing(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNListing2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐListing(ctx context.Context, sel ast.SelectionSet, v *model.Listing) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Listing(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNListingKey2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐListingKey(ctx context.Context, v any) (model.ListingKey, error) { + res, err := ec.unmarshalInputListingKey(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMetric2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐMetric(ctx context.Context, sel ast.SelectionSet, v model.Metric) graphql.Marshaler { + return ec._Metric(ctx, sel, &v) +} + +func (ec *executionContext) marshalNMetric2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐMetric(ctx context.Context, sel ast.SelectionSet, v *model.Metric) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Metric(ctx, sel, v) +} + +func (ec *executionContext) marshalNPersonalized2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐPersonalized(ctx context.Context, sel ast.SelectionSet, v model.Personalized) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Personalized(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNString2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNUserProfile2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐUserProfile(ctx context.Context, sel ast.SelectionSet, v model.UserProfile) graphql.Marshaler { + return ec._UserProfile(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUserProfile2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐUserProfile(ctx context.Context, sel ast.SelectionSet, v *model.UserProfile) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._UserProfile(ctx, sel, v) +} + +func (ec *executionContext) marshalNVenue2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐVenue(ctx context.Context, sel ast.SelectionSet, v model.Venue) graphql.Marshaler { + return ec._Venue(ctx, sel, &v) +} + +func (ec *executionContext) marshalNVenue2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐVenueᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Venue) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNVenue2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐVenue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNVenue2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐVenue(ctx context.Context, sel ast.SelectionSet, v *model.Venue) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Venue(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNVenueAddressKey2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐVenueAddressKey(ctx context.Context, v any) (*model.VenueAddressKey, error) { + res, err := ec.unmarshalInputVenueAddressKey(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNVenueLocationKey2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐVenueLocationKey(ctx context.Context, v any) (model.VenueLocationKey, error) { + res, err := ec.unmarshalInputVenueLocationKey(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNViewer2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐViewer(ctx context.Context, sel ast.SelectionSet, v model.Viewer) graphql.Marshaler { + return ec._Viewer(ctx, sel, &v) +} + +func (ec *executionContext) marshalNViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐViewer(ctx context.Context, sel ast.SelectionSet, v *model.Viewer) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Viewer(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v any) (map[string]any, error) { + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]any) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + _ = sel + res := graphql.MarshalMap(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v any) ([]map[string]any, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]map[string]any, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN_Any2map(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN_Any2ᚕmapᚄ(ctx context.Context, sel ast.SelectionSet, v []map[string]any) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalN_Any2map(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v []fedruntime.Entity) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { + return ec.__Service(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { + return ec.___Directive(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { + return ec.___EnumValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { + return ec.___Field(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { + return ec.___InputValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { + return ec.___Type(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Policy2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Scope2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐArticle(ctx context.Context, sel ast.SelectionSet, v *model.Article) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Article(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalBoolean(v) + return res +} + +func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v any) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalBoolean(*v) + return res +} + +func (ec *executionContext) marshalOCatalog2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐCatalog(ctx context.Context, sel ast.SelectionSet, v *model.Catalog) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Catalog(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v any) (*int, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalInt(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalInt(*v) + return res +} + +func (ec *executionContext) marshalOListing2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐListing(ctx context.Context, sel ast.SelectionSet, v *model.Listing) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Listing(ctx, sel, v) +} + +func (ec *executionContext) marshalOMetric2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐMetric(ctx context.Context, sel ast.SelectionSet, v *model.Metric) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Metric(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalString(v) + return res +} + +func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + if v == nil { + return nil, nil + } + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v any) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalString(*v) + return res +} + +func (ec *executionContext) marshalOUserProfile2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐUserProfile(ctx context.Context, sel ast.SelectionSet, v *model.UserProfile) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._UserProfile(ctx, sel, v) +} + +func (ec *executionContext) marshalOVenue2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraphᚋsubgraphᚋmodelᚐVenue(ctx context.Context, sel ast.SelectionSet, v *model.Venue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Venue(ctx, sel, v) +} + +func (ec *executionContext) marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v fedruntime.Entity) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.__Entity(ctx, sel, v) +} + +func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Schema(ctx, sel, v) +} + +func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +// endregion ***************************** type.gotpl ***************************** diff --git a/demo/pkg/subgraphs/cachegraph/subgraph/model/models_gen.go b/demo/pkg/subgraphs/cachegraph/subgraph/model/models_gen.go new file mode 100644 index 0000000000..f5cc949490 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph/subgraph/model/models_gen.go @@ -0,0 +1,104 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package model + +type Personalized interface { + IsEntity() + IsPersonalized() + GetID() string +} + +type Address struct { + ID string `json:"id"` +} + +type Article struct { + ID string `json:"id"` + Slug string `json:"slug"` + Title string `json:"title"` + Body string `json:"body"` + AuthorName string `json:"authorName"` + PublishedAt string `json:"publishedAt"` + Tags []string `json:"tags"` +} + +func (Article) IsPersonalized() {} +func (this Article) GetID() string { return this.ID } + +func (Article) IsEntity() {} + +// Partial cache load: when some entities are cached and others aren't, only the missing ones are fetched +type Catalog struct { + ID string `json:"id"` + Name string `json:"name"` + Category string `json:"category"` + ItemCount int `json:"itemCount"` +} + +func (Catalog) IsEntity() {} + +type Listing struct { + SellerID string `json:"sellerId"` + Sku string `json:"sku"` + Title string `json:"title"` + Price float64 `json:"price"` + Currency string `json:"currency"` + InStock bool `json:"inStock"` +} + +func (Listing) IsEntity() {} + +type ListingKey struct { + SellerID string `json:"sellerId"` + Sku string `json:"sku"` +} + +// Shadow mode: always fetches from subgraph but compares with cache for staleness detection +type Metric struct { + ID string `json:"id"` + Name string `json:"name"` + Value float64 `json:"value"` + Unit string `json:"unit"` +} + +func (Metric) IsEntity() {} + +type Mutation struct { +} + +type Query struct { +} + +// Per-user caching: includeHeaders makes the cache key include a hash of forwarded headers (e.g. Authorization) +type UserProfile struct { + ID string `json:"id"` + Username string `json:"username"` + Email string `json:"email"` + Role string `json:"role"` +} + +func (UserProfile) IsEntity() {} + +type Venue struct { + Address *Address `json:"address"` + Name string `json:"name"` + Capacity int `json:"capacity"` + City string `json:"city"` +} + +func (Venue) IsEntity() {} + +type VenueAddressKey struct { + ID string `json:"id"` +} + +type VenueLocationKey struct { + Address *VenueAddressKey `json:"address"` +} + +type Viewer struct { + ID string `json:"id"` + RecommendedArticles []*Article `json:"recommendedArticles"` +} + +func (Viewer) IsEntity() {} diff --git a/demo/pkg/subgraphs/cachegraph/subgraph/resolver.go b/demo/pkg/subgraphs/cachegraph/subgraph/resolver.go new file mode 100644 index 0000000000..ad863e02b2 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph/subgraph/resolver.go @@ -0,0 +1,22 @@ +package subgraph + +// This file will not be regenerated automatically. +// +// It serves as dependency injection for your app, add any dependencies you require here. + +// Resolver is the root gqlgen resolver. Each Resolver owns its own data stores +// so mutations are isolated per subgraph server instance and safe under +// concurrent request handling. +type Resolver struct { + articles *articleStore + listings *listingStore +} + +// NewResolver creates a Resolver with fresh, independent article and listing +// stores seeded from the default data. +func NewResolver() *Resolver { + return &Resolver{ + articles: newArticleStore(), + listings: newListingStore(), + } +} diff --git a/demo/pkg/subgraphs/cachegraph/subgraph/schema.graphqls b/demo/pkg/subgraphs/cachegraph/subgraph/schema.graphqls new file mode 100644 index 0000000000..7c2e3f31d5 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph/subgraph/schema.graphqls @@ -0,0 +1,138 @@ +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key"] + ) + +directive @openfed__entityCache( + maxAge: Int! + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT + +directive @openfed__queryCache( + maxAge: Int! + includeHeaders: Boolean = false + shadowMode: Boolean = false +) on FIELD_DEFINITION + +directive @openfed__cacheInvalidate on FIELD_DEFINITION + +directive @openfed__cachePopulate(maxAge: Int) on FIELD_DEFINITION + +directive @openfed__is(fields: String!) on ARGUMENT_DEFINITION + +type Query { + """Simple key lookup""" + article(id: ID!): Article @openfed__queryCache(maxAge: 120) + """List query""" + articles: [Article!]! @openfed__queryCache(maxAge: 120) + """Batch lookup with @openfed__is""" + articlesByIds(ids: [ID!]! @openfed__is(fields: "id")): [Article!]! @openfed__queryCache(maxAge: 120) + """Argument remapping via @openfed__is""" + articleBySlug(slug: String! @openfed__is(fields: "slug")): Article @openfed__queryCache(maxAge: 120) + + """Composite key lookup via input object with @openfed__is""" + listing(key: ListingKey! @openfed__is(fields: "sellerId sku")): Listing @openfed__queryCache(maxAge: 60) + """List of all listings""" + listings: [Listing!]! @openfed__queryCache(maxAge: 60) + + """Nested key lookup with @openfed__is and input object""" + venue(location: VenueLocationKey! @openfed__is(fields: "address { id }")): Venue @openfed__queryCache(maxAge: 180) + """List of all venues""" + venues: [Venue!]! @openfed__queryCache(maxAge: 180) + + """Per-user profile (cache varies by Authorization header)""" + userProfile(id: ID!): UserProfile @openfed__queryCache(maxAge: 60, includeHeaders: true) + + """Single catalog entry""" + catalog(id: ID!): Catalog @openfed__queryCache(maxAge: 120) + """All catalog entries (for partial cache load testing)""" + catalogs: [Catalog!]! @openfed__queryCache(maxAge: 120) + + """Single metric (shadow mode - always fetches from subgraph, compares with cache)""" + metric(id: ID!): Metric @openfed__queryCache(maxAge: 300, shadowMode: true) +} + +type Mutation { + updateArticle(id: ID!, title: String!): Article @openfed__cacheInvalidate + createArticle(title: String!, body: String!, authorName: String!): Article! @openfed__cachePopulate(maxAge: 30) + deleteListing(key: ListingKey!): Listing @openfed__cacheInvalidate +} + +"""Per-user caching: includeHeaders makes the cache key include a hash of forwarded headers (e.g. Authorization)""" +type UserProfile @key(fields: "id") @openfed__entityCache(maxAge: 60, includeHeaders: true) { + id: ID! + username: String! + email: String! + role: String! +} + +"""Partial cache load: when some entities are cached and others aren't, only the missing ones are fetched""" +type Catalog @key(fields: "id") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) { + id: ID! + name: String! + category: String! + itemCount: Int! +} + +"""Shadow mode: always fetches from subgraph but compares with cache for staleness detection""" +type Metric @key(fields: "id") @openfed__entityCache(maxAge: 300, shadowMode: true) { + id: ID! + name: String! + value: Float! + unit: String! +} + +input ListingKey { + sellerId: ID! + sku: String! +} + +input VenueLocationKey { + address: VenueAddressKey! +} + +input VenueAddressKey { + id: ID! +} + +interface Personalized @key(fields: "id") { + id: ID! +} + +type Viewer @key(fields: "id") { + id: ID! + recommendedArticles: [Article!]! +} + +type Article implements Personalized @key(fields: "id") @key(fields: "slug") @openfed__entityCache(maxAge: 120) { + id: ID! + slug: String! + title: String! + body: String! + authorName: String! + publishedAt: String! + tags: [String!]! +} + +type Listing @key(fields: "sellerId sku") @openfed__entityCache(maxAge: 60) { + sellerId: ID! + sku: String! + title: String! + price: Float! + currency: String! + inStock: Boolean! +} + +type Address { + id: ID! +} + +type Venue @key(fields: "address { id }") @openfed__entityCache(maxAge: 180) { + address: Address! + name: String! + capacity: Int! + city: String! +} diff --git a/demo/pkg/subgraphs/cachegraph/subgraph/schema.resolvers.go b/demo/pkg/subgraphs/cachegraph/subgraph/schema.resolvers.go new file mode 100644 index 0000000000..94bb2c59ee --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph/subgraph/schema.resolvers.go @@ -0,0 +1,121 @@ +package subgraph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.76 + +import ( + "context" + "fmt" + + "github.com/wundergraph/cosmo/demo/pkg/injector" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph/subgraph/generated" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph/subgraph/model" +) + +// UpdateArticle is the resolver for the updateArticle field. +func (r *mutationResolver) UpdateArticle(ctx context.Context, id string, title string) (*model.Article, error) { + return r.articles.update(id, title), nil +} + +// CreateArticle is the resolver for the createArticle field. +func (r *mutationResolver) CreateArticle(ctx context.Context, title string, body string, authorName string) (*model.Article, error) { + return r.articles.create(title, body, authorName), nil +} + +// DeleteListing is the resolver for the deleteListing field. +func (r *mutationResolver) DeleteListing(ctx context.Context, key model.ListingKey) (*model.Listing, error) { + return r.listings.delete(key.SellerID, key.Sku), nil +} + +// Article is the resolver for the article field. +func (r *queryResolver) Article(ctx context.Context, id string) (*model.Article, error) { + return r.articles.find(id), nil +} + +// Articles is the resolver for the articles field. +func (r *queryResolver) Articles(ctx context.Context) ([]*model.Article, error) { + return r.articles.all(), nil +} + +// ArticlesByIds is the resolver for the articlesByIds field. +func (r *queryResolver) ArticlesByIds(ctx context.Context, ids []string) ([]*model.Article, error) { + return r.articles.byIDs(ids), nil +} + +// ArticleBySlug is the resolver for the articleBySlug field. +func (r *queryResolver) ArticleBySlug(ctx context.Context, slug string) (*model.Article, error) { + return r.articles.findBySlug(slug), nil +} + +// Listing is the resolver for the listing field. +func (r *queryResolver) Listing(ctx context.Context, key model.ListingKey) (*model.Listing, error) { + return r.listings.get(key.SellerID, key.Sku), nil +} + +// Listings is the resolver for the listings field. +func (r *queryResolver) Listings(ctx context.Context) ([]*model.Listing, error) { + return r.listings.all(), nil +} + +// Venue is the resolver for the venue field. +func (r *queryResolver) Venue(ctx context.Context, location model.VenueLocationKey) (*model.Venue, error) { + if location.Address == nil { + return nil, fmt.Errorf("location.address is required") + } + return venuesData[location.Address.ID], nil +} + +// Venues is the resolver for the venues field. +func (r *queryResolver) Venues(ctx context.Context) ([]*model.Venue, error) { + return allVenues(), nil +} + +// UserProfile is the resolver for the userProfile field. +// The schema declares @openfed__queryCache(includeHeaders: true) so the cache +// key varies by Authorization header. Mirror that on the response side: when a +// known bearer token is present, return that viewer's profile rather than the +// id-based lookup. Without this, different headers would produce identical +// responses and the cache-explorer + benchmark suites could not detect a +// header-variance regression. +func (r *queryResolver) UserProfile(ctx context.Context, id string) (*model.UserProfile, error) { + if hdr := injector.Header(ctx); hdr != nil { + if viewerID, ok := userProfileIDByAuthorizationToken[hdr.Get("Authorization")]; ok { + return userProfilesData[viewerID], nil + } + } + return userProfilesData[id], nil +} + +// Catalog is the resolver for the catalog field. +func (r *queryResolver) Catalog(ctx context.Context, id string) (*model.Catalog, error) { + return catalogsData[id], nil +} + +// Catalogs is the resolver for the catalogs field. +func (r *queryResolver) Catalogs(ctx context.Context) ([]*model.Catalog, error) { + return allCatalogs(), nil +} + +// Metric is the resolver for the metric field. +func (r *queryResolver) Metric(ctx context.Context, id string) (*model.Metric, error) { + return metricsData[id], nil +} + +// RecommendedArticles is the resolver for the recommendedArticles field. +func (r *viewerResolver) RecommendedArticles(ctx context.Context, obj *model.Viewer) ([]*model.Article, error) { + return r.articles.recommendedForViewer(obj.ID), nil +} + +// Mutation returns generated.MutationResolver implementation. +func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResolver{r} } + +// Query returns generated.QueryResolver implementation. +func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} } + +// Viewer returns generated.ViewerResolver implementation. +func (r *Resolver) Viewer() generated.ViewerResolver { return &viewerResolver{r} } + +type mutationResolver struct{ *Resolver } +type queryResolver struct{ *Resolver } +type viewerResolver struct{ *Resolver } diff --git a/demo/pkg/subgraphs/cachegraph_ext/cachegraph_ext.go b/demo/pkg/subgraphs/cachegraph_ext/cachegraph_ext.go new file mode 100644 index 0000000000..595a0cb998 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph_ext/cachegraph_ext.go @@ -0,0 +1,12 @@ +package cachegraph_ext + +import ( + "github.com/99designs/gqlgen/graphql" + + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph_ext/subgraph" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph_ext/subgraph/generated" +) + +func NewSchema() graphql.ExecutableSchema { + return generated.NewExecutableSchema(generated.Config{Resolvers: &subgraph.Resolver{}}) +} diff --git a/demo/pkg/subgraphs/cachegraph_ext/generate.go b/demo/pkg/subgraphs/cachegraph_ext/generate.go new file mode 100644 index 0000000000..6c6a50910a --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph_ext/generate.go @@ -0,0 +1,2 @@ +//go:generate go run github.com/99designs/gqlgen generate +package cachegraph_ext diff --git a/demo/pkg/subgraphs/cachegraph_ext/gqlgen.yml b/demo/pkg/subgraphs/cachegraph_ext/gqlgen.yml new file mode 100644 index 0000000000..10fdc955ab --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph_ext/gqlgen.yml @@ -0,0 +1,45 @@ +schema: + - subgraph/*.graphqls + +exec: + filename: subgraph/generated/generated.go + package: generated + +federation: + filename: subgraph/generated/federation.go + package: generated + version: 2 + options: + explicit_requires: true + +model: + filename: subgraph/model/models_gen.go + package: model + +resolver: + layout: follow-schema + dir: subgraph + package: subgraph + +directives: + openfed__entityCache: + skip_runtime: true + +models: + Article: + fields: + relatedArticles: + resolver: true + personalizedRecommendation: + resolver: true + ID: + model: + - github.com/99designs/gqlgen/graphql.ID + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + Int: + model: + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 diff --git a/demo/pkg/subgraphs/cachegraph_ext/subgraph/data.go b/demo/pkg/subgraphs/cachegraph_ext/subgraph/data.go new file mode 100644 index 0000000000..5d70108ab0 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph_ext/subgraph/data.go @@ -0,0 +1,53 @@ +package subgraph + +import "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph_ext/subgraph/model" + +var articleExtensions = map[string]*articleExtData{ + "1": { + ViewCount: 12453, + Rating: 4.7, + ReviewSummary: "Excellent introduction to caching concepts. Clear examples.", + RelatedIDs: []string{"3", "4"}, + }, + "2": { + ViewCount: 8921, + Rating: 4.3, + ReviewSummary: "Deep dive into federation. Could use more diagrams.", + RelatedIDs: []string{"1", "3"}, + }, + "3": { + ViewCount: 15678, + Rating: 4.9, + ReviewSummary: "The definitive guide to cache invalidation. Must read.", + RelatedIDs: []string{"1", "4"}, + }, + "4": { + ViewCount: 6234, + Rating: 4.1, + ReviewSummary: "Practical tips for production caching. Solid advice.", + RelatedIDs: []string{"1", "2"}, + }, +} + +type articleExtData struct { + ViewCount int + Rating float64 + ReviewSummary string + RelatedIDs []string +} + +// Catalog extension data — description and lastUpdated from this subgraph +var catalogExtensions = map[string]*model.Catalog{ + "c1": {ID: "c1", Description: "Consumer electronics, gadgets, and accessories.", LastUpdated: "2025-03-15T08:00:00Z"}, + "c2": {ID: "c2", Description: "Fiction, non-fiction, technical books, and audiobooks.", LastUpdated: "2025-03-20T12:00:00Z"}, + "c3": {ID: "c3", Description: "Men's, women's, and children's apparel.", LastUpdated: "2025-03-25T16:00:00Z"}, +} + +func toArticle(id string, ext *articleExtData) *model.Article { + return &model.Article{ + ID: id, + ViewCount: ext.ViewCount, + Rating: ext.Rating, + ReviewSummary: ext.ReviewSummary, + } +} diff --git a/demo/pkg/subgraphs/cachegraph_ext/subgraph/entity.resolvers.go b/demo/pkg/subgraphs/cachegraph_ext/subgraph/entity.resolvers.go new file mode 100644 index 0000000000..092562c423 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph_ext/subgraph/entity.resolvers.go @@ -0,0 +1,38 @@ +package subgraph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.76 + +import ( + "context" + + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph_ext/subgraph/generated" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph_ext/subgraph/model" +) + +// FindArticleByID is the resolver for the findArticleByID field. +func (r *entityResolver) FindArticleByID(ctx context.Context, id string) (*model.Article, error) { + ext := articleExtensions[id] + if ext == nil { + return nil, nil + } + return toArticle(id, ext), nil +} + +// FindCatalogByID is the resolver for the findCatalogByID field. +func (r *entityResolver) FindCatalogByID(ctx context.Context, id string) (*model.Catalog, error) { + return catalogExtensions[id], nil +} + +// FindViewerByID is the resolver for the findViewerByID field. +func (r *entityResolver) FindViewerByID(ctx context.Context, id string) (*model.Viewer, error) { + // cachegraph-ext doesn't own Viewer data — this is resolved by the viewer subgraph. + // Return nil to indicate this subgraph can't resolve this entity. + return nil, nil +} + +// Entity returns generated.EntityResolver implementation. +func (r *Resolver) Entity() generated.EntityResolver { return &entityResolver{r} } + +type entityResolver struct{ *Resolver } diff --git a/demo/pkg/subgraphs/cachegraph_ext/subgraph/generated/federation.go b/demo/pkg/subgraphs/cachegraph_ext/subgraph/generated/federation.go new file mode 100644 index 0000000000..9b0fe72594 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph_ext/subgraph/generated/federation.go @@ -0,0 +1,345 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "strings" + "sync" + + "github.com/99designs/gqlgen/plugin/federation/fedruntime" +) + +var ( + ErrUnknownType = errors.New("unknown type") + ErrTypeNotFound = errors.New("type not found") +) + +func (ec *executionContext) __resolve__service(ctx context.Context) (fedruntime.Service, error) { + if ec.DisableIntrospection { + return fedruntime.Service{}, errors.New("federated introspection disabled") + } + + var sdl []string + + for _, src := range sources { + if src.BuiltIn { + continue + } + sdl = append(sdl, src.Input) + } + + return fedruntime.Service{ + SDL: strings.Join(sdl, "\n"), + }, nil +} + +func (ec *executionContext) __resolve_entities(ctx context.Context, representations []map[string]any) []fedruntime.Entity { + list := make([]fedruntime.Entity, len(representations)) + + repsMap := ec.buildRepresentationGroups(ctx, representations) + + switch len(repsMap) { + case 0: + return list + case 1: + for typeName, reps := range repsMap { + ec.resolveEntityGroup(ctx, typeName, reps, list) + } + return list + default: + var g sync.WaitGroup + g.Add(len(repsMap)) + for typeName, reps := range repsMap { + go func(typeName string, reps []EntityWithIndex) { + ec.resolveEntityGroup(ctx, typeName, reps, list) + g.Done() + }(typeName, reps) + } + g.Wait() + return list + } +} + +type EntityWithIndex struct { + // The index in the original representation array + index int + entity EntityRepresentation +} + +// EntityRepresentation is the JSON representation of an entity sent by the Router +// used as the inputs for us to resolve. +// +// We make it a map because we know the top level JSON is always an object. +type EntityRepresentation map[string]any + +// We group entities by typename so that we can parallelize their resolution. +// This is particularly helpful when there are entity groups in multi mode. +func (ec *executionContext) buildRepresentationGroups( + ctx context.Context, + representations []map[string]any, +) map[string][]EntityWithIndex { + repsMap := make(map[string][]EntityWithIndex) + for i, rep := range representations { + typeName, ok := rep["__typename"].(string) + if !ok { + // If there is no __typename, we just skip the representation; + // we just won't be resolving these unknown types. + ec.Error(ctx, errors.New("__typename must be an existing string")) + continue + } + + repsMap[typeName] = append(repsMap[typeName], EntityWithIndex{ + index: i, + entity: rep, + }) + } + + return repsMap +} + +func (ec *executionContext) resolveEntityGroup( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) { + if isMulti(typeName) { + err := ec.resolveManyEntities(ctx, typeName, reps, list) + if err != nil { + ec.Error(ctx, err) + } + } else { + // if there are multiple entities to resolve, parallelize (similar to + // graphql.FieldSet.Dispatch) + var e sync.WaitGroup + e.Add(len(reps)) + for i, rep := range reps { + i, rep := i, rep + go func(i int, rep EntityWithIndex) { + entity, err := ec.resolveEntity(ctx, typeName, rep.entity) + if err != nil { + ec.Error(ctx, err) + } else { + list[rep.index] = entity + } + e.Done() + }(i, rep) + } + e.Wait() + } +} + +func isMulti(typeName string) bool { + switch typeName { + default: + return false + } +} + +func (ec *executionContext) resolveEntity( + ctx context.Context, + typeName string, + rep EntityRepresentation, +) (e fedruntime.Entity, err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + case "Article": + resolverName, err := entityResolverNameForArticle(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Article": %w`, err) + } + switch resolverName { + + case "findArticleByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findArticleByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindArticleByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Article": %w`, err) + } + err = ec.PopulateArticleRequires(ctx, entity, rep) + if err != nil { + return nil, fmt.Errorf(`populating requires for Entity "Article": %w`, err) + } + return entity, nil + } + case "Catalog": + resolverName, err := entityResolverNameForCatalog(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Catalog": %w`, err) + } + switch resolverName { + + case "findCatalogByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findCatalogByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindCatalogByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Catalog": %w`, err) + } + + return entity, nil + } + case "Viewer": + resolverName, err := entityResolverNameForViewer(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Viewer": %w`, err) + } + switch resolverName { + + case "findViewerByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findViewerByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindViewerByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Viewer": %w`, err) + } + + return entity, nil + } + + } + return nil, fmt.Errorf("%w: %s", ErrUnknownType, typeName) +} + +func (ec *executionContext) resolveManyEntities( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) (err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + + default: + return errors.New("unknown type: " + typeName) + } +} + +func entityResolverNameForArticle(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Article", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Article", ErrTypeNotFound)) + break + } + return "findArticleByID", nil + } + return "", fmt.Errorf("%w for Article due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForCatalog(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Catalog", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Catalog", ErrTypeNotFound)) + break + } + return "findCatalogByID", nil + } + return "", fmt.Errorf("%w for Catalog due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForViewer(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Viewer", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Viewer", ErrTypeNotFound)) + break + } + return "findViewerByID", nil + } + return "", fmt.Errorf("%w for Viewer due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} diff --git a/demo/pkg/subgraphs/cachegraph_ext/subgraph/generated/federation.requires.go b/demo/pkg/subgraphs/cachegraph_ext/subgraph/generated/federation.requires.go new file mode 100644 index 0000000000..cf9363a758 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph_ext/subgraph/generated/federation.requires.go @@ -0,0 +1,28 @@ +package generated + +import ( + "context" + + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph_ext/subgraph/model" +) + +// PopulateArticleRequires is the requires populator for the Article entity. +func (ec *executionContext) PopulateArticleRequires(ctx context.Context, entity *model.Article, reps map[string]any) error { + cv, ok := reps["currentViewer"] + if !ok || cv == nil { + return nil + } + cvMap, ok := cv.(map[string]any) + if !ok { + return nil + } + viewer := &model.Viewer{} + if id, ok := cvMap["id"].(string); ok { + viewer.ID = id + } + if name, ok := cvMap["name"].(string); ok { + viewer.Name = name + } + entity.CurrentViewer = viewer + return nil +} diff --git a/demo/pkg/subgraphs/cachegraph_ext/subgraph/generated/generated.go b/demo/pkg/subgraphs/cachegraph_ext/subgraph/generated/generated.go new file mode 100644 index 0000000000..d1032d7adf --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph_ext/subgraph/generated/generated.go @@ -0,0 +1,5517 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "bytes" + "context" + "errors" + "fmt" + "strconv" + "sync" + "sync/atomic" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/introspection" + "github.com/99designs/gqlgen/plugin/federation/fedruntime" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph_ext/subgraph/model" +) + +// region ************************** generated!.gotpl ************************** + +// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. +func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { + return &executableSchema{ + schema: cfg.Schema, + resolvers: cfg.Resolvers, + directives: cfg.Directives, + complexity: cfg.Complexity, + } +} + +type Config struct { + Schema *ast.Schema + Resolvers ResolverRoot + Directives DirectiveRoot + Complexity ComplexityRoot +} + +type ResolverRoot interface { + Article() ArticleResolver + Entity() EntityResolver +} + +type DirectiveRoot struct { +} + +type ComplexityRoot struct { + Article struct { + CurrentViewer func(childComplexity int) int + ID func(childComplexity int) int + PersonalizedRecommendation func(childComplexity int) int + Rating func(childComplexity int) int + RelatedArticles func(childComplexity int) int + ReviewSummary func(childComplexity int) int + ViewCount func(childComplexity int) int + } + + Catalog struct { + Description func(childComplexity int) int + ID func(childComplexity int) int + LastUpdated func(childComplexity int) int + } + + Entity struct { + FindArticleByID func(childComplexity int, id string) int + FindCatalogByID func(childComplexity int, id string) int + FindViewerByID func(childComplexity int, id string) int + } + + Query struct { + __resolve__service func(childComplexity int) int + __resolve_entities func(childComplexity int, representations []map[string]any) int + } + + Viewer struct { + ID func(childComplexity int) int + Name func(childComplexity int) int + } + + _Service struct { + SDL func(childComplexity int) int + } +} + +type ArticleResolver interface { + RelatedArticles(ctx context.Context, obj *model.Article) ([]*model.Article, error) + PersonalizedRecommendation(ctx context.Context, obj *model.Article) (string, error) +} +type EntityResolver interface { + FindArticleByID(ctx context.Context, id string) (*model.Article, error) + FindCatalogByID(ctx context.Context, id string) (*model.Catalog, error) + FindViewerByID(ctx context.Context, id string) (*model.Viewer, error) +} + +type executableSchema struct { + schema *ast.Schema + resolvers ResolverRoot + directives DirectiveRoot + complexity ComplexityRoot +} + +func (e *executableSchema) Schema() *ast.Schema { + if e.schema != nil { + return e.schema + } + return parsedSchema +} + +func (e *executableSchema) Complexity(ctx context.Context, typeName, field string, childComplexity int, rawArgs map[string]any) (int, bool) { + ec := executionContext{nil, e, 0, 0, nil} + _ = ec + switch typeName + "." + field { + + case "Article.currentViewer": + if e.complexity.Article.CurrentViewer == nil { + break + } + + return e.complexity.Article.CurrentViewer(childComplexity), true + + case "Article.id": + if e.complexity.Article.ID == nil { + break + } + + return e.complexity.Article.ID(childComplexity), true + + case "Article.personalizedRecommendation": + if e.complexity.Article.PersonalizedRecommendation == nil { + break + } + + return e.complexity.Article.PersonalizedRecommendation(childComplexity), true + + case "Article.rating": + if e.complexity.Article.Rating == nil { + break + } + + return e.complexity.Article.Rating(childComplexity), true + + case "Article.relatedArticles": + if e.complexity.Article.RelatedArticles == nil { + break + } + + return e.complexity.Article.RelatedArticles(childComplexity), true + + case "Article.reviewSummary": + if e.complexity.Article.ReviewSummary == nil { + break + } + + return e.complexity.Article.ReviewSummary(childComplexity), true + + case "Article.viewCount": + if e.complexity.Article.ViewCount == nil { + break + } + + return e.complexity.Article.ViewCount(childComplexity), true + + case "Catalog.description": + if e.complexity.Catalog.Description == nil { + break + } + + return e.complexity.Catalog.Description(childComplexity), true + + case "Catalog.id": + if e.complexity.Catalog.ID == nil { + break + } + + return e.complexity.Catalog.ID(childComplexity), true + + case "Catalog.lastUpdated": + if e.complexity.Catalog.LastUpdated == nil { + break + } + + return e.complexity.Catalog.LastUpdated(childComplexity), true + + case "Entity.findArticleByID": + if e.complexity.Entity.FindArticleByID == nil { + break + } + + args, err := ec.field_Entity_findArticleByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindArticleByID(childComplexity, args["id"].(string)), true + + case "Entity.findCatalogByID": + if e.complexity.Entity.FindCatalogByID == nil { + break + } + + args, err := ec.field_Entity_findCatalogByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindCatalogByID(childComplexity, args["id"].(string)), true + + case "Entity.findViewerByID": + if e.complexity.Entity.FindViewerByID == nil { + break + } + + args, err := ec.field_Entity_findViewerByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindViewerByID(childComplexity, args["id"].(string)), true + + case "Query._service": + if e.complexity.Query.__resolve__service == nil { + break + } + + return e.complexity.Query.__resolve__service(childComplexity), true + + case "Query._entities": + if e.complexity.Query.__resolve_entities == nil { + break + } + + args, err := ec.field_Query__entities_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.__resolve_entities(childComplexity, args["representations"].([]map[string]any)), true + + case "Viewer.id": + if e.complexity.Viewer.ID == nil { + break + } + + return e.complexity.Viewer.ID(childComplexity), true + + case "Viewer.name": + if e.complexity.Viewer.Name == nil { + break + } + + return e.complexity.Viewer.Name(childComplexity), true + + case "_Service.sdl": + if e.complexity._Service.SDL == nil { + break + } + + return e.complexity._Service.SDL(childComplexity), true + + } + return 0, false +} + +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + opCtx := graphql.GetOperationContext(ctx) + ec := executionContext{opCtx, e, 0, 0, make(chan graphql.DeferredResult)} + inputUnmarshalMap := graphql.BuildUnmarshalerMap() + first := true + + switch opCtx.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + var response graphql.Response + var data graphql.Marshaler + if first { + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data = ec._Query(ctx, opCtx.Operation.SelectionSet) + } else { + if atomic.LoadInt32(&ec.pendingDeferred) > 0 { + result := <-ec.deferredResults + atomic.AddInt32(&ec.pendingDeferred, -1) + data = result.Result + response.Path = result.Path + response.Label = result.Label + response.Errors = result.Errors + } else { + return nil + } + } + var buf bytes.Buffer + data.MarshalGQL(&buf) + response.Data = buf.Bytes() + if atomic.LoadInt32(&ec.deferred) > 0 { + hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 + response.HasNext = &hasNext + } + + return &response + } + + default: + return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) + } +} + +type executionContext struct { + *graphql.OperationContext + *executableSchema + deferred int32 + pendingDeferred int32 + deferredResults chan graphql.DeferredResult +} + +func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) { + atomic.AddInt32(&ec.pendingDeferred, 1) + go func() { + ctx := graphql.WithFreshResponseContext(dg.Context) + dg.FieldSet.Dispatch(ctx) + ds := graphql.DeferredResult{ + Path: dg.Path, + Label: dg.Label, + Result: dg.FieldSet, + Errors: graphql.GetErrors(ctx), + } + // null fields should bubble up + if dg.FieldSet.Invalids > 0 { + ds.Result = graphql.Null + } + ec.deferredResults <- ds + }() +} + +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(ec.Schema()), nil +} + +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil +} + +var sources = []*ast.Source{ + {Name: "../schema.graphqls", Input: `extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key", "@external", "@requires"] + ) + +directive @openfed__entityCache( + maxAge: Int! + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT + +type Article @key(fields: "id") @openfed__entityCache(maxAge: 90) { + id: ID! + currentViewer: Viewer @external + viewCount: Int! + rating: Float! + reviewSummary: String! + relatedArticles: [Article!]! + personalizedRecommendation: String! @requires(fields: "currentViewer { id name }") +} + +type Viewer @key(fields: "id") { + id: ID! + name: String! @external +} + +"""Extends Catalog with description from a second subgraph (for partial cache load testing)""" +type Catalog @key(fields: "id") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) { + id: ID! + description: String! + lastUpdated: String! +} +`, BuiltIn: false}, + {Name: "../../federation/directives.graphql", Input: ` + directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM + directive @composeDirective(name: String!) repeatable on SCHEMA + directive @extends on OBJECT | INTERFACE + directive @external on OBJECT | FIELD_DEFINITION + directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE + directive @inaccessible on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + directive @interfaceObject on OBJECT + directive @link(import: [String!], url: String!) repeatable on SCHEMA + directive @override(from: String!, label: String) on FIELD_DEFINITION + directive @policy(policies: [[federation__Policy!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @provides(fields: FieldSet!) on FIELD_DEFINITION + directive @requires(fields: FieldSet!) on FIELD_DEFINITION + directive @requiresScopes(scopes: [[federation__Scope!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @shareable repeatable on FIELD_DEFINITION | OBJECT + directive @tag(name: String!) repeatable on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + scalar _Any + scalar FieldSet + scalar federation__Policy + scalar federation__Scope +`, BuiltIn: true}, + {Name: "../../federation/entity.graphql", Input: ` +# a union of all types that use the @key directive +union _Entity = Article | Catalog | Viewer + +# fake type to build resolver interfaces for users to implement +type Entity { + findArticleByID(id: ID!,): Article! + findCatalogByID(id: ID!,): Catalog! + findViewerByID(id: ID!,): Viewer! +} + +type _Service { + sdl: String +} + +extend type Query { + _entities(representations: [_Any!]!): [_Entity]! + _service: _Service! +} +`, BuiltIn: true}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Entity_findArticleByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findArticleByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findArticleByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findCatalogByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findCatalogByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findCatalogByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findViewerByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findViewerByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findViewerByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query___type_argsName(ctx, rawArgs) + if err != nil { + return nil, err + } + args["name"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query___type_argsName( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["name"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["name"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query__entities_argsRepresentations(ctx, rawArgs) + if err != nil { + return nil, err + } + args["representations"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query__entities_argsRepresentations( + ctx context.Context, + rawArgs map[string]any, +) ([]map[string]any, error) { + if _, ok := rawArgs["representations"]; !ok { + var zeroVal []map[string]any + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) + if tmp, ok := rawArgs["representations"]; ok { + return ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) + } + + var zeroVal []map[string]any + return zeroVal, nil +} + +func (ec *executionContext) field___Directive_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Directive_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Directive_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Field_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Field_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Field_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_enumValues_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_enumValues_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_fields_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_fields_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _Article_id(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_currentViewer(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_currentViewer(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.CurrentViewer, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Viewer) + fc.Result = res + return ec.marshalOViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraph_extᚋsubgraphᚋmodelᚐViewer(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_currentViewer(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Viewer_id(ctx, field) + case "name": + return ec.fieldContext_Viewer_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Viewer", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_viewCount(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_viewCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ViewCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_viewCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_rating(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_rating(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Rating, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(float64) + fc.Result = res + return ec.marshalNFloat2float64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_rating(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Float does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_reviewSummary(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_reviewSummary(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReviewSummary, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_reviewSummary(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_relatedArticles(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_relatedArticles(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Article().RelatedArticles(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Article) + fc.Result = res + return ec.marshalNArticle2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraph_extᚋsubgraphᚋmodelᚐArticleᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_relatedArticles(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "currentViewer": + return ec.fieldContext_Article_currentViewer(ctx, field) + case "viewCount": + return ec.fieldContext_Article_viewCount(ctx, field) + case "rating": + return ec.fieldContext_Article_rating(ctx, field) + case "reviewSummary": + return ec.fieldContext_Article_reviewSummary(ctx, field) + case "relatedArticles": + return ec.fieldContext_Article_relatedArticles(ctx, field) + case "personalizedRecommendation": + return ec.fieldContext_Article_personalizedRecommendation(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_personalizedRecommendation(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_personalizedRecommendation(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Article().PersonalizedRecommendation(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_personalizedRecommendation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Catalog_id(ctx context.Context, field graphql.CollectedField, obj *model.Catalog) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Catalog_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Catalog_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Catalog", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Catalog_description(ctx context.Context, field graphql.CollectedField, obj *model.Catalog) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Catalog_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Catalog_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Catalog", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Catalog_lastUpdated(ctx context.Context, field graphql.CollectedField, obj *model.Catalog) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Catalog_lastUpdated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdated, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Catalog_lastUpdated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Catalog", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_findArticleByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findArticleByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindArticleByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Article) + fc.Result = res + return ec.marshalNArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraph_extᚋsubgraphᚋmodelᚐArticle(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findArticleByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "currentViewer": + return ec.fieldContext_Article_currentViewer(ctx, field) + case "viewCount": + return ec.fieldContext_Article_viewCount(ctx, field) + case "rating": + return ec.fieldContext_Article_rating(ctx, field) + case "reviewSummary": + return ec.fieldContext_Article_reviewSummary(ctx, field) + case "relatedArticles": + return ec.fieldContext_Article_relatedArticles(ctx, field) + case "personalizedRecommendation": + return ec.fieldContext_Article_personalizedRecommendation(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findArticleByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findCatalogByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findCatalogByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindCatalogByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Catalog) + fc.Result = res + return ec.marshalNCatalog2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraph_extᚋsubgraphᚋmodelᚐCatalog(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findCatalogByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Catalog_id(ctx, field) + case "description": + return ec.fieldContext_Catalog_description(ctx, field) + case "lastUpdated": + return ec.fieldContext_Catalog_lastUpdated(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Catalog", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findCatalogByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findViewerByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findViewerByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindViewerByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Viewer) + fc.Result = res + return ec.marshalNViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraph_extᚋsubgraphᚋmodelᚐViewer(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findViewerByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Viewer_id(ctx, field) + case "name": + return ec.fieldContext_Viewer_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Viewer", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findViewerByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__entities(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve_entities(ctx, fc.Args["representations"].([]map[string]any)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]fedruntime.Entity) + fc.Result = res + return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__entities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type _Entity does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query__entities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__service(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve__service(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(fedruntime.Service) + fc.Result = res + return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__service(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "sdl": + return ec.fieldContext__Service_sdl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___schema(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Viewer_id(ctx context.Context, field graphql.CollectedField, obj *model.Viewer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Viewer_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Viewer_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Viewer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Viewer_name(ctx context.Context, field graphql.CollectedField, obj *model.Viewer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Viewer_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Viewer_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Viewer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext__Service_sdl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SDL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext__Service_sdl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "_Service", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsRepeatable, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Locations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __DirectiveLocation does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Directive_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Field_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_isOneOf(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_isOneOf(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsOneOf(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_isOneOf(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, obj fedruntime.Entity) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case model.Viewer: + return ec._Viewer(ctx, sel, &obj) + case *model.Viewer: + if obj == nil { + return graphql.Null + } + return ec._Viewer(ctx, sel, obj) + case model.Catalog: + return ec._Catalog(ctx, sel, &obj) + case *model.Catalog: + if obj == nil { + return graphql.Null + } + return ec._Catalog(ctx, sel, obj) + case model.Article: + return ec._Article(ctx, sel, &obj) + case *model.Article: + if obj == nil { + return graphql.Null + } + return ec._Article(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var articleImplementors = []string{"Article", "_Entity"} + +func (ec *executionContext) _Article(ctx context.Context, sel ast.SelectionSet, obj *model.Article) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, articleImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Article") + case "id": + out.Values[i] = ec._Article_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "currentViewer": + out.Values[i] = ec._Article_currentViewer(ctx, field, obj) + case "viewCount": + out.Values[i] = ec._Article_viewCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "rating": + out.Values[i] = ec._Article_rating(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "reviewSummary": + out.Values[i] = ec._Article_reviewSummary(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "relatedArticles": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Article_relatedArticles(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "personalizedRecommendation": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Article_personalizedRecommendation(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var catalogImplementors = []string{"Catalog", "_Entity"} + +func (ec *executionContext) _Catalog(ctx context.Context, sel ast.SelectionSet, obj *model.Catalog) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, catalogImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Catalog") + case "id": + out.Values[i] = ec._Catalog_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec._Catalog_description(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "lastUpdated": + out.Values[i] = ec._Catalog_lastUpdated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var entityImplementors = []string{"Entity"} + +func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Entity", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Entity") + case "findArticleByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findArticleByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findCatalogByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findCatalogByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findViewerByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findViewerByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var queryImplementors = []string{"Query"} + +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "_entities": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__entities(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "_service": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__service(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "__type": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) + case "__schema": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var viewerImplementors = []string{"Viewer", "_Entity"} + +func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, obj *model.Viewer) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, viewerImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Viewer") + case "id": + out.Values[i] = ec._Viewer_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._Viewer_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var _ServiceImplementors = []string{"_Service"} + +func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("_Service") + case "sdl": + out.Values[i] = ec.__Service_sdl(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __DirectiveImplementors = []string{"__Directive"} + +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "isRepeatable": + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __EnumValueImplementors = []string{"__EnumValue"} + +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __FieldImplementors = []string{"__Field"} + +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __InputValueImplementors = []string{"__InputValue"} + +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___InputValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___InputValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __SchemaImplementors = []string{"__Schema"} + +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Schema") + case "description": + out.Values[i] = ec.___Schema_description(ctx, field, obj) + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __TypeImplementors = []string{"__Type"} + +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "specifiedByURL": + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + case "isOneOf": + out.Values[i] = ec.___Type_isOneOf(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +// endregion **************************** object.gotpl **************************** + +// region ***************************** type.gotpl ***************************** + +func (ec *executionContext) marshalNArticle2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraph_extᚋsubgraphᚋmodelᚐArticle(ctx context.Context, sel ast.SelectionSet, v model.Article) graphql.Marshaler { + return ec._Article(ctx, sel, &v) +} + +func (ec *executionContext) marshalNArticle2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraph_extᚋsubgraphᚋmodelᚐArticleᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Article) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraph_extᚋsubgraphᚋmodelᚐArticle(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraph_extᚋsubgraphᚋmodelᚐArticle(ctx context.Context, sel ast.SelectionSet, v *model.Article) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Article(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNCatalog2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraph_extᚋsubgraphᚋmodelᚐCatalog(ctx context.Context, sel ast.SelectionSet, v model.Catalog) graphql.Marshaler { + return ec._Catalog(ctx, sel, &v) +} + +func (ec *executionContext) marshalNCatalog2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraph_extᚋsubgraphᚋmodelᚐCatalog(ctx context.Context, sel ast.SelectionSet, v *model.Catalog) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Catalog(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNFieldSet2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v any) (float64, error) { + res, err := graphql.UnmarshalFloatContext(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { + _ = sel + res := graphql.MarshalFloatContext(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return graphql.WrapContextMarshaler(ctx, res) +} + +func (ec *executionContext) unmarshalNID2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalID(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalID(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v any) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { + _ = sel + res := graphql.MarshalInt(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNViewer2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraph_extᚋsubgraphᚋmodelᚐViewer(ctx context.Context, sel ast.SelectionSet, v model.Viewer) graphql.Marshaler { + return ec._Viewer(ctx, sel, &v) +} + +func (ec *executionContext) marshalNViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraph_extᚋsubgraphᚋmodelᚐViewer(ctx context.Context, sel ast.SelectionSet, v *model.Viewer) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Viewer(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v any) (map[string]any, error) { + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]any) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + _ = sel + res := graphql.MarshalMap(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v any) ([]map[string]any, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]map[string]any, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN_Any2map(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN_Any2ᚕmapᚄ(ctx context.Context, sel ast.SelectionSet, v []map[string]any) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalN_Any2map(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v []fedruntime.Entity) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { + return ec.__Service(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { + return ec.___Directive(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { + return ec.___EnumValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { + return ec.___Field(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { + return ec.___InputValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { + return ec.___Type(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Policy2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Scope2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalBoolean(v) + return res +} + +func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v any) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalBoolean(*v) + return res +} + +func (ec *executionContext) unmarshalOString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalString(v) + return res +} + +func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + if v == nil { + return nil, nil + } + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v any) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalString(*v) + return res +} + +func (ec *executionContext) marshalOViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋcachegraph_extᚋsubgraphᚋmodelᚐViewer(ctx context.Context, sel ast.SelectionSet, v *model.Viewer) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Viewer(ctx, sel, v) +} + +func (ec *executionContext) marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v fedruntime.Entity) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.__Entity(ctx, sel, v) +} + +func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Schema(ctx, sel, v) +} + +func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +// endregion ***************************** type.gotpl ***************************** diff --git a/demo/pkg/subgraphs/cachegraph_ext/subgraph/model/models_gen.go b/demo/pkg/subgraphs/cachegraph_ext/subgraph/model/models_gen.go new file mode 100644 index 0000000000..eda8f193c0 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph_ext/subgraph/model/models_gen.go @@ -0,0 +1,34 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package model + +type Article struct { + ID string `json:"id"` + CurrentViewer *Viewer `json:"currentViewer,omitempty"` + ViewCount int `json:"viewCount"` + Rating float64 `json:"rating"` + ReviewSummary string `json:"reviewSummary"` + RelatedArticles []*Article `json:"relatedArticles"` + PersonalizedRecommendation string `json:"personalizedRecommendation"` +} + +func (Article) IsEntity() {} + +// Extends Catalog with description from a second subgraph (for partial cache load testing) +type Catalog struct { + ID string `json:"id"` + Description string `json:"description"` + LastUpdated string `json:"lastUpdated"` +} + +func (Catalog) IsEntity() {} + +type Query struct { +} + +type Viewer struct { + ID string `json:"id"` + Name string `json:"name"` +} + +func (Viewer) IsEntity() {} diff --git a/demo/pkg/subgraphs/cachegraph_ext/subgraph/resolver.go b/demo/pkg/subgraphs/cachegraph_ext/subgraph/resolver.go new file mode 100644 index 0000000000..11329bb4a8 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph_ext/subgraph/resolver.go @@ -0,0 +1,3 @@ +package subgraph + +type Resolver struct{} diff --git a/demo/pkg/subgraphs/cachegraph_ext/subgraph/schema.graphqls b/demo/pkg/subgraphs/cachegraph_ext/subgraph/schema.graphqls new file mode 100644 index 0000000000..ee734f0c63 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph_ext/subgraph/schema.graphqls @@ -0,0 +1,34 @@ +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key", "@external", "@requires"] + ) + +directive @openfed__entityCache( + maxAge: Int! + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT + +type Article @key(fields: "id") @openfed__entityCache(maxAge: 90) { + id: ID! + currentViewer: Viewer @external + viewCount: Int! + rating: Float! + reviewSummary: String! + relatedArticles: [Article!]! + personalizedRecommendation: String! @requires(fields: "currentViewer { id name }") +} + +type Viewer @key(fields: "id") { + id: ID! + name: String! @external +} + +"""Extends Catalog with description from a second subgraph (for partial cache load testing)""" +type Catalog @key(fields: "id") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) { + id: ID! + description: String! + lastUpdated: String! +} diff --git a/demo/pkg/subgraphs/cachegraph_ext/subgraph/schema.resolvers.go b/demo/pkg/subgraphs/cachegraph_ext/subgraph/schema.resolvers.go new file mode 100644 index 0000000000..9cb5ba9ac4 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph_ext/subgraph/schema.resolvers.go @@ -0,0 +1,44 @@ +package subgraph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.76 + +import ( + "context" + "fmt" + + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph_ext/subgraph/generated" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph_ext/subgraph/model" +) + +// RelatedArticles is the resolver for the relatedArticles field. +func (r *articleResolver) RelatedArticles(ctx context.Context, obj *model.Article) ([]*model.Article, error) { + ext := articleExtensions[obj.ID] + if ext == nil { + return nil, nil + } + related := make([]*model.Article, len(ext.RelatedIDs)) + for i, rid := range ext.RelatedIDs { + relatedExt := articleExtensions[rid] + if relatedExt == nil { + related[i] = &model.Article{ID: rid} + continue + } + related[i] = toArticle(rid, relatedExt) + } + return related, nil +} + +// PersonalizedRecommendation is the resolver for the personalizedRecommendation field. +func (r *articleResolver) PersonalizedRecommendation(ctx context.Context, obj *model.Article) (string, error) { + if obj.CurrentViewer == nil { + return "Sign in to get personalized recommendations.", nil + } + return fmt.Sprintf("Hey %s, based on your interests you'll love this article!", obj.CurrentViewer.Name), nil +} + +// Article returns generated.ArticleResolver implementation. +func (r *Resolver) Article() generated.ArticleResolver { return &articleResolver{r} } + +type articleResolver struct{ *Resolver } diff --git a/demo/pkg/subgraphs/cachegraph_ext/subgraph/schema.resolvers_test.go b/demo/pkg/subgraphs/cachegraph_ext/subgraph/schema.resolvers_test.go new file mode 100644 index 0000000000..e1ff750f85 --- /dev/null +++ b/demo/pkg/subgraphs/cachegraph_ext/subgraph/schema.resolvers_test.go @@ -0,0 +1,29 @@ +package subgraph + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph_ext/subgraph/model" +) + +func TestRelatedArticlesReturnsPopulatedArticleExtensions(t *testing.T) { + t.Parallel() + + r := &Resolver{} + + related, err := r.Article().RelatedArticles(context.Background(), &model.Article{ID: "1"}) + require.NoError(t, err) + require.Len(t, related, 2) + + require.Equal(t, "3", related[0].ID) + require.Equal(t, 15678, related[0].ViewCount) + require.Equal(t, 4.9, related[0].Rating) + require.Equal(t, "The definitive guide to cache invalidation. Must read.", related[0].ReviewSummary) + + require.Equal(t, "4", related[1].ID) + require.Equal(t, 6234, related[1].ViewCount) + require.Equal(t, 4.1, related[1].Rating) + require.Equal(t, "Practical tips for production caching. Solid advice.", related[1].ReviewSummary) +} diff --git a/demo/pkg/subgraphs/projects/generated/service.pb.go b/demo/pkg/subgraphs/projects/generated/service.pb.go index e5a79bd919..52431467ac 100644 --- a/demo/pkg/subgraphs/projects/generated/service.pb.go +++ b/demo/pkg/subgraphs/projects/generated/service.pb.go @@ -15452,7 +15452,7 @@ var file_generated_service_proto_rawDesc = []byte{ 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x54, 0x65, 0x63, 0x68, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x00, 0x52, 0x11, 0x74, 0x65, 0x63, 0x68, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x42, 0x0a, 0x0a, 0x08, 0x69, - 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xac, 0x08, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x6a, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xb2, 0x08, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, @@ -15519,758 +15519,759 @@ var file_generated_service_proto_rawDesc = []byte{ 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x0e, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, - 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x22, 0xa9, 0x04, 0x0a, 0x09, 0x4d, 0x69, 0x6c, 0x65, 0x73, - 0x74, 0x6f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x44, 0x61, 0x74, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12, 0x30, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x51, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x65, - 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x14, 0x63, 0x6f, - 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, - 0x67, 0x65, 0x12, 0x36, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, - 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x52, 0x0c, 0x64, 0x65, - 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x75, - 0x62, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x54, 0x61, 0x73, - 0x6b, 0x52, 0x08, 0x73, 0x75, 0x62, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x35, 0x0a, 0x09, 0x72, - 0x65, 0x76, 0x69, 0x65, 0x77, 0x65, 0x72, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, - 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x52, 0x09, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x65, - 0x72, 0x73, 0x22, 0xeb, 0x06, 0x0a, 0x04, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x0c, 0x6d, 0x69, - 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, - 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x3c, 0x0a, 0x0b, 0x61, - 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, - 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, + 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x4a, 0x04, 0x08, 0x14, 0x10, 0x16, 0x22, 0xa9, 0x04, 0x0a, + 0x09, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, - 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, - 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, - 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x13, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x49, 0x0a, - 0x0f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x75, 0x72, 0x73, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0e, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, - 0x74, 0x65, 0x64, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x75, - 0x61, 0x6c, 0x5f, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x61, 0x63, - 0x74, 0x75, 0x61, 0x6c, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x12, 0x3b, 0x0a, 0x0a, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3f, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, - 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, + 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x74, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x65, 0x6e, + 0x64, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x2d, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, - 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x75, 0x62, 0x74, 0x61, 0x73, - 0x6b, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x08, 0x73, - 0x75, 0x62, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x31, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, - 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x0c, 0x64, 0x65, - 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x74, - 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x73, 0x18, 0x10, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x55, - 0x72, 0x6c, 0x73, 0x12, 0x35, 0x0a, 0x0c, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x49, 0x6e, 0x74, 0x52, 0x0b, 0x72, - 0x65, 0x76, 0x69, 0x65, 0x77, 0x65, 0x72, 0x49, 0x64, 0x73, 0x4a, 0x04, 0x08, 0x12, 0x10, 0x14, - 0x22, 0xf1, 0x02, 0x0a, 0x08, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, - 0x08, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x73, 0x12, 0x34, 0x0a, 0x0e, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x61, - 0x73, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x0d, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x36, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, - 0x65, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, - 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, - 0x2d, 0x0a, 0x06, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x12, 0x3d, - 0x0a, 0x0e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0e, 0x63, - 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x45, 0x0a, - 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x50, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x69, 0x73, - 0x74, 0x6f, 0x72, 0x79, 0x22, 0x93, 0x01, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x12, 0x10, 0x0a, 0x03, 0x75, 0x70, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, - 0x70, 0x63, 0x12, 0x32, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x4f, 0x66, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x08, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x0e, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x4c, - 0x69, 0x73, 0x74, 0x4f, 0x66, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x66, 0x65, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x22, 0xd2, 0x01, 0x0a, 0x0f, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2f, - 0x0a, 0x08, 0x65, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x6c, 0x6f, - 0x79, 0x65, 0x65, 0x48, 0x00, 0x52, 0x08, 0x65, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x12, - 0x2c, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x32, 0x0a, - 0x09, 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x69, 0x6c, 0x65, 0x73, - 0x74, 0x6f, 0x6e, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, - 0x65, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x00, - 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0xa5, 0x01, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x32, 0x0a, 0x09, 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, - 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x48, 0x00, 0x52, 0x09, - 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x61, 0x73, - 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x07, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xb4, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x3f, 0x0a, 0x0e, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x32, 0x0a, 0x09, - 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, - 0x6f, 0x6e, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, - 0x12, 0x23, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, - 0x04, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xda, - 0x01, 0x0a, 0x04, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x32, 0x0a, 0x09, 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, - 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x48, 0x00, 0x52, 0x09, - 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x61, 0x73, - 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x3f, - 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x00, - 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, - 0x0a, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x88, 0x02, 0x0a, 0x0c, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x44, + 0x61, 0x74, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x69, + 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x51, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x74, 0x65, 0x12, 0x37, 0x0a, - 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, - 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xee, 0x01, 0x0a, 0x0e, 0x4d, 0x69, 0x6c, 0x65, 0x73, - 0x74, 0x6f, 0x6e, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x14, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, + 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, + 0x6e, 0x65, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, + 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x75, 0x62, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x4f, 0x66, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x08, 0x73, 0x75, 0x62, 0x74, 0x61, 0x73, 0x6b, + 0x73, 0x12, 0x35, 0x0a, 0x09, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x65, 0x72, 0x73, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x52, 0x09, 0x72, + 0x65, 0x76, 0x69, 0x65, 0x77, 0x65, 0x72, 0x73, 0x22, 0xeb, 0x06, 0x0a, 0x04, 0x54, 0x61, 0x73, + 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, + 0x12, 0x3f, 0x0a, 0x0c, 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x49, + 0x64, 0x12, 0x3c, 0x0a, 0x0b, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x08, 0x70, 0x72, + 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x49, 0x0a, 0x0f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0e, + 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x12, 0x3f, + 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x0b, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x12, + 0x3b, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3f, 0x0a, 0x0c, + 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x2d, 0x0a, + 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x2f, 0x0a, 0x08, + 0x73, 0x75, 0x62, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x54, + 0x61, 0x73, 0x6b, 0x52, 0x08, 0x73, 0x75, 0x62, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x31, 0x0a, + 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x0f, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, + 0x73, 0x6b, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, + 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x75, + 0x72, 0x6c, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x61, 0x63, + 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x72, 0x6c, 0x73, 0x12, 0x35, 0x0a, 0x0c, 0x72, 0x65, 0x76, + 0x69, 0x65, 0x77, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, + 0x49, 0x6e, 0x74, 0x52, 0x0b, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x65, 0x72, 0x49, 0x64, 0x73, + 0x4a, 0x04, 0x08, 0x12, 0x10, 0x14, 0x22, 0xf7, 0x02, 0x0a, 0x08, 0x45, 0x6d, 0x70, 0x6c, 0x6f, + 0x79, 0x65, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x08, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x34, 0x0a, 0x0e, 0x61, 0x73, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x0d, + 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x36, 0x0a, + 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, + 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x2d, 0x0a, 0x06, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x6b, + 0x69, 0x6c, 0x6c, 0x73, 0x12, 0x3d, 0x0a, 0x0e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x0e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x45, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, + 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x4c, 0x69, 0x73, + 0x74, 0x4f, 0x66, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, + 0x22, 0x93, 0x01, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x10, 0x0a, 0x03, + 0x75, 0x70, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x70, 0x63, 0x12, 0x32, + 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, + 0x66, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x73, 0x12, 0x42, 0x0a, 0x0e, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x6d, 0x61, + 0x74, 0x72, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x4c, 0x69, 0x73, 0x74, 0x4f, + 0x66, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x22, 0xd2, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x65, 0x6d, + 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x48, + 0x00, 0x52, 0x08, 0x65, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x70, + 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x48, 0x00, + 0x52, 0x07, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x32, 0x0a, 0x09, 0x6d, 0x69, 0x6c, + 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, + 0x48, 0x00, 0x52, 0x09, 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x12, 0x23, 0x0a, + 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x74, 0x61, + 0x73, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa5, 0x01, 0x0a, 0x13, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x12, 0x32, 0x0a, 0x09, 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, + 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6d, 0x69, 0x6c, 0x65, + 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, + 0x73, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x22, 0xb4, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x3f, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x6d, 0x69, 0x6c, 0x65, + 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x48, + 0x00, 0x52, 0x09, 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x12, 0x23, 0x0a, 0x04, + 0x74, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x74, 0x61, 0x73, + 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xda, 0x01, 0x0a, 0x04, 0x4e, + 0x6f, 0x64, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x12, 0x32, 0x0a, 0x09, 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, + 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6d, 0x69, 0x6c, 0x65, + 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, + 0x73, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x3f, 0x0a, 0x0e, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x88, 0x02, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x08, - 0x64, 0x75, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x64, 0x75, - 0x65, 0x44, 0x61, 0x74, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xe3, 0x02, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0a, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x74, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x65, 0x6e, 0x64, + 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, + 0x74, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x22, 0xee, 0x01, 0x0a, 0x0e, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x49, 0x64, 0x12, 0x3c, 0x0a, 0x0b, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, - 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, - 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, - 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, - 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x45, 0x0a, 0x0f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x65, - 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x22, 0x99, 0x02, - 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x22, - 0x0a, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x5f, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, - 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, - 0x38, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x7b, 0x0a, 0x0b, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x07, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x32, 0x0a, 0x09, 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, - 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x48, 0x00, 0x52, - 0x09, 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x3d, 0x0a, 0x0a, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x73, - 0x6b, 0x48, 0x00, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x0a, 0x0a, 0x08, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xbd, 0x01, 0x0a, 0x10, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, - 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x4c, 0x0a, 0x13, 0x74, 0x65, - 0x63, 0x68, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x74, 0x65, - 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x54, 0x65, 0x63, 0x68, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x57, 0x6f, 0x72, 0x6b, 0x49, - 0x74, 0x65, 0x6d, 0x48, 0x00, 0x52, 0x11, 0x74, 0x65, 0x63, 0x68, 0x6e, 0x69, 0x63, 0x61, 0x6c, - 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x4f, 0x0a, 0x14, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x74, 0x65, 0x6d, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x49, - 0x74, 0x65, 0x6d, 0x48, 0x00, 0x52, 0x12, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x42, 0x0a, 0x0a, 0x08, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xc5, 0x01, 0x0a, 0x11, 0x54, 0x65, 0x63, 0x68, 0x6e, 0x69, - 0x63, 0x61, 0x6c, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x63, - 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x09, 0x63, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x68, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x2d, - 0x0a, 0x05, 0x73, 0x70, 0x65, 0x63, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x65, 0x63, 0x68, 0x6e, 0x69, 0x63, 0x61, - 0x6c, 0x53, 0x70, 0x65, 0x63, 0x73, 0x52, 0x05, 0x73, 0x70, 0x65, 0x63, 0x73, 0x22, 0xc5, 0x01, - 0x0a, 0x12, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x57, 0x6f, 0x72, 0x6b, - 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x69, 0x7a, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, 0x53, 0x69, 0x7a, - 0x65, 0x12, 0x32, 0x0a, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x6f, 0x72, - 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x07, 0x68, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x05, 0x73, 0x70, 0x65, 0x63, 0x73, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x73, 0x52, 0x05, - 0x73, 0x70, 0x65, 0x63, 0x73, 0x22, 0x65, 0x0a, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, - 0x6d, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0d, - 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6d, - 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0c, - 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x22, 0x74, 0x0a, 0x0e, - 0x54, 0x65, 0x63, 0x68, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x70, 0x65, 0x63, 0x73, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x74, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, - 0x74, 0x79, 0x12, 0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x6f, - 0x72, 0x6b, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x73, 0x22, 0x6b, 0x0a, 0x0f, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x53, 0x70, 0x65, 0x63, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, - 0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x4d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, - 0x43, 0x0a, 0x0b, 0x57, 0x6f, 0x72, 0x6b, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x14, - 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x73, - 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, - 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, - 0x65, 0x6e, 0x63, 0x79, 0x22, 0x9a, 0x01, 0x0a, 0x10, 0x57, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x76, - 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3c, 0x0a, 0x0d, 0x77, 0x6f, 0x72, - 0x6b, 0x5f, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x41, - 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x41, - 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x12, 0x3f, 0x0a, 0x0e, 0x77, 0x6f, 0x72, 0x6b, 0x5f, - 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x52, 0x65, - 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0d, 0x77, 0x6f, 0x72, 0x6b, 0x52, - 0x65, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x49, 0x0a, 0x0c, 0x57, 0x6f, 0x72, 0x6b, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, - 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x61, - 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x41, 0x74, 0x22, 0x4e, 0x0a, 0x0d, - 0x57, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, - 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, - 0x65, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x65, 0x0a, 0x09, - 0x57, 0x6f, 0x72, 0x6b, 0x53, 0x65, 0x74, 0x75, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x69, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3c, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, - 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, - 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x49, - 0x74, 0x65, 0x6d, 0x2a, 0xa1, 0x01, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, 0x1a, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, - 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, - 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x4c, 0x41, 0x4e, 0x4e, 0x49, 0x4e, 0x47, - 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x53, 0x54, - 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x12, 0x1c, 0x0a, - 0x18, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, - 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x50, - 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x4e, - 0x5f, 0x48, 0x4f, 0x4c, 0x44, 0x10, 0x04, 0x2a, 0xb1, 0x01, 0x0a, 0x0f, 0x4d, 0x69, 0x6c, 0x65, - 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x0a, 0x1c, 0x4d, - 0x49, 0x4c, 0x45, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, - 0x18, 0x4d, 0x49, 0x4c, 0x45, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, - 0x53, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x20, 0x0a, 0x1c, 0x4d, - 0x49, 0x4c, 0x45, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, - 0x49, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x45, 0x53, 0x53, 0x10, 0x02, 0x12, 0x1e, 0x0a, - 0x1a, 0x4d, 0x49, 0x4c, 0x45, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, - 0x53, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, - 0x18, 0x4d, 0x49, 0x4c, 0x45, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, - 0x53, 0x5f, 0x44, 0x45, 0x4c, 0x41, 0x59, 0x45, 0x44, 0x10, 0x04, 0x2a, 0xa8, 0x01, 0x0a, 0x0a, - 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x41, - 0x53, 0x4b, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x53, 0x4b, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x54, 0x4f, 0x44, 0x4f, 0x10, 0x01, 0x12, 0x1b, 0x0a, - 0x17, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, 0x4e, 0x5f, - 0x50, 0x52, 0x4f, 0x47, 0x52, 0x45, 0x53, 0x53, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x41, - 0x53, 0x4b, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, - 0x10, 0x03, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, - 0x53, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x04, 0x12, 0x17, 0x0a, - 0x13, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x42, 0x4c, 0x4f, - 0x43, 0x4b, 0x45, 0x44, 0x10, 0x05, 0x2a, 0x90, 0x01, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x50, - 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x19, 0x54, 0x41, 0x53, 0x4b, 0x5f, - 0x50, 0x52, 0x49, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x50, - 0x52, 0x49, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4c, 0x4f, 0x57, 0x10, 0x01, 0x12, 0x18, 0x0a, - 0x14, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x50, 0x52, 0x49, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4d, - 0x45, 0x44, 0x49, 0x55, 0x4d, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x41, 0x53, 0x4b, 0x5f, - 0x50, 0x52, 0x49, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x48, 0x49, 0x47, 0x48, 0x10, 0x03, 0x12, - 0x18, 0x0a, 0x14, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x50, 0x52, 0x49, 0x4f, 0x52, 0x49, 0x54, 0x59, - 0x5f, 0x55, 0x52, 0x47, 0x45, 0x4e, 0x54, 0x10, 0x04, 0x2a, 0xfd, 0x01, 0x0a, 0x11, 0x50, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x23, 0x0a, 0x1f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, - 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x25, 0x0a, 0x21, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, - 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x50, - 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x4d, 0x49, 0x4c, 0x45, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x5f, 0x41, 0x44, 0x44, - 0x45, 0x44, 0x10, 0x02, 0x12, 0x25, 0x0a, 0x21, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, - 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x41, 0x53, 0x4b, - 0x5f, 0x41, 0x53, 0x53, 0x49, 0x47, 0x4e, 0x45, 0x44, 0x10, 0x03, 0x12, 0x27, 0x0a, 0x23, 0x50, + 0x63, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x08, 0x64, 0x75, 0x65, 0x5f, + 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x64, 0x75, 0x65, 0x44, 0x61, 0x74, + 0x65, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x69, 0x6c, 0x65, + 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x22, 0xe3, 0x02, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x6e, 0x70, 0x75, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, + 0x12, 0x3c, 0x0a, 0x0b, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x0a, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, + 0x61, 0x73, 0x6b, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x08, 0x70, 0x72, 0x69, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x45, 0x0a, 0x0f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x68, 0x6f, 0x75, 0x72, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, + 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x65, 0x73, 0x74, 0x69, 0x6d, + 0x61, 0x74, 0x65, 0x64, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x22, 0x99, 0x02, 0x0a, 0x0d, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x49, 0x64, 0x12, 0x3b, + 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x38, 0x0a, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x7b, 0x0a, 0x0b, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x12, 0x32, 0x0a, 0x09, 0x6d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6d, 0x69, 0x6c, + 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x22, 0x3d, 0x0a, 0x0a, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x12, 0x23, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, + 0x04, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x0a, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x22, 0xbd, 0x01, 0x0a, 0x10, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, + 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x4c, 0x0a, 0x13, 0x74, 0x65, 0x63, 0x68, 0x6e, 0x69, + 0x63, 0x61, 0x6c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x65, + 0x63, 0x68, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x48, + 0x00, 0x52, 0x11, 0x74, 0x65, 0x63, 0x68, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x57, 0x6f, 0x72, 0x6b, + 0x49, 0x74, 0x65, 0x6d, 0x12, 0x4f, 0x0a, 0x14, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x48, + 0x00, 0x52, 0x12, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x57, 0x6f, 0x72, + 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x42, 0x0a, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x22, 0xc5, 0x01, 0x0a, 0x11, 0x54, 0x65, 0x63, 0x68, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x57, + 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, + 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x64, 0x65, 0x5f, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x6f, 0x64, + 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x52, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x05, 0x73, 0x70, + 0x65, 0x63, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x54, 0x65, 0x63, 0x68, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x70, 0x65, + 0x63, 0x73, 0x52, 0x05, 0x73, 0x70, 0x65, 0x63, 0x73, 0x22, 0xc5, 0x01, 0x0a, 0x12, 0x4d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x32, 0x0a, + 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, + 0x6d, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x12, 0x2e, 0x0a, 0x05, 0x73, 0x70, 0x65, 0x63, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x73, 0x52, 0x05, 0x73, 0x70, 0x65, 0x63, + 0x73, 0x22, 0x65, 0x0a, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x61, 0x6e, + 0x64, 0x6c, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x61, 0x73, 0x73, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, + 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0c, 0x61, 0x73, 0x73, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x22, 0x74, 0x0a, 0x0e, 0x54, 0x65, 0x63, 0x68, + 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x70, 0x65, 0x63, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, + 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x74, 0x79, 0x12, 0x2e, + 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x4d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0x6b, + 0x0a, 0x0f, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0x43, 0x0a, 0x0b, 0x57, + 0x6f, 0x72, 0x6b, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, + 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, + 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x63, 0x79, + 0x22, 0x9a, 0x01, 0x0a, 0x10, 0x57, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3c, 0x0a, 0x0d, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x61, 0x70, + 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x41, 0x70, 0x70, 0x72, 0x6f, + 0x76, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x41, 0x70, 0x70, 0x72, 0x6f, + 0x76, 0x61, 0x6c, 0x12, 0x3f, 0x0a, 0x0e, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x72, 0x65, 0x6a, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0d, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x6a, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x49, 0x0a, + 0x0c, 0x57, 0x6f, 0x72, 0x6b, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x72, 0x6f, + 0x76, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, + 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x41, 0x74, 0x22, 0x4e, 0x0a, 0x0d, 0x57, 0x6f, 0x72, 0x6b, + 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, + 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x6a, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x65, 0x0a, 0x09, 0x57, 0x6f, 0x72, 0x6b, + 0x53, 0x65, 0x74, 0x75, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x12, 0x3c, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x69, 0x74, 0x65, + 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, + 0x65, 0x6d, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x2a, + 0xa1, 0x01, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x1e, 0x0a, 0x1a, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x50, 0x4c, 0x41, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x19, + 0x0a, 0x15, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, + 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, + 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x4d, 0x50, + 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x4a, 0x45, + 0x43, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x4e, 0x5f, 0x48, 0x4f, 0x4c, + 0x44, 0x10, 0x04, 0x2a, 0xb1, 0x01, 0x0a, 0x0f, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x0a, 0x1c, 0x4d, 0x49, 0x4c, 0x45, 0x53, + 0x54, 0x4f, 0x4e, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x4d, 0x49, 0x4c, + 0x45, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x45, + 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x20, 0x0a, 0x1c, 0x4d, 0x49, 0x4c, 0x45, 0x53, + 0x54, 0x4f, 0x4e, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, 0x4e, 0x5f, 0x50, + 0x52, 0x4f, 0x47, 0x52, 0x45, 0x53, 0x53, 0x10, 0x02, 0x12, 0x1e, 0x0a, 0x1a, 0x4d, 0x49, 0x4c, + 0x45, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, + 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x4d, 0x49, 0x4c, + 0x45, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, + 0x4c, 0x41, 0x59, 0x45, 0x44, 0x10, 0x04, 0x2a, 0xa8, 0x01, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x54, 0x4f, 0x44, 0x4f, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x41, 0x53, + 0x4b, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x47, + 0x52, 0x45, 0x53, 0x53, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x10, 0x03, 0x12, 0x19, + 0x0a, 0x15, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, + 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x04, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x53, + 0x4b, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, + 0x10, 0x05, 0x2a, 0x90, 0x01, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x69, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x19, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x50, 0x52, 0x49, 0x4f, + 0x52, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x50, 0x52, 0x49, 0x4f, 0x52, + 0x49, 0x54, 0x59, 0x5f, 0x4c, 0x4f, 0x57, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x54, 0x41, 0x53, + 0x4b, 0x5f, 0x50, 0x52, 0x49, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4d, 0x45, 0x44, 0x49, 0x55, + 0x4d, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x50, 0x52, 0x49, 0x4f, + 0x52, 0x49, 0x54, 0x59, 0x5f, 0x48, 0x49, 0x47, 0x48, 0x10, 0x03, 0x12, 0x18, 0x0a, 0x14, 0x54, + 0x41, 0x53, 0x4b, 0x5f, 0x50, 0x52, 0x49, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x52, 0x47, + 0x45, 0x4e, 0x54, 0x10, 0x04, 0x2a, 0xfd, 0x01, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x1f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x45, 0x53, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41, - 0x54, 0x45, 0x10, 0x04, 0x12, 0x23, 0x0a, 0x1f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, - 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x45, 0x41, 0x4d, - 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x05, 0x32, 0xa7, 0x2b, 0x0a, 0x0f, 0x50, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5f, 0x0a, - 0x12, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x42, - 0x79, 0x49, 0x64, 0x12, 0x22, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, + 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x25, 0x0a, 0x21, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, + 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, + 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x50, 0x52, 0x4f, 0x4a, 0x45, + 0x43, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, + 0x49, 0x4c, 0x45, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x5f, 0x41, 0x44, 0x44, 0x45, 0x44, 0x10, 0x02, + 0x12, 0x25, 0x0a, 0x21, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, + 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x41, 0x53, 0x53, + 0x49, 0x47, 0x4e, 0x45, 0x44, 0x10, 0x03, 0x12, 0x27, 0x0a, 0x23, 0x50, 0x52, 0x4f, 0x4a, 0x45, + 0x43, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, + 0x52, 0x4f, 0x47, 0x52, 0x45, 0x53, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x04, + 0x12, 0x23, 0x0a, 0x1f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, + 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x45, 0x41, 0x4d, 0x5f, 0x43, 0x48, 0x41, + 0x4e, 0x47, 0x45, 0x10, 0x05, 0x32, 0xa7, 0x2b, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5f, 0x0a, 0x12, 0x4c, 0x6f, 0x6f, + 0x6b, 0x75, 0x70, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x42, 0x79, 0x49, 0x64, 0x12, + 0x22, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, + 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x42, 0x79, 0x49, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, - 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, - 0x0a, 0x13, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, - 0x65, 0x42, 0x79, 0x49, 0x64, 0x12, 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x42, - 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4d, 0x69, 0x6c, 0x65, 0x73, - 0x74, 0x6f, 0x6e, 0x65, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x12, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x64, - 0x75, 0x63, 0x74, 0x42, 0x79, 0x55, 0x70, 0x63, 0x12, 0x22, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x13, 0x4c, 0x6f, + 0x6f, 0x6b, 0x75, 0x70, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x42, 0x79, 0x49, + 0x64, 0x12, 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, + 0x75, 0x70, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x42, 0x79, 0x49, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, + 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5f, + 0x0a, 0x12, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x42, + 0x79, 0x55, 0x70, 0x63, 0x12, 0x22, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, + 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x42, 0x79, 0x55, 0x70, + 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x42, 0x79, 0x55, 0x70, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x50, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x42, 0x79, 0x55, 0x70, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x11, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x50, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x42, 0x79, 0x49, 0x64, 0x12, 0x21, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x53, 0x0a, 0x0e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x54, 0x61, 0x73, 0x6b, 0x42, - 0x79, 0x49, 0x64, 0x12, 0x1e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, - 0x6f, 0x6b, 0x75, 0x70, 0x54, 0x61, 0x73, 0x6b, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, - 0x6f, 0x6b, 0x75, 0x70, 0x54, 0x61, 0x73, 0x6b, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x65, 0x0a, 0x14, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x12, 0x24, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x41, 0x64, 0x64, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, - 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, - 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5f, 0x0a, - 0x12, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x12, 0x22, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x75, + 0x42, 0x79, 0x55, 0x70, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x5c, 0x0a, 0x11, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x42, 0x79, 0x49, 0x64, 0x12, 0x21, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, + 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x79, 0x49, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x42, + 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x53, 0x0a, + 0x0e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x54, 0x61, 0x73, 0x6b, 0x42, 0x79, 0x49, 0x64, 0x12, + 0x1e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, + 0x54, 0x61, 0x73, 0x6b, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, + 0x54, 0x61, 0x73, 0x6b, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x65, 0x0a, 0x14, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, + 0x64, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x12, 0x24, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, + 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x25, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x75, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x12, 0x4d, 0x75, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, + 0x22, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x56, - 0x0a, 0x0f, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x54, 0x61, 0x73, - 0x6b, 0x12, 0x1f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x75, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x75, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7a, 0x0a, 0x1b, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x75, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x68, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x72, 0x63, 0x68, 0x69, - 0x76, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x25, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x72, 0x63, 0x68, 0x69, - 0x76, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x59, 0x0a, 0x10, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x20, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x56, 0x0a, 0x0f, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, - 0x6f, 0x6e, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x69, 0x6c, 0x65, 0x73, - 0x74, 0x6f, 0x6e, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x53, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x79, 0x49, - 0x64, 0x12, 0x1e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x6e, - 0x69, 0x63, 0x12, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x61, 0x6e, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x56, 0x0a, 0x0f, 0x4d, 0x75, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1f, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x41, 0x64, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x41, 0x64, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x7a, 0x0a, 0x1b, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x2b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x75, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x68, + 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x25, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x72, + 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x59, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x20, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, 0x69, 0x6c, 0x6c, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, 0x69, + 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x56, 0x0a, 0x0f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x69, 0x6c, 0x65, + 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x0e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x79, 0x49, 0x64, 0x12, 0x1e, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x47, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x6e, 0x69, 0x63, 0x12, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, - 0x6e, 0x69, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, - 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1c, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6b, 0x0a, 0x16, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x74, 0x69, - 0x76, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x26, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x74, - 0x69, 0x76, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x68, 0x0a, 0x15, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x12, 0x25, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x6e, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x6e, 0x69, 0x63, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0c, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x65, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x12, 0x24, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x25, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x59, 0x0a, 0x10, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x61, 0x67, 0x73, 0x12, 0x20, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6b, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x69, + 0x65, 0x73, 0x12, 0x26, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, + 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x68, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x25, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x21, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x68, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x25, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x42, - 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x62, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x23, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0a, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x65, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x73, - 0x42, 0x79, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x24, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x42, - 0x79, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x25, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x54, 0x61, 0x73, 0x6b, 0x73, 0x42, 0x79, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x92, 0x01, 0x0a, 0x23, 0x52, 0x65, - 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x44, 0x65, 0x65, - 0x70, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, - 0x64, 0x12, 0x33, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, - 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x44, 0x65, 0x65, 0x70, 0x57, - 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, - 0x44, 0x65, 0x65, 0x70, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, - 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0xa4, - 0x01, 0x0a, 0x29, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x65, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x12, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x59, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x61, 0x67, 0x73, 0x12, 0x20, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x50, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x68, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x73, 0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x25, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x73, 0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x42, 0x79, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, 0x0a, + 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, + 0x74, 0x72, 0x69, 0x78, 0x12, 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x74, 0x72, + 0x69, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x62, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, + 0x73, 0x6b, 0x73, 0x12, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, + 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x65, + 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x42, 0x79, 0x50, 0x72, + 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x42, 0x79, 0x50, 0x72, 0x69, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x73, 0x6b, + 0x73, 0x42, 0x79, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x92, 0x01, 0x0a, 0x23, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, + 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x44, 0x65, 0x65, 0x70, 0x57, 0x6f, 0x72, + 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x12, 0x33, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, + 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x44, 0x65, 0x65, 0x70, 0x57, 0x6f, 0x72, 0x6b, 0x49, + 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, + 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x44, 0x65, 0x65, 0x70, + 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0xa4, 0x01, 0x0a, 0x29, 0x52, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x75, 0x6d, + 0x6d, 0x61, 0x72, 0x79, 0x42, 0x79, 0x49, 0x64, 0x12, 0x39, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x79, 0x49, 0x64, 0x12, 0x39, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, - 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x50, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x79, 0x49, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, - 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, 0x0a, 0x1f, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, - 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x79, 0x49, 0x64, 0x12, 0x2f, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, - 0x79, 0x65, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, - 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, - 0x6f, 0x79, 0x65, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x9e, - 0x01, 0x0a, 0x27, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, - 0x65, 0x65, 0x54, 0x61, 0x67, 0x67, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, - 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x79, 0x49, 0x64, 0x12, 0x37, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, - 0x6f, 0x79, 0x65, 0x65, 0x54, 0x61, 0x67, 0x67, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, - 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x54, 0x61, 0x67, - 0x67, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, - 0x79, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x9b, 0x01, 0x0a, 0x26, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, - 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x61, 0x6e, 0x64, 0x6c, - 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x12, 0x36, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, - 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x61, 0x6e, 0x64, - 0x6c, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, - 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, - 0x49, 0x74, 0x65, 0x6d, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x42, - 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, - 0x0a, 0x1f, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, - 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, - 0x64, 0x12, 0x2f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, - 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, - 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, - 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, - 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x95, 0x01, 0x0a, 0x24, 0x52, 0x65, 0x71, 0x75, 0x69, - 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, - 0x65, 0x6d, 0x53, 0x70, 0x65, 0x63, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x12, - 0x34, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, - 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, - 0x6d, 0x53, 0x70, 0x65, 0x63, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, + 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x75, 0x6d, 0x6d, + 0x61, 0x72, 0x79, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x86, 0x01, 0x0a, 0x1f, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, + 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x42, 0x79, 0x49, 0x64, 0x12, 0x2f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x52, + 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x79, 0x49, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, + 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x79, 0x49, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x9e, 0x01, 0x0a, 0x27, 0x52, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x54, 0x61, + 0x67, 0x67, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x42, 0x79, 0x49, 0x64, 0x12, 0x37, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, + 0x54, 0x61, 0x67, 0x67, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x75, 0x6d, + 0x6d, 0x61, 0x72, 0x79, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x38, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, + 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x54, 0x61, 0x67, 0x67, 0x65, 0x64, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x79, 0x49, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x9b, 0x01, 0x0a, 0x26, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, - 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x70, 0x65, 0x63, 0x73, 0x49, 0x6e, 0x66, 0x6f, - 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x92, - 0x01, 0x0a, 0x23, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, - 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x53, 0x65, 0x74, 0x75, 0x70, 0x53, 0x75, 0x6d, 0x6d, 0x61, - 0x72, 0x79, 0x42, 0x79, 0x49, 0x64, 0x12, 0x33, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x12, 0x36, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, - 0x57, 0x6f, 0x72, 0x6b, 0x53, 0x65, 0x74, 0x75, 0x70, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, - 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x73, 0x65, + 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, + 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, + 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, 0x0a, 0x1f, 0x52, 0x65, + 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, + 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x12, 0x2f, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, + 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x49, + 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, + 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, + 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x95, 0x01, 0x0a, 0x24, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, + 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x70, + 0x65, 0x63, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x12, 0x34, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, - 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x53, 0x65, 0x74, 0x75, 0x70, 0x53, 0x75, - 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0xa1, 0x01, 0x0a, 0x28, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x45, - 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x54, 0x61, - 0x73, 0x6b, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x79, 0x73, - 0x12, 0x38, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x76, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, - 0x65, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x44, - 0x61, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x45, 0x6d, 0x70, 0x6c, - 0x6f, 0x79, 0x65, 0x65, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x43, - 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x79, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x83, 0x01, 0x0a, 0x1e, 0x52, 0x65, 0x73, 0x6f, - 0x6c, 0x76, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2e, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x45, 0x6d, 0x70, 0x6c, - 0x6f, 0x79, 0x65, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x6c, - 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x45, 0x6d, 0x70, 0x6c, - 0x6f, 0x79, 0x65, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x6c, - 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x89, 0x01, - 0x0a, 0x20, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, - 0x65, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x30, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x6c, 0x76, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x54, 0x6f, 0x74, 0x61, - 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, - 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x54, 0x6f, - 0x74, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7d, 0x0a, 0x1c, 0x52, 0x65, 0x73, - 0x6f, 0x6c, 0x76, 0x65, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x44, 0x61, 0x79, - 0x73, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x44, 0x75, 0x65, 0x12, 0x2c, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x4d, 0x69, 0x6c, 0x65, 0x73, - 0x74, 0x6f, 0x6e, 0x65, 0x44, 0x61, 0x79, 0x73, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x44, 0x75, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, - 0x6e, 0x65, 0x44, 0x61, 0x79, 0x73, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x44, 0x75, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x71, 0x0a, 0x18, 0x52, 0x65, 0x73, 0x6f, - 0x6c, 0x76, 0x65, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x49, 0x73, 0x41, 0x74, - 0x52, 0x69, 0x73, 0x6b, 0x12, 0x28, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, - 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x49, - 0x73, 0x41, 0x74, 0x52, 0x69, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, + 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x70, 0x65, + 0x63, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x35, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, + 0x74, 0x65, 0x6d, 0x53, 0x70, 0x65, 0x63, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x92, 0x01, 0x0a, 0x23, 0x52, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, + 0x72, 0x6b, 0x53, 0x65, 0x74, 0x75, 0x70, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x79, + 0x49, 0x64, 0x12, 0x33, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, + 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x57, 0x6f, 0x72, 0x6b, + 0x53, 0x65, 0x74, 0x75, 0x70, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x79, 0x49, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, + 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x53, 0x65, 0x74, 0x75, 0x70, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, + 0x79, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0xa1, 0x01, 0x0a, 0x28, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, + 0x79, 0x65, 0x65, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x6f, + 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x79, 0x73, 0x12, 0x38, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x45, 0x6d, + 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x54, 0x61, 0x73, + 0x6b, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x79, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, + 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x6d, 0x70, 0x6c, + 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x83, 0x01, 0x0a, 0x1e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x45, + 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x57, 0x6f, + 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, + 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, + 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x89, 0x01, 0x0a, 0x20, 0x52, 0x65, + 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x54, 0x6f, 0x74, + 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, + 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, + 0x76, 0x65, 0x45, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x65, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7d, 0x0a, 0x1c, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, + 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x44, 0x61, 0x79, 0x73, 0x55, 0x6e, 0x74, + 0x69, 0x6c, 0x44, 0x75, 0x65, 0x12, 0x2c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, + 0x44, 0x61, 0x79, 0x73, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x44, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, + 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x44, 0x61, + 0x79, 0x73, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x44, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x71, 0x0a, 0x18, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x4d, + 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x49, 0x73, 0x41, 0x74, 0x52, 0x69, 0x73, 0x6b, + 0x12, 0x28, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, + 0x76, 0x65, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x49, 0x73, 0x41, 0x74, 0x52, + 0x69, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x4d, 0x69, 0x6c, 0x65, + 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x49, 0x73, 0x41, 0x74, 0x52, 0x69, 0x73, 0x6b, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8f, 0x01, 0x0a, 0x22, 0x52, 0x65, 0x73, 0x6f, + 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x32, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, - 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x49, 0x73, 0x41, 0x74, 0x52, 0x69, 0x73, - 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8f, 0x01, 0x0a, 0x22, - 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x32, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6c, + 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x41, - 0x63, 0x74, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7d, 0x0a, - 0x1c, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, - 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x73, 0x65, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7d, 0x0a, 0x1c, 0x52, 0x65, 0x73, + 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, + 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x83, 0x01, 0x0a, 0x1e, 0x52, 0x65, 0x73, + 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x72, 0x69, 0x74, 0x69, + 0x63, 0x61, 0x6c, 0x44, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x2e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x83, 0x01, 0x0a, - 0x1e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, - 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x44, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, - 0x2e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, - 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, - 0x44, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, - 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, - 0x44, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x95, 0x01, 0x0a, 0x24, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, - 0x79, 0x73, 0x52, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x34, 0x2e, 0x73, 0x65, + 0x6a, 0x65, 0x63, 0x74, 0x43, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x44, 0x65, 0x61, 0x64, + 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x79, - 0x73, 0x52, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x35, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, - 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, - 0x74, 0x65, 0x64, 0x44, 0x61, 0x79, 0x73, 0x52, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7a, 0x0a, 0x1b, 0x52, 0x65, - 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x2b, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x74, 0x0a, 0x19, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, - 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x75, 0x62, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x12, 0x29, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, - 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x75, 0x62, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x75, 0x62, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6e, 0x0a, 0x17, - 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x61, - 0x73, 0x6b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x6a, 0x65, 0x63, 0x74, 0x43, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x44, 0x65, 0x61, 0x64, + 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x95, + 0x01, 0x0a, 0x24, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x79, 0x73, 0x52, 0x65, + 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x34, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x54, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x28, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x80, 0x01, 0x0a, - 0x1d, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, - 0x6f, 0x70, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x2d, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x6f, 0x70, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, - 0x74, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, + 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x79, 0x73, 0x52, 0x65, 0x6d, + 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x6f, 0x70, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x65, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x73, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x73, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x54, - 0x61, 0x73, 0x6b, 0x49, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6b, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, - 0x65, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x66, 0x66, 0x6f, 0x72, 0x74, - 0x12, 0x26, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x76, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x66, 0x66, 0x6f, 0x72, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x6f, - 0x74, 0x61, 0x6c, 0x45, 0x66, 0x66, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x77, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x2f, 0x64, 0x65, 0x6d, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x75, 0x62, - 0x67, 0x72, 0x61, 0x70, 0x68, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, + 0x61, 0x79, 0x73, 0x52, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7a, 0x0a, 0x1b, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, + 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, + 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x2b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, + 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x74, 0x0a, 0x19, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x53, 0x75, 0x62, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, + 0x29, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, + 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x75, 0x62, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x53, 0x75, 0x62, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6e, 0x0a, 0x17, 0x52, 0x65, 0x73, 0x6f, + 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, + 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x61, 0x73, 0x6b, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x80, 0x01, 0x0a, 0x1d, 0x52, 0x65, 0x73, + 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x6f, 0x70, 0x50, 0x72, + 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x2d, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x54, 0x6f, 0x70, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x49, 0x74, + 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x54, 0x6f, 0x70, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x49, 0x74, 0x65, + 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x65, 0x0a, 0x14, 0x52, + 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x73, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x65, 0x64, 0x12, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, + 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x49, + 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x6b, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x54, 0x61, 0x73, + 0x6b, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x66, 0x66, 0x6f, 0x72, 0x74, 0x12, 0x26, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x54, 0x61, + 0x73, 0x6b, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x66, 0x66, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, + 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x45, + 0x66, 0x66, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, + 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x75, + 0x6e, 0x64, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x2f, + 0x64, 0x65, 0x6d, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x75, 0x62, 0x67, 0x72, 0x61, 0x70, + 0x68, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/demo/pkg/subgraphs/projects/generated/service.proto b/demo/pkg/subgraphs/projects/generated/service.proto index 0dacf98c52..096135b8b1 100644 --- a/demo/pkg/subgraphs/projects/generated/service.proto +++ b/demo/pkg/subgraphs/projects/generated/service.proto @@ -1163,6 +1163,7 @@ message RequireEmployeeDeepWorkItemInfoByIdFields { } message Project { + reserved 20 to 21; string id = 1; string name = 2; google.protobuf.StringValue description = 3; @@ -1221,6 +1222,7 @@ message Task { } message Employee { + reserved 8; int32 id = 1; ListOfProject projects = 2; repeated Task assigned_tasks = 3; diff --git a/demo/pkg/subgraphs/projects/generated/service.proto.lock.json b/demo/pkg/subgraphs/projects/generated/service.proto.lock.json index ffd944642b..881a04dbdc 100644 --- a/demo/pkg/subgraphs/projects/generated/service.proto.lock.json +++ b/demo/pkg/subgraphs/projects/generated/service.proto.lock.json @@ -352,7 +352,11 @@ "tasksByPhase": 17, "milestoneGroups": 18, "priorityMatrix": 19 - } + }, + "reservedNumbers": [ + 20, + 21 + ] }, "Milestone": { "fields": { @@ -403,7 +407,10 @@ "skills": 5, "certifications": 6, "projectHistory": 7 - } + }, + "reservedNumbers": [ + 8 + ] }, "Product": { "fields": { diff --git a/demo/pkg/subgraphs/subgraphs.go b/demo/pkg/subgraphs/subgraphs.go index 44764f14bd..2a5801974e 100644 --- a/demo/pkg/subgraphs/subgraphs.go +++ b/demo/pkg/subgraphs/subgraphs.go @@ -12,7 +12,10 @@ import ( "os" "strconv" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/cachegraph_ext" "github.com/wundergraph/cosmo/demo/pkg/subgraphs/products_fg" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/viewer" "github.com/wundergraph/cosmo/router/core" rmetric "github.com/wundergraph/cosmo/router/pkg/metric" "github.com/wundergraph/cosmo/router/pkg/pubsub/datasource" @@ -48,6 +51,9 @@ const ( CountriesDefaultDemoURL = "http://localhost:4009/graphql" ProductsFgDefaultDemoURL = "http://localhost:4010/graphql" ProjectsDefaultDemoURL = "dns:///localhost:4011" + CacheGraphDefaultDemoURL = "http://localhost:4012/graphql" + CacheGraphExtDefaultDemoURL = "http://localhost:4013/graphql" + ViewerDefaultDemoURL = "http://localhost:4014/graphql" ) type Ports struct { @@ -60,6 +66,9 @@ type Ports struct { Availability int Mood int Countries int + CacheGraph int + CacheGraphExt int + Viewer int } func (p *Ports) AsArray() []int { @@ -73,6 +82,9 @@ func (p *Ports) AsArray() []int { p.Availability, p.Mood, p.Countries, + p.CacheGraph, + p.CacheGraphExt, + p.Viewer, } } @@ -152,7 +164,7 @@ func newServer(name string, enableDebug bool, port int, schema graphql.Executabl })) return &http.Server{ Addr: ":" + strconv.Itoa(port), - Handler: injector.HTTP(mux), + Handler: injector.Latency(injector.HTTP(mux)), } } @@ -160,7 +172,7 @@ func subgraphHandler(schema graphql.ExecutableSchema) http.Handler { srv := NewDemoServer(schema) mux := http.NewServeMux() mux.Handle("/graphql", srv) - return injector.HTTP(mux) + return injector.Latency(injector.HTTP(mux)) } type SubgraphOptions struct { @@ -204,6 +216,18 @@ func CountriesHandler(opts *SubgraphOptions) http.Handler { return subgraphHandler(countries.NewSchema(opts.NatsPubSubByProviderID)) } +func CacheGraphHandler() http.Handler { + return subgraphHandler(cachegraph.NewSchema()) +} + +func CacheGraphExtHandler() http.Handler { + return subgraphHandler(cachegraph_ext.NewSchema()) +} + +func ViewerHandler() http.Handler { + return viewer.NewHandler() +} + func New(ctx context.Context, config *Config) (*Subgraphs, error) { url := nats.DefaultURL if defaultSourceNameURL := os.Getenv("NATS_URL"); defaultSourceNameURL != "" { @@ -279,6 +303,18 @@ func New(ctx context.Context, config *Config) (*Subgraphs, error) { if srv := newServer("countries", config.EnableDebug, config.Ports.Countries, countries.NewSchema(natsPubSubByProviderID)); srv != nil { servers = append(servers, srv) } + if srv := newServer("cachegraph", config.EnableDebug, config.Ports.CacheGraph, cachegraph.NewSchema()); srv != nil { + servers = append(servers, srv) + } + if srv := newServer("cachegraph-ext", config.EnableDebug, config.Ports.CacheGraphExt, cachegraph_ext.NewSchema()); srv != nil { + servers = append(servers, srv) + } + if config.Ports.Viewer != 0 { + servers = append(servers, &http.Server{ + Addr: ":" + strconv.Itoa(config.Ports.Viewer), + Handler: injector.Latency(injector.HTTP(viewer.NewHandler())), + }) + } return &Subgraphs{ servers: servers, ports: config.Ports, diff --git a/demo/pkg/subgraphs/viewer/generate.go b/demo/pkg/subgraphs/viewer/generate.go new file mode 100644 index 0000000000..d3f0642e72 --- /dev/null +++ b/demo/pkg/subgraphs/viewer/generate.go @@ -0,0 +1,2 @@ +//go:generate go run github.com/99designs/gqlgen generate +package viewer diff --git a/demo/pkg/subgraphs/viewer/gqlgen.yml b/demo/pkg/subgraphs/viewer/gqlgen.yml new file mode 100644 index 0000000000..fbdda3219e --- /dev/null +++ b/demo/pkg/subgraphs/viewer/gqlgen.yml @@ -0,0 +1,39 @@ +schema: + - subgraph/*.graphqls + +exec: + filename: subgraph/generated/generated.go + package: generated + +federation: + filename: subgraph/generated/federation.go + package: generated + version: 2 + options: + explicit_requires: true + +model: + filename: subgraph/model/models_gen.go + package: model + +directives: + openfed__requestScoped: + skip_runtime: true + +resolver: + layout: follow-schema + dir: subgraph + package: subgraph + +models: + ID: + model: + - github.com/99designs/gqlgen/graphql.ID + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + Int: + model: + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 diff --git a/demo/pkg/subgraphs/viewer/subgraph/context.go b/demo/pkg/subgraphs/viewer/subgraph/context.go new file mode 100644 index 0000000000..d5a6732454 --- /dev/null +++ b/demo/pkg/subgraphs/viewer/subgraph/context.go @@ -0,0 +1,32 @@ +package subgraph + +import ( + "context" + "net/http" + + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/viewer/subgraph/model" +) + +// viewerFromContext extracts the current viewer from the request's Authorization header. +func viewerFromContext(ctx context.Context) *model.Viewer { + gc := ctx.Value(httpRequestKey{}) + if gc == nil { + return defaultViewer + } + r, ok := gc.(*http.Request) + if !ok { + return defaultViewer + } + auth := r.Header.Get("Authorization") + if v, found := viewersByToken[auth]; found { + return v + } + return defaultViewer +} + +type httpRequestKey struct{} + +// WithHTTPRequest stores the HTTP request in context for resolver access. +func WithHTTPRequest(ctx context.Context, r *http.Request) context.Context { + return context.WithValue(ctx, httpRequestKey{}, r) +} diff --git a/demo/pkg/subgraphs/viewer/subgraph/data.go b/demo/pkg/subgraphs/viewer/subgraph/data.go new file mode 100644 index 0000000000..5ec1f0dfd5 --- /dev/null +++ b/demo/pkg/subgraphs/viewer/subgraph/data.go @@ -0,0 +1,20 @@ +package subgraph + +import "github.com/wundergraph/cosmo/demo/pkg/subgraphs/viewer/subgraph/model" + +// Viewers keyed by auth token +var viewersByToken = map[string]*model.Viewer{ + "Bearer token-alice": {ID: "v1", Name: "Alice", Email: "alice@example.com"}, + "Bearer token-bob": {ID: "v2", Name: "Bob", Email: "bob@example.com"}, + "Bearer token-charlie": {ID: "v3", Name: "Charlie", Email: "charlie@example.com"}, +} + +// Viewers keyed by ID (for entity resolution) +var viewersByID = map[string]*model.Viewer{ + "v1": {ID: "v1", Name: "Alice", Email: "alice@example.com"}, + "v2": {ID: "v2", Name: "Bob", Email: "bob@example.com"}, + "v3": {ID: "v3", Name: "Charlie", Email: "charlie@example.com"}, +} + +// Default viewer when no auth token is provided +var defaultViewer = &model.Viewer{ID: "v0", Name: "Anonymous", Email: "anonymous@example.com"} diff --git a/demo/pkg/subgraphs/viewer/subgraph/entity.resolvers.go b/demo/pkg/subgraphs/viewer/subgraph/entity.resolvers.go new file mode 100644 index 0000000000..ca3c972428 --- /dev/null +++ b/demo/pkg/subgraphs/viewer/subgraph/entity.resolvers.go @@ -0,0 +1,33 @@ +package subgraph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.76 + +import ( + "context" + + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/viewer/subgraph/generated" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/viewer/subgraph/model" +) + +// FindPersonalizedByID is the resolver for the findPersonalizedByID field. +func (r *entityResolver) FindPersonalizedByID(ctx context.Context, id string) (*model.Personalized, error) { + // The @interfaceObject resolver: returns currentViewer for any entity implementing Personalized. + // The entity's actual type (Article, etc.) doesn't matter — the viewer is from the auth context. + viewer := viewerFromContext(ctx) + return &model.Personalized{ + ID: id, + CurrentViewer: viewer, + }, nil +} + +// FindViewerByID is the resolver for the findViewerByID field. +func (r *entityResolver) FindViewerByID(ctx context.Context, id string) (*model.Viewer, error) { + return viewersByID[id], nil +} + +// Entity returns generated.EntityResolver implementation. +func (r *Resolver) Entity() generated.EntityResolver { return &entityResolver{r} } + +type entityResolver struct{ *Resolver } diff --git a/demo/pkg/subgraphs/viewer/subgraph/generated/federation.go b/demo/pkg/subgraphs/viewer/subgraph/generated/federation.go new file mode 100644 index 0000000000..2556c88ac5 --- /dev/null +++ b/demo/pkg/subgraphs/viewer/subgraph/generated/federation.go @@ -0,0 +1,288 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "strings" + "sync" + + "github.com/99designs/gqlgen/plugin/federation/fedruntime" +) + +var ( + ErrUnknownType = errors.New("unknown type") + ErrTypeNotFound = errors.New("type not found") +) + +func (ec *executionContext) __resolve__service(ctx context.Context) (fedruntime.Service, error) { + if ec.DisableIntrospection { + return fedruntime.Service{}, errors.New("federated introspection disabled") + } + + var sdl []string + + for _, src := range sources { + if src.BuiltIn { + continue + } + sdl = append(sdl, src.Input) + } + + return fedruntime.Service{ + SDL: strings.Join(sdl, "\n"), + }, nil +} + +func (ec *executionContext) __resolve_entities(ctx context.Context, representations []map[string]any) []fedruntime.Entity { + list := make([]fedruntime.Entity, len(representations)) + + repsMap := ec.buildRepresentationGroups(ctx, representations) + + switch len(repsMap) { + case 0: + return list + case 1: + for typeName, reps := range repsMap { + ec.resolveEntityGroup(ctx, typeName, reps, list) + } + return list + default: + var g sync.WaitGroup + g.Add(len(repsMap)) + for typeName, reps := range repsMap { + go func(typeName string, reps []EntityWithIndex) { + ec.resolveEntityGroup(ctx, typeName, reps, list) + g.Done() + }(typeName, reps) + } + g.Wait() + return list + } +} + +type EntityWithIndex struct { + // The index in the original representation array + index int + entity EntityRepresentation +} + +// EntityRepresentation is the JSON representation of an entity sent by the Router +// used as the inputs for us to resolve. +// +// We make it a map because we know the top level JSON is always an object. +type EntityRepresentation map[string]any + +// We group entities by typename so that we can parallelize their resolution. +// This is particularly helpful when there are entity groups in multi mode. +func (ec *executionContext) buildRepresentationGroups( + ctx context.Context, + representations []map[string]any, +) map[string][]EntityWithIndex { + repsMap := make(map[string][]EntityWithIndex) + for i, rep := range representations { + typeName, ok := rep["__typename"].(string) + if !ok { + // If there is no __typename, we just skip the representation; + // we just won't be resolving these unknown types. + ec.Error(ctx, errors.New("__typename must be an existing string")) + continue + } + + repsMap[typeName] = append(repsMap[typeName], EntityWithIndex{ + index: i, + entity: rep, + }) + } + + return repsMap +} + +func (ec *executionContext) resolveEntityGroup( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) { + if isMulti(typeName) { + err := ec.resolveManyEntities(ctx, typeName, reps, list) + if err != nil { + ec.Error(ctx, err) + } + } else { + // if there are multiple entities to resolve, parallelize (similar to + // graphql.FieldSet.Dispatch) + var e sync.WaitGroup + e.Add(len(reps)) + for i, rep := range reps { + i, rep := i, rep + go func(i int, rep EntityWithIndex) { + entity, err := ec.resolveEntity(ctx, typeName, rep.entity) + if err != nil { + ec.Error(ctx, err) + } else { + list[rep.index] = entity + } + e.Done() + }(i, rep) + } + e.Wait() + } +} + +func isMulti(typeName string) bool { + switch typeName { + default: + return false + } +} + +func (ec *executionContext) resolveEntity( + ctx context.Context, + typeName string, + rep EntityRepresentation, +) (e fedruntime.Entity, err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + case "Personalized": + resolverName, err := entityResolverNameForPersonalized(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Personalized": %w`, err) + } + switch resolverName { + + case "findPersonalizedByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findPersonalizedByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindPersonalizedByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Personalized": %w`, err) + } + + return entity, nil + } + case "Viewer": + resolverName, err := entityResolverNameForViewer(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Viewer": %w`, err) + } + switch resolverName { + + case "findViewerByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findViewerByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindViewerByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Viewer": %w`, err) + } + + return entity, nil + } + + } + return nil, fmt.Errorf("%w: %s", ErrUnknownType, typeName) +} + +func (ec *executionContext) resolveManyEntities( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) (err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + + default: + return errors.New("unknown type: " + typeName) + } +} + +func entityResolverNameForPersonalized(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Personalized", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Personalized", ErrTypeNotFound)) + break + } + return "findPersonalizedByID", nil + } + return "", fmt.Errorf("%w for Personalized due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForViewer(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Viewer", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Viewer", ErrTypeNotFound)) + break + } + return "findViewerByID", nil + } + return "", fmt.Errorf("%w for Viewer due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} diff --git a/demo/pkg/subgraphs/viewer/subgraph/generated/generated.go b/demo/pkg/subgraphs/viewer/subgraph/generated/generated.go new file mode 100644 index 0000000000..46446bfc99 --- /dev/null +++ b/demo/pkg/subgraphs/viewer/subgraph/generated/generated.go @@ -0,0 +1,4839 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "bytes" + "context" + "errors" + "fmt" + "strconv" + "sync" + "sync/atomic" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/introspection" + "github.com/99designs/gqlgen/plugin/federation/fedruntime" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/viewer/subgraph/model" +) + +// region ************************** generated!.gotpl ************************** + +// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. +func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { + return &executableSchema{ + schema: cfg.Schema, + resolvers: cfg.Resolvers, + directives: cfg.Directives, + complexity: cfg.Complexity, + } +} + +type Config struct { + Schema *ast.Schema + Resolvers ResolverRoot + Directives DirectiveRoot + Complexity ComplexityRoot +} + +type ResolverRoot interface { + Entity() EntityResolver + Query() QueryResolver +} + +type DirectiveRoot struct { +} + +type ComplexityRoot struct { + Entity struct { + FindPersonalizedByID func(childComplexity int, id string) int + FindViewerByID func(childComplexity int, id string) int + } + + Personalized struct { + CurrentViewer func(childComplexity int) int + ID func(childComplexity int) int + } + + Query struct { + CurrentViewer func(childComplexity int) int + __resolve__service func(childComplexity int) int + __resolve_entities func(childComplexity int, representations []map[string]any) int + } + + Viewer struct { + Email func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + } + + _Service struct { + SDL func(childComplexity int) int + } +} + +type EntityResolver interface { + FindPersonalizedByID(ctx context.Context, id string) (*model.Personalized, error) + FindViewerByID(ctx context.Context, id string) (*model.Viewer, error) +} +type QueryResolver interface { + CurrentViewer(ctx context.Context) (*model.Viewer, error) +} + +type executableSchema struct { + schema *ast.Schema + resolvers ResolverRoot + directives DirectiveRoot + complexity ComplexityRoot +} + +func (e *executableSchema) Schema() *ast.Schema { + if e.schema != nil { + return e.schema + } + return parsedSchema +} + +func (e *executableSchema) Complexity(ctx context.Context, typeName, field string, childComplexity int, rawArgs map[string]any) (int, bool) { + ec := executionContext{nil, e, 0, 0, nil} + _ = ec + switch typeName + "." + field { + + case "Entity.findPersonalizedByID": + if e.complexity.Entity.FindPersonalizedByID == nil { + break + } + + args, err := ec.field_Entity_findPersonalizedByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindPersonalizedByID(childComplexity, args["id"].(string)), true + + case "Entity.findViewerByID": + if e.complexity.Entity.FindViewerByID == nil { + break + } + + args, err := ec.field_Entity_findViewerByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindViewerByID(childComplexity, args["id"].(string)), true + + case "Personalized.currentViewer": + if e.complexity.Personalized.CurrentViewer == nil { + break + } + + return e.complexity.Personalized.CurrentViewer(childComplexity), true + + case "Personalized.id": + if e.complexity.Personalized.ID == nil { + break + } + + return e.complexity.Personalized.ID(childComplexity), true + + case "Query.currentViewer": + if e.complexity.Query.CurrentViewer == nil { + break + } + + return e.complexity.Query.CurrentViewer(childComplexity), true + + case "Query._service": + if e.complexity.Query.__resolve__service == nil { + break + } + + return e.complexity.Query.__resolve__service(childComplexity), true + + case "Query._entities": + if e.complexity.Query.__resolve_entities == nil { + break + } + + args, err := ec.field_Query__entities_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.__resolve_entities(childComplexity, args["representations"].([]map[string]any)), true + + case "Viewer.email": + if e.complexity.Viewer.Email == nil { + break + } + + return e.complexity.Viewer.Email(childComplexity), true + + case "Viewer.id": + if e.complexity.Viewer.ID == nil { + break + } + + return e.complexity.Viewer.ID(childComplexity), true + + case "Viewer.name": + if e.complexity.Viewer.Name == nil { + break + } + + return e.complexity.Viewer.Name(childComplexity), true + + case "_Service.sdl": + if e.complexity._Service.SDL == nil { + break + } + + return e.complexity._Service.SDL(childComplexity), true + + } + return 0, false +} + +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + opCtx := graphql.GetOperationContext(ctx) + ec := executionContext{opCtx, e, 0, 0, make(chan graphql.DeferredResult)} + inputUnmarshalMap := graphql.BuildUnmarshalerMap() + first := true + + switch opCtx.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + var response graphql.Response + var data graphql.Marshaler + if first { + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data = ec._Query(ctx, opCtx.Operation.SelectionSet) + } else { + if atomic.LoadInt32(&ec.pendingDeferred) > 0 { + result := <-ec.deferredResults + atomic.AddInt32(&ec.pendingDeferred, -1) + data = result.Result + response.Path = result.Path + response.Label = result.Label + response.Errors = result.Errors + } else { + return nil + } + } + var buf bytes.Buffer + data.MarshalGQL(&buf) + response.Data = buf.Bytes() + if atomic.LoadInt32(&ec.deferred) > 0 { + hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 + response.HasNext = &hasNext + } + + return &response + } + + default: + return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) + } +} + +type executionContext struct { + *graphql.OperationContext + *executableSchema + deferred int32 + pendingDeferred int32 + deferredResults chan graphql.DeferredResult +} + +func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) { + atomic.AddInt32(&ec.pendingDeferred, 1) + go func() { + ctx := graphql.WithFreshResponseContext(dg.Context) + dg.FieldSet.Dispatch(ctx) + ds := graphql.DeferredResult{ + Path: dg.Path, + Label: dg.Label, + Result: dg.FieldSet, + Errors: graphql.GetErrors(ctx), + } + // null fields should bubble up + if dg.FieldSet.Invalids > 0 { + ds.Result = graphql.Null + } + ec.deferredResults <- ds + }() +} + +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(ec.Schema()), nil +} + +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil +} + +var sources = []*ast.Source{ + {Name: "../schema.graphqls", Input: `extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key", "@interfaceObject", "@inaccessible"] + ) + +directive @openfed__requestScoped(key: String!) on FIELD_DEFINITION + +# Symmetric @openfed__requestScoped: both Query.currentViewer and Personalized.currentViewer +# declare key: "currentViewer". Their L1 cache entry is "viewer.currentViewer". +# Whichever is resolved first populates L1; subsequent fields with the same key +# inject from L1 and skip the fetch. +type Personalized @key(fields: "id") @interfaceObject { + id: ID! + currentViewer: Viewer @inaccessible @openfed__requestScoped(key: "currentViewer") +} + +type Viewer @key(fields: "id") { + id: ID! + name: String! + email: String! +} + +type Query { + currentViewer: Viewer @openfed__requestScoped(key: "currentViewer") +} +`, BuiltIn: false}, + {Name: "../../federation/directives.graphql", Input: ` + directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM + directive @composeDirective(name: String!) repeatable on SCHEMA + directive @extends on OBJECT | INTERFACE + directive @external on OBJECT | FIELD_DEFINITION + directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE + directive @inaccessible on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + directive @interfaceObject on OBJECT + directive @link(import: [String!], url: String!) repeatable on SCHEMA + directive @override(from: String!, label: String) on FIELD_DEFINITION + directive @policy(policies: [[federation__Policy!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @provides(fields: FieldSet!) on FIELD_DEFINITION + directive @requires(fields: FieldSet!) on FIELD_DEFINITION + directive @requiresScopes(scopes: [[federation__Scope!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @shareable repeatable on FIELD_DEFINITION | OBJECT + directive @tag(name: String!) repeatable on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + scalar _Any + scalar FieldSet + scalar federation__Policy + scalar federation__Scope +`, BuiltIn: true}, + {Name: "../../federation/entity.graphql", Input: ` +# a union of all types that use the @key directive +union _Entity = Personalized | Viewer + +# fake type to build resolver interfaces for users to implement +type Entity { + findPersonalizedByID(id: ID!,): Personalized! + findViewerByID(id: ID!,): Viewer! +} + +type _Service { + sdl: String +} + +extend type Query { + _entities(representations: [_Any!]!): [_Entity]! + _service: _Service! +} +`, BuiltIn: true}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Entity_findPersonalizedByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findPersonalizedByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findPersonalizedByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findViewerByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findViewerByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findViewerByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query___type_argsName(ctx, rawArgs) + if err != nil { + return nil, err + } + args["name"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query___type_argsName( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["name"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["name"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query__entities_argsRepresentations(ctx, rawArgs) + if err != nil { + return nil, err + } + args["representations"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query__entities_argsRepresentations( + ctx context.Context, + rawArgs map[string]any, +) ([]map[string]any, error) { + if _, ok := rawArgs["representations"]; !ok { + var zeroVal []map[string]any + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) + if tmp, ok := rawArgs["representations"]; ok { + return ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) + } + + var zeroVal []map[string]any + return zeroVal, nil +} + +func (ec *executionContext) field___Directive_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Directive_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Directive_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Field_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Field_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Field_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_enumValues_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_enumValues_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_fields_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_fields_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _Entity_findPersonalizedByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findPersonalizedByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindPersonalizedByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Personalized) + fc.Result = res + return ec.marshalNPersonalized2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐPersonalized(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findPersonalizedByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Personalized_id(ctx, field) + case "currentViewer": + return ec.fieldContext_Personalized_currentViewer(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Personalized", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findPersonalizedByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findViewerByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findViewerByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindViewerByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Viewer) + fc.Result = res + return ec.marshalNViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐViewer(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findViewerByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Viewer_id(ctx, field) + case "name": + return ec.fieldContext_Viewer_name(ctx, field) + case "email": + return ec.fieldContext_Viewer_email(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Viewer", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findViewerByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Personalized_id(ctx context.Context, field graphql.CollectedField, obj *model.Personalized) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Personalized_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Personalized_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Personalized", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Personalized_currentViewer(ctx context.Context, field graphql.CollectedField, obj *model.Personalized) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Personalized_currentViewer(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.CurrentViewer, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Viewer) + fc.Result = res + return ec.marshalOViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐViewer(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Personalized_currentViewer(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Personalized", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Viewer_id(ctx, field) + case "name": + return ec.fieldContext_Viewer_name(ctx, field) + case "email": + return ec.fieldContext_Viewer_email(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Viewer", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_currentViewer(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_currentViewer(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CurrentViewer(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Viewer) + fc.Result = res + return ec.marshalOViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐViewer(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_currentViewer(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Viewer_id(ctx, field) + case "name": + return ec.fieldContext_Viewer_name(ctx, field) + case "email": + return ec.fieldContext_Viewer_email(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Viewer", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__entities(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve_entities(ctx, fc.Args["representations"].([]map[string]any)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]fedruntime.Entity) + fc.Result = res + return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__entities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type _Entity does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query__entities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__service(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve__service(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(fedruntime.Service) + fc.Result = res + return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__service(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "sdl": + return ec.fieldContext__Service_sdl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___schema(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Viewer_id(ctx context.Context, field graphql.CollectedField, obj *model.Viewer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Viewer_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Viewer_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Viewer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Viewer_name(ctx context.Context, field graphql.CollectedField, obj *model.Viewer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Viewer_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Viewer_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Viewer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Viewer_email(ctx context.Context, field graphql.CollectedField, obj *model.Viewer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Viewer_email(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Email, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Viewer_email(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Viewer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext__Service_sdl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SDL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext__Service_sdl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "_Service", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsRepeatable, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Locations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __DirectiveLocation does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Directive_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Field_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_isOneOf(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_isOneOf(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsOneOf(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_isOneOf(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, obj fedruntime.Entity) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case model.Viewer: + return ec._Viewer(ctx, sel, &obj) + case *model.Viewer: + if obj == nil { + return graphql.Null + } + return ec._Viewer(ctx, sel, obj) + case model.Personalized: + return ec._Personalized(ctx, sel, &obj) + case *model.Personalized: + if obj == nil { + return graphql.Null + } + return ec._Personalized(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var entityImplementors = []string{"Entity"} + +func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Entity", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Entity") + case "findPersonalizedByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findPersonalizedByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findViewerByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findViewerByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var personalizedImplementors = []string{"Personalized", "_Entity"} + +func (ec *executionContext) _Personalized(ctx context.Context, sel ast.SelectionSet, obj *model.Personalized) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, personalizedImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Personalized") + case "id": + out.Values[i] = ec._Personalized_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "currentViewer": + out.Values[i] = ec._Personalized_currentViewer(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var queryImplementors = []string{"Query"} + +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "currentViewer": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_currentViewer(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "_entities": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__entities(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "_service": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__service(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "__type": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) + case "__schema": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var viewerImplementors = []string{"Viewer", "_Entity"} + +func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, obj *model.Viewer) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, viewerImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Viewer") + case "id": + out.Values[i] = ec._Viewer_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._Viewer_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "email": + out.Values[i] = ec._Viewer_email(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var _ServiceImplementors = []string{"_Service"} + +func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("_Service") + case "sdl": + out.Values[i] = ec.__Service_sdl(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __DirectiveImplementors = []string{"__Directive"} + +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "isRepeatable": + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __EnumValueImplementors = []string{"__EnumValue"} + +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __FieldImplementors = []string{"__Field"} + +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __InputValueImplementors = []string{"__InputValue"} + +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___InputValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___InputValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __SchemaImplementors = []string{"__Schema"} + +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Schema") + case "description": + out.Values[i] = ec.___Schema_description(ctx, field, obj) + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __TypeImplementors = []string{"__Type"} + +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "specifiedByURL": + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + case "isOneOf": + out.Values[i] = ec.___Type_isOneOf(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +// endregion **************************** object.gotpl **************************** + +// region ***************************** type.gotpl ***************************** + +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNFieldSet2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNID2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalID(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalID(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNPersonalized2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐPersonalized(ctx context.Context, sel ast.SelectionSet, v model.Personalized) graphql.Marshaler { + return ec._Personalized(ctx, sel, &v) +} + +func (ec *executionContext) marshalNPersonalized2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐPersonalized(ctx context.Context, sel ast.SelectionSet, v *model.Personalized) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Personalized(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNViewer2githubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐViewer(ctx context.Context, sel ast.SelectionSet, v model.Viewer) graphql.Marshaler { + return ec._Viewer(ctx, sel, &v) +} + +func (ec *executionContext) marshalNViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐViewer(ctx context.Context, sel ast.SelectionSet, v *model.Viewer) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Viewer(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v any) (map[string]any, error) { + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]any) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + _ = sel + res := graphql.MarshalMap(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v any) ([]map[string]any, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]map[string]any, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN_Any2map(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN_Any2ᚕmapᚄ(ctx context.Context, sel ast.SelectionSet, v []map[string]any) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalN_Any2map(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v []fedruntime.Entity) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { + return ec.__Service(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { + return ec.___Directive(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { + return ec.___EnumValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { + return ec.___Field(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { + return ec.___InputValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { + return ec.___Type(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Policy2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Scope2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalBoolean(v) + return res +} + +func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v any) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalBoolean(*v) + return res +} + +func (ec *executionContext) unmarshalOString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalString(v) + return res +} + +func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + if v == nil { + return nil, nil + } + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v any) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalString(*v) + return res +} + +func (ec *executionContext) marshalOViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋdemoᚋpkgᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐViewer(ctx context.Context, sel ast.SelectionSet, v *model.Viewer) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Viewer(ctx, sel, v) +} + +func (ec *executionContext) marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v fedruntime.Entity) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.__Entity(ctx, sel, v) +} + +func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Schema(ctx, sel, v) +} + +func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +// endregion ***************************** type.gotpl ***************************** diff --git a/demo/pkg/subgraphs/viewer/subgraph/model/models_gen.go b/demo/pkg/subgraphs/viewer/subgraph/model/models_gen.go new file mode 100644 index 0000000000..85acb9e6a7 --- /dev/null +++ b/demo/pkg/subgraphs/viewer/subgraph/model/models_gen.go @@ -0,0 +1,21 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package model + +type Personalized struct { + ID string `json:"id"` + CurrentViewer *Viewer `json:"currentViewer,omitempty"` +} + +func (Personalized) IsEntity() {} + +type Query struct { +} + +type Viewer struct { + ID string `json:"id"` + Name string `json:"name"` + Email string `json:"email"` +} + +func (Viewer) IsEntity() {} diff --git a/demo/pkg/subgraphs/viewer/subgraph/resolver.go b/demo/pkg/subgraphs/viewer/subgraph/resolver.go new file mode 100644 index 0000000000..11329bb4a8 --- /dev/null +++ b/demo/pkg/subgraphs/viewer/subgraph/resolver.go @@ -0,0 +1,3 @@ +package subgraph + +type Resolver struct{} diff --git a/demo/pkg/subgraphs/viewer/subgraph/schema.graphqls b/demo/pkg/subgraphs/viewer/subgraph/schema.graphqls new file mode 100644 index 0000000000..1f41af7e2f --- /dev/null +++ b/demo/pkg/subgraphs/viewer/subgraph/schema.graphqls @@ -0,0 +1,26 @@ +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key", "@interfaceObject", "@inaccessible"] + ) + +directive @openfed__requestScoped(key: String!) on FIELD_DEFINITION + +# Symmetric @openfed__requestScoped: both Query.currentViewer and Personalized.currentViewer +# declare key: "currentViewer". Their L1 cache entry is "viewer.currentViewer". +# Whichever is resolved first populates L1; subsequent fields with the same key +# inject from L1 and skip the fetch. +type Personalized @key(fields: "id") @interfaceObject { + id: ID! + currentViewer: Viewer @inaccessible @openfed__requestScoped(key: "currentViewer") +} + +type Viewer @key(fields: "id") { + id: ID! + name: String! + email: String! +} + +type Query { + currentViewer: Viewer @openfed__requestScoped(key: "currentViewer") +} diff --git a/demo/pkg/subgraphs/viewer/subgraph/schema.resolvers.go b/demo/pkg/subgraphs/viewer/subgraph/schema.resolvers.go new file mode 100644 index 0000000000..2d1cb6acce --- /dev/null +++ b/demo/pkg/subgraphs/viewer/subgraph/schema.resolvers.go @@ -0,0 +1,22 @@ +package subgraph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.76 + +import ( + "context" + + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/viewer/subgraph/generated" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/viewer/subgraph/model" +) + +// CurrentViewer is the resolver for the currentViewer field. +func (r *queryResolver) CurrentViewer(ctx context.Context) (*model.Viewer, error) { + return viewerFromContext(ctx), nil +} + +// Query returns generated.QueryResolver implementation. +func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} } + +type queryResolver struct{ *Resolver } diff --git a/demo/pkg/subgraphs/viewer/viewer.go b/demo/pkg/subgraphs/viewer/viewer.go new file mode 100644 index 0000000000..05cee0b164 --- /dev/null +++ b/demo/pkg/subgraphs/viewer/viewer.go @@ -0,0 +1,30 @@ +package viewer + +import ( + "net/http" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/handler" + "github.com/99designs/gqlgen/graphql/handler/transport" + + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/viewer/subgraph" + "github.com/wundergraph/cosmo/demo/pkg/subgraphs/viewer/subgraph/generated" +) + +func NewSchema() graphql.ExecutableSchema { + return generated.NewExecutableSchema(generated.Config{Resolvers: &subgraph.Resolver{}}) +} + +// NewHandler creates an HTTP handler that injects the request into context +// so resolvers can access the Authorization header. +func NewHandler() http.Handler { + schema := NewSchema() + srv := handler.New(schema) + srv.AddTransport(transport.POST{}) + srv.AddTransport(transport.GET{}) + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := subgraph.WithHTTPRequest(r.Context(), r) + srv.ServeHTTP(w, r.WithContext(ctx)) + }) +} diff --git a/demo/router-cache-cp.yaml b/demo/router-cache-cp.yaml new file mode 100644 index 0000000000..7d312743bc --- /dev/null +++ b/demo/router-cache-cp.yaml @@ -0,0 +1,58 @@ +version: "1" + +# Connected to the local control plane — no execution_config.file. +# graph.token injected via GRAPH_API_TOKEN env var. + +storage_providers: + redis: + - id: "default" + urls: + - "redis://localhost:6379/2" + cluster_enabled: false + +entity_caching: + enabled: true + l1: + enabled: true + max_size: "100MB" + l2: + enabled: true + storage: + provider_id: "default" + key_prefix: "cosmo_entity_cache" + circuit_breaker: + enabled: false + +headers: + subgraphs: + cachegraph: + request: + - op: propagate + named: Authorization + - op: propagate + named: X-Artificial-Latency + cachegraph-ext: + request: + - op: propagate + named: X-Artificial-Latency + viewer: + request: + - op: propagate + named: Authorization + - op: propagate + named: X-Artificial-Latency + +# Needed because the demo cachegraph subgraphs use a non-standard header to inject +# synthetic latency for visible cache effect. All WG-standard headers (X-WG-Trace, +# X-WG-Token, X-WG-Disable-Entity-Cache*, etc.) are appended to AllowHeaders by the +# router automatically, so they do not need to be listed here. +cors: + allow_headers: + - X-Artificial-Latency + +log_level: debug +dev_mode: true +listen_addr: "localhost:3002" +playground: + enabled: true + path: "/" diff --git a/demo/router-cache.yaml b/demo/router-cache.yaml new file mode 100644 index 0000000000..4ec1e1fbce --- /dev/null +++ b/demo/router-cache.yaml @@ -0,0 +1,51 @@ +version: "1" + +execution_config: + file: + path: "../demo/config-cache-only.json" + +storage_providers: + memory: + - id: "default" + max_size: "100MB" + +entity_caching: + enabled: true + l1: + enabled: true + l2: + enabled: true + storage: + provider_id: "default" + key_prefix: "cosmo_entity_cache" + circuit_breaker: + enabled: false + +headers: + subgraphs: + cachegraph: + request: + - op: propagate + named: Authorization + - op: propagate + named: X-Artificial-Latency + cachegraph-ext: + request: + - op: propagate + named: X-Artificial-Latency + viewer: + request: + - op: propagate + named: Authorization + - op: propagate + named: X-Artificial-Latency + +graph: + token: "" + +log_level: debug +dev_mode: true +listen_addr: "localhost:3002" +playground: + enabled: true + path: "/" diff --git a/docs/REQUEST_SCOPED.md b/docs/REQUEST_SCOPED.md new file mode 100644 index 0000000000..e3481edceb --- /dev/null +++ b/docs/REQUEST_SCOPED.md @@ -0,0 +1,390 @@ +# @openfed__requestScoped Directive + +Per-request coordinate L1 cache for fields that resolve to the same value within a request. +Eliminates redundant subgraph calls when multiple fields in a subgraph share an identity +that only depends on the request context (current viewer, tenant, locale, feature flags, etc.). + +## Coordinate L1 vs Entity L1 + +Cosmo has two distinct per-request L1 caches. +They solve different problems and key differently: + +- **Coordinate L1** (this document). + Keyed by `{subgraphName}.{@requestScoped key}`. + Caches the value of a field coordinate — every field annotated with `@openfed__requestScoped(key: "X")` in the same subgraph shares one slot. + Use for values that are constant within a request regardless of parent entity (current viewer, tenant, locale, feature flags). +- **Entity L1**. + Keyed by `{subgraphName}.{typeName}.{@key values}`. + Caches the value of a specific entity instance — two queries for `product(id: "1")` within one request hit the same slot. + Use for deduplicating repeated fetches of the same entity within a request. + +A field can participate in both systems; they do not interfere. +Entity L2 (Redis or shared in-memory) exists only for entity caching. +Coordinate caching is request-scoped only. + +## TL;DR + +```graphql +directive @openfed__requestScoped(key: String!) on FIELD_DEFINITION + +# Every participating field declares the directive with the SAME key. +type Query { + currentViewer: Viewer @openfed__requestScoped(key: "currentViewer") +} + +type Personalized @key(fields: "id") @interfaceObject { + id: ID! + currentViewer: Viewer @inaccessible @openfed__requestScoped(key: "currentViewer") +} +``` + +Both fields share L1 key `{subgraphName}.currentViewer`. +Whichever resolves first populates the per-request L1; +subsequent fields inject from L1 and skip their subgraph fetch. + +## Semantics + +### Symmetric — no receiver, no provider + +There is no receiver/provider distinction. +Every field annotated with `@openfed__requestScoped(key: "X")` in the same subgraph is BOTH: + +- **A reader** — the planner emits a hint so the resolver can inject from L1 and skip the fetch +- **A writer** — the planner emits an export so the resolver stores the value in L1 after the fetch + +The first field in the execution order populates L1. +Every subsequent field with the same key is a candidate for injection. + +### L1 key format + +`{subgraphName}.{key}` + +The subgraph prefix isolates L1 entries across subgraphs. +Two subgraphs that happen to use the same `key` do not collide. + +### Scope + +Per request, in-memory, on a `sync.Map` stored on the resolver's `Loader`. +Discarded when the request completes. +No cross-request sharing — that's what L2 is for. + +### Participation requires ≥ 2 fields + +Composition emits a warning when a key is declared on only one field in the subgraph. +The directive is meaningless without a second reader — there would be no one to benefit from the cache. + +## When to use it + +Use `@openfed__requestScoped` when: + +- Multiple fields in the same subgraph resolve to a value that depends ONLY on the request context +- The value is identical across all entities/rows/items within the request +- Fetching the same value multiple times is wasteful + +Typical use cases: + +| Scenario | Key examples | +|----------|--------------| +| Current authenticated user | `currentViewer`, `me`, `session` | +| Current tenant / organization | `tenantConfig`, `currentOrg` | +| Request-level locale / feature flags | `locale`, `flags` | +| Rate limit / quota status | `quotaRemaining` | +| A/B test bucket | `experimentBucket` | + +Do NOT use `@openfed__requestScoped` when: + +- The value depends on entity identity (use normal entity resolution) +- The value changes between requests but should persist (use `@openfed__entityCache` / L2) +- The field has arguments that affect the value per call (use normal fetch) + +## Compared to `@openfed__entityCache` + +| Concern | `@openfed__entityCache` | `@openfed__requestScoped` | +|---------|---------------|------------------| +| Scope | Cross-request | Per-request | +| Cache layer | L2 (Redis/Ristretto) + L1 | Coordinate L1 only | +| Keyed by | Entity `@key` fields | Directive `key` argument | +| TTL | Configurable | Request duration | +| Purpose | Avoid re-fetching entities across requests | Avoid re-fetching the same request-scoped value within a request | + +The two directives are complementary and can be used together. +A field with `@openfed__entityCache` on its return type and `@openfed__requestScoped` on the field itself +gets request-scoped deduplication AND cross-request caching. + +## Example: `Personalized` via `@interfaceObject` + +The canonical use case. +An interface that carries request-scoped fields +is implemented by many concrete entities. + +```graphql +# viewer subgraph +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key", "@interfaceObject", "@inaccessible"] + ) + +directive @openfed__requestScoped(key: String!) on FIELD_DEFINITION + +type Personalized @key(fields: "id") @interfaceObject { + id: ID! + currentViewer: Viewer @inaccessible @openfed__requestScoped(key: "currentViewer") +} + +type Viewer @key(fields: "id") { + id: ID! + name: String! + email: String! +} + +type Query { + currentViewer: Viewer @openfed__requestScoped(key: "currentViewer") +} +``` + +```graphql +# cachegraph subgraph — Article implements Personalized via @interfaceObject +type Article @key(fields: "id") { + id: ID! + title: String! + body: String! +} +``` + +For the query: + +```graphql +{ + currentViewer { id name email } # root fetch to viewer + articles { # root fetch to cachegraph + id + title + currentViewer { id name } # would require N entity fetches to viewer + } +} +``` + +Without `@openfed__requestScoped`: +`Query.currentViewer` resolves on the viewer subgraph, +then `Personalized._entities` is called on the viewer subgraph with N articles, +each returning the same viewer data. + +With `@openfed__requestScoped`: +`Query.currentViewer` populates L1 under `viewer.currentViewer`. +The `Personalized._entities` batch for N articles is SKIPPED entirely — +the cached value is injected onto each article's `currentViewer` field. +**The viewer subgraph is called exactly once per request regardless of N.** + +## Implementation architecture + +### Four cache layers + +``` +┌─────────────────────────────────────────────────────────┐ +│ GraphQL Request │ +└─────────────────────────────┬────────────────────────────┘ + │ + ▼ +┌─────────────────────────────────────────────────────────┐ +│ Coordinate L1 (requestScopedL1, per-request sync.Map) │ +│ Key: "{subgraphName}.{key}" │ +│ Used by: @openfed__requestScoped │ +└─────────────────────────────────────────────────────────┘ +┌─────────────────────────────────────────────────────────┐ +│ Entity L1 (per-request sync.Map) │ +│ Key: `{"__typename":"X","key":{"id":"..."}}` │ +│ Used by: entity fetch deduplication, @openfed__entityCache L1 │ +└─────────────────────────────────────────────────────────┘ +┌─────────────────────────────────────────────────────────┐ +│ Entity L2 (cross-request, external — Redis/Ristretto) │ +│ Key: `{"__typename":"X","key":{"id":"..."}}` │ +│ Used by: @openfed__entityCache │ +└─────────────────────────────────────────────────────────┘ +┌─────────────────────────────────────────────────────────┐ +│ Subgraph │ +└─────────────────────────────────────────────────────────┘ +``` + +### Unified normalization pipeline + +The coordinate L1, entity L1, and entity L2 caches share the same alias-aware +normalization pipeline based on the response plan's `*Object` tree: + +- **Write (normalize)**: `normalizeForCache(value, obj)` — renames aliases to schema + field names, appends arg-hash suffixes for arg-variant fields, walks nested objects/arrays. + Returns input unchanged if `obj.HasAliases` is false (fast path). + +- **Validate (widening check)**: `validateItemHasRequiredData(cached, obj)` — checks + that the cached value contains every field declared in `obj.Fields`. + Missing field → widening check fails → fetch proceeds normally instead of using stale cache. + +- **Read (denormalize)**: `shallowCopyProvidedFields(cached, obj)` — copies fields + from the schema-named cache into a response-named object (re-applies aliases for + the current query's selection set). + +### Components + +| Layer | File | Role | +|-------|------|------| +| **Composition (TS)** | `composition/src/v1/constants/directive-definitions.ts` | Directive AST | +| | `composition/src/v1/normalization/directive-definition-data.ts` | Validation metadata (key required) | +| | `composition/src/v1/normalization/normalization-factory.ts:extractRequestScopedFields` | Extraction + single-field warning | +| | `composition/src/router-configuration/types.ts:RequestScopedFieldConfig` | Output type | +| **Proto** | `proto/wg/cosmo/node/v1/node.proto:RequestScopedFieldConfiguration` | Wire format | +| **Shared (TS)** | `shared/src/router-config/graphql-configuration.ts` | Serializer | +| **Router (Go)** | `router/core/factoryresolver.go:dataSourceMetaData` | Proto → `plan.RequestScopedField` | +| **Planner (Go)** | `v2/pkg/engine/plan/federation_metadata.go:RequestScopedField` | Plan type | +| | `v2/pkg/engine/datasource/graphql_datasource/graphql_datasource.go:ConfigureFetch` | Emits hint AND export per field (symmetric) | +| | `v2/pkg/engine/plan/visitor.go:configureFetchCaching` | Populates `ProvidesData` from `plannerObjects[fetchID]`; rewrites `FieldName`/`FieldPath` to outer query's alias | +| **Resolver (Go)** | `v2/pkg/engine/resolve/fetch.go:RequestScopedHint/RequestScopedExport` | Carry `ProvidesData *Object` | +| | `v2/pkg/engine/resolve/loader.go:requestScopedL1` | Per-request `sync.Map` | +| | `v2/pkg/engine/resolve/loader_cache.go:tryRequestScopedInjection` | Collect-then-inject with widening check | +| | `v2/pkg/engine/resolve/loader_cache.go:exportRequestScopedFields` | Normalize before storing | + +### Execution flow + +``` +1. Planner walks the response plan and locates the *Object sub-tree for each + @openfed__requestScoped field. Populates RequestScopedHint.ProvidesData and + RequestScopedExport.ProvidesData. Rewrites FieldName/FieldPath to use the + outer query's alias when aliased. + +2. For every fetch: + a. Phase 1 (pre-fetch): tryRequestScopedInjection checks L1 under hint.L1Key. + - If not found → return false, fetch proceeds. + - If found → validateItemHasRequiredData against hint.ProvidesData (widening). + - If check fails → return false, fetch proceeds. + - If check passes → shallowCopyProvidedFields (re-apply aliases) and + inject onto items. Mark fetch as skipped. + b. If the fetch was NOT skipped, it runs normally. + c. Phase 2 (post-fetch): exportRequestScopedFields reads the field value + from the response, normalizes via export.ProvidesData, stores in L1 + under export.L1Key. + +3. L1 is reset at the start of each request (Loader.Free / LoadGraphQLResponseData). +``` + +### Field widening check + +When a narrower query (`{id, name}`) caches a value and a subsequent wider query +(`{id, name, email}`) tries to inject from L1, the widening check catches the +missing `email` and skips injection. The wider fetch runs normally, then updates L1 +with the wider field set. This prevents silent data loss. + +### Alias handling + +Aliases are transparent to the L1 cache: + +- **L1 key** is schema-based (`{subgraphName}.{key}`) — aliases have no effect +- **L1 stored value** uses schema field names (normalized away on write) +- **Widening check** uses schema names (matches normalized L1) +- **Denormalized read** re-applies aliases for the current query + +Example: +```graphql +# Request A +{ me: currentViewer { id, displayName: name } } +# L1 stores: {"id": "...", "name": "..."} (schema names) + +# Request B (same request, different fetch) +{ articles { viewer: currentViewer { id, name } } } +# L1 widening check: needs id and name — satisfied +# Inject: produces {"viewer": {"id": "...", "name": "..."}} +``` + +### Arg-variant sub-fields + +Handled for free via the unified pipeline. A query requesting +`currentViewer { posts(first: 5) { id } }` stores the posts under a cacheFieldName +like `posts_`. A later query requesting `posts(first: 10)` has a +different arg hash, so the widening check fails and the fetch runs normally. +Both variants coexist in L1 under different sub-field keys. + +## Composition validation + +### Error: key missing + +```graphql +currentViewer: Viewer @openfed__requestScoped # ERROR: missing required arg "key" +``` + +### Error: directive repeated + +```graphql +# @openfed__requestScoped is NOT repeatable +currentViewer: Viewer @openfed__requestScoped(key: "a") @openfed__requestScoped(key: "b") # ERROR +``` + +### Warning: single field with key + +```graphql +type Query { + currentViewer: Viewer @openfed__requestScoped(key: "lonely") # WARNING: only one field +} +# No other field in the subgraph declares @openfed__requestScoped(key: "lonely") +# → directive is meaningless, warning emitted +``` + +## Trace reporting + +When a fetch is skipped via `tryRequestScopedInjection`: + +- `ensureFetchTrace(f).LoadSkipped = true` — ART shows the fetch as skipped +- `res.cacheTraceRequestScopedHits = res.cacheTraceEntityCount` — these get folded + into `L1Hit` by `buildCacheTrace`, so the playground's red bolt icon and + "X/Y Cached" badge correctly reflect the request-scoped injection + +## Per-request cache control + +For debugging / demo purposes, the router supports per-request cache control headers +(gated on dev mode or valid studio token): + +- `X-WG-Disable-Entity-Cache: true` → disable L1 and L2 +- `X-WG-Disable-Entity-Cache-L1: true` → disable L1 only (including coordinate L1) +- `X-WG-Disable-Entity-Cache-L2: true` → disable L2 only + +Disabling L1 via these headers also disables the `@openfed__requestScoped` coordinate L1. + +The playground's cache mode dropdown ("Caching enabled / L2 only / L1 only / disabled") +injects these headers transparently. + +## Known limitations + +### No cross-subgraph participation + +Two subgraphs cannot share an L1 entry even if they use the same `key`. +The subgraph prefix in the L1 key is intentional — cross-subgraph sharing would +require cross-subgraph consistency guarantees that don't exist. + +If you need the same value in two subgraphs, each subgraph must resolve it +independently. That's still O(subgraphs) calls, not O(entities). + +### Planner integration of aliases is partial + +The planner populates `ProvidesData` and rewrites `FieldName`/`FieldPath` to aliases +for the top-level `@openfed__requestScoped` field. Sub-field aliases (e.g., `currentViewer { displayName: name }`) +are handled via the unified `*Object` pipeline automatically — nothing extra needed. + +### No value validation on key collisions + +If two `@openfed__requestScoped` fields in the same subgraph declare the same key but have +incompatible types (e.g., one returns `Viewer`, another returns `String`), composition +does not currently validate this. At runtime, the widening check would catch the +mismatch and fall back to running the fetch, but no warning is emitted at composition time. +This is a potential future enhancement. + +## Test coverage + +- `composition/tests/v1/directives/entity-cache-fuzz.test.ts` — directive arg validation, single-field warning, repeatable error +- `graphql-go-tools/v2/pkg/engine/resolve/request_scoped_test.go` — resolver primitives: hit, miss, widening, export, round-trip, arena detach, aliases, nested, arrays, arg-variants, `__typename` +- `graphql-go-tools/v2/pkg/engine/plan/federation_metadata_test.go` — `RequestScopedFieldsForType`, `RequestScopedExportsForField` +- `graphql-go-tools/v2/pkg/engine/plan/request_scoped_provides_data_test.go` — planner `ProvidesData` population and alias rewriting +- `router/core/factoryresolver_test.go` — proto → plan mapping +- `router-tests/entity_caching/` — integration tests + +## References + +- Acceptance criteria: `graphql-go-tools/docs/entity-caching/ENTITY_CACHING_ACCEPTANCE_CRITERIA.md` (AC-RS-01..08) +- Composition CLAUDE.md: `composition/CLAUDE.md` — directive extraction +- graphql-go-tools CLAUDE.md: `graphql-go-tools/CLAUDE.md` — resolver + planner architecture diff --git a/docs/entity-caching/ENTITY_CACHING_DEMO.md b/docs/entity-caching/ENTITY_CACHING_DEMO.md new file mode 100644 index 0000000000..6f32596b28 --- /dev/null +++ b/docs/entity-caching/ENTITY_CACHING_DEMO.md @@ -0,0 +1,286 @@ +# Entity Caching — Visual Guide + +## The Schema (3 Subgraphs) + +```text +┌─────────────────────────────────────────────────────────────────────┐ +│ cachegraph (port 4012) │ +│ │ +│ type Article @key(fields: "id") @openfed__entityCache(maxAge: 120) { │ +│ id: ID! │ +│ title: String! │ +│ body: String! │ +│ authorName: String! │ +│ tags: [String!]! │ +│ } │ +│ │ +│ type Query { │ +│ article(id: ID!): Article @openfed__queryCache(maxAge: 120) │ +│ articles: [Article!]! @openfed__queryCache(maxAge: 120) │ +│ articlesByIds( │ +│ ids: [ID!]! @openfed__is(fields: "id") │ +│ ): [Article!]! @openfed__queryCache(maxAge: 120) ← batch isBatch=true │ +│ } │ +└─────────────────────────────────────────────────────────────────────┘ + +┌─────────────────────────────────────────────────────────────────────┐ +│ cachegraph-ext (port 4013) │ +│ │ +│ type Article @key(fields: "id") @openfed__entityCache(maxAge: 90) { │ +│ id: ID! │ +│ viewCount: Int! │ +│ rating: Float! │ +│ reviewSummary: String! │ +│ relatedArticles: [Article!]! ← field resolver │ +│ personalizedRecommendation: String @requires(currentViewer) │ +│ } │ +└─────────────────────────────────────────────────────────────────────┘ + +┌─────────────────────────────────────────────────────────────────────┐ +│ viewer (port 4014) │ +│ │ +│ type Personalized @key(fields: "id") @interfaceObject { │ +│ id: ID! │ +│ currentViewer: Viewer @inaccessible │ +│ @openfed__requestScoped(resolveFrom: ["Query.currentViewer"]) │ +│ ↑ │ +│ └── L1 key: "viewer.Personalized.currentViewer" │ +│ When Query.currentViewer resolves, result is stored │ +│ in coordinate L1. All entity batches skip the fetch. │ +│ } │ +│ │ +│ type Viewer @key(fields: "id") { │ +│ id: ID! name: String! email: String! │ +│ recommendedArticles: [Article!]! │ +│ } │ +│ │ +│ type Query { │ +│ currentViewer: Viewer ← provides @openfed__requestScoped value │ +│ } │ +└─────────────────────────────────────────────────────────────────────┘ +``` + +## The Query + +```graphql +{ + currentViewer { # ← Root field on viewer subgraph + id name email + recommendedArticles { # ← Viewer.recommendedArticles + id title viewCount # (crosses to cachegraph + cachegraph-ext) + } + } + articles { # ← Root field on cachegraph subgraph + id title + viewCount rating # ← Extension fields from cachegraph-ext + currentViewer { id name } # ← @interfaceObject field from viewer + relatedArticles { # ← Field resolver from cachegraph-ext + id title # resolves back to cachegraph + } + } +} +``` + +This query touches **3 subgraphs**, returns **4 articles** each with extension fields, +viewer data, and related articles. +Without caching, this would require **7+ subgraph calls**. + +## Request 1 — Cold Cache + +```text + Step Subgraph Path What Happens +═══════════════════════════════════════════════════════════════════════════════════════ + 1 ┌─ viewer / FETCH Query.currentViewer + │ → {id:"v0", name:"Anonymous", email:"..."} + │ ✦ EXPORT to requestScoped L1 + │ key: "viewer.Personalized.currentViewer" + │ + 2 └─ cachegraph / FETCH Query.articles + → [{id:"1",...}, {id:"2",...}, ...] + L2 MISS → stored in L2 (TTL: 120s) + + 3 cachegraph currentViewer FETCH article entities for + Viewer.recommendedArticles + → resolves article entities + + 4 cachegraph-ext articles BATCH ENTITY FETCH (4 articles) + → {viewCount, rating, relatedArticles} + L2 MISS → stored in L2 (TTL: 90s) + + 5 viewer articles ★ SKIPPED! @openfed__requestScoped L1 HIT + ╔═══════════════════════════════════╗ + ║ 4 entities need currentViewer ║ + ║ L1 has it from step 1 ║ + ║ → Inject cached value ║ + ║ → Skip viewer subgraph call ║ + ║ → 0ms, no network ║ + ╚═══════════════════════════════════╝ + + 6 cachegraph articles.@.relatedArticles BATCH ENTITY FETCH (8 articles) + → resolves related article entities +═══════════════════════════════════════════════════════════════════════════════════════ + Total network calls: 5 (would be 6+ without @openfed__requestScoped) + Total time: ~6ms +``` + +## Request 2 — Warm Cache (Same Query) + +```text + Step Subgraph Path What Happens +═══════════════════════════════════════════════════════════════════════════════════════ + 1 ┌─ viewer / FETCH Query.currentViewer + │ (not cached — viewer has no @openfed__entityCache) + │ ✦ EXPORT to requestScoped L1 + │ + 2 └─ cachegraph / ★ L2 HIT! (TTL: 120s) + articles data served from cache + → 0ms, no network + + 3 cachegraph currentViewer FETCH (viewer's recommended articles) + + 4 cachegraph-ext articles ★ L2 HIT! (TTL: 90s) + viewCount, rating, relatedArticles + all served from entity cache + → 0ms, no network + + 5 viewer articles ★ SKIPPED! @openfed__requestScoped L1 HIT + (same as request 1) + + 6 cachegraph articles.@.relatedArticles ★ L2 HIT! (TTL: 120s) + related articles from entity cache + → 0ms, no network +═══════════════════════════════════════════════════════════════════════════════════════ + Total network calls: 2 (down from 5) + Subgraph calls saved: 60% +``` + +## The Three Cache Layers at Work + +```text +┌─────────────────────────────────────────────────────────────────────┐ +│ CLIENT REQUEST │ +│ { currentViewer { ... } articles { ... currentViewer { ... } } } │ +└─────────────────────────────┬───────────────────────────────────────┘ + │ + ▼ +┌─────────────────────────────────────────────────────────────────────┐ +│ COSMO ROUTER │ +│ │ +│ ┌─────────────────────────────────────────────────────────────┐ │ +│ │ @openfed__requestScoped Coordinate L1 (per-request, in-memory) │ │ +│ │ │ │ +│ │ "viewer.Personalized.currentViewer" │ │ +│ │ → {id:"v0", name:"Anonymous", email:"..."} │ │ +│ │ │ │ +│ │ ✦ Populated from Query.currentViewer root field │ │ +│ │ ✦ Injected into ALL Personalized._entities batches │ │ +│ │ ✦ Eliminates redundant viewer subgraph calls │ │ +│ │ ✦ Field widening check: only inject if cached value │ │ +│ │ has ALL required sub-fields │ │ +│ └─────────────────────────────────────────────────────────────┘ │ +│ │ +│ ┌─────────────────────────────────────────────────────────────┐ │ +│ │ Entity L1 Cache (per-request, in-memory) │ │ +│ │ │ │ +│ │ {"__typename":"Article","key":{"id":"1"}} │ │ +│ │ → {title:"...", body:"...", viewCount:12453, ...} │ │ +│ │ │ │ +│ │ ✦ Populated from subgraph fetches within this request │ │ +│ │ ✦ Deduplicates same entity across parallel fetch paths │ │ +│ │ ✦ Checked before L2; L1 hit skips L2 entirely │ │ +│ └─────────────────────────────────────────────────────────────┘ │ +│ │ +│ ┌─────────────────────────────────────────────────────────────┐ │ +│ │ Entity L2 Cache (cross-request, Ristretto) │ │ +│ │ │ │ +│ │ Article (TTL: 120s) │ Article-ext (TTL: 90s) │ │ +│ │ ─────────────────────┼────────────────────── │ │ +│ │ id:1 → {title,...} │ id:1 → {viewCount,rating,...} │ │ +│ │ id:2 → {title,...} │ id:2 → {viewCount,rating,...} │ │ +│ │ id:3 → {title,...} │ id:3 → {viewCount,rating,...} │ │ +│ │ id:4 → {title,...} │ id:4 → {viewCount,rating,...} │ │ +│ │ │ │ +│ │ Root field (TTL: 120s) │ │ +│ │ ──────────────────── │ │ +│ │ Query.articles → [{id:1},{id:2},{id:3},{id:4}] │ │ +│ │ │ │ +│ │ ✦ Populated after successful subgraph calls │ │ +│ │ ✦ Per-entity TTL from @openfed__entityCache(maxAge:) │ │ +│ │ ✦ Normalized field names for query-independent reuse │ │ +│ │ ✦ Validated before serving (missing fields → re-fetch) │ │ +│ └─────────────────────────────────────────────────────────────┘ │ +│ │ +└──────────┬──────────────────┬──────────────────┬────────────────────┘ + │ │ │ + ▼ ▼ ▼ + ┌──────────┐ ┌──────────────┐ ┌──────────┐ + │ cachegraph│ │cachegraph-ext│ │ viewer │ + │ port 4012 │ │ port 4013 │ │ port 4014 │ + │ │ │ │ │ │ + │ Article │ │ Article ext │ │Personalized│ + │ (base) │ │ (viewCount, │ │(@interface │ + │ │ │ rating, │ │ Object) │ + │ │ │ related) │ │ │ + └──────────┘ └──────────────┘ └──────────┘ +``` + +## Before vs After: Subgraph Calls + +```text + Without Caching With Entity Caching + ───────────────── ───────────────────── + + Request 1 (cold) 7 subgraph calls 5 calls (viewer entity SKIPPED + via @openfed__requestScoped) + + Request 2 (warm) 7 subgraph calls 2 calls (L2 serves articles, + extensions, related articles; + @openfed__requestScoped skips viewer) + + Request 3+ 7 subgraph calls 2 calls (same as R2 until + TTL expires) + + ──────────────────────────────────────────────────────────────────── + 10 requests total 70 calls 23 calls (67% reduction) +``` + +## Directive Reference + +| Directive | Placement | Purpose | +|-----------|-----------|---------| +| `@openfed__entityCache(maxAge: Int!)` | `OBJECT` | Marks entity type as cacheable with TTL | +| `@openfed__queryCache(maxAge: Int!)` | `FIELD_DEFINITION` | Enables L2 cache reads for Query fields | +| `@openfed__is(fields: String!)` | `ARGUMENT_DEFINITION` | Maps argument to @key field for cache key | +| `@openfed__cacheInvalidate` | `FIELD_DEFINITION` | Evicts entity from cache (Mutation/Subscription) | +| `@openfed__cachePopulate(maxAge?: Int)` | `FIELD_DEFINITION` | Writes to cache (Mutation/Subscription) | +| `@openfed__requestScoped(resolveFrom: [String!], key: String)` | `FIELD_DEFINITION` | Eliminates redundant entity fetches via per-request L1 | + +## Key Mapping Examples + +```text + Schema Config Output + ────── ───────────── + + @key(fields: "id") entityKeyField: "id" + article(id: ID!) argumentPath: ["id"] + (auto-mapped by name) + + @key(fields: "id") entityKeyField: "id" + article(pid: ID! @openfed__is(fields: "id")) argumentPath: ["pid"] + (explicit @openfed__is mapping) + + @key(fields: "sellerId sku") entityKeyField: "sellerId" + listing(key: ListingKeyInput! argumentPath: ["key","sellerId"] + @openfed__is(fields: "sellerId sku")) entityKeyField: "sku" + argumentPath: ["key","sku"] + (input object decomposition) + + @key(fields: "location { id }") entityKeyField: "location.id" + venue(loc: VenueLocInput!) argumentPath: ["loc","address","id"] + (nested key + nested input) + + articlesByIds(ids: [ID!]! entityKeyField: "id" + @openfed__is(fields: "id")): [Article!]! argumentPath: ["ids"] + isBatch: true + (batch per-element cache keys) +``` diff --git a/docs/entity-caching/analytics-rfc.md b/docs/entity-caching/analytics-rfc.md new file mode 100644 index 0000000000..f038b4282d --- /dev/null +++ b/docs/entity-caching/analytics-rfc.md @@ -0,0 +1,321 @@ +# RFC: Entity Cache Analytics for Cosmo Router + +## Context + +Entity caching is being added to the Cosmo Router (branch `jensneuse/entity-caching`). The router already has 6 basic OTEL metrics for cache operations (hits/misses, key lifecycle, L2 latency, invalidation/population counts, shadow staleness). These are aggregate counters with low-cardinality labels — useful for operational monitoring, but insufficient for users to answer business-level questions about their cache effectiveness. + +The router also has a mature **schema usage tracking** system that collects per-request field/argument/input usage data, batches it, aggregates it, and exports it via gRPC to a backend collector service. This system is designed for high throughput with minimal router overhead (plan caching, buffer pools, batch aggregation, async export with backoff). + +This RFC proposes **cache analytics** — a richer data collection layer that gives users actionable insights about cache behavior per operation, per entity type, and per subgraph, enabling them to optimize their cache configuration and understand the business impact of caching. + +--- + +## End-User Capabilities + +### Questions Users Can Answer + +**Cache Effectiveness** +- "What is my overall cache hit rate, broken down by entity type?" — Identify which entity types benefit most from caching and which have poor hit rates +- "Which operations benefit most from caching?" — Rank operations by cache savings (hits × estimated subgraph cost avoided) +- "What's my hit rate per subgraph?" — Understand which subgraph calls are most frequently avoided by caching + +**Cost & Performance Impact** +- "How much subgraph traffic is entity caching saving me?" — Quantify the reduction in subgraph calls, enabling cost/benefit analysis +- "What's the latency impact of cache hits vs misses?" — Compare L2 cache fetch latency against subgraph fetch latency per entity type +- "Are my TTLs well-tuned?" — Shadow mode staleness data per entity type reveals if TTLs are too long (stale data) or too short (unnecessary misses) + +**Operational Health** +- "Is my cache working correctly after a deployment?" — Track hit rate trends per operation over time +- "Did this schema change affect cache effectiveness?" — Correlate cache metrics with schema version changes +- "Which clients benefit most from caching?" — Break down cache savings by client name/version + +**Cache Configuration Optimization** +- "Which entity types should I enable caching for?" — Identify high-frequency entities currently not cached +- "Should I adjust TTLs for specific entity types?" — Use staleness data and hit/miss patterns to tune TTLs +- "How effective is my invalidation strategy?" — See invalidation-to-population ratios per entity type + +### Business Value + +1. **Cost reduction visibility** — Quantify how much infrastructure spend entity caching saves by reducing subgraph calls +2. **Performance optimization** — Identify which entity types / operations to cache for maximum latency improvement +3. **Configuration confidence** — Data-driven TTL and cache scope decisions instead of guessing +4. **Incident detection** — Spot cache degradation (dropping hit rates, rising staleness) before users notice +5. **ROI justification** — Concrete numbers for stakeholders on the value of the caching layer + +--- + +## Architecture Decision: Separate Concern vs. Schema Usage Extension + +### Recommendation: Separate concern, reuse infrastructure + +Cache analytics should be a **separate data pipeline** from schema usage tracking, but it should **reuse the existing generic exporter infrastructure** (`internal/exporter/exporter.go`). + +**Reasons to keep separate:** + +1. **Different data shape** — Schema usage tracks fields/arguments/inputs per operation. Cache analytics tracks hits/misses/latencies per entity type per fetch. These are fundamentally different data structures with different aggregation keys. + +2. **Different cardinality profile** — Schema usage is bounded by the number of unique operations × clients. Cache analytics adds the entity type dimension, which could multiply cardinality. Mixing them into one pipeline would complicate aggregation. + +3. **Independent lifecycle** — Users should be able to enable/disable cache analytics independently from schema usage tracking. They serve different audiences (platform team vs. API consumers). + +4. **Different backend processing** — The schema usage collector backend processes data for breaking change detection, field coverage, etc. Cache analytics needs different backend processing (time-series aggregation, trend analysis, alerting). + +5. **Existing OTEL metrics should remain** — The current 6 OTEL metrics are good for real-time operational dashboards (Grafana). Cache analytics via the exporter adds the operation/entity-type/subgraph dimensions needed for deeper analysis in the Cosmo Studio. + +**What to reuse:** + +- `internal/exporter/exporter.go` — The generic batch exporter with queue, batching, retry, buffer pools, and graceful shutdown. Create a new `Exporter[*CacheAnalyticsInfo]` instance. +- The Connect RPC transport pattern from `GraphQLMetricsSink` — Create a new `CacheAnalyticsSink` following the same pattern. +- The aggregation pattern from `aggregate.go` — Create a new `AggregateCacheAnalyticsBatch()` function. + +--- + +## Resource Efficiency Design + +### Principles + +1. **Aggregate in-router, export summaries** — Don't export per-entity-key events. Aggregate by (operation hash, entity type, subgraph, cache level, event type) before export. +2. **Reuse the plan cache** — Like schema usage, cache-invariant metadata (which entity types an operation touches, which subgraphs are involved) can be computed once during planning and cached. +3. **Async, non-blocking export** — Use the existing exporter's queue-based async pattern. Drop items rather than block request processing. +4. **Batch before sending** — Use the same time/size-based batching (default: 1024 items or 10s interval). +5. **Aggregate before sending** — Like `AggregateSchemaUsageInfoBatch`, deduplicate identical records in the batch, incrementing counts. +6. **Bounded cardinality** — Only use low-cardinality dimensions as aggregation keys (operation hash, entity type name, subgraph ID, cache level). Never use entity key values. + +### Overhead Estimate + +The overhead per request is: +- **Snapshot collection**: Already happens for OTEL metrics — zero additional cost +- **Analytics record construction**: One allocation per request to build the `CacheAnalyticsInfo` struct from the snapshot — lightweight, ~microseconds +- **Queue enqueue**: One channel send — nanoseconds +- **Aggregation + export**: Happens asynchronously in background goroutine — no request path impact + +--- + +## Detailed Implementation Plan + +### Step 1: Define Protobuf Messages + +**New file**: `proto/wg/cosmo/cacheanalytics/v1/cacheanalytics.proto` + +```protobuf +syntax = "proto3"; +package wg.cosmo.cacheanalytics.v1; + +service CacheAnalyticsService { + rpc PublishCacheAnalytics(PublishCacheAnalyticsRequest) + returns (PublishCacheAnalyticsResponse) {} +} + +message PublishCacheAnalyticsRequest { + repeated CacheAnalyticsAggregation aggregations = 1; +} + +message PublishCacheAnalyticsResponse {} + +message CacheAnalyticsAggregation { + CacheAnalyticsInfo analytics = 1; + uint64 request_count = 2; +} + +// One record per request, aggregated before export +message CacheAnalyticsInfo { + // Operation context (same dimensions as schema usage) + OperationInfo operation = 1; + ClientInfo client = 2; + SchemaInfo schema = 3; + + // Cache statistics for this request + repeated EntityCacheStats entity_stats = 4; + repeated RootFieldCacheStats root_field_stats = 5; + + // Request-level cache summary + CacheSummary summary = 6; +} + +message OperationInfo { + string hash = 1; + string name = 2; + OperationType type = 3; +} + +enum OperationType { + QUERY = 0; + MUTATION = 1; + SUBSCRIPTION = 2; +} + +message ClientInfo { + string name = 1; + string version = 2; +} + +message SchemaInfo { + string version = 1; +} + +// Per entity-type cache stats within a single request +message EntityCacheStats { + string entity_type = 1; // e.g., "Product", "User" + string subgraph_id = 2; // which subgraph serves this entity + + uint32 l1_hits = 3; + uint32 l1_misses = 4; + uint32 l2_hits = 5; + uint32 l2_misses = 6; + uint32 l2_writes = 7; // cache populations + + // Latency (only for L2 operations in this request) + double l2_get_latency_ms = 8; // average L2 GET latency for this entity type + + // Invalidation/population events + uint32 invalidations = 9; + uint32 populations = 10; + + // Shadow mode + uint32 shadow_stale = 11; // times cached != fresh + uint32 shadow_fresh = 12; // times cached == fresh +} + +// Per root-field cache stats (non-entity caching) +message RootFieldCacheStats { + string field_name = 1; + string subgraph_id = 2; + + uint32 l1_hits = 3; + uint32 l1_misses = 4; + uint32 l2_hits = 5; + uint32 l2_misses = 6; + uint32 l2_writes = 7; + + double l2_get_latency_ms = 8; +} + +// Request-level summary (for quick dashboards without drilling into entity details) +message CacheSummary { + uint32 total_cache_hits = 1; // l1 + l2 combined + uint32 total_cache_misses = 2; + uint32 total_subgraph_fetches_avoided = 3; // entity fetches served from cache + double total_l2_latency_ms = 4; // total time spent on L2 operations + bool had_errors = 5; // any cache backend errors +} +``` + +### Step 2: Create Cache Analytics Sink + +**New file**: `router/internal/cacheanalytics/sink.go` + +Follow the exact pattern of `GraphQLMetricsSink`: +- Implement `exporter.Sink[*CacheAnalyticsInfo]` +- `Export()` calls `AggregateBatch()` then sends via Connect RPC +- `IsRetryableError()` reuses the same Connect error classification +- Auth via `Authorization: Bearer ` header + +### Step 3: Create Cache Analytics Aggregation + +**New file**: `router/internal/cacheanalytics/aggregate.go` + +Follow the pattern of `graphqlmetrics/aggregate.go`: +- Aggregate by: operation hash + schema version + client name/version + error status +- Increment `request_count` for identical records +- Entity-level stats within a record are already per-entity-type, so they aggregate naturally + +### Step 4: Create Cache Analytics Exporter + +**New file**: `router/internal/cacheanalytics/exporter.go` + +Thin wrapper around `exporter.Exporter[*cacheanalyticsv1.CacheAnalyticsInfo]`: +- `NewCacheAnalyticsExporter(logger, sink, settings)` — creates the generic exporter +- `RecordAnalytics(info, synchronous)` — delegates to exporter.Record() +- `Shutdown(ctx)` — delegates to exporter.Shutdown() + +### Step 5: Build Analytics Record from Snapshot + +**Modify**: `router/core/graphql_handler.go` + +In `recordEntityCacheMetrics()`, after the existing OTEL metric recording, build a `CacheAnalyticsInfo` from the snapshot: + +```go +func (h *GraphQLHandler) recordEntityCacheAnalytics(resolveCtx *resolve.Context, opCtx *operationContext) { + if h.cacheAnalyticsExporter == nil { + return + } + + snapshot := resolveCtx.GetCacheStats() + info := buildCacheAnalyticsInfo(snapshot, opCtx) + h.cacheAnalyticsExporter.RecordAnalytics(info, false) +} +``` + +The `buildCacheAnalyticsInfo` function: +1. Groups snapshot events by entity type / subgraph +2. Builds `EntityCacheStats` per group +3. Computes `CacheSummary` totals +4. Attaches operation/client/schema context from `operationContext` + +This runs on the request goroutine but is lightweight (iterating small event slices, no I/O). + +### Step 6: Register Exporter in Graph Server + +**Modify**: `router/core/graph_server.go` + +In the graph server setup, when entity caching analytics is enabled: +1. Create the Connect RPC client for the cache analytics service +2. Create the `CacheAnalyticsSink` +3. Create the `CacheAnalyticsExporter` with the generic exporter +4. Pass the exporter to `GraphQLHandler` + +### Step 7: Configuration + +**Modify**: `router/pkg/config/config.go` (or equivalent) + +Add cache analytics export endpoint configuration under the existing entity caching analytics config: + +```yaml +entity_caching: + analytics: + enabled: true + export: + endpoint: "https://cosmo-metrics.example.com" # defaults to same as graphql metrics + batch_size: 1024 + queue_size: 10240 + interval: "10s" + retry: + enabled: true + max_retries: 5 + max_duration: "10s" + interval: "5s" +``` + +--- + +## Files to Create/Modify + +| Action | File | Purpose | +|--------|------|---------| +| Create | `proto/wg/cosmo/cacheanalytics/v1/cacheanalytics.proto` | Protobuf message definitions | +| Create | `router/internal/cacheanalytics/sink.go` | Connect RPC sink (follows `graphql_metrics_sink.go` pattern) | +| Create | `router/internal/cacheanalytics/aggregate.go` | Batch aggregation (follows `aggregate.go` pattern) | +| Create | `router/internal/cacheanalytics/exporter.go` | Thin wrapper around generic `Exporter` | +| Modify | `router/core/graphql_handler.go` | Build analytics record from snapshot after execution | +| Modify | `router/core/graph_server.go` | Register cache analytics exporter | +| Modify | `router/pkg/config/config.go` | Add export configuration options | + +--- + +## Verification + +1. **Unit tests**: Aggregation logic, snapshot-to-analytics-info conversion +2. **Integration test**: Enable cache analytics, run queries with cache hits/misses, verify exporter receives correct records +3. **Benchmark**: Measure per-request overhead of analytics record construction — should be <10μs +4. **Cardinality check**: Verify that aggregation keys are bounded (no entity key values in exported data) +5. **Backward compatibility**: Existing OTEL metrics unchanged, existing schema usage tracking unchanged +6. **Config validation**: Cache analytics can be enabled/disabled independently + +--- + +## What This RFC Does NOT Cover (Backend) + +- Backend service that receives and stores cache analytics data +- Cosmo Studio UI for cache analytics dashboards +- Alerting rules based on cache analytics +- Historical trend analysis and recommendations engine diff --git a/docs/entity-caching/analytics.md b/docs/entity-caching/analytics.md new file mode 100644 index 0000000000..6a50827e6b --- /dev/null +++ b/docs/entity-caching/analytics.md @@ -0,0 +1,208 @@ +# Entity Cache Analytics — Available Data from graphql-go-tools + +This document describes the cache analytics data that `graphql-go-tools` collects during request +execution and makes available to the router via `resolve.CacheAnalyticsSnapshot`. This data can +be used to build an entity cache analytics pipeline in a future PR. + +## How to Enable Collection + +Set `EnableCacheAnalytics: true` in `resolve.CachingOptions` when executing a request. After +execution, call `resolveCtx.GetCacheStats()` to obtain a `CacheAnalyticsSnapshot`. + +The router already does this when entity cache OTEL metrics are configured (see +`graphql_handler.go:cachingOptions` and `graphql_handler.go:recordEntityCacheMetrics`). + +## CacheAnalyticsSnapshot Fields + +The snapshot is a read-only struct returned by the analytics collector after request execution. + +### Cache Read Events + +| Field | Type | Description | +|-------|------|-------------| +| `L1Reads` | `[]CacheKeyEvent` | L1 (in-memory, per-request) cache key lookup results | +| `L2Reads` | `[]CacheKeyEvent` | L2 (external, e.g. Redis) cache key lookup results | + +Each `CacheKeyEvent` contains: +- `CacheKey` — the full cache key string +- `EntityType` — entity type name (e.g. `"User"`) +- `Kind` — `CacheKeyHit`, `CacheKeyMiss`, or `CacheKeyPartialHit` +- `DataSource` — subgraph name (e.g. `"accounts"`) +- `ByteSize` — byte size of the cached value (hits only) +- `CacheAgeMs` — age of cached entry in ms (L2 hits only, 0 = unknown) +- `Shadow` — true if this event occurred in shadow mode + +### Cache Write Events + +| Field | Type | Description | +|-------|------|-------------| +| `L1Writes` | `[]CacheWriteEvent` | L1 cache write operations | +| `L2Writes` | `[]CacheWriteEvent` | L2 cache write operations | + +Each `CacheWriteEvent` contains: +- `CacheKey`, `EntityType`, `DataSource` — same as read events +- `ByteSize` — byte size of the value written +- `CacheLevel` — `CacheLevelL1` or `CacheLevelL2` +- `TTL` — configured TTL for this write +- `Shadow` — true if this write occurred in shadow mode + +### Fetch Timing Events + +| Field | Type | Description | +|-------|------|-------------| +| `FetchTimings` | `[]FetchTimingEvent` | Duration of each subgraph fetch or cache lookup | + +Each `FetchTimingEvent` contains: +- `DataSource` — subgraph name +- `EntityType` — entity type (empty for root fetches) +- `DurationMs` — time spent in milliseconds +- `Source` — `FieldSourceSubgraph`, `FieldSourceL1`, `FieldSourceL2`, or `FieldSourceShadowCached` +- `ItemCount` — number of entities in this fetch/lookup +- `IsEntityFetch` — true for `_entities` fetches, false for root fields +- `HTTPStatusCode` — HTTP status from subgraph response (0 for cache hits) +- `ResponseBytes` — response body size in bytes (0 for cache hits) +- `TTFBMs` — time to first byte in milliseconds (0 when unavailable) + +### Subgraph Error Events + +| Field | Type | Description | +|-------|------|-------------| +| `ErrorEvents` | `[]SubgraphErrorEvent` | Errors encountered during subgraph fetches | + +Each `SubgraphErrorEvent` contains: +- `DataSource` — subgraph name +- `EntityType` — entity type (empty for root fetches) +- `Message` — error message (truncated for safety) +- `Code` — error code from `errors[0].extensions.code` + +### Field Value Hashes + +| Field | Type | Description | +|-------|------|-------------| +| `FieldHashes` | `[]EntityFieldHash` | xxhash of scalar field values on entities | + +Each `EntityFieldHash` contains: +- `EntityType`, `FieldName` — which field on which entity +- `FieldHash` — xxhash of the non-key field value +- `KeyRaw` — raw key JSON e.g. `{"id":"1234"}` (when `HashKeys=false`) +- `KeyHash` — xxhash of key JSON (when `HashKeys=true`) +- `Source` — where the entity data came from (L1/L2/Subgraph) + +> **Security: `KeyRaw` and `EntityCacheKey` are not safe to export as-is.** +> +> The `KeyRaw` field on `EntityFieldHash` and the `EntityCacheKey` field on +> `MutationEvent` contain the raw JSON representation of entity key fields. +> These values frequently carry user identifiers (user IDs, account numbers, +> email addresses, phone numbers, tenant IDs) that are subject to privacy +> regulations (GDPR, CCPA) and cross-boundary data-sharing contracts. +> +> - **Do not export `KeyRaw` / `EntityCacheKey` unredacted to external analytics +> sinks, object stores, or log aggregators.** Treat them as PII. +> - Prefer `KeyHash` (set `HashKeys=true` on the analytics config) for any +> cardinality/aggregation analysis — it is a stable, non-reversible xxhash. +> - If you need to emit raw keys for an internal debugging sink, gate them +> behind an explicit opt-in and apply your organization's redaction policy +> before transport. +> - The router emits these fields into the in-memory `CacheAnalyticsSnapshot` +> by default; downstream exporters are responsible for filtering or hashing +> before upload. Treat "export" as an explicit decision, not a default. + +### Entity Type Tracking + +| Field | Type | Description | +|-------|------|-------------| +| `EntityTypes` | `[]EntityTypeInfo` | Entity types encountered and their counts | + +Each `EntityTypeInfo` contains: +- `TypeName` — entity type name +- `Count` — total instances encountered +- `UniqueKeys` — number of distinct entity keys + +### Shadow Mode Events + +| Field | Type | Description | +|-------|------|-------------| +| `ShadowComparisons` | `[]ShadowComparisonEvent` | Comparisons between cached and fresh data | + +Each `ShadowComparisonEvent` contains: +- `CacheKey`, `EntityType`, `DataSource` — identification +- `IsFresh` — true if ProvidesData fields match between cached and fresh +- `CachedHash`, `FreshHash` — xxhash of ProvidesData fields +- `CachedBytes`, `FreshBytes` — byte sizes +- `CacheAgeMs` — age of the cached entry +- `ConfiguredTTL` — TTL configured for this entity type + +### Mutation Events + +| Field | Type | Description | +|-------|------|-------------| +| `MutationEvents` | `[]MutationEvent` | Mutations that returned cacheable entities | + +Each `MutationEvent` contains: +- `MutationRootField` — e.g. `"updateUsername"` +- `EntityType` — e.g. `"User"` +- `EntityCacheKey` — display key e.g. `{"__typename":"User","key":{"id":"1234"}}` +- `HadCachedValue` — true if L2 had a cached value +- `IsStale` — true if cached value differs from mutation response +- `CachedHash`, `FreshHash` — xxhash of ProvidesData fields +- `CachedBytes`, `FreshBytes` — byte sizes + +### Header Impact Events + +| Field | Type | Description | +|-------|------|-------------| +| `HeaderImpactEvents` | `[]HeaderImpactEvent` | L2 writes with header-prefixed keys | + +Each `HeaderImpactEvent` contains: +- `BaseKey` — cache key WITHOUT header prefix (grouping key) +- `HeaderHash` — hash of forwarded headers for this subgraph +- `ResponseHash` — xxhash of the response value bytes written to L2 +- `EntityType`, `DataSource` — identification + +**Usage:** When the same `BaseKey` appears with different `HeaderHash` values but identical +`ResponseHash` values, the forwarded headers don't affect the response and +`IncludeSubgraphHeaderPrefix` can be disabled for that subgraph. + +## Computed Convenience Methods + +The snapshot provides these computed methods: + +| Method | Returns | Description | +|--------|---------|-------------| +| `L1HitRate()` | `float64` | L1 hit rate in [0,1] | +| `L2HitRate()` | `float64` | L2 hit rate in [0,1] | +| `CachedBytesServed()` | `int64` | Total bytes served from L1+L2 hits | +| `EventsByEntityType()` | `map[string]EntityTypeCacheStats` | Per-entity-type cache stats | +| `EventsByDataSource()` | `map[string]DataSourceCacheStats` | Per-data-source cache stats | +| `SubgraphCallsAvoided()` | `int64` | Number of subgraph fetches avoided by cache | +| `PartialHitRate()` | `float64` | Fraction of lookups that were partial hits | +| `ErrorsByDataSource()` | `map[string]int` | Error counts grouped by subgraph | +| `ErrorRate()` | `float64` | Fraction of fetches that errored | +| `AvgFetchDurationMs(ds)` | `int64` | Average fetch duration for a data source | +| `TotalTimeSavedMs()` | `int64` | Estimated time saved by cache hits | +| `AvgCacheAgeMs(type)` | `int64` | Average L2 cache entry age | +| `MaxCacheAgeMs()` | `int64` | Max L2 cache entry age | +| `ShadowFreshnessRate()` | `float64` | Fraction of shadow hits where data was fresh | +| `ShadowStaleCount()` | `int64` | Number of stale shadow comparisons | +| `ShadowFreshnessRateByEntityType()` | `map[string]float64` | Per-entity-type freshness rates | + +## Integration Points in the Router + +The analytics data flows through these points: + +1. **`graphql_handler.go:cachingOptions()`** — sets `EnableCacheAnalytics` on `resolve.CachingOptions` +2. **`graphql_handler.go:recordEntityCacheMetrics()`** — after execution, calls `resolveCtx.GetCacheStats()` + and passes snapshot to OTEL metrics. **This is where an analytics exporter should be added.** +3. **`graph_server.go`** — passes metrics and handler options to the GraphQL handler +4. **`router.go`** — sets up exporters during router initialization + +## Implementation Notes for Future Analytics Pipeline + +- The snapshot is available per-request; an analytics pipeline should aggregate across requests + before exporting (e.g. group by operation hash + client + schema version) +- Consider a batched async exporter (similar to `graphqlmetrics`) to avoid adding latency +- The `OperationMeta` (operation hash, name, type, client info, schema version) can be extracted + from `requestContext` at the same call site +- Field hashes enable cross-request change detection (same entity key, different field hash = data changed) +- Header impact events enable automated detection of unnecessary `IncludeSubgraphHeaderPrefix` configs +- Shadow comparison events are key for validating TTL tuning before going live diff --git a/docs/entity-caching/configuration.md b/docs/entity-caching/configuration.md new file mode 100644 index 0000000000..2becfb5039 --- /dev/null +++ b/docs/entity-caching/configuration.md @@ -0,0 +1,402 @@ +# Entity Caching Configuration + +This document defines the operational configuration for entity caching in the cosmo router. For directive definitions, see [directives.md](./directives.md). + +--- + +## Router YAML Configuration + +Entity caching configuration lives under the `entity_caching` key in the router YAML config. It follows existing router config patterns: + +- Storage references a named provider from `storage_providers.redis` or `storage_providers.memory` (like `persisted_operations.storage.provider_id`) +- Per-subgraph overrides use an array of subgraph rules (like `cache_control_policy.subgraphs`) +- Metrics integrate with the existing `telemetry.metrics` system (like `graphql_cache`) + +### Configuration Structure + +```yaml +entity_caching: + enabled: false + global_cache_key_prefix: "" # Prefix for all L2 keys (e.g., schema hash for versioning) + l1: + enabled: true + max_size: "100MB" # 100MB default + l2: + enabled: true + storage: + provider_id: "default" # References a storage_providers.redis or .memory entry + key_prefix: "cosmo_entity_cache" + circuit_breaker: + enabled: false # Circuit breaker for L2 cache operations + failure_threshold: 5 # Consecutive failures before opening + cooldown_period: "10s" # How long to stay open before probing + subgraph_cache_overrides: + - name: "products" + storage_provider_id: "fast-cache" # All entities in this subgraph use "fast-cache" + entities: + - type: "Product" + storage_provider_id: "hot-cache" # Override: this entity uses "hot-cache" instead + - name: "accounts" + entities: + - type: "User" + storage_provider_id: "persistent-cache" +``` + +### Configuration Reference + +#### Top-Level + +| Field | Type | Default | Env | Description | +|-------|------|---------|-----|-------------| +| `enabled` | bool | false | `ENTITY_CACHING_ENABLED` | Global enable/disable for entity caching. When false, all caching directives are ignored. | +| `global_cache_key_prefix` | string | "" | `ENTITY_CACHING_GLOBAL_CACHE_KEY_PREFIX` | Prefix prepended to all L2 cache keys (before header hash prefix). Use for schema versioning: set to a schema hash so that schema changes automatically separate cache entries without requiring a cache flush. Format: `{prefix}:{rest_of_key}`. Empty string means no prefix. | + +#### L1 Cache + +The L1 cache is an in-memory per-request cache. It deduplicates entity fetches within a single request — if the same entity is needed multiple times during query resolution, it is fetched once. L1 is a `sync.Map` and only covers entity fetches (not root fields). + +| Field | Type | Default | Env | Description | +|-------|------|---------|-----|-------------| +| `l1.enabled` | bool | true | `ENTITY_CACHING_L1_ENABLED` | Enable/disable L1 per-request in-memory cache. | +| `l1.max_size` | string | "100MB" | `ENTITY_CACHING_L1_MAX_SIZE` | Maximum size of the L1 cache. Supports human-readable byte strings (e.g., "100MB", "1GB"). | + +#### L2 Cache + +The L2 cache is a cross-request cache shared across all requests. It stores entity and root field data with TTL. L2 supports two storage backends: + +- **Redis** (`storage_providers.redis`): External shared cache across router instances. Recommended for production. +- **Memory** (`storage_providers.memory`): In-process cache using [Ristretto](https://github.com/dgraph-io/ristretto). Not shared across instances — useful for development, testing, or single-instance deployments. Memory providers can **only** be used for entity caching — they cannot be referenced by persisted operations, execution config, APQ, MCP, or ConnectRPC storage. + +| Field | Type | Default | Env | Description | +|-------|------|---------|-----|-------------| +| `l2.enabled` | bool | true | `ENTITY_CACHING_L2_ENABLED` | Enable/disable L2 external cache. | +| `l2.storage.provider_id` | string | "" | `ENTITY_CACHING_L2_STORAGE_PROVIDER_ID` | References a `storage_providers.redis` or `storage_providers.memory` entry by ID. | +| `l2.storage.key_prefix` | string | "cosmo_entity_cache" | `ENTITY_CACHING_L2_STORAGE_KEY_PREFIX` | Prefix for all entity cache keys in the storage backend. | + +#### L2 Circuit Breaker + +The circuit breaker protects against cascading latency when the L2 cache backend (e.g., Redis) is slow or unavailable. When the breaker trips, all L2 operations (Get/Set/Delete) are skipped and the engine falls back to direct subgraph fetches. The breaker applies per named cache instance. + +| Field | Type | Default | Env | Description | +|-------|------|---------|-----|-------------| +| `l2.circuit_breaker.enabled` | bool | false | `ENTITY_CACHING_L2_CIRCUIT_BREAKER_ENABLED` | Enable/disable the L2 circuit breaker. | +| `l2.circuit_breaker.failure_threshold` | int | 5 | `ENTITY_CACHING_L2_CIRCUIT_BREAKER_FAILURE_THRESHOLD` | Number of consecutive L2 operation failures that trips the breaker. | +| `l2.circuit_breaker.cooldown_period` | duration | "10s" | `ENTITY_CACHING_L2_CIRCUIT_BREAKER_COOLDOWN_PERIOD` | How long the breaker stays open before allowing a probe request. After cooldown, one request is allowed through (half-open state). If it succeeds, the breaker closes; if it fails, it re-opens. | + +**States:** +- **Closed**: All L2 operations pass through normally. +- **Open**: All L2 operations are skipped (fall back to subgraph fetch). Entered after `failure_threshold` consecutive failures. +- **Half-Open**: After `cooldown_period` elapses, one probe request is allowed. Success → Closed, Failure → Open. + +The `provider_id` references a storage provider defined in the top-level `storage_providers` section. The router checks `storage_providers.memory` first, then `storage_providers.redis`: + +```yaml +storage_providers: + redis: + - id: "default" + urls: + - "redis://localhost:6379" + cluster_enabled: false + - id: "fast-cache" + urls: + - "redis://fast-redis:6379" + cluster_enabled: false + memory: + - id: "dev-cache" + max_size: "100MB" # Maximum cache size (default: 100MB) + # Note: memory providers can only be used for entity caching +``` + +#### Metrics + +Entity cache metrics are automatically reported when entity caching is enabled (`entity_caching.enabled: true`). They are exported via the same OTLP and Prometheus exporters configured in `telemetry.metrics`, following the existing `router.graphql.cache.*` pattern. + +| Metric | Type | Labels | Description | +|--------|------|--------|-------------| +| `router.entity_cache.requests.stats` | Counter | `type` (hits/misses), `cache_level` (l1/l2), `cache_type` (entity/root_field) | Cache request statistics. Hit/miss counts per cache level and type. | +| `router.entity_cache.keys.stats` | Counter | `operation` (added/updated/evicted), `cache_type` | Key lifecycle statistics. | +| `router.entity_cache.latency` | Histogram | `cache_level` (l2), `operation` (get/set/delete) | L2 cache operation latency in milliseconds. | +| `router.entity_cache.invalidations` | Counter | `source` (mutation/subscription/extension) | Cache invalidation counts by trigger source. | +| `router.entity_cache.populations` | Counter | `source` (mutation/subscription/query) | Cache population counts by trigger source. | +| `router.entity_cache.shadow.staleness` | Counter | `cache_type` | Shadow mode: count of requests where cached data differed from fresh data. | +| `router.entity_cache.operation_errors` | Counter | `operation` (get/set/set_negative/delete), `cache_name`, `entity_type` | Cache operation errors (Get/Set/Delete failures). Cache errors are non-fatal (engine falls back to subgraph fetch), but tracking them allows operators to detect cache infrastructure issues. | + +#### Per-Subgraph Storage Provider Overrides + +Cache backend assignment is an operator concern — subgraph developers shouldn't need to know about the cache infrastructure topology. Operators assign cache backends to subgraphs or specific entity types via `subgraph_cache_overrides`. + +| Field | Type | Default | Description | +|-------|------|---------|-------------| +| `subgraph_cache_overrides[].name` | string | required | Subgraph name (must match a subgraph in the router config). | +| `subgraph_cache_overrides[].storage_provider_id` | string | "" | Storage provider for all entities in this subgraph (unless overridden per-entity). References a `storage_providers.redis` or `storage_providers.memory` entry by ID. | +| `subgraph_cache_overrides[].entities[].type` | string | required | Entity type name (must be a type with `@openfed__entityCache` in this subgraph). | +| `subgraph_cache_overrides[].entities[].storage_provider_id` | string | "" | Storage provider for this specific entity type. Overrides the subgraph-level `storage_provider_id`. | + +**Resolution order:** When the router needs a storage provider for a given entity type in a subgraph, it resolves using a 3-tier lookup: + +1. **Entity-level override**: `subgraph_cache_overrides[name].entities[type].storage_provider_id` +2. **Subgraph-level override**: `subgraph_cache_overrides[name].storage_provider_id` +3. **Global default**: `"default"` (the cache built from `l2.storage.provider_id`) + +The first non-empty match wins. If no override is configured, the entity uses the default cache. + +**Example resolution:** +```text +Entity "Category" in subgraph "products": + 1. Entity-level: storage_provider_id = "hot-cache" → uses "hot-cache" + +Entity "Product" in subgraph "products": + 1. Entity-level: not configured + 2. Subgraph-level: storage_provider_id = "fast-cache" → uses "fast-cache" + +Entity "Order" (not in any override): + 1. Entity-level: not configured + 2. Subgraph-level: not configured + 3. Global default: l2.storage.provider_id = "default" → uses "default" +``` + +**Behavior summary:** + +| Scenario | Behavior | +|----------|----------| +| Entity not in overrides, subgraph not in overrides | Uses global `l2.storage.provider_id` | +| Entity not in overrides, subgraph has `storage_provider_id` | Uses subgraph-level provider | +| Entity has `storage_provider_id` | Uses entity-level provider (highest priority) | +| Override references unknown subgraph | Warning log, router starts normally | +| Override references unknown entity type | Warning log, router starts normally | +| `storage_provider_id` references unknown provider | **Error** — router fails to start | +| Memory provider as default, Redis for overrides | Supported — mix freely | +| Redis provider as default, memory for overrides | Supported — mix freely | + +```yaml +entity_caching: + enabled: true + l2: + storage: + provider_id: "default" # Global default backend + subgraph_cache_overrides: + - name: "products" + storage_provider_id: "fast-cache" # All products entities → fast-cache + entities: + - type: "Product" + storage_provider_id: "hot-cache" # Exception: Product → hot-cache + - type: "Review" # No override → inherits "fast-cache" from subgraph + - name: "accounts" + entities: + - type: "User" + storage_provider_id: "persistent-cache" # No subgraph default → User → persistent-cache + # Other account entities → global default +``` + +--- + +## Custom Module: Entity Cache Key Interceptor + +The L2 cache key can be transformed per-request using a custom module. This enables use cases like tenant isolation, A/B testing, or any scenario where the same entity should have different cache entries based on request context. + +### Module Interface + +A new module interface is added to the router's custom module system (following the pattern of `EnginePreOriginHandler`, `RouterMiddlewareHandler`, etc.): + +```go +// EntityCacheKeyInterceptor allows custom modules to transform entity cache keys +// before they are used for L2 cache operations. The interceptor receives a batch +// of keys because the underlying LoaderCache interface is batch-oriented: +// Get(keys []string), Set(entries []*CacheEntry), Delete(keys []string). +// +// The interceptor is called once per cache operation (Get, Set, or Delete) with +// the full batch of keys for that operation. +type EntityCacheKeyInterceptor interface { + // OnEntityCacheKeys transforms a batch of cache keys for an entity cache operation. + // Each key is a JSON-encoded entity key or root field key. + // Returns the transformed keys in the same order. The returned slice must have + // the same length as the input slice. + OnEntityCacheKeys(keys [][]byte, ctx RequestContext) [][]byte +} +``` + +**Why batch?** The `LoaderCache` interface operates on batches — `Get(ctx, keys []string)` fetches multiple entities in a single Redis `MGET` call, `Set(ctx, entries []*CacheEntry)` writes multiple entries in a pipelined `SET`, and `Delete(ctx, keys []string)` removes multiple entries in a pipelined `DEL`. The interceptor receives the full batch so it can apply transformations efficiently (e.g., compute a shared prefix once and apply it to all keys, rather than re-computing per key). + +### Lifecycle + +- The interceptor is discovered during `router.initModules()` like all other module interfaces +- It is called for every L2 cache `Get`, `Set`, and `Delete` operation with the full batch of keys +- Multiple modules implementing this interface are called in priority order (lower priority = earlier execution) +- The output of one interceptor is the input to the next +- The returned slice must maintain the same length and order as the input (the cache uses positional correspondence to match keys to results) + +### Example Module + +```go +package module + +import ( + "crypto/sha256" + "encoding/hex" + "fmt" + + "github.com/wundergraph/cosmo/router/core" + "go.uber.org/zap" +) + +const tenantCacheModuleID = "tenant-cache-isolation" + +// TenantCacheIsolation prefixes entity cache keys with a tenant identifier +// extracted from the request headers, ensuring cache isolation between tenants. +type TenantCacheIsolation struct { + TenantHeader string `mapstructure:"tenant_header"` + Logger *zap.Logger +} + +func (m *TenantCacheIsolation) Module() core.ModuleInfo { + return core.ModuleInfo{ + ID: tenantCacheModuleID, + Priority: 1, + New: func() core.Module { + return &TenantCacheIsolation{} + }, + } +} + +func (m *TenantCacheIsolation) Provision(ctx *core.ModuleContext) error { + if m.TenantHeader == "" { + m.TenantHeader = "X-Tenant-ID" + } + m.Logger = ctx.Logger + return nil +} + +// OnEntityCacheKeys prefixes all cache keys in the batch with a hash of the tenant ID +func (m *TenantCacheIsolation) OnEntityCacheKeys(keys [][]byte, ctx core.RequestContext) [][]byte { + tenantID := ctx.Request().Header.Get(m.TenantHeader) + if tenantID == "" { + return keys // No tenant header, use original keys + } + // Compute prefix once for the entire batch + hash := sha256.Sum256([]byte(tenantID)) + prefix := hex.EncodeToString(hash[:8]) // 16-char hex prefix + result := make([][]byte, len(keys)) + for i, key := range keys { + result[i] = []byte(fmt.Sprintf("%s:%s", prefix, key)) + } + return result +} + +// Interface guards +var ( + _ core.Module = (*TenantCacheIsolation)(nil) + _ core.Provisioner = (*TenantCacheIsolation)(nil) + _ core.EntityCacheKeyInterceptor = (*TenantCacheIsolation)(nil) +) +``` + +### Router YAML Configuration + +```yaml +modules: + tenant-cache-isolation: + tenant_header: "X-Tenant-ID" +``` + +### Registration + +The module is registered in the custom router binary: + +```go +func main() { + core.RegisterModule(&module.TenantCacheIsolation{}) + // ... start router +} +``` + +--- + +## Subgraph Extension-Based Invalidation + +In addition to directive-based invalidation (`@openfed__cacheInvalidate`), subgraphs can signal cache invalidation at runtime through GraphQL response extensions. This does not require any directive — it is a runtime protocol between the subgraph and the router. + +### Protocol + +A subgraph includes invalidation hints in its response `extensions` field: + +```json +{ + "data": { "updateUser": { "id": "1", "name": "Updated" } }, + "extensions": { + "cacheInvalidation": { + "keys": [ + { "typename": "User", "key": { "id": "1" } }, + { "typename": "User", "key": { "id": "2" } } + ] + } + } +} +``` + +### Behavior + +1. The router inspects the `extensions.cacheInvalidation` field in every subgraph response +2. For each entry in `keys`, the router builds the full cache key (with all transformations applied — global prefix, header hashing, module interceptors if applicable) +3. The corresponding L2 entries are deleted +4. This allows subgraphs to invalidate cache entries for entities that weren't directly returned in the mutation response + +### Requirements + +- The entity type referenced in `typename` must have `@openfed__entityCache` configured in at least one subgraph. The router needs the cache configuration to determine which cache backend and key format to use. +- The `key` object must contain all `@key` fields for the entity type. +- Extension-based invalidation works regardless of the operation type (query, mutation, or subscription). + +### Use Cases + +- **Cascading invalidation**: A mutation on `Order` also invalidates related `OrderItem` entities that weren't returned in the response. +- **Batch invalidation**: A bulk update operation invalidates multiple entities at once. +- **Cross-entity invalidation**: Updating a `Product` price invalidates cached `PriceHistory` entities. + +--- + +## Complete Router YAML Example + +```yaml +version: "1" + +storage_providers: + redis: + - id: "default" + urls: + - "redis://localhost:6379" + cluster_enabled: false + - id: "fast-cache" + urls: + - "redis://fast-redis:6379" + cluster_enabled: false + memory: + - id: "dev-cache" + max_size: "100MB" + +entity_caching: + enabled: true + global_cache_key_prefix: "v1" # Schema version prefix for all L2 keys + l1: + enabled: true + max_size: "100MB" # 100MB + l2: + enabled: true + storage: + provider_id: "default" + key_prefix: "cosmo_entity_cache" + circuit_breaker: + enabled: true + failure_threshold: 5 + cooldown_period: "10s" + subgraph_cache_overrides: + - name: "products" + storage_provider_id: "fast-cache" # All product entities → fast Redis + entities: + - type: "Product" + storage_provider_id: "dev-cache" # Exception: Product → in-memory cache + +# Optional: custom module for cache key transformation +modules: + tenant-cache-isolation: + tenant_header: "X-Tenant-ID" +``` diff --git a/docs/entity-caching/directives.md b/docs/entity-caching/directives.md new file mode 100644 index 0000000000..dedef982c9 --- /dev/null +++ b/docs/entity-caching/directives.md @@ -0,0 +1,491 @@ +# Entity Caching Directives + +This document defines the GraphQL directives for configuring entity caching in cosmo federation subgraphs. + +--- + +## Design Principles + +1. **Subgraph developers declare what to cache.** Directives express freshness requirements and data relationships. +2. **Flat arguments.** Following ecosystem convention, directive arguments use scalars, enums, and simple lists — no nested input objects. +3. **Seconds for TTL.** All frameworks (Apollo `@cacheControl`, Stellate `@stellate_cache`, Hasura `@cached`) use seconds. We follow this convention. +4. **Separate directives per concern.** Each directive has a single, clear purpose rather than one overloaded directive with context-dependent behavior. +5. **Mutual exclusivity.** A field either invalidates or populates the cache — never both. +6. **`@openfed__` prefix.** All entity-caching directives use the `@openfed__` prefix (e.g. +`@openfed__entityCache`, +`@openfed__queryCache`, +`@openfed__is`). + +--- + +## Directives + +### 1. `@openfed__entityCache` — Entity Type Caching + +Declares that instances of this entity type should be cached when resolved via `_entities` queries. + +```graphql +directive @openfed__entityCache( + maxAge: Int! + negativeCacheTTL: Int = 0 + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT +``` + +**Not repeatable.** Each entity type may have at most one `@openfed__entityCache` directive. + +**Arguments:** + +| Argument | Type | Default | Description | +|----------|------|---------|-------------| +| `maxAge` | Int! | required | TTL in seconds. How long a cached entity remains valid. **Must be > 0.** Composition rejects zero or negative values (`maxAgeNotPositiveIntegerErrorMessage`) so the router never sees an invalid TTL at runtime. | +| `negativeCacheTTL` | Int | 0 | TTL in seconds for caching null entity results (entity not found). When > 0, null responses from `_entities` (entity returned null without errors) are cached as negative sentinels to avoid repeated subgraph lookups for non-existent entities. When 0 (default), null entities are not cached. Use shorter TTLs than `maxAge` (e.g., 5-10s) so deleted entities are re-checked sooner. **Negative values are rejected at composition time.** | +| `includeHeaders` | Boolean | false | When true, forwarded HTTP headers are hashed and included in the cache key. Use for multi-tenant scenarios where the same entity ID may return different data depending on request headers (e.g., authorization token, tenant header). | +| `partialCacheLoad` | Boolean | false | Controls batch miss behavior. When false (default): any miss in a batch refetches ALL entities (maximum freshness). When true: only missing entities are fetched (reduced subgraph load, within-TTL staleness acceptable). | +| `shadowMode` | Boolean | false | When true, L2 reads and writes happen but cached data is never served. Fresh data is always fetched from the subgraph. Use for testing caching behavior (hit rates, staleness) before enabling it in production. | + +**Example:** + +```graphql +# Basic: cache User entities for 5 minutes +type User @key(fields: "id") @openfed__entityCache(maxAge: 300) { + id: ID! + name: String! + email: String! +} + +# Multi-tenant: include auth headers in cache key +type Account @key(fields: "id") @openfed__entityCache(maxAge: 600, includeHeaders: true) { + id: ID! + balance: Float! +} + +# High-throughput: only fetch missing entities in batch +type Product @key(fields: "upc") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) { + upc: String! + name: String! + price: Float! + inStock: Boolean! +} + +# Shadow mode: test caching without serving cached data +type Inventory @key(fields: "sku") @openfed__entityCache(maxAge: 60, shadowMode: true) { + sku: String! + quantity: Int! +} + +# Negative caching: cache "not found" for 10 seconds to avoid repeated lookups +type Product @key(fields: "upc") @openfed__entityCache(maxAge: 600, negativeCacheTTL: 10) { + upc: String! + name: String! + price: Float! +} + +# Composite key +type OrderItem @key(fields: "orderId itemId") @openfed__entityCache(maxAge: 60) { + orderId: ID! + itemId: ID! + quantity: Int! +} +``` + +**Cache key format:** +```json +{"__typename":"User","key":{"id":"123"}} +{"__typename":"Product","key":{"upc":"top-1"}} +{"__typename":"OrderItem","key":{"itemId":"42","orderId":"1"}} +``` + +--- + +### 2. `@openfed__queryCache` — Root Query Field Caching + +Declares that the result of a root query field should be cached. The field must return an entity type (or list of entities). The cache uses entity key format, enabling sharing between root field queries and `_entities` fetches. + +```graphql +directive @openfed__queryCache( + maxAge: Int! + includeHeaders: Boolean = false + shadowMode: Boolean = false +) on FIELD_DEFINITION +``` + +**Not repeatable.** + +**Arguments:** + +| Argument | Type | Default | Description | +|----------|------|---------|-------------| +| `maxAge` | Int! | required | TTL in seconds. | +| `includeHeaders` | Boolean | false | Include forwarded headers in cache key. | +| `shadowMode` | Boolean | false | When true, caching runs in shadow mode (reads/writes happen but cached data is never served). | + +**Argument-to-Key Mapping:** + +When a `@openfed__queryCache` field returns an entity, composition maps field arguments to `@key` fields to enable cache sharing: + +1. **Auto-mapping**: If a field argument name matches a `@key` field name exactly, the mapping is automatic. +2. **Explicit mapping with `@openfed__is`**: When argument names differ from `@key` field names, use the `@openfed__is` directive on the argument to declare the mapping. +3. **Composition warning (cache reads disabled for this field)**: If any `@key` field cannot be mapped to an argument (neither by name match nor `@openfed__is`), +composition emits a warning and disables cache reads/population for this field. +The subgraph still composes successfully, +but the field behaves as if it had no `@openfed__queryCache` directive at runtime. + +**Single Entity Return:** + +When a field returns a single entity type and all `@key` fields can be mapped to arguments, the cache key uses entity key format: +- A `@openfed__queryCache` hit for `user(id: "123")` also serves a subsequent `_entities` fetch for `User(id: "123")` +- An `@openfed__entityCache` write for `User(id: "123")` also serves a subsequent `user(id: "123")` query + +**List Entity Return:** + +When a field returns a list of entities (e.g., `[Product!]!`), each entity in the result is individually cached using its own entity key. This maps to a list of entity keys — one per entity in the result. Each cached entity is shared with `_entities` fetches. + +**No-Argument Fields:** + +When a field has no arguments (e.g., `me: User`), it uses root field cache key format since there are no arguments to map to entity keys. + +**Example:** + +```graphql +type User @key(fields: "id") @openfed__entityCache(maxAge: 300) { + id: ID! + name: String! + email: String! +} + +type Product @key(fields: "upc") @openfed__entityCache(maxAge: 600) { + upc: String! + name: String! + price: Float! +} + +type OrderItem @key(fields: "orderId itemId") @openfed__entityCache(maxAge: 60) { + orderId: ID! + itemId: ID! + quantity: Int! +} + +type Query { + # Auto-mapped: argument "id" matches User @key field "id" + # Cache key: {"__typename":"User","key":{"id":"123"}} + user(id: ID!): User @openfed__queryCache(maxAge: 300) + + # Explicit mapping: argument "userId" does NOT match User @key field "id" + # @openfed__is maps "userId" → "id" + # Cache key: {"__typename":"User","key":{"id":"123"}} + userById(userId: ID! @openfed__is(fields: "id")): User @openfed__queryCache(maxAge: 300) + + # Auto-mapped composite key: both argument names match @key fields + # Cache key: {"__typename":"OrderItem","key":{"orderId":"1","itemId":"42"}} + orderItem(orderId: ID!, itemId: ID!): OrderItem @openfed__queryCache(maxAge: 60) + + # List return: each Product in the result is cached individually + # Cache keys: [{"__typename":"Product","key":{"upc":"top-1"}}, ...] + topProducts(first: Int = 5): [Product!]! @openfed__queryCache(maxAge: 30) + + # No arguments, returns entity: uses root field cache key format + # Cache key: {"__typename":"Query","field":"me"} + me: User @openfed__queryCache(maxAge: 60, includeHeaders: true) +} +``` + +**Cache key format (entity-mapped — single entity return with mapped args):** +```json +{"__typename":"User","key":{"id":"123"}} +{"__typename":"OrderItem","key":{"orderId":"1","itemId":"42"}} +``` + +**Cache key format (list return — list of entity keys):** +```json +[ + {"__typename":"Product","key":{"upc":"top-1"}}, + {"__typename":"Product","key":{"upc":"top-2"}} +] +``` + +**Cache key format (no-argument field — root field format):** +```json +{"__typename":"Query","field":"me"} +``` + +--- + +### 3. `@openfed__is` — Argument-to-Key Field Mapping + +Maps a query field argument to an entity `@key` field when the names don't match. Used together with `@openfed__queryCache` to enable cache key sharing. + +```graphql +directive @openfed__is( + fields: String! +) on ARGUMENT_DEFINITION +``` + +**Arguments:** + +| Argument | Type | Default | Description | +|----------|------|---------|-------------| +| `fields` | String! | required | The `@key` field name (or composite/nested field set) on the return entity type that this argument maps to. | + +**Example:** + +```graphql +type Product @key(fields: "upc") @openfed__entityCache(maxAge: 600) { + upc: String! + name: String! +} + +type Query { + # Argument "productUpc" does not match @key field "upc" + # @openfed__is explicitly maps it + product(productUpc: String! @openfed__is(fields: "upc")): Product @openfed__queryCache(maxAge: 600) + + # Without @openfed__is, this would be a composition error: + # "Field 'Query.product' has @openfed__queryCache but argument 'productUpc' + # cannot be mapped to Product @key field 'upc'. Use @openfed__is(fields: "upc") + # on the argument to declare the mapping." +} +``` + +--- + +### 4. `@openfed__cacheInvalidate` — Cache Invalidation + +Declares that after this field completes, the cached entity should be deleted from L2. + +```graphql +directive @openfed__cacheInvalidate on FIELD_DEFINITION +``` + +No arguments. **Not repeatable.** + +**Behavior:** +- **On mutations:** After the mutation completes and returns entity data containing `@key` fields, the corresponding L2 cache entry is deleted. The engine extracts the key field values from the mutation response to build the exact cache key to delete. +- **On subscriptions:** When a subscription event arrives containing entity data with `@key` fields, the corresponding L2 cache entry is deleted. Use this for "entity deleted" or "entity changed" events where you want to ensure stale data is evicted. + +**Example:** + +```graphql +type Mutation { + # After update completes, User(id: "123") is deleted from L2 + updateUser(id: ID!, name: String!): User @openfed__cacheInvalidate + + # After delete completes, Product(upc: "abc") is deleted from L2 + deleteProduct(upc: String!): Product @openfed__cacheInvalidate +} + +type Subscription { + # When a product deletion event arrives, delete it from L2 + productDeleted: Product @openfed__cacheInvalidate + + # When a user changes, delete stale cache entry + userChanged: User @openfed__cacheInvalidate +} +``` + +--- + +### 5. `@openfed__cachePopulate` — Cache Population + +Declares that entity data from this field's execution should be written to the L2 cache. + +```graphql +directive @openfed__cachePopulate( + maxAge: Int +) on FIELD_DEFINITION +``` + +**Not repeatable.** + +**Arguments:** + +| Argument | Type | Default | Description | +|----------|------|---------|-------------| +| `maxAge` | Int | nil | TTL in seconds for cache entries populated by this field. When omitted, uses the `@openfed__entityCache` TTL from the return entity type. When provided, overrides the entity TTL for entries written by this field. | + +**Behavior:** +- **On mutations:** By default, mutations skip L2 reads AND writes. This directive enables L2 writes for entity fetches triggered during this mutation's execution. L2 reads remain skipped (mutations always fetch fresh data). After the mutation returns entity data, the freshly fetched entities are written to L2. +- **On subscriptions:** When a subscription event arrives containing entity data with `@key` fields and additional entity fields, the entity data is written to L2 cache. This keeps the cache warm as entities change in real time. + +**Example:** + +```graphql +type Mutation { + # After creating a review, entity fetches for the associated + # Product and User will be written to L2 cache + addReview(productUpc: String!, body: String!, stars: Int!): Review @openfed__cachePopulate + + # Override TTL: write to cache with 10-minute TTL instead of entity's 5-minute TTL + refreshUser(id: ID!): User @openfed__cachePopulate(maxAge: 600) +} + +type Subscription { + # Subscription events with full Product data are written to L2 cache + productPriceChanged: Product @openfed__cachePopulate + + # Override TTL for subscription-driven cache population + accountBalanceChanged: Account @openfed__cachePopulate(maxAge: 300) +} +``` + +--- + +## Validation Rules + +This section consolidates all composition-time validation rules. + +### `@openfed__entityCache` +1. Must be on a type with `@key`. Error: `"Type 'X' has @openfed__entityCache but no @key directive."` +2. At most one per type. Error: `"Type 'X' has multiple @openfed__entityCache directives."` +3. `maxAge` must be a positive integer. Error: `"@openfed__entityCache maxAge must be a positive integer, got 'N'."` +3a. `negativeCacheTTL`, if provided, must be a non-negative integer. Error: `"@openfed__entityCache negativeCacheTTL must be a non-negative integer, got 'N'."` + +### `@openfed__queryCache` +4. Only on fields of root `Query` type. Error: `"@openfed__queryCache is only valid on Query fields, found on Mutation.X / Subscription.X."` +5. Return type must be an entity (type with `@key`), or a list of entities. Error: `"Field 'Query.X' has @openfed__queryCache but returns non-entity type 'Y'. @openfed__queryCache requires the return type to be an entity with @key."` +6. The return entity type must have `@openfed__entityCache`. Error: `"Field 'Query.X' returns entity type 'Y' which does not have @openfed__entityCache."` +7. When returning a single entity: all `@key` fields must be mappable to field arguments (by name match or `@openfed__is`). Error: `"Field 'Query.X' has @openfed__queryCache returning 'Y' but @key field 'Z' cannot be mapped to any argument. Add an argument named 'Z' or use @openfed__is(fields: \"Z\") on an existing argument."` +8. When returning a list of entities: all `@key` fields must be mappable to field arguments (by name match or `@openfed__is`). Error: same as rule 7. Entity keys are extracted per-entity from the response, but the mapping must be complete for composition to validate correctness. +9. `maxAge` must be a positive integer. + +### `@openfed__is` +10. Only on arguments of fields that have `@openfed__queryCache`. Error: `"@openfed__is on argument 'X' of field 'Query.Y' has no effect without @openfed__queryCache."` +11. The `fields` value must reference a `@key` field on the return entity type. Error: `"@openfed__is(fields: \"X\") on argument 'Y' of field 'Query.Z' references unknown @key field 'X' on type 'W'."` +12. No duplicate mappings — two arguments must not map to the same `@key` field. Error: `"Multiple arguments on field 'Query.X' map to @key field 'Y'."` +13. An argument must not have `@openfed__is` if its name already matches a `@key` field. Error: `"Argument 'X' on field 'Query.Y' already matches @key field 'X' by name — @openfed__is is redundant."` + +### `@openfed__cacheInvalidate` +14. Only on fields of root `Mutation` or `Subscription` type. Error: `"@openfed__cacheInvalidate is only valid on Mutation or Subscription fields."` +15. Return type must be an entity with `@key` and `@openfed__entityCache`. Error: `"Field 'Mutation.X' has @openfed__cacheInvalidate but returns non-entity type 'Y'."` +16. Mutually exclusive with `@openfed__cachePopulate`. Error: `"Field 'Mutation.X' has both @openfed__cacheInvalidate and @openfed__cachePopulate. A field must use one or the other, not both."` + +### `@openfed__cachePopulate` +17. Only on fields of root `Mutation` or `Subscription` type. Error: `"@openfed__cachePopulate is only valid on Mutation or Subscription fields."` +18. Return type must be an entity with `@key` and `@openfed__entityCache`. Error: `"Field 'Subscription.X' has @openfed__cachePopulate but returns non-entity type 'Y'."` +19. Mutually exclusive with `@openfed__cacheInvalidate`. (Same error as rule 16.) +20. If `maxAge` is provided, must be a positive integer. + +--- + +## Composition Behavior + +### Directive Processing + +During composition, the directives are: +1. **Validated** — all rules from the Validation Rules section are checked +2. **Extracted** — argument values are parsed into internal data structures +3. **Output** — cache configurations are serialized into the `DataSourceConfiguration` entries of the router execution config (one config per subgraph) +4. **Stripped from federated schema** — like `@authenticated`, caching directives do not appear in the final federated/client schema. They are metadata for the router, not for clients. + +### Cross-subgraph TTL divergence + +Each subgraph declares its own `@openfed__entityCache(maxAge: N)` for an entity. +The composed router configuration carries per-datasource TTL entries, +and does not collapse matching entity type names into a single cache configuration. + +At runtime, the router uses the TTL from the datasource that produced the cache entry for that entity. +In the cache demo, `demo/cachegraph` declares `Article @openfed__entityCache(maxAge: 120)`, +while `demo/cachegraph-ext` declares `Article @openfed__entityCache(maxAge: 90)`. +The composed `demo/config-cache-only.json` keeps those as separate `entityCacheConfigurations` entries. + +For a shared entity type fetched from multiple subgraphs, align `maxAge` values in SDL when possible. +Different TTLs are valid, but they can produce surprising freshness skew across fields resolved by different subgraphs. + +--- + +## Directive Summary + +| Directive | Location | Repeatable | Purpose | Key Args | +|-----------|----------|------------|---------|----------| +| `@openfed__entityCache` | OBJECT | No | Cache entity type via `_entities` | maxAge, negativeCacheTTL, includeHeaders, partialCacheLoad, shadowMode | +| `@openfed__queryCache` | FIELD_DEFINITION | No | Cache root query field (entity return required) | maxAge, includeHeaders, shadowMode | +| `@openfed__is` | ARGUMENT_DEFINITION | No | Map argument to entity @key field | field | +| `@openfed__cacheInvalidate` | FIELD_DEFINITION | No | Delete L2 cache on mutation/subscription | (none) | +| `@openfed__cachePopulate` | FIELD_DEFINITION | No | Write to L2 cache on mutation/subscription | maxAge | + +--- + +## Complete Example + +### Subgraph: Accounts + +```graphql +extend schema + @link(url: "https://specs.apollo.dev/federation/v2.5", import: ["@key", "@shareable"]) + +type User @key(fields: "id") @openfed__entityCache(maxAge: 300) { + id: ID! + name: String! + email: String! +} + +type Query { + user(id: ID!): User @openfed__queryCache(maxAge: 300) + me: User @openfed__queryCache(maxAge: 60, includeHeaders: true) +} + +type Mutation { + updateUser(id: ID!, name: String!): User @openfed__cacheInvalidate + deleteUser(id: ID!): User @openfed__cacheInvalidate +} +``` + +### Subgraph: Products + +```graphql +extend schema + @link(url: "https://specs.apollo.dev/federation/v2.5", import: ["@key", "@shareable"]) + +type Product @key(fields: "upc") @openfed__entityCache(maxAge: 600, negativeCacheTTL: 10, partialCacheLoad: true) { + upc: String! + name: String! + price: Float! + inStock: Boolean! +} + +type Review @key(fields: "id") @openfed__entityCache(maxAge: 120) { + id: ID! + body: String! + product: Product! + author: User! + stars: Int! +} + +type Query { + topProducts(first: Int = 5): [Product!]! @openfed__queryCache(maxAge: 30) + product(upc: String!): Product @openfed__queryCache(maxAge: 600) + productByUpc(productUpc: String! @openfed__is(fields: "upc")): Product @openfed__queryCache(maxAge: 600) +} + +type Mutation { + addReview(productUpc: String!, body: String!, stars: Int!): Review @openfed__cachePopulate + updateProduct(upc: String!, price: Float!): Product @openfed__cacheInvalidate +} + +type Subscription { + productPriceChanged: Product @openfed__cachePopulate + productDeleted: Product @openfed__cacheInvalidate +} +``` + +--- + +## Ecosystem Comparison + +| Feature | Cosmo (proposed) | Apollo | Stellate | +|---------|-----------------|--------|----------| +| Entity type caching | `@openfed__entityCache(maxAge)` | `@cacheControl(maxAge)` | `@stellate_cache(maxAge)` | +| Root field caching | `@openfed__queryCache(maxAge)` | `@cacheControl(maxAge)` | `@stellate_cache(maxAge)` | +| Cache key sharing | Automatic via `@openfed__queryCache` + `@openfed__is` | Not available | Not available | +| Mutation invalidation | `@openfed__cacheInvalidate` | `@cacheTag` + HTTP endpoint | Not available | +| Mutation population | `@openfed__cachePopulate` | Not available | Not available | +| Subscription invalidation | `@openfed__cacheInvalidate` on Subscription | Not available | Not available | +| Subscription population | `@openfed__cachePopulate` on Subscription | Not available | Not available | +| Multi-tenant isolation | `includeHeaders: true` | Not available | `scope: "AUTHENTICATED"` | +| Partial batch loading | `partialCacheLoad: true` | Not available | Not available | +| Shadow mode | `shadowMode: true` | Not available | Not available | +| Negative caching | `negativeCacheTTL: Int` | Not available | Not available | +| SWR | Not yet (future) | Not available | `swr: Int` | +| TTL unit | Seconds | Seconds | Seconds | diff --git a/docs/entity-caching/engineering-brief.md b/docs/entity-caching/engineering-brief.md new file mode 100644 index 0000000000..815c32d7a4 --- /dev/null +++ b/docs/entity-caching/engineering-brief.md @@ -0,0 +1,600 @@ +# Entity Caching: Engineering Brief + +**Branch:** `jensneuse/entity-caching` (cosmo) + [graphql-go-tools PR #1259](https://github.com/wundergraph/graphql-go-tools/pull/1259) +**Scope:** ~40,000 lines added across 266 files spanning composition, proto, router, and the GraphQL engine + +--- + +## Table of Contents + +1. [Why Entity Caching](#1-why-entity-caching) +2. [Key Features](#2-key-features) +3. [Schema Directives](#3-schema-directives) +4. [Key Design Decisions](#4-key-design-decisions) +5. [Architecture](#5-architecture) +6. [Composition Layer (TypeScript)](#6-composition-layer-typescript) +7. [Engine Layer (graphql-go-tools)](#7-engine-layer-graphql-go-tools) +8. [Router Layer (Go)](#8-router-layer-go) +9. [Proto Changes](#9-proto-changes) +10. [Configuration](#10-configuration) +11. [Observability](#11-observability) +12. [Test Coverage](#12-test-coverage) +13. [Review Focus Areas](#13-review-focus-areas) + +--- + +## 1. Why Entity Caching + +High-traffic websites running federated GraphQL pay a steep price in cost, latency, and reliability because every request fans out to subgraphs. A single page load can trigger dozens of entity resolution calls across multiple subgraphs -- and most of that data hasn't changed since the last request. + +Entity caching eliminates redundant subgraph calls by caching individual entities at the router level. Instead of caching full query responses (which are different for every query shape), we cache entities by their `@key` fields. This means a `Product` entity cached by one query is reused by every other query that needs that same product -- regardless of which fields are selected or which subgraphs are involved. + +The result: dramatically reduced subgraph load, lower latency, lower infrastructure cost, and improved reliability (the graph keeps serving even when a subgraph is slow). + +--- + +## 2. Key Features + +### Two-Layer Caching (L1 + L2) + +**L1 (per-request deduplication):** Within a single GraphQL request, the same entity is often resolved multiple times -- through aliases, nested references, or list items pointing to the same object. L1 is an in-memory `sync.Map` scoped to the request. It deduplicates these calls so each entity is fetched from a subgraph at most once per request, even without L2 enabled. + +**L2 (cross-request shared cache):** The persistent cache layer, backed by Redis or in-process memory (ristretto). When a user queries `Product(id: "123")` and the next user queries a different page that also needs `Product(id: "123")`, L2 serves it without touching the subgraph. TTLs are set per-entity via `@openfed__entityCache(maxAge)`. + +### Shadow Mode + +You cannot just flip caching on in production and hope it works. Shadow mode provides a scientific approach to cache rollout: + +1. **Enable shadow mode** -- the cache reads and writes happen normally, but cached data is **never served** to clients. Every request still hits the subgraph. +2. **Measure** -- the engine compares cached data against fresh subgraph responses, hashing each field individually. Staleness events are recorded in metrics. +3. **Fine-tune** -- adjust TTLs, invalidation rules, and entity coverage based on real production data in dashboards. See exactly which entities go stale and how quickly. +4. **Go live** -- once the data shows TTLs and invalidation are working correctly, disable shadow mode. Clients start seeing cached data with confidence that it's fresh. + +This eliminates the risk of serving stale data during initial rollout. You get production-grade validation before a single user sees cached content. + +### Partial Cache Loads + +Consider a list query that needs to resolve 50 entities from a subgraph. Without partial cache loads, if even one entity is missing from the cache, all 50 are re-fetched -- wasting the 49 cache hits. + +With `partialCacheLoad` enabled, the router tracks which entities are cached and which aren't. It serves the cached ones directly and only sends the missing ones to the subgraph. If 48 out of 50 entities are cached, only 2 go to the subgraph. + +For high-cardinality list queries, this dramatically reduces subgraph load even when cache coverage isn't 100%. + +### Negative Caching + +Imagine a list query that loads 50 entities, but 10 of them have been deleted. Without negative caching, those 10 deletions produce null responses that are never cached. Every subsequent request re-fetches those 10 non-existent entities, hitting the subgraph for data that will never exist. + +Negative caching stores a null sentinel in the cache with a separate (shorter) TTL. Now all 50 lookups are cache hits -- 40 returning data, 10 returning "this entity doesn't exist." The subgraph is only called when the negative cache TTL expires, giving the system a chance to check if the entity has been recreated. + +### Cache Invalidation (Three Mechanisms) + +**Mutation-triggered (`@openfed__cacheInvalidate`):** A subgraph team annotates mutations that modify entities. When `updateProduct(id: "1")` completes, the router automatically evicts `Product(id: "1")` from the cache using the `@key` fields from the mutation response. The next query fetches fresh data. + +**Extension-based invalidation:** Sometimes a mutation has side effects beyond its return type. For example, updating a product might affect related inventory counts, category rankings, or recommendation lists. The subgraph can return all affected entity keys in the response extensions: +```json +{"extensions":{"cacheInvalidation":{"keys":[ + {"typename":"Product","key":{"id":"1"}}, + {"typename":"Category","key":{"id":"electronics"}}, + {"typename":"Inventory","key":{"id":"warehouse-1"}} +]}}} +``` +The router batch-deletes all these entries in a single operation. This is extremely powerful for correlated invalidations that the subgraph understands but the router cannot infer from the mutation return type alone. + +**Subscription-triggered:** Real-time events can both invalidate and populate the cache. A subscription for `itemUpdated` with `@openfed__cacheInvalidate` evicts stale entities as events arrive. A subscription for `itemCreated` with `@openfed__cachePopulate` pre-warms the cache with new entities before any query asks for them. + +### Cache Populate on Mutations + +The flip side of invalidation: `@openfed__cachePopulate` on a mutation tells the router to write the returned entity into the cache. When `createProduct(name: "Widget")` returns the new product, it's immediately cached. The first query for that product is a cache hit. + +### Per-Subgraph and Per-Entity Cache Routing + +By default, all entities share a single Redis instance. But in high-traffic scenarios, one subgraph can dominate the cache, evicting entries from other subgraphs. + +Example: A music streaming service pre-computes personalized playlists for millions of users. That's millions of cache keys for a single entity type. If they share Redis with the rest of the graph, playlist entries evict product catalog entries, recommendation entries, and everything else. + +Cache routing solves this with a three-tier provider model: +1. **Entity-level override:** `Product` on the `catalog` subgraph uses `redis-catalog` +2. **Subgraph-level override:** Everything on the `playlist` subgraph uses `redis-playlist` +3. **Global default:** Everything else uses `redis-default` + +Each Redis instance is sized independently. The playlist cache can have 100GB without affecting anyone else. + +### Circuit Breaker + +Redis is usually reliable, but maintenance windows, network issues, or resource exhaustion happen. Without protection, a Redis outage causes a cascade of errors and timeouts across the entire graph. + +The circuit breaker wraps the cache layer with three states: +- **Closed (normal):** All cache operations pass through. +- **Open (tripped):** After N consecutive failures, the breaker opens. All cache operations are skipped -- the router falls back to subgraph fetches as if caching didn't exist. No errors, no timeouts, just slightly higher latency. +- **Half-open (probing):** After a cooldown period, one probe request tests the cache. If it succeeds, the breaker closes and caching resumes. If it fails, the breaker stays open. + +The graph never goes down because of a cache failure. + +### Root Field Caching with `@openfed__is` + +Entity caching works through `_entities` calls (federation entity resolution). But many queries start with a root field like `product(id: "123")` that fetches directly from a subgraph. The `@openfed__queryCache` directive enables caching these root field results. + +The key insight: if a root field returns a `Product` and takes `id` as an argument, the cache key should be the same as the entity key `Product(id: "123")`. This way, a product fetched via `product(id: "123")` shares its cache entry with the same product resolved via `_entities`. + +But sometimes argument names don't match entity key fields. A subgraph might expose `productByPid(pid: ID!)` where `pid` maps to the entity's `id` key field. The `@openfed__is` directive makes this explicit: + +```graphql +type Query { + productByPid(pid: ID! @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 300) +} +``` + +This tells composition: "the argument `pid` maps to the `@key` field `id`." The router uses this mapping to construct entity-compatible cache keys from root field arguments. + +--- + +## 3. Schema Directives + +Subgraph teams control caching through five directives in their schemas: + +```graphql +# Mark an entity as cacheable (300-second TTL) +type Product @key(fields: "id") @openfed__entityCache(maxAge: 300) { + id: ID! + name: String! + price: Float! +} + +# Enable root field caching with argument-to-key mapping +type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 300) + productByPid(pid: ID! @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 300) + products: [Product!]! @openfed__queryCache(maxAge: 300) +} + +# Invalidate cache on mutations +type Mutation { + updateProduct(id: ID!, name: String!): Product @openfed__cacheInvalidate + deleteProduct(id: ID!): Product @openfed__cacheInvalidate + createProduct(name: String!): Product! @openfed__cachePopulate(maxAge: 60) +} + +# Real-time cache management via subscriptions +type Subscription { + productUpdated: Product @openfed__cacheInvalidate + productCreated: Product @openfed__cachePopulate +} +``` + +### Directive Reference + +| Directive | Target | Arguments | Purpose | +|-----------|--------|-----------|---------| +| `@openfed__entityCache` | `OBJECT` | `maxAge: Int!`, `includeHeaders: Boolean`, `partialCacheLoad: Boolean`, `shadowMode: Boolean` | Marks an entity type as cacheable with TTL and behavior flags | +| `@openfed__queryCache` | `FIELD_DEFINITION` | `maxAge: Int!`, `includeHeaders: Boolean`, `shadowMode: Boolean` | Enables cache reads for Query root fields returning cached entities | +| `@openfed__cacheInvalidate` | `FIELD_DEFINITION` | (none) | Evicts the returned entity from cache after Mutation/Subscription | +| `@openfed__cachePopulate` | `FIELD_DEFINITION` | `maxAge: Int` (optional override) | Writes the returned entity to cache after Mutation/Subscription | +| `@openfed__is` | `ARGUMENT_DEFINITION` | `fields: String!` | Maps a query argument to an entity `@key` field name (or composite/nested field set) | + +--- + +## 4. Key Design Decisions + +### Why per-entity caching instead of per-query response caching? + +Every GraphQL query is different. Different clients select different fields, use different variables, combine different fragments. Caching full query responses means almost no cache sharing -- a mobile client's query and a web client's query for the same product generate different cache keys. + +Per-entity caching solves this by caching at the entity level using `@key` fields as the cache key. `Product(id: "123")` is cached once and served to any query that needs it, regardless of which fields are selected. The entity gets resolved from different subgraphs independently -- the `details` subgraph's contribution is cached separately from the `inventory` subgraph's contribution. + +This also respects team ownership. Every subgraph team can independently decide which entities to cache, what TTLs to use, and when to invalidate -- without coordinating with other teams. + +### Why schema directives instead of router-side configuration? + +The router is owned by the platform team. Entities are owned by subgraph teams. Subgraph teams know their data best -- they know how often a product changes, when a user profile goes stale, which mutations affect which entities. + +Putting cache rules in the schema means the people who understand the data define the caching behavior. The platform team configures infrastructure (which Redis, circuit breaker thresholds, L1/L2 toggles) while subgraph teams configure semantics (what to cache, for how long, when to invalidate). + +This separation also means cache rules travel with the schema through composition. When a subgraph is published with new caching directives, the composition engine validates them, and the next router config update picks them up automatically. + +### Why two cache layers (L1 + L2)? + +They solve different problems: + +**L1** solves an intra-request problem. A single GraphQL query often resolves the same entity multiple times (aliases like `a: product(id: "1") { ... } b: product(id: "1") { ... }`, or nested references). L1 deduplicates within a request using a `sync.Map`. It's zero-config, always useful, and has no external dependencies. + +**L2** solves a cross-request problem. Different users querying the same product should share cached data. L2 is backed by Redis or in-process memory and persists across requests. It requires configuration (storage provider, TTLs) and infrastructure. + +You can enable each independently. L1-only gives you deduplication with no infra. L2-only gives you shared caching. Both together give you the full benefit. + +### Why graceful degradation everywhere? + +Cache failures must never break the graph. If Redis is down, the query should still work -- it just takes longer because it hits the subgraph directly. This is implemented at every level: + +- The `LoaderCache` interface returns errors, but the engine treats them as cache misses +- The circuit breaker stops trying the cache after repeated failures, eliminating timeout overhead +- Shadow mode serves fresh data even when the cache has entries +- Memory pressure in ristretto triggers eviction, not errors + +The graph's correctness never depends on the cache. The cache is purely a performance optimization. + +### Why extension-based invalidation? + +Mutation return types only tell part of the story. When you update a product's price, the mutation returns the updated `Product`. But that price change might affect `Category` aggregates, `Recommendation` rankings, and `Cart` totals across the graph. + +The subgraph knows about these correlations. Extension-based invalidation lets the subgraph declare all affected entities in the response, and the router invalidates them in a single batch. This gives subgraph teams the power to express complex invalidation relationships without router-side configuration. + +--- + +## 5. Architecture + +### System Overview + +``` + Subgraph Schema + | + @openfed__entityCache, @openfed__queryCache, + @openfed__cacheInvalidate, @openfed__cachePopulate, @openfed__is + | + v + ┌─────────────────────┐ + │ Composition (TS) │ Validates directives, + │ │ generates cache configs + └──────────┬──────────┘ + │ Proto (EntityCacheConfiguration, + │ RootFieldCacheConfiguration, ...) + v + ┌─────────────────────┐ + │ Router Config │ L1/L2 flags, storage + │ (config.yaml) │ providers, circuit breaker + └──────────┬──────────┘ + │ + ┌────────────────────┼────────────────────┐ + v v v + ┌─────────────┐ ┌──────────────────┐ ┌───────────────┐ + │ L1 Cache │ │ L2 Cache │ │ Invalidation │ + │ (per-request)│ │ (cross-request) │ │ │ + │ sync.Map │ │ Redis / Memory │ │ Mutation │ + │ dedup only │ │ + Circuit Breaker │ │ Subscription │ + └─────────────┘ └──────────────────┘ │ Extension │ + └───────────────┘ +``` + +### Cache Flow Per Request + +``` +Query arrives + │ + ├─ prepareCacheKeys() Build keys from @key fields + arguments + │ + ├─ tryL1CacheLoad() sync.Map lookup (request-scoped) + │ ├─ HIT → skip fetch entirely (even skips goroutine in parallel mode) + │ └─ MISS ↓ + │ + ├─ tryL2CacheLoad() Redis/Memory lookup + │ ├─ HIT → serve from cache, populate L1 + │ ├─ PARTIAL HIT → fetch only missing entities (if partialCacheLoad=true) + │ └─ MISS ↓ + │ + ├─ Fetch from subgraph + │ + ├─ populateL1Cache() Store for intra-request dedup + ├─ updateL2Cache() Store for cross-request serving + │ └─ Merges with existing cached data (preserves other argument variants) + │ + └─ Cache invalidation Process mutation results + response extensions +``` + +### Cache Key Format + +**Entity keys** (used for `_entities` resolution and root fields with key mappings): +```json +{"__typename":"Product","key":{"id":"123"}} +``` + +**Root field keys** (used when no argument-to-key mapping exists): +```json +{"__typename":"Query","field":"topProducts","args":{"first":5}} +``` + +When `@openfed__queryCache` + `@openfed__is` mappings are configured, root fields produce entity-format keys. This means `product(id: "123")` and the `_entities` fetch for `Product(id: "123")` share the same cache entry. + +**Key prefix pipeline** (applied in order): +1. `GlobalCacheKeyPrefix` (e.g., multi-tenant isolation) +2. Subgraph header hash prefix (when `includeHeaders = true`) +3. User-provided `L2CacheKeyInterceptor` (custom module transform) + +### Parallel Resolution Model + +4-phase model for parallel entity fetches: + +1. **Phase 1 (main thread):** `prepareCacheKeys` + `tryL1CacheLoad` for all fetches. L1 hits set `cacheSkipFetch = true`, skipping the goroutine entirely. +2. **Phase 2 (goroutines via errgroup):** `tryL2CacheLoad` + subgraph fetch for L1 misses. Analytics accumulated per-result (goroutine-safe). +3. **Phase 3 (main thread):** Merge analytics events from goroutine-local slices. +4. **Phase 4 (main thread):** `mergeResult` + `populateL1Cache` + `updateL2Cache` + cache invalidation. + +### L2 Write Merging + +Different queries select different fields from the same entity. When query A caches `Product { id, name }` and later query B fetches `Product { id, price }`, the engine merges both field sets into the existing cache entry via `astjson.MergeValues`. The cache entry grows to contain `Product { id, name, price }`, serving both query shapes. + +Fields with arguments (e.g., `friends(first:5)` vs `friends(first:10)`) coexist in the same entity via xxhash suffixes on the field name. No collisions, no overwriting. + +### Alias Normalization + +`normalizeForCache` transforms aliased field names to their original schema names before L2 storage. `denormalizeFromCache` reverses this on load. This ensures that `myProduct: product(id:"1") { ... }` and `product(id:"1") { ... }` share the same cache entry. + +--- + +## 6. Composition Layer (TypeScript) + +### Files Changed +- `composition/src/v1/constants/directive-definitions.ts` -- 5 new directive AST definitions +- `composition/src/v1/normalization/normalization-factory.ts` -- ~500 lines: `validateAndExtractEntityCachingConfigs()` + helpers +- `composition/src/router-configuration/types.ts` -- 6 new config output types +- `composition/src/errors/errors.ts` -- 12 new error message functions +- `composition/src/v1/warnings/warnings.ts` -- 2 new warning types + +### Three-Phase Validation + +**Phase 1 -- Entity types:** Collects `@openfed__entityCache` from object types, validates `@key` presence and positive `maxAge`, builds `entityCacheConfigByTypeName` lookup. + +**Phase 2 -- Root type fields:** Processes `@openfed__queryCache`, `@openfed__cacheInvalidate`, `@openfed__cachePopulate`, `@openfed__is` on Query/Mutation/Subscription fields. Key rules: +- `@openfed__queryCache` only on Query fields +- `@openfed__cacheInvalidate` / `@openfed__cachePopulate` only on Mutation/Subscription +- `@openfed__cacheInvalidate` + `@openfed__cachePopulate` are mutually exclusive +- Return type must be an entity with `@openfed__entityCache` +- `@openfed__is` field must reference a `@key` field; `@openfed__is` without `@openfed__queryCache` is an error + +**Phase 3 -- Config attachment:** Validated configs attached to `ConfigurationData` entries for the proto serialization layer. + +### `@openfed__is` Directive and Key Mapping + +Two strategies for mapping query arguments to `@key` fields: +1. **Explicit:** `@openfed__is(fields: "keyFieldName")` on an argument +2. **Auto-mapping:** Argument name matches a `@key` field name + +Example: `product(pid: ID! @openfed__is(fields: "id")): Product @openfed__queryCache(maxAge: 30)` maps argument `pid` to `@key(fields: "id")`. + +List-returning fields support batch key mapping. +A list-valued argument whose inner type matches a `@key` field auto-maps into an `isBatch: true` `FieldMappingConfig`, +and `@openfed__is(fields: "...")` also resolves on list-returning fields when the argument is list-shaped. +Incomplete mappings on singular returns produce warnings (cache reads disabled for that field), +not composition errors. +Nested `@key` fields (e.g., `store { id }`) can be mapped through input-object arguments that mirror the nested shape, +or via `@openfed__is(fields: "store.id")` on a flat argument. + +### Validation Rules Summary + +| # | Rule | Severity | +|---|------|----------| +| 1 | `@openfed__entityCache` requires `@key` | Error | +| 2 | `maxAge` must be positive integer | Error | +| 3 | `@openfed__queryCache` only on Query fields | Error | +| 4 | `@openfed__queryCache` return type must be entity with `@openfed__entityCache` | Error | +| 5 | `@openfed__is` requires `@openfed__queryCache` on the field | Error | +| 6 | `@openfed__is(field)` must reference a `@key` field | Error | +| 7 | Duplicate key field mappings (two args map to same key) | Error | +| 8 | Incomplete key mapping (non-list) | Warning | +| 9 | Redundant `@openfed__is` (arg name already matches key field) | Warning | +| 10-13 | `@openfed__cacheInvalidate`/`@openfed__cachePopulate` operation type + return type checks | Error | +| 14 | `@openfed__cacheInvalidate` + `@openfed__cachePopulate` mutual exclusion | Error | + +--- + +## 7. Engine Layer (graphql-go-tools) + +This is the core implementation in `v2/pkg/engine/resolve/`. + +### Key Files + +| File | Lines | Purpose | +|------|-------|---------| +| `loader_cache.go` | ~1,900 | Core L1/L2 cache operations, invalidation, populate | +| `caching.go` | ~395 | CacheKeyTemplate, key rendering, prefix pipeline | +| `cache_analytics.go` | ~918 | Analytics collector and snapshot | +| `cache_fetch_info.go` | ~63 | Debug context enrichment | +| `fetch.go` | -- | FetchCacheConfiguration, MutationEntityImpactConfig | +| `plan/federation_metadata.go` | -- | All plan-time config types | + +### Data Validation + +`validateItemHasRequiredData` recursively checks that a cached entity has all fields required by the current query. Uses `cacheFieldName()` to handle argument-suffixed fields. Missing fields trigger a cache miss and subgraph re-fetch -- the cache never serves incomplete data. + +### Self-Referential Entity Safety + +`shallowCopyProvidedFields()` creates shallow copies when loading from L1 to prevent pointer aliasing. When `User.friends` returns `User` entities, arena-allocated objects could point back to the same memory. The copy prevents mutation of cached L1 entries. + +--- + +## 8. Router Layer (Go) + +### Cache Infrastructure (`router/pkg/entitycache/`) + +Three `resolve.LoaderCache` implementations: + +**`MemoryEntityCache`** (ristretto-backed): +- `dgraph-io/ristretto/v2` with cost = byte length +- Tracks entry count via `atomic.Int64` with eviction callback +- Tracks `RemainingTTL` on cache entries + +**`RedisEntityCache`**: +- `redis.UniversalClient` (supports single, sentinel, cluster) +- Key-prefixed (`keyPrefix + ":" + key`) +- Batch reads via `MGet`, writes via pipeline +- Implements `io.Closer` to close the Redis connection on shutdown + +**`CircuitBreakerCache`** (wrapper): +- Three states: closed / open / half-open (atomic, lock-free) +- On failure: swallows errors, returns empty results (graceful degradation) +- On open: bypasses cache entirely +- Half-open: single probe request via `CompareAndSwap` +- Implements `io.Closer`, delegates to inner cache + +### Executor Integration (`router/core/`) + +| File | Role | +|------|------| +| `executor.go` | Builds invalidation config map (`subgraphName -> typeName -> config`), three-tier provider resolution | +| `factoryresolver.go` | Populates `FederationMetaData` with all cache configs from proto, resolves per-subgraph/entity provider IDs | +| `graphql_handler.go` | Constructs per-request `CachingOptions`, chains key interceptor modules, records cache metrics | +| `router.go` | Creates named cache instances from storage providers, handles circuit breaker wrapping, closes caches on shutdown | +| `graph_server.go` | Validates subgraph/entity override references at startup, wires metrics, passes config to executor | + +### Module Extension Point (`modules.go`) + +```go +type EntityCacheKeyInterceptor interface { + OnEntityCacheKeys(keys [][]byte, ctx RequestContext) [][]byte +} +``` +Custom modules can transform cache keys before L2 operations. Use case: multi-tenant key prefixing based on request context. Auto-discovered during `initModules()`. + +--- + +## 9. Proto Changes + +**File:** `proto/wg/cosmo/node/v1/node.proto` + +New fields on `DataSourceConfiguration` (field numbers 17-20): + +```protobuf +repeated EntityCacheConfiguration entity_cache_configurations = 17; +repeated RootFieldCacheConfiguration root_field_cache_configurations = 18; +repeated CachePopulateConfiguration cache_populate_configurations = 19; +repeated CacheInvalidateConfiguration cache_invalidate_configurations = 20; +``` + +Supporting messages: `EntityKeyMapping`, `EntityCacheFieldMapping`. + +--- + +## 10. Configuration + +### Router Config (`config.yaml`) + +```yaml +entity_caching: + enabled: true + l1: + enabled: true # Per-request deduplication (default: true) + max_size_bytes: 100MB + l2: + enabled: true # Cross-request caching (default: true) + storage: + provider_id: "redis-default" # References a storage provider + key_prefix: "cosmo_entity_cache" + circuit_breaker: + enabled: true + failure_threshold: 5 + cooldown_period: 10s + global_cache_key_prefix: "" # Optional, e.g. tenant isolation + subgraph_cache_overrides: # Three-tier routing + - name: "products" + storage_provider_id: "redis-hot" + entities: + - type: "Product" + storage_provider_id: "redis-dedicated" +``` + +All settings are env-overridable with `ENTITY_CACHING_*` prefix. + +**Ownership split:** Subgraph teams define *what* to cache and *when* to invalidate (via schema directives). Platform teams define *where* to cache and *how* to protect it (via router config). + +--- + +## 11. Observability + +### Metrics (`router/pkg/metric/entity_cache_metrics.go`) + +Seven OTEL instruments: + +| Metric | Type | Description | +|--------|------|-------------| +| `router.entity_cache.requests.stats` | Counter | L1/L2 hits and misses | +| `router.entity_cache.keys.stats` | Counter | Key lifecycle (added) | +| `router.entity_cache.latency` | Histogram | L2 operation latency (ms) | +| `router.entity_cache.invalidations` | Counter | By source (mutation/subscription/extension) | +| `router.entity_cache.populations` | Counter | By source (mutation/subscription) | +| `router.entity_cache.shadow.staleness` | Counter | Shadow mode stale data events | +| `router.entity_cache.operation_errors` | Counter | Cache operation errors | + +Attributes: `cache_level`, `source`, `cache_name`, `entity_type`. + +These metrics power the shadow mode workflow: monitor `shadow.staleness` to validate TTLs before going live, watch `requests.stats` to measure hit rates, track `invalidations` to verify mutation/subscription triggers work. + +--- + +## 12. Test Coverage + +### Summary: ~15,500 lines across 20 test files + +| Layer | Files | Lines | What's Covered | +|-------|-------|-------|----------------| +| **Engine (graphql-go-tools)** | 13 | ~12,300 | L1/L2 interaction, parallel resolution, shadow mode, negative cache, alias normalization, partial loads, mutation/subscription/extension invalidation, analytics | +| **Composition (TypeScript)** | 1 | ~1,130 | All 14 validation rules, config extraction, federation, @openfed__is mapping | +| **Router unit tests** | 4 | ~790 | Memory/Redis/CircuitBreaker cache ops, executor config builders | +| **Router integration tests** | 2 | ~1,300 | 25 end-to-end scenarios with real subgraphs | + +### Integration Test Scenarios (25 tests) + +**Core caching:** +- L2 miss then hit, different entities produce separate entries +- List query caching (5 entities cached individually) +- Multi-subgraph caching (details + inventory subgraphs) +- Cross-subgraph combined queries +- Root field caching with key mappings +- `@openfed__is` directive cache key mapping (`pid` -> `id`) + +**Cache behavior:** +- TTL expiry (1s TTL + sleep verification) +- Header-varied cache keys (`includeHeaders`) +- Per-subgraph cache routing (custom Redis per entity type) +- Disabled caching (verify no caching occurs) +- L1 dedup (aliases in single request) + L1+L2 together + +**Advanced features:** +- Shadow mode (always fetches, populates cache, compares) +- Partial cache load (warm subset, fetch only missing) +- Negative caching (null responses cached, TTL expiry) +- Shadow mode with failing cache (graceful degradation) + +**Invalidation + population:** +- Mutation invalidation + population via `@openfed__cacheInvalidate` / `@openfed__cachePopulate` +- Delete mutation invalidation +- Subscription invalidation via WebSocket +- Subscription population via WebSocket +- Extension-based invalidation (subgraph response extensions) + +**Resilience:** +- Circuit breaker full lifecycle (healthy -> failure -> open -> recovery -> closed) +- Circuit breaker half-open probe + +--- + +## 13. Review Focus Areas + +### Architecture & Correctness + +1. **L2 write merging is not atomic.** On L2 write, existing cached data is read, merged with fresh fields via `astjson.MergeValues`, then written back. Concurrent requests for the same entity could race. This is acceptable in a best-effort cache model (worst case: one write wins, some fields are re-fetched next time), but verify the engine handles merge conflicts gracefully. + +2. **Parallel resolution phases.** The 4-phase model (L1 on main thread -> L2+fetch in goroutines -> merge on main thread -> write on main thread) is subtle. Verify that arena memory is never accessed from goroutines and that analytics merge is complete before snapshot. + +3. **Argument-aware field caching growth.** The xxhash suffix approach (`friends_AAA...`) means cached entities grow over time as different argument combinations are cached. There's no per-field TTL -- the entire entity expires together. Consider whether large entities with many argument variants could cause memory pressure. + +4. **Subscription `FindByTypeName` collision.** Both `@openfed__cachePopulate` and `@openfed__cacheInvalidate` on subscriptions create `SubscriptionEntityPopulationConfiguration` entries. `FindByTypeName` returns the first match, which can shadow one config if both exist for the same entity type. There's a workaround in tests (`removeSubscriptionPopulateConfigs`). Review whether this needs a fix. + +### Cache Key Integrity + +5. **`extractKeyFieldNames` tokenizer.** Splitting `normalizedFieldSet` by whitespace and filtering tokens containing `{` is naive. For compound keys like `@key(fields: "a b { c }")`, the token `b` could be incorrectly extracted. Verify the engine's normalized field set format guarantees safety. + +6. **Redis vs Memory TTL asymmetry.** `MemoryEntityCache.Get` populates `RemainingTTL` on cache entries; `RedisEntityCache.Get` does not. If any engine logic depends on `RemainingTTL`, behavior differs between providers. + +### Operational + +7. **Circuit breaker scope.** The breaker wraps the entire cache, not individual operations. A burst of `Set` failures trips the breaker, which blocks `Get` calls too. This is intentional (failing cache = skip entirely) but worth confirming is the right trade-off. + +8. **Memory cache `Len()` is approximate.** The ristretto-backed counter can drift under concurrent access. Integration tests use `require.Equal` on `Len()` -- verify these don't flake under CI load. + +9. **`negativeCacheTtlSeconds` source.** Present in proto but not extracted from `@openfed__entityCache` directive arguments by the composition layer. Only set via runtime config mutations in tests. Clarify: is this intentionally a runtime-only setting? + +### Coverage Gaps + +10. **No integration test for `EntityCacheKeyInterceptor`.** The module extension point exists but has no end-to-end test with a custom module. + +11. **No integration test for multi-provider storage.** Unit tests cover provider resolution logic, and one integration test uses per-subgraph cache names, but there's no test with two actual Redis instances verifying correct key routing. + +12. **Analytics export pipeline.** Metrics instruments and the `CacheAnalyticsCollector`/`CacheAnalyticsSnapshot` are implemented, but the full export pipeline is marked as future work. diff --git a/docs/entity-caching/pre-release-testing/.gitignore b/docs/entity-caching/pre-release-testing/.gitignore new file mode 100644 index 0000000000..d77474afc6 --- /dev/null +++ b/docs/entity-caching/pre-release-testing/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +bun.lock diff --git a/docs/entity-caching/pre-release-testing/Makefile b/docs/entity-caching/pre-release-testing/Makefile new file mode 100644 index 0000000000..88f2188ed4 --- /dev/null +++ b/docs/entity-caching/pre-release-testing/Makefile @@ -0,0 +1,74 @@ +SHELL := bash + +THIS_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) +REPO_ROOT := $(abspath $(THIS_DIR)/../../..) +GRAPH ?= $(THIS_DIR)/example/graph.yaml +CONFIG ?= $(THIS_DIR)/generated/config.json +COMPOSE_FILE := $(THIS_DIR)/docker-compose.yml + +.PHONY: help setup build-cli-deps subgraph-deps compose check-config up up-detached wait test logs down clean + +help: + @printf '%s\n' \ + 'Entity caching pre-release testing targets:' \ + '' \ + ' make setup Enable Corepack and install repo dependencies' \ + ' make build-cli-deps Build local workspace packages required by wgc router compose' \ + ' make subgraph-deps Install Bun dependencies for the bundled example subgraph' \ + ' make compose Compose GRAPH into generated/config.json' \ + ' make check-config Verify generated config contains cache metadata' \ + ' make up Compose, then build and run router + Redis' \ + ' make up-detached Compose, then build and run router + Redis in the background' \ + ' make test Run the self-contained router + Redis + Bun subgraph smoke test' \ + ' make logs Follow router logs' \ + ' make down Stop router + Redis' \ + ' make clean Remove generated/config.json' \ + '' \ + 'Variables:' \ + ' GRAPH=/path/to/graph.yaml' \ + ' CONFIG=/path/to/config.json' + +setup: + cd "$(REPO_ROOT)" && corepack enable && pnpm install + $(MAKE) build-cli-deps + $(MAKE) subgraph-deps + +build-cli-deps: + cd "$(REPO_ROOT)" && pnpm --filter @wundergraph/cosmo-connect build + cd "$(REPO_ROOT)" && pnpm --filter @wundergraph/composition build + cd "$(REPO_ROOT)" && pnpm --filter @wundergraph/protographic build + cd "$(REPO_ROOT)" && pnpm --filter @wundergraph/cosmo-shared build + +subgraph-deps: + @if command -v bun >/dev/null 2>&1; then \ + cd "$(THIS_DIR)" && bun install; \ + else \ + printf '%s\n' 'Bun is not installed locally; Docker Compose will install the example subgraph dependencies inside the products container.'; \ + fi + +compose: + "$(THIS_DIR)/scripts/compose.sh" "$(GRAPH)" "$(CONFIG)" + +check-config: + "$(THIS_DIR)/scripts/check-config.sh" "$(CONFIG)" + +up: compose check-config + docker compose -f "$(COMPOSE_FILE)" up --build + +up-detached: compose check-config + docker compose -f "$(COMPOSE_FILE)" up --build -d + +wait: + "$(THIS_DIR)/scripts/wait-router.sh" + +test: up-detached wait + "$(THIS_DIR)/scripts/smoke-test.sh" + +logs: + docker compose -f "$(COMPOSE_FILE)" logs -f router + +down: + docker compose -f "$(COMPOSE_FILE)" down + +clean: + rm -f "$(CONFIG)" diff --git a/docs/entity-caching/pre-release-testing/README.md b/docs/entity-caching/pre-release-testing/README.md new file mode 100644 index 0000000000..4df1c8fe9c --- /dev/null +++ b/docs/entity-caching/pre-release-testing/README.md @@ -0,0 +1,473 @@ +# Entity Caching Pre-Release Testing + +Use this kit to test entity caching in your own graph with PR [#2777](https://github.com/wundergraph/cosmo/pull/2777), before the feature is available in the public control plane and the released router. + +You will compose locally from this checkout and run a source-built router with Redis. This avoids hosted control-plane composition, which may not yet understand the new cache directives. + +## Get The PR Checkout + +Use PR [#2777](https://github.com/wundergraph/cosmo/pull/2777)'s source branch: + +```text +wundergraph/cosmo:jensneuse/entity-caching-v2 +``` + +From a fresh directory: + +```bash +git clone https://github.com/wundergraph/cosmo.git +cd cosmo +git fetch origin jensneuse/entity-caching-v2 +git checkout -B entity-caching-pre-release origin/jensneuse/entity-caching-v2 +git pull --ff-only origin jensneuse/entity-caching-v2 +``` + +From an existing Cosmo checkout: + +```bash +git remote set-url origin https://github.com/wundergraph/cosmo.git +git fetch origin jensneuse/entity-caching-v2 +git checkout -B entity-caching-pre-release origin/jensneuse/entity-caching-v2 +git pull --ff-only origin jensneuse/entity-caching-v2 +``` + +When you test again later, update the checkout before composing: + +```bash +git checkout entity-caching-pre-release +git pull --ff-only origin jensneuse/entity-caching-v2 +``` + +Confirm that you are on the pre-release branch: + +```bash +git status --short --branch +``` + +The output should include: + +```text +## entity-caching-pre-release +``` + +## Quick Start + +From this directory: + +```bash +cd docs/entity-caching/pre-release-testing +make setup +make test +``` + +`make test` composes the bundled graph, starts Redis, starts a tiny Bun/TypeScript products subgraph with GraphQL Yoga, builds and starts the router from source, sends the same product query twice, and verifies the second request does not hit the products subgraph root resolver again. It then restarts the router and sends the query once more to verify Redis-backed L2 serves the cached response after the router's in-memory L1 cache is gone. + +Then open the router playground and Cache Explorer: + +```text +http://localhost:3002/ +``` + +The bundled example is fully runnable. After you try it, replace the example SDL/routing URLs with your own subgraphs. + +## Add Your Own Subgraphs + +The kit composes subgraph SDL from [example/graph.yaml](example/graph.yaml). Start by replacing or extending the bundled `products` subgraph entry: + +```yaml +version: 1 +subgraphs: + - name: products + routing_url: http://products:4001/graphql + schema: + file: ./subgraphs/products/schema.graphqls +``` + +For each subgraph you want to test: + +1. Put the subgraph SDL under `example/subgraphs//schema.graphqls`. +2. Add a matching entry to `example/graph.yaml`. +3. Set `routing_url` to the URL the router container can call. +4. Add cache directives to your SDL. +5. Run `make compose`. +6. Run `make check-config`. +7. Run `make up`. + +Use Docker-internal hostnames when your subgraphs run inside this Compose project. The bundled `products` subgraph uses `http://products:4001/graphql` because the Compose service is named `products`. + +Use `host.docker.internal` when your subgraphs run on your host and the router runs in Docker: + +```yaml +version: 1 +subgraphs: + - name: accounts + routing_url: http://host.docker.internal:4101/graphql + schema: + file: ./subgraphs/accounts/schema.graphqls + - name: products + routing_url: http://host.docker.internal:4102/graphql + schema: + file: ./subgraphs/products/schema.graphqls +``` + +On Linux, the Docker Compose file already maps `host.docker.internal` to the host gateway. + +Keep the cache directive definitions in each subgraph SDL that uses them. Composition reads the SDL files directly, and your subgraph server must also accept those directives at runtime. If your GraphQL server rejects unknown directives, register the directive definitions or configure the server to ignore them. + +The bundled Bun server in [example/subgraphs/products/server.ts](example/subgraphs/products/server.ts) loads the same [example/subgraphs/products/schema.graphqls](example/subgraphs/products/schema.graphqls) file used by local composition. It adds only the minimal federation helper types (`_service`, `_entities`, `_Any`, `_Entity`) around that SDL file. + +## Configure Caching In SDL + +Add these directive definitions to any subgraph SDL that uses entity caching: + +```graphql +directive @openfed__entityCache( + maxAge: Int! + negativeCacheTTL: Int = 0 + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT + +directive @openfed__queryCache( + maxAge: Int! + includeHeaders: Boolean = false + shadowMode: Boolean = false +) on FIELD_DEFINITION + +directive @openfed__is(fields: String!) on ARGUMENT_DEFINITION + +directive @openfed__cacheInvalidate on FIELD_DEFINITION + +directive @openfed__cachePopulate(maxAge: Int) on FIELD_DEFINITION + +directive @openfed__requestScoped(key: String!) on FIELD_DEFINITION +``` + +Available directives: + +| Directive | Location | Purpose | +| --------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------- | +| `@openfed__entityCache` | Object type | Marks an entity type as cacheable by `@key`. | +| `@openfed__queryCache` | Root `Query` field | Caches a root query that returns a cacheable entity or list of entities. | +| `@openfed__is` | Query argument | Maps a query argument to an entity `@key` field when names do not match. | +| `@openfed__cacheInvalidate` | Root `Mutation` or `Subscription` field | Evicts the returned cacheable entity from L2 after the field resolves. | +| `@openfed__cachePopulate` | Root `Mutation` or `Subscription` field | Writes the returned cacheable entity to L2 after the field resolves. | +| `@openfed__requestScoped` | Field definition | Deduplicates fields that resolve to the same request-scoped value within one request. | + +### `@openfed__entityCache` + +Use this on entity object types that have at least one federation `@key`. + +```graphql +type Product @key(fields: "id") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) { + id: ID! + name: String! +} +``` + +Arguments: + +| Argument | Required | Default | Use it for | +| ------------------ | -------- | ------- | ---------------------------------------------------------------------------------------------------------------- | +| `maxAge` | yes | none | Entity TTL in seconds. Must be greater than zero. | +| `negativeCacheTTL` | no | `0` | Cache null entity results for a short time. Use this to avoid repeated lookups for missing entities. | +| `includeHeaders` | no | `false` | Include forwarded request headers in the cache key. Use this for tenant-, auth-, or locale-specific entity data. | +| `partialCacheLoad` | no | `false` | For batch entity fetches, fetch only missing entities instead of refetching the full batch after one miss. | +| `shadowMode` | no | `false` | Read and write cache metadata without serving cached data. Use this before turning cache serving on. | + +### `@openfed__queryCache` + +Use this on root `Query` fields that return an entity or a list of entities. The returned entity type must also have `@openfed__entityCache`. + +```graphql +type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 120) + products(ids: [ID!]! @openfed__is(fields: "id")): [Product!]! @openfed__queryCache(maxAge: 120) +} +``` + +Arguments: + +| Argument | Required | Default | Use it for | +| ---------------- | -------- | ------- | ------------------------------------------------------------------------ | +| `maxAge` | yes | none | Root query result TTL in seconds. Must be greater than zero. | +| `includeHeaders` | no | `false` | Include forwarded request headers in the cache key for this query field. | +| `shadowMode` | no | `false` | Exercise reads and writes without serving cached data. | + +When a query argument has the same name as a key field, composition maps it automatically: + +```graphql +type Product @key(fields: "id") @openfed__entityCache(maxAge: 120) { + id: ID! + name: String! +} + +type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 120) +} +``` + +When the argument name differs from the key field, add `@openfed__is` to the argument: + +```graphql +type Product @key(fields: "sku") @openfed__entityCache(maxAge: 120) { + sku: String! + name: String! +} + +type Query { + productBySku(productSku: String! @openfed__is(fields: "sku")): Product @openfed__queryCache(maxAge: 120) +} +``` + +For composite or nested keys, map the argument to the same field set shape used by `@key`: + +```graphql +type Warehouse @key(fields: "location { id }") @openfed__entityCache(maxAge: 120) { + location: Location! + name: String! +} + +type Query { + warehouse(input: WarehouseInput! @openfed__is(fields: "location { id }")): Warehouse @openfed__queryCache(maxAge: 120) +} +``` + +### `@openfed__cacheInvalidate` + +Use this on root `Mutation` or `Subscription` fields that return a cacheable entity. After the field resolves, the router evicts the returned entity from L2. + +```graphql +type Mutation { + updateProduct(id: ID!, name: String!): Product @openfed__cacheInvalidate +} + +type Subscription { + productDeleted: Product @openfed__cacheInvalidate +} +``` + +### `@openfed__cachePopulate` + +Use this on root `Mutation` or `Subscription` fields that return a cacheable entity. After the field resolves, the router writes the returned entity to L2. + +```graphql +type Mutation { + upsertProduct(id: ID!, name: String!): Product @openfed__cachePopulate(maxAge: 60) +} + +type Subscription { + productChanged: Product @openfed__cachePopulate +} +``` + +`maxAge` is optional. When you omit it, the router uses the TTL from the returned entity type's `@openfed__entityCache`. + +Do not put both `@openfed__cacheInvalidate` and `@openfed__cachePopulate` on the same field. + +### `@openfed__requestScoped` + +Use this on two or more fields in the same subgraph that resolve to the same value within a single request. This is a per-request L1 cache only; it does not write to Redis and it does not survive across requests. + +```graphql +type Query { + currentViewer: Viewer @openfed__requestScoped(key: "currentViewer") +} + +type Personalized @key(fields: "id") @interfaceObject { + id: ID! + currentViewer: Viewer @inaccessible @openfed__requestScoped(key: "currentViewer") +} +``` + +Fields with the same `key` share one request-local cache entry scoped to the subgraph. The first field that resolves populates the entry, and later fields with the same key can reuse it. + +Use it for values like current viewer, current tenant, locale, feature flags, or other data that is identical throughout one request. Do not use it for values that depend on the parent entity; use entity caching for that. + +### Minimal Cacheable Entity Example + +```graphql +extend schema @link(url: "https://specs.apollo.dev/federation/v2.5", import: ["@key"]) + +directive @openfed__entityCache( + maxAge: Int! + negativeCacheTTL: Int = 0 + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT + +directive @openfed__queryCache( + maxAge: Int! + includeHeaders: Boolean = false + shadowMode: Boolean = false +) on FIELD_DEFINITION +directive @openfed__is(fields: String!) on ARGUMENT_DEFINITION +directive @openfed__cacheInvalidate on FIELD_DEFINITION +directive @openfed__cachePopulate(maxAge: Int) on FIELD_DEFINITION +directive @openfed__requestScoped(key: String!) on FIELD_DEFINITION + +type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 120) + productBySku(productSku: String! @openfed__is(fields: "sku")): Product @openfed__queryCache(maxAge: 120) +} + +type Mutation { + updateProduct(id: ID!, name: String!): Product @openfed__cacheInvalidate + upsertProduct(id: ID!, sku: String!, name: String!): Product @openfed__cachePopulate(maxAge: 60) +} + +type Product @key(fields: "id") @key(fields: "sku") @openfed__entityCache(maxAge: 120) { + id: ID! + sku: String! + name: String! +} +``` + +## Make Targets + +```bash +make help # show targets +make setup # enable Corepack and install repo dependencies +make build-cli-deps # build local workspace packages required by wgc router compose +make subgraph-deps # install Bun dependencies for the bundled example subgraph +make compose # compose example/graph.yaml into generated/config.json +make check-config # verify the generated router config contains cache metadata +make up # compose, then build and run router + Redis +make up-detached # same as up, but in the background +make test # run the self-contained smoke test +make logs # follow router logs +make down # stop router + Redis +make clean # remove generated config +``` + +`make compose` uses the local CLI from this checkout: + +```bash +cd ../../../cli +pnpm tsx src/index.ts router compose \ + -i docs/entity-caching/pre-release-testing/example/graph.yaml \ + -o docs/entity-caching/pre-release-testing/generated/config.json +``` + +Do not use a released `wgc` binary for this pre-release test. + +## Router + Redis + Bun Subgraph + +[docker-compose.yml](docker-compose.yml) builds the router from source and starts Redis plus the bundled products subgraph: + +```bash +make up +``` + +The router uses [config/router.redis.yaml](config/router.redis.yaml): + +- `execution_config.file.path` points at `/etc/cosmo/config.json`. +- L1 is enabled. +- L2 is enabled and backed by Redis at `redis://redis:6379/0`. +- The playground is enabled at `/`. +- `dev_mode: true` enables local testing headers and playground workflows. + +The router container mounts: + +```text +generated/config.json -> /etc/cosmo/config.json +config/router.redis.yaml -> /etc/cosmo/router.yaml +``` + +The products subgraph is exposed on your host at: + +```text +http://localhost:4011/graphql +http://localhost:4011/stats +``` + +## Try It + +With the bundled subgraph: + +```bash +make test +``` + +Open `http://localhost:3002/`, run a query that returns a cacheable entity, then run it again. Use the Cache Explorer to compare cold-cache and warm-cache behavior. + +Example query shape: + +```graphql +query Product { + product(id: "p1") { + id + sku + name + } +} +``` + +After you replace the bundled subgraph with your own services: + +```bash +make compose +make up +``` + +Useful request headers for comparison: + +```text +X-WG-Disable-Entity-Cache: true # disable L1 and L2 +X-WG-Disable-Entity-Cache-L1: true # disable L1 only +X-WG-Disable-Entity-Cache-L2: true # disable L2 only +X-WG-Cache-Key-Prefix: test-run-1 # isolate test runs +``` + +Suggested checks: + +- Run the same query twice; the second request should hit cache or skip subgraph loads where the plan allows it. +- Restart the router with `make down && make up`; Redis-backed L2 entries should remain until TTL expiry. +- Add `includeHeaders: true` to a cache directive and forward `Authorization`; two different tokens should use separate cache entries. +- Warm an entity, run a mutation with `@openfed__cacheInvalidate`, then query again; the post-mutation read should fetch fresh data. +- Run a mutation with `@openfed__cachePopulate`, then read the returned entity by key; the read should be cache-served when L2 is enabled. +- Use `shadowMode: true` to exercise cache reads/writes while still serving subgraph results. + +GitHub Actions builds pull request workflows from the PR merge ref, and the PR image tag is: + +```text +ghcr.io/wundergraph/cosmo/router:pr-2777 +``` + +This kit defaults to building the router from source via Docker Compose because it keeps the test self-contained. + +## Why Local Composition + +For this pre-release test, avoid this path: + +```text +publish SDL with cache directives -> hosted control plane composes -> router polls CDN +``` + +Until WunderGraph confirms that your control plane has the PR #2777 composition version, that path can fail validation, strip cache metadata, or generate a router config without the cache fields. + +Use this path instead: + +```text +your SDL files -> local PR #2777 composition -> generated/config.json -> source-built router + Redis +``` + +## Troubleshooting + +### `make check-config` says no cache metadata was found + +Check that your SDL includes cache directives and that you ran `make compose` from this PR checkout. The generated config should contain `entityCacheConfigurations`, `rootFieldCacheConfigurations`, `cachePopulateConfigurations`, `cacheInvalidateConfigurations`, or `requestScopedFields`. + +### Root query caching does not hit + +The return type must be an entity with `@key` and `@openfed__entityCache`. If the query argument name does not match the entity key field, add `@openfed__is(fields: "...")` to the argument. + +### The router cannot reach your subgraphs + +Use routing URLs that are valid from inside the router container. For host-running subgraphs, use `host.docker.internal`. + +### Header-varying cache entries collide + +Confirm `includeHeaders: true` is on the relevant directive and the router YAML forwards the header to that subgraph. diff --git a/docs/entity-caching/pre-release-testing/config/router.redis.yaml b/docs/entity-caching/pre-release-testing/config/router.redis.yaml new file mode 100644 index 0000000000..acb8606521 --- /dev/null +++ b/docs/entity-caching/pre-release-testing/config/router.redis.yaml @@ -0,0 +1,42 @@ +version: '1' + +execution_config: + file: + path: '/etc/cosmo/config.json' + +storage_providers: + redis: + - id: 'default' + urls: + - 'redis://redis:6379/0' + cluster_enabled: false + +entity_caching: + enabled: true + l1: + enabled: true + max_size: '100MB' + l2: + enabled: true + storage: + provider_id: 'default' + key_prefix: 'cosmo_entity_cache_pre_release' + circuit_breaker: + enabled: false + +headers: + subgraphs: + products: + request: + - op: propagate + named: Authorization + +graph: + token: '' + +log_level: debug +dev_mode: true +listen_addr: '0.0.0.0:3002' +playground: + enabled: true + path: '/' diff --git a/docs/entity-caching/pre-release-testing/docker-compose.yml b/docs/entity-caching/pre-release-testing/docker-compose.yml new file mode 100644 index 0000000000..bade337a71 --- /dev/null +++ b/docs/entity-caching/pre-release-testing/docker-compose.yml @@ -0,0 +1,40 @@ +name: cosmo-entity-caching-pre-release + +services: + redis: + image: redis:7-alpine + + products: + image: oven/bun:1 + working_dir: /work + command: + - sh + - -lc + - bun install && bun run start:products + ports: + - '4011:4001' + volumes: + - .:/work + + router: + build: + context: ../../../router + dockerfile: Dockerfile + args: + VERSION: entity-caching-pr-2777-local + COMMIT: local + DATE: local + command: + - /router + - --config + - /etc/cosmo/router.yaml + depends_on: + - products + - redis + ports: + - '3002:3002' + extra_hosts: + - 'host.docker.internal:host-gateway' + volumes: + - ./config/router.redis.yaml:/etc/cosmo/router.yaml:ro + - ./generated/config.json:/etc/cosmo/config.json:ro diff --git a/docs/entity-caching/pre-release-testing/example/graph.yaml b/docs/entity-caching/pre-release-testing/example/graph.yaml new file mode 100644 index 0000000000..30bcba7542 --- /dev/null +++ b/docs/entity-caching/pre-release-testing/example/graph.yaml @@ -0,0 +1,6 @@ +version: 1 +subgraphs: + - name: products + routing_url: http://products:4001/graphql + schema: + file: ./subgraphs/products/schema.graphqls diff --git a/docs/entity-caching/pre-release-testing/example/subgraphs/products/schema.graphqls b/docs/entity-caching/pre-release-testing/example/subgraphs/products/schema.graphqls new file mode 100644 index 0000000000..e47fb33113 --- /dev/null +++ b/docs/entity-caching/pre-release-testing/example/subgraphs/products/schema.graphqls @@ -0,0 +1,37 @@ +extend schema @link(url: "https://specs.apollo.dev/federation/v2.5", import: ["@key"]) + +directive @openfed__entityCache( + maxAge: Int! + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT + +directive @openfed__queryCache( + maxAge: Int! + includeHeaders: Boolean = false + shadowMode: Boolean = false +) on FIELD_DEFINITION + +directive @openfed__cacheInvalidate on FIELD_DEFINITION + +directive @openfed__cachePopulate(maxAge: Int) on FIELD_DEFINITION + +directive @openfed__is(fields: String!) on ARGUMENT_DEFINITION + +type Query { + product(id: ID!): Product @openfed__queryCache(maxAge: 120) + productBySku(productSku: String! @openfed__is(fields: "sku")): Product @openfed__queryCache(maxAge: 120) + products(ids: [ID!]! @openfed__is(fields: "id")): [Product!]! @openfed__queryCache(maxAge: 120) +} + +type Mutation { + updateProduct(id: ID!, name: String!): Product @openfed__cacheInvalidate + upsertProduct(id: ID!, sku: String!, name: String!): Product @openfed__cachePopulate(maxAge: 60) +} + +type Product @key(fields: "id") @key(fields: "sku") @openfed__entityCache(maxAge: 120, partialCacheLoad: true) { + id: ID! + sku: String! + name: String! +} diff --git a/docs/entity-caching/pre-release-testing/example/subgraphs/products/server.ts b/docs/entity-caching/pre-release-testing/example/subgraphs/products/server.ts new file mode 100644 index 0000000000..b82e08fd28 --- /dev/null +++ b/docs/entity-caching/pre-release-testing/example/subgraphs/products/server.ts @@ -0,0 +1,182 @@ +import { GraphQLScalarType, Kind } from 'graphql'; +import { createSchema, createYoga } from 'graphql-yoga'; + +type Product = { + id: string; + sku: string; + name: string; +}; + +type ProductReference = { + __typename?: 'Product'; + id?: string; + sku?: string; +}; + +const port = Number(process.env.PORT || 4001); + +const products = new Map([ + ['p1', { id: 'p1', sku: 'sku-1', name: 'Widget' }], + ['p2', { id: 'p2', sku: 'sku-2', name: 'Gadget' }], +]); + +const schemaPath = new URL('./schema.graphqls', import.meta.url); +const compositionSdl = await Bun.file(schemaPath).text(); + +const stats = { + product: 0, + productBySku: 0, + products: 0, + entities: 0, + updateProduct: 0, + upsertProduct: 0, +}; + +const federationRuntimeSdl = /* GraphQL */ ` + directive @link(url: String!, import: [String!]) repeatable on SCHEMA + directive @key(fields: String!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE + directive @openfed__entityCache( + maxAge: Int! + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false + ) on OBJECT + directive @openfed__queryCache( + maxAge: Int! + includeHeaders: Boolean = false + shadowMode: Boolean = false + ) on FIELD_DEFINITION + directive @openfed__cacheInvalidate on FIELD_DEFINITION + directive @openfed__cachePopulate(maxAge: Int) on FIELD_DEFINITION + directive @openfed__is(fields: String!) on ARGUMENT_DEFINITION + + scalar _Any + + union _Entity = Product + + type _Service { + sdl: String! + } + + extend type Query { + _service: _Service! + _entities(representations: [_Any!]!): [_Entity]! + } +`; + +function resetStats() { + for (const key of Object.keys(stats) as Array) { + stats[key] = 0; + } +} + +function findProductBySku(sku: string) { + return [...products.values()].find((product) => product.sku === sku) ?? null; +} + +function findProductByReference(reference: ProductReference) { + stats.entities += 1; + if (reference.id) { + return products.get(reference.id) ?? null; + } + if (reference.sku) { + return findProductBySku(reference.sku); + } + return null; +} + +const schema = createSchema({ + typeDefs: [compositionSdl, federationRuntimeSdl], + resolvers: { + _Any: new GraphQLScalarType({ + name: '_Any', + parseLiteral(ast) { + if (ast.kind !== Kind.STRING) { + return null; + } + return JSON.parse(ast.value); + }, + parseValue(value) { + return value; + }, + serialize(value) { + return value; + }, + }), + _Entity: { + __resolveType(value: ProductReference) { + return value.__typename ?? 'Product'; + }, + }, + Query: { + _service: () => ({ sdl: compositionSdl }), + _entities: (_root: unknown, args: { representations: ProductReference[] }) => + args.representations.map(findProductByReference), + product: (_root: unknown, args: { id: string }) => { + stats.product += 1; + return products.get(args.id) ?? null; + }, + productBySku: (_root: unknown, args: { productSku: string }) => { + stats.productBySku += 1; + return findProductBySku(args.productSku); + }, + products: (_root: unknown, args: { ids: string[] }) => { + stats.products += 1; + return args.ids.map((id) => products.get(id)).filter((product): product is Product => Boolean(product)); + }, + }, + Mutation: { + updateProduct: (_root: unknown, args: { id: string; name: string }) => { + stats.updateProduct += 1; + const existing = products.get(args.id); + if (!existing) { + return null; + } + const updated = { ...existing, name: args.name }; + products.set(args.id, updated); + return updated; + }, + upsertProduct: (_root: unknown, args: { id: string; sku: string; name: string }) => { + stats.upsertProduct += 1; + const product = { id: args.id, sku: args.sku, name: args.name }; + products.set(args.id, product); + return product; + }, + }, + }, +}); + +const yoga = createYoga({ + schema, + graphqlEndpoint: '/graphql', + landingPage: false, +}); + +function json(data: unknown, status = 200) { + return new Response(JSON.stringify(data), { + status, + headers: { 'content-type': 'application/json' }, + }); +} + +const server = Bun.serve({ + port, + async fetch(req) { + const url = new URL(req.url); + if (url.pathname === '/health') { + return json({ ok: true }); + } + if (url.pathname === '/stats') { + return json({ stats }); + } + if (url.pathname === '/reset' && req.method === 'POST') { + resetStats(); + return json({ ok: true }); + } + return yoga.fetch(req); + }, +}); + +console.info( + `products subgraph listening on ${new URL(yoga.graphqlEndpoint, `http://${server.hostname}:${server.port}`)}`, +); diff --git a/docs/entity-caching/pre-release-testing/generated/.gitignore b/docs/entity-caching/pre-release-testing/generated/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/docs/entity-caching/pre-release-testing/generated/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/docs/entity-caching/pre-release-testing/package.json b/docs/entity-caching/pre-release-testing/package.json new file mode 100644 index 0000000000..c77fa15154 --- /dev/null +++ b/docs/entity-caching/pre-release-testing/package.json @@ -0,0 +1,12 @@ +{ + "name": "cosmo-entity-caching-pre-release-testing", + "private": true, + "type": "module", + "scripts": { + "start:products": "bun run example/subgraphs/products/server.ts" + }, + "dependencies": { + "graphql": "^16.11.0", + "graphql-yoga": "^5.16.2" + } +} diff --git a/docs/entity-caching/pre-release-testing/scripts/check-config.sh b/docs/entity-caching/pre-release-testing/scripts/check-config.sh new file mode 100755 index 0000000000..93d4c2258e --- /dev/null +++ b/docs/entity-caching/pre-release-testing/scripts/check-config.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -euo pipefail + +CONFIG="${1:-generated/config.json}" + +if [[ ! -f "$CONFIG" ]]; then + printf 'Missing router config: %s\nRun: make compose\n' "$CONFIG" >&2 + exit 1 +fi + +if command -v jq >/dev/null 2>&1; then + count="$( + jq '[.. | objects | select( + has("entityCacheConfigurations") or + has("rootFieldCacheConfigurations") or + has("cachePopulateConfigurations") or + has("cacheInvalidateConfigurations") or + has("requestScopedFields") + )] | length' "$CONFIG" + )" +else + count="$(grep -Eo 'entityCacheConfigurations|rootFieldCacheConfigurations|cachePopulateConfigurations|cacheInvalidateConfigurations|requestScopedFields' "$CONFIG" | wc -l | tr -d ' ')" +fi + +if [[ "$count" == "0" ]]; then + printf 'No entity caching metadata found in %s\n' "$CONFIG" >&2 + exit 1 +fi + +printf 'Found entity caching metadata in %s (%s matching object(s)).\n' "$CONFIG" "$count" diff --git a/docs/entity-caching/pre-release-testing/scripts/compose.sh b/docs/entity-caching/pre-release-testing/scripts/compose.sh new file mode 100755 index 0000000000..366724dc78 --- /dev/null +++ b/docs/entity-caching/pre-release-testing/scripts/compose.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +KIT_DIR="$(cd -- "$SCRIPT_DIR/.." && pwd)" +REPO_ROOT="$(cd -- "$KIT_DIR/../../.." && pwd)" + +GRAPH="${1:-$KIT_DIR/example/graph.yaml}" +OUT="${2:-$KIT_DIR/generated/config.json}" + +mkdir -p "$(dirname "$OUT")" + +if ! command -v pnpm >/dev/null 2>&1; then + printf 'pnpm was not found. Run: make setup\n' >&2 + exit 1 +fi + +cd "$REPO_ROOT/cli" +pnpm tsx src/index.ts router compose -i "$GRAPH" -o "$OUT" + +if command -v jq >/dev/null 2>&1; then + tmp="$OUT.tmp" + jq . "$OUT" > "$tmp" + mv "$tmp" "$OUT" +fi + +printf 'Wrote %s\n' "$OUT" diff --git a/docs/entity-caching/pre-release-testing/scripts/setup-pr.sh b/docs/entity-caching/pre-release-testing/scripts/setup-pr.sh new file mode 100755 index 0000000000..d6aa94d4b5 --- /dev/null +++ b/docs/entity-caching/pre-release-testing/scripts/setup-pr.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -euo pipefail + +PR="${1:-2777}" +DEST="${2:-$PWD/cosmo-entity-caching-pr-$PR}" +BRANCH="entity-caching-pr-$PR" + +if [[ ! -d "$DEST/.git" ]]; then + git clone https://github.com/wundergraph/cosmo.git "$DEST" +fi + +cd "$DEST" +git fetch origin "pull/$PR/merge:$BRANCH" +git checkout "$BRANCH" +corepack enable +pnpm install + +printf 'Ready: %s\n' "$DEST" diff --git a/docs/entity-caching/pre-release-testing/scripts/smoke-test.sh b/docs/entity-caching/pre-release-testing/scripts/smoke-test.sh new file mode 100755 index 0000000000..6ec0ffdc10 --- /dev/null +++ b/docs/entity-caching/pre-release-testing/scripts/smoke-test.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROUTER_GRAPHQL_URL="${ROUTER_GRAPHQL_URL:-http://localhost:3002/graphql}" +PRODUCTS_URL="${PRODUCTS_URL:-http://localhost:4011}" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +KIT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +COMPOSE_FILE="${COMPOSE_FILE:-$KIT_DIR/docker-compose.yml}" + +query='{"query":"query Product($id: ID!) { product(id: $id) { id sku name } }","variables":{"id":"p1"}}' + +stat_value() { + curl -fsS "$PRODUCTS_URL/stats" | node -e 'let s="";process.stdin.on("data",d=>s+=d);process.stdin.on("end",()=>console.log(JSON.parse(s).stats.product))' +} + +docker compose -f "$COMPOSE_FILE" exec -T redis redis-cli FLUSHDB >/dev/null +curl -fsS -X POST "$PRODUCTS_URL/reset" >/dev/null + +before="$(stat_value)" +first="$(curl -fsS -X POST "$ROUTER_GRAPHQL_URL" -H 'content-type: application/json' --data "$query")" +mid="$(stat_value)" +second="$(curl -fsS -X POST "$ROUTER_GRAPHQL_URL" -H 'content-type: application/json' --data "$query")" +after="$(stat_value)" +docker compose -f "$COMPOSE_FILE" restart router >/dev/null +"$SCRIPT_DIR/wait-router.sh" >/dev/null +third="$(curl -fsS -X POST "$ROUTER_GRAPHQL_URL" -H 'content-type: application/json' --data "$query")" +after_restart="$(stat_value)" + +printf 'First response: %s\n' "$first" +printf 'Second response: %s\n' "$second" +printf 'After router restart response: %s\n' "$third" +printf 'Products subgraph product resolver calls: before=%s first=%s second=%s after_router_restart=%s\n' "$before" "$mid" "$after" "$after_restart" + +if [[ "$first" != *'"Widget"'* || "$second" != *'"Widget"'* || "$third" != *'"Widget"'* ]]; then + printf 'Expected every response to contain the example product.\n' >&2 + exit 1 +fi + +if [[ "$before" != "0" || "$mid" != "1" || "$after" != "1" || "$after_restart" != "1" ]]; then + printf 'Expected cold request to call the products subgraph once, warm request to use cache, and post-restart request to use Redis-backed L2.\n' >&2 + exit 1 +fi + +printf 'Smoke test passed. The repeated product query was served from cache, and Redis-backed L2 survived a router restart.\n' diff --git a/docs/entity-caching/pre-release-testing/scripts/wait-router.sh b/docs/entity-caching/pre-release-testing/scripts/wait-router.sh new file mode 100755 index 0000000000..e70f19778a --- /dev/null +++ b/docs/entity-caching/pre-release-testing/scripts/wait-router.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROUTER_URL="${ROUTER_URL:-http://localhost:3002}" +PRODUCTS_URL="${PRODUCTS_URL:-http://localhost:4011}" + +wait_for_url() { + local name="$1" + local url="$2" + for _ in $(seq 1 90); do + if curl -fsS "$url" >/dev/null 2>&1; then + printf '%s is ready: %s\n' "$name" "$url" + return 0 + fi + sleep 1 + done + printf '%s did not become ready: %s\n' "$name" "$url" >&2 + return 1 +} + +wait_for_url products "$PRODUCTS_URL/health" +wait_for_url router "$ROUTER_URL/" diff --git a/graphqlmetrics/README.md b/graphqlmetrics/README.md index 034439041e..69bfcd834c 100644 --- a/graphqlmetrics/README.md +++ b/graphqlmetrics/README.md @@ -14,4 +14,8 @@ To create new migration run: ```bash make new-migration -``` \ No newline at end of file +``` + +## Regenerating proto bindings + +Run `make generate-go` at the repository root after editing any `.proto` under `proto/wg/cosmo/graphqlmetrics/`. diff --git a/playground/package.json b/playground/package.json index 10fbc23bc9..9c255a7392 100644 --- a/playground/package.json +++ b/playground/package.json @@ -32,6 +32,7 @@ "dev": "vite", "build": "tsc && vite build", "preview": "vite preview", + "test": "vitest run", "copy-html": "cp dist/index.html ../router/internal/graphiql/graphiql.html", "build:router": "VITE_SINGLE_FILE_OUTPUT=true pnpm build && pnpm copy-html", "format": "prettier -w -c ." @@ -73,8 +74,12 @@ }, "devDependencies": { "@tailwindcss/typography": "^0.5.10", + "@testing-library/dom": "^10.4.1", + "@testing-library/jest-dom": "^6.9.1", + "@testing-library/react": "^16.3.2", "@types/crypto-js": "^4.2.2", "@types/dagre": "^0.7.52", + "@types/jsdom": "^21.1.7", "@types/lodash": "^4.17.12", "@types/node": "^20.10.0", "@types/prismjs": "^1.26.3", @@ -82,6 +87,7 @@ "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.1", "autoprefixer": "^10.4.16", + "jsdom": "^26.1.0", "postcss": "^8.4.38", "tailwind-merge": "^2.0.0", "tailwind-scrollbar": "^3.1.0", @@ -91,7 +97,8 @@ "vite": "^5.4.21", "vite-plugin-dts": "4.5.4", "vite-plugin-html": "^3.2.2", - "vite-plugin-singlefile": "^2.2.0" + "vite-plugin-singlefile": "^2.2.0", + "vitest": "^3.2.4" }, "overrides": { "rollup": "4.59.0" diff --git a/playground/src/components/playground/cache-explorer-controller.ts b/playground/src/components/playground/cache-explorer-controller.ts new file mode 100644 index 0000000000..365d3652dd --- /dev/null +++ b/playground/src/components/playground/cache-explorer-controller.ts @@ -0,0 +1,72 @@ +import { runCacheExplorer, CacheExplorerConfig } from './cache-explorer-runner'; +import { CacheExplorerState } from './cache-explorer-types'; + +// Module-level singleton that bridges the graphiQLFetch intercept (which wants +// to start a run when the user clicks play) and the CacheExplorerView +// component (which needs to subscribe to state changes and show a Cancel +// button). Keeping this outside React context avoids prop-drilling and lets +// the fetcher dispatch without knowing about the React tree. + +type Listener = (state: CacheExplorerState) => void; + +let currentState: CacheExplorerState = { status: 'idle' }; +const listeners = new Set(); +let currentController: AbortController | null = null; +let currentRunId = 0; + +const emit = (next: CacheExplorerState) => { + currentState = next; + for (const fn of listeners) fn(currentState); +}; + +export const cacheExplorerController = { + getState: (): CacheExplorerState => currentState, + + subscribe: (fn: Listener): (() => void) => { + listeners.add(fn); + fn(currentState); + return () => { + listeners.delete(fn); + }; + }, + + start: async (config: CacheExplorerConfig): Promise => { + if (currentController) { + currentController.abort(); + } + const controller = new AbortController(); + currentController = controller; + const runId = ++currentRunId; + const emitIfCurrent = (next: CacheExplorerState) => { + if (runId === currentRunId) emit(next); + }; + try { + await runCacheExplorer(config, emitIfCurrent, controller.signal); + } catch (err: any) { + if (runId !== currentRunId) { + // A newer run has taken over — do not clobber its state. + return; + } + if (err?.message === 'aborted' || err?.name === 'AbortError') { + emit({ status: 'idle' }); + } else { + emit({ status: 'error', message: err?.message || 'Cache explorer failed' }); + } + } finally { + if (currentController === controller) { + currentController = null; + } + } + }, + + abort: (): void => { + if (currentController) { + currentController.abort(); + currentController = null; + } + }, + + reset: (): void => { + emit({ status: 'idle' }); + }, +}; diff --git a/playground/src/components/playground/cache-explorer-runner.ts b/playground/src/components/playground/cache-explorer-runner.ts new file mode 100644 index 0000000000..b09ad8c0a9 --- /dev/null +++ b/playground/src/components/playground/cache-explorer-runner.ts @@ -0,0 +1,494 @@ +import { + CacheExplorerRequestResult, + CacheExplorerPhaseResult, + CacheExplorerResult, + CacheExplorerState, + FetchSourceBreakdown, + FetchPlanNode, + WARMUP_ITERATIONS, +} from './cache-explorer-types'; +import { CacheMode } from './types'; + +export type CacheExplorerConfig = { + url: string; + query: string; + variables?: string; // raw JSON string from editor + operationName?: string; + headers: Record; // user's editor headers, already sanitized + iterations: number; + cacheMode: CacheMode; // drives which disable headers the cached phase sends +}; + +type ProgressCallback = (state: CacheExplorerState) => void; + +const cacheHeaderKeys = [ + 'X-WG-Disable-Entity-Cache', + 'X-WG-Disable-Entity-Cache-L1', + 'X-WG-Disable-Entity-Cache-L2', + 'X-WG-Cache-Key-Prefix', +]; + +// Strip any pre-existing cache-control headers (case-insensitive) so the runner +// has a clean base to layer its own headers on top of. +const stripCacheHeaders = (headers: Record): Record => { + const out: Record = {}; + const blocked = new Set(cacheHeaderKeys.map((k) => k.toLowerCase())); + for (const [k, v] of Object.entries(headers)) { + if (!blocked.has(k.toLowerCase())) { + out[k] = v; + } + } + return out; +}; + +const applyCacheModeHeaders = ( + headers: Record, + mode: CacheMode, +): Record => { + const h = { ...headers }; + if (mode === 'no-l1') { + h['X-WG-Disable-Entity-Cache-L1'] = 'true'; + } else if (mode === 'no-l2') { + h['X-WG-Disable-Entity-Cache-L2'] = 'true'; + } else if (mode === 'disabled') { + h['X-WG-Disable-Entity-Cache'] = 'true'; + } + // 'enabled' → no extra headers + return h; +}; + +const extractRepresentations = (trace: any): any[] | undefined => { + const representations = trace?.input?.body?.variables?.representations; + return Array.isArray(representations) && representations.length > 0 ? representations : undefined; +}; + +// Build a FetchPlanNode tree from the raw ART trace fetch structure. Preserves +// the hierarchy (Sequence/Parallel containers, nested BatchEntity fetches) so +// the UI can render a side-by-side visual of what the router did with caching +// on vs off. +const buildFetchPlan = (node: any): FetchPlanNode | undefined => { + if (!node) return undefined; + + const t = node.trace || node.datasource_load_trace; + const ct = t?.cache_trace; + const bodySize: number = + t?.output?.extensions?.trace?.response?.body_size ?? 0; + + // Load duration: prefer the actual HTTP load time. For skipped fetches with + // cache trace timing, fall back to the cache operation duration. + let loadNs = t?.duration_load_nanoseconds ?? 0; + if (!loadNs && ct?.duration_nanoseconds) { + loadNs = ct.duration_nanoseconds; + } + + const rawKeys: string[] | undefined = + Array.isArray(ct?.keys) && ct.keys.length > 0 ? ct.keys : undefined; + + const planNode: FetchPlanNode = { + kind: node.kind || '?', + sourceName: node.source_name, + path: node.path, + query: t?.input?.body?.query, + representations: extractRepresentations(t), + cacheKeys: rawKeys, + responseData: t?.output?.data, + loadSkipped: !!t?.load_skipped, + loadDurationMs: loadNs / 1_000_000, + bodySize, + l1Hits: ct?.l1_hit || 0, + l1Misses: ct?.l1_miss || 0, + l2Hits: ct?.l2_hit || 0, + l2Misses: ct?.l2_miss || 0, + l2GetDurationMs: (ct?.l2_get_duration_nanoseconds || 0) / 1_000_000, + entityCount: ct?.entity_count || 0, + children: [], + }; + + const rawChildren = node.children || node.fetches || node.traces; + if (rawChildren) { + for (const c of rawChildren) { + const childNode = buildFetchPlan(c.fetch || c); + if (childNode) planNode.children.push(childNode); + } + } + + return planNode; +}; + +// Walk the trace fetch tree and aggregate cache metrics. Mirrors the existing +// collectCacheSummary pattern in index.tsx but collects more data. +// +// The source breakdown counts per *fetch node*, not per entity key, so the +// unit matches "Subgraph HTTP Requests" in the summary table. A fetch node +// either hits the cache (load_skipped=true → no HTTP call) or misses (HTTP +// call was made). This gives an apples-to-apples cache ratio. +const extractMetricsFromTrace = ( + trace: any, +): { + cacheHits: number; + cacheMisses: number; + entityCount: number; + subgraphRequests: number; + bytesTransferred: number; + sourceBreakdown: FetchSourceBreakdown[]; +} => { + let cacheHits = 0; + let cacheMisses = 0; + let entityCount = 0; + let subgraphRequests = 0; + let bytesTransferred = 0; + const sourceMap = new Map< + string, + { totalFetches: number; l1Cached: number; l2Cached: number; httpCalls: number } + >(); + + const walk = (node: any) => { + if (!node) return; + + const t = node.trace || node.datasource_load_trace; + if (t) { + const bodySize = t.output?.extensions?.trace?.response?.body_size; + // Only count as a subgraph request if the router actually made an HTTP + // call to the subgraph (evidenced by a non-zero response body size). + // Cache hits short-circuit the fetch and don't produce a response body. + if (!t.load_skipped && node.source_id && typeof bodySize === 'number' && bodySize > 0) { + subgraphRequests++; + } + if (typeof bodySize === 'number') { + bytesTransferred += bodySize; + } + + const ct = t.cache_trace; + const sourceName: string = node.source_name || 'unknown'; + if (ct) { + const l1h = ct.l1_hit || 0; + const l1m = ct.l1_miss || 0; + const l2h = ct.l2_hit || 0; + const l2m = ct.l2_miss || 0; + cacheHits += l1h + l2h; + cacheMisses += l1m + l2m; + entityCount += ct.entity_count || 0; + + // Classify this fetch node by how it resolved. Each fetch node is + // exactly one of: L1 cached, L2 cached, or HTTP call. The source + // breakdown counts fetch nodes (not entity keys) so the cache ratio + // uses the same unit as "Subgraph HTTP Requests". + if (sourceName !== 'unknown') { + let entry = sourceMap.get(sourceName); + if (!entry) { + entry = { totalFetches: 0, l1Cached: 0, l2Cached: 0, httpCalls: 0 }; + sourceMap.set(sourceName, entry); + } + entry.totalFetches += 1; + if (l1h > 0 && l1m === 0) { + // All entities in this fetch hit L1 — no HTTP call needed. + entry.l1Cached += 1; + } else if (l2h > 0 && l2m === 0) { + // L1 missed (or wasn't consulted) but L2 served all — no HTTP. + entry.l2Cached += 1; + } else { + // At least one entity missed both cache layers → HTTP call. + // This also covers pass-through fetches (0/0/0/0) where no + // cache was consulted at all. + entry.httpCalls += 1; + } + } + } else if (sourceName !== 'unknown' && !t.load_skipped) { + // Pass-through fetch: no cache_trace means the cache was not consulted + // at all. If the fetch actually ran (not load_skipped), count it as + // an HTTP call so the source breakdown reflects reality. + let entry = sourceMap.get(sourceName); + if (!entry) { + entry = { totalFetches: 0, l1Cached: 0, l2Cached: 0, httpCalls: 0 }; + sourceMap.set(sourceName, entry); + } + entry.totalFetches += 1; + entry.httpCalls += 1; + } + } + + const children = node.children || node.fetches || node.traces; + if (children) { + for (const child of children) { + walk(child.fetch || child); + } + } + }; + + walk(trace); + + const sourceBreakdown: FetchSourceBreakdown[] = []; + for (const [sourceName, stats] of sourceMap.entries()) { + sourceBreakdown.push({ + sourceName, + totalFetches: stats.totalFetches, + l1Cached: stats.l1Cached, + l2Cached: stats.l2Cached, + httpCalls: stats.httpCalls, + }); + } + sourceBreakdown.sort((a, b) => a.sourceName.localeCompare(b.sourceName)); + + return { + cacheHits, + cacheMisses, + entityCount, + subgraphRequests, + bytesTransferred, + sourceBreakdown, + }; +}; + +// Compute server-side processing time in ms from the ART trace info block. +// Sums parse/normalize/validate/planner phase durations, then uses the fetch +// tree to find when the last fetch completed (execute end). +const extractServerDurationMs = (trace: any): number => { + const info = trace?.info; + if (!info) return 0; + const phaseNs = + (info.parse_stats?.duration_nanoseconds || 0) + + (info.normalize_stats?.duration_nanoseconds || 0) + + (info.validate_stats?.duration_nanoseconds || 0) + + (info.planner_stats?.duration_nanoseconds || 0); + + // Find the last fetch end time relative to request start + let maxFetchEndNs = 0; + const plannerEndNs = + (info.planner_stats?.duration_since_start_nanoseconds || 0) + + (info.planner_stats?.duration_nanoseconds || 0); + + const walk = (node: any) => { + if (!node) return; + const t = node.trace || node.datasource_load_trace; + if (t) { + const start = t.duration_since_start_nanoseconds || 0; + const load = t.duration_load_nanoseconds || 0; + // Cache hits with no load timing fall back to cache_trace timing + let effectiveStart = start; + let effectiveLoad = load; + if (!effectiveStart && t.cache_trace) { + effectiveStart = t.cache_trace.duration_since_start_nanoseconds || 0; + effectiveLoad = t.cache_trace.duration_nanoseconds || 0; + } + const end = effectiveStart + effectiveLoad; + if (end > maxFetchEndNs) maxFetchEndNs = end; + } + const children = node.children || node.fetches || node.traces; + if (children) { + for (const child of children) { + walk(child.fetch || child); + } + } + }; + + walk(trace?.fetches || trace); + + // Execute duration = maxFetchEnd - plannerEnd (time spent after planning) + // If we have no fetches, fall back to plannerEnd. + const executeNs = Math.max(0, maxFetchEndNs - plannerEndNs); + const totalNs = phaseNs + executeNs; + return totalNs / 1_000_000; +}; + +const runOne = async ( + config: CacheExplorerConfig, + headers: Record, + index: number, + signal: AbortSignal, +): Promise => { + const body: any = { + query: config.query, + }; + if (config.operationName) body.operationName = config.operationName; + if (config.variables) { + const trimmed = config.variables.trim(); + if (trimmed.length > 0) { + try { + body.variables = JSON.parse(trimmed); + } catch (err: any) { + throw new Error( + `Invalid variables JSON: ${err?.message || 'could not parse'}`, + ); + } + } + } + + const start = performance.now(); + const resp = await fetch(config.url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + ...headers, + }, + body: JSON.stringify(body), + signal, + }); + const parsed = await resp.json(); + const clientDurationMs = performance.now() - start; + + if (resp.status < 200 || resp.status >= 300) { + throw new Error( + `HTTP ${resp.status} ${resp.statusText || ''}`.trim(), + ); + } + if (Array.isArray(parsed?.errors) && parsed.errors.length > 0) { + const first = parsed.errors[0]; + const message = + typeof first?.message === 'string' ? first.message : 'GraphQL error'; + throw new Error(`GraphQL error: ${message}`); + } + + const trace = parsed?.extensions?.trace; + + const metrics = trace + ? extractMetricsFromTrace(trace.fetches || trace) + : { + cacheHits: 0, + cacheMisses: 0, + entityCount: 0, + subgraphRequests: 0, + bytesTransferred: 0, + sourceBreakdown: [], + }; + + const serverDurationMs = trace ? extractServerDurationMs(trace) : clientDurationMs; + const fetchPlan = trace ? buildFetchPlan(trace.fetches || trace) : undefined; + + return { + index, + clientDurationMs, + serverDurationMs, + status: resp.status, + ...metrics, + fetchPlan, + responseData: parsed?.data, + }; +}; + +const computePhaseResult = ( + label: 'cached' | 'uncached', + requests: CacheExplorerRequestResult[], +): CacheExplorerPhaseResult => { + if (requests.length === 0) { + return { + label, + requests, + avgClientLatencyMs: 0, + avgServerLatencyMs: 0, + minServerLatencyMs: 0, + maxServerLatencyMs: 0, + totalCacheHits: 0, + totalCacheMisses: 0, + cacheHitRatio: 0, + totalSubgraphRequests: 0, + totalBytesTransferred: 0, + }; + } + const sumClient = requests.reduce((acc, r) => acc + r.clientDurationMs, 0); + const sumServer = requests.reduce((acc, r) => acc + r.serverDurationMs, 0); + const minServer = Math.min(...requests.map((r) => r.serverDurationMs)); + const maxServer = Math.max(...requests.map((r) => r.serverDurationMs)); + const totalHits = requests.reduce((acc, r) => acc + r.cacheHits, 0); + const totalMisses = requests.reduce((acc, r) => acc + r.cacheMisses, 0); + const totalSubgraph = requests.reduce((acc, r) => acc + r.subgraphRequests, 0); + const totalBytes = requests.reduce((acc, r) => acc + r.bytesTransferred, 0); + const ratioDenom = totalHits + totalMisses; + + return { + label, + requests, + avgClientLatencyMs: sumClient / requests.length, + avgServerLatencyMs: sumServer / requests.length, + minServerLatencyMs: minServer, + maxServerLatencyMs: maxServer, + totalCacheHits: totalHits, + totalCacheMisses: totalMisses, + cacheHitRatio: ratioDenom > 0 ? totalHits / ratioDenom : 0, + totalSubgraphRequests: totalSubgraph, + totalBytesTransferred: totalBytes, + }; +}; + +export const runCacheExplorer = async ( + config: CacheExplorerConfig, + onProgress: ProgressCallback, + signal: AbortSignal, +): Promise => { + if (config.cacheMode === 'disabled') { + throw new Error('Cache mode is "disabled" — nothing to compare. Pick a cache mode first.'); + } + + const prefix = `cache-explorer-${ + (globalThis.crypto?.randomUUID?.() || `${Date.now()}-${Math.random()}`).toString().slice(0, 12) + }`; + const baseHeaders = stripCacheHeaders(config.headers); + baseHeaders['X-WG-TRACE'] = 'true'; + + const cachedHeaders = applyCacheModeHeaders(baseHeaders, config.cacheMode); + cachedHeaders['X-WG-Cache-Key-Prefix'] = prefix; + + const uncachedHeaders = { ...baseHeaders, 'X-WG-Disable-Entity-Cache': 'true' }; + + const cachedResults: CacheExplorerRequestResult[] = []; + const uncachedResults: CacheExplorerRequestResult[] = []; + + const emit = (phase: 'warmup' | 'cached' | 'uncached', current: number, total: number) => { + onProgress({ + status: 'running', + phase, + current, + total, + cachedResults: [...cachedResults], + uncachedResults: [...uncachedResults], + }); + }; + + // Uncached phase runs first so the user sees the baseline immediately. + // This also means the cached phase's "warm-up" is effectively the uncached + // phase itself — by the time we start measuring cached iterations, the L2 + // entity cache has been populated by the preceding uncached requests (with + // a different cache key prefix, so entries don't collide). We still run an + // explicit warm-up pass afterwards to ensure the cached-prefix entries are + // primed for the measurement. + for (let i = 0; i < config.iterations; i++) { + if (signal.aborted) throw new Error('aborted'); + emit('uncached', i + 1, config.iterations); + const result = await runOne(config, uncachedHeaders, i, signal); + uncachedResults.push(result); + emit('uncached', i + 1, config.iterations); + } + + // Warm-up phase: pre-populate the cache under the cached-phase prefix so + // the measured cached iterations are true cache hits. Results are NOT + // recorded — these just prime the cache. + for (let i = 0; i < WARMUP_ITERATIONS; i++) { + if (signal.aborted) throw new Error('aborted'); + emit('warmup', i + 1, WARMUP_ITERATIONS); + await runOne(config, cachedHeaders, i, signal); + } + + // Cached phase + for (let i = 0; i < config.iterations; i++) { + if (signal.aborted) throw new Error('aborted'); + emit('cached', i + 1, config.iterations); + const result = await runOne(config, cachedHeaders, i, signal); + cachedResults.push(result); + emit('cached', i + 1, config.iterations); + } + + const cached = computePhaseResult('cached', cachedResults); + const uncached = computePhaseResult('uncached', uncachedResults); + const speedup = + cached.avgServerLatencyMs > 0 ? uncached.avgServerLatencyMs / cached.avgServerLatencyMs : 0; + + const result: CacheExplorerResult = { + timestamp: Date.now(), + iterations: config.iterations, + cached, + uncached, + speedup, + }; + + onProgress({ status: 'complete', result }); + return result; +}; diff --git a/playground/src/components/playground/cache-explorer-types.ts b/playground/src/components/playground/cache-explorer-types.ts new file mode 100644 index 0000000000..3dd31ee513 --- /dev/null +++ b/playground/src/components/playground/cache-explorer-types.ts @@ -0,0 +1,89 @@ +// Per-subgraph breakdown of how fetches resolved. Counted per *fetch node* +// (not per entity key) so the unit matches "Subgraph HTTP Requests" in the +// summary table. A fetch node either hits the cache (load_skipped) or makes +// an HTTP call — that's the apples-to-apples comparison for the cache ratio. +export type FetchSourceBreakdown = { + sourceName: string; + totalFetches: number; // fetch nodes routed to this subgraph + l1Cached: number; // fetches fully served from L1 (coordinate / request-scoped) + l2Cached: number; // fetches fully served from L2 (cross-request entity cache) + httpCalls: number; // fetches that required an actual HTTP call +}; + +// FetchPlanNode is a visual representation of one node in the router's fetch +// tree extracted from the ART trace. Used to render a side-by-side hierarchy +// of what the router did with caching on vs off, so users can see which +// fetches get eliminated, which become L1/L2 hits, and where the time goes. +export type FetchPlanNode = { + kind: string; // "Sequence" | "Parallel" | "Single" | "Entity" | "BatchEntity" + sourceName?: string; // subgraph name for leaf fetches + path?: string; // response path (e.g. "currentViewer.recommendedArticles") + query?: string; // raw GraphQL query string sent to the subgraph (hover tooltip) + representations?: any[]; // request representations for _entities fetches; used for stable matching + cacheKeys?: string[]; // raw cache key strings from cache_trace.keys (click-to-expand) + responseData?: any; // parsed response body from output.data (may be null for cache hits) + loadSkipped: boolean; // router marked this as skipped (no HTTP call) + loadDurationMs: number; // actual HTTP round-trip time in ms (0 if skipped) + bodySize: number; // response body bytes + l1Hits: number; + l1Misses: number; + l2Hits: number; + l2Misses: number; + l2GetDurationMs: number; // time the L2 cache took to return data (from cache_trace) + entityCount: number; + children: FetchPlanNode[]; +}; + +export type CacheExplorerRequestResult = { + index: number; + clientDurationMs: number; // wall-clock (performance.now) + serverDurationMs: number; // from ART: total server processing time + status: number; + cacheHits: number; // l1_hit + l2_hit across all fetches + cacheMisses: number; // l1_miss + l2_miss across all fetches + entityCount: number; // sum of entity_count across all fetches + subgraphRequests: number; // count of non-skipped fetch nodes with source_id + bytesTransferred: number; // sum of response body_size from subgraph traces + sourceBreakdown: FetchSourceBreakdown[]; + fetchPlan?: FetchPlanNode; // root of the fetch tree for this request + responseData?: any; // full GraphQL response data (for cached-vs-uncached diff) +}; + +export type CacheExplorerPhaseResult = { + label: 'cached' | 'uncached'; + requests: CacheExplorerRequestResult[]; + avgClientLatencyMs: number; + avgServerLatencyMs: number; + minServerLatencyMs: number; + maxServerLatencyMs: number; + totalCacheHits: number; + totalCacheMisses: number; + cacheHitRatio: number; // 0..1 + totalSubgraphRequests: number; + totalBytesTransferred: number; +}; + +export type CacheExplorerResult = { + timestamp: number; + iterations: number; + cached: CacheExplorerPhaseResult; + uncached: CacheExplorerPhaseResult; + speedup: number; // uncached.avgServerLatencyMs / cached.avgServerLatencyMs +}; + +export type CacheExplorerRunningState = { + status: 'running'; + phase: 'warmup' | 'cached' | 'uncached'; + current: number; + total: number; + cachedResults: CacheExplorerRequestResult[]; + uncachedResults: CacheExplorerRequestResult[]; +}; + +export const WARMUP_ITERATIONS = 3; + +export type CacheExplorerState = + | { status: 'idle' } + | CacheExplorerRunningState + | { status: 'complete'; result: CacheExplorerResult } + | { status: 'error'; message: string }; diff --git a/playground/src/components/playground/cache-explorer-utils.test.ts b/playground/src/components/playground/cache-explorer-utils.test.ts new file mode 100644 index 0000000000..908de2a436 --- /dev/null +++ b/playground/src/components/playground/cache-explorer-utils.test.ts @@ -0,0 +1,265 @@ +import assert from 'node:assert/strict'; +import { test } from 'vitest'; + +import { + collectFetchPairs, + dedupeCacheKeysForDisplay, + formatCacheKey, + summarizeFetchIdentity, +} from './cache-explorer-utils'; +import type { FetchPlanNode } from './cache-explorer-types'; + +const leaf = (overrides: Partial): FetchPlanNode => ({ + kind: 'Entity', + path: 'articles.@.relatedArticles', + sourceName: 'cachegraph', + query: 'query Q { _entities { ... on Article { id title tags } } }', + representations: undefined, + cacheKeys: undefined, + responseData: undefined, + loadSkipped: false, + loadDurationMs: 0, + bodySize: 0, + l1Hits: 0, + l1Misses: 0, + l2Hits: 0, + l2Misses: 0, + l2GetDurationMs: 0, + entityCount: 1, + children: [], + ...overrides, +}); + +const container = (...children: FetchPlanNode[]): FetchPlanNode => ({ + kind: 'Sequence', + path: '', + query: undefined, + cacheKeys: undefined, + responseData: undefined, + sourceName: undefined, + loadSkipped: false, + loadDurationMs: 0, + bodySize: 0, + l1Hits: 0, + l1Misses: 0, + l2Hits: 0, + l2Misses: 0, + l2GetDurationMs: 0, + entityCount: 0, + children, +}); + +test('formatCacheKey strips synthetic cache explorer prefixes from displayed keys', () => { + const raw = 'cache-explorer-abc123{"__typename":"Article","key":{"id":"2"}}'; + assert.equal(formatCacheKey(raw), '{\n "__typename": "Article",\n "key": {\n "id": "2"\n }\n}'); + + const legacyRaw = 'explorer-legacy{"__typename":"Article","key":{"id":"3"}}'; + assert.equal(formatCacheKey(legacyRaw), '{\n "__typename": "Article",\n "key": {\n "id": "3"\n }\n}'); +}); + +test('dedupeCacheKeysForDisplay removes duplicate entity keys while preserving first-seen order', () => { + const keys = [ + 'cache-explorer-run{"__typename":"Article","key":{"id":"3"}}', + 'cache-explorer-run{"__typename":"Article","key":{"id":"4"}}', + 'cache-explorer-run{"__typename":"Article","key":{"id":"1"}}', + 'cache-explorer-run{"__typename":"Article","key":{"id":"3"}}', + 'cache-explorer-run{"__typename":"Article","key":{"id":"1"}}', + 'cache-explorer-run{"__typename":"Article","key":{"id":"2"}}', + ]; + + assert.deepEqual(dedupeCacheKeysForDisplay(keys), [ + 'cache-explorer-run{"__typename":"Article","key":{"id":"3"}}', + 'cache-explorer-run{"__typename":"Article","key":{"id":"4"}}', + 'cache-explorer-run{"__typename":"Article","key":{"id":"1"}}', + 'cache-explorer-run{"__typename":"Article","key":{"id":"2"}}', + ]); +}); + +test('collectFetchPairs matches fetches by stable entity identity instead of child index', () => { + const cachedPlan = container( + leaf({ + loadSkipped: true, + cacheKeys: ['cache-explorer-run{"__typename":"Article","key":{"id":"2"}}'], + }), + leaf({ + loadSkipped: true, + cacheKeys: ['cache-explorer-run{"__typename":"Article","key":{"id":"3"}}'], + }), + ); + + const uncachedPlan = container( + leaf({ + responseData: { + _entities: [{ __typename: 'Article', id: '3', title: 'Cache Invalidation Strategies' }], + }, + }), + leaf({ + responseData: { + _entities: [{ __typename: 'Article', id: '2', title: 'Advanced Federation Patterns' }], + }, + }), + ); + + const pairs = collectFetchPairs(cachedPlan, uncachedPlan); + assert.equal(pairs.length, 2); + + assert.deepEqual(pairs[0].pair.cached?.cacheKeys, ['cache-explorer-run{"__typename":"Article","key":{"id":"2"}}']); + assert.deepEqual(pairs[0].pair.uncached?.responseData, { + _entities: [{ __typename: 'Article', id: '2', title: 'Advanced Federation Patterns' }], + }); + + assert.deepEqual(pairs[1].pair.cached?.cacheKeys, ['cache-explorer-run{"__typename":"Article","key":{"id":"3"}}']); + assert.deepEqual(pairs[1].pair.uncached?.responseData, { + _entities: [{ __typename: 'Article', id: '3', title: 'Cache Invalidation Strategies' }], + }); +}); + +test('collectFetchPairs matches semantically identical fetches even when query shape differs', () => { + const cachedPlan = container( + leaf({ + kind: 'Single', + sourceName: 'cachegraph', + path: 'articles.@.relatedArticles', + query: 'query A { _entities(representations: $reps) { ... on Article { title tags } } }', + cacheKeys: ['cache-explorer-run{"__typename":"Article","key":{"id":"2"}}'], + loadSkipped: true, + }), + ); + + const uncachedPlan = container( + leaf({ + kind: 'BatchEntity', + sourceName: 'cachegraph', + path: 'articles.@.relatedArticles', + query: 'query B { _entities(representations: $reps) { ... on Article { __typename title tags } } }', + responseData: { + _entities: [{ __typename: 'Article', id: '2', title: 'Advanced Federation Patterns' }], + }, + }), + ); + + const pairs = collectFetchPairs(cachedPlan, uncachedPlan); + assert.equal(pairs.length, 1); + assert.deepEqual(pairs[0].pair.cached?.cacheKeys, ['cache-explorer-run{"__typename":"Article","key":{"id":"2"}}']); + assert.deepEqual(pairs[0].pair.uncached?.responseData, { + _entities: [{ __typename: 'Article', id: '2', title: 'Advanced Federation Patterns' }], + }); +}); + +test('collectFetchPairs matches batch entity fetches by representations when response items have no ids', () => { + const cachedPlan = container( + leaf({ + kind: 'BatchEntity', + sourceName: 'cachegraph', + path: 'articles.@.relatedArticles', + query: 'query A { _entities(representations: $reps) { ... on Article { __typename title tags } } }', + representations: [ + { __typename: 'Article', id: '3' }, + { __typename: 'Article', id: '4' }, + { __typename: 'Article', id: '1' }, + { __typename: 'Article', id: '2' }, + ], + cacheKeys: [ + 'cache-explorer-run{"__typename":"Article","key":{"id":"3"}}', + 'cache-explorer-run{"__typename":"Article","key":{"id":"4"}}', + 'cache-explorer-run{"__typename":"Article","key":{"id":"1"}}', + 'cache-explorer-run{"__typename":"Article","key":{"id":"2"}}', + ], + responseData: { + _entities: [ + { __typename: 'Article', title: 'Cache Invalidation Strategies' }, + { __typename: 'Article', title: 'Performance Tuning with Entity Caching' }, + { __typename: 'Article', title: 'Introduction to GraphQL Caching' }, + { __typename: 'Article', title: 'Advanced Federation Patterns' }, + ], + }, + loadSkipped: true, + }), + leaf({ + kind: 'BatchEntity', + sourceName: 'cachegraph', + path: 'articles.@.relatedArticles', + query: 'query B { _entities(representations: $reps) { ... on Article { __typename title tags } } }', + representations: [ + { __typename: 'Article', id: '3' }, + { __typename: 'Article', id: '4' }, + { __typename: 'Article', id: '1' }, + { __typename: 'Article', id: '3' }, + ], + responseData: { + _entities: [ + { __typename: 'Article', title: 'Cache Invalidation Strategies' }, + { __typename: 'Article', title: 'Performance Tuning with Entity Caching' }, + { __typename: 'Article', title: 'Introduction to GraphQL Caching' }, + { __typename: 'Article', title: 'Cache Invalidation Strategies' }, + ], + }, + loadSkipped: true, + }), + ); + + const uncachedPlan = container( + leaf({ + kind: 'BatchEntity', + sourceName: 'cachegraph', + path: 'articles.@.relatedArticles', + query: 'query C { _entities(representations: $reps) { ... on Article { __typename title tags } } }', + representations: [ + { __typename: 'Article', id: '3' }, + { __typename: 'Article', id: '4' }, + { __typename: 'Article', id: '1' }, + { __typename: 'Article', id: '3' }, + ], + responseData: { + _entities: [ + { __typename: 'Article', title: 'Cache Invalidation Strategies' }, + { __typename: 'Article', title: 'Performance Tuning with Entity Caching' }, + { __typename: 'Article', title: 'Introduction to GraphQL Caching' }, + { __typename: 'Article', title: 'Cache Invalidation Strategies' }, + ], + }, + }), + leaf({ + kind: 'BatchEntity', + sourceName: 'cachegraph', + path: 'articles.@.relatedArticles', + query: 'query D { _entities(representations: $reps) { ... on Article { __typename title tags } } }', + representations: [ + { __typename: 'Article', id: '3' }, + { __typename: 'Article', id: '4' }, + { __typename: 'Article', id: '1' }, + { __typename: 'Article', id: '2' }, + ], + responseData: { + _entities: [ + { __typename: 'Article', title: 'Cache Invalidation Strategies' }, + { __typename: 'Article', title: 'Performance Tuning with Entity Caching' }, + { __typename: 'Article', title: 'Introduction to GraphQL Caching' }, + { __typename: 'Article', title: 'Advanced Federation Patterns' }, + ], + }, + }), + ); + + const pairs = collectFetchPairs(cachedPlan, uncachedPlan); + assert.equal(pairs.length, 2); + assert.deepEqual(pairs[0].pair.cached?.representations, [ + { __typename: 'Article', id: '3' }, + { __typename: 'Article', id: '4' }, + { __typename: 'Article', id: '1' }, + { __typename: 'Article', id: '2' }, + ]); + assert.deepEqual(pairs[0].pair.uncached?.representations, [ + { __typename: 'Article', id: '3' }, + { __typename: 'Article', id: '4' }, + { __typename: 'Article', id: '1' }, + { __typename: 'Article', id: '2' }, + ]); +}); + +test('summarizeFetchIdentity exposes a readable row label for paired fetches', () => { + const node = leaf({ + cacheKeys: ['cache-explorer-run{"__typename":"Article","key":{"id":"2"}}'], + }); + assert.equal(summarizeFetchIdentity(node), 'Article{id:2}'); +}); diff --git a/playground/src/components/playground/cache-explorer-utils.ts b/playground/src/components/playground/cache-explorer-utils.ts new file mode 100644 index 0000000000..6a99938134 --- /dev/null +++ b/playground/src/components/playground/cache-explorer-utils.ts @@ -0,0 +1,267 @@ +import { FetchPlanNode } from './cache-explorer-types'; + +export type FetchPair = { + cached?: FetchPlanNode; + uncached?: FetchPlanNode; +}; + +const stripSyntheticPrefix = (raw: string): string => { + const jsonStart = raw.indexOf('{'); + if (jsonStart < 0) return raw; + const prefix = raw.slice(0, jsonStart); + if (/^(cache-explorer|explorer)-/.test(prefix)) { + return raw.slice(jsonStart); + } + return raw; +}; + +const stableStringify = (value: any): string => { + if (Array.isArray(value)) { + return `[${value.map(stableStringify).join(',')}]`; + } + if (value && typeof value === 'object') { + return `{${Object.keys(value) + .sort() + .map((key) => `${JSON.stringify(key)}:${stableStringify(value[key])}`) + .join(',')}}`; + } + return JSON.stringify(value); +}; + +const normalizeEntityIdentity = (__typename: string, key: any): string => { + return stableStringify({ __typename, key }); +}; + +const extractCacheKeyIdentities = (keys?: string[]): string[] => { + if (!keys || keys.length === 0) return []; + const identities = new Set(); + for (const raw of keys) { + try { + const parsed = JSON.parse(stripSyntheticPrefix(raw)); + if (parsed?.__typename && parsed?.key && typeof parsed.key === 'object') { + identities.add(normalizeEntityIdentity(parsed.__typename, parsed.key)); + } + } catch { + // Ignore malformed cache keys in the UI matcher. + } + } + return Array.from(identities).sort(); +}; + +const extractResponseIdentitiesInto = (value: any, out: Set) => { + if (Array.isArray(value)) { + for (const item of value) { + extractResponseIdentitiesInto(item, out); + } + return; + } + if (!value || typeof value !== 'object') { + return; + } + + if (value.__typename && value.id != null) { + out.add(normalizeEntityIdentity(String(value.__typename), { id: String(value.id) })); + } + + for (const child of Object.values(value)) { + extractResponseIdentitiesInto(child, out); + } +}; + +const extractResponseIdentities = (responseData: any): string[] => { + if (responseData == null) return []; + const identities = new Set(); + extractResponseIdentitiesInto(responseData, identities); + return Array.from(identities).sort(); +}; + +const extractRepresentationsIdentity = (representations?: any[]): string => { + if (!representations || representations.length === 0) return ''; + return representations.map((representation) => stableStringify(representation)).join('|'); +}; + +const fetchBucket = (node: FetchPlanNode): string => + [node.path || '', node.sourceName || ''].join('||'); + +const fetchIdentity = (node: FetchPlanNode): string => { + const representationsIdentity = extractRepresentationsIdentity(node.representations); + if (representationsIdentity) { + return representationsIdentity; + } + const cacheIdentities = extractCacheKeyIdentities(node.cacheKeys); + if (cacheIdentities.length > 0) { + return cacheIdentities.join('|'); + } + const responseIdentities = extractResponseIdentities(node.responseData); + if (responseIdentities.length > 0) { + return responseIdentities.join('|'); + } + return ''; +}; + +const summarizeIdentity = (identity: string): string => { + if (!identity) return ''; + try { + const parsed = JSON.parse(identity); + const typename = parsed?.__typename; + const key = parsed?.key; + if (typename && key && typeof key === 'object') { + const parts = Object.entries(key) + .map(([k, v]) => `${k}:${String(v)}`) + .join(', '); + return `${typename}{${parts}}`; + } + } catch { + // fall through + } + return identity; +}; + +const isContainerNode = (node: FetchPlanNode): boolean => + node.kind === 'Sequence' || node.kind === 'Parallel'; + +const flattenLeafFetches = (root: FetchPlanNode | undefined): FetchPlanNode[] => { + if (!root) return []; + const out: FetchPlanNode[] = []; + const walk = (node: FetchPlanNode) => { + if (isContainerNode(node)) { + for (const child of node.children || []) { + walk(child); + } + return; + } + out.push(node); + }; + walk(root); + return out; +}; + +export const formatCacheKey = (raw: string): string => { + const withoutPrefix = stripSyntheticPrefix(raw); + try { + const pretty = JSON.stringify(JSON.parse(withoutPrefix), null, 2); + return pretty; + } catch { + return withoutPrefix; + } +}; + +export const dedupeCacheKeysForDisplay = (keys?: string[]): string[] => { + if (!keys || keys.length === 0) return []; + + const seen = new Set(); + const out: string[] = []; + for (const raw of keys) { + const normalized = stripSyntheticPrefix(raw); + if (seen.has(normalized)) { + continue; + } + seen.add(normalized); + out.push(raw); + } + return out; +}; + +export const summarizeFetchIdentity = (node?: FetchPlanNode): string | undefined => { + if (!node) return undefined; + const identity = fetchIdentity(node); + if (!identity) return undefined; + const parts = identity.split('|').filter(Boolean); + if (parts.length === 0) return undefined; + if (parts.length === 1) return summarizeIdentity(parts[0]); + return `${parts.length} entities`; +}; + +export const collectFetchPairs = ( + cached: FetchPlanNode | undefined, + uncached: FetchPlanNode | undefined, +): Array<{ path: string; pair: FetchPair }> => { + const cachedLeaves = flattenLeafFetches(cached); + const uncachedLeaves = flattenLeafFetches(uncached); + const bucketOrder: string[] = []; + const seenBuckets = new Set(); + const rememberBucket = (bucket: string) => { + if (!seenBuckets.has(bucket)) { + seenBuckets.add(bucket); + bucketOrder.push(bucket); + } + }; + + const cachedByBucket = new Map(); + for (const node of cachedLeaves) { + const bucket = fetchBucket(node); + rememberBucket(bucket); + const list = cachedByBucket.get(bucket) || []; + list.push(node); + cachedByBucket.set(bucket, list); + } + + const uncachedByBucket = new Map(); + for (const node of uncachedLeaves) { + const bucket = fetchBucket(node); + rememberBucket(bucket); + const list = uncachedByBucket.get(bucket) || []; + list.push(node); + uncachedByBucket.set(bucket, list); + } + + const out: Array<{ path: string; pair: FetchPair }> = []; + + for (const bucket of bucketOrder) { + const cachedNodes = [...(cachedByBucket.get(bucket) || [])]; + const uncachedNodes = [...(uncachedByBucket.get(bucket) || [])]; + const remainingUncached = new Set(uncachedNodes.map((_, i) => i)); + + const uncachedByIdentity = new Map(); + for (let i = 0; i < uncachedNodes.length; i++) { + const identity = fetchIdentity(uncachedNodes[i]); + if (!identity) continue; + const list = uncachedByIdentity.get(identity) || []; + list.push(i); + uncachedByIdentity.set(identity, list); + } + + for (const cachedNode of cachedNodes) { + const identity = fetchIdentity(cachedNode); + let matchedIndex: number | undefined; + if (identity) { + const candidates = uncachedByIdentity.get(identity); + while (candidates && candidates.length > 0) { + const idx = candidates.shift(); + if (idx != null && remainingUncached.has(idx)) { + matchedIndex = idx; + break; + } + } + } + if (matchedIndex == null) { + matchedIndex = Array.from(remainingUncached).sort((a, b) => a - b)[0]; + } + + if (matchedIndex != null) { + remainingUncached.delete(matchedIndex); + const uncachedNode = uncachedNodes[matchedIndex]; + const ref = cachedNode || uncachedNode; + out.push({ + path: ref.path || '', + pair: { cached: cachedNode, uncached: uncachedNode }, + }); + } else { + out.push({ + path: cachedNode.path || '', + pair: { cached: cachedNode }, + }); + } + } + + for (const idx of Array.from(remainingUncached).sort((a, b) => a - b)) { + const uncachedNode = uncachedNodes[idx]; + out.push({ + path: uncachedNode.path || '', + pair: { uncached: uncachedNode }, + }); + } + } + + return out; +}; diff --git a/playground/src/components/playground/cache-explorer-view.tsx b/playground/src/components/playground/cache-explorer-view.tsx new file mode 100644 index 0000000000..11c5dbcab8 --- /dev/null +++ b/playground/src/components/playground/cache-explorer-view.tsx @@ -0,0 +1,1484 @@ +import { useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'; +import { createPortal } from 'react-dom'; +import { BoltIcon } from '@heroicons/react/24/solid'; +import { LuActivity } from 'react-icons/lu'; +import { ExclamationTriangleIcon } from '@radix-ui/react-icons'; +import { parse as gqlParse, print as gqlPrint } from 'graphql'; +import { useLocalStorage } from '@/lib/use-local-storage'; +import { cn } from '@/lib/utils'; +import { Button } from '../ui/button'; +import { EmptyState } from '../empty-state'; +import { cacheExplorerController } from './cache-explorer-controller'; +import { + collectFetchPairs, + dedupeCacheKeysForDisplay, + FetchPair, + formatCacheKey, + summarizeFetchIdentity, +} from './cache-explorer-utils'; +import { + CacheExplorerPhaseResult, + CacheExplorerRequestResult, + CacheExplorerState, + FetchPlanNode, +} from './cache-explorer-types'; +import { WARMUP_ITERATIONS } from './cache-explorer-types'; +import { CacheMode, PlaygroundContext } from './types'; + +const cacheModeLabels: Record = { + enabled: 'Caching enabled (L1 + L2)', + 'no-l1': 'Caching (L2 only)', + 'no-l2': 'Caching (L1 only)', + disabled: 'Cache disabled', +}; + +// --- Formatters --- + +const formatMs = (ms: number): string => { + if (ms < 1) return `${(ms * 1000).toFixed(0)}µs`; + if (ms < 10) return `${ms.toFixed(2)}ms`; + if (ms < 1000) return `${ms.toFixed(1)}ms`; + return `${(ms / 1000).toFixed(2)}s`; +}; + +const formatBytes = (n: number): string => { + if (n < 1024) return `${n}B`; + if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)}KB`; + return `${(n / (1024 * 1024)).toFixed(2)}MB`; +}; + +const formatPercent = (v: number): string => `${(v * 100).toFixed(0)}%`; + +// --- Running phase aggregation (partial results for live stats) --- + +const aggregatePartial = (reqs: CacheExplorerRequestResult[]): CacheExplorerPhaseResult => { + if (reqs.length === 0) { + return { + label: 'cached', + requests: reqs, + avgClientLatencyMs: 0, + avgServerLatencyMs: 0, + minServerLatencyMs: 0, + maxServerLatencyMs: 0, + totalCacheHits: 0, + totalCacheMisses: 0, + cacheHitRatio: 0, + totalSubgraphRequests: 0, + totalBytesTransferred: 0, + }; + } + const serverLats = reqs.map((r) => r.serverDurationMs); + const hits = reqs.reduce((a, r) => a + r.cacheHits, 0); + const misses = reqs.reduce((a, r) => a + r.cacheMisses, 0); + return { + label: 'cached', + requests: reqs, + avgClientLatencyMs: reqs.reduce((a, r) => a + r.clientDurationMs, 0) / reqs.length, + avgServerLatencyMs: serverLats.reduce((a, b) => a + b, 0) / reqs.length, + minServerLatencyMs: Math.min(...serverLats), + maxServerLatencyMs: Math.max(...serverLats), + totalCacheHits: hits, + totalCacheMisses: misses, + cacheHitRatio: hits + misses > 0 ? hits / (hits + misses) : 0, + totalSubgraphRequests: reqs.reduce((a, r) => a + r.subgraphRequests, 0), + totalBytesTransferred: reqs.reduce((a, r) => a + r.bytesTransferred, 0), + }; +}; + +// --- Latency chart (inline SVG, no deps) --- + +const LatencyChart = ({ + cached, + uncached, + iterations, +}: { + cached: CacheExplorerRequestResult[]; + uncached: CacheExplorerRequestResult[]; + iterations: number; +}) => { + // Internal viewBox dimensions — the SVG scales to the container width via + // preserveAspectRatio. Height is a ratio of width for a consistent aspect. + const width = 800; + const height = 260; + // Extra top padding so the legend sits in dedicated headroom above the data. + const padding = { top: 56, right: 20, bottom: 36, left: 56 }; + const plotW = width - padding.left - padding.right; + const plotH = height - padding.top - padding.bottom; + + const allValues = [ + ...cached.map((r) => r.serverDurationMs), + ...uncached.map((r) => r.serverDurationMs), + ]; + // 15% headroom gives the line some breathing room below the (now reserved) + // legend area at the very top. + const maxY = allValues.length > 0 ? Math.max(...allValues) * 1.15 : 10; + const minY = 0; + + const xForIndex = (i: number) => + padding.left + (iterations > 1 ? (i / (iterations - 1)) * plotW : plotW / 2); + const yForValue = (v: number) => + padding.top + plotH - ((v - minY) / (maxY - minY || 1)) * plotH; + + const toPath = (reqs: CacheExplorerRequestResult[]): string => + reqs + .map((r, i) => `${i === 0 ? 'M' : 'L'} ${xForIndex(r.index)} ${yForValue(r.serverDurationMs)}`) + .join(' '); + + const yTicks = [0, 0.25, 0.5, 0.75, 1].map((t) => ({ + y: padding.top + plotH - t * plotH, + value: minY + t * (maxY - minY), + })); + + return ( + + {/* Grid */} + {yTicks.map((t, idx) => ( + + + + {formatMs(t.value)} + + + ))} + {/* Axes */} + + + {/* X labels */} + + 1 + + + {iterations} + + + iteration + + {/* Uncached line (red) */} + {uncached.length > 0 && ( + <> + + {uncached.map((r) => ( + + ))} + + )} + {/* Cached line (green) */} + {cached.length > 0 && ( + <> + + {cached.map((r) => ( + + ))} + + )} + {/* Legend — horizontal, sits in reserved headroom above the plot */} + + + + Cached + + + + Uncached + + + + ); +}; + +// --- Summary table --- + +const SummaryTable = ({ + cached, + uncached, + cacheRatio, +}: { + cached: CacheExplorerPhaseResult; + uncached: CacheExplorerPhaseResult; + cacheRatio: number; +}) => { + const latencyReduction = + uncached.avgServerLatencyMs > 0 + ? (1 - cached.avgServerLatencyMs / uncached.avgServerLatencyMs) + : 0; + const bytesReduction = + uncached.totalBytesTransferred > 0 + ? (1 - cached.totalBytesTransferred / uncached.totalBytesTransferred) + : 0; + + const rows: Array<{ label: string; cached: string; uncached: string }> = [ + { + label: 'Server Avg', + cached: formatMs(cached.avgServerLatencyMs), + uncached: formatMs(uncached.avgServerLatencyMs), + }, + { + label: 'Server Min', + cached: formatMs(cached.minServerLatencyMs), + uncached: formatMs(uncached.minServerLatencyMs), + }, + { + label: 'Server Max', + cached: formatMs(cached.maxServerLatencyMs), + uncached: formatMs(uncached.maxServerLatencyMs), + }, + { + label: 'Avg Latency Reduction', + cached: formatPercent(Math.max(0, latencyReduction)), + uncached: '—', + }, + { + label: 'Client Avg', + cached: formatMs(cached.avgClientLatencyMs), + uncached: formatMs(uncached.avgClientLatencyMs), + }, + { + label: 'Subgraph Requests', + cached: String(cached.totalSubgraphRequests), + uncached: String(uncached.totalSubgraphRequests), + }, + { + label: 'Subgraph Cache Ratio', + cached: formatPercent(cacheRatio), + uncached: '—', + }, + { + label: 'Subgraph → Router Bytes', + cached: formatBytes(cached.totalBytesTransferred), + uncached: formatBytes(uncached.totalBytesTransferred), + }, + { + label: 'Subgraph → Router Bytes Reduction', + cached: formatPercent(Math.max(0, bytesReduction)), + uncached: '—', + }, + ]; + + return ( +
+ + + + + + + + + + {rows.map((r, i) => ( + + + + + + ))} + +
Metric + Cached + + Uncached +
{r.label}{r.cached}{r.uncached}
+
+ ); +}; + +// --- Fetch breakdown (per subgraph) --- +// +// Groups every entity-lookup key seen across the cached phase by the subgraph +// that would serve it, and shows how many of those keys were resolved from +// L1 cache, L2 cache, or required a real HTTP call. Directly answers the +// user's question "which subgraph is caching saving me from calling?" + +type MergedSourceBreakdown = { + sourceName: string; + totalFetches: number; + l1Cached: number; + l2Cached: number; + httpCalls: number; +}; + +const FetchBreakdown = ({ requests }: { requests: CacheExplorerRequestResult[] }) => { + const merged = useMemo(() => { + const map = new Map(); + for (const r of requests) { + for (const sb of r.sourceBreakdown) { + const cur = map.get(sb.sourceName) || { + sourceName: sb.sourceName, + totalFetches: 0, + l1Cached: 0, + l2Cached: 0, + httpCalls: 0, + }; + cur.totalFetches += sb.totalFetches; + cur.l1Cached += sb.l1Cached; + cur.l2Cached += sb.l2Cached; + cur.httpCalls += sb.httpCalls; + map.set(sb.sourceName, cur); + } + } + return Array.from(map.values()).sort((a, b) => a.sourceName.localeCompare(b.sourceName)); + }, [requests]); + + if (merged.length === 0) return null; + + return ( +
+
+ Fetch Breakdown by Subgraph (cached phase) +
+ + + + + + + + + + + + + {merged.map((s, i) => { + const cached = s.l1Cached + s.l2Cached; + const ratio = s.totalFetches > 0 ? cached / s.totalFetches : 0; + return ( + + + + + + + + + ); + })} + +
SubgraphFetchesL1 CachedL2 CachedHTTPCache Ratio
{s.sourceName} + {s.totalFetches} + + {s.l1Cached > 0 ? s.l1Cached : '—'} + + {s.l2Cached > 0 ? s.l2Cached : '—'} + + {s.httpCalls} + 0 && 'text-yellow-600 dark:text-yellow-400', + ratio === 0 && 'text-muted-foreground', + )} + > + {formatPercent(ratio)} +
+
+ ); +}; + +// --- Fetch plan tree --- + +// fetchPlanNodeStatus returns a compact tag describing what happened at a +// single fetch node from a caching perspective. Picked so you can skim the +// tree and immediately see which fetches were real HTTP round-trips, which +// were served from L1 (request-scoped dedup), which were L2 hits, and which +// the router short-circuited for other reasons. +type FetchPlanStatus = { + label: string; + className: string; +}; + +const fetchPlanNodeStatus = (node: FetchPlanNode): FetchPlanStatus | null => { + // Container nodes have no cache status of their own. + if (node.kind === 'Sequence' || node.kind === 'Parallel') return null; + + // bodySize>0 means the router actually received a response body from the + // subgraph → a real HTTP fetch happened. Zero body means the router short- + // circuited via L1/L2/request-scoped injection, even if loadSkipped is false + // (load_skipped is set only for @requestScoped injections; entity L2 hits + // leave it false but still bypass the subgraph). + const realFetch = node.bodySize > 0 && !node.loadSkipped; + + if (!realFetch) { + // Short-circuited via cache or request-scoped injection — all green. + if (node.l1Hits > 0 && node.l2Hits === 0) { + return { label: 'L1 HIT', className: 'bg-green-500/15 text-green-600 dark:text-green-400 border-green-500/40' }; + } + if (node.l2Hits > 0) { + return { label: 'L2 HIT', className: 'bg-green-500/15 text-green-600 dark:text-green-400 border-green-500/40' }; + } + return { label: 'SKIPPED', className: 'bg-green-500/15 text-green-600 dark:text-green-400 border-green-500/40' }; + } + + // Real HTTP fetch happened. + if (node.l1Misses > 0 || node.l2Misses > 0) { + // Cache was checked but missed — red to draw attention. + return { label: 'CACHE MISS', className: 'bg-red-500/15 text-red-600 dark:text-red-400 border-red-500/40' }; + } + // No cache involved (pass-through field without @entityCache) — neutral blue. + return { label: 'FETCH', className: 'bg-blue-500/15 text-blue-600 dark:text-blue-400 border-blue-500/40' }; +}; + +// A leaf fetch is a "real HTTP fetch" only if the router actually called the +// subgraph. We use bodySize>0 as the definitive signal: the router only reports +// a response body size when a real HTTP response came back from the subgraph. +// L1/L2 cache hits have bodySize=0 even when loadSkipped=false, because the +// response was synthesized from cache. +const isRealHttpFetch = (n: FetchPlanNode): boolean => { + if (n.children.length > 0) return false; + if (n.loadSkipped) return false; + return n.bodySize > 0; +}; + +// Sum of real (non-cached, non-skipped) load durations at every leaf in the tree. +const sumRealLoadMs = (node: FetchPlanNode | undefined): number => { + if (!node) return 0; + let total = 0; + const walk = (n: FetchPlanNode) => { + if (isRealHttpFetch(n)) total += n.loadDurationMs; + for (const c of n.children) walk(c); + }; + walk(node); + return total; +}; + +// Count leaf fetches that actually made an HTTP call. +const countRealFetches = (node: FetchPlanNode | undefined): number => { + if (!node) return 0; + let count = 0; + const walk = (n: FetchPlanNode) => { + if (isRealHttpFetch(n)) count++; + for (const c of n.children) walk(c); + }; + walk(node); + return count; +}; + +// Render the latency annotation for one side of a fetch node. For real HTTP +// fetches this is the network round-trip time; for L2 cache hits we show the +// L2 Get duration (typically microseconds); for L1 hits we show µs where +// available. Returns null if nothing meaningful to display. +const fetchNodeLatency = (node: FetchPlanNode): string | null => { + if (isRealHttpFetch(node)) { + return formatMs(node.loadDurationMs); + } + // L2 hit: cache_trace carries the actual Get duration + if (node.l2Hits > 0 && node.l2GetDurationMs > 0) { + return formatMs(node.l2GetDurationMs); + } + // L1 hit or skipped: the cache_trace's own duration field (duration_nanoseconds) + // captures the combined coordinate/L1 lookup cost — fall back to that via the + // loadDurationMs synthesized in buildFetchPlan (which uses cache_trace's + // duration when loadSkipped + no HTTP). + if (node.loadDurationMs > 0 && node.loadDurationMs < 5) { + return formatMs(node.loadDurationMs); + } + return null; +}; + +// --- Path hierarchy model --- +// +// Rather than mirroring the router's raw Sequence/Parallel fetch tree, we +// reorganize the plan around *paths*: every distinct response path in the +// query becomes a node in a trie, and the actual fetches (leaf nodes from +// the raw tree) hang off the path node that owns them. This matches how a +// user thinks about their query ("at `recommendedArticles.relatedArticles`, +// what fetches happen?") and avoids showing the same path on every line. +// +// The internal Sequence/Parallel grouping is dropped entirely — it's a +// scheduling detail the user doesn't need to see. Similarly, we collapse +// Single / Entity / BatchEntity into a generic "Fetch" since from the +// caching perspective they all behave identically. + +// splitPath breaks a router path string into human-readable segments. The +// router uses `.` as a separator and `@` to denote list flattening. We keep +// `@.foo` glued together into a single segment because the `@` on its own +// isn't meaningful to the reader. +const splitPath = (p: string): string[] => { + if (!p) return []; + const parts = p.split('.'); + const out: string[] = []; + for (let i = 0; i < parts.length; i++) { + if (parts[i] === '@' && i + 1 < parts.length) { + out.push('@.' + parts[i + 1]); + i++; + } else { + out.push(parts[i]); + } + } + return out; +}; + +type PathNode = { + segment: string; // display segment at this level (e.g. "recommendedArticles", "@.relatedArticles") + fullPath: string; // full router path represented by this node + fetches: FetchPair[]; // fetches that resolve to exactly this path + children: PathNode[]; // deeper paths nested under this one +}; + +// Build a path-trie from the collected fetches. Each trie node owns a single +// segment of the path and the fetches that resolve to its full path. +const buildPathTrie = (entries: Array<{ path: string; pair: FetchPair }>): PathNode => { + const root: PathNode = { segment: '', fullPath: '', fetches: [], children: [] }; + for (const { path, pair } of entries) { + const segments = splitPath(path); + if (segments.length === 0) { + root.fetches.push(pair); + continue; + } + let node = root; + let accumulated = ''; + for (const seg of segments) { + accumulated = accumulated === '' ? seg.replace(/^@\./, '@.') : accumulated + '.' + seg.replace(/^@\./, '@.'); + // The full path stored in the raw trace uses "foo.@.bar", but we merge + // `@.` into one segment. Reconstruct the raw path for lookup parity. + const rawFull = accumulated.replace(/(^|\.)@\./g, '$1@.'); + let child = node.children.find((c) => c.segment === seg); + if (!child) { + child = { segment: seg, fullPath: rawFull, fetches: [], children: [] }; + node.children.push(child); + } + node = child; + } + node.fetches.push(pair); + } + return root; +}; + +// --- Fetch row cell rendering --- +// +// Each fetch row is a 5-column CSS grid so that badges and latency text line +// up perfectly across every row regardless of how long the path/source labels +// get: +// [Fetch label (1fr) | Cached badge (78px) | Cached latency (60px) | +// Uncached badge (78px) | Uncached latency (60px)] +// The grid is defined on the row + header together; cells are plain spans +// that fill their assigned column. + +const StatusBadge = ({ status, missingLabel }: { status: FetchPlanStatus | null; missingLabel?: string }) => { + if (!status) { + return ( + + {missingLabel || 'no match'} + + ); + } + return ( + + {status.label} + + ); +}; + +const LatencyCell = ({ text }: { text: string | null }) => ( + + {text || ''} + +); + +// Attempt to pretty-print a GraphQL query string using the official parser. +// Falls back to the raw string if it fails to parse — the router sometimes +// sends internal federation queries that the parser might reject. +const prettyPrintQuery = (q: string): string => { + try { + return gqlPrint(gqlParse(q)); + } catch { + return q; + } +}; + +// --- Structural JSON comparison for per-fetch responses --- +// +// The L2 entity cache stores denormalized (post-merge) entities that include +// fields from ALL subgraphs, while the uncached HTTP response contains only +// the fields that the individual subgraph provides. A naive line diff between +// these two would flag every line as different even though caching is correct. +// +// normalizeForComparison compares structurally: for `_entities` responses, it +// extracts each entity and filters the cached entity to only the fields +// present in the uncached entity. This shows whether the values that the +// subgraph actually provides match the cached values, ignoring extra fields +// (which are expected from denormalization). +// +// Returns { cachedNormalized, uncachedNormalized, extraFieldCount } where +// both normalized strings can be diffed line-by-line meaningfully. +const normalizeForComparison = ( + cachedJson: string, + uncachedJson: string, +): { cachedNorm: string; uncachedNorm: string; extraFields: number } => { + try { + const cached = JSON.parse(cachedJson); + const uncached = JSON.parse(uncachedJson); + + // If both have _entities arrays, compare entity-by-entity + const cachedEntities = cached?._entities; + const uncachedEntities = uncached?._entities; + if (Array.isArray(cachedEntities) && Array.isArray(uncachedEntities)) { + let extraFields = 0; + const filteredCached: any[] = []; + for (let i = 0; i < uncachedEntities.length; i++) { + const ue = uncachedEntities[i]; + const ce = cachedEntities[i]; + if (ce && ue && typeof ce === 'object' && typeof ue === 'object') { + const filtered: any = {}; + for (const key of Object.keys(ue)) { + filtered[key] = ce[key]; + } + extraFields += Object.keys(ce).length - Object.keys(ue).length; + filteredCached.push(filtered); + } else { + filteredCached.push(ce); + } + } + return { + cachedNorm: JSON.stringify({ _entities: filteredCached }, null, 2), + uncachedNorm: JSON.stringify({ _entities: uncachedEntities }, null, 2), + extraFields: Math.max(0, extraFields), + }; + } + } catch { + // Fall through to raw comparison + } + return { cachedNorm: cachedJson, uncachedNorm: uncachedJson, extraFields: 0 }; +}; + +// Context-diff renderer: compares two pretty-printed JSON strings line by +// line. Matching sections are collapsed into "··· N matching lines ···" fold +// markers so diffs are impossible to miss. 2 lines of context are kept around +// each changed region (like `git diff -U2`). When responses are identical, +// just a green "match" banner is shown — no need to render the full body. +const DIFF_CONTEXT = 2; + +type DiffChunk = + | { kind: 'match'; count: number } + | { kind: 'diff'; cachedLines: string[]; uncachedLines: string[] }; + +const buildDiffChunks = (a: string[], b: string[]): DiffChunk[] => { + const maxLen = Math.max(a.length, b.length); + // Mark which lines differ. + const differs: boolean[] = []; + for (let i = 0; i < maxLen; i++) { + differs.push((a[i] ?? '') !== (b[i] ?? '')); + } + // Expand each diff line by DIFF_CONTEXT in both directions to include context. + const visible = new Uint8Array(maxLen); + for (let i = 0; i < maxLen; i++) { + if (differs[i]) { + for (let j = Math.max(0, i - DIFF_CONTEXT); j <= Math.min(maxLen - 1, i + DIFF_CONTEXT); j++) { + visible[j] = 1; + } + } + } + // Build chunks. + const chunks: DiffChunk[] = []; + let i = 0; + while (i < maxLen) { + if (visible[i]) { + // Visible region — collect consecutive visible lines. + const cachedLines: string[] = []; + const uncachedLines: string[] = []; + while (i < maxLen && visible[i]) { + cachedLines.push(a[i] ?? ''); + uncachedLines.push(b[i] ?? ''); + i++; + } + chunks.push({ kind: 'diff', cachedLines, uncachedLines }); + } else { + // Hidden (all-matching) region — count consecutive hidden lines. + let count = 0; + while (i < maxLen && !visible[i]) { + count++; + i++; + } + chunks.push({ kind: 'match', count }); + } + } + return chunks; +}; + +const ResponseDiff = ({ + cachedJson, + uncachedJson, +}: { + cachedJson: string; + uncachedJson: string; +}) => { + const match = cachedJson === uncachedJson; + const cachedLines = useMemo(() => cachedJson.split('\n'), [cachedJson]); + const uncachedLines = useMemo(() => uncachedJson.split('\n'), [uncachedJson]); + const chunks = useMemo( + () => buildDiffChunks(cachedLines, uncachedLines), + [cachedLines, uncachedLines], + ); + const diffCount = useMemo( + () => chunks.reduce((n, c) => n + (c.kind === 'diff' ? c.cachedLines.filter((l, i) => l !== c.uncachedLines[i]).length : 0), 0), + [chunks], + ); + // When matching: default to showing full response. When differing: default + // to diff-only (collapsed matching lines). Toggle switches between modes. + const [showFull, setShowFull] = useState(match); + const maxLines = Math.max(cachedLines.length, uncachedLines.length); + + const diffClass = { + green: 'border-l-2 border-green-500 bg-green-500/15 pl-2', + red: 'border-l-2 border-red-500 bg-red-500/15 pl-2', + }; + + // Render one side of the diff — either collapsed (chunks) or full (all lines). + const renderSide = (lines: string[], otherLines: string[], color: 'green' | 'red') => { + if (showFull) { + return ( +
+          
+ {Array.from({ length: maxLines }, (_, i) => { + const line = lines[i] ?? ''; + const otherLine = otherLines[i] ?? ''; + const differs = line !== otherLine; + return ( +
+ {line} +
+ ); + })} +
+
+ ); + } + return ( +
+        {chunks.map((chunk, ci) =>
+          chunk.kind === 'match' ? (
+            
+ ··· {chunk.count} matching lines ··· +
+ ) : ( +
+ {(color === 'green' ? chunk.cachedLines : chunk.uncachedLines).map((line, li) => { + const otherLine = (color === 'green' ? chunk.uncachedLines : chunk.cachedLines)[li]; + const differs = line !== otherLine; + return ( +
+ {line} +
+ ); + })} +
+ ), + )} +
+ ); + }; + + return ( + <> +
+ + {match + ? 'Response — cached and uncached match' + : `Response — ${diffCount} line${diffCount !== 1 ? 's' : ''} differ`} + + +
+
+
+
+ Cached +
+ {renderSide(cachedLines, uncachedLines, 'green')} +
+
+
+ Uncached +
+ {renderSide(uncachedLines, cachedLines, 'red')} +
+
+ + ); +}; + +// Top-level response comparison between the last cached and uncached iterations. +// Shows a side-by-side diff of the full GraphQL response data so users can +// verify cache correctness — if the responses differ, there's a bug. +const ResponseComparison = ({ + cachedResponse, + uncachedResponse, +}: { + cachedResponse: any; + uncachedResponse: any; +}) => { + const cachedJson = useMemo( + () => (cachedResponse != null ? JSON.stringify(cachedResponse, null, 2) : ''), + [cachedResponse], + ); + const uncachedJson = useMemo( + () => (uncachedResponse != null ? JSON.stringify(uncachedResponse, null, 2) : ''), + [uncachedResponse], + ); + + if (!cachedJson && !uncachedJson) return null; + + return ( +
+
+ Response Comparison (last measured iteration) +
+ +
+ ); +}; + +// Build a compact summary like "2× Article, 1× Query" from raw cache keys. +const summarizeCacheKeys = (keys: string[]): string => { + const counts = new Map(); + for (const raw of keys) { + let typeName = '?'; + try { + const jsonStart = raw.indexOf('{'); + if (jsonStart >= 0) { + const parsed = JSON.parse(raw.slice(jsonStart)); + if (parsed?.__typename) typeName = parsed.__typename; + } + } catch { /* keep '?' */ } + counts.set(typeName, (counts.get(typeName) || 0) + 1); + } + return Array.from(counts.entries()) + .map(([t, n]) => `${n}× ${t}`) + .join(', '); +}; + +// CursorTooltip renders a floating card that tracks the cursor position. The +// card's bottom-left corner anchors to the cursor (so the tooltip always +// hovers above-and-right of the pointer). Portaled to document.body so it +// can escape the cache-explorer scroll container and any other ancestor +// with overflow:hidden. +// +// Position updates bypass React state and write directly to the DOM on every +// pointermove for smooth tracking — state-driven updates would trigger a +// re-render per pixel which is wasteful here since nothing else in the +// tooltip changes as the cursor moves. +const CursorTooltip = ({ + visible, + title, + body, + footer, + tooltipRef, + cursorPosRef, +}: { + visible: boolean; + title: string; + body: string; + footer?: string; + tooltipRef: React.RefObject; + cursorPosRef: React.MutableRefObject<{ x: number; y: number }>; +}) => { + // Apply the initial cursor position synchronously after the portal commits + // but before paint — this avoids a flash at (0,0) on hover. Subsequent + // pointermove events update style.left/top directly on the DOM node. + useLayoutEffect(() => { + if (!visible) return; + const el = tooltipRef.current; + if (!el) return; + el.style.left = `${cursorPosRef.current.x}px`; + el.style.top = `${cursorPosRef.current.y}px`; + }, [visible, tooltipRef, cursorPosRef]); + if (!visible) return null; + return createPortal( +
+
+ {title} +
+
+        {body}
+      
+ {footer && ( +
+ {footer} +
+ )} +
, + document.body, + ); +}; + +const FetchRow = ({ pair }: { pair: FetchPair }) => { + const ref = pair.cached || pair.uncached!; + const cachedStatus = pair.cached ? fetchPlanNodeStatus(pair.cached) : null; + const uncachedStatus = pair.uncached ? fetchPlanNodeStatus(pair.uncached) : null; + const cachedLatency = pair.cached ? fetchNodeLatency(pair.cached) : null; + const uncachedLatency = pair.uncached ? fetchNodeLatency(pair.uncached) : null; + const rawQuery = pair.cached?.query || pair.uncached?.query; + const formattedQuery = useMemo( + () => (rawQuery ? prettyPrintQuery(rawQuery) : undefined), + [rawQuery], + ); + const rawCacheKeys = pair.cached?.cacheKeys || pair.uncached?.cacheKeys; + const cacheKeys = useMemo(() => dedupeCacheKeysForDisplay(rawCacheKeys), [rawCacheKeys]); + const cachedResponseData = pair.cached?.responseData; + const uncachedResponseData = pair.uncached?.responseData; + const hasDetail = !!(cacheKeys?.length || formattedQuery || cachedResponseData != null || uncachedResponseData != null); + const keySummary = useMemo( + () => (cacheKeys && cacheKeys.length > 0 ? summarizeCacheKeys(cacheKeys) : undefined), + [cacheKeys], + ); + const identityLabel = useMemo( + () => summarizeFetchIdentity(pair.cached) || summarizeFetchIdentity(pair.uncached), + [pair.cached, pair.uncached], + ); + // Normalize per-fetch responses for structural comparison. L2 cached + // entities contain a superset of fields (denormalized from all subgraphs); + // the uncached response has only this subgraph's fields. Comparing raw JSON + // would flag every line as different. normalizeForComparison filters the + // cached entities to only the fields present in the uncached response so + // the diff shows actual value differences, not structural noise. + const { cachedNorm, uncachedNorm, extraFields } = useMemo(() => { + if (cachedResponseData == null || uncachedResponseData == null) { + return { + cachedNorm: cachedResponseData != null ? JSON.stringify(cachedResponseData, null, 2) : undefined, + uncachedNorm: uncachedResponseData != null ? JSON.stringify(uncachedResponseData, null, 2) : undefined, + extraFields: 0, + }; + } + return normalizeForComparison( + JSON.stringify(cachedResponseData, null, 2), + JSON.stringify(uncachedResponseData, null, 2), + ); + }, [cachedResponseData, uncachedResponseData]); + + const tooltipRef = useRef(null); + const cursorPosRef = useRef({ x: 0, y: 0 }); + const [tooltipVisible, setTooltipVisible] = useState(false); + const [expanded, setExpanded] = useState(false); + + const handleMove = (e: React.PointerEvent) => { + cursorPosRef.current = { x: e.clientX, y: e.clientY }; + const el = tooltipRef.current; + if (!el) return; + el.style.left = `${e.clientX}px`; + el.style.top = `${e.clientY}px`; + }; + + const handleEnter = (e: React.PointerEvent) => { + if (!formattedQuery) return; + cursorPosRef.current = { x: e.clientX, y: e.clientY }; + setTooltipVisible(true); + }; + + const handleLeave = () => setTooltipVisible(false); + + return ( + <> +
setExpanded((v) => !v) : undefined} + > +
+ Fetch → + {ref.sourceName || '?'} + {identityLabel && ( + · {identityLabel} + )} +
+ + + + +
+ {/* Inline expandable detail panel — click anywhere on it to fold. + No internal scrolling — the outer cache-explorer container scrolls. */} + {expanded && hasDetail && ( +
setExpanded(false)} + > + {formattedQuery && ( + <> +
+ Query +
+
+                {formattedQuery}
+              
+ + )} + {cacheKeys && cacheKeys.length > 0 && ( + <> +
+ Cache Keys ({cacheKeys.length}) +
+
+                {cacheKeys.map(formatCacheKey).join('\n\n')}
+              
+ + )} + {(cachedNorm || uncachedNorm) && ( + <> + + {extraFields > 0 && ( +
+ Cached response has {extraFields} additional field{extraFields !== 1 ? 's' : ''} from + other subgraphs (expected — L2 stores denormalized entities). + Comparison above shows only the fields this subgraph provides. +
+ )} + + )} +
+ )} + {/* Hover tooltip — query + compact key summary */} + {formattedQuery && ( + + )} + + ); +}; + +// Recursively render a path node: its segment header (when it has one) plus +// any fetches at this path, then child paths indented beneath. +const PathTreeNode = ({ node, depth }: { node: PathNode; depth: number }) => { + const isRoot = node.segment === ''; + return ( + <> + {!isRoot && ( +
+ {node.segment} +
+ )} + {node.fetches.length > 0 && ( +
+ {node.fetches.map((pair, i) => ( + + ))} +
+ )} + {node.children.map((child, i) => ( + + ))} + + ); +}; + +const FetchPlanTree = ({ + cachedPlan, + uncachedPlan, +}: { + cachedPlan?: FetchPlanNode; + uncachedPlan?: FetchPlanNode; +}) => { + if (!cachedPlan && !uncachedPlan) return null; + + const cachedCount = countRealFetches(cachedPlan); + const uncachedCount = countRealFetches(uncachedPlan); + const cachedTotal = sumRealLoadMs(cachedPlan); + const uncachedTotal = sumRealLoadMs(uncachedPlan); + + // Reorganize by path hierarchy for display. + const entries = useMemo( + () => collectFetchPairs(cachedPlan, uncachedPlan), + [cachedPlan, uncachedPlan], + ); + const pathRoot = useMemo(() => buildPathTrie(entries), [entries]); + + return ( +
+
+ Fetch Plan (last measured iteration) + + Cached:{' '} + + {cachedCount} HTTP · {formatMs(cachedTotal)} + + {' · '} + Uncached:{' '} + + {uncachedCount} HTTP · {formatMs(uncachedTotal)} + + +
+ {/* Column headers — fixed widths match the FetchRow grid columns */} +
+
Path / Fetch
+
Cached
+
Uncached
+
+
+ +
+
+ ); +}; + +// --- Speedup banner --- + +// Cache ratio: the fraction of entity-lookup keys served from cache (L1 or +// L2) across all subgraphs in the cached phase. This is the same number +// rolled up from the per-subgraph Fetch Breakdown table — it answers +// "what fraction of individual entity lookups did caching resolve without +// hitting a subgraph?" +// +// Per-key rather than per-HTTP-fetch because a single batch fetch resolves +// many entities independently; counting keys gives a truer picture of the +// work saved. For the demo query with 10 iterations: viewer has 150 keys +// (140 cached, 10 HTTP), cachegraph 130 (120 cached, 10 HTTP), cachegraph-ext +// 140 (all cached), summing to 400/420 ≈ 95% cache ratio. +const computeCacheRatio = (requests: CacheExplorerRequestResult[]): number => { + let totalFetches = 0; + let cachedFetches = 0; + for (const r of requests) { + for (const sb of r.sourceBreakdown) { + totalFetches += sb.totalFetches; + cachedFetches += sb.l1Cached + sb.l2Cached; + } + } + return totalFetches > 0 ? cachedFetches / totalFetches : 0; +}; + +const SpeedupBanner = ({ + speedup, + cacheRatio, +}: { + speedup: number; + cacheRatio: number; +}) => { + if (!isFinite(speedup) || speedup <= 0) return null; + const isFaster = speedup > 1; + return ( +
+ + {speedup.toFixed(2)}x + + {isFaster ? 'faster with caching (server-side)' : 'no speedup — cache did not help'} + + + {cacheRatio > 0 && ( + + {Math.round(cacheRatio * 100)}% + cache ratio (entity lookups served from cache) + + )} +
+ ); +}; + +// --- Main view --- + +export const CacheExplorerView = () => { + const { cacheMode } = useContext(PlaygroundContext); + const [iterations, setIterations] = useLocalStorage( + 'playground:cache-explorer:iterations', + 10, + ); + const [state, setState] = useState(cacheExplorerController.getState()); + + useEffect(() => { + return cacheExplorerController.subscribe(setState); + }, []); + + // Expose current iterations + cacheMode to the fetcher intercept via window. + // The fetcher picks these up when the user clicks play in cache-explorer view. + useEffect(() => { + (window as any).__cacheExplorerConfig = { iterations, cacheMode }; + }, [iterations, cacheMode]); + + // Arm the trigger gate when the play button is clicked. We use a capture-phase + // listener on the execute button so the flag is set BEFORE GraphiQL's fetcher + // fires. Without this, GraphiQL's auto-refetch on header/query edits would + // re-launch the benchmark unintentionally. + useEffect(() => { + const btn = document.querySelector('button[aria-label^="Execute query"]'); + if (!btn) return; + const handler = () => { + (window as any).__cacheExplorerTrigger = true; + }; + btn.addEventListener('click', handler, { capture: true }); + return () => btn.removeEventListener('click', handler, { capture: true }); + }, []); + + const canRun = cacheMode !== 'disabled'; + const isRunning = state.status === 'running'; + + const cachedReqs = useMemo(() => { + if (state.status === 'running') return state.cachedResults; + if (state.status === 'complete') return state.result.cached.requests; + return []; + }, [state]); + + const uncachedReqs = useMemo(() => { + if (state.status === 'running') return state.uncachedResults; + if (state.status === 'complete') return state.result.uncached.requests; + return []; + }, [state]); + + const cachedPhase = useMemo(() => { + if (state.status === 'complete') return state.result.cached; + return aggregatePartial(cachedReqs); + }, [state, cachedReqs]); + + const uncachedPhase = useMemo(() => { + if (state.status === 'complete') return state.result.uncached; + return { ...aggregatePartial(uncachedReqs), label: 'uncached' as const }; + }, [state, uncachedReqs]); + + const liveSpeedup = + state.status === 'complete' + ? state.result.speedup + : cachedPhase.avgServerLatencyMs > 0 && uncachedPhase.avgServerLatencyMs > 0 + ? uncachedPhase.avgServerLatencyMs / cachedPhase.avgServerLatencyMs + : 0; + + const liveCacheRatio = useMemo(() => computeCacheRatio(cachedReqs), [cachedReqs]); + + return ( +
+ {/* Header */} +
+
+ + { + const v = parseInt(e.target.value, 10); + if (!Number.isNaN(v) && v >= 2 && v <= 100) setIterations(v); + }} + className="h-8 w-20 rounded border bg-background px-2 text-sm" + /> + {isRunning && ( + + )} +
+
+ {canRun ? ( + <> + Comparing: {cacheModeLabels[cacheMode]}{' '} + vs Cache disabled + {!isRunning && state.status !== 'complete' && ( + — click the Play button to run + )} + + ) : ( + + + Select a cache mode other than "Cache disabled" to run the explorer + + )} +
+
+ + {/* Running progress — single bar from 0% to 100%. Warmup is hidden + (runs silently between uncached and cached phases). */} + {isRunning && state.phase !== 'warmup' && (() => { + const totalWork = state.total * 2; + const completed = state.phase === 'uncached' + ? state.current + : state.total + state.current; + const pct = Math.min(100, (completed / totalWork) * 100); + const label = state.phase === 'uncached' + ? `Uncached phase — request ${state.current} / ${state.total}` + : `Cached phase — request ${state.current} / ${state.total}`; + const step = state.phase === 'uncached' ? 'Step 1/2' : 'Step 2/2'; + return ( +
+
+ {label} + {step} +
+
+
+
+
+ ); + })()} + + {/* Error */} + {state.status === 'error' && ( +
+ {state.message} +
+ )} + + {/* Empty state */} + {state.status === 'idle' && ( +
+ } + title="Cache Explorer" + description={ + canRun + ? 'Write a query in the editor, pick a cache mode, and click the Play button. The explorer will run your query multiple times with caching enabled and again with caching disabled, then compare latencies and cache efficiency side by side.' + : 'Pick a cache mode other than "Cache disabled" to enable the explorer.' + } + /> +
+ )} + + {/* Results (also shown live during run) */} + {(isRunning || state.status === 'complete') && (cachedReqs.length > 0 || uncachedReqs.length > 0) && ( + <> + {liveSpeedup > 0 && ( + + )} + +
+ +
+ + + + + + 0 ? cachedReqs[cachedReqs.length - 1].fetchPlan : undefined} + uncachedPlan={uncachedReqs.length > 0 ? uncachedReqs[uncachedReqs.length - 1].fetchPlan : undefined} + /> + + {cachedReqs.length > 0 && uncachedReqs.length > 0 && ( + + )} + +
+
+ +
+ Note: The cached phase is preceded by {WARMUP_ITERATIONS}{' '} + warm-up queries (not shown in results) so the cache is fully populated before + the measured iterations begin. Other router caches (plan, normalization, + variables) also warm during warm-up, so the measured iterations focus on + entity cache impact. This is a dev-mode exploration tool, not a production + load test. +
+
+
+ + )} +
+ ); +}; diff --git a/playground/src/components/playground/fetch-flow.tsx b/playground/src/components/playground/fetch-flow.tsx index 9d0801c457..7b5055c5af 100644 --- a/playground/src/components/playground/fetch-flow.tsx +++ b/playground/src/components/playground/fetch-flow.tsx @@ -30,7 +30,8 @@ import { Badge } from '../ui/badge'; import { Button, buttonVariants } from '../ui/button'; import { Separator } from '../ui/separator'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../ui/tooltip'; -import { ARTFetchNode, QueryPlanFetchTypeNode } from './types'; +import { ARTFetchNode, QueryPlanFetchTypeNode, getCacheStatus, getCacheStatusLabel } from './types'; +import { ViewCache } from './view-cache'; import { ViewHeaders } from './view-headers'; import { ViewInput } from './view-input'; import { ViewLoadStats } from './view-load-stats'; @@ -161,7 +162,7 @@ export const ReactFlowARTFetchNode = ({ data }: Node) => { {data.dataSourceId}

- {data.outputTrace && ( + {data.outputTrace && !data.loadSkipped && ( {data.outputTrace?.response?.statusCode} )}
@@ -185,8 +186,27 @@ export const ReactFlowARTFetchNode = ({ data }: Node) => { Single Flight Shared Response: {getIcon(data.singleFlightSharedResponse)}

Load Skipped: {getIcon(data.loadSkipped)}

+ {data.cacheTrace && (() => { + const status = getCacheStatus(data.cacheTrace); + return ( + <> + +

+ Cache:{' '} + + {getCacheStatusLabel(data.cacheTrace)} + +

+

Cache Name: {data.cacheTrace.cacheName}

+

TTL: {data.cacheTrace.ttlSeconds}s

+

Entities: {data.cacheTrace.entityCount}

+

L1: {data.cacheTrace.l1Hit} hit / {data.cacheTrace.l1Miss} miss

+

L2: {data.cacheTrace.l2Hit} hit / {data.cacheTrace.l2Miss} miss

+ + ); + })()} - {(data.outputTrace || data.input || data.rawInput || data.output) && } + {(data.outputTrace || data.input || data.rawInput || data.output || data.cacheTrace) && }
) => { {(data.input || data.rawInput) && } {data.output && } {data.loadStats && } + {data.cacheTrace && }
diff --git a/playground/src/components/playground/fetch-waterfall.tsx b/playground/src/components/playground/fetch-waterfall.tsx index 0a65fcbf80..431e6b03ea 100644 --- a/playground/src/components/playground/fetch-waterfall.tsx +++ b/playground/src/components/playground/fetch-waterfall.tsx @@ -1,12 +1,13 @@ import { nsToTime } from '@/lib/utils'; import { cn } from '@/lib/utils'; +import { BoltIcon } from '@heroicons/react/24/solid'; import { CubeIcon, ExclamationTriangleIcon, MinusIcon, PlusIcon } from '@radix-ui/react-icons'; import { sentenceCase } from 'change-case'; import { useState } from 'react'; import { Badge } from '../ui/badge'; import { Button } from '../ui/button'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../ui/tooltip'; -import { ARTFetchNode } from './types'; +import { ARTFetchNode, getCacheStatus, getCacheStatusLabel } from './types'; import { ViewHeaders } from './view-headers'; import { ViewInput } from './view-input'; import { ViewLoadStats } from './view-load-stats'; @@ -195,7 +196,22 @@ export const FetchWaterfall = ({ {isError && }
{fetch.dataSourceName} - {statusCode ? {statusCode} :
} + {statusCode && !isLoadSkipped ? {statusCode} :
} + {fetch.cacheTrace && (() => { + const status = getCacheStatus(fetch.cacheTrace); + if (status === 'l1-hit' || status === 'l2-hit') { + return ( + + ); + } + return null; + })()}
@@ -271,6 +287,28 @@ export const FetchWaterfall = ({ + {fetch.cacheTrace && ( + <> + + + + + + + + + {fetch.cacheTrace.durationPretty && ( + + )} + {fetch.cacheTrace.l2GetDurationPretty && ( + + )} + {fetch.cacheTrace.l2SetDurationPretty && ( + + )} + + )} +
{fetch.outputTrace && ( @@ -284,6 +322,21 @@ export const FetchWaterfall = ({ {fetch.loadStats && }
+ + {fetch.cacheTrace?.keys && fetch.cacheTrace.keys.length > 0 && ( +
+

Cache Keys ({fetch.cacheTrace.keys.length})

+
+                  {JSON.stringify(
+                    fetch.cacheTrace.keys.map((k) => {
+                      try { return JSON.parse(k); } catch { return k; }
+                    }),
+                    null,
+                    2,
+                  )}
+                
+
+ )} )} diff --git a/playground/src/components/playground/index.test.ts b/playground/src/components/playground/index.test.ts new file mode 100644 index 0000000000..0379346c65 --- /dev/null +++ b/playground/src/components/playground/index.test.ts @@ -0,0 +1,37 @@ +import { describe, expect, it } from 'vitest'; + +import { applyCacheModeHeaders } from './index'; + +describe('applyCacheModeHeaders', () => { + it('preserves existing headers while switching cache modes', () => { + let headers = JSON.stringify( + { + Authorization: 'Bearer test-token', + 'X-WG-Disable-Entity-Cache': 'true', + }, + null, + 2, + ); + + headers = applyCacheModeHeaders(headers, 'no-l1')!; + expect(JSON.parse(headers)).toEqual({ + Authorization: 'Bearer test-token', + 'X-WG-Disable-Entity-Cache-L1': 'true', + }); + + headers = applyCacheModeHeaders(headers, 'no-l2')!; + expect(JSON.parse(headers)).toEqual({ + Authorization: 'Bearer test-token', + 'X-WG-Disable-Entity-Cache-L2': 'true', + }); + + headers = applyCacheModeHeaders(headers, 'enabled')!; + expect(JSON.parse(headers)).toEqual({ + Authorization: 'Bearer test-token', + }); + }); + + it('leaves invalid JSON untouched', () => { + expect(applyCacheModeHeaders('{not-json', 'disabled')).toBe('{not-json'); + }); +}); diff --git a/playground/src/components/playground/index.tsx b/playground/src/components/playground/index.tsx index 4bd48b6728..2893bfe873 100644 --- a/playground/src/components/playground/index.tsx +++ b/playground/src/components/playground/index.tsx @@ -1,4 +1,9 @@ +import { BoltIcon } from '@heroicons/react/24/solid'; +import { LuActivity } from 'react-icons/lu'; import { TraceContext, TraceView } from '@/components/playground/trace-view'; +import { CacheExplorerView } from './cache-explorer-view'; +import { cacheExplorerController } from './cache-explorer-controller'; +import type { CacheExplorerConfig } from './cache-explorer-runner'; import { explorerPlugin } from '@graphiql/plugin-explorer'; import { createGraphiQLFetcher } from '@graphiql/toolkit'; import { GraphiQL } from 'graphiql'; @@ -11,7 +16,7 @@ import { parse, validate, } from 'graphql'; -import { useContext, useEffect, useMemo, useState } from 'react'; +import { useContext, useEffect, useMemo, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; import { FaNetworkWired } from 'react-icons/fa'; import { PiBracketsCurly } from 'react-icons/pi'; @@ -23,7 +28,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@ import { LuLayoutDashboard } from 'react-icons/lu'; import { sentenceCase } from 'change-case'; import { PlanView } from './plan-view'; -import { PlaygroundContext, QueryPlan, TabsState, PlaygroundView } from './types'; +import { PlaygroundContext, QueryPlan, TabsState, PlaygroundView, CacheMode } from './types'; import { useDebounce } from 'use-debounce'; import { useLocalStorage } from '@/lib/use-local-storage'; import { @@ -147,6 +152,27 @@ type GraphiQLScripts = { transformHeaders?: (headers: Record) => Record; }; +export const applyCacheModeHeaders = (headersJson: string | undefined, cacheMode: CacheMode): string => { + try { + const parsed = JSON.parse(headersJson || '{}'); + delete parsed['X-WG-Disable-Entity-Cache']; + delete parsed['X-WG-Disable-Entity-Cache-L1']; + delete parsed['X-WG-Disable-Entity-Cache-L2']; + + if (cacheMode === 'disabled') { + parsed['X-WG-Disable-Entity-Cache'] = 'true'; + } else if (cacheMode === 'no-l1') { + parsed['X-WG-Disable-Entity-Cache-L1'] = 'true'; + } else if (cacheMode === 'no-l2') { + parsed['X-WG-Disable-Entity-Cache-L2'] = 'true'; + } + + return JSON.stringify(parsed, null, 2); + } catch { + return headersJson ?? ''; + } +}; + const graphiQLFetch = async ( schema: GraphQLSchema | null, clientValidationEnabled: boolean, @@ -154,6 +180,8 @@ const graphiQLFetch = async ( onFetch: any, url: URL, init: RequestInit, + cacheMode?: CacheMode, + view?: PlaygroundView, ) => { try { const initialHeaders = init.headers as Record; @@ -161,10 +189,51 @@ const graphiQLFetch = async ( ? scripts.transformHeaders(initialHeaders) : { ...initialHeaders }; + // Inject entity cache control headers based on cache mode + delete headers['X-WG-Disable-Entity-Cache']; + delete headers['X-WG-Disable-Entity-Cache-L1']; + delete headers['X-WG-Disable-Entity-Cache-L2']; + if (cacheMode === 'disabled') { + headers['X-WG-Disable-Entity-Cache'] = 'true'; + } else if (cacheMode === 'no-l1') { + headers['X-WG-Disable-Entity-Cache-L1'] = 'true'; + } else if (cacheMode === 'no-l2') { + headers['X-WG-Disable-Entity-Cache-L2'] = 'true'; + } + headers = substituteHeadersFromEnv(headers, '0'); validateHeaders(headers); + // Cache Explorer intercept: if we're in cache-explorer view AND the user + // explicitly clicked the play button (trigger gate), dispatch to the + // explorer controller. Without the gate, GraphiQL's auto-refetch on + // header/query edits would re-launch the benchmark unintentionally. + if (view === 'cache-explorer') { + const trigger = (window as any).__cacheExplorerTrigger; + if (trigger) { + (window as any).__cacheExplorerTrigger = false; + const body = JSON.parse(init.body as string); + const explorerConfig: CacheExplorerConfig = { + url: url.toString(), + query: body.query, + variables: body.variables ? JSON.stringify(body.variables) : undefined, + operationName: body.operationName, + headers, + iterations: (window as any).__cacheExplorerConfig?.iterations ?? 10, + cacheMode: cacheMode || 'enabled', + }; + // Fire and forget — the controller emits state via its subscription + cacheExplorerController.start(explorerConfig); + } + const synthetic = new Response( + JSON.stringify({ data: null, extensions: { cacheExplorer: { status: 'running' } } }), + { headers: { 'Content-Type': 'application/json' } }, + ); + onFetch(await synthetic.clone().json(), 200, 'OK'); + return synthetic; + } + if (schema && clientValidationEnabled) { const query = JSON.parse(init.body as string)?.query as string; @@ -225,44 +294,158 @@ const graphiQLFetch = async ( } }; +type CacheSummary = { hits: number; total: number } | null; + +const collectCacheSummary = (fetches: any): CacheSummary => { + if (!fetches) return null; + + let hits = 0; + let total = 0; + + const walkFetch = (node: any) => { + if (!node) return; + + const trace = node.trace || node.datasource_load_trace; + + // Count every fetch that has a trace (i.e., a real datasource fetch). + if (trace) { + total++; + if (trace.load_skipped) { + // Skipped fetches (e.g., @requestScoped L1 injection) count as cache hits. + hits++; + } else { + const ct = trace.cache_trace; + if (ct && (ct.l1_hit > 0 || ct.l2_hit > 0)) { + hits++; + } + } + } + + const children = node.children || node.fetches || node.traces; + if (children) { + for (const child of children) { + walkFetch(child.fetch || child); + } + } + }; + + walkFetch(fetches); + return total > 0 ? { hits, total } : null; +}; + +const CacheBadge = ({ hits, total }: { hits: number; total: number }) => { + const pct = Math.round((hits / total) * 100); + const allHit = hits === total; + const noneHit = hits === 0; + + return ( + + + +
+ + + {hits}/{total} Cached + +
+
+ + {allHit + ? 'All fetches served from cache' + : noneHit + ? 'No cache hits' + : `${hits} of ${total} fetches served from cache`} + +
+
+ ); +}; + +const cacheModeLabels: Record = { + enabled: 'Caching enabled', + 'no-l1': 'Caching (L2 only)', + 'no-l2': 'Caching (L1 only)', + disabled: 'Caching disabled', +}; + +const cacheModeColors: Record = { + enabled: 'border-success/50 bg-success/10 text-success', + 'no-l1': 'border-orange-500/50 bg-orange-500/10 text-orange-500', + 'no-l2': 'border-orange-500/50 bg-orange-500/10 text-orange-500', + disabled: 'border-destructive/50 bg-destructive/10 text-destructive', +}; + +const CacheControl = () => { + const { cacheMode, setCacheMode } = useContext(PlaygroundContext); + + return ( + + ); +}; + const ResponseToolbar = () => { const { view, setView } = useContext(PlaygroundContext); const onValueChange = (val: PlaygroundView) => { const response = document.getElementsByClassName('graphiql-response')[0] as HTMLDivElement; - const art = document.getElementById('art-visualization') as HTMLDivElement; - const plan = document.getElementById('planner-visualization') as HTMLDivElement; + const explorer = document.getElementById('cache-explorer-visualization') as HTMLDivElement; - if (!response || !art || !plan) { + if (!response || !art || !plan || !explorer) { return; } - if (val === 'request-trace') { - response.classList.add('invisible'); - response.classList.add('-z-50'); - plan.classList.add('invisible'); - plan.classList.add('-z-50'); + const hide = (el: HTMLDivElement) => { + el.classList.add('invisible'); + el.classList.add('-z-50'); + }; + const show = (el: HTMLDivElement) => { + el.classList.remove('invisible'); + el.classList.remove('-z-50'); + }; - art.classList.remove('invisible'); - art.classList.remove('-z-50'); - } else if (val === 'query-plan') { - response.classList.add('invisible'); - response.classList.add('-z-50'); - art.classList.add('invisible'); - art.classList.add('-z-50'); + // Hide all first + hide(art); + hide(plan); + hide(explorer); + response.classList.add('invisible'); + response.classList.add('-z-50'); - plan.classList.remove('invisible'); - plan.classList.remove('-z-50'); + // Then show the chosen one + if (val === 'request-trace') { + show(art); + } else if (val === 'query-plan') { + show(plan); + } else if (val === 'cache-explorer') { + show(explorer); } else { response.classList.remove('invisible'); response.classList.remove('-z-50'); - - art.classList.add('invisible'); - art.classList.add('-z-50'); - plan.classList.add('invisible'); - plan.classList.add('-z-50'); } setView(val); @@ -273,17 +456,35 @@ const ResponseToolbar = () => { return ; } else if (val === 'request-trace') { return ; + } else if (val === 'cache-explorer') { + return ; } else { return ; } }; const { status, statusText } = useContext(PlaygroundContext); + const { response } = useContext(TraceContext); + + const cacheSummary = useMemo(() => { + try { + const parsed = JSON.parse(response || '{}'); + // Skip introspection responses — they have __schema in data + if (parsed?.data?.__schema) return null; + const trace = parsed?.extensions?.trace; + if (!trace) return null; + return collectCacheSummary(trace.fetches || trace); + } catch { + return null; + } + }, [response]); const isSuccess = !!status && status >= 200 && status < 300; return (
+ + {cacheSummary && } {(status || statusText) && ( {!isSuccess && } @@ -318,6 +519,12 @@ const ResponseToolbar = () => { Query Plan
+ +
+ {getIcon('cache-explorer')} + Cache Explorer +
+
@@ -354,6 +561,7 @@ const PlaygroundPortal = () => { const responseToolbar = document.getElementById('response-toolbar'); const artDiv = document.getElementById('art-visualization'); const plannerDiv = document.getElementById('planner-visualization'); + const cacheExplorerDiv = document.getElementById('cache-explorer-visualization'); const toggleClientValidation = document.getElementById('toggle-client-validation'); const logo = document.getElementById('graphiql-wg-logo'); const scriptsSection = document.getElementById('scripts-section'); @@ -363,6 +571,7 @@ const PlaygroundPortal = () => { !responseToolbar || !artDiv || !plannerDiv || + !cacheExplorerDiv || !toggleClientValidation || !logo || !scriptsSection || @@ -376,6 +585,7 @@ const PlaygroundPortal = () => { {createPortal(, responseToolbar)} {createPortal(, plannerDiv)} {createPortal(, artDiv)} + {createPortal(, cacheExplorerDiv)} {createPortal(, toggleClientValidation)} {createPortal(, scriptsSection)} {createPortal(, preFlightScriptSection)} @@ -435,6 +645,12 @@ export const Playground = (input: { const [isMounted, setIsMounted] = useState(false); const [view, setView] = useState('response'); + const viewRef = useRef(view); + viewRef.current = view; + const [cacheMode, setCacheMode] = useState('enabled'); + const cacheModeRef = useRef(cacheMode); + cacheModeRef.current = cacheMode; + const suppressSchemaRefetch = useRef(false); const [schema, setSchema] = useState(null); @@ -468,6 +684,20 @@ export const Playground = (input: { "X-WG-TRACE" : "true" }`); + // Sync cache mode into the visible headers JSON editor. + // Uses suppressSchemaRefetch to prevent the schema re-fetch that would reset stats. + const cacheHeaderKeys = ['X-WG-Disable-Entity-Cache', 'X-WG-Disable-Entity-Cache-L1', 'X-WG-Disable-Entity-Cache-L2']; + useEffect(() => { + setHeaders((prev) => { + const nextHeaders = applyCacheModeHeaders(prev, cacheMode); + if (nextHeaders !== prev) { + suppressSchemaRefetch.current = true; + return nextHeaders; + } + return prev; + }); + }, [cacheMode]); + const [response, setResponse] = useState(''); const [plan, setPlan] = useState(undefined); @@ -569,8 +799,13 @@ export const Playground = (input: { plannerWrapper.id = 'planner-visualization'; plannerWrapper.className = 'flex flex-1 h-full w-full absolute invisible -z-50'; + const cacheExplorerWrapper = document.createElement('div'); + cacheExplorerWrapper.id = 'cache-explorer-visualization'; + cacheExplorerWrapper.className = 'flex flex-1 absolute inset-0 invisible -z-50 overflow-hidden'; + responseSectionParent.append(artWrapper); responseSectionParent.append(plannerWrapper); + responseSectionParent.append(cacheExplorerWrapper); } } @@ -601,6 +836,10 @@ export const Playground = (input: { }; useEffect(() => { + if (suppressSchemaRefetch.current) { + suppressSchemaRefetch.current = false; + return; + } getSchema(); }, [headers]); @@ -618,7 +857,16 @@ export const Playground = (input: { url: url, subscriptionUrl: url.replace('http', 'ws'), fetch: (...args) => - graphiQLFetch(schema, clientValidationEnabled, input.scripts, onFetch, args[0] as URL, args[1] as RequestInit), + graphiQLFetch( + schema, + clientValidationEnabled, + input.scripts, + onFetch, + args[0] as URL, + args[1] as RequestInit, + cacheModeRef.current, + viewRef.current, + ), }); }, [schema, clientValidationEnabled]); @@ -692,6 +940,8 @@ export const Playground = (input: { statusText, view, setView, + cacheMode, + setCacheMode, }} > ({ + ReactFlowProvider: ({ children }: { children: React.ReactNode }) =>
{children}
, +})); + +vi.mock('react-move-hook', () => ({ + useMovable: () => () => {}, +})); + +vi.mock('./fetch-flow', () => ({ + ARTCustomEdge: {}, + FetchFlow: () =>
, + ReactFlowARTFetchNode: () => null, + ReactFlowARTMultiFetchNode: () => null, +})); + +vi.mock('./fetch-waterfall', () => ({ + FetchWaterfall: () =>
, +})); + +describe('minimumVisibleDurationNs', () => { + it('clamps zero or missing durations to a visible minimum', () => { + expect(minimumVisibleDurationNs()).toBe(1000); + expect(minimumVisibleDurationNs(0)).toBe(1000); + expect(minimumVisibleDurationNs(2500)).toBe(2500); + }); +}); + +describe('TraceView', () => { + it('keeps the waterfall tab selected when the initial trace view is waterfall', () => { + const response = JSON.stringify({ + data: { + item: { id: '1' }, + }, + extensions: { + trace: { + version: '2', + info: { + trace_start_unix: 1, + parse_stats: { + duration_since_start_nanoseconds: 0, + duration_nanoseconds: 1, + }, + normalize_stats: { + duration_since_start_nanoseconds: 1, + duration_nanoseconds: 1, + }, + validate_stats: { + duration_since_start_nanoseconds: 2, + duration_nanoseconds: 1, + }, + planner_stats: { + duration_since_start_nanoseconds: 3, + duration_nanoseconds: 1, + }, + }, + fetches: { + id: 'fetch-1', + type: 'Single', + data_source_id: 'sg-1', + trace: { + duration_since_start_nanoseconds: 4, + duration_nanoseconds: 0, + cache_trace: { + duration_since_start_nanoseconds: 4, + duration_nanoseconds: 0, + }, + }, + children: [], + }, + }, + }, + }); + + render( + {}, + forcedTheme: undefined, + }} + > + + , + ); + + expect(screen.getByTestId('fetch-waterfall')).toBeInTheDocument(); + expect(screen.getByRole('tab', { name: /waterfall view/i })).toHaveAttribute('data-state', 'active'); + expect(screen.getByRole('tab', { name: /tree view/i })).toHaveAttribute('data-state', 'inactive'); + }); +}); diff --git a/playground/src/components/playground/trace-view.tsx b/playground/src/components/playground/trace-view.tsx index 55b3f9a853..86e8516169 100644 --- a/playground/src/components/playground/trace-view.tsx +++ b/playground/src/components/playground/trace-view.tsx @@ -12,10 +12,12 @@ import { CLI, CLISteps } from '../ui/cli'; import { Tabs, TabsList, TabsTrigger } from '../ui/tabs'; import { ARTCustomEdge, FetchFlow, ReactFlowARTFetchNode, ReactFlowARTMultiFetchNode } from './fetch-flow'; import { FetchWaterfall } from './fetch-waterfall'; -import { ARTFetchNode, LoadStats, QueryPlan } from './types'; +import { ARTFetchNode, CacheTrace, LoadStats, QueryPlan } from './types'; const initialPaneWidth = 360; +export const minimumVisibleDurationNs = (durationNs?: number) => Math.max(durationNs ?? 0, 1000); + export const TraceContext = createContext<{ query?: string; subgraphs: { id: string; name: string }[]; @@ -102,6 +104,29 @@ const Trace = ({ let gEndTimeNano = BigInt(0); let executeDurationSinceStart = 0; + let plannerEndNs = 0; + + const parseCacheTrace = (ct: any): CacheTrace | undefined => { + if (!ct) return undefined; + return { + l1Enabled: ct.l1_enabled, + l2Enabled: ct.l2_enabled, + cacheName: ct.cache_name, + ttlSeconds: ct.ttl_seconds, + entityCount: ct.entity_count ?? 0, + l1Hit: ct.l1_hit, + l1Miss: ct.l1_miss, + l2Hit: ct.l2_hit, + l2Miss: ct.l2_miss, + durationSinceStart: ct.duration_since_start_nanoseconds, + durationSinceStartPretty: ct.duration_since_start_pretty, + duration: ct.duration_nanoseconds, + durationPretty: ct.duration_pretty, + l2GetDurationPretty: ct.l2_get_duration_pretty, + l2SetDurationPretty: ct.l2_set_duration_pretty, + keys: ct.keys, + }; + }; const fetchMap = new Map(); @@ -148,6 +173,8 @@ const Trace = ({ fetchNode.loadStats = mappedData; } + fetchNode.cacheTrace = parseCacheTrace(fetch.datasource_load_trace?.cache_trace); + const fetchOutputTrace = fetch.datasource_load_trace?.output?.extensions?.trace; if (fetchOutputTrace) { fetchNode.outputTrace = { @@ -290,6 +317,15 @@ const Trace = ({ fetchNode.loadStats = mappedData; } + fetchNode.cacheTrace = parseCacheTrace(fetch.trace?.cache_trace); + + // For cache hits with no load timing, synthesize timing from cache trace data + if (!fetchNode.durationSinceStart && fetchNode.cacheTrace) { + const ct = fetch.trace?.cache_trace; + fetchNode.durationSinceStart = ct?.duration_since_start_nanoseconds ?? plannerEndNs; + fetchNode.durationLoad = minimumVisibleDurationNs(ct?.duration_nanoseconds); // minimum 1µs so the bar is visible + } + const fetchOutputTrace = fetch.trace?.output?.extensions?.trace; if (fetchOutputTrace) { fetchNode.outputTrace = { @@ -375,6 +411,7 @@ const Trace = ({ const normalizeStats = parsedResponse.extensions.trace.info.normalize_stats; const validateStats = parsedResponse.extensions.trace.info.validate_stats; const plannerStats = parsedResponse.extensions.trace.info.planner_stats; + plannerEndNs = plannerStats.duration_since_start_nanoseconds + plannerStats.duration_nanoseconds; const parse = { id: 'parse', @@ -458,6 +495,15 @@ const Trace = ({ }, }); + // When no fetch had load timing data (e.g. all served from cache), + // gEndTimeNano was never updated. Estimate from the planner phase end. + if (gEndTimeNano <= gStartTimeNano) { + gEndTimeNano = gStartTimeNano + BigInt(plannerEndNs); + } + if (!executeDurationSinceStart) { + executeDurationSinceStart = plannerEndNs; + } + const execute = { id: 'execute', type: 'execute', @@ -606,7 +652,7 @@ export const TraceView = () => { const hasTrace = hasTraceHeader && hasTraceInResponse; - const [view, setView] = useState<'tree' | 'waterfall'>('tree'); + const [view, setView] = useState<'tree' | 'waterfall'>('waterfall'); const isSubscription = useMemo(() => { try { @@ -669,7 +715,7 @@ export const TraceView = () => { return (
- setView(v)}> + setView(v)}>
diff --git a/playground/src/components/playground/types.ts b/playground/src/components/playground/types.ts index cc961c491c..c3f629bc35 100644 --- a/playground/src/components/playground/types.ts +++ b/playground/src/components/playground/types.ts @@ -16,7 +16,9 @@ export type TabsState = { activeTabIndex: number; }; -export type PlaygroundView = 'response' | 'request-trace' | 'query-plan'; +export type PlaygroundView = 'response' | 'request-trace' | 'query-plan' | 'cache-explorer'; + +export type CacheMode = 'enabled' | 'no-l1' | 'no-l2' | 'disabled'; type PlaygroundContextType = { graphId: string; @@ -25,6 +27,8 @@ type PlaygroundContextType = { statusText?: string; view: PlaygroundView; setView: (val: PlaygroundView) => void; + cacheMode: CacheMode; + setCacheMode: (val: CacheMode) => void; }; export const PlaygroundContext = createContext({ @@ -32,6 +36,8 @@ export const PlaygroundContext = createContext({ tabsState: { tabs: [], activeTabIndex: 0 }, view: 'response', setView: () => {}, + cacheMode: 'enabled', + setCacheMode: () => {}, }); export type PlaygroundScript = { @@ -51,6 +57,44 @@ export type LoadStatsEntry = { export type LoadStats = LoadStatsEntry[]; +export type CacheTrace = { + l1Enabled: boolean; + l2Enabled: boolean; + cacheName: string; + ttlSeconds: number; + entityCount: number; + l1Hit: number; + l1Miss: number; + l2Hit: number; + l2Miss: number; + durationSinceStart?: number; + durationSinceStartPretty?: string; + duration?: number; + durationPretty?: string; + l2GetDurationPretty?: string; + l2SetDurationPretty?: string; + keys?: string[]; +}; + +export type CacheStatus = 'l1-hit' | 'l2-hit' | 'miss' | 'no-lookup'; + +export const getCacheStatus = (ct: CacheTrace): CacheStatus => { + if (ct.l1Hit > 0) return 'l1-hit'; + if (ct.l2Hit > 0) return 'l2-hit'; + if (ct.l1Miss > 0 || ct.l2Miss > 0) return 'miss'; + return 'no-lookup'; +}; + +export const getCacheStatusLabel = (ct: CacheTrace): string => { + const status = getCacheStatus(ct); + switch (status) { + case 'l1-hit': return 'L1 HIT'; + case 'l2-hit': return 'L2 HIT'; + case 'miss': return 'MISS'; + case 'no-lookup': return 'NO LOOKUP'; + } +}; + export type ARTFetchNode = { id: string; parentId?: string; @@ -80,6 +124,7 @@ export type ARTFetchNode = { singleFlightSharedResponse: boolean; loadSkipped: boolean; loadStats?: LoadStats; + cacheTrace?: CacheTrace; }; export type Representation = { diff --git a/playground/src/components/playground/view-cache.tsx b/playground/src/components/playground/view-cache.tsx new file mode 100644 index 0000000000..c729437a2a --- /dev/null +++ b/playground/src/components/playground/view-cache.tsx @@ -0,0 +1,84 @@ +import { cn } from '@/lib/utils'; +import { CodeViewer } from '../code-viewer'; +import { Button } from '../ui/button'; +import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '../ui/dialog'; +import { CacheTrace, getCacheStatus, getCacheStatusLabel } from './types'; + +export const ViewCache = ({ cacheTrace, asChild }: { cacheTrace: CacheTrace; asChild?: boolean }) => { + const status = getCacheStatus(cacheTrace); + const isHit = status === 'l1-hit' || status === 'l2-hit'; + + return ( + + + {asChild ? ( + + ) : ( + 'View Cache' + )} + + + + Entity Cache + +
+
+

Status

+

+ Result:{' '} + + {getCacheStatusLabel(cacheTrace)} + +

+

Entities: {cacheTrace.entityCount}

+
+
+

Configuration

+

Cache Name: {cacheTrace.cacheName}

+

TTL: {cacheTrace.ttlSeconds}s

+

L1 Enabled: {cacheTrace.l1Enabled ? 'Yes' : 'No'}

+

L2 Enabled: {cacheTrace.l2Enabled ? 'Yes' : 'No'}

+
+
+

Statistics

+

L1: {cacheTrace.l1Hit} hit / {cacheTrace.l1Miss} miss

+

L2: {cacheTrace.l2Hit} hit / {cacheTrace.l2Miss} miss

+ {cacheTrace.durationPretty && ( +

Cache Duration: {cacheTrace.durationPretty}

+ )} + {cacheTrace.l2GetDurationPretty && ( +

L2 Get: {cacheTrace.l2GetDurationPretty}

+ )} + {cacheTrace.l2SetDurationPretty && ( +

L2 Set: {cacheTrace.l2SetDurationPretty}

+ )} +
+ {cacheTrace.keys && cacheTrace.keys.length > 0 && ( +
+

Cache Keys ({cacheTrace.keys.length})

+
+ { + try { return JSON.parse(k); } catch { return k; } + }), + null, + 2, + )} + language="json" + /> +
+
+ )} +
+
+
+ ); +}; diff --git a/playground/src/test/setup.ts b/playground/src/test/setup.ts new file mode 100644 index 0000000000..bb02c60cd0 --- /dev/null +++ b/playground/src/test/setup.ts @@ -0,0 +1 @@ +import '@testing-library/jest-dom/vitest'; diff --git a/playground/vitest.config.ts b/playground/vitest.config.ts new file mode 100644 index 0000000000..ab5ea87b04 --- /dev/null +++ b/playground/vitest.config.ts @@ -0,0 +1,16 @@ +import path from 'path'; +import { defineConfig } from 'vitest/config'; +import react from '@vitejs/plugin-react'; + +export default defineConfig({ + plugins: [react()], + resolve: { + alias: { + '@': path.resolve(__dirname, './src'), + }, + }, + test: { + environment: 'jsdom', + setupFiles: ['./src/test/setup.ts'], + }, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2e8088855d..7b9265e032 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -842,12 +842,24 @@ importers: '@tailwindcss/typography': specifier: ^0.5.10 version: 0.5.13(tailwindcss@3.4.15(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.5.2))) + '@testing-library/dom': + specifier: ^10.4.1 + version: 10.4.1 + '@testing-library/jest-dom': + specifier: ^6.9.1 + version: 6.9.1 + '@testing-library/react': + specifier: ^16.3.2 + version: 16.3.2(@testing-library/dom@10.4.1)(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@types/crypto-js': specifier: ^4.2.2 version: 4.2.2 '@types/dagre': specifier: ^0.7.52 version: 0.7.52 + '@types/jsdom': + specifier: ^21.1.7 + version: 21.1.7 '@types/lodash': specifier: ^4.17.12 version: 4.17.12 @@ -869,6 +881,9 @@ importers: autoprefixer: specifier: ^10.4.16 version: 10.4.19(postcss@8.4.38) + jsdom: + specifier: ^26.1.0 + version: 26.1.0 postcss: specifier: ^8.4.38 version: 8.4.38 @@ -899,6 +914,9 @@ importers: vite-plugin-singlefile: specifier: ^2.2.0 version: 2.2.0(rollup@4.59.0)(vite@5.4.21(@types/node@20.12.12)(terser@5.44.1)) + vitest: + specifier: ^3.2.4 + version: 3.2.4(@types/debug@4.1.12)(@types/node@20.12.12)(jsdom@26.1.0)(terser@5.44.1) protographic: dependencies: @@ -1351,6 +1369,9 @@ packages: '@acemir/cssom@0.9.31': resolution: {integrity: sha512-ZnR3GSaH+/vJ0YlHau21FjfLYjMpYVIzTD8M8vIEQvIGxeOXyXdzCI140rrCY862p/C/BbzWsjc1dgnM9mkoTA==} + '@adobe/css-tools@4.4.4': + resolution: {integrity: sha512-Elp+iwUx5rN5+Y8xLt5/GRoG20WGoDCQ/1Fb+1LiGtvwbDavuSk0jhD/eZdckHAuzcDzccnkv+rEjyWfRx18gg==} + '@alloc/quick-lru@5.2.0': resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} @@ -7396,10 +7417,18 @@ packages: '@tanstack/virtual-core@3.0.0': resolution: {integrity: sha512-SYXOBTjJb05rXa2vl55TTwO40A6wKu0R5i1qQwhJYNDIqaIGF7D0HsLw+pJAyi2OvntlEIVusx3xtbbgSUi6zg==} + '@testing-library/dom@10.4.1': + resolution: {integrity: sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==} + engines: {node: '>=18'} + '@testing-library/dom@9.3.4': resolution: {integrity: sha512-FlS4ZWlp97iiNWig0Muq8p+3rVDjRiYE+YKGbAqXOu9nwJFFOdL00kFpz42M+4huzYi86vAK1sOOfyOG45muIQ==} engines: {node: '>=14'} + '@testing-library/jest-dom@6.9.1': + resolution: {integrity: sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==} + engines: {node: '>=14', npm: '>=6', yarn: '>=1'} + '@testing-library/react@14.1.2': resolution: {integrity: sha512-z4p7DVBTPjKM5qDZ0t5ZjzkpSNb+fZy1u6bzO7kk8oeGagpPCAtgh4cx1syrfp7a+QWkM021jGqjJaxJJnXAZg==} engines: {node: '>=14'} @@ -7407,6 +7436,21 @@ packages: react: 18.3.1 react-dom: ^18.0.0 + '@testing-library/react@16.3.2': + resolution: {integrity: sha512-XU5/SytQM+ykqMnAnvB2umaJNIOsLF3PVv//1Ew4CTcpz0/BRyy/af40qqrt7SjKpDdT1saBMc42CUok5gaw+g==} + engines: {node: '>=18'} + peerDependencies: + '@testing-library/dom': ^10.0.0 + '@types/react': ^18.0.0 || ^19.0.0 + '@types/react-dom': ^18.0.0 || ^19.0.0 + react: 18.3.1 + react-dom: ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@tiptap/core@2.1.13': resolution: {integrity: sha512-cMC8bgTN63dj1Mv82iDeeLl6sa9kY0Pug8LSalxVEptRmyFVsVxGgu2/6Y3T+9aCYScxfS06EkA8SdzFMAwYTQ==} peerDependencies: @@ -7768,6 +7812,9 @@ packages: '@types/js-yaml@4.0.5': resolution: {integrity: sha512-FhpRzf927MNQdRZP0J5DLIdTXhjLYzeUTmLAu69mnVksLH9CJY3IuSeEgbKUki7GQZm0WqDkGzyxju2EZGD2wA==} + '@types/jsdom@21.1.7': + resolution: {integrity: sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA==} + '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} @@ -7934,6 +7981,9 @@ packages: '@types/through@0.0.30': resolution: {integrity: sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==} + '@types/tough-cookie@4.0.5': + resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==} + '@types/trusted-types@2.0.7': resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} @@ -9130,6 +9180,9 @@ packages: resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} engines: {node: '>= 6'} + css.escape@1.5.1: + resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} + cssesc@3.0.0: resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} engines: {node: '>=4'} @@ -9452,6 +9505,9 @@ packages: dom-accessibility-api@0.5.16: resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==} + dom-accessibility-api@0.6.3: + resolution: {integrity: sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==} + dom-helpers@3.4.0: resolution: {integrity: sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA==} @@ -11331,6 +11387,15 @@ packages: canvas: optional: true + jsdom@26.1.0: + resolution: {integrity: sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==} + engines: {node: '>=18'} + peerDependencies: + canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + jsdom@27.2.0: resolution: {integrity: sha512-454TI39PeRDW1LgpyLPyURtB4Zx1tklSr6+OFOipsxGUH1WMTvk6C65JQdrj455+DP2uJ1+veBEHTGFKWVLFoA==} engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} @@ -12218,6 +12283,9 @@ packages: nullthrows@1.1.1: resolution: {integrity: sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==} + nwsapi@2.2.23: + resolution: {integrity: sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ==} + object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -13296,6 +13364,10 @@ packages: react: 18.3.1 react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0 + redent@3.0.0: + resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} + engines: {node: '>=8'} + redent@4.0.0: resolution: {integrity: sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==} engines: {node: '>=12'} @@ -14101,9 +14173,16 @@ packages: resolution: {integrity: sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==} engines: {node: '>=12'} + tldts-core@6.1.86: + resolution: {integrity: sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==} + tldts-core@7.0.25: resolution: {integrity: sha512-ZjCZK0rppSBu7rjHYDYsEaMOIbbT+nWF57hKkv4IUmZWBNrBWBOjIElc0mKRgLM8bm7x/BBlof6t2gi/Oq/Asw==} + tldts@6.1.86: + resolution: {integrity: sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==} + hasBin: true + tldts@7.0.25: resolution: {integrity: sha512-keinCnPbwXEUG3ilrWQZU+CqcTTzHq9m2HhoUP2l7Xmi8l1LuijAXLpAJ5zRW+ifKTNscs4NdCkfkDCBYm352w==} hasBin: true @@ -14142,6 +14221,10 @@ packages: resolution: {integrity: sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==} engines: {node: '>=6'} + tough-cookie@5.1.2: + resolution: {integrity: sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==} + engines: {node: '>=16'} + tough-cookie@6.0.1: resolution: {integrity: sha512-LktZQb3IeoUWB9lqR5EWTHgW/VTITCXg4D21M+lvybRVdylLrRMnqaIONLVb5mav8vM19m44HIcGq4qASeu2Qw==} engines: {node: '>=16'} @@ -15090,6 +15173,8 @@ snapshots: '@acemir/cssom@0.9.31': {} + '@adobe/css-tools@4.4.4': {} + '@alloc/quick-lru@5.2.0': {} '@ampproject/remapping@2.3.0': @@ -15693,7 +15778,7 @@ snapshots: '@babel/code-frame@7.27.1': dependencies: - '@babel/helper-validator-identifier': 7.27.1 + '@babel/helper-validator-identifier': 7.28.5 js-tokens: 4.0.0 picocolors: 1.1.1 @@ -18678,7 +18763,7 @@ snapshots: dependencies: agent-base: 7.1.4 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.5 + https-proxy-agent: 7.0.6 lru-cache: 11.2.4 socks-proxy-agent: 8.0.5 transitivePeerDependencies: @@ -19979,7 +20064,7 @@ snapshots: '@radix-ui/react-arrow@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.27.1 + '@babel/runtime': 7.28.6 '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -20914,7 +20999,7 @@ snapshots: '@radix-ui/react-use-escape-keydown@1.0.3(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.27.1 + '@babel/runtime': 7.28.6 '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@18.3.1) react: 18.3.1 optionalDependencies: @@ -20966,7 +21051,7 @@ snapshots: '@radix-ui/react-use-rect@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.27.1 + '@babel/runtime': 7.28.6 '@radix-ui/rect': 1.0.1 react: 18.3.1 optionalDependencies: @@ -21022,7 +21107,7 @@ snapshots: '@radix-ui/rect@1.0.1': dependencies: - '@babel/runtime': 7.27.1 + '@babel/runtime': 7.28.6 '@radix-ui/rect@1.1.0': {} @@ -22366,6 +22451,17 @@ snapshots: '@tanstack/virtual-core@3.0.0': {} + '@testing-library/dom@10.4.1': + dependencies: + '@babel/code-frame': 7.27.1 + '@babel/runtime': 7.28.6 + '@types/aria-query': 5.0.4 + aria-query: 5.3.0 + dom-accessibility-api: 0.5.16 + lz-string: 1.5.0 + picocolors: 1.1.1 + pretty-format: 27.5.1 + '@testing-library/dom@9.3.4': dependencies: '@babel/code-frame': 7.26.2 @@ -22377,6 +22473,15 @@ snapshots: lz-string: 1.5.0 pretty-format: 27.5.1 + '@testing-library/jest-dom@6.9.1': + dependencies: + '@adobe/css-tools': 4.4.4 + aria-query: 5.3.0 + css.escape: 1.5.1 + dom-accessibility-api: 0.6.3 + picocolors: 1.1.1 + redent: 3.0.0 + '@testing-library/react@14.1.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@babel/runtime': 7.27.1 @@ -22385,6 +22490,16 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + '@testing-library/react@16.3.2(@testing-library/dom@10.4.1)(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + dependencies: + '@babel/runtime': 7.28.6 + '@testing-library/dom': 10.4.1 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 + '@tiptap/core@2.1.13(@tiptap/pm@2.1.13)': dependencies: '@tiptap/pm': 2.1.13 @@ -22798,6 +22913,12 @@ snapshots: '@types/js-yaml@4.0.5': {} + '@types/jsdom@21.1.7': + dependencies: + '@types/node': 20.12.12 + '@types/tough-cookie': 4.0.5 + parse5: 7.3.0 + '@types/json-schema@7.0.15': {} '@types/json5@0.0.29': {} @@ -22989,6 +23110,8 @@ snapshots: dependencies: '@types/node': 20.12.12 + '@types/tough-cookie@4.0.5': {} + '@types/trusted-types@2.0.7': optional: true @@ -23231,13 +23354,21 @@ snapshots: optionalDependencies: vite: 5.4.19(@types/node@20.3.1)(terser@5.44.1) - '@vitest/mocker@3.2.4(vite@5.4.19(@types/node@22.17.0)(terser@5.44.1))': + '@vitest/mocker@3.2.4(vite@5.4.21(@types/node@20.12.12)(terser@5.44.1))': + dependencies: + '@vitest/spy': 3.2.4 + estree-walker: 3.0.3 + magic-string: 0.30.17 + optionalDependencies: + vite: 5.4.21(@types/node@20.12.12)(terser@5.44.1) + + '@vitest/mocker@3.2.4(vite@5.4.21(@types/node@22.17.0)(terser@5.44.1))': dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: 5.4.19(@types/node@22.17.0)(terser@5.44.1) + vite: 5.4.21(@types/node@22.17.0)(terser@5.44.1) '@vitest/pretty-format@3.2.4': dependencies: @@ -24431,6 +24562,8 @@ snapshots: css-what@6.1.0: {} + css.escape@1.5.1: {} + cssesc@3.0.0: {} cssstyle@4.6.0: @@ -24745,6 +24878,8 @@ snapshots: dom-accessibility-api@0.5.16: {} + dom-accessibility-api@0.6.3: {} + dom-helpers@3.4.0: dependencies: '@babel/runtime': 7.27.1 @@ -27071,6 +27206,33 @@ snapshots: - supports-color - utf-8-validate + jsdom@26.1.0: + dependencies: + cssstyle: 4.6.0 + data-urls: 5.0.0 + decimal.js: 10.6.0 + html-encoding-sniffer: 4.0.0 + http-proxy-agent: 7.0.2 + https-proxy-agent: 7.0.6 + is-potential-custom-element-name: 1.0.1 + nwsapi: 2.2.23 + parse5: 7.3.0 + rrweb-cssom: 0.8.0 + saxes: 6.0.0 + symbol-tree: 3.2.4 + tough-cookie: 5.1.2 + w3c-xmlserializer: 5.0.0 + webidl-conversions: 7.0.0 + whatwg-encoding: 3.1.1 + whatwg-mimetype: 4.0.0 + whatwg-url: 14.2.0 + ws: 8.19.0 + xml-name-validator: 5.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + jsdom@27.2.0: dependencies: '@acemir/cssom': 0.9.31 @@ -28221,6 +28383,8 @@ snapshots: nullthrows@1.1.1: {} + nwsapi@2.2.23: {} + object-assign@4.1.1: {} object-hash@3.0.0: {} @@ -29430,6 +29594,11 @@ snapshots: tiny-invariant: 1.3.1 victory-vendor: 36.6.11 + redent@3.0.0: + dependencies: + indent-string: 4.0.0 + strip-indent: 3.0.0 + redent@4.0.0: dependencies: indent-string: 5.0.0 @@ -30410,8 +30579,14 @@ snapshots: titleize@3.0.0: {} + tldts-core@6.1.86: {} + tldts-core@7.0.25: {} + tldts@6.1.86: + dependencies: + tldts-core: 6.1.86 + tldts@7.0.25: dependencies: tldts-core: 7.0.25 @@ -30443,6 +30618,10 @@ snapshots: universalify: 0.2.0 url-parse: 1.5.10 + tough-cookie@5.1.2: + dependencies: + tldts: 6.1.86 + tough-cookie@6.0.1: dependencies: tldts: 7.0.25 @@ -30966,7 +31145,7 @@ snapshots: vite-node@3.2.4(@types/node@20.12.12)(terser@5.44.1): dependencies: cac: 6.7.14 - debug: 4.3.7 + debug: 4.4.1 es-module-lexer: 1.7.0 pathe: 2.0.3 vite: 5.4.21(@types/node@20.12.12)(terser@5.44.1) @@ -31002,7 +31181,7 @@ snapshots: vite-node@3.2.4(@types/node@22.17.0)(terser@5.44.1): dependencies: cac: 6.7.14 - debug: 4.3.7 + debug: 4.4.1 es-module-lexer: 1.7.0 pathe: 2.0.3 vite: 5.4.21(@types/node@22.17.0)(terser@5.44.1) @@ -31088,16 +31267,6 @@ snapshots: fsevents: 2.3.3 terser: 5.44.1 - vite@5.4.19(@types/node@22.17.0)(terser@5.44.1): - dependencies: - esbuild: 0.21.5 - postcss: 8.5.3 - rollup: 4.59.0 - optionalDependencies: - '@types/node': 22.17.0 - fsevents: 2.3.3 - terser: 5.44.1 - vite@5.4.21(@types/node@18.19.21)(terser@5.44.1): dependencies: esbuild: 0.21.5 @@ -31178,6 +31347,46 @@ snapshots: - supports-color - terser + vitest@3.2.4(@types/debug@4.1.12)(@types/node@20.12.12)(jsdom@26.1.0)(terser@5.44.1): + dependencies: + '@types/chai': 5.2.2 + '@vitest/expect': 3.2.4 + '@vitest/mocker': 3.2.4(vite@5.4.21(@types/node@20.12.12)(terser@5.44.1)) + '@vitest/pretty-format': 3.2.4 + '@vitest/runner': 3.2.4 + '@vitest/snapshot': 3.2.4 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.2.1 + debug: 4.4.1 + expect-type: 1.2.1 + magic-string: 0.30.17 + pathe: 2.0.3 + picomatch: 4.0.3 + std-env: 3.9.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.15 + tinypool: 1.1.1 + tinyrainbow: 2.0.0 + vite: 5.4.21(@types/node@20.12.12)(terser@5.44.1) + vite-node: 3.2.4(@types/node@20.12.12)(terser@5.44.1) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/debug': 4.1.12 + '@types/node': 20.12.12 + jsdom: 26.1.0 + transitivePeerDependencies: + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + vitest@3.2.4(@types/debug@4.1.12)(@types/node@20.12.12)(jsdom@27.2.0)(terser@5.44.1): dependencies: '@types/chai': 5.2.2 @@ -31302,14 +31511,14 @@ snapshots: dependencies: '@types/chai': 5.2.2 '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4(vite@5.4.19(@types/node@22.17.0)(terser@5.44.1)) + '@vitest/mocker': 3.2.4(vite@5.4.21(@types/node@22.17.0)(terser@5.44.1)) '@vitest/pretty-format': 3.2.4 '@vitest/runner': 3.2.4 '@vitest/snapshot': 3.2.4 '@vitest/spy': 3.2.4 '@vitest/utils': 3.2.4 chai: 5.2.1 - debug: 4.3.7 + debug: 4.4.1 expect-type: 1.2.1 magic-string: 0.30.17 pathe: 2.0.3 @@ -31317,10 +31526,10 @@ snapshots: std-env: 3.9.0 tinybench: 2.9.0 tinyexec: 0.3.2 - tinyglobby: 0.2.14 + tinyglobby: 0.2.15 tinypool: 1.1.1 tinyrainbow: 2.0.0 - vite: 5.4.19(@types/node@22.17.0)(terser@5.44.1) + vite: 5.4.21(@types/node@22.17.0)(terser@5.44.1) vite-node: 3.2.4(@types/node@22.17.0)(terser@5.44.1) why-is-node-running: 2.3.0 optionalDependencies: diff --git a/proto/wg/cosmo/node/v1/node.proto b/proto/wg/cosmo/node/v1/node.proto index 73ceb7eb62..f9d2d6d1ed 100644 --- a/proto/wg/cosmo/node/v1/node.proto +++ b/proto/wg/cosmo/node/v1/node.proto @@ -91,6 +91,80 @@ message DataSourceConfiguration { repeated EntityInterfaceConfiguration entity_interfaces = 14; repeated EntityInterfaceConfiguration interface_objects = 15; CostConfiguration cost_configuration = 16; + // Entity caching configurations (from composition directives) + repeated EntityCacheConfiguration entity_cache_configurations = 17; + repeated RootFieldCacheConfiguration root_field_cache_configurations = 18; + repeated CachePopulateConfiguration cache_populate_configurations = 19; + repeated CacheInvalidateConfiguration cache_invalidate_configurations = 20; + // Request-scoped field configurations (from @openfed__requestScoped directive) + repeated RequestScopedFieldConfiguration request_scoped_fields = 21; +} + +// Per-field declaration for @openfed__requestScoped. All fields in the same subgraph declaring +// @openfed__requestScoped(key: "X") share L1 key "{subgraphName}.X". The first field to resolve +// populates L1; subsequent fields with the same key inject from L1 and can skip their +// fetch when all required sub-fields are present. +message RequestScopedFieldConfiguration { + string field_name = 1; + string type_name = 2; + string l1_key = 3; + reserved 4; + reserved "resolve_from"; +} + +message EntityCacheConfiguration { + reserved "negative_cache_ttl_seconds"; + string type_name = 1; + // TTL for cached entity values. Required: composition rejects values <= 0, + // so omit (zero) does not occur in practice. Interpreted in seconds. + int64 max_age_seconds = 2; + bool include_headers = 3; + bool partial_cache_load = 4; + bool shadow_mode = 5; + // TTL for caching "not found" entity responses (entity returned null from + // _entities without errors). Omit or 0 disables negative caching and null + // responses are not cached. Positive values are seconds. Composition rejects + // negative values at schema validation time. + int64 not_found_cache_ttl_seconds = 6; +} + +message RootFieldCacheConfiguration { + string field_name = 1; + // TTL for cached root-field responses. Required: composition rejects values + // <= 0. Interpreted in seconds. + int64 max_age_seconds = 2; + bool include_headers = 3; + bool shadow_mode = 4; + string entity_type_name = 5; + repeated EntityKeyMapping entity_key_mappings = 6; +} + +message EntityKeyMapping { + string entity_type_name = 1; + repeated EntityCacheFieldMapping field_mappings = 2; +} + +message EntityCacheFieldMapping { + string entity_key_field = 1; + repeated string argument_path = 2; + bool is_batch = 3; +} + +message CachePopulateConfiguration { + string field_name = 1; + string operation_type = 2; + // Optional override TTL for mutation/subscription populate writes. When omit, + // falls back to the target entity's max_age_seconds (for subscriptions) or + // the cache's default TTL (for mutations). Zero is treated as "no override". + // Composition rejects negative values. + optional int64 max_age_seconds = 3; + string entity_type_name = 4; +} + +message CacheInvalidateConfiguration { + string field_name = 1; + string operation_type = 2; + string entity_type_name = 3; } message CostConfiguration { diff --git a/router-tests/entity_caching/Makefile b/router-tests/entity_caching/Makefile new file mode 100644 index 0000000000..bc04f713ef --- /dev/null +++ b/router-tests/entity_caching/Makefile @@ -0,0 +1,16 @@ +.PHONY: all generate compose + +all: generate compose + +generate: + cd subgraphs/items && go run github.com/99designs/gqlgen generate + cd subgraphs/details && go run github.com/99designs/gqlgen generate + cd subgraphs/inventory && go run github.com/99designs/gqlgen generate + cd subgraphs/viewer && go run github.com/99designs/gqlgen generate + cd subgraphs/articles && go run github.com/99designs/gqlgen generate + cd subgraphs/articlesmeta && go run github.com/99designs/gqlgen generate + +compose: + go run ./cmd/compose + jq . testdata/config.json > testdata/config.json.tmp + mv testdata/config.json.tmp testdata/config.json diff --git a/router-tests/entity_caching/cmd/compose/main.go b/router-tests/entity_caching/cmd/compose/main.go new file mode 100644 index 0000000000..66ec36a71e --- /dev/null +++ b/router-tests/entity_caching/cmd/compose/main.go @@ -0,0 +1,88 @@ +package main + +import ( + "fmt" + "os" + + composition "github.com/wundergraph/cosmo/composition-go" +) + +func main() { + itemsSchema, err := os.ReadFile("subgraphs/items/subgraph/schema.graphqls") + if err != nil { + fmt.Fprintf(os.Stderr, "error reading items schema: %v\n", err) + os.Exit(1) + } + detailsSchema, err := os.ReadFile("subgraphs/details/subgraph/schema.graphqls") + if err != nil { + fmt.Fprintf(os.Stderr, "error reading details schema: %v\n", err) + os.Exit(1) + } + inventorySchema, err := os.ReadFile("subgraphs/inventory/subgraph/schema.graphqls") + if err != nil { + fmt.Fprintf(os.Stderr, "error reading inventory schema: %v\n", err) + os.Exit(1) + } + viewerSchema, err := os.ReadFile("subgraphs/viewer/subgraph/schema.graphqls") + if err != nil { + fmt.Fprintf(os.Stderr, "error reading viewer schema: %v\n", err) + os.Exit(1) + } + articlesSchema, err := os.ReadFile("subgraphs/articles/subgraph/schema.graphqls") + if err != nil { + fmt.Fprintf(os.Stderr, "error reading articles schema: %v\n", err) + os.Exit(1) + } + articlesMetaSchema, err := os.ReadFile("subgraphs/articlesmeta/subgraph/schema.graphqls") + if err != nil { + fmt.Fprintf(os.Stderr, "error reading articlesmeta schema: %v\n", err) + os.Exit(1) + } + + result, err := composition.BuildRouterConfiguration( + &composition.Subgraph{ + Name: "items", + Schema: string(itemsSchema), + URL: "http://items.entity-cache-test.local/graphql", + }, + &composition.Subgraph{ + Name: "details", + Schema: string(detailsSchema), + URL: "http://details.entity-cache-test.local/graphql", + }, + &composition.Subgraph{ + Name: "inventory", + Schema: string(inventorySchema), + URL: "http://inventory.entity-cache-test.local/graphql", + }, + &composition.Subgraph{ + Name: "viewer", + Schema: string(viewerSchema), + URL: "http://viewer.entity-cache-test.local/graphql", + }, + &composition.Subgraph{ + Name: "articles", + Schema: string(articlesSchema), + URL: "http://articles.entity-cache-test.local/graphql", + }, + &composition.Subgraph{ + Name: "articlesmeta", + Schema: string(articlesMetaSchema), + URL: "http://articlesmeta.entity-cache-test.local/graphql", + }, + ) + if err != nil { + fmt.Fprintf(os.Stderr, "composition error: %v\n", err) + os.Exit(1) + } + + if err := os.MkdirAll("testdata", 0o755); err != nil { + fmt.Fprintf(os.Stderr, "error creating testdata dir: %v\n", err) + os.Exit(1) + } + if err := os.WriteFile("testdata/config.json", []byte(result), 0o644); err != nil { + fmt.Fprintf(os.Stderr, "error writing config: %v\n", err) + os.Exit(1) + } + fmt.Printf("config written to testdata/config.json (%d bytes)\n", len(result)) +} diff --git a/router-tests/entity_caching/entity_caching_test.go b/router-tests/entity_caching/entity_caching_test.go new file mode 100644 index 0000000000..c54373f47e --- /dev/null +++ b/router-tests/entity_caching/entity_caching_test.go @@ -0,0 +1,2664 @@ +package entity_caching + +import ( + "encoding/json" + "net/http" + "sync/atomic" + "testing" + "time" + + "github.com/stretchr/testify/require" + + itemsModel "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/items/subgraph/model" + "github.com/wundergraph/cosmo/router-tests/testenv" + "github.com/wundergraph/cosmo/router/core" + nodev1 "github.com/wundergraph/cosmo/router/gen/proto/wg/cosmo/node/v1" + "github.com/wundergraph/cosmo/router/pkg/config" + "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve" +) + +func TestEntityCaching(t *testing.T) { + t.Parallel() + + t.Run("L2/basic miss then hit", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + } + res := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, `{"data":{"item":{"id":"1","name":"Widget","description":"A versatile widget for everyday use"}}}`, res.Body) + + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), detailsAfterFirst) + + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, `{"data":{"item":{"id":"1","name":"Widget","description":"A versatile widget for everyday use"}}}`, res2.Body) + + // Details subgraph should NOT be called again (cache hit) + require.Equal(t, int64(1), counters.details.Load()) + }) + }) + + t.Run("L2/different entities use separate entries", func(t *testing.T) { + t.Parallel() + + servers, _ := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + reqItem1 := testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + } + res1 := xEnv.MakeGraphQLRequestOK(reqItem1) + require.Equal(t, `{"data":{"item":{"id":"1","name":"Widget","description":"A versatile widget for everyday use"}}}`, res1.Body) + + res2 := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "2") { id name description } }`, + }) + require.Equal(t, `{"data":{"item":{"id":"2","name":"Gadget","description":"A high-tech gadget with many features"}}}`, res2.Body) + + // Both entities should produce cache entries + require.Equal(t, 2, cache.Len()) + + // Re-fetch id:"1" — verify response correctness + res3 := xEnv.MakeGraphQLRequestOK(reqItem1) + require.Equal(t, `{"data":{"item":{"id":"1","name":"Widget","description":"A versatile widget for everyday use"}}}`, res3.Body) + }) + }) + + t.Run("L2/list query caching", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ items { id description rating } }`, + } + res := xEnv.MakeGraphQLRequestOK(req) + require.Contains(t, res.Body, `"description"`) + require.Contains(t, res.Body, `"rating"`) + + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), detailsAfterFirst) + + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, res.Body, res2.Body) + require.Equal(t, int64(1), counters.details.Load()) + }) + }) + + t.Run("L2/cache entries are written", func(t *testing.T) { + t.Parallel() + + servers, _ := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + require.Equal(t, 0, cache.Len()) + + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id description } }`, + }) + + require.Equal(t, 1, cache.Len()) + }) + }) + + t.Run("L2/disabled caching does not cache", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + clearEntityCacheConfigs(routerConfig) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + } + xEnv.MakeGraphQLRequestOK(req) + detailsFirst := counters.details.Load() + require.Equal(t, int64(1), detailsFirst) + + xEnv.MakeGraphQLRequestOK(req) + // Details subgraph called again (no caching) + require.Equal(t, int64(2), counters.details.Load()) + }) + }) + + t.Run("L2/multi-subgraph caching", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // Fetch description (from details subgraph) + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id description } }`, + }) + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), detailsAfterFirst) + + // Fetch available (from inventory subgraph) + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id available } }`, + }) + inventoryAfterFirst := counters.inventory.Load() + require.Equal(t, int64(1), inventoryAfterFirst) + + // Re-fetch both: should be cached + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id description } }`, + }) + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id available } }`, + }) + + require.Equal(t, detailsAfterFirst, counters.details.Load()) + require.Equal(t, inventoryAfterFirst, counters.inventory.Load()) + }) + }) + + t.Run("L2/cross-subgraph combined query", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description available } }`, + } + res := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, `{"data":{"item":{"id":"1","name":"Widget","description":"A versatile widget for everyday use","available":true}}}`, res.Body) + + detailsAfterFirst := counters.details.Load() + inventoryAfterFirst := counters.inventory.Load() + + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, `{"data":{"item":{"id":"1","name":"Widget","description":"A versatile widget for everyday use","available":true}}}`, res2.Body) + + require.Equal(t, detailsAfterFirst, counters.details.Load()) + require.Equal(t, inventoryAfterFirst, counters.inventory.Load()) + }) + }) + + t.Run("Shadow/always fetches", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingOptions(cache), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + setEntityCacheShadowMode(routerConfig, true) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + } + xEnv.MakeGraphQLRequestOK(req) + detailsFirst := counters.details.Load() + + xEnv.MakeGraphQLRequestOK(req) + // Shadow mode: subgraph ALWAYS called, but cache is populated + require.Equal(t, detailsFirst+1, counters.details.Load()) + require.Equal(t, 1, cache.Len()) + }) + }) + + t.Run("L2/partial cache load", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + setEntityCachePartialLoad(routerConfig, true) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + // Warm cache for id:"1" — this populates one entity entry in L2. + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id description } }`, + }) + detailsAfterWarm := counters.details.Load() + require.Equal(t, int64(1), detailsAfterWarm) + require.GreaterOrEqual(t, cache.Len(), 1, + "warm-up must populate at least one L2 entity entry before the partial-load path is exercised") + cacheLenAfterWarm := cache.Len() + + // List query: id:"1" served from cache, other IDs fetched from + // details. With L2 disabled the warm-up wouldn't have written + // anything, so this assertion of exactly one additional details + // call only holds when partial-load actually reads from L2. + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ items { id description } }`, + }) + require.Equal(t, detailsAfterWarm+1, counters.details.Load(), + "partial-load must fetch only the uncached entities; one extra details call expected") + + // After the list query every entity is cached. + require.Greater(t, cache.Len(), cacheLenAfterWarm, + "partial-load must write the newly-fetched entities back to L2 so subsequent reads are served from cache") + + // Repeat list query: all entities now cached → no additional details call. + detailsBeforeRepeat := counters.details.Load() + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ items { id description } }`, + }) + require.Equal(t, detailsBeforeRepeat, counters.details.Load(), + "repeat list query must be served entirely from cache — this fails if L2 is off") + }) + }) + + t.Run("L2/TTL expiry", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + setEntityCacheTTL(routerConfig, 1) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id description } }`, + } + xEnv.MakeGraphQLRequestOK(req) + detailsAfterFirst := counters.details.Load() + + // Immediately, should be cached + xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, detailsAfterFirst, counters.details.Load()) + + // Wait for TTL expiry + time.Sleep(1500 * time.Millisecond) + + // After expiry, cache miss + xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, detailsAfterFirst+1, counters.details.Load()) + }) + }) + + t.Run("L2/per-subgraph cache name", func(t *testing.T) { + t.Parallel() + + servers, _ := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + defaultCache := newMemoryCache(t) + customCache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingOptionsWithSubgraphConfig( + map[string]resolve.LoaderCache{ + "default": defaultCache, + "custom": customCache, + }, + []config.EntityCachingSubgraphCacheOverride{ + { + Name: "details", + Entities: []config.EntityCachingEntityConfig{ + {Type: "Item", StorageProviderID: "custom"}, + }, + }, + }, + ), + }, func(t *testing.T, xEnv *testenv.Environment) { + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id description } }`, + }) + + require.Equal(t, 1, customCache.Len()) + }) + }) + + t.Run("L2/include headers varies cache key", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: append( + entityCachingL2OnlyOptions(cache), + core.WithHeaderRules(config.HeaderRules{ + All: &config.GlobalHeaderRule{ + Request: []*config.RequestHeaderRule{ + { + Operation: config.HeaderRuleOperationPropagate, + Named: "X-Tenant", + }, + }, + }, + }), + ), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + setEntityCacheIncludeHeaders(routerConfig, true) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + // Request with header A + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id description } }`, + Header: map[string][]string{"X-Tenant": {"A"}}, + }) + detailsAfterA := counters.details.Load() + + // Request with header B — different cache key, miss + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id description } }`, + Header: map[string][]string{"X-Tenant": {"B"}}, + }) + detailsAfterB := counters.details.Load() + require.Equal(t, detailsAfterA+1, detailsAfterB) + + // Request with header A again — should hit + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id description } }`, + Header: map[string][]string{"X-Tenant": {"A"}}, + }) + require.Equal(t, detailsAfterB, counters.details.Load()) + }) + }) + + t.Run("L2/negative TTL caches not-found response within window", func(t *testing.T) { + // Exercises the entity-level not-found cache: items subgraph has an id + // that details subgraph does NOT have. On first fetch, details' + // _entities resolver returns null for that key. With notFoundCacheTtl + // set, the router caches the null result so the second fetch skips the + // details subgraph. Verifying via counters.details (rather than + // counters.items) is the signal the reviewer asked for: the items + // subgraph is always called in this flow, so only the details counter + // distinguishes a not-found cache hit from a miss. + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + // Create an item in items-subgraph via mutation, but details-subgraph + // has no record for the new id — entity hydration will return null. + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + setNotFoundCacheTTL(routerConfig, 60) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + // Reserve a new id by creating the item in items-subgraph. + createRes := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `mutation { createItem(name: "Ghost", category: "phantom") { id } }`, + }) + var created struct { + Data struct { + CreateItem struct { + ID string `json:"id"` + } `json:"createItem"` + } `json:"data"` + } + require.NoError(t, json.Unmarshal([]byte(createRes.Body), &created)) + require.NotEmpty(t, created.Data.CreateItem.ID) + newID := created.Data.CreateItem.ID + + req := testenv.GraphQLRequest{ + Query: `{ item(id: "` + newID + `") { id description } }`, + } + // First query: items returns the new entity, details returns null. + // The details subgraph IS called once. + xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, int64(1), counters.details.Load(), + "first request must hit the details entity subgraph for the not-found hydration") + + // Second query: with notFoundCacheTtl, the null entity is cached, + // so details is NOT called again. With L2 disabled this counter + // would grow to 2. + xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, int64(1), counters.details.Load(), + "not-found cache must short-circuit the details subgraph; with L2 disabled this counter would be 2") + }) + }) + + t.Run("L2/root field caching with key mapping", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + } + // Cross-subgraph query to trigger both root-field and entity caching. + res := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, `{"data":{"item":{"id":"1","name":"Widget","description":"A versatile widget for everyday use"}}}`, res.Body) + + itemsAfterFirst := counters.items.Load() + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), itemsAfterFirst) + require.Equal(t, int64(1), detailsAfterFirst) + require.GreaterOrEqual(t, cache.Len(), 1) + + // Same query — both root-field (items) AND entity (details) caches + // must hit. Asserting on counters.items specifically is what the + // reviewer asked for: the previous form only checked details and + // so would pass even if @queryCache were completely ignored. + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, `{"data":{"item":{"id":"1","name":"Widget","description":"A versatile widget for everyday use"}}}`, res2.Body) + require.Equal(t, itemsAfterFirst, counters.items.Load(), + "root-field cache hit: items subgraph must NOT be re-fetched; with @queryCache ignored this counter would be 2") + require.Equal(t, detailsAfterFirst, counters.details.Load(), + "entity cache hit: details subgraph must NOT be re-fetched") + }) + }) + + t.Run("L2/root field list caching", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ items { id name description } }`, + } + // Cross-subgraph list query: exercises both the root-field cache + // on the items subgraph and the per-entity cache on details. + res := xEnv.MakeGraphQLRequestOK(req) + require.Contains(t, res.Body, `"Widget"`) + require.Contains(t, res.Body, `"description"`) + + itemsAfterFirst := counters.items.Load() + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), itemsAfterFirst) + require.Equal(t, int64(1), detailsAfterFirst) + + // 5 entity entries (one per item) + 1 root field L2 entry. + require.Equal(t, 6, cache.Len()) + + // Same query — both root-field AND entity caches must hit. + // Asserting counters.items (not only details) is what the reviewer + // asked for: with @queryCache ignored, items would be refetched. + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, res.Body, res2.Body) + require.Equal(t, itemsAfterFirst, counters.items.Load(), + "root-field cache hit: items subgraph must NOT be re-fetched") + require.Equal(t, detailsAfterFirst, counters.details.Load(), + "entity cache hit: details subgraph must NOT be re-fetched") + }) + }) + + t.Run("L2/root field different args use different cache keys", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // Different arguments must produce different cache keys (two entries). + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name } }`, + }) + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "2") { id name } }`, + }) + require.Equal(t, int64(2), counters.items.Load()) + require.GreaterOrEqual(t, cache.Len(), 2, + "each distinct args tuple must produce its own cache entry") + + // Repeat both calls — each must be a cache hit, so items counter + // stays at 2. With @queryCache ignored (or L2 disabled) items + // would climb to 4. + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name } }`, + }) + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "2") { id name } }`, + }) + require.Equal(t, int64(2), counters.items.Load(), + "repeat calls must be cache hits on the items root field; with L2 disabled this would be 4") + }) + }) + + t.Run("Shadow/query cache always fetches", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingOptions(cache), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + setQueryCacheShadowMode(routerConfig, true) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name } }`, + } + xEnv.MakeGraphQLRequestOK(req) + itemsFirst := counters.items.Load() + // Shadow mode MUST populate the cache even though it does not read + // from it — that's the whole point. Without L2, cache.Len() stays + // at 0 and this assertion fails. + require.GreaterOrEqual(t, cache.Len(), 1, + "shadow mode must still WRITE the root-field entry to L2") + + // Shadow mode: items subgraph is called on the second request too. + xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, itemsFirst+1, counters.items.Load(), + "shadow mode must always fetch from the items subgraph") + }) + }) + + t.Run("L2/mutation invalidates cache", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + } + // Warm cache + xEnv.MakeGraphQLRequestOK(req) + detailsAfterWarm := counters.details.Load() + + // Verify cache hit + xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, detailsAfterWarm, counters.details.Load()) + + // Mutation triggers @cacheInvalidate + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `mutation { updateItem(id: "1", name: "Updated Widget") { id name } }`, + }) + + // After invalidation, cache miss → details subgraph called again + xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, detailsAfterWarm+1, counters.details.Load()) + }) + }) + + t.Run("L2/mutation populates cache", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + lenBefore := cache.Len() + + // createItem has @cachePopulate(maxAge: 60). The mutation response + // body alone isn't a caching signal — we need to verify the L2 was + // actually written and that a follow-up read hits cache. + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `mutation { createItem(name: "Foobar", category: "test") { id name category } }`, + }) + require.Contains(t, res.Body, `"Foobar"`) + + // @cachePopulate MUST have added at least one entry to L2. With + // L2.Enabled=false, lenAfter stays at lenBefore. + require.Greater(t, cache.Len(), lenBefore, + "@cachePopulate must write the mutation result to L2") + + // Extract the newly-created id and verify a follow-up read by id + // is served from cache (items subgraph not called again). + var body struct { + Data struct { + CreateItem struct { + ID string `json:"id"` + } `json:"createItem"` + } `json:"data"` + } + require.NoError(t, json.Unmarshal([]byte(res.Body), &body)) + newID := body.Data.CreateItem.ID + require.NotEmpty(t, newID) + + itemsAfterMutation := counters.items.Load() + readRes := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "` + newID + `") { id name category } }`, + }) + require.Equal(t, + `{"data":{"item":{"id":"`+newID+`","name":"Foobar","category":"test"}}}`, + readRes.Body) + require.Equal(t, itemsAfterMutation, counters.items.Load(), + "follow-up read must be a cache hit (items subgraph not called); with L2 disabled this counter would be itemsAfterMutation+1") + }) + }) + + // Tests that the full circuit breaker lifecycle keeps requests working: + // cache healthy → cache breaks → breaker opens → cache recovers → breaker closes. + // At every phase, GraphQL queries must return correct data. The subgraph call + // counter proves whether the response came from cache (counter unchanged) or + // from a subgraph fetch (counter incremented). + t.Run("L2/circuit breaker degrades gracefully on cache failure", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + + cache := newControllableCache(t) + cooldown := 100 * time.Millisecond + opts, cb := entityCachingOptionsWithCircuitBreakerRef(cache, 2, cooldown) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: opts, + }, func(t *testing.T, xEnv *testenv.Environment) { + const query = `{ item(id: "1") { id name description } }` + const expected = `{"data":{"item":{"id":"1","name":"Widget","description":"A versatile widget for everyday use"}}}` + + // Phase 1: Cache is healthy. First request populates cache. + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: query}) + require.Equal(t, expected, res.Body) + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), detailsAfterFirst) + + // Second request should be a cache hit — subgraph counter stays the same. + res = xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: query}) + require.Equal(t, expected, res.Body) + require.Equal(t, detailsAfterFirst, counters.details.Load(), "expected cache hit: details counter should not change") + + // Phase 2: Cache starts failing. Breaker is still closed, so it tries the cache + // and gets errors. Requests still succeed via subgraph fallback. + cache.SetFailing(true) + for range 2 { + res = xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: query}) + require.Equal(t, expected, res.Body) + } + require.True(t, cb.IsOpen(), "breaker should be open after 2 consecutive failures") + + // Phase 3: Breaker is open — cache is bypassed entirely. + // Subgraph counter should increase with every request. + counterBefore := counters.details.Load() + res = xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: query}) + require.Equal(t, expected, res.Body) + require.Equal(t, counterBefore+1, counters.details.Load(), "expected subgraph fetch when breaker is open") + + // Phase 4: Cache recovers. Wait for cooldown so breaker transitions to half-open. + cache.SetFailing(false) + time.Sleep(cooldown + 50*time.Millisecond) + + // The next request is the half-open probe. It should succeed and close the breaker. + res = xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: query}) + require.Equal(t, expected, res.Body) + require.False(t, cb.IsOpen(), "breaker should be closed after successful probe") + + // Phase 5: Cache works again. Verify we get a cache hit. + detailsBefore := counters.details.Load() + res = xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: query}) + require.Equal(t, expected, res.Body) + require.Equal(t, detailsBefore, counters.details.Load(), "expected cache hit after recovery") + }) + }) + + // Focused test for the half-open → closed transition. + // Trips the breaker, waits for cooldown, then verifies that one successful + // probe closes the breaker and the cache resumes normal operation. + t.Run("L2/circuit breaker recovers after cooldown", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + + cache := newControllableCache(t) + cooldown := 100 * time.Millisecond + cache.SetFailing(true) // Start broken + + opts, cb := entityCachingOptionsWithCircuitBreakerRef(cache, 2, cooldown) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: opts, + }, func(t *testing.T, xEnv *testenv.Environment) { + const query = `{ item(id: "1") { id name description } }` + const expected = `{"data":{"item":{"id":"1","name":"Widget","description":"A versatile widget for everyday use"}}}` + + // Trip the breaker: 2 failures while closed. + for range 2 { + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: query}) + require.Equal(t, expected, res.Body) + } + require.True(t, cb.IsOpen(), "breaker should be open after threshold failures") + + // Fix the cache and wait for cooldown. + cache.SetFailing(false) + time.Sleep(cooldown + 50*time.Millisecond) + + // Probe request: succeeds, closes the breaker, populates cache. + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: query}) + require.Equal(t, expected, res.Body) + require.False(t, cb.IsOpen(), "breaker should be closed after successful probe") + + // Next request should be a cache hit — subgraph not called. + detailsBefore := counters.details.Load() + res = xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: query}) + require.Equal(t, expected, res.Body) + require.Equal(t, detailsBefore, counters.details.Load(), "expected cache hit after recovery") + }) + }) + + t.Run("L2/subscription invalidates cache", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + } + // Warm cache + res := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, `{"data":{"item":{"id":"1","name":"Widget","description":"A versatile widget for everyday use"}}}`, res.Body) + + detailsAfterWarm := counters.details.Load() + + // Verify cache hit + xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, detailsAfterWarm, counters.details.Load()) + + // Start subscription via WebSocket (itemUpdated has @cacheInvalidate) + conn := xEnv.InitGraphQLWebSocketConnection(nil, nil, nil) + + err := testenv.WSWriteJSON(t, conn, testenv.WebSocketMessage{ + ID: "1", + Type: "subscribe", + // Select ONLY key fields so the engine uses SubscriptionCacheModeInvalidate. + // Selecting non-key fields would cause SubscriptionCacheModePopulate instead. + Payload: []byte(`{"query":"subscription { itemUpdated { id } }"}`), + }) + require.NoError(t, err) + + // Push event in background after subscription is established + go func() { + xEnv.WaitForSubscriptionCount(1, 5*time.Second) + servers.itemUpdatedCh <- &itemsModel.Item{ID: "1", Name: "Updated Widget", Category: "tools"} + }() + + // Read subscription event + var msg testenv.WebSocketMessage + err = testenv.WSReadJSON(t, conn, &msg) + require.NoError(t, err) + require.Equal(t, "next", msg.Type) + require.Contains(t, string(msg.Payload), `"itemUpdated"`) + + // Close subscription + require.NoError(t, conn.Close()) + xEnv.WaitForSubscriptionCount(0, 5*time.Second) + + // After invalidation, cache miss → details subgraph called again + xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, detailsAfterWarm+1, counters.details.Load()) + }) + }) + + t.Run("L2/subscription populate config carries entity type name", func(t *testing.T) { + // Regression test for the composition->router pipeline carrying entityTypeName + // end-to-end on @cachePopulate configs. Before this was wired: + // - composition wrote CachePopulateConfig without entityTypeName + // - router compensated by expanding subscription populate across every + // cached entity in the subgraph (semantically ambiguous, wrong config) + // Now the field carries the specific target entity — router looks it up directly. + // + // If composition is reverted, entityTypeName is empty, the router skips the + // populate setup, and the follow-up subscription_populates_cache test goes red. + t.Parallel() + + servers, _ := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + var itemCreatedPopulate *nodev1.CachePopulateConfiguration + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + ModifyRouterConfig: func(rc *nodev1.RouterConfig) { + for _, ds := range rc.EngineConfig.DatasourceConfigurations { + for _, cp := range ds.CachePopulateConfigurations { + if cp.OperationType == "Subscription" && cp.FieldName == "itemCreated" { + itemCreatedPopulate = cp + } + } + } + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + require.NotNil(t, itemCreatedPopulate, + "expected a CachePopulateConfiguration for subscription itemCreated") + require.Equal(t, "Item", itemCreatedPopulate.EntityTypeName, + "@cachePopulate must carry the target entity type name through the pipeline") + }) + }) + + t.Run("L2/subscription populates cache", func(t *testing.T) { + t.Parallel() + + servers, _ := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // Start subscription via WebSocket (itemCreated has @cachePopulate) + conn := xEnv.InitGraphQLWebSocketConnection(nil, nil, nil) + + err := testenv.WSWriteJSON(t, conn, testenv.WebSocketMessage{ + ID: "1", + Type: "subscribe", + Payload: []byte(`{"query":"subscription { itemCreated { id name category } }"}`), + }) + require.NoError(t, err) + + // Push event in background after subscription is established + go func() { + xEnv.WaitForSubscriptionCount(1, 5*time.Second) + servers.itemCreatedCh <- &itemsModel.Item{ID: "99", Name: "New Item", Category: "test"} + }() + + // Read subscription event + var msg testenv.WebSocketMessage + err = testenv.WSReadJSON(t, conn, &msg) + require.NoError(t, err) + require.Equal(t, "next", msg.Type) + require.Contains(t, string(msg.Payload), `"itemCreated"`) + require.Contains(t, string(msg.Payload), `"New Item"`) + + // Close subscription + require.NoError(t, conn.Close()) + xEnv.WaitForSubscriptionCount(0, 5*time.Second) + + // @cachePopulate should have written the entity data to L2 cache + require.Equal(t, 1, cache.Len()) + }) + }) + + t.Run("L2/extensions invalidate cache", func(t *testing.T) { + t.Parallel() + + var extensionFlag atomic.Bool + servers, counters := startSubgraphServersWithMiddleware(t, extensionInvalidationMiddleware(&extensionFlag)) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // Warm cache with extension OFF + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + }) + require.Equal(t, `{"data":{"item":{"id":"1","name":"Widget","description":"A versatile widget for everyday use"}}}`, res.Body) + + detailsAfterWarm := counters.details.Load() + + // Verify cache hit + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + }) + require.Equal(t, detailsAfterWarm, counters.details.Load()) + + // Enable extension: details responses will now include cacheInvalidation for Item id:"1" + extensionFlag.Store(true) + + // Make a request that hits details subgraph for a DIFFERENT entity. + // This triggers the details middleware which adds the extension for id:"1". + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "2") { id name description } }`, + }) + + // Disable extension for the final query + extensionFlag.Store(false) + + // Query id:"1" again — should be cache miss because extension invalidated it + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + }) + require.Equal(t, detailsAfterWarm+2, counters.details.Load()) + }) + }) + + t.Run("L2/mutation populate writes to cache", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // createItem has @cachePopulate(maxAge: 60). The truthful signal is + // that the follow-up read-by-id is served from cache — i.e. the + // items subgraph is NOT called again for the newly created entity. + // + // Checking cache.Len() growth is insufficient: there is a known + // router-Go bug where @cachePopulate writes still land in L2 even + // when L2.Enabled=false, so size-based assertions pass under a + // feature-disabled run. The items-counter read-path check below is + // the assertion that fails when caching is actually off. + createRes := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `mutation { createItem(name: "Foobar", category: "test") { id name category } }`, + }) + var created struct { + Data struct { + CreateItem struct { + ID string `json:"id"` + } `json:"createItem"` + } `json:"data"` + } + require.NoError(t, json.Unmarshal([]byte(createRes.Body), &created)) + require.NotEmpty(t, created.Data.CreateItem.ID) + + itemsAfterCreate := counters.items.Load() + + // Read the just-created entity by its @key. If @cachePopulate wrote + // to L2, the items root-field subgraph must NOT be re-fetched. + // With L2 disabled this counter would grow to itemsAfterCreate+1. + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "` + created.Data.CreateItem.ID + `") { id name category } }`, + }) + require.Equal(t, itemsAfterCreate, counters.items.Load(), + "@cachePopulate must write the entity to L2 so the read-by-id is a cache hit; with L2 disabled this counter would be itemsAfterCreate+1") + }) + }) + + t.Run("Regression/mutation cache populate does not write when L2 is disabled", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: []core.Option{ + core.WithEntityCaching(config.EntityCachingConfiguration{ + Enabled: true, + L1: config.EntityCachingL1Configuration{ + Enabled: true, + }, + L2: config.EntityCachingL2Configuration{ + Enabled: false, + }, + }), + core.WithEntityCacheInstances(map[string]resolve.LoaderCache{ + "default": cache, + }), + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + lenBefore := cache.Len() + + createRes := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `mutation { createItem(name: "NoL2Populate", category: "disabled") { id name category } }`, + }) + require.Contains(t, createRes.Body, `"NoL2Populate"`) + + var created struct { + Data struct { + CreateItem struct { + ID string `json:"id"` + } `json:"createItem"` + } `json:"data"` + } + require.NoError(t, json.Unmarshal([]byte(createRes.Body), &created)) + require.NotEmpty(t, created.Data.CreateItem.ID) + + require.Equal(t, lenBefore, cache.Len(), + "@cachePopulate must not write to L2 when router L2 caching is disabled") + + itemsAfterCreate := counters.items.Load() + readRes := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "` + created.Data.CreateItem.ID + `") { id name category } }`, + }) + require.Equal(t, + `{"data":{"item":{"id":"`+created.Data.CreateItem.ID+`","name":"NoL2Populate","category":"disabled"}}}`, + readRes.Body) + require.Equal(t, itemsAfterCreate+1, counters.items.Load(), + "with L2 disabled, the follow-up read must miss cache and refetch from the items subgraph") + }) + }) + + t.Run("L2/delete mutation invalidates cache", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // Warm cache: first request populates both the root-field L2 entry and + // the Item entity L2 entry. + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + }) + itemsAfterWarm := counters.items.Load() + detailsAfterWarm := counters.details.Load() + require.Greater(t, cache.Len(), 0, + "warm-up must populate at least one cache entry") + + // Second identical request must be a cache hit: neither the items + // (root-field) subgraph nor the details (entity) subgraph is called. + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + }) + require.Equal(t, itemsAfterWarm, counters.items.Load(), + "pre-invalidate read must be a cache hit on the items root-field subgraph") + require.Equal(t, detailsAfterWarm, counters.details.Load(), + "pre-invalidate read must be a cache hit on the details entity subgraph") + + // Delete triggers @cacheInvalidate. The mutation itself hits the items + // subgraph to run the resolver, so we capture the counter AFTER the + // mutation and assert on the delta from the subsequent read. + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `mutation { deleteItem(id: "1") { id name } }`, + }) + itemsAfterMutation := counters.items.Load() + + // After invalidation, the read MUST miss the cache and re-hit the + // items subgraph. The store has persisted the delete, so `item(id:"1")` + // now returns null and no downstream entity fetch to the details + // subgraph happens — but the root-field cache-miss alone is enough + // to prove @cacheInvalidate fired. + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + }) + require.Equal(t, `{"data":{"item":null}}`, res.Body, + "post-delete read must return null since the store now lacks id=1") + require.Equal(t, itemsAfterMutation+1, counters.items.Load(), + "post-invalidate read must refetch from items subgraph; equal count means the cache entry survived the invalidate") + }) + }) + + t.Run("Combined/L1 deduplicates with warm L2", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // Query same entity via two aliases — L1 should deduplicate + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ + a: item(id: "1") { id name description } + b: item(id: "1") { id name description } + }`, + }) + require.Contains(t, res.Body, `"a"`) + require.Contains(t, res.Body, `"b"`) + + // Details subgraph called only once (L1 dedup within single request) + require.Equal(t, int64(1), counters.details.Load()) + + // L2 should also have the entry + require.Equal(t, 1, cache.Len()) + }) + }) + + t.Run("L2/@is directive cache key mapping", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // Query using @is-mapped argument (pid maps to @key field "id") + // Include cross-subgraph field (description from details) to trigger entity caching + req := testenv.GraphQLRequest{ + Query: `{ itemByPid(pid: "1") { id name description } }`, + } + res := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, `{"data":{"itemByPid":{"id":"1","name":"Widget","description":"A versatile widget for everyday use"}}}`, res.Body) + + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), detailsAfterFirst) + + // Same query again — entity cache hit (details subgraph not called again) + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, `{"data":{"itemByPid":{"id":"1","name":"Widget","description":"A versatile widget for everyday use"}}}`, res2.Body) + require.Equal(t, int64(1), counters.details.Load()) + + // Different pid — entity cache miss for this entity + res3 := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ itemByPid(pid: "2") { id name description } }`, + }) + require.Equal(t, `{"data":{"itemByPid":{"id":"2","name":"Gadget","description":"A high-tech gadget with many features"}}}`, res3.Body) + require.Equal(t, int64(2), counters.details.Load()) + }) + }) + + t.Run("Shadow/with failing cache", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingOptions(&FailingEntityCache{}), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + setEntityCacheShadowMode(routerConfig, true) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + } + // Shadow mode + failing cache: every request must still resolve + // end-to-end via the subgraphs. The signal is that BOTH calls hit + // the details subgraph — shadow mode never serves from cache, even + // when the cache is working. With cache failures on top, the only + // data source is the subgraph, so the counter must tick on every + // call. With shadow mode disabled (reads-from-cache), the cache + // error would either short-circuit or fail the request; so this + // counter-based assertion is the truthful shadow-mode signal. + res := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, `{"data":{"item":{"id":"1","name":"Widget","description":"A versatile widget for everyday use"}}}`, res.Body) + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), detailsAfterFirst) + + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, `{"data":{"item":{"id":"1","name":"Widget","description":"A versatile widget for everyday use"}}}`, res2.Body) + require.Equal(t, int64(2), counters.details.Load(), + "shadow mode must refetch from details on every request even when the cache is failing") + }) + }) + + t.Run("L2/negative TTL expires and refetches", func(t *testing.T) { + // Companion to negative_cache_caches_null: asserts the not-found entity + // cache also EXPIRES after its configured TTL. Like the sister test, the + // signal is counters.details (the entity-hydration subgraph) because + // items-subgraph is always called for the root field. The TTL is set + // to 1s; after sleeping >1s, the third request MUST re-hit details. + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + setNotFoundCacheTTL(routerConfig, 1) // 1 second not-found cache TTL + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + // Create an item in items-subgraph; details-subgraph has no record + // for the new id, so entity hydration returns null there. + createRes := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `mutation { createItem(name: "Phantom", category: "void") { id } }`, + }) + var created struct { + Data struct { + CreateItem struct { + ID string `json:"id"` + } `json:"createItem"` + } `json:"data"` + } + require.NoError(t, json.Unmarshal([]byte(createRes.Body), &created)) + newID := created.Data.CreateItem.ID + require.NotEmpty(t, newID) + + req := testenv.GraphQLRequest{ + Query: `{ item(id: "` + newID + `") { id description } }`, + } + // First call: details hit once, null entity cached under its key. + xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, int64(1), counters.details.Load(), + "first request must hit details for the not-found hydration") + + // Immediate re-request: not-found cache hit, details skipped. + xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, int64(1), counters.details.Load(), + "immediate re-request must be a not-found cache hit") + + // Wait past TTL. + time.Sleep(1500 * time.Millisecond) + + // After expiry the not-found entry must be gone, so details is + // re-hit. Without TTL expiry (or with L2 off) this counter would + // stay at 1 or climb on every call respectively. + xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, int64(2), counters.details.Load(), + "after not-found TTL expiry, the next request must re-hit details exactly once") + }) + }) + + t.Run("L2/negative TTL falls back to positive TTL when unset", func(t *testing.T) { + // Regression guard against the new negativeCacheTTL field clobbering + // the two existing code paths. + // With notFoundCacheTtlSeconds unset (directive default 0) on the + // details subgraph's Item, + // both pre-existing behaviors must hold: + // (1) not-found entity fetches are NOT negatively cached — + // a second request for a missing id re-hits details. + // (2) found-entity positive caching (maxAge: 300) still works — + // a second request for a known id serves from cache. + // Signals: counters.details climbs on each not-found request, + // then stays flat on a repeated known-id request. + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + // Deliberately do NOT call setNotFoundCacheTTL — leave the field at + // its zero default to exercise the unset-fallback path. + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // Create an id that exists in items-subgraph but not in details. + createRes := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `mutation { createItem(name: "Missing", category: "void") { id } }`, + }) + var created struct { + Data struct { + CreateItem struct { + ID string `json:"id"` + } `json:"createItem"` + } `json:"data"` + } + require.NoError(t, json.Unmarshal([]byte(createRes.Body), &created)) + newID := created.Data.CreateItem.ID + require.NotEmpty(t, newID) + + missingReq := testenv.GraphQLRequest{ + Query: `{ item(id: "` + newID + `") { id description } }`, + } + // First not-found request: details is hit once. + xEnv.MakeGraphQLRequestOK(missingReq) + require.Equal(t, int64(1), counters.details.Load(), + "first not-found request must hit details") + + // Second not-found request: negative cache is OFF, so details + // must be hit again. With a negative-TTL leak here, this would + // stay at 1. + xEnv.MakeGraphQLRequestOK(missingReq) + require.Equal(t, int64(2), counters.details.Load(), + "without notFoundCacheTtlSeconds, not-found results must NOT be cached; details must re-hit") + + // Positive-TTL sanity check: a known id must still be entity-cached. + foundReq := testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id description } }`, + } + xEnv.MakeGraphQLRequestOK(foundReq) + detailsAfterFoundFirst := counters.details.Load() + require.Equal(t, int64(3), detailsAfterFoundFirst, + "first request for a known id must hit details once") + + xEnv.MakeGraphQLRequestOK(foundReq) + require.Equal(t, detailsAfterFoundFirst, counters.details.Load(), + "positive-TTL entity cache must hit on the second request for a known id") + }) + }) + + t.Run("L2/partial cache load with multiple warm entities", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + setEntityCachePartialLoad(routerConfig, true) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + // Warm cache for id:"1" and id:"2" + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id description } }`, + }) + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "2") { id description } }`, + }) + detailsAfterWarm := counters.details.Load() + require.Equal(t, int64(2), detailsAfterWarm) + require.Equal(t, 2, cache.Len()) + + // List query: id:"1" and id:"2" cached, rest fetched from subgraph + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ items { id description } }`, + }) + require.Contains(t, res.Body, `"description"`) + + // Details should be called once more for the remaining uncached items + require.Equal(t, detailsAfterWarm+1, counters.details.Load()) + }) + }) + + t.Run("L2/query cache include headers", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: append( + entityCachingL2OnlyOptions(cache), + core.WithHeaderRules(config.HeaderRules{ + All: &config.GlobalHeaderRule{ + Request: []*config.RequestHeaderRule{ + { + Operation: config.HeaderRuleOperationPropagate, + Named: "X-Tenant", + }, + }, + }, + }), + ), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + // @queryCache includeHeaders varies the root field cache key by request headers + setQueryCacheIncludeHeaders(routerConfig, true) + // Also set entity cache includeHeaders so entity resolution cache key varies too + setEntityCacheIncludeHeaders(routerConfig, true) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + // Request with header A — entity resolution calls details subgraph + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + Header: map[string][]string{"X-Tenant": {"A"}}, + }) + detailsAfterA := counters.details.Load() + require.Equal(t, int64(1), detailsAfterA) + + // Same query, header A — entity cache hit (details not called) + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + Header: map[string][]string{"X-Tenant": {"A"}}, + }) + require.Equal(t, detailsAfterA, counters.details.Load()) + + // Same query, header B — different cache key, details called again + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + Header: map[string][]string{"X-Tenant": {"B"}}, + }) + require.Equal(t, detailsAfterA+1, counters.details.Load()) + }) + }) + + t.Run("L2/cache populate maxAge override", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + // Override @cachePopulate(maxAge:60) down to 1 second. + setCachePopulateTTL(routerConfig, 1) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + lenBefore := cache.Len() + + // createItem has @cachePopulate. The mutation must write the new + // Item to L2 under the short (1s) override TTL. + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `mutation { createItem(name: "ShortLived", category: "test") { id name category } }`, + }) + require.Contains(t, res.Body, `"ShortLived"`) + + // Cache MUST have grown — proves @cachePopulate actually ran. + // With L2.Enabled=false, this assertion fails. + require.Greater(t, cache.Len(), lenBefore, + "@cachePopulate must write to L2 even under the maxAge override") + + var body struct { + Data struct { + CreateItem struct { + ID string `json:"id"` + } `json:"createItem"` + } `json:"data"` + } + require.NoError(t, json.Unmarshal([]byte(res.Body), &body)) + newID := body.Data.CreateItem.ID + require.NotEmpty(t, newID) + + // Immediately after the mutation the entity is in L2 with a 1s TTL: + // a follow-up read hits cache (items subgraph not called). + itemsAfterMutation := counters.items.Load() + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "` + newID + `") { id name } }`, + }) + require.Equal(t, itemsAfterMutation, counters.items.Load(), + "immediate follow-up read must hit the populated L2 entry") + + // Wait past the 1s override TTL. The entry must have expired, so + // a subsequent read now MUST re-hit the items subgraph. This is + // the truthful proof that the maxAge override fired: without the + // override (60s default), the counter would still not tick. + time.Sleep(1500 * time.Millisecond) + + itemsBeforeExpiredRead := counters.items.Load() + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "` + newID + `") { id name } }`, + }) + require.Equal(t, itemsBeforeExpiredRead+1, counters.items.Load(), + "after the 1s override TTL expires, the read must refetch from items; unchanged counter means the override was ignored") + }) + }) + + // --- Mapping rule coverage tests --- + + t.Run("L2/batch list argument cache keys", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // itemsByIds uses @is(fields: "id") with a list argument → batch cache lookup. + // Each element in the ids list maps to one entity cache key. + req := testenv.GraphQLRequest{ + Query: `{ itemsByIds(ids: ["1", "2"]) { id name description } }`, + } + res := xEnv.MakeGraphQLRequestOK(req) + require.Contains(t, res.Body, `"Widget"`) + require.Contains(t, res.Body, `"Gadget"`) + require.Contains(t, res.Body, `"description"`) + + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), detailsAfterFirst) + + // Two entities fetched → two cache entries + require.Equal(t, 2, cache.Len()) + + // Same query again → all entities served from cache + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, res.Body, res2.Body) + require.Equal(t, detailsAfterFirst, counters.details.Load()) + }) + }) + + t.Run("L2/batch list partial cache hit", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // Warm cache for id:"1" only + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + }) + detailsAfterWarm := counters.details.Load() + require.Equal(t, 1, cache.Len()) + + // Batch query for ids ["1", "3"] — id:"1" is cached, id:"3" is not + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ itemsByIds(ids: ["1", "3"]) { id name description } }`, + }) + require.Contains(t, res.Body, `"Widget"`) + require.Contains(t, res.Body, `"Gizmo"`) + + // Details subgraph should be called again for the uncached entity + require.Greater(t, counters.details.Load(), detailsAfterWarm) + }) + }) + + t.Run("L2/composite key auto mapping", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // product(id, region) auto-maps both args to @key(fields: "id region"). + // The cache key includes both id AND region. + req := testenv.GraphQLRequest{ + Query: `{ product(id: "p1", region: "US") { id region name info } }`, + } + res := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, `{"data":{"product":{"id":"p1","region":"US","name":"Alpha","info":"Alpha product details for US market"}}}`, res.Body) + + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), detailsAfterFirst) + + // Same composite key → cache hit + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, res.Body, res2.Body) + require.Equal(t, detailsAfterFirst, counters.details.Load()) + + // Same id, different region → cache miss (different composite key) + res3 := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ product(id: "p3", region: "EU") { id region name info } }`, + }) + require.Contains(t, res3.Body, `"Gamma"`) + require.Equal(t, detailsAfterFirst+1, counters.details.Load()) + }) + }) + + t.Run("L2/multiple keys with one satisfiable", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // Product has @key(fields: "id region") and @key(fields: "sku"). + // productBySku only provides sku → only the sku key is satisfiable. + req := testenv.GraphQLRequest{ + Query: `{ productBySku(sku: "SKU-001") { id region sku name info } }`, + } + res := xEnv.MakeGraphQLRequestOK(req) + require.Contains(t, res.Body, `"Alpha"`) + require.Contains(t, res.Body, `"SKU-001"`) + require.Contains(t, res.Body, `"info"`) + + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), detailsAfterFirst) + + // Same sku → cache hit + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, res.Body, res2.Body) + require.Equal(t, detailsAfterFirst, counters.details.Load()) + + // Different sku → cache miss + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ productBySku(sku: "SKU-003") { id region sku name info } }`, + }) + require.Equal(t, detailsAfterFirst+1, counters.details.Load()) + }) + }) + + t.Run("L2/no key match leaves root field uncached", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // productByName(name) — "name" doesn't match any @key field. + // No entity key mapping is emitted, so no per-entity cache keys + // are constructed from the argument. Entity caching via _entities + // still works (the details subgraph result is cached by entity key), + // but the root field itself does not produce a query cache mapping. + req := testenv.GraphQLRequest{ + Query: `{ productByName(name: "Alpha") { id region name info } }`, + } + res := xEnv.MakeGraphQLRequestOK(req) + require.Contains(t, res.Body, `"Alpha"`) + require.Contains(t, res.Body, `"info"`) + + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), detailsAfterFirst) + + // Entity caching from _entities still works — details cached + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, res.Body, res2.Body) + require.Equal(t, detailsAfterFirst, counters.details.Load()) + }) + }) + + t.Run("L2/composite key input object via @is", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // productByKey uses an input object argument with @is(fields: "id region"). + // The composition decomposes this into argumentPath ["key","id"] and ["key","region"], + // mapping input object fields to the composite @key(fields: "id region"). + req := testenv.GraphQLRequest{ + Query: `query($k: ProductKeyInput!) { productByKey(key: $k) { id region name info } }`, + Variables: []byte(`{"k": {"id": "p1", "region": "US"}}`), + } + res := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, `{"data":{"productByKey":{"id":"p1","region":"US","name":"Alpha","info":"Alpha product details for US market"}}}`, res.Body) + + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), detailsAfterFirst) + + // Same input object → cache hit + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, res.Body, res2.Body) + require.Equal(t, detailsAfterFirst, counters.details.Load()) + + // Different input object → cache miss + req2 := testenv.GraphQLRequest{ + Query: `query($k: ProductKeyInput!) { productByKey(key: $k) { id region name info } }`, + Variables: []byte(`{"k": {"id": "p3", "region": "EU"}}`), + } + res3 := xEnv.MakeGraphQLRequestOK(req2) + require.Contains(t, res3.Body, `"Gamma"`) + require.Equal(t, detailsAfterFirst+1, counters.details.Load()) + }) + }) + + t.Run("L2/nested key via @is directive", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // warehouse(locationId) uses @is(fields: "location.id") to map a scalar + // argument to the nested key path @key(fields: "location { id }"). + req := testenv.GraphQLRequest{ + Query: `{ warehouse(locationId: "w1") { location { id } name capacity } }`, + } + res := xEnv.MakeGraphQLRequestOK(req) + require.Contains(t, res.Body, `"Main Depot"`) + require.Contains(t, res.Body, `"capacity"`) + + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), detailsAfterFirst) + + // Same nested key → cache hit + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, res.Body, res2.Body) + require.Equal(t, detailsAfterFirst, counters.details.Load()) + + // Different location → cache miss + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ warehouse(locationId: "w2") { location { id } name capacity } }`, + }) + require.Equal(t, detailsAfterFirst+1, counters.details.Load()) + }) + }) + + t.Run("L2/single-subgraph composite key input object", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // productByKey uses an input object argument with @is(fields: "id region"). + // Querying only items-subgraph fields (id, region, name) verifies that + // RemapVariables correctly handles nested argument paths in a single-subgraph + // setup where no entity fetch is needed. + req := testenv.GraphQLRequest{ + Query: `query($k: ProductKeyInput!) { productByKey(key: $k) { id region name } }`, + Variables: []byte(`{"k": {"id": "p1", "region": "US"}}`), + } + res := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, `{"data":{"productByKey":{"id":"p1","region":"US","name":"Alpha"}}}`, res.Body) + + itemsAfterFirst := counters.items.Load() + require.Equal(t, int64(1), itemsAfterFirst) + + // Same input object → cache hit, items subgraph NOT called again + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, res.Body, res2.Body) + require.Equal(t, itemsAfterFirst, counters.items.Load()) + }) + }) + + // request_scoped_field_deduplication establishes the baseline behavior for + // entity resolution deduplication. Without @requestScoped, the details + // subgraph is called exactly once for a list query (all entities are + // batched into a single _entities call). The L2 cache then serves + // subsequent identical requests without calling the subgraph again. + // + // When @requestScoped support is added (subgraph schemas declare + // @requestScoped, composition produces requestScopedFields in config.json, + // and the planner generates RequestScopedExports/Hints), this test should + // be extended to verify that the details subgraph is called fewer times + // across multiple entity batches within a single request. + t.Run("L2/list entity batch caches across requests", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // Query a list of items. Each item triggers entity resolution to + // the details subgraph for description, batched into one _entities call. + req := testenv.GraphQLRequest{ + Query: `{ items { id name description } }`, + } + + res := xEnv.MakeGraphQLRequestOK(req) + require.Contains(t, res.Body, `"description"`) + require.Contains(t, res.Body, `"Widget"`) + + // Baseline: details subgraph called exactly once (one batch) + require.Equal(t, int64(1), counters.details.Load(), + "details should be called once for the entity batch") + + // Second identical request: L2 cache hit, no subgraph calls + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, res.Body, res2.Body) + require.Equal(t, int64(1), counters.details.Load(), + "details should not be called again (L2 cache hit)") + }) + }) + + // field_widening_across_requests verifies that when a cached entity has + // a subset of fields (e.g., description only), a subsequent request + // asking for additional fields from the same subgraph (e.g., description + // + rating) correctly fetches the wider field set from the subgraph. + t.Run("L2/field widening across requests", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // Request 1: fetch only description from details subgraph + res1 := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description } }`, + }) + require.Equal(t, `{"data":{"item":{"id":"1","name":"Widget","description":"A versatile widget for everyday use"}}}`, res1.Body) + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), detailsAfterFirst) + + // Request 2: fetch description + rating (wider field set from same subgraph). + // The cache key includes the field selection, so this is a cache miss + // for the entity resolution to details. The subgraph must be called again. + res2 := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description rating } }`, + }) + require.Contains(t, res2.Body, `"description"`) + require.Contains(t, res2.Body, `"rating"`) + require.Contains(t, res2.Body, `"Widget"`) + + // Details subgraph called again because wider field set is a different cache key + require.Equal(t, detailsAfterFirst+1, counters.details.Load(), + "details should be called again for the wider field set") + + // Request 3: repeat the wider query — should now be a cache hit + res3 := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description rating } }`, + }) + require.Equal(t, res2.Body, res3.Body) + require.Equal(t, detailsAfterFirst+1, counters.details.Load(), + "wider field set should be cached after second fetch") + }) + }) + + // batch_partial_hit_with_extension_fields verifies that batch queries + // correctly handle partial cache hits when entity extension fields + // (from the details subgraph) are involved. Entities with cached + // extension data are served from cache; uncached entities trigger a + // subgraph fetch only for the missing ones. + t.Run("L2/batch partial hit with extension fields", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // Warm cache: fetch extension fields for entity 1 and entity 2 + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ itemsByIds(ids: ["1", "2"]) { id name description } }`, + }) + detailsAfterWarm := counters.details.Load() + require.Equal(t, int64(1), detailsAfterWarm) + require.Equal(t, 2, cache.Len()) + + // Batch query for entities [1, 2, 3]: entities 1 and 2 have cached + // extension data from details, entity 3 does not. + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ itemsByIds(ids: ["1", "2", "3"]) { id name description } }`, + }) + require.Contains(t, res.Body, `"Widget"`) + require.Contains(t, res.Body, `"Gadget"`) + require.Contains(t, res.Body, `"Gizmo"`) + require.Contains(t, res.Body, `"description"`) + + // Details subgraph called again for the uncached entity (id:"3") + require.Greater(t, counters.details.Load(), detailsAfterWarm, + "details should be called for uncached entity 3") + + // All three entities now cached + require.Equal(t, 3, cache.Len()) + + // Repeat the batch query — all entities cached, no more subgraph calls + detailsBeforeRepeat := counters.details.Load() + res2 := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ itemsByIds(ids: ["1", "2", "3"]) { id name description } }`, + }) + require.Equal(t, res.Body, res2.Body) + require.Equal(t, detailsBeforeRepeat, counters.details.Load(), + "all entities should be served from cache") + }) + }) + + t.Run("L2/batch entity key per-element caching", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ itemsByIds(ids: ["1", "2"]) { id name description } }`, + } + + // Request 1: both subgraphs called (items for root field, details for entity) + res := xEnv.MakeGraphQLRequestOK(req) + require.Contains(t, res.Body, `"Widget"`) + require.Contains(t, res.Body, `"Gadget"`) + require.Contains(t, res.Body, `"description"`) + + itemsAfterFirst := counters.items.Load() + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), itemsAfterFirst) + require.Equal(t, int64(1), detailsAfterFirst) + + // Per-element cache entries: 2 entity keys (one per id) + require.Equal(t, 2, cache.Len()) + + // Request 2: identical query — batch entity keys hit, no subgraph calls + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, res.Body, res2.Body) + + // Items subgraph should NOT be called again (batch entity key cache hit) + require.Equal(t, itemsAfterFirst, counters.items.Load()) + // Details subgraph should NOT be called again (entity cache hit) + require.Equal(t, detailsAfterFirst, counters.details.Load()) + }) + }) + + // request_scoped_widening_refetch asserts the TARGET behavior for + // @requestScoped coordinate L1 caching: no matter how many sites within a + // single request read a @requestScoped field with the same key, the + // underlying subgraph should be fetched EXACTLY ONCE. + // + // This test is currently expected to FAIL. Under the present implementation + // the planner writes L1 with the narrow root selection ({id, name}) and a + // later sequentially-dependent read needs the wider selection + // ({id, name, email}) via @requires. The widening check in + // validateItemHasRequiredData sees that email is missing and triggers a + // refetch against the viewer subgraph, so counters.viewer is 2, not 1. + // + // The fix will either (a) teach the planner to pre-plan the wider union of + // selections up-front so the root fetch already carries {id, name, email}, + // or (b) teach the L1 layer to widen its stored entry when a later read + // asks for a superset of fields. Either way, once the fix lands this test + // should pass unchanged. + // + // Schema setup (see subgraphs/viewer + subgraphs/articles): + // + // viewer subgraph: + // Query.currentViewer @requestScoped(key: "currentViewer") + // Personalized.currentViewer @requestScoped(key: "currentViewer") + // Viewer { id, name, email } + // + // articles subgraph: + // Viewer { recommendedArticles } (extends viewer entity) + // Article implements Personalized { + // personalizedRecommendation: String! + // @requires(fields: "currentViewer { id name email }") + // } + // + // Query under test: + // + // { + // currentViewer { id name + // recommendedArticles { + // id title + // personalizedRecommendation + // } + // } + // } + t.Run("L1/request-scoped widening refetch", func(t *testing.T) { + t.Parallel() + t.Skip("pending functionality: widening refetch across @requires-driven fetches") + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL1OnlyOptions(), + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ + currentViewer { + id + name + recommendedArticles { + id + title + personalizedRecommendation + } + } + }`, + } + res := xEnv.MakeGraphQLRequestOK(req) + // personalizedRecommendation formats "for <>" — asserting the + // email shows up proves the wider {id,name,email} selection actually + // reached the articles subgraph via @requires, i.e. the widening + // refetch really happened. + require.Equal(t, + `{"data":{"currentViewer":{"id":"v1","name":"Alice","recommendedArticles":[`+ + `{"id":"a1","title":"The Rise of Federated GraphQL","personalizedRecommendation":"The Rise of Federated GraphQL, recommended for Alice "},`+ + `{"id":"a2","title":"Caching Strategies for Modern APIs","personalizedRecommendation":"Caching Strategies for Modern APIs, recommended for Alice "},`+ + `{"id":"a3","title":"A Practical Guide to @requestScoped","personalizedRecommendation":"A Practical Guide to @requestScoped, recommended for Alice "}`+ + `]}}}`, + res.Body) + + // Target behavior: viewer should be fetched EXACTLY ONCE no matter + // how many @requestScoped reads happen within the request. + // + // Currently fails (actual == 2) because the root fetch carries only + // {id, name} and the later @requires-driven Personalized._entities + // fetch needs {id, name, email} — the widening check misses and + // refetches the viewer subgraph. See the test's header comment. + require.Equal(t, int64(1), counters.viewer.Load(), + "viewer must be fetched exactly once per request regardless of "+ + "how many @requestScoped reads share the same key") + + require.Equal(t, int64(2), counters.articles.Load(), + "articles is called twice: once for Viewer._entities (recommendedArticles), "+ + "once for Article._entities (personalizedRecommendation after @requires)") + }) + }) + + // Exercise the same @requestScoped key at the root, nested Article.currentViewer, + // and relatedArticles.currentViewer sites. L1 should let the first fetch populate + // the coordinate cache so the viewer subgraph is fetched once. + t.Run("L1/request-scoped nested dedup", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL1OnlyOptions(), + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ + currentViewer { + id + name + email + recommendedArticles { + id + title + currentViewer { + id + name + email + } + relatedArticles { + id + title + currentViewer { + id + name + email + } + } + } + } + }`, + } + res := xEnv.MakeGraphQLRequestOK(req) + // Sanity: the query resolved successfully and the viewer data is + // identical at every site (proves the @requestScoped dedup is at + // least returning consistent data, even if it made too many fetches). + require.Contains(t, res.Body, `"currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}`) + require.Contains(t, res.Body, `"recommendedArticles"`) + require.Contains(t, res.Body, `"relatedArticles"`) + + // Target behavior: the viewer subgraph is hit EXACTLY ONCE regardless + // of how many Article.currentViewer sites exist in the query. The root + // Query.currentViewer fetch populates the L1 coordinate cache under + // key "currentViewer", and every subsequent read at any nesting depth + // must inject from L1 without launching a new subgraph fetch. + require.Equal(t, int64(1), counters.viewer.Load(), + "viewer must be fetched exactly once per request regardless of "+ + "how many nesting levels select Article.currentViewer inline "+ + "(currently fails: the planner launches BatchEntity viewer fetches "+ + "for deeper Article.currentViewer sites in parallel with the L1 "+ + "injection check, paying the subgraph round-trip unnecessarily)") + }) + }) + + // Inverse of L1/request-scoped nested dedup: when the coordinate L1 cache + // is disabled, every Article.currentViewer site must issue its own BatchEntity + // fetch to the viewer subgraph. Without this counter-assertion, the dedup + // test above could silently turn into a no-op if the planner ever started + // merging the three selection sites on its own. + t.Run("L1-disabled/request-scoped nested no-dedup baseline", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingDisabledOptions(), + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ + currentViewer { + id + name + email + recommendedArticles { + id + title + currentViewer { + id + name + email + } + relatedArticles { + id + title + currentViewer { + id + name + email + } + } + } + } + }`, + } + res := xEnv.MakeGraphQLRequestOK(req) + require.Contains(t, res.Body, `"currentViewer":{"id":"v1","name":"Alice","email":"alice@example.com"}`) + + // Without L1 coordinate caching, the viewer subgraph is hit three times: + // 1. Root Query.currentViewer + // 2. Viewer._entities for recommendedArticles[].currentViewer (batched) + // 3. Viewer._entities for relatedArticles[].currentViewer (batched) + require.Equal(t, int64(3), counters.viewer.Load(), + "with L1 disabled, each Article.currentViewer site must hit the "+ + "viewer subgraph; if this ever drops below 3 the companion dedup "+ + "test is no longer proving anything") + }) + }) + + t.Run("Regression/complex viewer/articles query shape has no errors", func(t *testing.T) { + t.Parallel() + + servers, _ := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `query ViewerArticles { + articles { + id + title + body + relatedArticles { + ...ArticleFields + relatedArticles { + ...ArticleFields + relatedArticles { + ...ArticleFields + } + } + } + } + currentViewer { + id + name + email + recommendedArticles { + ...ArticleFields + relatedArticles { + ...ArticleFields + relatedArticles { + ...ArticleFields + } + } + } + } + } + + fragment ArticleFields on Article { + id + title + tags + viewCount + rating + reviewSummary + personalizedRecommendation + currentViewer { + id + name + email + } + }`, + } + + for i := range 3 { + res := xEnv.MakeGraphQLRequestOK(req) + require.NotContains(t, res.Body, `"errors"`, "iteration %d: expected query to execute without GraphQL errors", i) + require.Contains(t, res.Body, `"articles"`, "iteration %d: expected articles payload", i) + require.Contains(t, res.Body, `"currentViewer"`, "iteration %d: expected currentViewer payload", i) + } + }) + }) + + t.Run("Regression/complex viewer/articles cached matches uncached", func(t *testing.T) { + t.Parallel() + + servers, _ := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `query ViewerArticles { + articles { + id + title + body + relatedArticles { + ...ArticleFields + relatedArticles { + ...ArticleFields + relatedArticles { + ...ArticleFields + } + } + } + } + currentViewer { + id + name + email + recommendedArticles { + ...ArticleFields + relatedArticles { + ...ArticleFields + relatedArticles { + ...ArticleFields + } + } + } + } + } + + fragment ArticleFields on Article { + id + title + tags + viewCount + rating + reviewSummary + personalizedRecommendation + currentViewer { + id + name + email + } + }`, + } + + // Warm cache. + xEnv.MakeGraphQLRequestOK(req) + + cachedRes := xEnv.MakeGraphQLRequestOK(req) + require.NotContains(t, cachedRes.Body, `"errors"`) + + uncachedReq := req + uncachedReq.Header = http.Header{ + "X-WG-Disable-Entity-Cache": []string{"true"}, + } + uncachedRes := xEnv.MakeGraphQLRequestOK(uncachedReq) + require.NotContains(t, uncachedRes.Body, `"errors"`) + + require.Equal(t, uncachedRes.Body, cachedRes.Body) + }) + }) + + // Regression test for the arena pointer bug: exportRequestScopedFields must + // copy values before storing in requestScopedL1. Without the copy, stored + // pointers become dangling when the goroutine arena is reused on subsequent + // requests, causing crashes or corrupted data. + t.Run("Regression/repeated complex query does not panic", func(t *testing.T) { + t.Parallel() + + servers, _ := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // A query that exercises entity fetching across multiple subgraphs + // (items + details + inventory). Repeated execution triggers arena + // reuse which would crash if exported values were not copied. + req := testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id name description rating tags available count } }`, + } + for i := range 5 { + res := xEnv.MakeGraphQLRequestOK(req) + require.Contains(t, res.Body, `"Widget"`, "iteration %d: expected Widget in response", i) + require.Contains(t, res.Body, `"description"`, "iteration %d: expected description in response", i) + require.Contains(t, res.Body, `"available"`, "iteration %d: expected available in response", i) + } + }) + }) + + // Companion to mutation_populate_writes_to_cache. Both tests pin the same + // @cachePopulate read-after-write contract on a Mutation: the returned + // entity must land in L2 so the next `item(id: ...)` read is a cache hit. + // This variant keeps the RED_-style explicit response-body assertion as + // a second signal — the body assertion alone is not a truthful caching + // signal (the items store persists the new item regardless), but the + // counters.items no-growth assertion is. + // + // Historically the mutation_populate_* tests only verified the mutation + // responded; the read-path effect was added after review round 1. + t.Run("L2/cache populate writes entity for subsequent read", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // createItem has @cachePopulate(maxAge: 60). The mutation must populate L2 + // with the returned Item entity under its @key("id") cache key. + createRes := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `mutation { createItem(name: "PopulatedItem", category: "populate") { id name category } }`, + }) + require.Contains(t, createRes.Body, `"PopulatedItem"`) + + // Extract the new id from the response — `nextID` is shared across the + // parallel test suite, so we can't predict it. + var idMatch struct { + Data struct { + CreateItem struct { + ID string `json:"id"` + Name string `json:"name"` + Category string `json:"category"` + } `json:"createItem"` + } `json:"data"` + } + require.NoError(t, json.Unmarshal([]byte(createRes.Body), &idMatch)) + newID := idMatch.Data.CreateItem.ID + require.NotEmpty(t, newID, "createItem must return a non-empty id") + + itemsAfterCreate := counters.items.Load() + + // Read the just-created entity by its key. If @cachePopulate wrote to L2, + // the items subgraph must NOT be called again. The items store now persists + // createItem results (see items subgraph data.go), so the response body is + // correct either way — the truthful signal is the items-counter: cache hit + // leaves it unchanged, cache miss grows it by one. + readRes := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "` + newID + `") { id name category } }`, + }) + require.Equal(t, + `{"data":{"item":{"id":"`+newID+`","name":"PopulatedItem","category":"populate"}}}`, + readRes.Body) + require.Equal(t, itemsAfterCreate, counters.items.Load(), + "@cachePopulate must write the entity to L2 so the read-by-id is served from cache") + }) + }) + + // Regression test: @cacheInvalidate clears an entity cached under a composite @key. + // + // `delete_mutation_invalidates_cache` already covers the simple id-only case + // (Item @key("id")). This test pins the composite-key path via Product + // @key("id region") + deleteProduct(id, region) @cacheInvalidate. + // + // The cache-demo failure of an apparently equivalent scenario turned out to be + // a test-script artifact (mutable subgraph state caused warm-up to return null, + // which prevented the cache write). The router-side composite-key invalidate + // path itself works correctly — this test pins that contract. + t.Run("L2/cache invalidates composite key", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + warmReq := testenv.GraphQLRequest{ + Query: `{ product(id: "p1", region: "US") { id region sku name } }`, + } + // 1. Warm the cache for product (id=p1, region=US) + xEnv.MakeGraphQLRequestOK(warmReq) + itemsAfterWarm := counters.items.Load() + + // 2. Re-read — must be a cache hit + xEnv.MakeGraphQLRequestOK(warmReq) + require.Equal(t, itemsAfterWarm, counters.items.Load(), + "composite-key entity must be cached after warm-up") + + // 3. Invalidate via deleteProduct. The mutation itself hits the items subgraph + // to execute the resolver — so we capture the counter AFTER the mutation and + // only assert on the delta from the subsequent read. + delRes := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `mutation { deleteProduct(id: "p1", region: "US") { id region } }`, + }) + require.Contains(t, delRes.Body, `"deleteProduct"`) + itemsAfterMutation := counters.items.Load() + + // 4. Read again — composite-key cache MUST be cleared, items subgraph + // MUST be hit one more time. Currently fails: counter unchanged → @cacheInvalidate + // did not evict the composite-key entity, so the read is still a cache hit. + xEnv.MakeGraphQLRequestOK(warmReq) + require.Equal(t, itemsAfterMutation+1, counters.items.Load(), + "@cacheInvalidate on Mutation returning composite-key entity must clear the L2 entry; the post-invalidate read must re-fetch from subgraph") + }) + }) + + // RED test: nested @key reached via input object @is(fields: "location { id }") + // + // `warehouse(locationId: ID! @is(fields: "location.id"))` (scalar arg with dot notation) + // already passes — see "nested_key_via_is_directive" above. + // + // `warehouseByInput(input: WarehouseLocationInput! @is(fields: "location { id }"))` is + // the same nested @key reached via a multi-hop argument path. Composition produces + // the same `entityKeyField: "location.id"` plus `argumentPath: ["input","location","id"]`. + // The router's loader must walk the input-object path to construct the cache key. + // + // Discovered in cache-demo manual testing: cache lookup fires with the right key but + // every call shows l2_miss and the entity is never written. Pinning the failure here + // so the loader fix can land with a regression test. + t.Run("L2/nested key via input object @is directive", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingL2OnlyOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // IMPORTANT: this query does NOT select the @key field (`location { id }`). + // Reproduces the cache-demo Venue failure where queries that omit the + // key field from the selection set prevent the cache write — the router's + // entity write path derives the cache key from the response payload + // instead of from the argument values that were already used to build + // the lookup key. + // + // Compare to "nested_key_via_is_directive" above, which selects + // `location { id }` and passes — that test masks this bug because the + // key value happens to be in the response payload. + req := testenv.GraphQLRequest{ + Query: `{ warehouseByInput(input: { location: { id: "w1" } }) { name } }`, + } + res := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, `{"data":{"warehouseByInput":{"name":"Main Depot"}}}`, res.Body) + + itemsAfterFirst := counters.items.Load() + require.Equal(t, int64(1), itemsAfterFirst, "first call must hit the items subgraph") + + // Same nested key via input object → MUST be a cache hit. Currently fails: + // the items subgraph is called a second time despite the L2 lookup running + // with the structurally correct key, because the cache write path can't + // reconstruct the entity key from a response that doesn't contain the + // key field. + res2 := xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, res.Body, res2.Body) + require.Equal(t, itemsAfterFirst, counters.items.Load(), + "input-object → nested-key cache write must persist when @key field is not selected; second call must NOT re-hit subgraph") + }) + }) + + // REGRESSION: a SingleFetch served entirely from L2 cache must report + // `load_skipped: true` in the request trace. Previously the resolveSingle + // path didn't set LoadSkipped on cache-hit branches even though the bulk + // parallel path already did, so observability reported `false` on fetches + // that demonstrably never called the subgraph. + t.Run("Trace/root field cache hit reports load_skipped", func(t *testing.T) { + t.Parallel() + + servers, _ := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: entityCachingOptions(cache), + }, func(t *testing.T, xEnv *testenv.Environment) { + // Warm the cache. + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id description } }`, + }) + + // Second call with tracing enabled — assert load_skipped == true on the fetch. + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id description } }`, + Header: map[string][]string{"X-WG-Trace": {"true"}}, + }) + var body struct { + Extensions struct { + Trace struct { + Fetches map[string]any `json:"fetches"` + } `json:"trace"` + } `json:"extensions"` + } + require.NoError(t, json.Unmarshal([]byte(res.Body), &body)) + + // Walk the fetch tree and find any Single fetch with load_skipped=true. + var anyLoadSkipped bool + var visit func(node any) + visit = func(node any) { + m, ok := node.(map[string]any) + if !ok { + return + } + if m["kind"] == "Single" { + if fetch, ok := m["fetch"].(map[string]any); ok { + if trace, ok := fetch["trace"].(map[string]any); ok { + if ls, _ := trace["load_skipped"].(bool); ls { + anyLoadSkipped = true + } + } + } + } + if children, ok := m["children"].([]any); ok { + for _, c := range children { + visit(c) + } + } + } + visit(map[string]any(body.Extensions.Trace.Fetches)) + require.True(t, anyLoadSkipped, + "trace must report load_skipped=true on the cache-hit fetch") + }) + }) + + // REGRESSION: includeHeaders=true with NO header forwarded must still produce a + // stable cache key — write and read paths must agree on the prefix. Previously + // the WRITE path dropped the prefix when headerHash==0 while the READ path + // always built "0:..." → every read missed. + t.Run("L2/include headers still caches when no header is forwarded", func(t *testing.T) { + t.Parallel() + + servers, counters := startSubgraphServers(t) + configJSON := buildConfigJSON(servers) + cache := newMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterConfigJSONTemplate: configJSON, + RouterOptions: append( + entityCachingL2OnlyOptions(cache), + core.WithHeaderRules(config.HeaderRules{ + All: &config.GlobalHeaderRule{ + Request: []*config.RequestHeaderRule{ + { + Operation: config.HeaderRuleOperationPropagate, + Named: "X-Tenant", + }, + }, + }, + }), + ), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + setEntityCacheIncludeHeaders(routerConfig, true) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + req := testenv.GraphQLRequest{ + Query: `{ item(id: "1") { id description } }`, + // No X-Tenant header sent — SubgraphHeadersBuilder returns hash=0. + } + + // First call: cache miss → subgraph fetch. + xEnv.MakeGraphQLRequestOK(req) + detailsAfterFirst := counters.details.Load() + require.Equal(t, int64(1), detailsAfterFirst) + + // Second call (same query, still no header): MUST be a cache hit. Counter + // stays at 1. Previously failed because write key {json} ≠ read key 0:{json}. + xEnv.MakeGraphQLRequestOK(req) + require.Equal(t, detailsAfterFirst, counters.details.Load(), + "includeHeaders=true with no header forwarded must produce a stable cache key; second call must hit cache") + }) + }) +} diff --git a/router-tests/entity_caching/graph.yaml b/router-tests/entity_caching/graph.yaml new file mode 100644 index 0000000000..017b032f33 --- /dev/null +++ b/router-tests/entity_caching/graph.yaml @@ -0,0 +1,26 @@ +version: 1 +subgraphs: + - name: items + routing_url: http://items.entity-cache-test.local/graphql + schema: + file: ./subgraphs/items/subgraph/schema.graphqls + - name: details + routing_url: http://details.entity-cache-test.local/graphql + schema: + file: ./subgraphs/details/subgraph/schema.graphqls + - name: inventory + routing_url: http://inventory.entity-cache-test.local/graphql + schema: + file: ./subgraphs/inventory/subgraph/schema.graphqls + - name: viewer + routing_url: http://viewer.entity-cache-test.local/graphql + schema: + file: ./subgraphs/viewer/subgraph/schema.graphqls + - name: articles + routing_url: http://articles.entity-cache-test.local/graphql + schema: + file: ./subgraphs/articles/subgraph/schema.graphqls + - name: articlesmeta + routing_url: http://articlesmeta.entity-cache-test.local/graphql + schema: + file: ./subgraphs/articlesmeta/subgraph/schema.graphqls diff --git a/router-tests/entity_caching/harness_test.go b/router-tests/entity_caching/harness_test.go new file mode 100644 index 0000000000..798b2cda6f --- /dev/null +++ b/router-tests/entity_caching/harness_test.go @@ -0,0 +1,523 @@ +package entity_caching + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/http/httptest" + "strings" + "sync/atomic" + "testing" + "time" + + "github.com/99designs/gqlgen/graphql/handler" + "github.com/99designs/gqlgen/graphql/handler/transport" + "github.com/alicebob/miniredis/v2" + "github.com/redis/go-redis/v9" + "github.com/stretchr/testify/require" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/articles" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/articlesmeta" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/details" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/inventory" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/items" + itemsModel "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/items/subgraph/model" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/viewer" + "github.com/wundergraph/cosmo/router/core" + nodev1 "github.com/wundergraph/cosmo/router/gen/proto/wg/cosmo/node/v1" + "github.com/wundergraph/cosmo/router/pkg/config" + "github.com/wundergraph/cosmo/router/pkg/entitycache" + "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve" +) + +type requestCounters struct { + items atomic.Int64 + details atomic.Int64 + inventory atomic.Int64 + viewer atomic.Int64 + articles atomic.Int64 + articlesMeta atomic.Int64 +} + +func countingMiddleware(counter *atomic.Int64, next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + counter.Add(1) + next.ServeHTTP(w, r) + }) +} + +type subgraphServers struct { + items *httptest.Server + details *httptest.Server + inventory *httptest.Server + viewer *httptest.Server + articles *httptest.Server + articlesMeta *httptest.Server + // Subscription channels for the items subgraph. + itemUpdatedCh chan *itemsModel.Item + itemCreatedCh chan *itemsModel.Item +} + +func startSubgraphServers(t *testing.T) (*subgraphServers, *requestCounters) { + t.Helper() + + counters := &requestCounters{} + itemUpdatedCh := make(chan *itemsModel.Item, 1) + itemCreatedCh := make(chan *itemsModel.Item, 1) + + itemsSchema := items.NewSchema(itemUpdatedCh, itemCreatedCh) + itemsHandler := handler.New(itemsSchema) + itemsHandler.AddTransport(transport.POST{}) + itemsHandler.AddTransport(transport.Websocket{ + KeepAlivePingInterval: 10 * time.Second, + }) + + detailsSchema := details.NewSchema() + detailsHandler := handler.New(detailsSchema) + detailsHandler.AddTransport(transport.POST{}) + + inventorySchema := inventory.NewSchema() + inventoryHandler := handler.New(inventorySchema) + inventoryHandler.AddTransport(transport.POST{}) + + viewerSchema := viewer.NewSchema() + viewerHandler := handler.New(viewerSchema) + viewerHandler.AddTransport(transport.POST{}) + + articlesSchema := articles.NewSchema() + articlesHandler := handler.New(articlesSchema) + articlesHandler.AddTransport(transport.POST{}) + + articlesMetaSchema := articlesmeta.NewSchema() + articlesMetaHandler := handler.New(articlesMetaSchema) + articlesMetaHandler.AddTransport(transport.POST{}) + + itemsSrv := httptest.NewServer(countingMiddleware(&counters.items, itemsHandler)) + t.Cleanup(itemsSrv.Close) + + detailsSrv := httptest.NewServer(countingMiddleware(&counters.details, detailsHandler)) + t.Cleanup(detailsSrv.Close) + + inventorySrv := httptest.NewServer(countingMiddleware(&counters.inventory, inventoryHandler)) + t.Cleanup(inventorySrv.Close) + + viewerSrv := httptest.NewServer(countingMiddleware(&counters.viewer, viewerHandler)) + t.Cleanup(viewerSrv.Close) + + articlesSrv := httptest.NewServer(countingMiddleware(&counters.articles, articlesHandler)) + t.Cleanup(articlesSrv.Close) + + articlesMetaSrv := httptest.NewServer(countingMiddleware(&counters.articlesMeta, articlesMetaHandler)) + t.Cleanup(articlesMetaSrv.Close) + + return &subgraphServers{ + items: itemsSrv, + details: detailsSrv, + inventory: inventorySrv, + viewer: viewerSrv, + articles: articlesSrv, + articlesMeta: articlesMetaSrv, + itemUpdatedCh: itemUpdatedCh, + itemCreatedCh: itemCreatedCh, + }, counters +} + +func startSubgraphServersWithMiddleware(t *testing.T, mw func(http.Handler) http.Handler) (*subgraphServers, *requestCounters) { + t.Helper() + + counters := &requestCounters{} + itemUpdatedCh := make(chan *itemsModel.Item, 1) + itemCreatedCh := make(chan *itemsModel.Item, 1) + + itemsSchema := items.NewSchema(itemUpdatedCh, itemCreatedCh) + itemsHandler := handler.New(itemsSchema) + itemsHandler.AddTransport(transport.POST{}) + itemsHandler.AddTransport(transport.Websocket{ + KeepAlivePingInterval: 10 * time.Second, + }) + + detailsSchema := details.NewSchema() + detailsHandler := handler.New(detailsSchema) + detailsHandler.AddTransport(transport.POST{}) + + inventorySchema := inventory.NewSchema() + inventoryHandler := handler.New(inventorySchema) + inventoryHandler.AddTransport(transport.POST{}) + + viewerSchema := viewer.NewSchema() + viewerHandler := handler.New(viewerSchema) + viewerHandler.AddTransport(transport.POST{}) + + articlesSchema := articles.NewSchema() + articlesHandler := handler.New(articlesSchema) + articlesHandler.AddTransport(transport.POST{}) + + articlesMetaSchema := articlesmeta.NewSchema() + articlesMetaHandler := handler.New(articlesMetaSchema) + articlesMetaHandler.AddTransport(transport.POST{}) + + var detailsWrapped http.Handler = detailsHandler + if mw != nil { + detailsWrapped = mw(detailsHandler) + } + + itemsSrv := httptest.NewServer(countingMiddleware(&counters.items, itemsHandler)) + t.Cleanup(itemsSrv.Close) + + detailsSrv := httptest.NewServer(countingMiddleware(&counters.details, detailsWrapped)) + t.Cleanup(detailsSrv.Close) + + inventorySrv := httptest.NewServer(countingMiddleware(&counters.inventory, inventoryHandler)) + t.Cleanup(inventorySrv.Close) + + viewerSrv := httptest.NewServer(countingMiddleware(&counters.viewer, viewerHandler)) + t.Cleanup(viewerSrv.Close) + + articlesSrv := httptest.NewServer(countingMiddleware(&counters.articles, articlesHandler)) + t.Cleanup(articlesSrv.Close) + + articlesMetaSrv := httptest.NewServer(countingMiddleware(&counters.articlesMeta, articlesMetaHandler)) + t.Cleanup(articlesMetaSrv.Close) + + return &subgraphServers{ + items: itemsSrv, + details: detailsSrv, + inventory: inventorySrv, + viewer: viewerSrv, + articles: articlesSrv, + articlesMeta: articlesMetaSrv, + itemUpdatedCh: itemUpdatedCh, + itemCreatedCh: itemCreatedCh, + }, counters +} + +func TestStartSubgraphServersWithMiddlewareBuildsCompleteConfig(t *testing.T) { + t.Parallel() + + servers, _ := startSubgraphServersWithMiddleware(t, nil) + require.NotNil(t, servers.articlesMeta) + require.NotPanics(t, func() { + _ = buildConfigJSON(servers) + }) +} + +func buildConfigJSON(servers *subgraphServers) string { + replaced := configJSONTemplate + replaced = strings.ReplaceAll(replaced, itemsPlaceholderURL, servers.items.URL) + replaced = strings.ReplaceAll(replaced, detailsPlaceholderURL, servers.details.URL) + replaced = strings.ReplaceAll(replaced, inventoryPlaceholderURL, servers.inventory.URL) + replaced = strings.ReplaceAll(replaced, viewerPlaceholderURL, servers.viewer.URL) + replaced = strings.ReplaceAll(replaced, articlesPlaceholderURL, servers.articles.URL) + replaced = strings.ReplaceAll(replaced, articlesMetaPlaceholderURL, servers.articlesMeta.URL) + return replaced +} + +func entityCachingOptions(cache resolve.LoaderCache) []core.Option { + return []core.Option{ + core.WithEntityCaching(config.EntityCachingConfiguration{ + Enabled: true, + L1: config.EntityCachingL1Configuration{ + Enabled: true, + }, + L2: config.EntityCachingL2Configuration{ + Enabled: true, + }, + }), + core.WithEntityCacheInstances(map[string]resolve.LoaderCache{ + "default": cache, + }), + } +} + +// entityCachingL1OnlyOptions enables only the per-request L1 cache. +// Use in subtests named L1/... so the assertion depends on L1 behavior alone, +// not on L2 coincidentally helping. +func entityCachingL1OnlyOptions() []core.Option { + return []core.Option{ + core.WithEntityCaching(config.EntityCachingConfiguration{ + Enabled: true, + L1: config.EntityCachingL1Configuration{ + Enabled: true, + }, + L2: config.EntityCachingL2Configuration{ + Enabled: false, + }, + }), + } +} + +// entityCachingL2OnlyOptions enables only the cross-request L2 cache. +// Use in subtests named L2/... so the assertion depends on L2 behavior alone. +func entityCachingL2OnlyOptions(cache resolve.LoaderCache) []core.Option { + return []core.Option{ + core.WithEntityCaching(config.EntityCachingConfiguration{ + Enabled: true, + L1: config.EntityCachingL1Configuration{ + Enabled: false, + }, + L2: config.EntityCachingL2Configuration{ + Enabled: true, + }, + }), + core.WithEntityCacheInstances(map[string]resolve.LoaderCache{ + "default": cache, + }), + } +} + +// entityCachingDisabledOptions turns both layers off. +// Use as the baseline for inverse "L1 disabled → N calls" assertions. +func entityCachingDisabledOptions() []core.Option { + return []core.Option{ + core.WithEntityCaching(config.EntityCachingConfiguration{ + Enabled: true, + L1: config.EntityCachingL1Configuration{ + Enabled: false, + }, + L2: config.EntityCachingL2Configuration{ + Enabled: false, + }, + }), + } +} + +// clearEntityCacheConfigs removes all entity cache configs from the router config. +func clearEntityCacheConfigs(rc *nodev1.RouterConfig) { + for _, ds := range rc.EngineConfig.DatasourceConfigurations { + ds.EntityCacheConfigurations = nil + ds.RootFieldCacheConfigurations = nil + ds.CacheInvalidateConfigurations = nil + ds.CachePopulateConfigurations = nil + } +} + +// setEntityCacheTTL overrides MaxAgeSeconds on all entity cache configs. +func setEntityCacheTTL(rc *nodev1.RouterConfig, ttl int64) { + for _, ds := range rc.EngineConfig.DatasourceConfigurations { + for _, ec := range ds.EntityCacheConfigurations { + ec.MaxAgeSeconds = ttl + } + } +} + +// setEntityCacheShadowMode sets ShadowMode on all entity cache configs. +func setEntityCacheShadowMode(rc *nodev1.RouterConfig, enabled bool) { + for _, ds := range rc.EngineConfig.DatasourceConfigurations { + for _, ec := range ds.EntityCacheConfigurations { + ec.ShadowMode = enabled + } + } +} + +// setEntityCachePartialLoad sets PartialCacheLoad on all entity cache configs. +func setEntityCachePartialLoad(rc *nodev1.RouterConfig, enabled bool) { + for _, ds := range rc.EngineConfig.DatasourceConfigurations { + for _, ec := range ds.EntityCacheConfigurations { + ec.PartialCacheLoad = enabled + } + } +} + +// setEntityCacheIncludeHeaders sets IncludeHeaders on all entity cache configs. +func setEntityCacheIncludeHeaders(rc *nodev1.RouterConfig, enabled bool) { + for _, ds := range rc.EngineConfig.DatasourceConfigurations { + for _, ec := range ds.EntityCacheConfigurations { + ec.IncludeHeaders = enabled + } + } +} + +// setNotFoundCacheTTL sets NotFoundCacheTtlSeconds on all entity cache configs. +func setNotFoundCacheTTL(rc *nodev1.RouterConfig, ttl int64) { + for _, ds := range rc.EngineConfig.DatasourceConfigurations { + for _, ec := range ds.EntityCacheConfigurations { + ec.NotFoundCacheTtlSeconds = ttl + } + } +} + +// setQueryCacheShadowMode sets ShadowMode on all root field cache configs. +func setQueryCacheShadowMode(rc *nodev1.RouterConfig, enabled bool) { + for _, ds := range rc.EngineConfig.DatasourceConfigurations { + for _, rfc := range ds.RootFieldCacheConfigurations { + rfc.ShadowMode = enabled + } + } +} + +// setQueryCacheIncludeHeaders sets IncludeHeaders on all root field cache configs. +func setQueryCacheIncludeHeaders(rc *nodev1.RouterConfig, enabled bool) { + for _, ds := range rc.EngineConfig.DatasourceConfigurations { + for _, rfc := range ds.RootFieldCacheConfigurations { + rfc.IncludeHeaders = enabled + } + } +} + +// setCachePopulateTTL overrides MaxAgeSeconds on all cache populate configs. +func setCachePopulateTTL(rc *nodev1.RouterConfig, ttl int64) { + for _, ds := range rc.EngineConfig.DatasourceConfigurations { + for _, cp := range ds.CachePopulateConfigurations { + cp.MaxAgeSeconds = &ttl + } + } +} + +// FailingEntityCache implements resolve.LoaderCache and always returns errors. +type FailingEntityCache struct{} + +var _ resolve.LoaderCache = (*FailingEntityCache)(nil) + +func (f *FailingEntityCache) Get(_ context.Context, keys []string) ([]*resolve.CacheEntry, error) { + return nil, errCacheFailed +} + +func (f *FailingEntityCache) Set(_ context.Context, _ []*resolve.CacheEntry, _ time.Duration) error { + return errCacheFailed +} + +func (f *FailingEntityCache) Delete(_ context.Context, _ []string) error { + return errCacheFailed +} + +var errCacheFailed = &cacheFailed{} + +type cacheFailed struct{} + +func (c *cacheFailed) Error() string { + return "entity cache operation failed" +} + +// ControllableCache wraps a MemoryEntityCache but can be toggled to fail on demand. +// Use SetFailing(true) to simulate a Redis outage mid-test. +type ControllableCache struct { + inner *entitycache.MemoryEntityCache + failing atomic.Bool +} + +func newControllableCache(t *testing.T) *ControllableCache { + t.Helper() + cache, err := entitycache.NewMemoryEntityCache(10 * 1024 * 1024) + require.NoError(t, err) + t.Cleanup(func() { _ = cache.Close() }) + return &ControllableCache{inner: cache} +} + +func (c *ControllableCache) SetFailing(v bool) { c.failing.Store(v) } + +func (c *ControllableCache) Get(ctx context.Context, keys []string) ([]*resolve.CacheEntry, error) { + if c.failing.Load() { + return nil, errCacheFailed + } + return c.inner.Get(ctx, keys) +} + +func (c *ControllableCache) Set(ctx context.Context, entries []*resolve.CacheEntry, ttl time.Duration) error { + if c.failing.Load() { + return errCacheFailed + } + return c.inner.Set(ctx, entries, ttl) +} + +func (c *ControllableCache) Delete(ctx context.Context, keys []string) error { + if c.failing.Load() { + return errCacheFailed + } + return c.inner.Delete(ctx, keys) +} + +// entityCachingOptionsWithCircuitBreakerRef returns L2-only router options with +// a CircuitBreakerCache so tests can inspect its state. +func entityCachingOptionsWithCircuitBreakerRef(cache resolve.LoaderCache, threshold int, cooldown time.Duration) ([]core.Option, *entitycache.CircuitBreakerCache) { + cb := entitycache.NewCircuitBreakerCache(cache, entitycache.CircuitBreakerConfig{ + Enabled: true, + FailureThreshold: threshold, + CooldownPeriod: cooldown, + }) + return entityCachingL2OnlyOptions(cb), cb +} + +// entityCachingOptionsWithSubgraphConfig returns L2-only router options with +// per-subgraph cache routing. +func entityCachingOptionsWithSubgraphConfig(caches map[string]resolve.LoaderCache, subgraphs []config.EntityCachingSubgraphCacheOverride) []core.Option { + return []core.Option{ + core.WithEntityCaching(config.EntityCachingConfiguration{ + Enabled: true, + L1: config.EntityCachingL1Configuration{ + Enabled: false, + }, + L2: config.EntityCachingL2Configuration{ + Enabled: true, + }, + SubgraphCacheOverrides: subgraphs, + }), + core.WithEntityCacheInstances(caches), + } +} + +// newMemoryCache is a convenience wrapper. +func newMemoryCache(t *testing.T) *entitycache.MemoryEntityCache { + t.Helper() + c, err := entitycache.NewMemoryEntityCache(10 * 1024 * 1024) // 10MB for tests + require.NoError(t, err) + t.Cleanup(func() { _ = c.Close() }) + return c +} + +// newTestRedisCache creates a miniredis-backed cache for testing. +func newTestRedisCache(t *testing.T) (*entitycache.RedisEntityCache, *miniredis.Miniredis) { + t.Helper() + mr := miniredis.RunT(t) + client := redis.NewClient(&redis.Options{Addr: mr.Addr()}) + t.Cleanup(func() { client.Close() }) + return entitycache.NewRedisEntityCache(client, "test"), mr +} + +// extensionInvalidationMiddleware returns an HTTP middleware that injects +// a cacheInvalidation extension into the subgraph response when the flag is set. +// Format: {"extensions":{"cacheInvalidation":{"keys":[{"typename":"Item","key":{"id":"1"}}]}}} +func extensionInvalidationMiddleware(flag *atomic.Bool) func(http.Handler) http.Handler { + return func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if !flag.Load() { + next.ServeHTTP(w, r) + return + } + // Capture the response. + rec := httptest.NewRecorder() + next.ServeHTTP(rec, r) + + body := rec.Body.Bytes() + var resp map[string]json.RawMessage + if err := json.Unmarshal(body, &resp); err != nil { + // Pass through on unmarshal error. + for k, v := range rec.Header() { + w.Header()[k] = v + } + w.WriteHeader(rec.Code) + _, _ = w.Write(body) + return + } + + // Inject cacheInvalidation extension. + ext := map[string]any{ + "cacheInvalidation": map[string]any{ + "keys": []map[string]any{ + {"typename": "Item", "key": map[string]any{"id": "1"}}, + }, + }, + } + extBytes, _ := json.Marshal(ext) + resp["extensions"] = extBytes + modified, _ := json.Marshal(resp) + + for k, v := range rec.Header() { + w.Header()[k] = v + } + w.Header().Set("Content-Length", fmt.Sprintf("%d", len(modified))) + w.WriteHeader(rec.Code) + _, _ = w.Write(modified) + }) + } +} diff --git a/router-tests/entity_caching/redis_test.go b/router-tests/entity_caching/redis_test.go new file mode 100644 index 0000000000..224f2d61b7 --- /dev/null +++ b/router-tests/entity_caching/redis_test.go @@ -0,0 +1,123 @@ +package entity_caching + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve" +) + +func TestRedis(t *testing.T) { + t.Parallel() + + t.Run("basic_miss_then_hit", func(t *testing.T) { + t.Parallel() + + cache, _ := newTestRedisCache(t) + ctx := t.Context() + + // Get miss + entries, err := cache.Get(ctx, []string{"key1"}) + require.NoError(t, err) + require.Len(t, entries, 1) + require.Nil(t, entries[0]) + + // Set + err = cache.Set(ctx, []*resolve.CacheEntry{ + {Key: "key1", Value: []byte(`{"id":"1","name":"Widget"}`)}, + }, 300*time.Second) + require.NoError(t, err) + + // Get hit + entries, err = cache.Get(ctx, []string{"key1"}) + require.NoError(t, err) + require.Len(t, entries, 1) + require.NotNil(t, entries[0]) + require.Equal(t, "key1", entries[0].Key) + require.Equal(t, `{"id":"1","name":"Widget"}`, string(entries[0].Value)) + }) + + t.Run("batch_operations", func(t *testing.T) { + t.Parallel() + + cache, _ := newTestRedisCache(t) + ctx := t.Context() + + // Batch Set + err := cache.Set(ctx, []*resolve.CacheEntry{ + {Key: "a", Value: []byte(`{"id":"1"}`)}, + {Key: "b", Value: []byte(`{"id":"2"}`)}, + {Key: "c", Value: []byte(`{"id":"3"}`)}, + }, 300*time.Second) + require.NoError(t, err) + + // Batch Get (MGet) + entries, err := cache.Get(ctx, []string{"a", "b", "c", "d"}) + require.NoError(t, err) + require.Len(t, entries, 4) + require.NotNil(t, entries[0]) + require.Equal(t, `{"id":"1"}`, string(entries[0].Value)) + require.NotNil(t, entries[1]) + require.Equal(t, `{"id":"2"}`, string(entries[1].Value)) + require.NotNil(t, entries[2]) + require.Equal(t, `{"id":"3"}`, string(entries[2].Value)) + require.Nil(t, entries[3]) // "d" not set + }) + + t.Run("ttl_expiry", func(t *testing.T) { + t.Parallel() + + cache, mr := newTestRedisCache(t) + ctx := t.Context() + + err := cache.Set(ctx, []*resolve.CacheEntry{ + {Key: "expiring", Value: []byte(`{"ttl":"test"}`)}, + }, 1*time.Second) + require.NoError(t, err) + + // Verify it's there + entries, err := cache.Get(ctx, []string{"expiring"}) + require.NoError(t, err) + require.NotNil(t, entries[0]) + + // Fast-forward time + mr.FastForward(2 * time.Second) + + // Should be expired + entries, err = cache.Get(ctx, []string{"expiring"}) + require.NoError(t, err) + require.Nil(t, entries[0]) + }) + + t.Run("delete", func(t *testing.T) { + t.Parallel() + + cache, _ := newTestRedisCache(t) + ctx := t.Context() + + // Set entries + err := cache.Set(ctx, []*resolve.CacheEntry{ + {Key: "del1", Value: []byte(`{"a":"1"}`)}, + {Key: "del2", Value: []byte(`{"b":"2"}`)}, + }, 300*time.Second) + require.NoError(t, err) + + // Verify present + entries, err := cache.Get(ctx, []string{"del1", "del2"}) + require.NoError(t, err) + require.NotNil(t, entries[0]) + require.NotNil(t, entries[1]) + + // Delete one + err = cache.Delete(ctx, []string{"del1"}) + require.NoError(t, err) + + // Verify deleted + entries, err = cache.Get(ctx, []string{"del1", "del2"}) + require.NoError(t, err) + require.Nil(t, entries[0]) + require.NotNil(t, entries[1]) + }) +} diff --git a/router-tests/entity_caching/setup_test.go b/router-tests/entity_caching/setup_test.go new file mode 100644 index 0000000000..949c204157 --- /dev/null +++ b/router-tests/entity_caching/setup_test.go @@ -0,0 +1,17 @@ +package entity_caching + +import ( + _ "embed" +) + +//go:embed testdata/config.json +var configJSONTemplate string + +const ( + itemsPlaceholderURL = "http://items.entity-cache-test.local/graphql" + detailsPlaceholderURL = "http://details.entity-cache-test.local/graphql" + inventoryPlaceholderURL = "http://inventory.entity-cache-test.local/graphql" + viewerPlaceholderURL = "http://viewer.entity-cache-test.local/graphql" + articlesPlaceholderURL = "http://articles.entity-cache-test.local/graphql" + articlesMetaPlaceholderURL = "http://articlesmeta.entity-cache-test.local/graphql" +) diff --git a/router-tests/entity_caching/subgraphs/articles/articles.go b/router-tests/entity_caching/subgraphs/articles/articles.go new file mode 100644 index 0000000000..ebce9ac2dc --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articles/articles.go @@ -0,0 +1,14 @@ +package articles + +import ( + "github.com/99designs/gqlgen/graphql" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/articles/subgraph" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/articles/subgraph/generated" +) + +func NewSchema() graphql.ExecutableSchema { + return generated.NewExecutableSchema(generated.Config{ + Resolvers: &subgraph.Resolver{}, + }) +} diff --git a/router-tests/entity_caching/subgraphs/articles/generate.go b/router-tests/entity_caching/subgraphs/articles/generate.go new file mode 100644 index 0000000000..aab7bc94a8 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articles/generate.go @@ -0,0 +1,3 @@ +//go:generate go run github.com/99designs/gqlgen generate + +package articles diff --git a/router-tests/entity_caching/subgraphs/articles/gqlgen.yml b/router-tests/entity_caching/subgraphs/articles/gqlgen.yml new file mode 100644 index 0000000000..78cd6bc4bf --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articles/gqlgen.yml @@ -0,0 +1,39 @@ +schema: + - subgraph/*.graphqls + +exec: + filename: subgraph/generated/generated.go + package: generated + +federation: + filename: subgraph/generated/federation.go + package: generated + version: 2 + options: + explicit_requires: true + +model: + filename: subgraph/model/models_gen.go + package: model + +resolver: + layout: follow-schema + dir: subgraph + package: subgraph + +models: + Article: + fields: + personalizedRecommendation: + resolver: true + ID: + model: + - github.com/99designs/gqlgen/graphql.ID + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + Int: + model: + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 diff --git a/router-tests/entity_caching/subgraphs/articles/subgraph/data.go b/router-tests/entity_caching/subgraphs/articles/subgraph/data.go new file mode 100644 index 0000000000..bc88c11ee2 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articles/subgraph/data.go @@ -0,0 +1,39 @@ +package subgraph + +type articleFixture struct { + Title string + Body string + Tags []string +} + +// articleFixtures keep article fields stable across entity resolutions so the +// synthetic entity-caching graph can model the same query shape repeatedly. +var articleFixtures = map[string]articleFixture{ + "a1": { + Title: "The Rise of Federated GraphQL", + Body: "Federated GraphQL lets teams split ownership while keeping one graph.", + Tags: []string{"federation", "graphql"}, + }, + "a2": { + Title: "Caching Strategies for Modern APIs", + Body: "Layered caching trades complexity for latency and load reduction.", + Tags: []string{"caching", "performance"}, + }, + "a3": { + Title: "A Practical Guide to @requestScoped", + Body: "@requestScoped deduplicates repeated field reads within one request.", + Tags: []string{"request-scoped", "graphql"}, + }, +} + +// relatedArticleIDs maps each article to its related articles. Used by the +// Article.relatedArticles resolver to enable nested-selection tests. +var relatedArticleIDs = map[string][]string{ + "a1": {"a2", "a3"}, + "a2": {"a1", "a3"}, + "a3": {"a1", "a2"}, +} + +func allArticleIDs() []string { + return []string{"a1", "a2", "a3"} +} diff --git a/router-tests/entity_caching/subgraphs/articles/subgraph/entity.resolvers.go b/router-tests/entity_caching/subgraphs/articles/subgraph/entity.resolvers.go new file mode 100644 index 0000000000..94874f4678 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articles/subgraph/entity.resolvers.go @@ -0,0 +1,67 @@ +package subgraph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.76 + +import ( + "context" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/articles/subgraph/generated" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/articles/subgraph/model" +) + +// buildArticle returns a populated Article including relatedArticles (as +// stubs — downstream entity lookups re-resolve them if the query selects +// nested fields). +func buildArticle(id string) *model.Article { + fixture := articleFixtures[id] + relatedIDs := relatedArticleIDs[id] + related := make([]*model.Article, 0, len(relatedIDs)) + for _, rid := range relatedIDs { + relatedFixture := articleFixtures[rid] + related = append(related, &model.Article{ + ID: rid, + Title: relatedFixture.Title, + Body: relatedFixture.Body, + Tags: relatedFixture.Tags, + }) + } + return &model.Article{ + ID: id, + Title: fixture.Title, + Body: fixture.Body, + Tags: fixture.Tags, + RelatedArticles: related, + } +} + +// FindArticleByID is the resolver for the findArticleByID field. +func (r *entityResolver) FindArticleByID(ctx context.Context, id string) (*model.Article, error) { + return buildArticle(id), nil +} + +// FindPersonalizedByID is the resolver for the findPersonalizedByID field. +func (r *entityResolver) FindPersonalizedByID(ctx context.Context, id string) (model.Personalized, error) { + // The articles subgraph declares Personalized as a plain interface with only the id key. + // The router never actually fetches _entities(Personalized) from this subgraph (that's the + // viewer subgraph's @interfaceObject). Returning an Article as the concrete type is a safe stub. + return buildArticle(id), nil +} + +// FindViewerByID is the resolver for the findViewerByID field. +func (r *entityResolver) FindViewerByID(ctx context.Context, id string) (*model.Viewer, error) { + return &model.Viewer{ + ID: id, + RecommendedArticles: []*model.Article{ + buildArticle("a1"), + buildArticle("a2"), + buildArticle("a3"), + }, + }, nil +} + +// Entity returns generated.EntityResolver implementation. +func (r *Resolver) Entity() generated.EntityResolver { return &entityResolver{r} } + +type entityResolver struct{ *Resolver } diff --git a/router-tests/entity_caching/subgraphs/articles/subgraph/generated/federation.go b/router-tests/entity_caching/subgraphs/articles/subgraph/generated/federation.go new file mode 100644 index 0000000000..6658afb637 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articles/subgraph/generated/federation.go @@ -0,0 +1,345 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "strings" + "sync" + + "github.com/99designs/gqlgen/plugin/federation/fedruntime" +) + +var ( + ErrUnknownType = errors.New("unknown type") + ErrTypeNotFound = errors.New("type not found") +) + +func (ec *executionContext) __resolve__service(ctx context.Context) (fedruntime.Service, error) { + if ec.DisableIntrospection { + return fedruntime.Service{}, errors.New("federated introspection disabled") + } + + var sdl []string + + for _, src := range sources { + if src.BuiltIn { + continue + } + sdl = append(sdl, src.Input) + } + + return fedruntime.Service{ + SDL: strings.Join(sdl, "\n"), + }, nil +} + +func (ec *executionContext) __resolve_entities(ctx context.Context, representations []map[string]any) []fedruntime.Entity { + list := make([]fedruntime.Entity, len(representations)) + + repsMap := ec.buildRepresentationGroups(ctx, representations) + + switch len(repsMap) { + case 0: + return list + case 1: + for typeName, reps := range repsMap { + ec.resolveEntityGroup(ctx, typeName, reps, list) + } + return list + default: + var g sync.WaitGroup + g.Add(len(repsMap)) + for typeName, reps := range repsMap { + go func(typeName string, reps []EntityWithIndex) { + ec.resolveEntityGroup(ctx, typeName, reps, list) + g.Done() + }(typeName, reps) + } + g.Wait() + return list + } +} + +type EntityWithIndex struct { + // The index in the original representation array + index int + entity EntityRepresentation +} + +// EntityRepresentation is the JSON representation of an entity sent by the Router +// used as the inputs for us to resolve. +// +// We make it a map because we know the top level JSON is always an object. +type EntityRepresentation map[string]any + +// We group entities by typename so that we can parallelize their resolution. +// This is particularly helpful when there are entity groups in multi mode. +func (ec *executionContext) buildRepresentationGroups( + ctx context.Context, + representations []map[string]any, +) map[string][]EntityWithIndex { + repsMap := make(map[string][]EntityWithIndex) + for i, rep := range representations { + typeName, ok := rep["__typename"].(string) + if !ok { + // If there is no __typename, we just skip the representation; + // we just won't be resolving these unknown types. + ec.Error(ctx, errors.New("__typename must be an existing string")) + continue + } + + repsMap[typeName] = append(repsMap[typeName], EntityWithIndex{ + index: i, + entity: rep, + }) + } + + return repsMap +} + +func (ec *executionContext) resolveEntityGroup( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) { + if isMulti(typeName) { + err := ec.resolveManyEntities(ctx, typeName, reps, list) + if err != nil { + ec.Error(ctx, err) + } + } else { + // if there are multiple entities to resolve, parallelize (similar to + // graphql.FieldSet.Dispatch) + var e sync.WaitGroup + e.Add(len(reps)) + for i, rep := range reps { + i, rep := i, rep + go func(i int, rep EntityWithIndex) { + entity, err := ec.resolveEntity(ctx, typeName, rep.entity) + if err != nil { + ec.Error(ctx, err) + } else { + list[rep.index] = entity + } + e.Done() + }(i, rep) + } + e.Wait() + } +} + +func isMulti(typeName string) bool { + switch typeName { + default: + return false + } +} + +func (ec *executionContext) resolveEntity( + ctx context.Context, + typeName string, + rep EntityRepresentation, +) (e fedruntime.Entity, err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + case "Article": + resolverName, err := entityResolverNameForArticle(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Article": %w`, err) + } + switch resolverName { + + case "findArticleByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findArticleByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindArticleByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Article": %w`, err) + } + err = ec.PopulateArticleRequires(ctx, entity, rep) + if err != nil { + return nil, fmt.Errorf(`populating requires for Entity "Article": %w`, err) + } + return entity, nil + } + case "Personalized": + resolverName, err := entityResolverNameForPersonalized(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Personalized": %w`, err) + } + switch resolverName { + + case "findPersonalizedByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findPersonalizedByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindPersonalizedByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Personalized": %w`, err) + } + + return entity, nil + } + case "Viewer": + resolverName, err := entityResolverNameForViewer(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Viewer": %w`, err) + } + switch resolverName { + + case "findViewerByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findViewerByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindViewerByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Viewer": %w`, err) + } + + return entity, nil + } + + } + return nil, fmt.Errorf("%w: %s", ErrUnknownType, typeName) +} + +func (ec *executionContext) resolveManyEntities( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) (err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + + default: + return errors.New("unknown type: " + typeName) + } +} + +func entityResolverNameForArticle(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Article", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Article", ErrTypeNotFound)) + break + } + return "findArticleByID", nil + } + return "", fmt.Errorf("%w for Article due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForPersonalized(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Personalized", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Personalized", ErrTypeNotFound)) + break + } + return "findPersonalizedByID", nil + } + return "", fmt.Errorf("%w for Personalized due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForViewer(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Viewer", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Viewer", ErrTypeNotFound)) + break + } + return "findViewerByID", nil + } + return "", fmt.Errorf("%w for Viewer due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} diff --git a/router-tests/entity_caching/subgraphs/articles/subgraph/generated/federation.requires.go b/router-tests/entity_caching/subgraphs/articles/subgraph/generated/federation.requires.go new file mode 100644 index 0000000000..9305cf6ab9 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articles/subgraph/generated/federation.requires.go @@ -0,0 +1,35 @@ +package generated + +import ( + "context" + "fmt" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/articles/subgraph/model" +) + +// PopulateArticleRequires is the requires populator for the Article entity. +func (ec *executionContext) PopulateArticleRequires(ctx context.Context, entity *model.Article, reps map[string]any) error { + rawViewer, ok := reps["currentViewer"] + if !ok || rawViewer == nil { + return nil + } + + viewerMap, ok := rawViewer.(map[string]any) + if !ok { + return fmt.Errorf("expected currentViewer to be an object, got %T", rawViewer) + } + + viewer := &model.Viewer{} + if id, ok := viewerMap["id"].(string); ok { + viewer.ID = id + } + if name, ok := viewerMap["name"].(string); ok { + viewer.Name = name + } + if email, ok := viewerMap["email"].(string); ok { + viewer.Email = email + } + + entity.CurrentViewer = viewer + return nil +} diff --git a/router-tests/entity_caching/subgraphs/articles/subgraph/generated/generated.go b/router-tests/entity_caching/subgraphs/articles/subgraph/generated/generated.go new file mode 100644 index 0000000000..0c04ab98cc --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articles/subgraph/generated/generated.go @@ -0,0 +1,5519 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "bytes" + "context" + "errors" + "fmt" + "strconv" + "sync" + "sync/atomic" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/introspection" + "github.com/99designs/gqlgen/plugin/federation/fedruntime" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/articles/subgraph/model" +) + +// region ************************** generated!.gotpl ************************** + +// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. +func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { + return &executableSchema{ + schema: cfg.Schema, + resolvers: cfg.Resolvers, + directives: cfg.Directives, + complexity: cfg.Complexity, + } +} + +type Config struct { + Schema *ast.Schema + Resolvers ResolverRoot + Directives DirectiveRoot + Complexity ComplexityRoot +} + +type ResolverRoot interface { + Article() ArticleResolver + Entity() EntityResolver + Query() QueryResolver +} + +type DirectiveRoot struct { +} + +type ComplexityRoot struct { + Article struct { + Body func(childComplexity int) int + CurrentViewer func(childComplexity int) int + ID func(childComplexity int) int + PersonalizedRecommendation func(childComplexity int) int + RelatedArticles func(childComplexity int) int + Tags func(childComplexity int) int + Title func(childComplexity int) int + } + + Entity struct { + FindArticleByID func(childComplexity int, id string) int + FindPersonalizedByID func(childComplexity int, id string) int + FindViewerByID func(childComplexity int, id string) int + } + + Query struct { + Articles func(childComplexity int) int + __resolve__service func(childComplexity int) int + __resolve_entities func(childComplexity int, representations []map[string]any) int + } + + Viewer struct { + Email func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + RecommendedArticles func(childComplexity int) int + } + + _Service struct { + SDL func(childComplexity int) int + } +} + +type ArticleResolver interface { + PersonalizedRecommendation(ctx context.Context, obj *model.Article) (string, error) +} +type EntityResolver interface { + FindArticleByID(ctx context.Context, id string) (*model.Article, error) + FindPersonalizedByID(ctx context.Context, id string) (model.Personalized, error) + FindViewerByID(ctx context.Context, id string) (*model.Viewer, error) +} +type QueryResolver interface { + Articles(ctx context.Context) ([]*model.Article, error) +} + +type executableSchema struct { + schema *ast.Schema + resolvers ResolverRoot + directives DirectiveRoot + complexity ComplexityRoot +} + +func (e *executableSchema) Schema() *ast.Schema { + if e.schema != nil { + return e.schema + } + return parsedSchema +} + +func (e *executableSchema) Complexity(ctx context.Context, typeName, field string, childComplexity int, rawArgs map[string]any) (int, bool) { + ec := executionContext{nil, e, 0, 0, nil} + _ = ec + switch typeName + "." + field { + + case "Article.body": + if e.complexity.Article.Body == nil { + break + } + + return e.complexity.Article.Body(childComplexity), true + + case "Article.currentViewer": + if e.complexity.Article.CurrentViewer == nil { + break + } + + return e.complexity.Article.CurrentViewer(childComplexity), true + + case "Article.id": + if e.complexity.Article.ID == nil { + break + } + + return e.complexity.Article.ID(childComplexity), true + + case "Article.personalizedRecommendation": + if e.complexity.Article.PersonalizedRecommendation == nil { + break + } + + return e.complexity.Article.PersonalizedRecommendation(childComplexity), true + + case "Article.relatedArticles": + if e.complexity.Article.RelatedArticles == nil { + break + } + + return e.complexity.Article.RelatedArticles(childComplexity), true + + case "Article.tags": + if e.complexity.Article.Tags == nil { + break + } + + return e.complexity.Article.Tags(childComplexity), true + + case "Article.title": + if e.complexity.Article.Title == nil { + break + } + + return e.complexity.Article.Title(childComplexity), true + + case "Entity.findArticleByID": + if e.complexity.Entity.FindArticleByID == nil { + break + } + + args, err := ec.field_Entity_findArticleByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindArticleByID(childComplexity, args["id"].(string)), true + + case "Entity.findPersonalizedByID": + if e.complexity.Entity.FindPersonalizedByID == nil { + break + } + + args, err := ec.field_Entity_findPersonalizedByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindPersonalizedByID(childComplexity, args["id"].(string)), true + + case "Entity.findViewerByID": + if e.complexity.Entity.FindViewerByID == nil { + break + } + + args, err := ec.field_Entity_findViewerByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindViewerByID(childComplexity, args["id"].(string)), true + + case "Query.articles": + if e.complexity.Query.Articles == nil { + break + } + + return e.complexity.Query.Articles(childComplexity), true + + case "Query._service": + if e.complexity.Query.__resolve__service == nil { + break + } + + return e.complexity.Query.__resolve__service(childComplexity), true + + case "Query._entities": + if e.complexity.Query.__resolve_entities == nil { + break + } + + args, err := ec.field_Query__entities_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.__resolve_entities(childComplexity, args["representations"].([]map[string]any)), true + + case "Viewer.email": + if e.complexity.Viewer.Email == nil { + break + } + + return e.complexity.Viewer.Email(childComplexity), true + + case "Viewer.id": + if e.complexity.Viewer.ID == nil { + break + } + + return e.complexity.Viewer.ID(childComplexity), true + + case "Viewer.name": + if e.complexity.Viewer.Name == nil { + break + } + + return e.complexity.Viewer.Name(childComplexity), true + + case "Viewer.recommendedArticles": + if e.complexity.Viewer.RecommendedArticles == nil { + break + } + + return e.complexity.Viewer.RecommendedArticles(childComplexity), true + + case "_Service.sdl": + if e.complexity._Service.SDL == nil { + break + } + + return e.complexity._Service.SDL(childComplexity), true + + } + return 0, false +} + +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + opCtx := graphql.GetOperationContext(ctx) + ec := executionContext{opCtx, e, 0, 0, make(chan graphql.DeferredResult)} + inputUnmarshalMap := graphql.BuildUnmarshalerMap() + first := true + + switch opCtx.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + var response graphql.Response + var data graphql.Marshaler + if first { + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data = ec._Query(ctx, opCtx.Operation.SelectionSet) + } else { + if atomic.LoadInt32(&ec.pendingDeferred) > 0 { + result := <-ec.deferredResults + atomic.AddInt32(&ec.pendingDeferred, -1) + data = result.Result + response.Path = result.Path + response.Label = result.Label + response.Errors = result.Errors + } else { + return nil + } + } + var buf bytes.Buffer + data.MarshalGQL(&buf) + response.Data = buf.Bytes() + if atomic.LoadInt32(&ec.deferred) > 0 { + hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 + response.HasNext = &hasNext + } + + return &response + } + + default: + return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) + } +} + +type executionContext struct { + *graphql.OperationContext + *executableSchema + deferred int32 + pendingDeferred int32 + deferredResults chan graphql.DeferredResult +} + +func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) { + atomic.AddInt32(&ec.pendingDeferred, 1) + go func() { + ctx := graphql.WithFreshResponseContext(dg.Context) + dg.FieldSet.Dispatch(ctx) + ds := graphql.DeferredResult{ + Path: dg.Path, + Label: dg.Label, + Result: dg.FieldSet, + Errors: graphql.GetErrors(ctx), + } + // null fields should bubble up + if dg.FieldSet.Invalids > 0 { + ds.Result = graphql.Null + } + ec.deferredResults <- ds + }() +} + +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(ec.Schema()), nil +} + +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil +} + +var sources = []*ast.Source{ + {Name: "../schema.graphqls", Input: `extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key", "@external", "@requires"] + ) + +type Query { + articles: [Article!]! +} + +interface Personalized @key(fields: "id") { + id: ID! +} + +# Extends Viewer with an edge back into articles land. +# The @key forces sequencing: the articles _entities fetch for +# recommendedArticles needs viewer.id from the prior viewer fetch, so the +# planner cannot parallelize it with the root Query.currentViewer call. +# +# name and email are declared @external because Article.personalizedRecommendation +# @requires references them. Composition fails without these declarations. +type Viewer @key(fields: "id") { + id: ID! + name: String! @external + email: String! @external + recommendedArticles: [Article!]! +} + +type Article implements Personalized @key(fields: "id") { + id: ID! + title: String! + body: String! + tags: [String!]! + # Article.currentViewer is provided by the viewer subgraph via the + # Personalized @interfaceObject. It is @external here so @requires can + # reference it. + currentViewer: Viewer @external + # @requires a WIDER selection ({id, name, email}) than the root query + # will ask for ({id, name}). This is the widening-miss trigger that the + # test asserts: the coordinate L1 was populated with {id, name}, so the + # follow-up _entities(Personalized) fetch fails the widening check and + # refetches the viewer subgraph. + personalizedRecommendation: String! + @requires(fields: "currentViewer { id name email }") + # relatedArticles enables nested selection of Article entities so tests + # can exercise @requestScoped deduplication across multiple nesting + # levels (Article.currentViewer selected inline at more than one depth). + relatedArticles: [Article!]! +} +`, BuiltIn: false}, + {Name: "../../federation/directives.graphql", Input: ` + directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM + directive @composeDirective(name: String!) repeatable on SCHEMA + directive @extends on OBJECT | INTERFACE + directive @external on OBJECT | FIELD_DEFINITION + directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE + directive @inaccessible on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + directive @interfaceObject on OBJECT + directive @link(import: [String!], url: String!) repeatable on SCHEMA + directive @override(from: String!, label: String) on FIELD_DEFINITION + directive @policy(policies: [[federation__Policy!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @provides(fields: FieldSet!) on FIELD_DEFINITION + directive @requires(fields: FieldSet!) on FIELD_DEFINITION + directive @requiresScopes(scopes: [[federation__Scope!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @shareable repeatable on FIELD_DEFINITION | OBJECT + directive @tag(name: String!) repeatable on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + scalar _Any + scalar FieldSet + scalar federation__Policy + scalar federation__Scope +`, BuiltIn: true}, + {Name: "../../federation/entity.graphql", Input: ` +# a union of all types that use the @key directive +union _Entity = Article | Viewer + +# fake type to build resolver interfaces for users to implement +type Entity { + findArticleByID(id: ID!,): Article! + findPersonalizedByID(id: ID!,): Personalized! + findViewerByID(id: ID!,): Viewer! +} + +type _Service { + sdl: String +} + +extend type Query { + _entities(representations: [_Any!]!): [_Entity]! + _service: _Service! +} +`, BuiltIn: true}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Entity_findArticleByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findArticleByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findArticleByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findPersonalizedByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findPersonalizedByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findPersonalizedByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findViewerByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findViewerByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findViewerByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query___type_argsName(ctx, rawArgs) + if err != nil { + return nil, err + } + args["name"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query___type_argsName( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["name"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["name"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query__entities_argsRepresentations(ctx, rawArgs) + if err != nil { + return nil, err + } + args["representations"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query__entities_argsRepresentations( + ctx context.Context, + rawArgs map[string]any, +) ([]map[string]any, error) { + if _, ok := rawArgs["representations"]; !ok { + var zeroVal []map[string]any + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) + if tmp, ok := rawArgs["representations"]; ok { + return ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) + } + + var zeroVal []map[string]any + return zeroVal, nil +} + +func (ec *executionContext) field___Directive_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Directive_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Directive_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Field_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Field_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Field_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_enumValues_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_enumValues_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_fields_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_fields_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _Article_id(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_title(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_title(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Title, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_title(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_body(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_body(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Body, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_body(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_tags(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_tags(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Tags, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_currentViewer(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_currentViewer(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.CurrentViewer, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Viewer) + fc.Result = res + return ec.marshalOViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesᚋsubgraphᚋmodelᚐViewer(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_currentViewer(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Viewer_id(ctx, field) + case "name": + return ec.fieldContext_Viewer_name(ctx, field) + case "email": + return ec.fieldContext_Viewer_email(ctx, field) + case "recommendedArticles": + return ec.fieldContext_Viewer_recommendedArticles(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Viewer", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_personalizedRecommendation(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_personalizedRecommendation(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Article().PersonalizedRecommendation(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_personalizedRecommendation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_relatedArticles(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_relatedArticles(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.RelatedArticles, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Article) + fc.Result = res + return ec.marshalNArticle2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesᚋsubgraphᚋmodelᚐArticleᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_relatedArticles(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "title": + return ec.fieldContext_Article_title(ctx, field) + case "body": + return ec.fieldContext_Article_body(ctx, field) + case "tags": + return ec.fieldContext_Article_tags(ctx, field) + case "currentViewer": + return ec.fieldContext_Article_currentViewer(ctx, field) + case "personalizedRecommendation": + return ec.fieldContext_Article_personalizedRecommendation(ctx, field) + case "relatedArticles": + return ec.fieldContext_Article_relatedArticles(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_findArticleByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findArticleByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindArticleByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Article) + fc.Result = res + return ec.marshalNArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesᚋsubgraphᚋmodelᚐArticle(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findArticleByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "title": + return ec.fieldContext_Article_title(ctx, field) + case "body": + return ec.fieldContext_Article_body(ctx, field) + case "tags": + return ec.fieldContext_Article_tags(ctx, field) + case "currentViewer": + return ec.fieldContext_Article_currentViewer(ctx, field) + case "personalizedRecommendation": + return ec.fieldContext_Article_personalizedRecommendation(ctx, field) + case "relatedArticles": + return ec.fieldContext_Article_relatedArticles(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findArticleByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findPersonalizedByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findPersonalizedByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindPersonalizedByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.Personalized) + fc.Result = res + return ec.marshalNPersonalized2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesᚋsubgraphᚋmodelᚐPersonalized(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findPersonalizedByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findPersonalizedByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findViewerByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findViewerByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindViewerByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Viewer) + fc.Result = res + return ec.marshalNViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesᚋsubgraphᚋmodelᚐViewer(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findViewerByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Viewer_id(ctx, field) + case "name": + return ec.fieldContext_Viewer_name(ctx, field) + case "email": + return ec.fieldContext_Viewer_email(ctx, field) + case "recommendedArticles": + return ec.fieldContext_Viewer_recommendedArticles(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Viewer", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findViewerByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_articles(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_articles(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Articles(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Article) + fc.Result = res + return ec.marshalNArticle2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesᚋsubgraphᚋmodelᚐArticleᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_articles(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "title": + return ec.fieldContext_Article_title(ctx, field) + case "body": + return ec.fieldContext_Article_body(ctx, field) + case "tags": + return ec.fieldContext_Article_tags(ctx, field) + case "currentViewer": + return ec.fieldContext_Article_currentViewer(ctx, field) + case "personalizedRecommendation": + return ec.fieldContext_Article_personalizedRecommendation(ctx, field) + case "relatedArticles": + return ec.fieldContext_Article_relatedArticles(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__entities(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve_entities(ctx, fc.Args["representations"].([]map[string]any)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]fedruntime.Entity) + fc.Result = res + return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__entities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type _Entity does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query__entities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__service(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve__service(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(fedruntime.Service) + fc.Result = res + return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__service(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "sdl": + return ec.fieldContext__Service_sdl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___schema(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Viewer_id(ctx context.Context, field graphql.CollectedField, obj *model.Viewer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Viewer_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Viewer_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Viewer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Viewer_name(ctx context.Context, field graphql.CollectedField, obj *model.Viewer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Viewer_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Viewer_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Viewer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Viewer_email(ctx context.Context, field graphql.CollectedField, obj *model.Viewer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Viewer_email(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Email, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Viewer_email(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Viewer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Viewer_recommendedArticles(ctx context.Context, field graphql.CollectedField, obj *model.Viewer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Viewer_recommendedArticles(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecommendedArticles, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Article) + fc.Result = res + return ec.marshalNArticle2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesᚋsubgraphᚋmodelᚐArticleᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Viewer_recommendedArticles(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Viewer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "title": + return ec.fieldContext_Article_title(ctx, field) + case "body": + return ec.fieldContext_Article_body(ctx, field) + case "tags": + return ec.fieldContext_Article_tags(ctx, field) + case "currentViewer": + return ec.fieldContext_Article_currentViewer(ctx, field) + case "personalizedRecommendation": + return ec.fieldContext_Article_personalizedRecommendation(ctx, field) + case "relatedArticles": + return ec.fieldContext_Article_relatedArticles(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext__Service_sdl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SDL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext__Service_sdl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "_Service", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsRepeatable, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Locations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __DirectiveLocation does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Directive_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Field_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_isOneOf(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_isOneOf(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsOneOf(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_isOneOf(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +func (ec *executionContext) _Personalized(ctx context.Context, sel ast.SelectionSet, obj model.Personalized) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case model.Article: + return ec._Article(ctx, sel, &obj) + case *model.Article: + if obj == nil { + return graphql.Null + } + return ec._Article(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, obj fedruntime.Entity) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case model.Article: + return ec._Article(ctx, sel, &obj) + case *model.Article: + if obj == nil { + return graphql.Null + } + return ec._Article(ctx, sel, obj) + case model.Viewer: + return ec._Viewer(ctx, sel, &obj) + case *model.Viewer: + if obj == nil { + return graphql.Null + } + return ec._Viewer(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var articleImplementors = []string{"Article", "Personalized", "_Entity"} + +func (ec *executionContext) _Article(ctx context.Context, sel ast.SelectionSet, obj *model.Article) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, articleImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Article") + case "id": + out.Values[i] = ec._Article_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "title": + out.Values[i] = ec._Article_title(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "body": + out.Values[i] = ec._Article_body(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "tags": + out.Values[i] = ec._Article_tags(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "currentViewer": + out.Values[i] = ec._Article_currentViewer(ctx, field, obj) + case "personalizedRecommendation": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Article_personalizedRecommendation(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "relatedArticles": + out.Values[i] = ec._Article_relatedArticles(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var entityImplementors = []string{"Entity"} + +func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Entity", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Entity") + case "findArticleByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findArticleByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findPersonalizedByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findPersonalizedByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findViewerByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findViewerByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var queryImplementors = []string{"Query"} + +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "articles": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_articles(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "_entities": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__entities(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "_service": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__service(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "__type": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) + case "__schema": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var viewerImplementors = []string{"Viewer", "_Entity"} + +func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, obj *model.Viewer) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, viewerImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Viewer") + case "id": + out.Values[i] = ec._Viewer_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._Viewer_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "email": + out.Values[i] = ec._Viewer_email(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "recommendedArticles": + out.Values[i] = ec._Viewer_recommendedArticles(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var _ServiceImplementors = []string{"_Service"} + +func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("_Service") + case "sdl": + out.Values[i] = ec.__Service_sdl(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __DirectiveImplementors = []string{"__Directive"} + +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "isRepeatable": + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __EnumValueImplementors = []string{"__EnumValue"} + +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __FieldImplementors = []string{"__Field"} + +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __InputValueImplementors = []string{"__InputValue"} + +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___InputValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___InputValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __SchemaImplementors = []string{"__Schema"} + +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Schema") + case "description": + out.Values[i] = ec.___Schema_description(ctx, field, obj) + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __TypeImplementors = []string{"__Type"} + +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "specifiedByURL": + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + case "isOneOf": + out.Values[i] = ec.___Type_isOneOf(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +// endregion **************************** object.gotpl **************************** + +// region ***************************** type.gotpl ***************************** + +func (ec *executionContext) marshalNArticle2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesᚋsubgraphᚋmodelᚐArticle(ctx context.Context, sel ast.SelectionSet, v model.Article) graphql.Marshaler { + return ec._Article(ctx, sel, &v) +} + +func (ec *executionContext) marshalNArticle2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesᚋsubgraphᚋmodelᚐArticleᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Article) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesᚋsubgraphᚋmodelᚐArticle(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesᚋsubgraphᚋmodelᚐArticle(ctx context.Context, sel ast.SelectionSet, v *model.Article) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Article(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNFieldSet2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNID2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalID(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalID(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNPersonalized2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesᚋsubgraphᚋmodelᚐPersonalized(ctx context.Context, sel ast.SelectionSet, v model.Personalized) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Personalized(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNString2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNViewer2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesᚋsubgraphᚋmodelᚐViewer(ctx context.Context, sel ast.SelectionSet, v model.Viewer) graphql.Marshaler { + return ec._Viewer(ctx, sel, &v) +} + +func (ec *executionContext) marshalNViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesᚋsubgraphᚋmodelᚐViewer(ctx context.Context, sel ast.SelectionSet, v *model.Viewer) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Viewer(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v any) (map[string]any, error) { + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]any) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + _ = sel + res := graphql.MarshalMap(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v any) ([]map[string]any, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]map[string]any, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN_Any2map(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN_Any2ᚕmapᚄ(ctx context.Context, sel ast.SelectionSet, v []map[string]any) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalN_Any2map(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v []fedruntime.Entity) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { + return ec.__Service(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { + return ec.___Directive(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { + return ec.___EnumValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { + return ec.___Field(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { + return ec.___InputValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { + return ec.___Type(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Policy2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Scope2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalBoolean(v) + return res +} + +func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v any) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalBoolean(*v) + return res +} + +func (ec *executionContext) unmarshalOString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalString(v) + return res +} + +func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + if v == nil { + return nil, nil + } + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v any) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalString(*v) + return res +} + +func (ec *executionContext) marshalOViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesᚋsubgraphᚋmodelᚐViewer(ctx context.Context, sel ast.SelectionSet, v *model.Viewer) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Viewer(ctx, sel, v) +} + +func (ec *executionContext) marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v fedruntime.Entity) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.__Entity(ctx, sel, v) +} + +func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Schema(ctx, sel, v) +} + +func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +// endregion ***************************** type.gotpl ***************************** diff --git a/router-tests/entity_caching/subgraphs/articles/subgraph/generated/staticcheck.conf b/router-tests/entity_caching/subgraphs/articles/subgraph/generated/staticcheck.conf new file mode 100644 index 0000000000..582953a07e --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articles/subgraph/generated/staticcheck.conf @@ -0,0 +1,2 @@ +# This is meant as a workaround to skip staticcheck checks for generated code +checks = ["all", "-SA4004", "-ST1000"] diff --git a/router-tests/entity_caching/subgraphs/articles/subgraph/model/models_gen.go b/router-tests/entity_caching/subgraphs/articles/subgraph/model/models_gen.go new file mode 100644 index 0000000000..71377788b6 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articles/subgraph/model/models_gen.go @@ -0,0 +1,36 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package model + +type Personalized interface { + IsEntity() + IsPersonalized() + GetID() string +} + +type Article struct { + ID string `json:"id"` + Title string `json:"title"` + Body string `json:"body"` + Tags []string `json:"tags"` + CurrentViewer *Viewer `json:"currentViewer,omitempty"` + PersonalizedRecommendation string `json:"personalizedRecommendation"` + RelatedArticles []*Article `json:"relatedArticles"` +} + +func (Article) IsPersonalized() {} +func (this Article) GetID() string { return this.ID } + +func (Article) IsEntity() {} + +type Query struct { +} + +type Viewer struct { + ID string `json:"id"` + Name string `json:"name"` + Email string `json:"email"` + RecommendedArticles []*Article `json:"recommendedArticles"` +} + +func (Viewer) IsEntity() {} diff --git a/router-tests/entity_caching/subgraphs/articles/subgraph/resolver.go b/router-tests/entity_caching/subgraphs/articles/subgraph/resolver.go new file mode 100644 index 0000000000..c1da1a4335 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articles/subgraph/resolver.go @@ -0,0 +1,7 @@ +package subgraph + +// This file will not be regenerated automatically. +// +// It serves as dependency injection for your app, add any dependencies you require here. + +type Resolver struct{} diff --git a/router-tests/entity_caching/subgraphs/articles/subgraph/schema.graphqls b/router-tests/entity_caching/subgraphs/articles/subgraph/schema.graphqls new file mode 100644 index 0000000000..1f25b3d917 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articles/subgraph/schema.graphqls @@ -0,0 +1,49 @@ +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key", "@external", "@requires"] + ) + +type Query { + articles: [Article!]! +} + +interface Personalized @key(fields: "id") { + id: ID! +} + +# Extends Viewer with an edge back into articles land. +# The @key forces sequencing: the articles _entities fetch for +# recommendedArticles needs viewer.id from the prior viewer fetch, so the +# planner cannot parallelize it with the root Query.currentViewer call. +# +# name and email are declared @external because Article.personalizedRecommendation +# @requires references them. Composition fails without these declarations. +type Viewer @key(fields: "id") { + id: ID! + name: String! @external + email: String! @external + recommendedArticles: [Article!]! +} + +type Article implements Personalized @key(fields: "id") { + id: ID! + title: String! + body: String! + tags: [String!]! + # Article.currentViewer is provided by the viewer subgraph via the + # Personalized @interfaceObject. It is @external here so @requires can + # reference it. + currentViewer: Viewer @external + # @requires a WIDER selection ({id, name, email}) than the root query + # will ask for ({id, name}). This is the widening-miss trigger that the + # test asserts: the coordinate L1 was populated with {id, name}, so the + # follow-up _entities(Personalized) fetch fails the widening check and + # refetches the viewer subgraph. + personalizedRecommendation: String! + @requires(fields: "currentViewer { id name email }") + # relatedArticles enables nested selection of Article entities so tests + # can exercise @openfed__requestScoped deduplication across multiple nesting + # levels (Article.currentViewer selected inline at more than one depth). + relatedArticles: [Article!]! +} diff --git a/router-tests/entity_caching/subgraphs/articles/subgraph/schema.resolvers.go b/router-tests/entity_caching/subgraphs/articles/subgraph/schema.resolvers.go new file mode 100644 index 0000000000..6b581532bd --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articles/subgraph/schema.resolvers.go @@ -0,0 +1,44 @@ +package subgraph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.76 + +import ( + "context" + "fmt" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/articles/subgraph/generated" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/articles/subgraph/model" +) + +// PersonalizedRecommendation is the resolver for the personalizedRecommendation field. +func (r *articleResolver) PersonalizedRecommendation(ctx context.Context, obj *model.Article) (string, error) { + // obj.Title is set by FindArticleByID (looked up from articleFixtures). + // obj.CurrentViewer is populated by PopulateArticleRequires from the + // @requires representation. Including email in the returned string lets + // the test assert that the wider {id, name, email} selection actually + // reached this resolver. + if obj.CurrentViewer == nil { + return "no viewer", nil + } + return fmt.Sprintf("%s, recommended for %s <%s>", obj.Title, obj.CurrentViewer.Name, obj.CurrentViewer.Email), nil +} + +// Articles is the resolver for the articles field. +func (r *queryResolver) Articles(ctx context.Context) ([]*model.Article, error) { + articles := make([]*model.Article, 0, len(articleFixtures)) + for _, id := range allArticleIDs() { + articles = append(articles, buildArticle(id)) + } + return articles, nil +} + +// Article returns generated.ArticleResolver implementation. +func (r *Resolver) Article() generated.ArticleResolver { return &articleResolver{r} } + +// Query returns generated.QueryResolver implementation. +func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} } + +type articleResolver struct{ *Resolver } +type queryResolver struct{ *Resolver } diff --git a/router-tests/entity_caching/subgraphs/articlesmeta/articlesmeta.go b/router-tests/entity_caching/subgraphs/articlesmeta/articlesmeta.go new file mode 100644 index 0000000000..961a76c231 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articlesmeta/articlesmeta.go @@ -0,0 +1,14 @@ +package articlesmeta + +import ( + "github.com/99designs/gqlgen/graphql" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/articlesmeta/subgraph" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/generated" +) + +func NewSchema() graphql.ExecutableSchema { + return generated.NewExecutableSchema(generated.Config{ + Resolvers: &subgraph.Resolver{}, + }) +} diff --git a/router-tests/entity_caching/subgraphs/articlesmeta/generate.go b/router-tests/entity_caching/subgraphs/articlesmeta/generate.go new file mode 100644 index 0000000000..1a6605cfc8 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articlesmeta/generate.go @@ -0,0 +1,3 @@ +//go:generate go run github.com/99designs/gqlgen generate + +package articlesmeta diff --git a/router-tests/entity_caching/subgraphs/articlesmeta/gqlgen.yml b/router-tests/entity_caching/subgraphs/articlesmeta/gqlgen.yml new file mode 100644 index 0000000000..b4a796a814 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articlesmeta/gqlgen.yml @@ -0,0 +1,33 @@ +schema: + - subgraph/*.graphqls + +exec: + filename: subgraph/generated/generated.go + package: generated + +federation: + filename: subgraph/generated/federation.go + package: generated + version: 2 + +model: + filename: subgraph/model/models_gen.go + package: model + +resolver: + layout: follow-schema + dir: subgraph + package: subgraph + +models: + ID: + model: + - github.com/99designs/gqlgen/graphql.ID + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + Int: + model: + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 diff --git a/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/data.go b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/data.go new file mode 100644 index 0000000000..966312452e --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/data.go @@ -0,0 +1,25 @@ +package subgraph + +type articleMetaFixture struct { + ViewCount int + Rating float64 + ReviewSummary string +} + +var articleMetaFixtures = map[string]articleMetaFixture{ + "a1": { + ViewCount: 128, + Rating: 4.8, + ReviewSummary: "Strong overview of federation tradeoffs and rollout patterns.", + }, + "a2": { + ViewCount: 256, + Rating: 4.6, + ReviewSummary: "Practical caching patterns with clear latency examples.", + }, + "a3": { + ViewCount: 384, + Rating: 4.9, + ReviewSummary: "Concrete request-scoped guidance with useful caveats.", + }, +} diff --git a/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/entity.resolvers.go b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/entity.resolvers.go new file mode 100644 index 0000000000..4947fdfdbe --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/entity.resolvers.go @@ -0,0 +1,28 @@ +package subgraph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.76 + +import ( + "context" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/generated" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/model" +) + +// FindArticleByID is the resolver for the findArticleByID field. +func (r *entityResolver) FindArticleByID(ctx context.Context, id string) (*model.Article, error) { + fixture := articleMetaFixtures[id] + return &model.Article{ + ID: id, + ViewCount: fixture.ViewCount, + Rating: fixture.Rating, + ReviewSummary: fixture.ReviewSummary, + }, nil +} + +// Entity returns generated.EntityResolver implementation. +func (r *Resolver) Entity() generated.EntityResolver { return &entityResolver{r} } + +type entityResolver struct{ *Resolver } diff --git a/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/generated/federation.go b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/generated/federation.go new file mode 100644 index 0000000000..ab35491be7 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/generated/federation.go @@ -0,0 +1,234 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "strings" + "sync" + + "github.com/99designs/gqlgen/plugin/federation/fedruntime" +) + +var ( + ErrUnknownType = errors.New("unknown type") + ErrTypeNotFound = errors.New("type not found") +) + +func (ec *executionContext) __resolve__service(ctx context.Context) (fedruntime.Service, error) { + if ec.DisableIntrospection { + return fedruntime.Service{}, errors.New("federated introspection disabled") + } + + var sdl []string + + for _, src := range sources { + if src.BuiltIn { + continue + } + sdl = append(sdl, src.Input) + } + + return fedruntime.Service{ + SDL: strings.Join(sdl, "\n"), + }, nil +} + +func (ec *executionContext) __resolve_entities(ctx context.Context, representations []map[string]any) []fedruntime.Entity { + list := make([]fedruntime.Entity, len(representations)) + + repsMap := ec.buildRepresentationGroups(ctx, representations) + + switch len(repsMap) { + case 0: + return list + case 1: + for typeName, reps := range repsMap { + ec.resolveEntityGroup(ctx, typeName, reps, list) + } + return list + default: + var g sync.WaitGroup + g.Add(len(repsMap)) + for typeName, reps := range repsMap { + go func(typeName string, reps []EntityWithIndex) { + ec.resolveEntityGroup(ctx, typeName, reps, list) + g.Done() + }(typeName, reps) + } + g.Wait() + return list + } +} + +type EntityWithIndex struct { + // The index in the original representation array + index int + entity EntityRepresentation +} + +// EntityRepresentation is the JSON representation of an entity sent by the Router +// used as the inputs for us to resolve. +// +// We make it a map because we know the top level JSON is always an object. +type EntityRepresentation map[string]any + +// We group entities by typename so that we can parallelize their resolution. +// This is particularly helpful when there are entity groups in multi mode. +func (ec *executionContext) buildRepresentationGroups( + ctx context.Context, + representations []map[string]any, +) map[string][]EntityWithIndex { + repsMap := make(map[string][]EntityWithIndex) + for i, rep := range representations { + typeName, ok := rep["__typename"].(string) + if !ok { + // If there is no __typename, we just skip the representation; + // we just won't be resolving these unknown types. + ec.Error(ctx, errors.New("__typename must be an existing string")) + continue + } + + repsMap[typeName] = append(repsMap[typeName], EntityWithIndex{ + index: i, + entity: rep, + }) + } + + return repsMap +} + +func (ec *executionContext) resolveEntityGroup( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) { + if isMulti(typeName) { + err := ec.resolveManyEntities(ctx, typeName, reps, list) + if err != nil { + ec.Error(ctx, err) + } + } else { + // if there are multiple entities to resolve, parallelize (similar to + // graphql.FieldSet.Dispatch) + var e sync.WaitGroup + e.Add(len(reps)) + for i, rep := range reps { + i, rep := i, rep + go func(i int, rep EntityWithIndex) { + entity, err := ec.resolveEntity(ctx, typeName, rep.entity) + if err != nil { + ec.Error(ctx, err) + } else { + list[rep.index] = entity + } + e.Done() + }(i, rep) + } + e.Wait() + } +} + +func isMulti(typeName string) bool { + switch typeName { + default: + return false + } +} + +func (ec *executionContext) resolveEntity( + ctx context.Context, + typeName string, + rep EntityRepresentation, +) (e fedruntime.Entity, err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + case "Article": + resolverName, err := entityResolverNameForArticle(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Article": %w`, err) + } + switch resolverName { + + case "findArticleByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findArticleByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindArticleByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Article": %w`, err) + } + + return entity, nil + } + + } + return nil, fmt.Errorf("%w: %s", ErrUnknownType, typeName) +} + +func (ec *executionContext) resolveManyEntities( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) (err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + + default: + return errors.New("unknown type: " + typeName) + } +} + +func entityResolverNameForArticle(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Article", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Article", ErrTypeNotFound)) + break + } + return "findArticleByID", nil + } + return "", fmt.Errorf("%w for Article due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} diff --git a/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/generated/generated.go b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/generated/generated.go new file mode 100644 index 0000000000..5c7fe36b21 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/generated/generated.go @@ -0,0 +1,4529 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "bytes" + "context" + "errors" + "fmt" + "strconv" + "sync" + "sync/atomic" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/introspection" + "github.com/99designs/gqlgen/plugin/federation/fedruntime" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/model" +) + +// region ************************** generated!.gotpl ************************** + +// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. +func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { + return &executableSchema{ + schema: cfg.Schema, + resolvers: cfg.Resolvers, + directives: cfg.Directives, + complexity: cfg.Complexity, + } +} + +type Config struct { + Schema *ast.Schema + Resolvers ResolverRoot + Directives DirectiveRoot + Complexity ComplexityRoot +} + +type ResolverRoot interface { + Entity() EntityResolver +} + +type DirectiveRoot struct { +} + +type ComplexityRoot struct { + Article struct { + ID func(childComplexity int) int + Rating func(childComplexity int) int + ReviewSummary func(childComplexity int) int + ViewCount func(childComplexity int) int + } + + Entity struct { + FindArticleByID func(childComplexity int, id string) int + } + + Query struct { + __resolve__service func(childComplexity int) int + __resolve_entities func(childComplexity int, representations []map[string]any) int + } + + _Service struct { + SDL func(childComplexity int) int + } +} + +type EntityResolver interface { + FindArticleByID(ctx context.Context, id string) (*model.Article, error) +} + +type executableSchema struct { + schema *ast.Schema + resolvers ResolverRoot + directives DirectiveRoot + complexity ComplexityRoot +} + +func (e *executableSchema) Schema() *ast.Schema { + if e.schema != nil { + return e.schema + } + return parsedSchema +} + +func (e *executableSchema) Complexity(ctx context.Context, typeName, field string, childComplexity int, rawArgs map[string]any) (int, bool) { + ec := executionContext{nil, e, 0, 0, nil} + _ = ec + switch typeName + "." + field { + + case "Article.id": + if e.complexity.Article.ID == nil { + break + } + + return e.complexity.Article.ID(childComplexity), true + + case "Article.rating": + if e.complexity.Article.Rating == nil { + break + } + + return e.complexity.Article.Rating(childComplexity), true + + case "Article.reviewSummary": + if e.complexity.Article.ReviewSummary == nil { + break + } + + return e.complexity.Article.ReviewSummary(childComplexity), true + + case "Article.viewCount": + if e.complexity.Article.ViewCount == nil { + break + } + + return e.complexity.Article.ViewCount(childComplexity), true + + case "Entity.findArticleByID": + if e.complexity.Entity.FindArticleByID == nil { + break + } + + args, err := ec.field_Entity_findArticleByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindArticleByID(childComplexity, args["id"].(string)), true + + case "Query._service": + if e.complexity.Query.__resolve__service == nil { + break + } + + return e.complexity.Query.__resolve__service(childComplexity), true + + case "Query._entities": + if e.complexity.Query.__resolve_entities == nil { + break + } + + args, err := ec.field_Query__entities_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.__resolve_entities(childComplexity, args["representations"].([]map[string]any)), true + + case "_Service.sdl": + if e.complexity._Service.SDL == nil { + break + } + + return e.complexity._Service.SDL(childComplexity), true + + } + return 0, false +} + +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + opCtx := graphql.GetOperationContext(ctx) + ec := executionContext{opCtx, e, 0, 0, make(chan graphql.DeferredResult)} + inputUnmarshalMap := graphql.BuildUnmarshalerMap() + first := true + + switch opCtx.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + var response graphql.Response + var data graphql.Marshaler + if first { + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data = ec._Query(ctx, opCtx.Operation.SelectionSet) + } else { + if atomic.LoadInt32(&ec.pendingDeferred) > 0 { + result := <-ec.deferredResults + atomic.AddInt32(&ec.pendingDeferred, -1) + data = result.Result + response.Path = result.Path + response.Label = result.Label + response.Errors = result.Errors + } else { + return nil + } + } + var buf bytes.Buffer + data.MarshalGQL(&buf) + response.Data = buf.Bytes() + if atomic.LoadInt32(&ec.deferred) > 0 { + hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 + response.HasNext = &hasNext + } + + return &response + } + + default: + return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) + } +} + +type executionContext struct { + *graphql.OperationContext + *executableSchema + deferred int32 + pendingDeferred int32 + deferredResults chan graphql.DeferredResult +} + +func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) { + atomic.AddInt32(&ec.pendingDeferred, 1) + go func() { + ctx := graphql.WithFreshResponseContext(dg.Context) + dg.FieldSet.Dispatch(ctx) + ds := graphql.DeferredResult{ + Path: dg.Path, + Label: dg.Label, + Result: dg.FieldSet, + Errors: graphql.GetErrors(ctx), + } + // null fields should bubble up + if dg.FieldSet.Invalids > 0 { + ds.Result = graphql.Null + } + ec.deferredResults <- ds + }() +} + +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(ec.Schema()), nil +} + +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil +} + +var sources = []*ast.Source{ + {Name: "../schema.graphqls", Input: `extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key"] + ) + +type Article @key(fields: "id") { + id: ID! + viewCount: Int! + rating: Float! + reviewSummary: String! +} +`, BuiltIn: false}, + {Name: "../../federation/directives.graphql", Input: ` + directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM + directive @composeDirective(name: String!) repeatable on SCHEMA + directive @extends on OBJECT | INTERFACE + directive @external on OBJECT | FIELD_DEFINITION + directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE + directive @inaccessible on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + directive @interfaceObject on OBJECT + directive @link(import: [String!], url: String!) repeatable on SCHEMA + directive @override(from: String!, label: String) on FIELD_DEFINITION + directive @policy(policies: [[federation__Policy!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @provides(fields: FieldSet!) on FIELD_DEFINITION + directive @requires(fields: FieldSet!) on FIELD_DEFINITION + directive @requiresScopes(scopes: [[federation__Scope!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @shareable repeatable on FIELD_DEFINITION | OBJECT + directive @tag(name: String!) repeatable on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + scalar _Any + scalar FieldSet + scalar federation__Policy + scalar federation__Scope +`, BuiltIn: true}, + {Name: "../../federation/entity.graphql", Input: ` +# a union of all types that use the @key directive +union _Entity = Article + +# fake type to build resolver interfaces for users to implement +type Entity { + findArticleByID(id: ID!,): Article! +} + +type _Service { + sdl: String +} + +extend type Query { + _entities(representations: [_Any!]!): [_Entity]! + _service: _Service! +} +`, BuiltIn: true}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Entity_findArticleByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findArticleByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findArticleByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query___type_argsName(ctx, rawArgs) + if err != nil { + return nil, err + } + args["name"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query___type_argsName( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["name"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["name"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query__entities_argsRepresentations(ctx, rawArgs) + if err != nil { + return nil, err + } + args["representations"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query__entities_argsRepresentations( + ctx context.Context, + rawArgs map[string]any, +) ([]map[string]any, error) { + if _, ok := rawArgs["representations"]; !ok { + var zeroVal []map[string]any + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) + if tmp, ok := rawArgs["representations"]; ok { + return ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) + } + + var zeroVal []map[string]any + return zeroVal, nil +} + +func (ec *executionContext) field___Directive_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Directive_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Directive_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Field_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Field_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Field_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_enumValues_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_enumValues_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_fields_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_fields_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _Article_id(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_viewCount(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_viewCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ViewCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_viewCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_rating(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_rating(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Rating, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(float64) + fc.Result = res + return ec.marshalNFloat2float64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_rating(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Float does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Article_reviewSummary(ctx context.Context, field graphql.CollectedField, obj *model.Article) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Article_reviewSummary(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReviewSummary, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Article_reviewSummary(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Article", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_findArticleByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findArticleByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindArticleByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Article) + fc.Result = res + return ec.marshalNArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesmetaᚋsubgraphᚋmodelᚐArticle(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findArticleByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Article_id(ctx, field) + case "viewCount": + return ec.fieldContext_Article_viewCount(ctx, field) + case "rating": + return ec.fieldContext_Article_rating(ctx, field) + case "reviewSummary": + return ec.fieldContext_Article_reviewSummary(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Article", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findArticleByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__entities(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve_entities(ctx, fc.Args["representations"].([]map[string]any)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]fedruntime.Entity) + fc.Result = res + return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__entities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type _Entity does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query__entities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__service(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve__service(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(fedruntime.Service) + fc.Result = res + return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__service(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "sdl": + return ec.fieldContext__Service_sdl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___schema(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext__Service_sdl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SDL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext__Service_sdl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "_Service", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsRepeatable, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Locations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __DirectiveLocation does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Directive_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Field_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_isOneOf(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_isOneOf(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsOneOf(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_isOneOf(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, obj fedruntime.Entity) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case model.Article: + return ec._Article(ctx, sel, &obj) + case *model.Article: + if obj == nil { + return graphql.Null + } + return ec._Article(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var articleImplementors = []string{"Article", "_Entity"} + +func (ec *executionContext) _Article(ctx context.Context, sel ast.SelectionSet, obj *model.Article) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, articleImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Article") + case "id": + out.Values[i] = ec._Article_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "viewCount": + out.Values[i] = ec._Article_viewCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "rating": + out.Values[i] = ec._Article_rating(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "reviewSummary": + out.Values[i] = ec._Article_reviewSummary(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var entityImplementors = []string{"Entity"} + +func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Entity", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Entity") + case "findArticleByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findArticleByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var queryImplementors = []string{"Query"} + +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "_entities": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__entities(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "_service": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__service(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "__type": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) + case "__schema": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var _ServiceImplementors = []string{"_Service"} + +func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("_Service") + case "sdl": + out.Values[i] = ec.__Service_sdl(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __DirectiveImplementors = []string{"__Directive"} + +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "isRepeatable": + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __EnumValueImplementors = []string{"__EnumValue"} + +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __FieldImplementors = []string{"__Field"} + +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __InputValueImplementors = []string{"__InputValue"} + +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___InputValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___InputValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __SchemaImplementors = []string{"__Schema"} + +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Schema") + case "description": + out.Values[i] = ec.___Schema_description(ctx, field, obj) + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __TypeImplementors = []string{"__Type"} + +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "specifiedByURL": + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + case "isOneOf": + out.Values[i] = ec.___Type_isOneOf(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +// endregion **************************** object.gotpl **************************** + +// region ***************************** type.gotpl ***************************** + +func (ec *executionContext) marshalNArticle2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesmetaᚋsubgraphᚋmodelᚐArticle(ctx context.Context, sel ast.SelectionSet, v model.Article) graphql.Marshaler { + return ec._Article(ctx, sel, &v) +} + +func (ec *executionContext) marshalNArticle2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋarticlesmetaᚋsubgraphᚋmodelᚐArticle(ctx context.Context, sel ast.SelectionSet, v *model.Article) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Article(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNFieldSet2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v any) (float64, error) { + res, err := graphql.UnmarshalFloatContext(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { + _ = sel + res := graphql.MarshalFloatContext(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return graphql.WrapContextMarshaler(ctx, res) +} + +func (ec *executionContext) unmarshalNID2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalID(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalID(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v any) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { + _ = sel + res := graphql.MarshalInt(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v any) (map[string]any, error) { + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]any) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + _ = sel + res := graphql.MarshalMap(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v any) ([]map[string]any, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]map[string]any, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN_Any2map(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN_Any2ᚕmapᚄ(ctx context.Context, sel ast.SelectionSet, v []map[string]any) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalN_Any2map(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v []fedruntime.Entity) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { + return ec.__Service(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { + return ec.___Directive(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { + return ec.___EnumValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { + return ec.___Field(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { + return ec.___InputValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { + return ec.___Type(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Policy2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Scope2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalBoolean(v) + return res +} + +func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v any) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalBoolean(*v) + return res +} + +func (ec *executionContext) unmarshalOString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalString(v) + return res +} + +func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + if v == nil { + return nil, nil + } + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v any) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalString(*v) + return res +} + +func (ec *executionContext) marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v fedruntime.Entity) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.__Entity(ctx, sel, v) +} + +func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Schema(ctx, sel, v) +} + +func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +// endregion ***************************** type.gotpl ***************************** diff --git a/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/generated/staticcheck.conf b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/generated/staticcheck.conf new file mode 100644 index 0000000000..582953a07e --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/generated/staticcheck.conf @@ -0,0 +1,2 @@ +# This is meant as a workaround to skip staticcheck checks for generated code +checks = ["all", "-SA4004", "-ST1000"] diff --git a/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/model/models_gen.go b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/model/models_gen.go new file mode 100644 index 0000000000..9cb075b6f5 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/model/models_gen.go @@ -0,0 +1,15 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package model + +type Article struct { + ID string `json:"id"` + ViewCount int `json:"viewCount"` + Rating float64 `json:"rating"` + ReviewSummary string `json:"reviewSummary"` +} + +func (Article) IsEntity() {} + +type Query struct { +} diff --git a/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/resolver.go b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/resolver.go new file mode 100644 index 0000000000..c1da1a4335 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/resolver.go @@ -0,0 +1,7 @@ +package subgraph + +// This file will not be regenerated automatically. +// +// It serves as dependency injection for your app, add any dependencies you require here. + +type Resolver struct{} diff --git a/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/schema.graphqls b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/schema.graphqls new file mode 100644 index 0000000000..9b382e2281 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/articlesmeta/subgraph/schema.graphqls @@ -0,0 +1,12 @@ +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key"] + ) + +type Article @key(fields: "id") { + id: ID! + viewCount: Int! + rating: Float! + reviewSummary: String! +} diff --git a/router-tests/entity_caching/subgraphs/details/details.go b/router-tests/entity_caching/subgraphs/details/details.go new file mode 100644 index 0000000000..7e013a9b39 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/details/details.go @@ -0,0 +1,14 @@ +package details + +import ( + "github.com/99designs/gqlgen/graphql" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/details/subgraph" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/details/subgraph/generated" +) + +func NewSchema() graphql.ExecutableSchema { + return generated.NewExecutableSchema(generated.Config{ + Resolvers: &subgraph.Resolver{}, + }) +} diff --git a/router-tests/entity_caching/subgraphs/details/generate.go b/router-tests/entity_caching/subgraphs/details/generate.go new file mode 100644 index 0000000000..244aa22f21 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/details/generate.go @@ -0,0 +1,3 @@ +//go:generate go run github.com/99designs/gqlgen generate + +package details diff --git a/router-tests/entity_caching/subgraphs/details/gqlgen.yml b/router-tests/entity_caching/subgraphs/details/gqlgen.yml new file mode 100644 index 0000000000..2d7a8e4a30 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/details/gqlgen.yml @@ -0,0 +1,39 @@ +schema: + - subgraph/*.graphqls + +exec: + filename: subgraph/generated/generated.go + package: generated + +federation: + filename: subgraph/generated/federation.go + package: generated + version: 2 + options: + explicit_requires: true + +model: + filename: subgraph/model/models_gen.go + package: model + +resolver: + layout: follow-schema + dir: subgraph + package: subgraph + +directives: + entityCache: + skip_runtime: true + +models: + ID: + model: + - github.com/99designs/gqlgen/graphql.ID + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + Int: + model: + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 diff --git a/router-tests/entity_caching/subgraphs/details/subgraph/data.go b/router-tests/entity_caching/subgraphs/details/subgraph/data.go new file mode 100644 index 0000000000..2ee48f07c4 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/details/subgraph/data.go @@ -0,0 +1,29 @@ +package subgraph + +import ( + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/details/subgraph/model" +) + +// productKey creates a composite lookup key for Product entities. +func productKey(id, region string) string { return id + ":" + region } + +var ProductDetails = map[string]*model.Product{ + productKey("p1", "US"): {ID: "p1", Region: "US", Info: "Alpha product details for US market"}, + productKey("p2", "US"): {ID: "p2", Region: "US", Info: "Beta product details for US market"}, + productKey("p3", "EU"): {ID: "p3", Region: "EU", Info: "Gamma product details for EU market"}, + productKey("p4", "EU"): {ID: "p4", Region: "EU", Info: "Delta product details for EU market"}, +} + +var WarehouseDetails = map[string]*model.Warehouse{ + "w1": {Location: &model.Location{ID: "w1"}, Capacity: 1000}, + "w2": {Location: &model.Location{ID: "w2"}, Capacity: 500}, + "w3": {Location: &model.Location{ID: "w3"}, Capacity: 750}, +} + +var ItemDetails = map[string]*model.Item{ + "1": {ID: "1", Description: "A versatile widget for everyday use", Rating: 4.5, Tags: []string{"popular", "tools"}}, + "2": {ID: "2", Description: "A high-tech gadget with many features", Rating: 4.8, Tags: []string{"new", "electronics"}}, + "3": {ID: "3", Description: "A compact gizmo that fits in your pocket", Rating: 3.9, Tags: []string{"compact", "electronics"}}, + "4": {ID: "4", Description: "A mysterious doohickey of unknown purpose", Rating: 3.2, Tags: []string{"misc"}}, + "5": {ID: "5", Description: "An elaborate thingamajig for advanced users", Rating: 4.1, Tags: []string{"advanced", "misc"}}, +} diff --git a/router-tests/entity_caching/subgraphs/details/subgraph/entity.resolvers.go b/router-tests/entity_caching/subgraphs/details/subgraph/entity.resolvers.go new file mode 100644 index 0000000000..208e3064ff --- /dev/null +++ b/router-tests/entity_caching/subgraphs/details/subgraph/entity.resolvers.go @@ -0,0 +1,41 @@ +package subgraph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.76 + +import ( + "context" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/details/subgraph/generated" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/details/subgraph/model" +) + +// FindItemByID is the resolver for the findItemByID field. +func (r *entityResolver) FindItemByID(ctx context.Context, id string) (*model.Item, error) { + if item, ok := ItemDetails[id]; ok { + return item, nil + } + return nil, nil +} + +// FindProductByIDAndRegion is the resolver for the findProductByIDAndRegion field. +func (r *entityResolver) FindProductByIDAndRegion(ctx context.Context, id string, region string) (*model.Product, error) { + if p, ok := ProductDetails[productKey(id, region)]; ok { + return p, nil + } + return nil, nil +} + +// FindWarehouseByLocationID is the resolver for the findWarehouseByLocationID field. +func (r *entityResolver) FindWarehouseByLocationID(ctx context.Context, locationID string) (*model.Warehouse, error) { + if w, ok := WarehouseDetails[locationID]; ok { + return w, nil + } + return nil, nil +} + +// Entity returns generated.EntityResolver implementation. +func (r *Resolver) Entity() generated.EntityResolver { return &entityResolver{r} } + +type entityResolver struct{ *Resolver } diff --git a/router-tests/entity_caching/subgraphs/details/subgraph/generated/federation.go b/router-tests/entity_caching/subgraphs/details/subgraph/generated/federation.go new file mode 100644 index 0000000000..d75e9137d7 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/details/subgraph/generated/federation.go @@ -0,0 +1,368 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "strings" + "sync" + + "github.com/99designs/gqlgen/plugin/federation/fedruntime" +) + +var ( + ErrUnknownType = errors.New("unknown type") + ErrTypeNotFound = errors.New("type not found") +) + +func (ec *executionContext) __resolve__service(ctx context.Context) (fedruntime.Service, error) { + if ec.DisableIntrospection { + return fedruntime.Service{}, errors.New("federated introspection disabled") + } + + var sdl []string + + for _, src := range sources { + if src.BuiltIn { + continue + } + sdl = append(sdl, src.Input) + } + + return fedruntime.Service{ + SDL: strings.Join(sdl, "\n"), + }, nil +} + +func (ec *executionContext) __resolve_entities(ctx context.Context, representations []map[string]any) []fedruntime.Entity { + list := make([]fedruntime.Entity, len(representations)) + + repsMap := ec.buildRepresentationGroups(ctx, representations) + + switch len(repsMap) { + case 0: + return list + case 1: + for typeName, reps := range repsMap { + ec.resolveEntityGroup(ctx, typeName, reps, list) + } + return list + default: + var g sync.WaitGroup + g.Add(len(repsMap)) + for typeName, reps := range repsMap { + go func(typeName string, reps []EntityWithIndex) { + ec.resolveEntityGroup(ctx, typeName, reps, list) + g.Done() + }(typeName, reps) + } + g.Wait() + return list + } +} + +type EntityWithIndex struct { + // The index in the original representation array + index int + entity EntityRepresentation +} + +// EntityRepresentation is the JSON representation of an entity sent by the Router +// used as the inputs for us to resolve. +// +// We make it a map because we know the top level JSON is always an object. +type EntityRepresentation map[string]any + +// We group entities by typename so that we can parallelize their resolution. +// This is particularly helpful when there are entity groups in multi mode. +func (ec *executionContext) buildRepresentationGroups( + ctx context.Context, + representations []map[string]any, +) map[string][]EntityWithIndex { + repsMap := make(map[string][]EntityWithIndex) + for i, rep := range representations { + typeName, ok := rep["__typename"].(string) + if !ok { + // If there is no __typename, we just skip the representation; + // we just won't be resolving these unknown types. + ec.Error(ctx, errors.New("__typename must be an existing string")) + continue + } + + repsMap[typeName] = append(repsMap[typeName], EntityWithIndex{ + index: i, + entity: rep, + }) + } + + return repsMap +} + +func (ec *executionContext) resolveEntityGroup( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) { + if isMulti(typeName) { + err := ec.resolveManyEntities(ctx, typeName, reps, list) + if err != nil { + ec.Error(ctx, err) + } + } else { + // if there are multiple entities to resolve, parallelize (similar to + // graphql.FieldSet.Dispatch) + var e sync.WaitGroup + e.Add(len(reps)) + for i, rep := range reps { + i, rep := i, rep + go func(i int, rep EntityWithIndex) { + entity, err := ec.resolveEntity(ctx, typeName, rep.entity) + if err != nil { + ec.Error(ctx, err) + } else { + list[rep.index] = entity + } + e.Done() + }(i, rep) + } + e.Wait() + } +} + +func isMulti(typeName string) bool { + switch typeName { + default: + return false + } +} + +func (ec *executionContext) resolveEntity( + ctx context.Context, + typeName string, + rep EntityRepresentation, +) (e fedruntime.Entity, err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + case "Item": + resolverName, err := entityResolverNameForItem(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Item": %w`, err) + } + switch resolverName { + + case "findItemByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findItemByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindItemByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Item": %w`, err) + } + + return entity, nil + } + case "Product": + resolverName, err := entityResolverNameForProduct(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Product": %w`, err) + } + switch resolverName { + + case "findProductByIDAndRegion": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findProductByIDAndRegion(): %w`, err) + } + id1, err := ec.unmarshalNString2string(ctx, rep["region"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 1 for findProductByIDAndRegion(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindProductByIDAndRegion(ctx, id0, id1) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Product": %w`, err) + } + + return entity, nil + } + case "Warehouse": + resolverName, err := entityResolverNameForWarehouse(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Warehouse": %w`, err) + } + switch resolverName { + + case "findWarehouseByLocationID": + id0, err := ec.unmarshalNID2string(ctx, rep["location"].(map[string]any)["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findWarehouseByLocationID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindWarehouseByLocationID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Warehouse": %w`, err) + } + + return entity, nil + } + + } + return nil, fmt.Errorf("%w: %s", ErrUnknownType, typeName) +} + +func (ec *executionContext) resolveManyEntities( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) (err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + + default: + return errors.New("unknown type: " + typeName) + } +} + +func entityResolverNameForItem(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Item", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Item", ErrTypeNotFound)) + break + } + return "findItemByID", nil + } + return "", fmt.Errorf("%w for Item due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForProduct(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Product", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + m = rep + val, ok = m["region"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"region\" for Product", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Product", ErrTypeNotFound)) + break + } + return "findProductByIDAndRegion", nil + } + return "", fmt.Errorf("%w for Product due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForWarehouse(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["location"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"location\" for Warehouse", ErrTypeNotFound)) + break + } + if m, ok = val.(map[string]any); !ok { + // nested field value is not a map[string]interface so don't use it + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to nested Key Field \"location\" value not matching map[string]any for Warehouse", ErrTypeNotFound)) + break + } + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Warehouse", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Warehouse", ErrTypeNotFound)) + break + } + return "findWarehouseByLocationID", nil + } + return "", fmt.Errorf("%w for Warehouse due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} diff --git a/router-tests/entity_caching/subgraphs/details/subgraph/generated/generated.go b/router-tests/entity_caching/subgraphs/details/subgraph/generated/generated.go new file mode 100644 index 0000000000..cb7f75c6a4 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/details/subgraph/generated/generated.go @@ -0,0 +1,5367 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "bytes" + "context" + "errors" + "fmt" + "strconv" + "sync" + "sync/atomic" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/introspection" + "github.com/99designs/gqlgen/plugin/federation/fedruntime" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/details/subgraph/model" +) + +// region ************************** generated!.gotpl ************************** + +// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. +func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { + return &executableSchema{ + schema: cfg.Schema, + resolvers: cfg.Resolvers, + directives: cfg.Directives, + complexity: cfg.Complexity, + } +} + +type Config struct { + Schema *ast.Schema + Resolvers ResolverRoot + Directives DirectiveRoot + Complexity ComplexityRoot +} + +type ResolverRoot interface { + Entity() EntityResolver +} + +type DirectiveRoot struct { +} + +type ComplexityRoot struct { + Entity struct { + FindItemByID func(childComplexity int, id string) int + FindProductByIDAndRegion func(childComplexity int, id string, region string) int + FindWarehouseByLocationID func(childComplexity int, locationID string) int + } + + Item struct { + Description func(childComplexity int) int + ID func(childComplexity int) int + Rating func(childComplexity int) int + Tags func(childComplexity int) int + } + + Location struct { + ID func(childComplexity int) int + } + + Product struct { + ID func(childComplexity int) int + Info func(childComplexity int) int + Region func(childComplexity int) int + } + + Query struct { + __resolve__service func(childComplexity int) int + __resolve_entities func(childComplexity int, representations []map[string]any) int + } + + Warehouse struct { + Capacity func(childComplexity int) int + Location func(childComplexity int) int + } + + _Service struct { + SDL func(childComplexity int) int + } +} + +type EntityResolver interface { + FindItemByID(ctx context.Context, id string) (*model.Item, error) + FindProductByIDAndRegion(ctx context.Context, id string, region string) (*model.Product, error) + FindWarehouseByLocationID(ctx context.Context, locationID string) (*model.Warehouse, error) +} + +type executableSchema struct { + schema *ast.Schema + resolvers ResolverRoot + directives DirectiveRoot + complexity ComplexityRoot +} + +func (e *executableSchema) Schema() *ast.Schema { + if e.schema != nil { + return e.schema + } + return parsedSchema +} + +func (e *executableSchema) Complexity(ctx context.Context, typeName, field string, childComplexity int, rawArgs map[string]any) (int, bool) { + ec := executionContext{nil, e, 0, 0, nil} + _ = ec + switch typeName + "." + field { + + case "Entity.findItemByID": + if e.complexity.Entity.FindItemByID == nil { + break + } + + args, err := ec.field_Entity_findItemByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindItemByID(childComplexity, args["id"].(string)), true + + case "Entity.findProductByIDAndRegion": + if e.complexity.Entity.FindProductByIDAndRegion == nil { + break + } + + args, err := ec.field_Entity_findProductByIDAndRegion_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindProductByIDAndRegion(childComplexity, args["id"].(string), args["region"].(string)), true + + case "Entity.findWarehouseByLocationID": + if e.complexity.Entity.FindWarehouseByLocationID == nil { + break + } + + args, err := ec.field_Entity_findWarehouseByLocationID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindWarehouseByLocationID(childComplexity, args["locationID"].(string)), true + + case "Item.description": + if e.complexity.Item.Description == nil { + break + } + + return e.complexity.Item.Description(childComplexity), true + + case "Item.id": + if e.complexity.Item.ID == nil { + break + } + + return e.complexity.Item.ID(childComplexity), true + + case "Item.rating": + if e.complexity.Item.Rating == nil { + break + } + + return e.complexity.Item.Rating(childComplexity), true + + case "Item.tags": + if e.complexity.Item.Tags == nil { + break + } + + return e.complexity.Item.Tags(childComplexity), true + + case "Location.id": + if e.complexity.Location.ID == nil { + break + } + + return e.complexity.Location.ID(childComplexity), true + + case "Product.id": + if e.complexity.Product.ID == nil { + break + } + + return e.complexity.Product.ID(childComplexity), true + + case "Product.info": + if e.complexity.Product.Info == nil { + break + } + + return e.complexity.Product.Info(childComplexity), true + + case "Product.region": + if e.complexity.Product.Region == nil { + break + } + + return e.complexity.Product.Region(childComplexity), true + + case "Query._service": + if e.complexity.Query.__resolve__service == nil { + break + } + + return e.complexity.Query.__resolve__service(childComplexity), true + + case "Query._entities": + if e.complexity.Query.__resolve_entities == nil { + break + } + + args, err := ec.field_Query__entities_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.__resolve_entities(childComplexity, args["representations"].([]map[string]any)), true + + case "Warehouse.capacity": + if e.complexity.Warehouse.Capacity == nil { + break + } + + return e.complexity.Warehouse.Capacity(childComplexity), true + + case "Warehouse.location": + if e.complexity.Warehouse.Location == nil { + break + } + + return e.complexity.Warehouse.Location(childComplexity), true + + case "_Service.sdl": + if e.complexity._Service.SDL == nil { + break + } + + return e.complexity._Service.SDL(childComplexity), true + + } + return 0, false +} + +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + opCtx := graphql.GetOperationContext(ctx) + ec := executionContext{opCtx, e, 0, 0, make(chan graphql.DeferredResult)} + inputUnmarshalMap := graphql.BuildUnmarshalerMap() + first := true + + switch opCtx.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + var response graphql.Response + var data graphql.Marshaler + if first { + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data = ec._Query(ctx, opCtx.Operation.SelectionSet) + } else { + if atomic.LoadInt32(&ec.pendingDeferred) > 0 { + result := <-ec.deferredResults + atomic.AddInt32(&ec.pendingDeferred, -1) + data = result.Result + response.Path = result.Path + response.Label = result.Label + response.Errors = result.Errors + } else { + return nil + } + } + var buf bytes.Buffer + data.MarshalGQL(&buf) + response.Data = buf.Bytes() + if atomic.LoadInt32(&ec.deferred) > 0 { + hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 + response.HasNext = &hasNext + } + + return &response + } + + default: + return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) + } +} + +type executionContext struct { + *graphql.OperationContext + *executableSchema + deferred int32 + pendingDeferred int32 + deferredResults chan graphql.DeferredResult +} + +func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) { + atomic.AddInt32(&ec.pendingDeferred, 1) + go func() { + ctx := graphql.WithFreshResponseContext(dg.Context) + dg.FieldSet.Dispatch(ctx) + ds := graphql.DeferredResult{ + Path: dg.Path, + Label: dg.Label, + Result: dg.FieldSet, + Errors: graphql.GetErrors(ctx), + } + // null fields should bubble up + if dg.FieldSet.Invalids > 0 { + ds.Result = graphql.Null + } + ec.deferredResults <- ds + }() +} + +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(ec.Schema()), nil +} + +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil +} + +var sources = []*ast.Source{ + {Name: "../schema.graphqls", Input: `extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key"] + ) + +directive @entityCache( + maxAge: Int! + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT + +type Item @key(fields: "id") @entityCache(maxAge: 300) { + id: ID! + description: String! + rating: Float! + tags: [String!]! +} + +type Product @key(fields: "id region") @entityCache(maxAge: 300) { + id: ID! + region: String! + info: String! +} + +type Location { + id: ID! +} + +type Warehouse @key(fields: "location { id }") @entityCache(maxAge: 300) { + location: Location! + capacity: Int! +} +`, BuiltIn: false}, + {Name: "../../federation/directives.graphql", Input: ` + directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM + directive @composeDirective(name: String!) repeatable on SCHEMA + directive @extends on OBJECT | INTERFACE + directive @external on OBJECT | FIELD_DEFINITION + directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE + directive @inaccessible on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + directive @interfaceObject on OBJECT + directive @link(import: [String!], url: String!) repeatable on SCHEMA + directive @override(from: String!, label: String) on FIELD_DEFINITION + directive @policy(policies: [[federation__Policy!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @provides(fields: FieldSet!) on FIELD_DEFINITION + directive @requires(fields: FieldSet!) on FIELD_DEFINITION + directive @requiresScopes(scopes: [[federation__Scope!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @shareable repeatable on FIELD_DEFINITION | OBJECT + directive @tag(name: String!) repeatable on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + scalar _Any + scalar FieldSet + scalar federation__Policy + scalar federation__Scope +`, BuiltIn: true}, + {Name: "../../federation/entity.graphql", Input: ` +# a union of all types that use the @key directive +union _Entity = Item | Product | Warehouse + +# fake type to build resolver interfaces for users to implement +type Entity { + findItemByID(id: ID!,): Item! + findProductByIDAndRegion(id: ID!,region: String!,): Product! + findWarehouseByLocationID(locationID: ID!,): Warehouse! +} + +type _Service { + sdl: String +} + +extend type Query { + _entities(representations: [_Any!]!): [_Entity]! + _service: _Service! +} +`, BuiltIn: true}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Entity_findItemByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findItemByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findItemByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findProductByIDAndRegion_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findProductByIDAndRegion_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + arg1, err := ec.field_Entity_findProductByIDAndRegion_argsRegion(ctx, rawArgs) + if err != nil { + return nil, err + } + args["region"] = arg1 + return args, nil +} +func (ec *executionContext) field_Entity_findProductByIDAndRegion_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findProductByIDAndRegion_argsRegion( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["region"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) + if tmp, ok := rawArgs["region"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findWarehouseByLocationID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findWarehouseByLocationID_argsLocationID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["locationID"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findWarehouseByLocationID_argsLocationID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["locationID"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("locationID")) + if tmp, ok := rawArgs["locationID"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query___type_argsName(ctx, rawArgs) + if err != nil { + return nil, err + } + args["name"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query___type_argsName( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["name"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["name"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query__entities_argsRepresentations(ctx, rawArgs) + if err != nil { + return nil, err + } + args["representations"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query__entities_argsRepresentations( + ctx context.Context, + rawArgs map[string]any, +) ([]map[string]any, error) { + if _, ok := rawArgs["representations"]; !ok { + var zeroVal []map[string]any + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) + if tmp, ok := rawArgs["representations"]; ok { + return ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) + } + + var zeroVal []map[string]any + return zeroVal, nil +} + +func (ec *executionContext) field___Directive_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Directive_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Directive_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Field_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Field_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Field_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_enumValues_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_enumValues_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_fields_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_fields_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _Entity_findItemByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findItemByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindItemByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Item) + fc.Result = res + return ec.marshalNItem2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋdetailsᚋsubgraphᚋmodelᚐItem(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findItemByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Item_id(ctx, field) + case "description": + return ec.fieldContext_Item_description(ctx, field) + case "rating": + return ec.fieldContext_Item_rating(ctx, field) + case "tags": + return ec.fieldContext_Item_tags(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Item", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findItemByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findProductByIDAndRegion(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findProductByIDAndRegion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindProductByIDAndRegion(rctx, fc.Args["id"].(string), fc.Args["region"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Product) + fc.Result = res + return ec.marshalNProduct2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋdetailsᚋsubgraphᚋmodelᚐProduct(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findProductByIDAndRegion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Product_id(ctx, field) + case "region": + return ec.fieldContext_Product_region(ctx, field) + case "info": + return ec.fieldContext_Product_info(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Product", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findProductByIDAndRegion_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findWarehouseByLocationID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findWarehouseByLocationID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindWarehouseByLocationID(rctx, fc.Args["locationID"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Warehouse) + fc.Result = res + return ec.marshalNWarehouse2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋdetailsᚋsubgraphᚋmodelᚐWarehouse(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findWarehouseByLocationID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "location": + return ec.fieldContext_Warehouse_location(ctx, field) + case "capacity": + return ec.fieldContext_Warehouse_capacity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Warehouse", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findWarehouseByLocationID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Item_id(ctx context.Context, field graphql.CollectedField, obj *model.Item) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Item_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Item_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Item", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Item_description(ctx context.Context, field graphql.CollectedField, obj *model.Item) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Item_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Item_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Item", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Item_rating(ctx context.Context, field graphql.CollectedField, obj *model.Item) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Item_rating(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Rating, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(float64) + fc.Result = res + return ec.marshalNFloat2float64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Item_rating(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Item", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Float does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Item_tags(ctx context.Context, field graphql.CollectedField, obj *model.Item) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Item_tags(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Tags, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Item_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Item", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Location_id(ctx context.Context, field graphql.CollectedField, obj *model.Location) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Location_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Location_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Location", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Product_id(ctx context.Context, field graphql.CollectedField, obj *model.Product) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Product_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Product_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Product", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Product_region(ctx context.Context, field graphql.CollectedField, obj *model.Product) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Product_region(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Region, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Product_region(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Product", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Product_info(ctx context.Context, field graphql.CollectedField, obj *model.Product) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Product_info(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Info, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Product_info(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Product", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__entities(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve_entities(ctx, fc.Args["representations"].([]map[string]any)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]fedruntime.Entity) + fc.Result = res + return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__entities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type _Entity does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query__entities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__service(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve__service(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(fedruntime.Service) + fc.Result = res + return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__service(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "sdl": + return ec.fieldContext__Service_sdl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___schema(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Warehouse_location(ctx context.Context, field graphql.CollectedField, obj *model.Warehouse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Warehouse_location(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Location, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Location) + fc.Result = res + return ec.marshalNLocation2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋdetailsᚋsubgraphᚋmodelᚐLocation(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Warehouse_location(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Warehouse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Location_id(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Location", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Warehouse_capacity(ctx context.Context, field graphql.CollectedField, obj *model.Warehouse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Warehouse_capacity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Capacity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Warehouse_capacity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Warehouse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext__Service_sdl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SDL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext__Service_sdl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "_Service", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsRepeatable, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Locations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __DirectiveLocation does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Directive_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Field_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_isOneOf(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_isOneOf(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsOneOf(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_isOneOf(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, obj fedruntime.Entity) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case model.Warehouse: + return ec._Warehouse(ctx, sel, &obj) + case *model.Warehouse: + if obj == nil { + return graphql.Null + } + return ec._Warehouse(ctx, sel, obj) + case model.Product: + return ec._Product(ctx, sel, &obj) + case *model.Product: + if obj == nil { + return graphql.Null + } + return ec._Product(ctx, sel, obj) + case model.Item: + return ec._Item(ctx, sel, &obj) + case *model.Item: + if obj == nil { + return graphql.Null + } + return ec._Item(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var entityImplementors = []string{"Entity"} + +func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Entity", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Entity") + case "findItemByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findItemByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findProductByIDAndRegion": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findProductByIDAndRegion(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findWarehouseByLocationID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findWarehouseByLocationID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var itemImplementors = []string{"Item", "_Entity"} + +func (ec *executionContext) _Item(ctx context.Context, sel ast.SelectionSet, obj *model.Item) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, itemImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Item") + case "id": + out.Values[i] = ec._Item_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec._Item_description(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "rating": + out.Values[i] = ec._Item_rating(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "tags": + out.Values[i] = ec._Item_tags(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var locationImplementors = []string{"Location"} + +func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, obj *model.Location) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, locationImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Location") + case "id": + out.Values[i] = ec._Location_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var productImplementors = []string{"Product", "_Entity"} + +func (ec *executionContext) _Product(ctx context.Context, sel ast.SelectionSet, obj *model.Product) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, productImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Product") + case "id": + out.Values[i] = ec._Product_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "region": + out.Values[i] = ec._Product_region(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "info": + out.Values[i] = ec._Product_info(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var queryImplementors = []string{"Query"} + +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "_entities": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__entities(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "_service": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__service(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "__type": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) + case "__schema": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var warehouseImplementors = []string{"Warehouse", "_Entity"} + +func (ec *executionContext) _Warehouse(ctx context.Context, sel ast.SelectionSet, obj *model.Warehouse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, warehouseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Warehouse") + case "location": + out.Values[i] = ec._Warehouse_location(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "capacity": + out.Values[i] = ec._Warehouse_capacity(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var _ServiceImplementors = []string{"_Service"} + +func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("_Service") + case "sdl": + out.Values[i] = ec.__Service_sdl(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __DirectiveImplementors = []string{"__Directive"} + +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "isRepeatable": + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __EnumValueImplementors = []string{"__EnumValue"} + +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __FieldImplementors = []string{"__Field"} + +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __InputValueImplementors = []string{"__InputValue"} + +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___InputValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___InputValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __SchemaImplementors = []string{"__Schema"} + +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Schema") + case "description": + out.Values[i] = ec.___Schema_description(ctx, field, obj) + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __TypeImplementors = []string{"__Type"} + +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "specifiedByURL": + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + case "isOneOf": + out.Values[i] = ec.___Type_isOneOf(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +// endregion **************************** object.gotpl **************************** + +// region ***************************** type.gotpl ***************************** + +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNFieldSet2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v any) (float64, error) { + res, err := graphql.UnmarshalFloatContext(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { + _ = sel + res := graphql.MarshalFloatContext(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return graphql.WrapContextMarshaler(ctx, res) +} + +func (ec *executionContext) unmarshalNID2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalID(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalID(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v any) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { + _ = sel + res := graphql.MarshalInt(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNItem2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋdetailsᚋsubgraphᚋmodelᚐItem(ctx context.Context, sel ast.SelectionSet, v model.Item) graphql.Marshaler { + return ec._Item(ctx, sel, &v) +} + +func (ec *executionContext) marshalNItem2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋdetailsᚋsubgraphᚋmodelᚐItem(ctx context.Context, sel ast.SelectionSet, v *model.Item) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Item(ctx, sel, v) +} + +func (ec *executionContext) marshalNLocation2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋdetailsᚋsubgraphᚋmodelᚐLocation(ctx context.Context, sel ast.SelectionSet, v *model.Location) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Location(ctx, sel, v) +} + +func (ec *executionContext) marshalNProduct2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋdetailsᚋsubgraphᚋmodelᚐProduct(ctx context.Context, sel ast.SelectionSet, v model.Product) graphql.Marshaler { + return ec._Product(ctx, sel, &v) +} + +func (ec *executionContext) marshalNProduct2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋdetailsᚋsubgraphᚋmodelᚐProduct(ctx context.Context, sel ast.SelectionSet, v *model.Product) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Product(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNString2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNWarehouse2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋdetailsᚋsubgraphᚋmodelᚐWarehouse(ctx context.Context, sel ast.SelectionSet, v model.Warehouse) graphql.Marshaler { + return ec._Warehouse(ctx, sel, &v) +} + +func (ec *executionContext) marshalNWarehouse2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋdetailsᚋsubgraphᚋmodelᚐWarehouse(ctx context.Context, sel ast.SelectionSet, v *model.Warehouse) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Warehouse(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v any) (map[string]any, error) { + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]any) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + _ = sel + res := graphql.MarshalMap(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v any) ([]map[string]any, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]map[string]any, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN_Any2map(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN_Any2ᚕmapᚄ(ctx context.Context, sel ast.SelectionSet, v []map[string]any) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalN_Any2map(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v []fedruntime.Entity) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { + return ec.__Service(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { + return ec.___Directive(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { + return ec.___EnumValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { + return ec.___Field(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { + return ec.___InputValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { + return ec.___Type(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Policy2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Scope2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalBoolean(v) + return res +} + +func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v any) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalBoolean(*v) + return res +} + +func (ec *executionContext) unmarshalOString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalString(v) + return res +} + +func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + if v == nil { + return nil, nil + } + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v any) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalString(*v) + return res +} + +func (ec *executionContext) marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v fedruntime.Entity) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.__Entity(ctx, sel, v) +} + +func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Schema(ctx, sel, v) +} + +func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +// endregion ***************************** type.gotpl ***************************** diff --git a/router-tests/entity_caching/subgraphs/details/subgraph/generated/staticcheck.conf b/router-tests/entity_caching/subgraphs/details/subgraph/generated/staticcheck.conf new file mode 100644 index 0000000000..582953a07e --- /dev/null +++ b/router-tests/entity_caching/subgraphs/details/subgraph/generated/staticcheck.conf @@ -0,0 +1,2 @@ +# This is meant as a workaround to skip staticcheck checks for generated code +checks = ["all", "-SA4004", "-ST1000"] diff --git a/router-tests/entity_caching/subgraphs/details/subgraph/model/models_gen.go b/router-tests/entity_caching/subgraphs/details/subgraph/model/models_gen.go new file mode 100644 index 0000000000..37c4142d26 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/details/subgraph/model/models_gen.go @@ -0,0 +1,34 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package model + +type Item struct { + ID string `json:"id"` + Description string `json:"description"` + Rating float64 `json:"rating"` + Tags []string `json:"tags"` +} + +func (Item) IsEntity() {} + +type Location struct { + ID string `json:"id"` +} + +type Product struct { + ID string `json:"id"` + Region string `json:"region"` + Info string `json:"info"` +} + +func (Product) IsEntity() {} + +type Query struct { +} + +type Warehouse struct { + Location *Location `json:"location"` + Capacity int `json:"capacity"` +} + +func (Warehouse) IsEntity() {} diff --git a/router-tests/entity_caching/subgraphs/details/subgraph/resolver.go b/router-tests/entity_caching/subgraphs/details/subgraph/resolver.go new file mode 100644 index 0000000000..c1da1a4335 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/details/subgraph/resolver.go @@ -0,0 +1,7 @@ +package subgraph + +// This file will not be regenerated automatically. +// +// It serves as dependency injection for your app, add any dependencies you require here. + +type Resolver struct{} diff --git a/router-tests/entity_caching/subgraphs/details/subgraph/schema.graphqls b/router-tests/entity_caching/subgraphs/details/subgraph/schema.graphqls new file mode 100644 index 0000000000..4d54164b0c --- /dev/null +++ b/router-tests/entity_caching/subgraphs/details/subgraph/schema.graphqls @@ -0,0 +1,34 @@ +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key"] + ) + +directive @openfed__entityCache( + maxAge: Int! + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT + +type Item @key(fields: "id") @openfed__entityCache(maxAge: 300) { + id: ID! + description: String! + rating: Float! + tags: [String!]! +} + +type Product @key(fields: "id region") @openfed__entityCache(maxAge: 300) { + id: ID! + region: String! + info: String! +} + +type Location { + id: ID! +} + +type Warehouse @key(fields: "location { id }") @openfed__entityCache(maxAge: 300) { + location: Location! + capacity: Int! +} diff --git a/router-tests/entity_caching/subgraphs/inventory/generate.go b/router-tests/entity_caching/subgraphs/inventory/generate.go new file mode 100644 index 0000000000..af1dc70b37 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/inventory/generate.go @@ -0,0 +1,3 @@ +//go:generate go run github.com/99designs/gqlgen generate + +package inventory diff --git a/router-tests/entity_caching/subgraphs/inventory/gqlgen.yml b/router-tests/entity_caching/subgraphs/inventory/gqlgen.yml new file mode 100644 index 0000000000..2d7a8e4a30 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/inventory/gqlgen.yml @@ -0,0 +1,39 @@ +schema: + - subgraph/*.graphqls + +exec: + filename: subgraph/generated/generated.go + package: generated + +federation: + filename: subgraph/generated/federation.go + package: generated + version: 2 + options: + explicit_requires: true + +model: + filename: subgraph/model/models_gen.go + package: model + +resolver: + layout: follow-schema + dir: subgraph + package: subgraph + +directives: + entityCache: + skip_runtime: true + +models: + ID: + model: + - github.com/99designs/gqlgen/graphql.ID + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + Int: + model: + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 diff --git a/router-tests/entity_caching/subgraphs/inventory/inventory.go b/router-tests/entity_caching/subgraphs/inventory/inventory.go new file mode 100644 index 0000000000..bdc34cbbc4 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/inventory/inventory.go @@ -0,0 +1,14 @@ +package inventory + +import ( + "github.com/99designs/gqlgen/graphql" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/inventory/subgraph" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/inventory/subgraph/generated" +) + +func NewSchema() graphql.ExecutableSchema { + return generated.NewExecutableSchema(generated.Config{ + Resolvers: &subgraph.Resolver{}, + }) +} diff --git a/router-tests/entity_caching/subgraphs/inventory/subgraph/data.go b/router-tests/entity_caching/subgraphs/inventory/subgraph/data.go new file mode 100644 index 0000000000..3cc260e1c4 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/inventory/subgraph/data.go @@ -0,0 +1,13 @@ +package subgraph + +import ( + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/inventory/subgraph/model" +) + +var ItemInventory = map[string]*model.Item{ + "1": {ID: "1", Available: true, Count: 100}, + "2": {ID: "2", Available: true, Count: 50}, + "3": {ID: "3", Available: false, Count: 0}, + "4": {ID: "4", Available: true, Count: 25}, + "5": {ID: "5", Available: true, Count: 10}, +} diff --git a/router-tests/entity_caching/subgraphs/inventory/subgraph/entity.resolvers.go b/router-tests/entity_caching/subgraphs/inventory/subgraph/entity.resolvers.go new file mode 100644 index 0000000000..e1c5d77126 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/inventory/subgraph/entity.resolvers.go @@ -0,0 +1,25 @@ +package subgraph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.76 + +import ( + "context" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/inventory/subgraph/generated" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/inventory/subgraph/model" +) + +// FindItemByID is the resolver for the findItemByID field. +func (r *entityResolver) FindItemByID(ctx context.Context, id string) (*model.Item, error) { + if item, ok := ItemInventory[id]; ok { + return item, nil + } + return nil, nil +} + +// Entity returns generated.EntityResolver implementation. +func (r *Resolver) Entity() generated.EntityResolver { return &entityResolver{r} } + +type entityResolver struct{ *Resolver } diff --git a/router-tests/entity_caching/subgraphs/inventory/subgraph/generated/federation.go b/router-tests/entity_caching/subgraphs/inventory/subgraph/generated/federation.go new file mode 100644 index 0000000000..61f57e902f --- /dev/null +++ b/router-tests/entity_caching/subgraphs/inventory/subgraph/generated/federation.go @@ -0,0 +1,235 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. +//lint:file-ignore SA4004 gqlgen-generated federation resolver + +package generated + +import ( + "context" + "errors" + "fmt" + "strings" + "sync" + + "github.com/99designs/gqlgen/plugin/federation/fedruntime" +) + +var ( + ErrUnknownType = errors.New("unknown type") + ErrTypeNotFound = errors.New("type not found") +) + +func (ec *executionContext) __resolve__service(ctx context.Context) (fedruntime.Service, error) { + if ec.DisableIntrospection { + return fedruntime.Service{}, errors.New("federated introspection disabled") + } + + var sdl []string + + for _, src := range sources { + if src.BuiltIn { + continue + } + sdl = append(sdl, src.Input) + } + + return fedruntime.Service{ + SDL: strings.Join(sdl, "\n"), + }, nil +} + +func (ec *executionContext) __resolve_entities(ctx context.Context, representations []map[string]any) []fedruntime.Entity { + list := make([]fedruntime.Entity, len(representations)) + + repsMap := ec.buildRepresentationGroups(ctx, representations) + + switch len(repsMap) { + case 0: + return list + case 1: + for typeName, reps := range repsMap { + ec.resolveEntityGroup(ctx, typeName, reps, list) + } + return list + default: + var g sync.WaitGroup + g.Add(len(repsMap)) + for typeName, reps := range repsMap { + go func(typeName string, reps []EntityWithIndex) { + ec.resolveEntityGroup(ctx, typeName, reps, list) + g.Done() + }(typeName, reps) + } + g.Wait() + return list + } +} + +type EntityWithIndex struct { + // The index in the original representation array + index int + entity EntityRepresentation +} + +// EntityRepresentation is the JSON representation of an entity sent by the Router +// used as the inputs for us to resolve. +// +// We make it a map because we know the top level JSON is always an object. +type EntityRepresentation map[string]any + +// We group entities by typename so that we can parallelize their resolution. +// This is particularly helpful when there are entity groups in multi mode. +func (ec *executionContext) buildRepresentationGroups( + ctx context.Context, + representations []map[string]any, +) map[string][]EntityWithIndex { + repsMap := make(map[string][]EntityWithIndex) + for i, rep := range representations { + typeName, ok := rep["__typename"].(string) + if !ok { + // If there is no __typename, we just skip the representation; + // we just won't be resolving these unknown types. + ec.Error(ctx, errors.New("__typename must be an existing string")) + continue + } + + repsMap[typeName] = append(repsMap[typeName], EntityWithIndex{ + index: i, + entity: rep, + }) + } + + return repsMap +} + +func (ec *executionContext) resolveEntityGroup( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) { + if isMulti(typeName) { + err := ec.resolveManyEntities(ctx, typeName, reps, list) + if err != nil { + ec.Error(ctx, err) + } + } else { + // if there are multiple entities to resolve, parallelize (similar to + // graphql.FieldSet.Dispatch) + var e sync.WaitGroup + e.Add(len(reps)) + for i, rep := range reps { + i, rep := i, rep + go func(i int, rep EntityWithIndex) { + entity, err := ec.resolveEntity(ctx, typeName, rep.entity) + if err != nil { + ec.Error(ctx, err) + } else { + list[rep.index] = entity + } + e.Done() + }(i, rep) + } + e.Wait() + } +} + +func isMulti(typeName string) bool { + switch typeName { + default: + return false + } +} + +func (ec *executionContext) resolveEntity( + ctx context.Context, + typeName string, + rep EntityRepresentation, +) (e fedruntime.Entity, err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + case "Item": + resolverName, err := entityResolverNameForItem(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Item": %w`, err) + } + switch resolverName { + + case "findItemByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findItemByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindItemByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Item": %w`, err) + } + + return entity, nil + } + + } + return nil, fmt.Errorf("%w: %s", ErrUnknownType, typeName) +} + +func (ec *executionContext) resolveManyEntities( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) (err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + + default: + return errors.New("unknown type: " + typeName) + } +} + +func entityResolverNameForItem(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Item", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Item", ErrTypeNotFound)) + break + } + return "findItemByID", nil + } + return "", fmt.Errorf("%w for Item due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} diff --git a/router-tests/entity_caching/subgraphs/inventory/subgraph/generated/generated.go b/router-tests/entity_caching/subgraphs/inventory/subgraph/generated/generated.go new file mode 100644 index 0000000000..ae67e267de --- /dev/null +++ b/router-tests/entity_caching/subgraphs/inventory/subgraph/generated/generated.go @@ -0,0 +1,4460 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "bytes" + "context" + "errors" + "fmt" + "strconv" + "sync" + "sync/atomic" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/introspection" + "github.com/99designs/gqlgen/plugin/federation/fedruntime" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/inventory/subgraph/model" +) + +// region ************************** generated!.gotpl ************************** + +// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. +func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { + return &executableSchema{ + schema: cfg.Schema, + resolvers: cfg.Resolvers, + directives: cfg.Directives, + complexity: cfg.Complexity, + } +} + +type Config struct { + Schema *ast.Schema + Resolvers ResolverRoot + Directives DirectiveRoot + Complexity ComplexityRoot +} + +type ResolverRoot interface { + Entity() EntityResolver +} + +type DirectiveRoot struct { +} + +type ComplexityRoot struct { + Entity struct { + FindItemByID func(childComplexity int, id string) int + } + + Item struct { + Available func(childComplexity int) int + Count func(childComplexity int) int + ID func(childComplexity int) int + } + + Query struct { + __resolve__service func(childComplexity int) int + __resolve_entities func(childComplexity int, representations []map[string]any) int + } + + _Service struct { + SDL func(childComplexity int) int + } +} + +type EntityResolver interface { + FindItemByID(ctx context.Context, id string) (*model.Item, error) +} + +type executableSchema struct { + schema *ast.Schema + resolvers ResolverRoot + directives DirectiveRoot + complexity ComplexityRoot +} + +func (e *executableSchema) Schema() *ast.Schema { + if e.schema != nil { + return e.schema + } + return parsedSchema +} + +func (e *executableSchema) Complexity(ctx context.Context, typeName, field string, childComplexity int, rawArgs map[string]any) (int, bool) { + ec := executionContext{nil, e, 0, 0, nil} + _ = ec + switch typeName + "." + field { + + case "Entity.findItemByID": + if e.complexity.Entity.FindItemByID == nil { + break + } + + args, err := ec.field_Entity_findItemByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindItemByID(childComplexity, args["id"].(string)), true + + case "Item.available": + if e.complexity.Item.Available == nil { + break + } + + return e.complexity.Item.Available(childComplexity), true + + case "Item.count": + if e.complexity.Item.Count == nil { + break + } + + return e.complexity.Item.Count(childComplexity), true + + case "Item.id": + if e.complexity.Item.ID == nil { + break + } + + return e.complexity.Item.ID(childComplexity), true + + case "Query._service": + if e.complexity.Query.__resolve__service == nil { + break + } + + return e.complexity.Query.__resolve__service(childComplexity), true + + case "Query._entities": + if e.complexity.Query.__resolve_entities == nil { + break + } + + args, err := ec.field_Query__entities_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.__resolve_entities(childComplexity, args["representations"].([]map[string]any)), true + + case "_Service.sdl": + if e.complexity._Service.SDL == nil { + break + } + + return e.complexity._Service.SDL(childComplexity), true + + } + return 0, false +} + +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + opCtx := graphql.GetOperationContext(ctx) + ec := executionContext{opCtx, e, 0, 0, make(chan graphql.DeferredResult)} + inputUnmarshalMap := graphql.BuildUnmarshalerMap() + first := true + + switch opCtx.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + var response graphql.Response + var data graphql.Marshaler + if first { + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data = ec._Query(ctx, opCtx.Operation.SelectionSet) + } else { + if atomic.LoadInt32(&ec.pendingDeferred) > 0 { + result := <-ec.deferredResults + atomic.AddInt32(&ec.pendingDeferred, -1) + data = result.Result + response.Path = result.Path + response.Label = result.Label + response.Errors = result.Errors + } else { + return nil + } + } + var buf bytes.Buffer + data.MarshalGQL(&buf) + response.Data = buf.Bytes() + if atomic.LoadInt32(&ec.deferred) > 0 { + hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 + response.HasNext = &hasNext + } + + return &response + } + + default: + return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) + } +} + +type executionContext struct { + *graphql.OperationContext + *executableSchema + deferred int32 + pendingDeferred int32 + deferredResults chan graphql.DeferredResult +} + +func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) { + atomic.AddInt32(&ec.pendingDeferred, 1) + go func() { + ctx := graphql.WithFreshResponseContext(dg.Context) + dg.FieldSet.Dispatch(ctx) + ds := graphql.DeferredResult{ + Path: dg.Path, + Label: dg.Label, + Result: dg.FieldSet, + Errors: graphql.GetErrors(ctx), + } + // null fields should bubble up + if dg.FieldSet.Invalids > 0 { + ds.Result = graphql.Null + } + ec.deferredResults <- ds + }() +} + +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(ec.Schema()), nil +} + +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil +} + +var sources = []*ast.Source{ + {Name: "../schema.graphqls", Input: `extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key"] + ) + +directive @entityCache( + maxAge: Int! + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT + +type Item @key(fields: "id") @entityCache(maxAge: 300) { + id: ID! + available: Boolean! + count: Int! +} +`, BuiltIn: false}, + {Name: "../../federation/directives.graphql", Input: ` + directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM + directive @composeDirective(name: String!) repeatable on SCHEMA + directive @extends on OBJECT | INTERFACE + directive @external on OBJECT | FIELD_DEFINITION + directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE + directive @inaccessible on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + directive @interfaceObject on OBJECT + directive @link(import: [String!], url: String!) repeatable on SCHEMA + directive @override(from: String!, label: String) on FIELD_DEFINITION + directive @policy(policies: [[federation__Policy!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @provides(fields: FieldSet!) on FIELD_DEFINITION + directive @requires(fields: FieldSet!) on FIELD_DEFINITION + directive @requiresScopes(scopes: [[federation__Scope!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @shareable repeatable on FIELD_DEFINITION | OBJECT + directive @tag(name: String!) repeatable on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + scalar _Any + scalar FieldSet + scalar federation__Policy + scalar federation__Scope +`, BuiltIn: true}, + {Name: "../../federation/entity.graphql", Input: ` +# a union of all types that use the @key directive +union _Entity = Item + +# fake type to build resolver interfaces for users to implement +type Entity { + findItemByID(id: ID!,): Item! +} + +type _Service { + sdl: String +} + +extend type Query { + _entities(representations: [_Any!]!): [_Entity]! + _service: _Service! +} +`, BuiltIn: true}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Entity_findItemByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findItemByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findItemByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query___type_argsName(ctx, rawArgs) + if err != nil { + return nil, err + } + args["name"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query___type_argsName( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["name"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["name"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query__entities_argsRepresentations(ctx, rawArgs) + if err != nil { + return nil, err + } + args["representations"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query__entities_argsRepresentations( + ctx context.Context, + rawArgs map[string]any, +) ([]map[string]any, error) { + if _, ok := rawArgs["representations"]; !ok { + var zeroVal []map[string]any + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) + if tmp, ok := rawArgs["representations"]; ok { + return ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) + } + + var zeroVal []map[string]any + return zeroVal, nil +} + +func (ec *executionContext) field___Directive_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Directive_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Directive_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Field_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Field_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Field_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_enumValues_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_enumValues_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_fields_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_fields_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _Entity_findItemByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findItemByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindItemByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Item) + fc.Result = res + return ec.marshalNItem2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋinventoryᚋsubgraphᚋmodelᚐItem(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findItemByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Item_id(ctx, field) + case "available": + return ec.fieldContext_Item_available(ctx, field) + case "count": + return ec.fieldContext_Item_count(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Item", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findItemByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Item_id(ctx context.Context, field graphql.CollectedField, obj *model.Item) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Item_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Item_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Item", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Item_available(ctx context.Context, field graphql.CollectedField, obj *model.Item) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Item_available(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Available, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Item_available(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Item", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Item_count(ctx context.Context, field graphql.CollectedField, obj *model.Item) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Item_count(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Count, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Item_count(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Item", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__entities(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve_entities(ctx, fc.Args["representations"].([]map[string]any)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]fedruntime.Entity) + fc.Result = res + return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__entities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type _Entity does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query__entities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__service(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve__service(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(fedruntime.Service) + fc.Result = res + return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__service(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "sdl": + return ec.fieldContext__Service_sdl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___schema(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext__Service_sdl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SDL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext__Service_sdl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "_Service", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsRepeatable, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Locations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __DirectiveLocation does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Directive_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Field_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_isOneOf(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_isOneOf(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsOneOf(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_isOneOf(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, obj fedruntime.Entity) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case model.Item: + return ec._Item(ctx, sel, &obj) + case *model.Item: + if obj == nil { + return graphql.Null + } + return ec._Item(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var entityImplementors = []string{"Entity"} + +func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Entity", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Entity") + case "findItemByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findItemByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var itemImplementors = []string{"Item", "_Entity"} + +func (ec *executionContext) _Item(ctx context.Context, sel ast.SelectionSet, obj *model.Item) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, itemImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Item") + case "id": + out.Values[i] = ec._Item_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "available": + out.Values[i] = ec._Item_available(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "count": + out.Values[i] = ec._Item_count(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var queryImplementors = []string{"Query"} + +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "_entities": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__entities(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "_service": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__service(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "__type": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) + case "__schema": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var _ServiceImplementors = []string{"_Service"} + +func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("_Service") + case "sdl": + out.Values[i] = ec.__Service_sdl(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __DirectiveImplementors = []string{"__Directive"} + +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "isRepeatable": + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __EnumValueImplementors = []string{"__EnumValue"} + +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __FieldImplementors = []string{"__Field"} + +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __InputValueImplementors = []string{"__InputValue"} + +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___InputValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___InputValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __SchemaImplementors = []string{"__Schema"} + +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Schema") + case "description": + out.Values[i] = ec.___Schema_description(ctx, field, obj) + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __TypeImplementors = []string{"__Type"} + +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "specifiedByURL": + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + case "isOneOf": + out.Values[i] = ec.___Type_isOneOf(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +// endregion **************************** object.gotpl **************************** + +// region ***************************** type.gotpl ***************************** + +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNFieldSet2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNID2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalID(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalID(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v any) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { + _ = sel + res := graphql.MarshalInt(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNItem2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋinventoryᚋsubgraphᚋmodelᚐItem(ctx context.Context, sel ast.SelectionSet, v model.Item) graphql.Marshaler { + return ec._Item(ctx, sel, &v) +} + +func (ec *executionContext) marshalNItem2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋinventoryᚋsubgraphᚋmodelᚐItem(ctx context.Context, sel ast.SelectionSet, v *model.Item) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Item(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v any) (map[string]any, error) { + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]any) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + _ = sel + res := graphql.MarshalMap(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v any) ([]map[string]any, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]map[string]any, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN_Any2map(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN_Any2ᚕmapᚄ(ctx context.Context, sel ast.SelectionSet, v []map[string]any) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalN_Any2map(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v []fedruntime.Entity) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { + return ec.__Service(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { + return ec.___Directive(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { + return ec.___EnumValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { + return ec.___Field(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { + return ec.___InputValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { + return ec.___Type(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Policy2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Scope2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalBoolean(v) + return res +} + +func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v any) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalBoolean(*v) + return res +} + +func (ec *executionContext) unmarshalOString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalString(v) + return res +} + +func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + if v == nil { + return nil, nil + } + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v any) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalString(*v) + return res +} + +func (ec *executionContext) marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v fedruntime.Entity) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.__Entity(ctx, sel, v) +} + +func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Schema(ctx, sel, v) +} + +func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +// endregion ***************************** type.gotpl ***************************** diff --git a/router-tests/entity_caching/subgraphs/inventory/subgraph/model/models_gen.go b/router-tests/entity_caching/subgraphs/inventory/subgraph/model/models_gen.go new file mode 100644 index 0000000000..1d6357e34c --- /dev/null +++ b/router-tests/entity_caching/subgraphs/inventory/subgraph/model/models_gen.go @@ -0,0 +1,14 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package model + +type Item struct { + ID string `json:"id"` + Available bool `json:"available"` + Count int `json:"count"` +} + +func (Item) IsEntity() {} + +type Query struct { +} diff --git a/router-tests/entity_caching/subgraphs/inventory/subgraph/resolver.go b/router-tests/entity_caching/subgraphs/inventory/subgraph/resolver.go new file mode 100644 index 0000000000..c1da1a4335 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/inventory/subgraph/resolver.go @@ -0,0 +1,7 @@ +package subgraph + +// This file will not be regenerated automatically. +// +// It serves as dependency injection for your app, add any dependencies you require here. + +type Resolver struct{} diff --git a/router-tests/entity_caching/subgraphs/inventory/subgraph/schema.graphqls b/router-tests/entity_caching/subgraphs/inventory/subgraph/schema.graphqls new file mode 100644 index 0000000000..23b424d859 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/inventory/subgraph/schema.graphqls @@ -0,0 +1,18 @@ +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key"] + ) + +directive @openfed__entityCache( + maxAge: Int! + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT + +type Item @key(fields: "id") @openfed__entityCache(maxAge: 300) { + id: ID! + available: Boolean! + count: Int! +} diff --git a/router-tests/entity_caching/subgraphs/items/generate.go b/router-tests/entity_caching/subgraphs/items/generate.go new file mode 100644 index 0000000000..89d17e5530 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/items/generate.go @@ -0,0 +1,3 @@ +//go:generate go run github.com/99designs/gqlgen generate + +package items diff --git a/router-tests/entity_caching/subgraphs/items/gqlgen.yml b/router-tests/entity_caching/subgraphs/items/gqlgen.yml new file mode 100644 index 0000000000..d458fc22fd --- /dev/null +++ b/router-tests/entity_caching/subgraphs/items/gqlgen.yml @@ -0,0 +1,47 @@ +schema: + - subgraph/*.graphqls + +exec: + filename: subgraph/generated/generated.go + package: generated + +federation: + filename: subgraph/generated/federation.go + package: generated + version: 2 + options: + explicit_requires: true + +model: + filename: subgraph/model/models_gen.go + package: model + +resolver: + layout: follow-schema + dir: subgraph + package: subgraph + +directives: + entityCache: + skip_runtime: true + queryCache: + skip_runtime: true + cacheInvalidate: + skip_runtime: true + cachePopulate: + skip_runtime: true + is: + skip_runtime: true + +models: + ID: + model: + - github.com/99designs/gqlgen/graphql.ID + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + Int: + model: + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 diff --git a/router-tests/entity_caching/subgraphs/items/items.go b/router-tests/entity_caching/subgraphs/items/items.go new file mode 100644 index 0000000000..b3e5911740 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/items/items.go @@ -0,0 +1,15 @@ +package items + +import ( + "github.com/99designs/gqlgen/graphql" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/items/subgraph" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/items/subgraph/generated" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/items/subgraph/model" +) + +func NewSchema(itemUpdatedCh chan *model.Item, itemCreatedCh chan *model.Item) graphql.ExecutableSchema { + return generated.NewExecutableSchema(generated.Config{ + Resolvers: subgraph.NewResolver(itemUpdatedCh, itemCreatedCh), + }) +} diff --git a/router-tests/entity_caching/subgraphs/items/subgraph/data.go b/router-tests/entity_caching/subgraphs/items/subgraph/data.go new file mode 100644 index 0000000000..3dbd6faee2 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/items/subgraph/data.go @@ -0,0 +1,140 @@ +package subgraph + +import ( + "fmt" + "sync" + "sync/atomic" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/items/subgraph/model" +) + +var nextID atomic.Int64 + +func init() { + nextID.Store(5) +} + +// defaultItems is the seed data for a fresh item store. Each Resolver clones +// this into its own store so mutations are isolated between parallel tests. +var defaultItems = []*model.Item{ + {ID: "1", Name: "Widget", Category: "tools"}, + {ID: "2", Name: "Gadget", Category: "electronics"}, + {ID: "3", Name: "Gizmo", Category: "electronics"}, + {ID: "4", Name: "Doohickey", Category: "misc"}, + {ID: "5", Name: "Thingamajig", Category: "misc"}, +} + +// Items is kept for backward compatibility with any external readers. It is a +// snapshot of the seed data and MUST NOT be mutated. Tests mutate the per- +// resolver store via itemStore. +var Items = cloneItems(defaultItems) + +var Products = []*model.Product{ + {ID: "p1", Region: "US", Sku: "SKU-001", Name: "Alpha"}, + {ID: "p2", Region: "US", Sku: "SKU-002", Name: "Beta"}, + {ID: "p3", Region: "EU", Sku: "SKU-003", Name: "Gamma"}, + {ID: "p4", Region: "EU", Sku: "SKU-004", Name: "Delta"}, +} + +var Warehouses = []*model.Warehouse{ + {Location: &model.Location{ID: "w1"}, Name: "Main Depot"}, + {Location: &model.Location{ID: "w2"}, Name: "East Hub"}, + {Location: &model.Location{ID: "w3"}, Name: "West Hub"}, +} + +// itemStore is a per-resolver mutable Item store. Tests create one per +// subgraph server so mutations in one test don't affect parallel tests. +type itemStore struct { + mu sync.RWMutex + items []*model.Item +} + +func newItemStore() *itemStore { + return &itemStore{items: cloneItems(defaultItems)} +} + +func (s *itemStore) all() []*model.Item { + s.mu.RLock() + defer s.mu.RUnlock() + return cloneItems(s.items) +} + +func (s *itemStore) find(id string) *model.Item { + s.mu.RLock() + defer s.mu.RUnlock() + for _, it := range s.items { + if it.ID == id { + return cloneItem(it) + } + } + return nil +} + +func (s *itemStore) byIDs(ids []string) []*model.Item { + s.mu.RLock() + defer s.mu.RUnlock() + var out []*model.Item + for _, id := range ids { + for _, it := range s.items { + if it.ID == id { + out = append(out, cloneItem(it)) + break + } + } + } + return out +} + +func (s *itemStore) update(id, name string) (*model.Item, bool) { + s.mu.Lock() + defer s.mu.Unlock() + for _, it := range s.items { + if it.ID == id { + it.Name = name + return cloneItem(it), true + } + } + return nil, false +} + +func (s *itemStore) delete(id string) (*model.Item, bool) { + s.mu.Lock() + defer s.mu.Unlock() + for i, it := range s.items { + if it.ID == id { + removed := cloneItem(it) + s.items = append(s.items[:i], s.items[i+1:]...) + return removed, true + } + } + return nil, false +} + +func (s *itemStore) create(name, category string) *model.Item { + id := atomicNextID() + s.mu.Lock() + defer s.mu.Unlock() + it := &model.Item{ID: id, Name: name, Category: category} + s.items = append(s.items, it) + return cloneItem(it) +} + +func atomicNextID() string { + return fmt.Sprintf("%d", nextID.Add(1)) +} + +func cloneItem(it *model.Item) *model.Item { + if it == nil { + return nil + } + c := *it + return &c +} + +func cloneItems(in []*model.Item) []*model.Item { + out := make([]*model.Item, len(in)) + for i, it := range in { + out[i] = cloneItem(it) + } + return out +} diff --git a/router-tests/entity_caching/subgraphs/items/subgraph/entity.resolvers.go b/router-tests/entity_caching/subgraphs/items/subgraph/entity.resolvers.go new file mode 100644 index 0000000000..b72f51d82b --- /dev/null +++ b/router-tests/entity_caching/subgraphs/items/subgraph/entity.resolvers.go @@ -0,0 +1,52 @@ +package subgraph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.76 + +import ( + "context" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/items/subgraph/generated" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/items/subgraph/model" +) + +// FindItemByID is the resolver for the findItemByID field. +func (r *entityResolver) FindItemByID(ctx context.Context, id string) (*model.Item, error) { + return r.Store.find(id), nil +} + +// FindProductByIDAndRegion is the resolver for the findProductByIDAndRegion field. +func (r *entityResolver) FindProductByIDAndRegion(ctx context.Context, id string, region string) (*model.Product, error) { + for _, p := range Products { + if p.ID == id && p.Region == region { + return p, nil + } + } + return nil, nil +} + +// FindProductBySku is the resolver for the findProductBySku field. +func (r *entityResolver) FindProductBySku(ctx context.Context, sku string) (*model.Product, error) { + for _, p := range Products { + if p.Sku == sku { + return p, nil + } + } + return nil, nil +} + +// FindWarehouseByLocationID is the resolver for the findWarehouseByLocationID field. +func (r *entityResolver) FindWarehouseByLocationID(ctx context.Context, locationID string) (*model.Warehouse, error) { + for _, w := range Warehouses { + if w.Location.ID == locationID { + return w, nil + } + } + return nil, nil +} + +// Entity returns generated.EntityResolver implementation. +func (r *Resolver) Entity() generated.EntityResolver { return &entityResolver{r} } + +type entityResolver struct{ *Resolver } diff --git a/router-tests/entity_caching/subgraphs/items/subgraph/generated/federation.go b/router-tests/entity_caching/subgraphs/items/subgraph/generated/federation.go new file mode 100644 index 0000000000..036c32b5dd --- /dev/null +++ b/router-tests/entity_caching/subgraphs/items/subgraph/generated/federation.go @@ -0,0 +1,406 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "strings" + "sync" + + "github.com/99designs/gqlgen/plugin/federation/fedruntime" +) + +var ( + ErrUnknownType = errors.New("unknown type") + ErrTypeNotFound = errors.New("type not found") +) + +func (ec *executionContext) __resolve__service(ctx context.Context) (fedruntime.Service, error) { + if ec.DisableIntrospection { + return fedruntime.Service{}, errors.New("federated introspection disabled") + } + + var sdl []string + + for _, src := range sources { + if src.BuiltIn { + continue + } + sdl = append(sdl, src.Input) + } + + return fedruntime.Service{ + SDL: strings.Join(sdl, "\n"), + }, nil +} + +func (ec *executionContext) __resolve_entities(ctx context.Context, representations []map[string]any) []fedruntime.Entity { + list := make([]fedruntime.Entity, len(representations)) + + repsMap := ec.buildRepresentationGroups(ctx, representations) + + switch len(repsMap) { + case 0: + return list + case 1: + for typeName, reps := range repsMap { + ec.resolveEntityGroup(ctx, typeName, reps, list) + } + return list + default: + var g sync.WaitGroup + g.Add(len(repsMap)) + for typeName, reps := range repsMap { + go func(typeName string, reps []EntityWithIndex) { + ec.resolveEntityGroup(ctx, typeName, reps, list) + g.Done() + }(typeName, reps) + } + g.Wait() + return list + } +} + +type EntityWithIndex struct { + // The index in the original representation array + index int + entity EntityRepresentation +} + +// EntityRepresentation is the JSON representation of an entity sent by the Router +// used as the inputs for us to resolve. +// +// We make it a map because we know the top level JSON is always an object. +type EntityRepresentation map[string]any + +// We group entities by typename so that we can parallelize their resolution. +// This is particularly helpful when there are entity groups in multi mode. +func (ec *executionContext) buildRepresentationGroups( + ctx context.Context, + representations []map[string]any, +) map[string][]EntityWithIndex { + repsMap := make(map[string][]EntityWithIndex) + for i, rep := range representations { + typeName, ok := rep["__typename"].(string) + if !ok { + // If there is no __typename, we just skip the representation; + // we just won't be resolving these unknown types. + ec.Error(ctx, errors.New("__typename must be an existing string")) + continue + } + + repsMap[typeName] = append(repsMap[typeName], EntityWithIndex{ + index: i, + entity: rep, + }) + } + + return repsMap +} + +func (ec *executionContext) resolveEntityGroup( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) { + if isMulti(typeName) { + err := ec.resolveManyEntities(ctx, typeName, reps, list) + if err != nil { + ec.Error(ctx, err) + } + } else { + // if there are multiple entities to resolve, parallelize (similar to + // graphql.FieldSet.Dispatch) + var e sync.WaitGroup + e.Add(len(reps)) + for i, rep := range reps { + i, rep := i, rep + go func(i int, rep EntityWithIndex) { + entity, err := ec.resolveEntity(ctx, typeName, rep.entity) + if err != nil { + ec.Error(ctx, err) + } else { + list[rep.index] = entity + } + e.Done() + }(i, rep) + } + e.Wait() + } +} + +func isMulti(typeName string) bool { + switch typeName { + default: + return false + } +} + +func (ec *executionContext) resolveEntity( + ctx context.Context, + typeName string, + rep EntityRepresentation, +) (e fedruntime.Entity, err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + case "Item": + resolverName, err := entityResolverNameForItem(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Item": %w`, err) + } + switch resolverName { + + case "findItemByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findItemByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindItemByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Item": %w`, err) + } + + return entity, nil + } + case "Product": + resolverName, err := entityResolverNameForProduct(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Product": %w`, err) + } + switch resolverName { + + case "findProductByIDAndRegion": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findProductByIDAndRegion(): %w`, err) + } + id1, err := ec.unmarshalNString2string(ctx, rep["region"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 1 for findProductByIDAndRegion(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindProductByIDAndRegion(ctx, id0, id1) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Product": %w`, err) + } + + return entity, nil + case "findProductBySku": + id0, err := ec.unmarshalNString2string(ctx, rep["sku"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findProductBySku(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindProductBySku(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Product": %w`, err) + } + + return entity, nil + } + case "Warehouse": + resolverName, err := entityResolverNameForWarehouse(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Warehouse": %w`, err) + } + switch resolverName { + + case "findWarehouseByLocationID": + id0, err := ec.unmarshalNID2string(ctx, rep["location"].(map[string]any)["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findWarehouseByLocationID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindWarehouseByLocationID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Warehouse": %w`, err) + } + + return entity, nil + } + + } + return nil, fmt.Errorf("%w: %s", ErrUnknownType, typeName) +} + +func (ec *executionContext) resolveManyEntities( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) (err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + + default: + return errors.New("unknown type: " + typeName) + } +} + +func entityResolverNameForItem(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Item", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Item", ErrTypeNotFound)) + break + } + return "findItemByID", nil + } + return "", fmt.Errorf("%w for Item due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForProduct(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Product", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + m = rep + val, ok = m["region"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"region\" for Product", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Product", ErrTypeNotFound)) + break + } + return "findProductByIDAndRegion", nil + } + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["sku"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"sku\" for Product", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Product", ErrTypeNotFound)) + break + } + return "findProductBySku", nil + } + return "", fmt.Errorf("%w for Product due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForWarehouse(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["location"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"location\" for Warehouse", ErrTypeNotFound)) + break + } + if m, ok = val.(map[string]any); !ok { + // nested field value is not a map[string]interface so don't use it + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to nested Key Field \"location\" value not matching map[string]any for Warehouse", ErrTypeNotFound)) + break + } + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Warehouse", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Warehouse", ErrTypeNotFound)) + break + } + return "findWarehouseByLocationID", nil + } + return "", fmt.Errorf("%w for Warehouse due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} diff --git a/router-tests/entity_caching/subgraphs/items/subgraph/generated/generated.go b/router-tests/entity_caching/subgraphs/items/subgraph/generated/generated.go new file mode 100644 index 0000000000..e1845710cb --- /dev/null +++ b/router-tests/entity_caching/subgraphs/items/subgraph/generated/generated.go @@ -0,0 +1,7691 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "bytes" + "context" + "errors" + "fmt" + "io" + "strconv" + "sync" + "sync/atomic" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/introspection" + "github.com/99designs/gqlgen/plugin/federation/fedruntime" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/items/subgraph/model" +) + +// region ************************** generated!.gotpl ************************** + +// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. +func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { + return &executableSchema{ + schema: cfg.Schema, + resolvers: cfg.Resolvers, + directives: cfg.Directives, + complexity: cfg.Complexity, + } +} + +type Config struct { + Schema *ast.Schema + Resolvers ResolverRoot + Directives DirectiveRoot + Complexity ComplexityRoot +} + +type ResolverRoot interface { + Entity() EntityResolver + Mutation() MutationResolver + Query() QueryResolver + Subscription() SubscriptionResolver +} + +type DirectiveRoot struct { +} + +type ComplexityRoot struct { + Entity struct { + FindItemByID func(childComplexity int, id string) int + FindProductByIDAndRegion func(childComplexity int, id string, region string) int + FindProductBySku func(childComplexity int, sku string) int + FindWarehouseByLocationID func(childComplexity int, locationID string) int + } + + Item struct { + Category func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + } + + Location struct { + ID func(childComplexity int) int + } + + Mutation struct { + CreateItem func(childComplexity int, name string, category string) int + DeleteItem func(childComplexity int, id string) int + DeleteProduct func(childComplexity int, id string, region string) int + UpdateItem func(childComplexity int, id string, name string) int + } + + Product struct { + ID func(childComplexity int) int + Name func(childComplexity int) int + Region func(childComplexity int) int + Sku func(childComplexity int) int + } + + Query struct { + Item func(childComplexity int, id string) int + ItemByPid func(childComplexity int, pid string) int + Items func(childComplexity int) int + ItemsByIds func(childComplexity int, ids []string) int + Product func(childComplexity int, id string, region string) int + ProductByKey func(childComplexity int, key model.ProductKeyInput) int + ProductByName func(childComplexity int, name string) int + ProductBySku func(childComplexity int, sku string) int + Warehouse func(childComplexity int, locationID string) int + WarehouseByInput func(childComplexity int, input model.WarehouseLocationInput) int + __resolve__service func(childComplexity int) int + __resolve_entities func(childComplexity int, representations []map[string]any) int + } + + Subscription struct { + ItemCreated func(childComplexity int) int + ItemUpdated func(childComplexity int) int + } + + Warehouse struct { + Location func(childComplexity int) int + Name func(childComplexity int) int + } + + _Service struct { + SDL func(childComplexity int) int + } +} + +type EntityResolver interface { + FindItemByID(ctx context.Context, id string) (*model.Item, error) + FindProductByIDAndRegion(ctx context.Context, id string, region string) (*model.Product, error) + FindProductBySku(ctx context.Context, sku string) (*model.Product, error) + FindWarehouseByLocationID(ctx context.Context, locationID string) (*model.Warehouse, error) +} +type MutationResolver interface { + UpdateItem(ctx context.Context, id string, name string) (*model.Item, error) + DeleteItem(ctx context.Context, id string) (*model.Item, error) + CreateItem(ctx context.Context, name string, category string) (*model.Item, error) + DeleteProduct(ctx context.Context, id string, region string) (*model.Product, error) +} +type QueryResolver interface { + Item(ctx context.Context, id string) (*model.Item, error) + ItemByPid(ctx context.Context, pid string) (*model.Item, error) + Items(ctx context.Context) ([]*model.Item, error) + ItemsByIds(ctx context.Context, ids []string) ([]*model.Item, error) + Product(ctx context.Context, id string, region string) (*model.Product, error) + ProductBySku(ctx context.Context, sku string) (*model.Product, error) + ProductByName(ctx context.Context, name string) (*model.Product, error) + ProductByKey(ctx context.Context, key model.ProductKeyInput) (*model.Product, error) + Warehouse(ctx context.Context, locationID string) (*model.Warehouse, error) + WarehouseByInput(ctx context.Context, input model.WarehouseLocationInput) (*model.Warehouse, error) +} +type SubscriptionResolver interface { + ItemUpdated(ctx context.Context) (<-chan *model.Item, error) + ItemCreated(ctx context.Context) (<-chan *model.Item, error) +} + +type executableSchema struct { + schema *ast.Schema + resolvers ResolverRoot + directives DirectiveRoot + complexity ComplexityRoot +} + +func (e *executableSchema) Schema() *ast.Schema { + if e.schema != nil { + return e.schema + } + return parsedSchema +} + +func (e *executableSchema) Complexity(ctx context.Context, typeName, field string, childComplexity int, rawArgs map[string]any) (int, bool) { + ec := executionContext{nil, e, 0, 0, nil} + _ = ec + switch typeName + "." + field { + + case "Entity.findItemByID": + if e.complexity.Entity.FindItemByID == nil { + break + } + + args, err := ec.field_Entity_findItemByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindItemByID(childComplexity, args["id"].(string)), true + + case "Entity.findProductByIDAndRegion": + if e.complexity.Entity.FindProductByIDAndRegion == nil { + break + } + + args, err := ec.field_Entity_findProductByIDAndRegion_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindProductByIDAndRegion(childComplexity, args["id"].(string), args["region"].(string)), true + + case "Entity.findProductBySku": + if e.complexity.Entity.FindProductBySku == nil { + break + } + + args, err := ec.field_Entity_findProductBySku_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindProductBySku(childComplexity, args["sku"].(string)), true + + case "Entity.findWarehouseByLocationID": + if e.complexity.Entity.FindWarehouseByLocationID == nil { + break + } + + args, err := ec.field_Entity_findWarehouseByLocationID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindWarehouseByLocationID(childComplexity, args["locationID"].(string)), true + + case "Item.category": + if e.complexity.Item.Category == nil { + break + } + + return e.complexity.Item.Category(childComplexity), true + + case "Item.id": + if e.complexity.Item.ID == nil { + break + } + + return e.complexity.Item.ID(childComplexity), true + + case "Item.name": + if e.complexity.Item.Name == nil { + break + } + + return e.complexity.Item.Name(childComplexity), true + + case "Location.id": + if e.complexity.Location.ID == nil { + break + } + + return e.complexity.Location.ID(childComplexity), true + + case "Mutation.createItem": + if e.complexity.Mutation.CreateItem == nil { + break + } + + args, err := ec.field_Mutation_createItem_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateItem(childComplexity, args["name"].(string), args["category"].(string)), true + + case "Mutation.deleteItem": + if e.complexity.Mutation.DeleteItem == nil { + break + } + + args, err := ec.field_Mutation_deleteItem_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteItem(childComplexity, args["id"].(string)), true + + case "Mutation.deleteProduct": + if e.complexity.Mutation.DeleteProduct == nil { + break + } + + args, err := ec.field_Mutation_deleteProduct_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteProduct(childComplexity, args["id"].(string), args["region"].(string)), true + + case "Mutation.updateItem": + if e.complexity.Mutation.UpdateItem == nil { + break + } + + args, err := ec.field_Mutation_updateItem_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateItem(childComplexity, args["id"].(string), args["name"].(string)), true + + case "Product.id": + if e.complexity.Product.ID == nil { + break + } + + return e.complexity.Product.ID(childComplexity), true + + case "Product.name": + if e.complexity.Product.Name == nil { + break + } + + return e.complexity.Product.Name(childComplexity), true + + case "Product.region": + if e.complexity.Product.Region == nil { + break + } + + return e.complexity.Product.Region(childComplexity), true + + case "Product.sku": + if e.complexity.Product.Sku == nil { + break + } + + return e.complexity.Product.Sku(childComplexity), true + + case "Query.item": + if e.complexity.Query.Item == nil { + break + } + + args, err := ec.field_Query_item_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Item(childComplexity, args["id"].(string)), true + + case "Query.itemByPid": + if e.complexity.Query.ItemByPid == nil { + break + } + + args, err := ec.field_Query_itemByPid_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.ItemByPid(childComplexity, args["pid"].(string)), true + + case "Query.items": + if e.complexity.Query.Items == nil { + break + } + + return e.complexity.Query.Items(childComplexity), true + + case "Query.itemsByIds": + if e.complexity.Query.ItemsByIds == nil { + break + } + + args, err := ec.field_Query_itemsByIds_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.ItemsByIds(childComplexity, args["ids"].([]string)), true + + case "Query.product": + if e.complexity.Query.Product == nil { + break + } + + args, err := ec.field_Query_product_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Product(childComplexity, args["id"].(string), args["region"].(string)), true + + case "Query.productByKey": + if e.complexity.Query.ProductByKey == nil { + break + } + + args, err := ec.field_Query_productByKey_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.ProductByKey(childComplexity, args["key"].(model.ProductKeyInput)), true + + case "Query.productByName": + if e.complexity.Query.ProductByName == nil { + break + } + + args, err := ec.field_Query_productByName_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.ProductByName(childComplexity, args["name"].(string)), true + + case "Query.productBySku": + if e.complexity.Query.ProductBySku == nil { + break + } + + args, err := ec.field_Query_productBySku_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.ProductBySku(childComplexity, args["sku"].(string)), true + + case "Query.warehouse": + if e.complexity.Query.Warehouse == nil { + break + } + + args, err := ec.field_Query_warehouse_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Warehouse(childComplexity, args["locationId"].(string)), true + + case "Query.warehouseByInput": + if e.complexity.Query.WarehouseByInput == nil { + break + } + + args, err := ec.field_Query_warehouseByInput_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.WarehouseByInput(childComplexity, args["input"].(model.WarehouseLocationInput)), true + + case "Query._service": + if e.complexity.Query.__resolve__service == nil { + break + } + + return e.complexity.Query.__resolve__service(childComplexity), true + + case "Query._entities": + if e.complexity.Query.__resolve_entities == nil { + break + } + + args, err := ec.field_Query__entities_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.__resolve_entities(childComplexity, args["representations"].([]map[string]any)), true + + case "Subscription.itemCreated": + if e.complexity.Subscription.ItemCreated == nil { + break + } + + return e.complexity.Subscription.ItemCreated(childComplexity), true + + case "Subscription.itemUpdated": + if e.complexity.Subscription.ItemUpdated == nil { + break + } + + return e.complexity.Subscription.ItemUpdated(childComplexity), true + + case "Warehouse.location": + if e.complexity.Warehouse.Location == nil { + break + } + + return e.complexity.Warehouse.Location(childComplexity), true + + case "Warehouse.name": + if e.complexity.Warehouse.Name == nil { + break + } + + return e.complexity.Warehouse.Name(childComplexity), true + + case "_Service.sdl": + if e.complexity._Service.SDL == nil { + break + } + + return e.complexity._Service.SDL(childComplexity), true + + } + return 0, false +} + +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + opCtx := graphql.GetOperationContext(ctx) + ec := executionContext{opCtx, e, 0, 0, make(chan graphql.DeferredResult)} + inputUnmarshalMap := graphql.BuildUnmarshalerMap( + ec.unmarshalInputProductKeyInput, + ec.unmarshalInputWarehouseLocationInput, + ec.unmarshalInputWarehouseLocationKeyInput, + ) + first := true + + switch opCtx.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + var response graphql.Response + var data graphql.Marshaler + if first { + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data = ec._Query(ctx, opCtx.Operation.SelectionSet) + } else { + if atomic.LoadInt32(&ec.pendingDeferred) > 0 { + result := <-ec.deferredResults + atomic.AddInt32(&ec.pendingDeferred, -1) + data = result.Result + response.Path = result.Path + response.Label = result.Label + response.Errors = result.Errors + } else { + return nil + } + } + var buf bytes.Buffer + data.MarshalGQL(&buf) + response.Data = buf.Bytes() + if atomic.LoadInt32(&ec.deferred) > 0 { + hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 + response.HasNext = &hasNext + } + + return &response + } + case ast.Mutation: + return func(ctx context.Context) *graphql.Response { + if !first { + return nil + } + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data := ec._Mutation(ctx, opCtx.Operation.SelectionSet) + var buf bytes.Buffer + data.MarshalGQL(&buf) + + return &graphql.Response{ + Data: buf.Bytes(), + } + } + case ast.Subscription: + next := ec._Subscription(ctx, opCtx.Operation.SelectionSet) + + var buf bytes.Buffer + return func(ctx context.Context) *graphql.Response { + buf.Reset() + data := next(ctx) + + if data == nil { + return nil + } + data.MarshalGQL(&buf) + + return &graphql.Response{ + Data: buf.Bytes(), + } + } + + default: + return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) + } +} + +type executionContext struct { + *graphql.OperationContext + *executableSchema + deferred int32 + pendingDeferred int32 + deferredResults chan graphql.DeferredResult +} + +func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) { + atomic.AddInt32(&ec.pendingDeferred, 1) + go func() { + ctx := graphql.WithFreshResponseContext(dg.Context) + dg.FieldSet.Dispatch(ctx) + ds := graphql.DeferredResult{ + Path: dg.Path, + Label: dg.Label, + Result: dg.FieldSet, + Errors: graphql.GetErrors(ctx), + } + // null fields should bubble up + if dg.FieldSet.Invalids > 0 { + ds.Result = graphql.Null + } + ec.deferredResults <- ds + }() +} + +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(ec.Schema()), nil +} + +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil +} + +var sources = []*ast.Source{ + {Name: "../schema.graphqls", Input: `extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key"] + ) + +directive @entityCache( + maxAge: Int! + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT + +directive @queryCache( + maxAge: Int! + includeHeaders: Boolean = false + shadowMode: Boolean = false +) on FIELD_DEFINITION + +directive @cacheInvalidate on FIELD_DEFINITION + +directive @cachePopulate(maxAge: Int) on FIELD_DEFINITION + +directive @is(fields: String!) on ARGUMENT_DEFINITION + +type Query { + item(id: ID!): Item @queryCache(maxAge: 300) + itemByPid(pid: ID! @is(fields: "id")): Item @queryCache(maxAge: 300) + items: [Item!]! @queryCache(maxAge: 300) + itemsByIds(ids: [ID!]! @is(fields: "id")): [Item!]! @queryCache(maxAge: 300) + product(id: ID!, region: String!): Product @queryCache(maxAge: 300) + productBySku(sku: String!): Product @queryCache(maxAge: 300) + productByName(name: String!): Product @queryCache(maxAge: 300) + productByKey(key: ProductKeyInput! @is(fields: "id region")): Product @queryCache(maxAge: 300) + warehouse(locationId: ID! @is(fields: "location.id")): Warehouse @queryCache(maxAge: 300) + # warehouseByInput exercises the same nested @key as ` + "`" + `warehouse` + "`" + ` but reaches it + # via an input object using GraphQL selection syntax in @is. This produces the + # multi-hop argumentPath ["input","location","id"] instead of the scalar + # ["locationId"]. Captures the red state where input-object → nested-key + # cache writes don't persist (cache lookup uses correct key but never hits). + warehouseByInput(input: WarehouseLocationInput! @is(fields: "location { id }")): Warehouse @queryCache(maxAge: 300) +} + +input ProductKeyInput { + id: ID! + region: String! +} + +input WarehouseLocationInput { + location: WarehouseLocationKeyInput! +} + +input WarehouseLocationKeyInput { + id: ID! +} + +type Mutation { + updateItem(id: ID!, name: String!): Item @cacheInvalidate + deleteItem(id: ID!): Item @cacheInvalidate + createItem(name: String!, category: String!): Item! @cachePopulate(maxAge: 60) + # deleteProduct invalidates a composite-key entity (Product @key("id region")). + # Used to pin behavior for cache invalidation when the entity uses a composite + # @key — a separate code path from the simple id-only key in deleteItem. + deleteProduct(id: ID!, region: String!): Product @cacheInvalidate +} + +type Subscription { + itemUpdated: Item @cacheInvalidate + itemCreated: Item @cachePopulate +} + +type Item @key(fields: "id") @entityCache(maxAge: 300) { + id: ID! + name: String! + category: String! +} + +type Product @key(fields: "id region") @key(fields: "sku") @entityCache(maxAge: 300) { + id: ID! + region: String! + sku: String! + name: String! +} + +type Location { + id: ID! +} + +type Warehouse @key(fields: "location { id }") @entityCache(maxAge: 300) { + location: Location! + name: String! +} +`, BuiltIn: false}, + {Name: "../../federation/directives.graphql", Input: ` + directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM + directive @composeDirective(name: String!) repeatable on SCHEMA + directive @extends on OBJECT | INTERFACE + directive @external on OBJECT | FIELD_DEFINITION + directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE + directive @inaccessible on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + directive @interfaceObject on OBJECT + directive @link(import: [String!], url: String!) repeatable on SCHEMA + directive @override(from: String!, label: String) on FIELD_DEFINITION + directive @policy(policies: [[federation__Policy!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @provides(fields: FieldSet!) on FIELD_DEFINITION + directive @requires(fields: FieldSet!) on FIELD_DEFINITION + directive @requiresScopes(scopes: [[federation__Scope!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @shareable repeatable on FIELD_DEFINITION | OBJECT + directive @tag(name: String!) repeatable on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + scalar _Any + scalar FieldSet + scalar federation__Policy + scalar federation__Scope +`, BuiltIn: true}, + {Name: "../../federation/entity.graphql", Input: ` +# a union of all types that use the @key directive +union _Entity = Item | Product | Warehouse + +# fake type to build resolver interfaces for users to implement +type Entity { + findItemByID(id: ID!,): Item! + findProductByIDAndRegion(id: ID!,region: String!,): Product! + findProductBySku(sku: String!,): Product! + findWarehouseByLocationID(locationID: ID!,): Warehouse! +} + +type _Service { + sdl: String +} + +extend type Query { + _entities(representations: [_Any!]!): [_Entity]! + _service: _Service! +} +`, BuiltIn: true}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Entity_findItemByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findItemByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findItemByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findProductByIDAndRegion_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findProductByIDAndRegion_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + arg1, err := ec.field_Entity_findProductByIDAndRegion_argsRegion(ctx, rawArgs) + if err != nil { + return nil, err + } + args["region"] = arg1 + return args, nil +} +func (ec *executionContext) field_Entity_findProductByIDAndRegion_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findProductByIDAndRegion_argsRegion( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["region"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) + if tmp, ok := rawArgs["region"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findProductBySku_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findProductBySku_argsSku(ctx, rawArgs) + if err != nil { + return nil, err + } + args["sku"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findProductBySku_argsSku( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["sku"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("sku")) + if tmp, ok := rawArgs["sku"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findWarehouseByLocationID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findWarehouseByLocationID_argsLocationID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["locationID"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findWarehouseByLocationID_argsLocationID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["locationID"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("locationID")) + if tmp, ok := rawArgs["locationID"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_createItem_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Mutation_createItem_argsName(ctx, rawArgs) + if err != nil { + return nil, err + } + args["name"] = arg0 + arg1, err := ec.field_Mutation_createItem_argsCategory(ctx, rawArgs) + if err != nil { + return nil, err + } + args["category"] = arg1 + return args, nil +} +func (ec *executionContext) field_Mutation_createItem_argsName( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["name"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["name"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_createItem_argsCategory( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["category"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("category")) + if tmp, ok := rawArgs["category"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_deleteItem_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Mutation_deleteItem_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Mutation_deleteItem_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_deleteProduct_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Mutation_deleteProduct_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + arg1, err := ec.field_Mutation_deleteProduct_argsRegion(ctx, rawArgs) + if err != nil { + return nil, err + } + args["region"] = arg1 + return args, nil +} +func (ec *executionContext) field_Mutation_deleteProduct_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_deleteProduct_argsRegion( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["region"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) + if tmp, ok := rawArgs["region"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateItem_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Mutation_updateItem_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + arg1, err := ec.field_Mutation_updateItem_argsName(ctx, rawArgs) + if err != nil { + return nil, err + } + args["name"] = arg1 + return args, nil +} +func (ec *executionContext) field_Mutation_updateItem_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateItem_argsName( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["name"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["name"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query___type_argsName(ctx, rawArgs) + if err != nil { + return nil, err + } + args["name"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query___type_argsName( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["name"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["name"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query__entities_argsRepresentations(ctx, rawArgs) + if err != nil { + return nil, err + } + args["representations"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query__entities_argsRepresentations( + ctx context.Context, + rawArgs map[string]any, +) ([]map[string]any, error) { + if _, ok := rawArgs["representations"]; !ok { + var zeroVal []map[string]any + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) + if tmp, ok := rawArgs["representations"]; ok { + return ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) + } + + var zeroVal []map[string]any + return zeroVal, nil +} + +func (ec *executionContext) field_Query_itemByPid_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_itemByPid_argsPid(ctx, rawArgs) + if err != nil { + return nil, err + } + args["pid"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_itemByPid_argsPid( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["pid"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("pid")) + if tmp, ok := rawArgs["pid"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query_item_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_item_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_item_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query_itemsByIds_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_itemsByIds_argsIds(ctx, rawArgs) + if err != nil { + return nil, err + } + args["ids"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_itemsByIds_argsIds( + ctx context.Context, + rawArgs map[string]any, +) ([]string, error) { + if _, ok := rawArgs["ids"]; !ok { + var zeroVal []string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("ids")) + if tmp, ok := rawArgs["ids"]; ok { + return ec.unmarshalNID2ᚕstringᚄ(ctx, tmp) + } + + var zeroVal []string + return zeroVal, nil +} + +func (ec *executionContext) field_Query_productByKey_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_productByKey_argsKey(ctx, rawArgs) + if err != nil { + return nil, err + } + args["key"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_productByKey_argsKey( + ctx context.Context, + rawArgs map[string]any, +) (model.ProductKeyInput, error) { + if _, ok := rawArgs["key"]; !ok { + var zeroVal model.ProductKeyInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + if tmp, ok := rawArgs["key"]; ok { + return ec.unmarshalNProductKeyInput2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐProductKeyInput(ctx, tmp) + } + + var zeroVal model.ProductKeyInput + return zeroVal, nil +} + +func (ec *executionContext) field_Query_productByName_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_productByName_argsName(ctx, rawArgs) + if err != nil { + return nil, err + } + args["name"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_productByName_argsName( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["name"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["name"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query_productBySku_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_productBySku_argsSku(ctx, rawArgs) + if err != nil { + return nil, err + } + args["sku"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_productBySku_argsSku( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["sku"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("sku")) + if tmp, ok := rawArgs["sku"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query_product_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_product_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + arg1, err := ec.field_Query_product_argsRegion(ctx, rawArgs) + if err != nil { + return nil, err + } + args["region"] = arg1 + return args, nil +} +func (ec *executionContext) field_Query_product_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query_product_argsRegion( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["region"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) + if tmp, ok := rawArgs["region"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query_warehouseByInput_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_warehouseByInput_argsInput(ctx, rawArgs) + if err != nil { + return nil, err + } + args["input"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_warehouseByInput_argsInput( + ctx context.Context, + rawArgs map[string]any, +) (model.WarehouseLocationInput, error) { + if _, ok := rawArgs["input"]; !ok { + var zeroVal model.WarehouseLocationInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNWarehouseLocationInput2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐWarehouseLocationInput(ctx, tmp) + } + + var zeroVal model.WarehouseLocationInput + return zeroVal, nil +} + +func (ec *executionContext) field_Query_warehouse_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_warehouse_argsLocationID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["locationId"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_warehouse_argsLocationID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["locationId"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("locationId")) + if tmp, ok := rawArgs["locationId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field___Directive_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Directive_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Directive_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Field_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Field_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Field_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_enumValues_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_enumValues_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_fields_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_fields_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _Entity_findItemByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findItemByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindItemByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Item) + fc.Result = res + return ec.marshalNItem2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐItem(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findItemByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Item_id(ctx, field) + case "name": + return ec.fieldContext_Item_name(ctx, field) + case "category": + return ec.fieldContext_Item_category(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Item", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findItemByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findProductByIDAndRegion(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findProductByIDAndRegion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindProductByIDAndRegion(rctx, fc.Args["id"].(string), fc.Args["region"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Product) + fc.Result = res + return ec.marshalNProduct2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐProduct(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findProductByIDAndRegion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Product_id(ctx, field) + case "region": + return ec.fieldContext_Product_region(ctx, field) + case "sku": + return ec.fieldContext_Product_sku(ctx, field) + case "name": + return ec.fieldContext_Product_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Product", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findProductByIDAndRegion_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findProductBySku(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findProductBySku(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindProductBySku(rctx, fc.Args["sku"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Product) + fc.Result = res + return ec.marshalNProduct2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐProduct(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findProductBySku(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Product_id(ctx, field) + case "region": + return ec.fieldContext_Product_region(ctx, field) + case "sku": + return ec.fieldContext_Product_sku(ctx, field) + case "name": + return ec.fieldContext_Product_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Product", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findProductBySku_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findWarehouseByLocationID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findWarehouseByLocationID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindWarehouseByLocationID(rctx, fc.Args["locationID"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Warehouse) + fc.Result = res + return ec.marshalNWarehouse2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐWarehouse(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findWarehouseByLocationID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "location": + return ec.fieldContext_Warehouse_location(ctx, field) + case "name": + return ec.fieldContext_Warehouse_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Warehouse", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findWarehouseByLocationID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Item_id(ctx context.Context, field graphql.CollectedField, obj *model.Item) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Item_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Item_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Item", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Item_name(ctx context.Context, field graphql.CollectedField, obj *model.Item) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Item_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Item_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Item", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Item_category(ctx context.Context, field graphql.CollectedField, obj *model.Item) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Item_category(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Category, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Item_category(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Item", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Location_id(ctx context.Context, field graphql.CollectedField, obj *model.Location) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Location_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Location_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Location", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateItem(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateItem(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateItem(rctx, fc.Args["id"].(string), fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Item) + fc.Result = res + return ec.marshalOItem2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐItem(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateItem(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Item_id(ctx, field) + case "name": + return ec.fieldContext_Item_name(ctx, field) + case "category": + return ec.fieldContext_Item_category(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Item", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateItem_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteItem(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteItem(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteItem(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Item) + fc.Result = res + return ec.marshalOItem2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐItem(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteItem(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Item_id(ctx, field) + case "name": + return ec.fieldContext_Item_name(ctx, field) + case "category": + return ec.fieldContext_Item_category(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Item", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteItem_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createItem(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createItem(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateItem(rctx, fc.Args["name"].(string), fc.Args["category"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Item) + fc.Result = res + return ec.marshalNItem2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐItem(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createItem(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Item_id(ctx, field) + case "name": + return ec.fieldContext_Item_name(ctx, field) + case "category": + return ec.fieldContext_Item_category(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Item", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createItem_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteProduct(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteProduct(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteProduct(rctx, fc.Args["id"].(string), fc.Args["region"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Product) + fc.Result = res + return ec.marshalOProduct2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐProduct(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteProduct(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Product_id(ctx, field) + case "region": + return ec.fieldContext_Product_region(ctx, field) + case "sku": + return ec.fieldContext_Product_sku(ctx, field) + case "name": + return ec.fieldContext_Product_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Product", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteProduct_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Product_id(ctx context.Context, field graphql.CollectedField, obj *model.Product) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Product_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Product_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Product", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Product_region(ctx context.Context, field graphql.CollectedField, obj *model.Product) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Product_region(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Region, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Product_region(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Product", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Product_sku(ctx context.Context, field graphql.CollectedField, obj *model.Product) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Product_sku(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Sku, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Product_sku(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Product", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Product_name(ctx context.Context, field graphql.CollectedField, obj *model.Product) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Product_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Product_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Product", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_item(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_item(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Item(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Item) + fc.Result = res + return ec.marshalOItem2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐItem(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_item(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Item_id(ctx, field) + case "name": + return ec.fieldContext_Item_name(ctx, field) + case "category": + return ec.fieldContext_Item_category(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Item", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_item_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_itemByPid(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_itemByPid(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().ItemByPid(rctx, fc.Args["pid"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Item) + fc.Result = res + return ec.marshalOItem2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐItem(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_itemByPid(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Item_id(ctx, field) + case "name": + return ec.fieldContext_Item_name(ctx, field) + case "category": + return ec.fieldContext_Item_category(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Item", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_itemByPid_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_items(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_items(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Items(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Item) + fc.Result = res + return ec.marshalNItem2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐItemᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_items(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Item_id(ctx, field) + case "name": + return ec.fieldContext_Item_name(ctx, field) + case "category": + return ec.fieldContext_Item_category(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Item", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_itemsByIds(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_itemsByIds(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().ItemsByIds(rctx, fc.Args["ids"].([]string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Item) + fc.Result = res + return ec.marshalNItem2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐItemᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_itemsByIds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Item_id(ctx, field) + case "name": + return ec.fieldContext_Item_name(ctx, field) + case "category": + return ec.fieldContext_Item_category(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Item", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_itemsByIds_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_product(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_product(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Product(rctx, fc.Args["id"].(string), fc.Args["region"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Product) + fc.Result = res + return ec.marshalOProduct2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐProduct(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_product(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Product_id(ctx, field) + case "region": + return ec.fieldContext_Product_region(ctx, field) + case "sku": + return ec.fieldContext_Product_sku(ctx, field) + case "name": + return ec.fieldContext_Product_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Product", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_product_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_productBySku(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_productBySku(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().ProductBySku(rctx, fc.Args["sku"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Product) + fc.Result = res + return ec.marshalOProduct2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐProduct(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_productBySku(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Product_id(ctx, field) + case "region": + return ec.fieldContext_Product_region(ctx, field) + case "sku": + return ec.fieldContext_Product_sku(ctx, field) + case "name": + return ec.fieldContext_Product_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Product", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_productBySku_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_productByName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_productByName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().ProductByName(rctx, fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Product) + fc.Result = res + return ec.marshalOProduct2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐProduct(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_productByName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Product_id(ctx, field) + case "region": + return ec.fieldContext_Product_region(ctx, field) + case "sku": + return ec.fieldContext_Product_sku(ctx, field) + case "name": + return ec.fieldContext_Product_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Product", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_productByName_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_productByKey(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_productByKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().ProductByKey(rctx, fc.Args["key"].(model.ProductKeyInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Product) + fc.Result = res + return ec.marshalOProduct2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐProduct(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_productByKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Product_id(ctx, field) + case "region": + return ec.fieldContext_Product_region(ctx, field) + case "sku": + return ec.fieldContext_Product_sku(ctx, field) + case "name": + return ec.fieldContext_Product_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Product", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_productByKey_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_warehouse(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_warehouse(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Warehouse(rctx, fc.Args["locationId"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Warehouse) + fc.Result = res + return ec.marshalOWarehouse2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐWarehouse(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_warehouse(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "location": + return ec.fieldContext_Warehouse_location(ctx, field) + case "name": + return ec.fieldContext_Warehouse_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Warehouse", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_warehouse_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_warehouseByInput(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_warehouseByInput(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().WarehouseByInput(rctx, fc.Args["input"].(model.WarehouseLocationInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Warehouse) + fc.Result = res + return ec.marshalOWarehouse2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐWarehouse(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_warehouseByInput(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "location": + return ec.fieldContext_Warehouse_location(ctx, field) + case "name": + return ec.fieldContext_Warehouse_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Warehouse", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_warehouseByInput_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__entities(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve_entities(ctx, fc.Args["representations"].([]map[string]any)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]fedruntime.Entity) + fc.Result = res + return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__entities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type _Entity does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query__entities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__service(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve__service(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(fedruntime.Service) + fc.Result = res + return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__service(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "sdl": + return ec.fieldContext__Service_sdl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___schema(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Subscription_itemUpdated(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) { + fc, err := ec.fieldContext_Subscription_itemUpdated(ctx, field) + if err != nil { + return nil + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Subscription().ItemUpdated(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return nil + } + if resTmp == nil { + return nil + } + return func(ctx context.Context) graphql.Marshaler { + select { + case res, ok := <-resTmp.(<-chan *model.Item): + if !ok { + return nil + } + return graphql.WriterFunc(func(w io.Writer) { + w.Write([]byte{'{'}) + graphql.MarshalString(field.Alias).MarshalGQL(w) + w.Write([]byte{':'}) + ec.marshalOItem2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐItem(ctx, field.Selections, res).MarshalGQL(w) + w.Write([]byte{'}'}) + }) + case <-ctx.Done(): + return nil + } + } +} + +func (ec *executionContext) fieldContext_Subscription_itemUpdated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscription", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Item_id(ctx, field) + case "name": + return ec.fieldContext_Item_name(ctx, field) + case "category": + return ec.fieldContext_Item_category(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Item", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Subscription_itemCreated(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) { + fc, err := ec.fieldContext_Subscription_itemCreated(ctx, field) + if err != nil { + return nil + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Subscription().ItemCreated(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return nil + } + if resTmp == nil { + return nil + } + return func(ctx context.Context) graphql.Marshaler { + select { + case res, ok := <-resTmp.(<-chan *model.Item): + if !ok { + return nil + } + return graphql.WriterFunc(func(w io.Writer) { + w.Write([]byte{'{'}) + graphql.MarshalString(field.Alias).MarshalGQL(w) + w.Write([]byte{':'}) + ec.marshalOItem2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐItem(ctx, field.Selections, res).MarshalGQL(w) + w.Write([]byte{'}'}) + }) + case <-ctx.Done(): + return nil + } + } +} + +func (ec *executionContext) fieldContext_Subscription_itemCreated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscription", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Item_id(ctx, field) + case "name": + return ec.fieldContext_Item_name(ctx, field) + case "category": + return ec.fieldContext_Item_category(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Item", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Warehouse_location(ctx context.Context, field graphql.CollectedField, obj *model.Warehouse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Warehouse_location(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Location, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Location) + fc.Result = res + return ec.marshalNLocation2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐLocation(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Warehouse_location(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Warehouse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Location_id(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Location", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Warehouse_name(ctx context.Context, field graphql.CollectedField, obj *model.Warehouse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Warehouse_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Warehouse_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Warehouse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext__Service_sdl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SDL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext__Service_sdl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "_Service", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsRepeatable, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Locations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __DirectiveLocation does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Directive_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Field_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_isOneOf(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_isOneOf(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsOneOf(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_isOneOf(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +func (ec *executionContext) unmarshalInputProductKeyInput(ctx context.Context, obj any) (model.ProductKeyInput, error) { + var it model.ProductKeyInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"id", "region"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.ID = data + case "region": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Region = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputWarehouseLocationInput(ctx context.Context, obj any) (model.WarehouseLocationInput, error) { + var it model.WarehouseLocationInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"location"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "location": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("location")) + data, err := ec.unmarshalNWarehouseLocationKeyInput2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐWarehouseLocationKeyInput(ctx, v) + if err != nil { + return it, err + } + it.Location = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputWarehouseLocationKeyInput(ctx context.Context, obj any) (model.WarehouseLocationKeyInput, error) { + var it model.WarehouseLocationKeyInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"id"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.ID = data + } + } + + return it, nil +} + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, obj fedruntime.Entity) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case model.Warehouse: + return ec._Warehouse(ctx, sel, &obj) + case *model.Warehouse: + if obj == nil { + return graphql.Null + } + return ec._Warehouse(ctx, sel, obj) + case model.Product: + return ec._Product(ctx, sel, &obj) + case *model.Product: + if obj == nil { + return graphql.Null + } + return ec._Product(ctx, sel, obj) + case model.Item: + return ec._Item(ctx, sel, &obj) + case *model.Item: + if obj == nil { + return graphql.Null + } + return ec._Item(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var entityImplementors = []string{"Entity"} + +func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Entity", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Entity") + case "findItemByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findItemByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findProductByIDAndRegion": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findProductByIDAndRegion(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findProductBySku": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findProductBySku(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findWarehouseByLocationID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findWarehouseByLocationID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var itemImplementors = []string{"Item", "_Entity"} + +func (ec *executionContext) _Item(ctx context.Context, sel ast.SelectionSet, obj *model.Item) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, itemImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Item") + case "id": + out.Values[i] = ec._Item_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._Item_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "category": + out.Values[i] = ec._Item_category(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var locationImplementors = []string{"Location"} + +func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, obj *model.Location) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, locationImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Location") + case "id": + out.Values[i] = ec._Location_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var mutationImplementors = []string{"Mutation"} + +func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Mutation", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Mutation") + case "updateItem": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateItem(ctx, field) + }) + case "deleteItem": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteItem(ctx, field) + }) + case "createItem": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createItem(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteProduct": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteProduct(ctx, field) + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var productImplementors = []string{"Product", "_Entity"} + +func (ec *executionContext) _Product(ctx context.Context, sel ast.SelectionSet, obj *model.Product) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, productImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Product") + case "id": + out.Values[i] = ec._Product_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "region": + out.Values[i] = ec._Product_region(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "sku": + out.Values[i] = ec._Product_sku(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._Product_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var queryImplementors = []string{"Query"} + +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "item": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_item(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "itemByPid": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_itemByPid(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "items": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_items(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "itemsByIds": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_itemsByIds(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "product": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_product(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "productBySku": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_productBySku(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "productByName": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_productByName(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "productByKey": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_productByKey(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "warehouse": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_warehouse(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "warehouseByInput": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_warehouseByInput(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "_entities": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__entities(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "_service": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__service(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "__type": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) + case "__schema": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var subscriptionImplementors = []string{"Subscription"} + +func (ec *executionContext) _Subscription(ctx context.Context, sel ast.SelectionSet) func(ctx context.Context) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, subscriptionImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Subscription", + }) + if len(fields) != 1 { + ec.Errorf(ctx, "must subscribe to exactly one stream") + return nil + } + + switch fields[0].Name { + case "itemUpdated": + return ec._Subscription_itemUpdated(ctx, fields[0]) + case "itemCreated": + return ec._Subscription_itemCreated(ctx, fields[0]) + default: + panic("unknown field " + strconv.Quote(fields[0].Name)) + } +} + +var warehouseImplementors = []string{"Warehouse", "_Entity"} + +func (ec *executionContext) _Warehouse(ctx context.Context, sel ast.SelectionSet, obj *model.Warehouse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, warehouseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Warehouse") + case "location": + out.Values[i] = ec._Warehouse_location(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._Warehouse_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var _ServiceImplementors = []string{"_Service"} + +func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("_Service") + case "sdl": + out.Values[i] = ec.__Service_sdl(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __DirectiveImplementors = []string{"__Directive"} + +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "isRepeatable": + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __EnumValueImplementors = []string{"__EnumValue"} + +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __FieldImplementors = []string{"__Field"} + +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __InputValueImplementors = []string{"__InputValue"} + +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___InputValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___InputValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __SchemaImplementors = []string{"__Schema"} + +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Schema") + case "description": + out.Values[i] = ec.___Schema_description(ctx, field, obj) + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __TypeImplementors = []string{"__Type"} + +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "specifiedByURL": + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + case "isOneOf": + out.Values[i] = ec.___Type_isOneOf(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +// endregion **************************** object.gotpl **************************** + +// region ***************************** type.gotpl ***************************** + +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNFieldSet2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNID2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalID(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalID(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNID2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNID2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNID2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNID2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v any) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { + _ = sel + res := graphql.MarshalInt(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNItem2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐItem(ctx context.Context, sel ast.SelectionSet, v model.Item) graphql.Marshaler { + return ec._Item(ctx, sel, &v) +} + +func (ec *executionContext) marshalNItem2ᚕᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐItemᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Item) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNItem2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐItem(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNItem2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐItem(ctx context.Context, sel ast.SelectionSet, v *model.Item) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Item(ctx, sel, v) +} + +func (ec *executionContext) marshalNLocation2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐLocation(ctx context.Context, sel ast.SelectionSet, v *model.Location) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Location(ctx, sel, v) +} + +func (ec *executionContext) marshalNProduct2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐProduct(ctx context.Context, sel ast.SelectionSet, v model.Product) graphql.Marshaler { + return ec._Product(ctx, sel, &v) +} + +func (ec *executionContext) marshalNProduct2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐProduct(ctx context.Context, sel ast.SelectionSet, v *model.Product) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Product(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNProductKeyInput2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐProductKeyInput(ctx context.Context, v any) (model.ProductKeyInput, error) { + res, err := ec.unmarshalInputProductKeyInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNWarehouse2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐWarehouse(ctx context.Context, sel ast.SelectionSet, v model.Warehouse) graphql.Marshaler { + return ec._Warehouse(ctx, sel, &v) +} + +func (ec *executionContext) marshalNWarehouse2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐWarehouse(ctx context.Context, sel ast.SelectionSet, v *model.Warehouse) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Warehouse(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNWarehouseLocationInput2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐWarehouseLocationInput(ctx context.Context, v any) (model.WarehouseLocationInput, error) { + res, err := ec.unmarshalInputWarehouseLocationInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNWarehouseLocationKeyInput2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐWarehouseLocationKeyInput(ctx context.Context, v any) (*model.WarehouseLocationKeyInput, error) { + res, err := ec.unmarshalInputWarehouseLocationKeyInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v any) (map[string]any, error) { + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]any) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + _ = sel + res := graphql.MarshalMap(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v any) ([]map[string]any, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]map[string]any, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN_Any2map(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN_Any2ᚕmapᚄ(ctx context.Context, sel ast.SelectionSet, v []map[string]any) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalN_Any2map(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v []fedruntime.Entity) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { + return ec.__Service(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { + return ec.___Directive(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { + return ec.___EnumValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { + return ec.___Field(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { + return ec.___InputValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { + return ec.___Type(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Policy2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Scope2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalBoolean(v) + return res +} + +func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v any) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalBoolean(*v) + return res +} + +func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v any) (*int, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalInt(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalInt(*v) + return res +} + +func (ec *executionContext) marshalOItem2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐItem(ctx context.Context, sel ast.SelectionSet, v *model.Item) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Item(ctx, sel, v) +} + +func (ec *executionContext) marshalOProduct2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐProduct(ctx context.Context, sel ast.SelectionSet, v *model.Product) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Product(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalString(v) + return res +} + +func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + if v == nil { + return nil, nil + } + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v any) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalString(*v) + return res +} + +func (ec *executionContext) marshalOWarehouse2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋitemsᚋsubgraphᚋmodelᚐWarehouse(ctx context.Context, sel ast.SelectionSet, v *model.Warehouse) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Warehouse(ctx, sel, v) +} + +func (ec *executionContext) marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v fedruntime.Entity) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.__Entity(ctx, sel, v) +} + +func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Schema(ctx, sel, v) +} + +func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +// endregion ***************************** type.gotpl ***************************** diff --git a/router-tests/entity_caching/subgraphs/items/subgraph/generated/staticcheck.conf b/router-tests/entity_caching/subgraphs/items/subgraph/generated/staticcheck.conf new file mode 100644 index 0000000000..582953a07e --- /dev/null +++ b/router-tests/entity_caching/subgraphs/items/subgraph/generated/staticcheck.conf @@ -0,0 +1,2 @@ +# This is meant as a workaround to skip staticcheck checks for generated code +checks = ["all", "-SA4004", "-ST1000"] diff --git a/router-tests/entity_caching/subgraphs/items/subgraph/model/models_gen.go b/router-tests/entity_caching/subgraphs/items/subgraph/model/models_gen.go new file mode 100644 index 0000000000..8c4908fb17 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/items/subgraph/model/models_gen.go @@ -0,0 +1,53 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package model + +type Item struct { + ID string `json:"id"` + Name string `json:"name"` + Category string `json:"category"` +} + +func (Item) IsEntity() {} + +type Location struct { + ID string `json:"id"` +} + +type Mutation struct { +} + +type Product struct { + ID string `json:"id"` + Region string `json:"region"` + Sku string `json:"sku"` + Name string `json:"name"` +} + +func (Product) IsEntity() {} + +type ProductKeyInput struct { + ID string `json:"id"` + Region string `json:"region"` +} + +type Query struct { +} + +type Subscription struct { +} + +type Warehouse struct { + Location *Location `json:"location"` + Name string `json:"name"` +} + +func (Warehouse) IsEntity() {} + +type WarehouseLocationInput struct { + Location *WarehouseLocationKeyInput `json:"location"` +} + +type WarehouseLocationKeyInput struct { + ID string `json:"id"` +} diff --git a/router-tests/entity_caching/subgraphs/items/subgraph/resolver.go b/router-tests/entity_caching/subgraphs/items/subgraph/resolver.go new file mode 100644 index 0000000000..5cf786f056 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/items/subgraph/resolver.go @@ -0,0 +1,26 @@ +package subgraph + +import ( + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/items/subgraph/model" +) + +type Resolver struct { + ItemUpdatedCh chan *model.Item + ItemCreatedCh chan *model.Item + + // Store is a per-resolver Item store. Each subgraph server constructs a + // fresh Resolver (and thus a fresh Store) so mutations in one test do not + // leak into parallel tests. + Store *itemStore +} + +// NewResolver constructs a Resolver with a freshly seeded Item store and the +// subscription channels. Tests should call NewResolver (via NewSchema) rather +// than instantiating Resolver directly so the store is always non-nil. +func NewResolver(itemUpdatedCh chan *model.Item, itemCreatedCh chan *model.Item) *Resolver { + return &Resolver{ + ItemUpdatedCh: itemUpdatedCh, + ItemCreatedCh: itemCreatedCh, + Store: newItemStore(), + } +} diff --git a/router-tests/entity_caching/subgraphs/items/subgraph/schema.graphqls b/router-tests/entity_caching/subgraphs/items/subgraph/schema.graphqls new file mode 100644 index 0000000000..b584e904aa --- /dev/null +++ b/router-tests/entity_caching/subgraphs/items/subgraph/schema.graphqls @@ -0,0 +1,93 @@ +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key"] + ) + +directive @openfed__entityCache( + maxAge: Int! + negativeCacheTTL: Int = 0 + includeHeaders: Boolean = false + partialCacheLoad: Boolean = false + shadowMode: Boolean = false +) on OBJECT + +directive @openfed__queryCache( + maxAge: Int! + includeHeaders: Boolean = false + shadowMode: Boolean = false +) on FIELD_DEFINITION + +directive @openfed__cacheInvalidate on FIELD_DEFINITION + +directive @openfed__cachePopulate(maxAge: Int) on FIELD_DEFINITION + +directive @openfed__is(fields: String!) on ARGUMENT_DEFINITION + +type Query { + item(id: ID!): Item @openfed__queryCache(maxAge: 300) + itemByPid(pid: ID! @openfed__is(fields: "id")): Item @openfed__queryCache(maxAge: 300) + items: [Item!]! @openfed__queryCache(maxAge: 300) + itemsByIds(ids: [ID!]! @openfed__is(fields: "id")): [Item!]! @openfed__queryCache(maxAge: 300) + product(id: ID!, region: String!): Product @openfed__queryCache(maxAge: 300) + productBySku(sku: String!): Product @openfed__queryCache(maxAge: 300) + productByName(name: String!): Product @openfed__queryCache(maxAge: 300) + productByKey(key: ProductKeyInput! @openfed__is(fields: "id region")): Product @openfed__queryCache(maxAge: 300) + warehouse(locationId: ID! @openfed__is(fields: "location.id")): Warehouse @openfed__queryCache(maxAge: 300) + # warehouseByInput exercises the same nested @key as `warehouse` but reaches it + # via an input object using GraphQL selection syntax in @openfed__is. This produces the + # multi-hop argumentPath ["input","location","id"] instead of the scalar + # ["locationId"]. Captures the red state where input-object → nested-key + # cache writes don't persist (cache lookup uses correct key but never hits). + warehouseByInput(input: WarehouseLocationInput! @openfed__is(fields: "location { id }")): Warehouse @openfed__queryCache(maxAge: 300) +} + +input ProductKeyInput { + id: ID! + region: String! +} + +input WarehouseLocationInput { + location: WarehouseLocationKeyInput! +} + +input WarehouseLocationKeyInput { + id: ID! +} + +type Mutation { + updateItem(id: ID!, name: String!): Item @openfed__cacheInvalidate + deleteItem(id: ID!): Item @openfed__cacheInvalidate + createItem(name: String!, category: String!): Item! @openfed__cachePopulate(maxAge: 60) + # deleteProduct invalidates a composite-key entity (Product @key("id region")). + # Used to pin behavior for cache invalidation when the entity uses a composite + # @key — a separate code path from the simple id-only key in deleteItem. + deleteProduct(id: ID!, region: String!): Product @openfed__cacheInvalidate +} + +type Subscription { + itemUpdated: Item @openfed__cacheInvalidate + itemCreated: Item @openfed__cachePopulate +} + +type Item @key(fields: "id") @openfed__entityCache(maxAge: 300, negativeCacheTTL: 30) { + id: ID! + name: String! + category: String! +} + +type Product @key(fields: "id region") @key(fields: "sku") @openfed__entityCache(maxAge: 300) { + id: ID! + region: String! + sku: String! + name: String! +} + +type Location { + id: ID! +} + +type Warehouse @key(fields: "location { id }") @openfed__entityCache(maxAge: 300) { + location: Location! + name: String! +} diff --git a/router-tests/entity_caching/subgraphs/items/subgraph/schema.resolvers.go b/router-tests/entity_caching/subgraphs/items/subgraph/schema.resolvers.go new file mode 100644 index 0000000000..e7a5f20b58 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/items/subgraph/schema.resolvers.go @@ -0,0 +1,180 @@ +package subgraph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.76 + +import ( + "context" + "fmt" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/items/subgraph/generated" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/items/subgraph/model" +) + +// UpdateItem is the resolver for the updateItem field. +// It persists the new name to the per-resolver store and publishes the +// updated entity on the itemUpdated subscription channel so subscription-based +// @cacheInvalidate flows can be exercised end-to-end in tests. +func (r *mutationResolver) UpdateItem(ctx context.Context, id string, name string) (*model.Item, error) { + updated, ok := r.Store.update(id, name) + if !ok { + return nil, fmt.Errorf("item %s not found", id) + } + if r.ItemUpdatedCh != nil { + select { + case r.ItemUpdatedCh <- updated: + default: + } + } + return updated, nil +} + +// DeleteItem is the resolver for the deleteItem field. +// It removes the item from the per-resolver store and publishes the deleted +// entity on the itemUpdated subscription channel so tests can verify the +// downstream cache-invalidate pipeline. +func (r *mutationResolver) DeleteItem(ctx context.Context, id string) (*model.Item, error) { + deleted, ok := r.Store.delete(id) + if !ok { + return nil, fmt.Errorf("item %s not found", id) + } + if r.ItemUpdatedCh != nil { + select { + case r.ItemUpdatedCh <- deleted: + default: + } + } + return deleted, nil +} + +// CreateItem is the resolver for the createItem field. +// It persists the new item to the per-resolver store and publishes it on the +// itemCreated subscription channel so @cachePopulate subscription flows get a +// real event to populate the cache from. +func (r *mutationResolver) CreateItem(ctx context.Context, name string, category string) (*model.Item, error) { + created := r.Store.create(name, category) + if r.ItemCreatedCh != nil { + select { + case r.ItemCreatedCh <- created: + default: + } + } + return created, nil +} + +// DeleteProduct is the resolver for the deleteProduct field. +// Returns the matching Product without removing it from the in-memory data, so +// tests can verify @cacheInvalidate clears the cache without simulating durable +// deletion in the subgraph. +func (r *mutationResolver) DeleteProduct(ctx context.Context, id string, region string) (*model.Product, error) { + for _, p := range Products { + if p.ID == id && p.Region == region { + return p, nil + } + } + return nil, fmt.Errorf("product %s/%s not found", id, region) +} + +// Item is the resolver for the item field. +func (r *queryResolver) Item(ctx context.Context, id string) (*model.Item, error) { + return r.Store.find(id), nil +} + +// ItemByPid is the resolver for the itemByPid field. +func (r *queryResolver) ItemByPid(ctx context.Context, pid string) (*model.Item, error) { + return r.Store.find(pid), nil +} + +// Items is the resolver for the items field. +func (r *queryResolver) Items(ctx context.Context) ([]*model.Item, error) { + return r.Store.all(), nil +} + +// ItemsByIds is the resolver for the itemsByIds field. +func (r *queryResolver) ItemsByIds(ctx context.Context, ids []string) ([]*model.Item, error) { + return r.Store.byIDs(ids), nil +} + +// Product is the resolver for the product field. +func (r *queryResolver) Product(ctx context.Context, id string, region string) (*model.Product, error) { + for _, p := range Products { + if p.ID == id && p.Region == region { + return p, nil + } + } + return nil, nil +} + +// ProductBySku is the resolver for the productBySku field. +func (r *queryResolver) ProductBySku(ctx context.Context, sku string) (*model.Product, error) { + for _, p := range Products { + if p.Sku == sku { + return p, nil + } + } + return nil, nil +} + +// ProductByName is the resolver for the productByName field. +func (r *queryResolver) ProductByName(ctx context.Context, name string) (*model.Product, error) { + for _, p := range Products { + if p.Name == name { + return p, nil + } + } + return nil, nil +} + +// ProductByKey is the resolver for the productByKey field. +func (r *queryResolver) ProductByKey(ctx context.Context, key model.ProductKeyInput) (*model.Product, error) { + for _, p := range Products { + if p.ID == key.ID && p.Region == key.Region { + return p, nil + } + } + return nil, nil +} + +// Warehouse is the resolver for the warehouse field. +func (r *queryResolver) Warehouse(ctx context.Context, locationID string) (*model.Warehouse, error) { + for _, w := range Warehouses { + if w.Location.ID == locationID { + return w, nil + } + } + return nil, nil +} + +// WarehouseByInput is the resolver for the warehouseByInput field. +func (r *queryResolver) WarehouseByInput(ctx context.Context, input model.WarehouseLocationInput) (*model.Warehouse, error) { + for _, w := range Warehouses { + if w.Location.ID == input.Location.ID { + return w, nil + } + } + return nil, nil +} + +// ItemUpdated is the resolver for the itemUpdated field. +func (r *subscriptionResolver) ItemUpdated(ctx context.Context) (<-chan *model.Item, error) { + return r.ItemUpdatedCh, nil +} + +// ItemCreated is the resolver for the itemCreated field. +func (r *subscriptionResolver) ItemCreated(ctx context.Context) (<-chan *model.Item, error) { + return r.ItemCreatedCh, nil +} + +// Mutation returns generated.MutationResolver implementation. +func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResolver{r} } + +// Query returns generated.QueryResolver implementation. +func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} } + +// Subscription returns generated.SubscriptionResolver implementation. +func (r *Resolver) Subscription() generated.SubscriptionResolver { return &subscriptionResolver{r} } + +type mutationResolver struct{ *Resolver } +type queryResolver struct{ *Resolver } +type subscriptionResolver struct{ *Resolver } diff --git a/router-tests/entity_caching/subgraphs/viewer/generate.go b/router-tests/entity_caching/subgraphs/viewer/generate.go new file mode 100644 index 0000000000..f83456a6c1 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/viewer/generate.go @@ -0,0 +1,3 @@ +//go:generate go run github.com/99designs/gqlgen generate + +package viewer diff --git a/router-tests/entity_caching/subgraphs/viewer/gqlgen.yml b/router-tests/entity_caching/subgraphs/viewer/gqlgen.yml new file mode 100644 index 0000000000..e1445b4121 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/viewer/gqlgen.yml @@ -0,0 +1,39 @@ +schema: + - subgraph/*.graphqls + +exec: + filename: subgraph/generated/generated.go + package: generated + +federation: + filename: subgraph/generated/federation.go + package: generated + version: 2 + options: + explicit_requires: true + +model: + filename: subgraph/model/models_gen.go + package: model + +resolver: + layout: follow-schema + dir: subgraph + package: subgraph + +directives: + requestScoped: + skip_runtime: true + +models: + ID: + model: + - github.com/99designs/gqlgen/graphql.ID + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + Int: + model: + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 diff --git a/router-tests/entity_caching/subgraphs/viewer/subgraph/data.go b/router-tests/entity_caching/subgraphs/viewer/subgraph/data.go new file mode 100644 index 0000000000..9c97786ab8 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/viewer/subgraph/data.go @@ -0,0 +1,13 @@ +package subgraph + +import "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/viewer/subgraph/model" + +// defaultViewer returns a fresh Viewer instance. Returning a new pointer on +// each call prevents accidental aliasing between concurrent resolvers. +func defaultViewer() *model.Viewer { + return &model.Viewer{ + ID: "v1", + Name: "Alice", + Email: "alice@example.com", + } +} diff --git a/router-tests/entity_caching/subgraphs/viewer/subgraph/entity.resolvers.go b/router-tests/entity_caching/subgraphs/viewer/subgraph/entity.resolvers.go new file mode 100644 index 0000000000..403eea4a81 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/viewer/subgraph/entity.resolvers.go @@ -0,0 +1,34 @@ +package subgraph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.76 + +import ( + "context" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/viewer/subgraph/generated" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/viewer/subgraph/model" +) + +// FindPersonalizedByID is the resolver for the findPersonalizedByID field. +func (r *entityResolver) FindPersonalizedByID(ctx context.Context, id string) (*model.Personalized, error) { + // @interfaceObject resolver: returns currentViewer for any entity implementing Personalized. + // The concrete type (e.g. Article) is irrelevant — currentViewer comes from the request context. + return &model.Personalized{ + ID: id, + CurrentViewer: defaultViewer(), + }, nil +} + +// FindViewerByID is the resolver for the findViewerByID field. +func (r *entityResolver) FindViewerByID(ctx context.Context, id string) (*model.Viewer, error) { + v := defaultViewer() + v.ID = id + return v, nil +} + +// Entity returns generated.EntityResolver implementation. +func (r *Resolver) Entity() generated.EntityResolver { return &entityResolver{r} } + +type entityResolver struct{ *Resolver } diff --git a/router-tests/entity_caching/subgraphs/viewer/subgraph/generated/federation.go b/router-tests/entity_caching/subgraphs/viewer/subgraph/generated/federation.go new file mode 100644 index 0000000000..2556c88ac5 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/viewer/subgraph/generated/federation.go @@ -0,0 +1,288 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "strings" + "sync" + + "github.com/99designs/gqlgen/plugin/federation/fedruntime" +) + +var ( + ErrUnknownType = errors.New("unknown type") + ErrTypeNotFound = errors.New("type not found") +) + +func (ec *executionContext) __resolve__service(ctx context.Context) (fedruntime.Service, error) { + if ec.DisableIntrospection { + return fedruntime.Service{}, errors.New("federated introspection disabled") + } + + var sdl []string + + for _, src := range sources { + if src.BuiltIn { + continue + } + sdl = append(sdl, src.Input) + } + + return fedruntime.Service{ + SDL: strings.Join(sdl, "\n"), + }, nil +} + +func (ec *executionContext) __resolve_entities(ctx context.Context, representations []map[string]any) []fedruntime.Entity { + list := make([]fedruntime.Entity, len(representations)) + + repsMap := ec.buildRepresentationGroups(ctx, representations) + + switch len(repsMap) { + case 0: + return list + case 1: + for typeName, reps := range repsMap { + ec.resolveEntityGroup(ctx, typeName, reps, list) + } + return list + default: + var g sync.WaitGroup + g.Add(len(repsMap)) + for typeName, reps := range repsMap { + go func(typeName string, reps []EntityWithIndex) { + ec.resolveEntityGroup(ctx, typeName, reps, list) + g.Done() + }(typeName, reps) + } + g.Wait() + return list + } +} + +type EntityWithIndex struct { + // The index in the original representation array + index int + entity EntityRepresentation +} + +// EntityRepresentation is the JSON representation of an entity sent by the Router +// used as the inputs for us to resolve. +// +// We make it a map because we know the top level JSON is always an object. +type EntityRepresentation map[string]any + +// We group entities by typename so that we can parallelize their resolution. +// This is particularly helpful when there are entity groups in multi mode. +func (ec *executionContext) buildRepresentationGroups( + ctx context.Context, + representations []map[string]any, +) map[string][]EntityWithIndex { + repsMap := make(map[string][]EntityWithIndex) + for i, rep := range representations { + typeName, ok := rep["__typename"].(string) + if !ok { + // If there is no __typename, we just skip the representation; + // we just won't be resolving these unknown types. + ec.Error(ctx, errors.New("__typename must be an existing string")) + continue + } + + repsMap[typeName] = append(repsMap[typeName], EntityWithIndex{ + index: i, + entity: rep, + }) + } + + return repsMap +} + +func (ec *executionContext) resolveEntityGroup( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) { + if isMulti(typeName) { + err := ec.resolveManyEntities(ctx, typeName, reps, list) + if err != nil { + ec.Error(ctx, err) + } + } else { + // if there are multiple entities to resolve, parallelize (similar to + // graphql.FieldSet.Dispatch) + var e sync.WaitGroup + e.Add(len(reps)) + for i, rep := range reps { + i, rep := i, rep + go func(i int, rep EntityWithIndex) { + entity, err := ec.resolveEntity(ctx, typeName, rep.entity) + if err != nil { + ec.Error(ctx, err) + } else { + list[rep.index] = entity + } + e.Done() + }(i, rep) + } + e.Wait() + } +} + +func isMulti(typeName string) bool { + switch typeName { + default: + return false + } +} + +func (ec *executionContext) resolveEntity( + ctx context.Context, + typeName string, + rep EntityRepresentation, +) (e fedruntime.Entity, err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + case "Personalized": + resolverName, err := entityResolverNameForPersonalized(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Personalized": %w`, err) + } + switch resolverName { + + case "findPersonalizedByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findPersonalizedByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindPersonalizedByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Personalized": %w`, err) + } + + return entity, nil + } + case "Viewer": + resolverName, err := entityResolverNameForViewer(ctx, rep) + if err != nil { + return nil, fmt.Errorf(`finding resolver for Entity "Viewer": %w`, err) + } + switch resolverName { + + case "findViewerByID": + id0, err := ec.unmarshalNID2string(ctx, rep["id"]) + if err != nil { + return nil, fmt.Errorf(`unmarshalling param 0 for findViewerByID(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindViewerByID(ctx, id0) + if err != nil { + return nil, fmt.Errorf(`resolving Entity "Viewer": %w`, err) + } + + return entity, nil + } + + } + return nil, fmt.Errorf("%w: %s", ErrUnknownType, typeName) +} + +func (ec *executionContext) resolveManyEntities( + ctx context.Context, + typeName string, + reps []EntityWithIndex, + list []fedruntime.Entity, +) (err error) { + // we need to do our own panic handling, because we may be called in a + // goroutine, where the usual panic handling can't catch us + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + } + }() + + switch typeName { + + default: + return errors.New("unknown type: " + typeName) + } +} + +func entityResolverNameForPersonalized(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Personalized", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Personalized", ErrTypeNotFound)) + break + } + return "findPersonalizedByID", nil + } + return "", fmt.Errorf("%w for Personalized due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} + +func entityResolverNameForViewer(ctx context.Context, rep EntityRepresentation) (string, error) { + // we collect errors because a later entity resolver may work fine + // when an entity has multiple keys + entityResolverErrs := []error{} + for { + var ( + m EntityRepresentation + val any + ok bool + ) + _ = val + // if all of the KeyFields values for this resolver are null, + // we shouldn't use use it + allNull := true + m = rep + val, ok = m["id"] + if !ok { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to missing Key Field \"id\" for Viewer", ErrTypeNotFound)) + break + } + if allNull { + allNull = val == nil + } + if allNull { + entityResolverErrs = append(entityResolverErrs, + fmt.Errorf("%w due to all null value KeyFields for Viewer", ErrTypeNotFound)) + break + } + return "findViewerByID", nil + } + return "", fmt.Errorf("%w for Viewer due to %v", ErrTypeNotFound, + errors.Join(entityResolverErrs...).Error()) +} diff --git a/router-tests/entity_caching/subgraphs/viewer/subgraph/generated/generated.go b/router-tests/entity_caching/subgraphs/viewer/subgraph/generated/generated.go new file mode 100644 index 0000000000..aefa5cc157 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/viewer/subgraph/generated/generated.go @@ -0,0 +1,4837 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package generated + +import ( + "bytes" + "context" + "errors" + "fmt" + "strconv" + "sync" + "sync/atomic" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/introspection" + "github.com/99designs/gqlgen/plugin/federation/fedruntime" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/viewer/subgraph/model" +) + +// region ************************** generated!.gotpl ************************** + +// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. +func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { + return &executableSchema{ + schema: cfg.Schema, + resolvers: cfg.Resolvers, + directives: cfg.Directives, + complexity: cfg.Complexity, + } +} + +type Config struct { + Schema *ast.Schema + Resolvers ResolverRoot + Directives DirectiveRoot + Complexity ComplexityRoot +} + +type ResolverRoot interface { + Entity() EntityResolver + Query() QueryResolver +} + +type DirectiveRoot struct { +} + +type ComplexityRoot struct { + Entity struct { + FindPersonalizedByID func(childComplexity int, id string) int + FindViewerByID func(childComplexity int, id string) int + } + + Personalized struct { + CurrentViewer func(childComplexity int) int + ID func(childComplexity int) int + } + + Query struct { + CurrentViewer func(childComplexity int) int + __resolve__service func(childComplexity int) int + __resolve_entities func(childComplexity int, representations []map[string]any) int + } + + Viewer struct { + Email func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + } + + _Service struct { + SDL func(childComplexity int) int + } +} + +type EntityResolver interface { + FindPersonalizedByID(ctx context.Context, id string) (*model.Personalized, error) + FindViewerByID(ctx context.Context, id string) (*model.Viewer, error) +} +type QueryResolver interface { + CurrentViewer(ctx context.Context) (*model.Viewer, error) +} + +type executableSchema struct { + schema *ast.Schema + resolvers ResolverRoot + directives DirectiveRoot + complexity ComplexityRoot +} + +func (e *executableSchema) Schema() *ast.Schema { + if e.schema != nil { + return e.schema + } + return parsedSchema +} + +func (e *executableSchema) Complexity(ctx context.Context, typeName, field string, childComplexity int, rawArgs map[string]any) (int, bool) { + ec := executionContext{nil, e, 0, 0, nil} + _ = ec + switch typeName + "." + field { + + case "Entity.findPersonalizedByID": + if e.complexity.Entity.FindPersonalizedByID == nil { + break + } + + args, err := ec.field_Entity_findPersonalizedByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindPersonalizedByID(childComplexity, args["id"].(string)), true + + case "Entity.findViewerByID": + if e.complexity.Entity.FindViewerByID == nil { + break + } + + args, err := ec.field_Entity_findViewerByID_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindViewerByID(childComplexity, args["id"].(string)), true + + case "Personalized.currentViewer": + if e.complexity.Personalized.CurrentViewer == nil { + break + } + + return e.complexity.Personalized.CurrentViewer(childComplexity), true + + case "Personalized.id": + if e.complexity.Personalized.ID == nil { + break + } + + return e.complexity.Personalized.ID(childComplexity), true + + case "Query.currentViewer": + if e.complexity.Query.CurrentViewer == nil { + break + } + + return e.complexity.Query.CurrentViewer(childComplexity), true + + case "Query._service": + if e.complexity.Query.__resolve__service == nil { + break + } + + return e.complexity.Query.__resolve__service(childComplexity), true + + case "Query._entities": + if e.complexity.Query.__resolve_entities == nil { + break + } + + args, err := ec.field_Query__entities_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.__resolve_entities(childComplexity, args["representations"].([]map[string]any)), true + + case "Viewer.email": + if e.complexity.Viewer.Email == nil { + break + } + + return e.complexity.Viewer.Email(childComplexity), true + + case "Viewer.id": + if e.complexity.Viewer.ID == nil { + break + } + + return e.complexity.Viewer.ID(childComplexity), true + + case "Viewer.name": + if e.complexity.Viewer.Name == nil { + break + } + + return e.complexity.Viewer.Name(childComplexity), true + + case "_Service.sdl": + if e.complexity._Service.SDL == nil { + break + } + + return e.complexity._Service.SDL(childComplexity), true + + } + return 0, false +} + +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + opCtx := graphql.GetOperationContext(ctx) + ec := executionContext{opCtx, e, 0, 0, make(chan graphql.DeferredResult)} + inputUnmarshalMap := graphql.BuildUnmarshalerMap() + first := true + + switch opCtx.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + var response graphql.Response + var data graphql.Marshaler + if first { + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data = ec._Query(ctx, opCtx.Operation.SelectionSet) + } else { + if atomic.LoadInt32(&ec.pendingDeferred) > 0 { + result := <-ec.deferredResults + atomic.AddInt32(&ec.pendingDeferred, -1) + data = result.Result + response.Path = result.Path + response.Label = result.Label + response.Errors = result.Errors + } else { + return nil + } + } + var buf bytes.Buffer + data.MarshalGQL(&buf) + response.Data = buf.Bytes() + if atomic.LoadInt32(&ec.deferred) > 0 { + hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 + response.HasNext = &hasNext + } + + return &response + } + + default: + return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) + } +} + +type executionContext struct { + *graphql.OperationContext + *executableSchema + deferred int32 + pendingDeferred int32 + deferredResults chan graphql.DeferredResult +} + +func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) { + atomic.AddInt32(&ec.pendingDeferred, 1) + go func() { + ctx := graphql.WithFreshResponseContext(dg.Context) + dg.FieldSet.Dispatch(ctx) + ds := graphql.DeferredResult{ + Path: dg.Path, + Label: dg.Label, + Result: dg.FieldSet, + Errors: graphql.GetErrors(ctx), + } + // null fields should bubble up + if dg.FieldSet.Invalids > 0 { + ds.Result = graphql.Null + } + ec.deferredResults <- ds + }() +} + +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(ec.Schema()), nil +} + +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil +} + +var sources = []*ast.Source{ + {Name: "../schema.graphqls", Input: `extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key", "@interfaceObject", "@inaccessible"] + ) + +directive @requestScoped(key: String!) on FIELD_DEFINITION + +type Viewer @key(fields: "id") { + id: ID! + name: String! + email: String! +} + +# Symmetric @requestScoped: Query.currentViewer and Personalized.currentViewer +# share key "currentViewer" so they read/write the same L1 coordinate cache entry. +type Personalized @key(fields: "id") @interfaceObject { + id: ID! + currentViewer: Viewer @inaccessible @requestScoped(key: "currentViewer") +} + +type Query { + currentViewer: Viewer @requestScoped(key: "currentViewer") +} +`, BuiltIn: false}, + {Name: "../../federation/directives.graphql", Input: ` + directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM + directive @composeDirective(name: String!) repeatable on SCHEMA + directive @extends on OBJECT | INTERFACE + directive @external on OBJECT | FIELD_DEFINITION + directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE + directive @inaccessible on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + directive @interfaceObject on OBJECT + directive @link(import: [String!], url: String!) repeatable on SCHEMA + directive @override(from: String!, label: String) on FIELD_DEFINITION + directive @policy(policies: [[federation__Policy!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @provides(fields: FieldSet!) on FIELD_DEFINITION + directive @requires(fields: FieldSet!) on FIELD_DEFINITION + directive @requiresScopes(scopes: [[federation__Scope!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM + directive @shareable repeatable on FIELD_DEFINITION | OBJECT + directive @tag(name: String!) repeatable on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + scalar _Any + scalar FieldSet + scalar federation__Policy + scalar federation__Scope +`, BuiltIn: true}, + {Name: "../../federation/entity.graphql", Input: ` +# a union of all types that use the @key directive +union _Entity = Personalized | Viewer + +# fake type to build resolver interfaces for users to implement +type Entity { + findPersonalizedByID(id: ID!,): Personalized! + findViewerByID(id: ID!,): Viewer! +} + +type _Service { + sdl: String +} + +extend type Query { + _entities(representations: [_Any!]!): [_Entity]! + _service: _Service! +} +`, BuiltIn: true}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Entity_findPersonalizedByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findPersonalizedByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findPersonalizedByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Entity_findViewerByID_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Entity_findViewerByID_argsID(ctx, rawArgs) + if err != nil { + return nil, err + } + args["id"] = arg0 + return args, nil +} +func (ec *executionContext) field_Entity_findViewerByID_argsID( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["id"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query___type_argsName(ctx, rawArgs) + if err != nil { + return nil, err + } + args["name"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query___type_argsName( + ctx context.Context, + rawArgs map[string]any, +) (string, error) { + if _, ok := rawArgs["name"]; !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["name"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query__entities_argsRepresentations(ctx, rawArgs) + if err != nil { + return nil, err + } + args["representations"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query__entities_argsRepresentations( + ctx context.Context, + rawArgs map[string]any, +) ([]map[string]any, error) { + if _, ok := rawArgs["representations"]; !ok { + var zeroVal []map[string]any + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) + if tmp, ok := rawArgs["representations"]; ok { + return ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) + } + + var zeroVal []map[string]any + return zeroVal, nil +} + +func (ec *executionContext) field___Directive_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Directive_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Directive_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Field_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Field_args_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Field_args_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (*bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal *bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + } + + var zeroVal *bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_enumValues_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_enumValues_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field___Type_fields_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_fields_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]any, +) (bool, error) { + if _, ok := rawArgs["includeDeprecated"]; !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _Entity_findPersonalizedByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findPersonalizedByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindPersonalizedByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Personalized) + fc.Result = res + return ec.marshalNPersonalized2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐPersonalized(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findPersonalizedByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Personalized_id(ctx, field) + case "currentViewer": + return ec.fieldContext_Personalized_currentViewer(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Personalized", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findPersonalizedByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Entity_findViewerByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findViewerByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindViewerByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Viewer) + fc.Result = res + return ec.marshalNViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐViewer(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findViewerByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Viewer_id(ctx, field) + case "name": + return ec.fieldContext_Viewer_name(ctx, field) + case "email": + return ec.fieldContext_Viewer_email(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Viewer", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findViewerByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Personalized_id(ctx context.Context, field graphql.CollectedField, obj *model.Personalized) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Personalized_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Personalized_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Personalized", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Personalized_currentViewer(ctx context.Context, field graphql.CollectedField, obj *model.Personalized) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Personalized_currentViewer(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.CurrentViewer, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Viewer) + fc.Result = res + return ec.marshalOViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐViewer(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Personalized_currentViewer(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Personalized", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Viewer_id(ctx, field) + case "name": + return ec.fieldContext_Viewer_name(ctx, field) + case "email": + return ec.fieldContext_Viewer_email(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Viewer", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_currentViewer(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_currentViewer(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CurrentViewer(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Viewer) + fc.Result = res + return ec.marshalOViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐViewer(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_currentViewer(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Viewer_id(ctx, field) + case "name": + return ec.fieldContext_Viewer_name(ctx, field) + case "email": + return ec.fieldContext_Viewer_email(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Viewer", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__entities(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve_entities(ctx, fc.Args["representations"].([]map[string]any)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]fedruntime.Entity) + fc.Result = res + return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__entities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type _Entity does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query__entities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__service(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve__service(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(fedruntime.Service) + fc.Result = res + return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__service(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "sdl": + return ec.fieldContext__Service_sdl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___schema(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Viewer_id(ctx context.Context, field graphql.CollectedField, obj *model.Viewer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Viewer_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Viewer_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Viewer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Viewer_name(ctx context.Context, field graphql.CollectedField, obj *model.Viewer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Viewer_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Viewer_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Viewer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Viewer_email(ctx context.Context, field graphql.CollectedField, obj *model.Viewer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Viewer_email(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Email, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Viewer_email(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Viewer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext__Service_sdl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SDL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext__Service_sdl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "_Service", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsRepeatable, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Locations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __DirectiveLocation does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Directive_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Field_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "isDeprecated": + return ec.fieldContext___InputValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___InputValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "isOneOf": + return ec.fieldContext___Type_isOneOf(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_isOneOf(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_isOneOf(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsOneOf(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_isOneOf(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, obj fedruntime.Entity) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case model.Viewer: + return ec._Viewer(ctx, sel, &obj) + case *model.Viewer: + if obj == nil { + return graphql.Null + } + return ec._Viewer(ctx, sel, obj) + case model.Personalized: + return ec._Personalized(ctx, sel, &obj) + case *model.Personalized: + if obj == nil { + return graphql.Null + } + return ec._Personalized(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var entityImplementors = []string{"Entity"} + +func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Entity", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Entity") + case "findPersonalizedByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findPersonalizedByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findViewerByID": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findViewerByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var personalizedImplementors = []string{"Personalized", "_Entity"} + +func (ec *executionContext) _Personalized(ctx context.Context, sel ast.SelectionSet, obj *model.Personalized) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, personalizedImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Personalized") + case "id": + out.Values[i] = ec._Personalized_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "currentViewer": + out.Values[i] = ec._Personalized_currentViewer(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var queryImplementors = []string{"Query"} + +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "currentViewer": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_currentViewer(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "_entities": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__entities(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "_service": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__service(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "__type": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) + case "__schema": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var viewerImplementors = []string{"Viewer", "_Entity"} + +func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, obj *model.Viewer) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, viewerImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Viewer") + case "id": + out.Values[i] = ec._Viewer_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._Viewer_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "email": + out.Values[i] = ec._Viewer_email(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var _ServiceImplementors = []string{"_Service"} + +func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("_Service") + case "sdl": + out.Values[i] = ec.__Service_sdl(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __DirectiveImplementors = []string{"__Directive"} + +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "isRepeatable": + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __EnumValueImplementors = []string{"__EnumValue"} + +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __FieldImplementors = []string{"__Field"} + +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __InputValueImplementors = []string{"__InputValue"} + +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___InputValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___InputValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __SchemaImplementors = []string{"__Schema"} + +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Schema") + case "description": + out.Values[i] = ec.___Schema_description(ctx, field, obj) + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __TypeImplementors = []string{"__Type"} + +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "specifiedByURL": + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + case "isOneOf": + out.Values[i] = ec.___Type_isOneOf(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +// endregion **************************** object.gotpl **************************** + +// region ***************************** type.gotpl ***************************** + +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNFieldSet2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNID2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalID(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalID(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNPersonalized2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐPersonalized(ctx context.Context, sel ast.SelectionSet, v model.Personalized) graphql.Marshaler { + return ec._Personalized(ctx, sel, &v) +} + +func (ec *executionContext) marshalNPersonalized2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐPersonalized(ctx context.Context, sel ast.SelectionSet, v *model.Personalized) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Personalized(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNViewer2githubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐViewer(ctx context.Context, sel ast.SelectionSet, v model.Viewer) graphql.Marshaler { + return ec._Viewer(ctx, sel, &v) +} + +func (ec *executionContext) marshalNViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐViewer(ctx context.Context, sel ast.SelectionSet, v *model.Viewer) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Viewer(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v any) (map[string]any, error) { + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]any) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + _ = sel + res := graphql.MarshalMap(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v any) ([]map[string]any, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]map[string]any, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN_Any2map(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN_Any2ᚕmapᚄ(ctx context.Context, sel ast.SelectionSet, v []map[string]any) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalN_Any2map(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v []fedruntime.Entity) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { + return ec.__Service(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { + return ec.___Directive(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { + return ec.___EnumValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { + return ec.___Field(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { + return ec.___InputValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { + return ec.___Type(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Policy2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Policy2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Policy2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNfederation__Scope2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, v any) ([][]string, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([][]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNfederation__Scope2ᚕstringᚄ(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNfederation__Scope2ᚕstringᚄ(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v any) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalBoolean(v) + return res +} + +func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v any) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalBoolean(*v) + return res +} + +func (ec *executionContext) unmarshalOString2string(ctx context.Context, v any) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + _ = sel + _ = ctx + res := graphql.MarshalString(v) + return res +} + +func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) { + if v == nil { + return nil, nil + } + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v any) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalString(*v) + return res +} + +func (ec *executionContext) marshalOViewer2ᚖgithubᚗcomᚋwundergraphᚋcosmoᚋrouterᚑtestsᚋentity_cachingᚋsubgraphsᚋviewerᚋsubgraphᚋmodelᚐViewer(ctx context.Context, sel ast.SelectionSet, v *model.Viewer) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Viewer(ctx, sel, v) +} + +func (ec *executionContext) marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v fedruntime.Entity) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.__Entity(ctx, sel, v) +} + +func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Schema(ctx, sel, v) +} + +func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +// endregion ***************************** type.gotpl ***************************** diff --git a/router-tests/entity_caching/subgraphs/viewer/subgraph/generated/staticcheck.conf b/router-tests/entity_caching/subgraphs/viewer/subgraph/generated/staticcheck.conf new file mode 100644 index 0000000000..582953a07e --- /dev/null +++ b/router-tests/entity_caching/subgraphs/viewer/subgraph/generated/staticcheck.conf @@ -0,0 +1,2 @@ +# This is meant as a workaround to skip staticcheck checks for generated code +checks = ["all", "-SA4004", "-ST1000"] diff --git a/router-tests/entity_caching/subgraphs/viewer/subgraph/model/models_gen.go b/router-tests/entity_caching/subgraphs/viewer/subgraph/model/models_gen.go new file mode 100644 index 0000000000..85acb9e6a7 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/viewer/subgraph/model/models_gen.go @@ -0,0 +1,21 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package model + +type Personalized struct { + ID string `json:"id"` + CurrentViewer *Viewer `json:"currentViewer,omitempty"` +} + +func (Personalized) IsEntity() {} + +type Query struct { +} + +type Viewer struct { + ID string `json:"id"` + Name string `json:"name"` + Email string `json:"email"` +} + +func (Viewer) IsEntity() {} diff --git a/router-tests/entity_caching/subgraphs/viewer/subgraph/resolver.go b/router-tests/entity_caching/subgraphs/viewer/subgraph/resolver.go new file mode 100644 index 0000000000..c1da1a4335 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/viewer/subgraph/resolver.go @@ -0,0 +1,7 @@ +package subgraph + +// This file will not be regenerated automatically. +// +// It serves as dependency injection for your app, add any dependencies you require here. + +type Resolver struct{} diff --git a/router-tests/entity_caching/subgraphs/viewer/subgraph/schema.graphqls b/router-tests/entity_caching/subgraphs/viewer/subgraph/schema.graphqls new file mode 100644 index 0000000000..1c71175536 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/viewer/subgraph/schema.graphqls @@ -0,0 +1,24 @@ +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5" + import: ["@key", "@interfaceObject", "@inaccessible"] + ) + +directive @openfed__requestScoped(key: String!) on FIELD_DEFINITION + +type Viewer @key(fields: "id") { + id: ID! + name: String! + email: String! +} + +# Symmetric @openfed__requestScoped: Query.currentViewer and Personalized.currentViewer +# share key "currentViewer" so they read/write the same L1 coordinate cache entry. +type Personalized @key(fields: "id") @interfaceObject { + id: ID! + currentViewer: Viewer @inaccessible @openfed__requestScoped(key: "currentViewer") +} + +type Query { + currentViewer: Viewer @openfed__requestScoped(key: "currentViewer") +} diff --git a/router-tests/entity_caching/subgraphs/viewer/subgraph/schema.resolvers.go b/router-tests/entity_caching/subgraphs/viewer/subgraph/schema.resolvers.go new file mode 100644 index 0000000000..5e33abd37d --- /dev/null +++ b/router-tests/entity_caching/subgraphs/viewer/subgraph/schema.resolvers.go @@ -0,0 +1,22 @@ +package subgraph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.76 + +import ( + "context" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/viewer/subgraph/generated" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/viewer/subgraph/model" +) + +// CurrentViewer is the resolver for the currentViewer field. +func (r *queryResolver) CurrentViewer(ctx context.Context) (*model.Viewer, error) { + return defaultViewer(), nil +} + +// Query returns generated.QueryResolver implementation. +func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} } + +type queryResolver struct{ *Resolver } diff --git a/router-tests/entity_caching/subgraphs/viewer/viewer.go b/router-tests/entity_caching/subgraphs/viewer/viewer.go new file mode 100644 index 0000000000..7850f9a843 --- /dev/null +++ b/router-tests/entity_caching/subgraphs/viewer/viewer.go @@ -0,0 +1,14 @@ +package viewer + +import ( + "github.com/99designs/gqlgen/graphql" + + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/viewer/subgraph" + "github.com/wundergraph/cosmo/router-tests/entity_caching/subgraphs/viewer/subgraph/generated" +) + +func NewSchema() graphql.ExecutableSchema { + return generated.NewExecutableSchema(generated.Config{ + Resolvers: &subgraph.Resolver{}, + }) +} diff --git a/router-tests/entity_caching/testdata/config.json b/router-tests/entity_caching/testdata/config.json new file mode 100644 index 0000000000..7195049dac --- /dev/null +++ b/router-tests/entity_caching/testdata/config.json @@ -0,0 +1,929 @@ +{ + "engineConfig": { + "defaultFlushInterval": "500", + "datasourceConfigurations": [ + { + "kind": "GRAPHQL", + "rootNodes": [ + { + "typeName": "Query", + "fieldNames": [ + "item", + "itemByPid", + "items", + "itemsByIds", + "product", + "productBySku", + "productByName", + "productByKey", + "warehouse", + "warehouseByInput" + ] + }, + { + "typeName": "Mutation", + "fieldNames": [ + "updateItem", + "deleteItem", + "createItem", + "deleteProduct" + ] + }, + { + "typeName": "Subscription", + "fieldNames": [ + "itemUpdated", + "itemCreated" + ] + }, + { + "typeName": "Item", + "fieldNames": [ + "id", + "name", + "category" + ] + }, + { + "typeName": "Product", + "fieldNames": [ + "id", + "region", + "sku", + "name" + ] + }, + { + "typeName": "Warehouse", + "fieldNames": [ + "location", + "name" + ] + } + ], + "childNodes": [ + { + "typeName": "Location", + "fieldNames": [ + "id" + ] + } + ], + "overrideFieldPathFromAlias": true, + "customGraphql": { + "fetch": { + "url": { + "staticVariableContent": "http://items.entity-cache-test.local/graphql" + }, + "method": "POST", + "body": {}, + "baseUrl": {}, + "path": {} + }, + "subscription": { + "enabled": true, + "url": { + "staticVariableContent": "http://items.entity-cache-test.local/graphql" + }, + "protocol": "GRAPHQL_SUBSCRIPTION_PROTOCOL_WS", + "websocketSubprotocol": "GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO" + }, + "federation": { + "enabled": true, + "serviceSdl": "extend schema\n @link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\"@key\"]\n )\n\ndirective @openfed__entityCache(\n maxAge: Int!\n negativeCacheTTL: Int = 0\n includeHeaders: Boolean = false\n partialCacheLoad: Boolean = false\n shadowMode: Boolean = false\n) on OBJECT\n\ndirective @openfed__queryCache(\n maxAge: Int!\n includeHeaders: Boolean = false\n shadowMode: Boolean = false\n) on FIELD_DEFINITION\n\ndirective @openfed__cacheInvalidate on FIELD_DEFINITION\n\ndirective @openfed__cachePopulate(maxAge: Int) on FIELD_DEFINITION\n\ndirective @openfed__is(fields: String!) on ARGUMENT_DEFINITION\n\ntype Query {\n item(id: ID!): Item @openfed__queryCache(maxAge: 300)\n itemByPid(pid: ID! @openfed__is(fields: \"id\")): Item @openfed__queryCache(maxAge: 300)\n items: [Item!]! @openfed__queryCache(maxAge: 300)\n itemsByIds(ids: [ID!]! @openfed__is(fields: \"id\")): [Item!]! @openfed__queryCache(maxAge: 300)\n product(id: ID!, region: String!): Product @openfed__queryCache(maxAge: 300)\n productBySku(sku: String!): Product @openfed__queryCache(maxAge: 300)\n productByName(name: String!): Product @openfed__queryCache(maxAge: 300)\n productByKey(key: ProductKeyInput! @openfed__is(fields: \"id region\")): Product @openfed__queryCache(maxAge: 300)\n warehouse(locationId: ID! @openfed__is(fields: \"location.id\")): Warehouse @openfed__queryCache(maxAge: 300)\n # warehouseByInput exercises the same nested @key as `warehouse` but reaches it\n # via an input object using GraphQL selection syntax in @openfed__is. This produces the\n # multi-hop argumentPath [\"input\",\"location\",\"id\"] instead of the scalar\n # [\"locationId\"]. Captures the red state where input-object → nested-key\n # cache writes don't persist (cache lookup uses correct key but never hits).\n warehouseByInput(input: WarehouseLocationInput! @openfed__is(fields: \"location { id }\")): Warehouse @openfed__queryCache(maxAge: 300)\n}\n\ninput ProductKeyInput {\n id: ID!\n region: String!\n}\n\ninput WarehouseLocationInput {\n location: WarehouseLocationKeyInput!\n}\n\ninput WarehouseLocationKeyInput {\n id: ID!\n}\n\ntype Mutation {\n updateItem(id: ID!, name: String!): Item @openfed__cacheInvalidate\n deleteItem(id: ID!): Item @openfed__cacheInvalidate\n createItem(name: String!, category: String!): Item! @openfed__cachePopulate(maxAge: 60)\n # deleteProduct invalidates a composite-key entity (Product @key(\"id region\")).\n # Used to pin behavior for cache invalidation when the entity uses a composite\n # @key — a separate code path from the simple id-only key in deleteItem.\n deleteProduct(id: ID!, region: String!): Product @openfed__cacheInvalidate\n}\n\ntype Subscription {\n itemUpdated: Item @openfed__cacheInvalidate\n itemCreated: Item @openfed__cachePopulate\n}\n\ntype Item @key(fields: \"id\") @openfed__entityCache(maxAge: 300, negativeCacheTTL: 30) {\n id: ID!\n name: String!\n category: String!\n}\n\ntype Product @key(fields: \"id region\") @key(fields: \"sku\") @openfed__entityCache(maxAge: 300) {\n id: ID!\n region: String!\n sku: String!\n name: String!\n}\n\ntype Location {\n id: ID!\n}\n\ntype Warehouse @key(fields: \"location { id }\") @openfed__entityCache(maxAge: 300) {\n location: Location!\n name: String!\n}\n" + }, + "upstreamSchema": { + "key": "bd938246cff0199909aca1d5df40d042d917c954" + } + }, + "requestTimeoutSeconds": "10", + "id": "0", + "keys": [ + { + "typeName": "Item", + "selectionSet": "id" + }, + { + "typeName": "Product", + "selectionSet": "id region" + }, + { + "typeName": "Product", + "selectionSet": "sku" + }, + { + "typeName": "Warehouse", + "selectionSet": "location { id }" + } + ], + "entityCacheConfigurations": [ + { + "typeName": "Item", + "maxAgeSeconds": "300", + "notFoundCacheTtlSeconds": "30" + }, + { + "typeName": "Product", + "maxAgeSeconds": "300" + }, + { + "typeName": "Warehouse", + "maxAgeSeconds": "300" + } + ], + "rootFieldCacheConfigurations": [ + { + "fieldName": "item", + "maxAgeSeconds": "300", + "entityTypeName": "Item", + "entityKeyMappings": [ + { + "entityTypeName": "Item", + "fieldMappings": [ + { + "entityKeyField": "id", + "argumentPath": [ + "id" + ] + } + ] + } + ] + }, + { + "fieldName": "itemByPid", + "maxAgeSeconds": "300", + "entityTypeName": "Item", + "entityKeyMappings": [ + { + "entityTypeName": "Item", + "fieldMappings": [ + { + "entityKeyField": "id", + "argumentPath": [ + "pid" + ] + } + ] + } + ] + }, + { + "fieldName": "items", + "maxAgeSeconds": "300", + "entityTypeName": "Item" + }, + { + "fieldName": "itemsByIds", + "maxAgeSeconds": "300", + "entityTypeName": "Item", + "entityKeyMappings": [ + { + "entityTypeName": "Item", + "fieldMappings": [ + { + "entityKeyField": "id", + "argumentPath": [ + "ids" + ], + "isBatch": true + } + ] + } + ] + }, + { + "fieldName": "product", + "maxAgeSeconds": "300", + "entityTypeName": "Product", + "entityKeyMappings": [ + { + "entityTypeName": "Product", + "fieldMappings": [ + { + "entityKeyField": "id", + "argumentPath": [ + "id" + ] + }, + { + "entityKeyField": "region", + "argumentPath": [ + "region" + ] + } + ] + } + ] + }, + { + "fieldName": "productBySku", + "maxAgeSeconds": "300", + "entityTypeName": "Product", + "entityKeyMappings": [ + { + "entityTypeName": "Product", + "fieldMappings": [ + { + "entityKeyField": "sku", + "argumentPath": [ + "sku" + ] + } + ] + } + ] + }, + { + "fieldName": "productByName", + "maxAgeSeconds": "300", + "entityTypeName": "Product" + }, + { + "fieldName": "productByKey", + "maxAgeSeconds": "300", + "entityTypeName": "Product", + "entityKeyMappings": [ + { + "entityTypeName": "Product", + "fieldMappings": [ + { + "entityKeyField": "id", + "argumentPath": [ + "key", + "id" + ] + }, + { + "entityKeyField": "region", + "argumentPath": [ + "key", + "region" + ] + } + ] + } + ] + }, + { + "fieldName": "warehouse", + "maxAgeSeconds": "300", + "entityTypeName": "Warehouse", + "entityKeyMappings": [ + { + "entityTypeName": "Warehouse", + "fieldMappings": [ + { + "entityKeyField": "location.id", + "argumentPath": [ + "locationId" + ] + } + ] + } + ] + }, + { + "fieldName": "warehouseByInput", + "maxAgeSeconds": "300", + "entityTypeName": "Warehouse", + "entityKeyMappings": [ + { + "entityTypeName": "Warehouse", + "fieldMappings": [ + { + "entityKeyField": "location.id", + "argumentPath": [ + "input", + "location", + "id" + ] + } + ] + } + ] + } + ], + "cachePopulateConfigurations": [ + { + "fieldName": "createItem", + "operationType": "Mutation", + "maxAgeSeconds": "60", + "entityTypeName": "Item" + }, + { + "fieldName": "itemCreated", + "operationType": "Subscription", + "entityTypeName": "Item" + } + ], + "cacheInvalidateConfigurations": [ + { + "fieldName": "updateItem", + "operationType": "Mutation", + "entityTypeName": "Item" + }, + { + "fieldName": "deleteItem", + "operationType": "Mutation", + "entityTypeName": "Item" + }, + { + "fieldName": "deleteProduct", + "operationType": "Mutation", + "entityTypeName": "Product" + }, + { + "fieldName": "itemUpdated", + "operationType": "Subscription", + "entityTypeName": "Item" + } + ] + }, + { + "kind": "GRAPHQL", + "rootNodes": [ + { + "typeName": "Item", + "fieldNames": [ + "id", + "description", + "rating", + "tags" + ] + }, + { + "typeName": "Product", + "fieldNames": [ + "id", + "region", + "info" + ] + }, + { + "typeName": "Warehouse", + "fieldNames": [ + "location", + "capacity" + ] + } + ], + "childNodes": [ + { + "typeName": "Location", + "fieldNames": [ + "id" + ] + } + ], + "overrideFieldPathFromAlias": true, + "customGraphql": { + "fetch": { + "url": { + "staticVariableContent": "http://details.entity-cache-test.local/graphql" + }, + "method": "POST", + "body": {}, + "baseUrl": {}, + "path": {} + }, + "subscription": { + "enabled": true, + "url": { + "staticVariableContent": "http://details.entity-cache-test.local/graphql" + }, + "protocol": "GRAPHQL_SUBSCRIPTION_PROTOCOL_WS", + "websocketSubprotocol": "GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO" + }, + "federation": { + "enabled": true, + "serviceSdl": "extend schema\n @link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\"@key\"]\n )\n\ndirective @openfed__entityCache(\n maxAge: Int!\n includeHeaders: Boolean = false\n partialCacheLoad: Boolean = false\n shadowMode: Boolean = false\n) on OBJECT\n\ntype Item @key(fields: \"id\") @openfed__entityCache(maxAge: 300) {\n id: ID!\n description: String!\n rating: Float!\n tags: [String!]!\n}\n\ntype Product @key(fields: \"id region\") @openfed__entityCache(maxAge: 300) {\n id: ID!\n region: String!\n info: String!\n}\n\ntype Location {\n id: ID!\n}\n\ntype Warehouse @key(fields: \"location { id }\") @openfed__entityCache(maxAge: 300) {\n location: Location!\n capacity: Int!\n}\n" + }, + "upstreamSchema": { + "key": "c155dbdb80b10cafddd0f1f0379b57532dc3dcc7" + } + }, + "requestTimeoutSeconds": "10", + "id": "1", + "keys": [ + { + "typeName": "Item", + "selectionSet": "id" + }, + { + "typeName": "Product", + "selectionSet": "id region" + }, + { + "typeName": "Warehouse", + "selectionSet": "location { id }" + } + ], + "entityCacheConfigurations": [ + { + "typeName": "Item", + "maxAgeSeconds": "300" + }, + { + "typeName": "Product", + "maxAgeSeconds": "300" + }, + { + "typeName": "Warehouse", + "maxAgeSeconds": "300" + } + ] + }, + { + "kind": "GRAPHQL", + "rootNodes": [ + { + "typeName": "Item", + "fieldNames": [ + "id", + "available", + "count" + ] + } + ], + "overrideFieldPathFromAlias": true, + "customGraphql": { + "fetch": { + "url": { + "staticVariableContent": "http://inventory.entity-cache-test.local/graphql" + }, + "method": "POST", + "body": {}, + "baseUrl": {}, + "path": {} + }, + "subscription": { + "enabled": true, + "url": { + "staticVariableContent": "http://inventory.entity-cache-test.local/graphql" + }, + "protocol": "GRAPHQL_SUBSCRIPTION_PROTOCOL_WS", + "websocketSubprotocol": "GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO" + }, + "federation": { + "enabled": true, + "serviceSdl": "extend schema\n @link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\"@key\"]\n )\n\ndirective @openfed__entityCache(\n maxAge: Int!\n includeHeaders: Boolean = false\n partialCacheLoad: Boolean = false\n shadowMode: Boolean = false\n) on OBJECT\n\ntype Item @key(fields: \"id\") @openfed__entityCache(maxAge: 300) {\n id: ID!\n available: Boolean!\n count: Int!\n}\n" + }, + "upstreamSchema": { + "key": "f39f668358c7d91881c7b4b68f5387d7f18b9aad" + } + }, + "requestTimeoutSeconds": "10", + "id": "2", + "keys": [ + { + "typeName": "Item", + "selectionSet": "id" + } + ], + "entityCacheConfigurations": [ + { + "typeName": "Item", + "maxAgeSeconds": "300" + } + ] + }, + { + "kind": "GRAPHQL", + "rootNodes": [ + { + "typeName": "Viewer", + "fieldNames": [ + "id", + "name", + "email" + ] + }, + { + "typeName": "Personalized", + "fieldNames": [ + "id", + "currentViewer" + ] + }, + { + "typeName": "Query", + "fieldNames": [ + "currentViewer" + ] + }, + { + "typeName": "Article", + "fieldNames": [ + "id", + "currentViewer" + ] + } + ], + "overrideFieldPathFromAlias": true, + "customGraphql": { + "fetch": { + "url": { + "staticVariableContent": "http://viewer.entity-cache-test.local/graphql" + }, + "method": "POST", + "body": {}, + "baseUrl": {}, + "path": {} + }, + "subscription": { + "enabled": true, + "url": { + "staticVariableContent": "http://viewer.entity-cache-test.local/graphql" + }, + "protocol": "GRAPHQL_SUBSCRIPTION_PROTOCOL_WS", + "websocketSubprotocol": "GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO" + }, + "federation": { + "enabled": true, + "serviceSdl": "extend schema\n @link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\"@key\", \"@interfaceObject\", \"@inaccessible\"]\n )\n\ndirective @openfed__requestScoped(key: String!) on FIELD_DEFINITION\n\ntype Viewer @key(fields: \"id\") {\n id: ID!\n name: String!\n email: String!\n}\n\n# Symmetric @openfed__requestScoped: Query.currentViewer and Personalized.currentViewer\n# share key \"currentViewer\" so they read/write the same L1 coordinate cache entry.\ntype Personalized @key(fields: \"id\") @interfaceObject {\n id: ID!\n currentViewer: Viewer @inaccessible @openfed__requestScoped(key: \"currentViewer\")\n}\n\ntype Query {\n currentViewer: Viewer @openfed__requestScoped(key: \"currentViewer\")\n}\n" + }, + "upstreamSchema": { + "key": "9ee951b49b83d66e073d83402d78cd8078181571" + } + }, + "requestTimeoutSeconds": "10", + "id": "3", + "keys": [ + { + "typeName": "Viewer", + "selectionSet": "id" + }, + { + "typeName": "Personalized", + "selectionSet": "id" + }, + { + "typeName": "Article", + "selectionSet": "id" + } + ], + "interfaceObjects": [ + { + "interfaceTypeName": "Personalized", + "concreteTypeNames": [ + "Article" + ] + } + ], + "requestScopedFields": [ + { + "fieldName": "currentViewer", + "typeName": "Personalized", + "l1Key": "viewer.currentViewer" + }, + { + "fieldName": "currentViewer", + "typeName": "Query", + "l1Key": "viewer.currentViewer" + } + ] + }, + { + "kind": "GRAPHQL", + "rootNodes": [ + { + "typeName": "Query", + "fieldNames": [ + "articles" + ] + }, + { + "typeName": "Personalized", + "fieldNames": [ + "id" + ] + }, + { + "typeName": "Viewer", + "fieldNames": [ + "id", + "recommendedArticles" + ], + "externalFieldNames": [ + "name", + "email" + ] + }, + { + "typeName": "Article", + "fieldNames": [ + "id", + "title", + "body", + "tags", + "personalizedRecommendation", + "relatedArticles" + ], + "externalFieldNames": [ + "currentViewer" + ] + } + ], + "overrideFieldPathFromAlias": true, + "customGraphql": { + "fetch": { + "url": { + "staticVariableContent": "http://articles.entity-cache-test.local/graphql" + }, + "method": "POST", + "body": {}, + "baseUrl": {}, + "path": {} + }, + "subscription": { + "enabled": true, + "url": { + "staticVariableContent": "http://articles.entity-cache-test.local/graphql" + }, + "protocol": "GRAPHQL_SUBSCRIPTION_PROTOCOL_WS", + "websocketSubprotocol": "GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO" + }, + "federation": { + "enabled": true, + "serviceSdl": "extend schema\n @link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\"@key\", \"@external\", \"@requires\"]\n )\n\ntype Query {\n articles: [Article!]!\n}\n\ninterface Personalized @key(fields: \"id\") {\n id: ID!\n}\n\n# Extends Viewer with an edge back into articles land.\n# The @key forces sequencing: the articles _entities fetch for\n# recommendedArticles needs viewer.id from the prior viewer fetch, so the\n# planner cannot parallelize it with the root Query.currentViewer call.\n#\n# name and email are declared @external because Article.personalizedRecommendation\n# @requires references them. Composition fails without these declarations.\ntype Viewer @key(fields: \"id\") {\n id: ID!\n name: String! @external\n email: String! @external\n recommendedArticles: [Article!]!\n}\n\ntype Article implements Personalized @key(fields: \"id\") {\n id: ID!\n title: String!\n body: String!\n tags: [String!]!\n # Article.currentViewer is provided by the viewer subgraph via the\n # Personalized @interfaceObject. It is @external here so @requires can\n # reference it.\n currentViewer: Viewer @external\n # @requires a WIDER selection ({id, name, email}) than the root query\n # will ask for ({id, name}). This is the widening-miss trigger that the\n # test asserts: the coordinate L1 was populated with {id, name}, so the\n # follow-up _entities(Personalized) fetch fails the widening check and\n # refetches the viewer subgraph.\n personalizedRecommendation: String!\n @requires(fields: \"currentViewer { id name email }\")\n # relatedArticles enables nested selection of Article entities so tests\n # can exercise @openfed__requestScoped deduplication across multiple nesting\n # levels (Article.currentViewer selected inline at more than one depth).\n relatedArticles: [Article!]!\n}\n" + }, + "upstreamSchema": { + "key": "cf1e444bb26e20ccce317dd20e2f8da88671c87d" + } + }, + "requestTimeoutSeconds": "10", + "id": "4", + "keys": [ + { + "typeName": "Personalized", + "selectionSet": "id" + }, + { + "typeName": "Viewer", + "selectionSet": "id" + }, + { + "typeName": "Article", + "selectionSet": "id" + } + ], + "requires": [ + { + "typeName": "Article", + "fieldName": "personalizedRecommendation", + "selectionSet": "currentViewer { email id name }" + } + ], + "entityInterfaces": [ + { + "interfaceTypeName": "Personalized", + "concreteTypeNames": [ + "Article" + ] + } + ] + }, + { + "kind": "GRAPHQL", + "rootNodes": [ + { + "typeName": "Article", + "fieldNames": [ + "id", + "viewCount", + "rating", + "reviewSummary" + ] + } + ], + "overrideFieldPathFromAlias": true, + "customGraphql": { + "fetch": { + "url": { + "staticVariableContent": "http://articlesmeta.entity-cache-test.local/graphql" + }, + "method": "POST", + "body": {}, + "baseUrl": {}, + "path": {} + }, + "subscription": { + "enabled": true, + "url": { + "staticVariableContent": "http://articlesmeta.entity-cache-test.local/graphql" + }, + "protocol": "GRAPHQL_SUBSCRIPTION_PROTOCOL_WS", + "websocketSubprotocol": "GRAPHQL_WEBSOCKET_SUBPROTOCOL_AUTO" + }, + "federation": { + "enabled": true, + "serviceSdl": "extend schema\n @link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\"@key\"]\n )\n\ntype Article @key(fields: \"id\") {\n id: ID!\n viewCount: Int!\n rating: Float!\n reviewSummary: String!\n}\n" + }, + "upstreamSchema": { + "key": "26317d3464ef1d47aa8354694ea00cc787b1caef" + } + }, + "requestTimeoutSeconds": "10", + "id": "5", + "keys": [ + { + "typeName": "Article", + "selectionSet": "id" + } + ] + } + ], + "fieldConfigurations": [ + { + "typeName": "Query", + "fieldName": "item", + "argumentsConfiguration": [ + { + "name": "id", + "sourceType": "FIELD_ARGUMENT" + } + ] + }, + { + "typeName": "Query", + "fieldName": "itemByPid", + "argumentsConfiguration": [ + { + "name": "pid", + "sourceType": "FIELD_ARGUMENT" + } + ] + }, + { + "typeName": "Query", + "fieldName": "itemsByIds", + "argumentsConfiguration": [ + { + "name": "ids", + "sourceType": "FIELD_ARGUMENT" + } + ] + }, + { + "typeName": "Query", + "fieldName": "product", + "argumentsConfiguration": [ + { + "name": "id", + "sourceType": "FIELD_ARGUMENT" + }, + { + "name": "region", + "sourceType": "FIELD_ARGUMENT" + } + ] + }, + { + "typeName": "Query", + "fieldName": "productBySku", + "argumentsConfiguration": [ + { + "name": "sku", + "sourceType": "FIELD_ARGUMENT" + } + ] + }, + { + "typeName": "Query", + "fieldName": "productByName", + "argumentsConfiguration": [ + { + "name": "name", + "sourceType": "FIELD_ARGUMENT" + } + ] + }, + { + "typeName": "Query", + "fieldName": "productByKey", + "argumentsConfiguration": [ + { + "name": "key", + "sourceType": "FIELD_ARGUMENT" + } + ] + }, + { + "typeName": "Query", + "fieldName": "warehouse", + "argumentsConfiguration": [ + { + "name": "locationId", + "sourceType": "FIELD_ARGUMENT" + } + ] + }, + { + "typeName": "Query", + "fieldName": "warehouseByInput", + "argumentsConfiguration": [ + { + "name": "input", + "sourceType": "FIELD_ARGUMENT" + } + ] + }, + { + "typeName": "Mutation", + "fieldName": "updateItem", + "argumentsConfiguration": [ + { + "name": "id", + "sourceType": "FIELD_ARGUMENT" + }, + { + "name": "name", + "sourceType": "FIELD_ARGUMENT" + } + ] + }, + { + "typeName": "Mutation", + "fieldName": "deleteItem", + "argumentsConfiguration": [ + { + "name": "id", + "sourceType": "FIELD_ARGUMENT" + } + ] + }, + { + "typeName": "Mutation", + "fieldName": "createItem", + "argumentsConfiguration": [ + { + "name": "name", + "sourceType": "FIELD_ARGUMENT" + }, + { + "name": "category", + "sourceType": "FIELD_ARGUMENT" + } + ] + }, + { + "typeName": "Mutation", + "fieldName": "deleteProduct", + "argumentsConfiguration": [ + { + "name": "id", + "sourceType": "FIELD_ARGUMENT" + }, + { + "name": "region", + "sourceType": "FIELD_ARGUMENT" + } + ] + } + ], + "graphqlSchema": "directive @inaccessible on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION\n\ntype Query {\n item(id: ID!): Item\n itemByPid(pid: ID!): Item\n items: [Item!]!\n itemsByIds(ids: [ID!]!): [Item!]!\n product(id: ID!, region: String!): Product\n productBySku(sku: String!): Product\n productByName(name: String!): Product\n productByKey(key: ProductKeyInput!): Product\n warehouse(locationId: ID!): Warehouse\n warehouseByInput(input: WarehouseLocationInput!): Warehouse\n currentViewer: Viewer\n articles: [Article!]!\n}\n\ninput ProductKeyInput {\n id: ID!\n region: String!\n}\n\ninput WarehouseLocationInput {\n location: WarehouseLocationKeyInput!\n}\n\ninput WarehouseLocationKeyInput {\n id: ID!\n}\n\ntype Mutation {\n updateItem(id: ID!, name: String!): Item\n deleteItem(id: ID!): Item\n createItem(name: String!, category: String!): Item!\n deleteProduct(id: ID!, region: String!): Product\n}\n\ntype Subscription {\n itemUpdated: Item\n itemCreated: Item\n}\n\ntype Item {\n id: ID!\n name: String!\n category: String!\n description: String!\n rating: Float!\n tags: [String!]!\n available: Boolean!\n count: Int!\n}\n\ntype Product {\n id: ID!\n region: String!\n sku: String!\n name: String!\n info: String!\n}\n\ntype Location {\n id: ID!\n}\n\ntype Warehouse {\n location: Location!\n name: String!\n capacity: Int!\n}\n\ntype Viewer {\n id: ID!\n name: String!\n email: String!\n recommendedArticles: [Article!]!\n}\n\ninterface Personalized {\n id: ID!\n currentViewer: Viewer\n}\n\ntype Article implements Personalized {\n id: ID!\n title: String!\n body: String!\n tags: [String!]!\n currentViewer: Viewer\n personalizedRecommendation: String!\n relatedArticles: [Article!]!\n viewCount: Int!\n rating: Float!\n reviewSummary: String!\n}", + "stringStorage": { + "bd938246cff0199909aca1d5df40d042d917c954": "schema {\n query: Query\n mutation: Mutation\n subscription: Subscription\n}\n\ndirective @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT\n\ndirective @link(as: String, for: link__Purpose, import: [link__Import], url: String!) repeatable on SCHEMA\n\ndirective @openfed__cacheInvalidate on FIELD_DEFINITION\n\ndirective @openfed__cachePopulate(maxAge: Int) on FIELD_DEFINITION\n\ndirective @openfed__entityCache(includeHeaders: Boolean = false, maxAge: Int!, negativeCacheTTL: Int = 0, partialCacheLoad: Boolean = false, shadowMode: Boolean = false) on OBJECT\n\ndirective @openfed__is(fields: String!) on ARGUMENT_DEFINITION\n\ndirective @openfed__queryCache(includeHeaders: Boolean = false, maxAge: Int!, shadowMode: Boolean = false) on FIELD_DEFINITION\n\ntype Item @key(fields: \"id\") @openfed__entityCache(maxAge: 300, negativeCacheTTL: 30) {\n category: String!\n id: ID!\n name: String!\n}\n\ntype Location {\n id: ID!\n}\n\ntype Mutation {\n createItem(category: String!, name: String!): Item! @openfed__cachePopulate(maxAge: 60)\n deleteItem(id: ID!): Item @openfed__cacheInvalidate\n deleteProduct(id: ID!, region: String!): Product @openfed__cacheInvalidate\n updateItem(id: ID!, name: String!): Item @openfed__cacheInvalidate\n}\n\ntype Product @key(fields: \"id region\") @key(fields: \"sku\") @openfed__entityCache(maxAge: 300) {\n id: ID!\n name: String!\n region: String!\n sku: String!\n}\n\ninput ProductKeyInput {\n id: ID!\n region: String!\n}\n\ntype Query {\n item(id: ID!): Item @openfed__queryCache(maxAge: 300)\n itemByPid(pid: ID! @openfed__is(fields: \"id\")): Item @openfed__queryCache(maxAge: 300)\n items: [Item!]! @openfed__queryCache(maxAge: 300)\n itemsByIds(ids: [ID!]! @openfed__is(fields: \"id\")): [Item!]! @openfed__queryCache(maxAge: 300)\n product(id: ID!, region: String!): Product @openfed__queryCache(maxAge: 300)\n productByKey(key: ProductKeyInput! @openfed__is(fields: \"id region\")): Product @openfed__queryCache(maxAge: 300)\n productByName(name: String!): Product @openfed__queryCache(maxAge: 300)\n productBySku(sku: String!): Product @openfed__queryCache(maxAge: 300)\n warehouse(locationId: ID! @openfed__is(fields: \"location.id\")): Warehouse @openfed__queryCache(maxAge: 300)\n warehouseByInput(input: WarehouseLocationInput! @openfed__is(fields: \"location { id }\")): Warehouse @openfed__queryCache(maxAge: 300)\n}\n\ntype Subscription {\n itemCreated: Item @openfed__cachePopulate\n itemUpdated: Item @openfed__cacheInvalidate\n}\n\ntype Warehouse @key(fields: \"location { id }\") @openfed__entityCache(maxAge: 300) {\n location: Location!\n name: String!\n}\n\ninput WarehouseLocationInput {\n location: WarehouseLocationKeyInput!\n}\n\ninput WarehouseLocationKeyInput {\n id: ID!\n}\n\nscalar link__Import\n\nenum link__Purpose {\n EXECUTION\n SECURITY\n}\n\nscalar openfed__FieldSet", + "c155dbdb80b10cafddd0f1f0379b57532dc3dcc7": "directive @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT\n\ndirective @link(as: String, for: link__Purpose, import: [link__Import], url: String!) repeatable on SCHEMA\n\ndirective @openfed__entityCache(includeHeaders: Boolean = false, maxAge: Int!, negativeCacheTTL: Int = 0, partialCacheLoad: Boolean = false, shadowMode: Boolean = false) on OBJECT\n\ntype Item @key(fields: \"id\") @openfed__entityCache(maxAge: 300) {\n description: String!\n id: ID!\n rating: Float!\n tags: [String!]!\n}\n\ntype Location {\n id: ID!\n}\n\ntype Product @key(fields: \"id region\") @openfed__entityCache(maxAge: 300) {\n id: ID!\n info: String!\n region: String!\n}\n\ntype Warehouse @key(fields: \"location { id }\") @openfed__entityCache(maxAge: 300) {\n capacity: Int!\n location: Location!\n}\n\nscalar link__Import\n\nenum link__Purpose {\n EXECUTION\n SECURITY\n}\n\nscalar openfed__FieldSet", + "f39f668358c7d91881c7b4b68f5387d7f18b9aad": "directive @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT\n\ndirective @link(as: String, for: link__Purpose, import: [link__Import], url: String!) repeatable on SCHEMA\n\ndirective @openfed__entityCache(includeHeaders: Boolean = false, maxAge: Int!, negativeCacheTTL: Int = 0, partialCacheLoad: Boolean = false, shadowMode: Boolean = false) on OBJECT\n\ntype Item @key(fields: \"id\") @openfed__entityCache(maxAge: 300) {\n available: Boolean!\n count: Int!\n id: ID!\n}\n\nscalar link__Import\n\nenum link__Purpose {\n EXECUTION\n SECURITY\n}\n\nscalar openfed__FieldSet", + "9ee951b49b83d66e073d83402d78cd8078181571": "schema {\n query: Query\n}\n\ndirective @inaccessible on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION\n\ndirective @interfaceObject on OBJECT\n\ndirective @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT\n\ndirective @link(as: String, for: link__Purpose, import: [link__Import], url: String!) repeatable on SCHEMA\n\ndirective @openfed__requestScoped(key: String!) on FIELD_DEFINITION\n\ntype Personalized @key(fields: \"id\") @interfaceObject {\n currentViewer: Viewer @inaccessible @openfed__requestScoped(key: \"currentViewer\")\n id: ID!\n}\n\ntype Query {\n currentViewer: Viewer @openfed__requestScoped(key: \"currentViewer\")\n}\n\ntype Viewer @key(fields: \"id\") {\n email: String!\n id: ID!\n name: String!\n}\n\nscalar link__Import\n\nenum link__Purpose {\n EXECUTION\n SECURITY\n}\n\nscalar openfed__FieldSet", + "cf1e444bb26e20ccce317dd20e2f8da88671c87d": "schema {\n query: Query\n}\n\ndirective @external on FIELD_DEFINITION | OBJECT\n\ndirective @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT\n\ndirective @link(as: String, for: link__Purpose, import: [link__Import], url: String!) repeatable on SCHEMA\n\ndirective @requires(fields: openfed__FieldSet!) on FIELD_DEFINITION\n\ntype Article implements Personalized @key(fields: \"id\") {\n body: String!\n currentViewer: Viewer @external\n id: ID!\n personalizedRecommendation: String! @requires(fields: \"currentViewer { id name email }\")\n relatedArticles: [Article!]!\n tags: [String!]!\n title: String!\n}\n\ninterface Personalized @key(fields: \"id\") {\n id: ID!\n}\n\ntype Query {\n articles: [Article!]!\n}\n\ntype Viewer @key(fields: \"id\") {\n email: String! @external\n id: ID!\n name: String! @external\n recommendedArticles: [Article!]!\n}\n\nscalar link__Import\n\nenum link__Purpose {\n EXECUTION\n SECURITY\n}\n\nscalar openfed__FieldSet", + "26317d3464ef1d47aa8354694ea00cc787b1caef": "directive @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT\n\ndirective @link(as: String, for: link__Purpose, import: [link__Import], url: String!) repeatable on SCHEMA\n\ntype Article @key(fields: \"id\") {\n id: ID!\n rating: Float!\n reviewSummary: String!\n viewCount: Int!\n}\n\nscalar link__Import\n\nenum link__Purpose {\n EXECUTION\n SECURITY\n}\n\nscalar openfed__FieldSet" + }, + "graphqlClientSchema": "type Query {\n item(id: ID!): Item\n itemByPid(pid: ID!): Item\n items: [Item!]!\n itemsByIds(ids: [ID!]!): [Item!]!\n product(id: ID!, region: String!): Product\n productBySku(sku: String!): Product\n productByName(name: String!): Product\n productByKey(key: ProductKeyInput!): Product\n warehouse(locationId: ID!): Warehouse\n warehouseByInput(input: WarehouseLocationInput!): Warehouse\n currentViewer: Viewer\n articles: [Article!]!\n}\n\ninput ProductKeyInput {\n id: ID!\n region: String!\n}\n\ninput WarehouseLocationInput {\n location: WarehouseLocationKeyInput!\n}\n\ninput WarehouseLocationKeyInput {\n id: ID!\n}\n\ntype Mutation {\n updateItem(id: ID!, name: String!): Item\n deleteItem(id: ID!): Item\n createItem(name: String!, category: String!): Item!\n deleteProduct(id: ID!, region: String!): Product\n}\n\ntype Subscription {\n itemUpdated: Item\n itemCreated: Item\n}\n\ntype Item {\n id: ID!\n name: String!\n category: String!\n description: String!\n rating: Float!\n tags: [String!]!\n available: Boolean!\n count: Int!\n}\n\ntype Product {\n id: ID!\n region: String!\n sku: String!\n name: String!\n info: String!\n}\n\ntype Location {\n id: ID!\n}\n\ntype Warehouse {\n location: Location!\n name: String!\n capacity: Int!\n}\n\ntype Viewer {\n id: ID!\n name: String!\n email: String!\n recommendedArticles: [Article!]!\n}\n\ninterface Personalized {\n id: ID!\n}\n\ntype Article implements Personalized {\n id: ID!\n title: String!\n body: String!\n tags: [String!]!\n currentViewer: Viewer\n personalizedRecommendation: String!\n relatedArticles: [Article!]!\n viewCount: Int!\n rating: Float!\n reviewSummary: String!\n}" + }, + "subgraphs": [ + { + "id": "0", + "name": "items", + "routingUrl": "http://items.entity-cache-test.local/graphql" + }, + { + "id": "1", + "name": "details", + "routingUrl": "http://details.entity-cache-test.local/graphql" + }, + { + "id": "2", + "name": "inventory", + "routingUrl": "http://inventory.entity-cache-test.local/graphql" + }, + { + "id": "3", + "name": "viewer", + "routingUrl": "http://viewer.entity-cache-test.local/graphql" + }, + { + "id": "4", + "name": "articles", + "routingUrl": "http://articles.entity-cache-test.local/graphql" + }, + { + "id": "5", + "name": "articlesmeta", + "routingUrl": "http://articlesmeta.entity-cache-test.local/graphql" + } + ], + "compatibilityVersion": "1:{{$COMPOSITION__VERSION}}" +} diff --git a/router-tests/entity_caching_standard_subgraphs_test.go b/router-tests/entity_caching_standard_subgraphs_test.go new file mode 100644 index 0000000000..b39e63ca46 --- /dev/null +++ b/router-tests/entity_caching_standard_subgraphs_test.go @@ -0,0 +1,291 @@ +package integration + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/wundergraph/cosmo/router-tests/testenv" + "github.com/wundergraph/cosmo/router/core" + nodev1 "github.com/wundergraph/cosmo/router/gen/proto/wg/cosmo/node/v1" + "github.com/wundergraph/cosmo/router/pkg/config" + "github.com/wundergraph/cosmo/router/pkg/entitycache" + "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve" +) + +func newEntityMemoryCache(t *testing.T) *entitycache.MemoryEntityCache { + t.Helper() + c, err := entitycache.NewMemoryEntityCache(10 * 1024 * 1024) // 10MB for tests + require.NoError(t, err) + t.Cleanup(func() { _ = c.Close() }) + return c +} + +// entityCachingConfig returns RouterOptions that enable entity caching with +// the given MemoryEntityCache as the default L2 cache. +func entityCachingConfig(cache *entitycache.MemoryEntityCache) []core.Option { + return []core.Option{ + core.WithEntityCaching(config.EntityCachingConfiguration{ + Enabled: true, + L1: config.EntityCachingL1Configuration{ + Enabled: true, + }, + L2: config.EntityCachingL2Configuration{ + Enabled: true, + }, + }), + core.WithEntityCacheInstances(map[string]resolve.LoaderCache{ + "default": cache, + }), + } +} + +// addEntityCacheConfig adds entity cache configuration to all datasources +// in the router config with the given TTL in seconds. +func addEntityCacheConfig(routerConfig *nodev1.RouterConfig, ttlSeconds int64) { + for _, ds := range routerConfig.EngineConfig.DatasourceConfigurations { + for _, key := range ds.Keys { + if key.DisableEntityResolver { + continue + } + ds.EntityCacheConfigurations = append(ds.EntityCacheConfigurations, &nodev1.EntityCacheConfiguration{ + TypeName: key.TypeName, + MaxAgeSeconds: ttlSeconds, + }) + } + } +} + +func TestEntityCaching(t *testing.T) { + t.Parallel() + + // Cross-subgraph query: employee root from employees subgraph, + // products field resolved by products subgraph via _entities. + // Entity caching intercepts the _entities call. + const crossSubgraphQuery = `{ employee(id: 1) { id products } }` + + t.Run("basic L2 miss then hit", func(t *testing.T) { + t.Parallel() + + cache := newEntityMemoryCache(t) + testenv.Run(t, &testenv.Config{ + RouterOptions: entityCachingConfig(cache), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + addEntityCacheConfig(routerConfig, 300) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + // First request: cache miss, both employees and products subgraphs called + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: crossSubgraphQuery}) + require.Contains(t, res.Body, `"products"`) + + productsCountAfterFirst := xEnv.SubgraphRequestCount.Products.Load() + require.Equal(t, int64(1), productsCountAfterFirst) + + // Second request: entity cache hit, products subgraph NOT called again + res2 := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: crossSubgraphQuery}) + require.Equal(t, res.Body, res2.Body) + require.Equal(t, int64(1), xEnv.SubgraphRequestCount.Products.Load()) + }) + }) + + t.Run("different entities produce separate cache entries", func(t *testing.T) { + t.Parallel() + + cache := newEntityMemoryCache(t) + testenv.Run(t, &testenv.Config{ + RouterOptions: entityCachingConfig(cache), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + addEntityCacheConfig(routerConfig, 300) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + // Fetch employee 1 products + res1 := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ employee(id: 1) { id products } }`, + }) + require.Contains(t, res1.Body, `"products"`) + + // Fetch employee 3 products (different entity — cache miss) + res2 := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ employee(id: 3) { id products } }`, + }) + require.Contains(t, res2.Body, `"products"`) + + // Products subgraph called twice (once per distinct employee) + require.Equal(t, int64(2), xEnv.SubgraphRequestCount.Products.Load()) + + // Now re-fetch employee 1 — should be cached + res3 := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ employee(id: 1) { id products } }`, + }) + require.Equal(t, res1.Body, res3.Body) + require.Equal(t, int64(2), xEnv.SubgraphRequestCount.Products.Load()) + }) + }) + + t.Run("multi-subgraph entity caching", func(t *testing.T) { + t.Parallel() + + cache := newEntityMemoryCache(t) + testenv.Run(t, &testenv.Config{ + RouterOptions: entityCachingConfig(cache), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + addEntityCacheConfig(routerConfig, 300) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + // First query hits products subgraph via _entities + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ employee(id: 1) { id products } }`, + }) + require.Contains(t, res.Body, `"products"`) + require.Equal(t, int64(1), xEnv.SubgraphRequestCount.Products.Load()) + + // Second query hits availability subgraph via _entities + res2 := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ employee(id: 1) { id isAvailable } }`, + }) + require.Contains(t, res2.Body, `"isAvailable"`) + require.Equal(t, int64(1), xEnv.SubgraphRequestCount.Availability.Load()) + + // Re-fetch both: products and availability should be cached + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ employee(id: 1) { id products } }`, + }) + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: `{ employee(id: 1) { id isAvailable } }`, + }) + require.Equal(t, int64(1), xEnv.SubgraphRequestCount.Products.Load()) + require.Equal(t, int64(1), xEnv.SubgraphRequestCount.Availability.Load()) + }) + }) + + t.Run("per-subgraph cache name routes to separate instances", func(t *testing.T) { + t.Parallel() + + defaultCache := newEntityMemoryCache(t) + customCache := newEntityMemoryCache(t) + + testenv.Run(t, &testenv.Config{ + RouterOptions: []core.Option{ + core.WithEntityCaching(config.EntityCachingConfiguration{ + Enabled: true, + L1: config.EntityCachingL1Configuration{Enabled: true}, + L2: config.EntityCachingL2Configuration{Enabled: true}, + SubgraphCacheOverrides: []config.EntityCachingSubgraphCacheOverride{ + { + Name: "products", + Entities: []config.EntityCachingEntityConfig{ + {Type: "Employee", StorageProviderID: "custom"}, + }, + }, + }, + }), + core.WithEntityCacheInstances(map[string]resolve.LoaderCache{ + "default": defaultCache, + "custom": customCache, + }), + }, + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + addEntityCacheConfig(routerConfig, 300) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{ + Query: crossSubgraphQuery, + }) + require.Contains(t, res.Body, `"products"`) + + // The custom cache should have entries (Employee on products routed to "custom") + require.Equal(t, 1, customCache.Len()) + }) + }) + + t.Run("shadow mode always fetches from subgraph", func(t *testing.T) { + t.Parallel() + + cache := newEntityMemoryCache(t) + testenv.Run(t, &testenv.Config{ + RouterOptions: entityCachingConfig(cache), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + for _, ds := range routerConfig.EngineConfig.DatasourceConfigurations { + for _, key := range ds.Keys { + if key.DisableEntityResolver { + continue + } + ds.EntityCacheConfigurations = append(ds.EntityCacheConfigurations, &nodev1.EntityCacheConfiguration{ + TypeName: key.TypeName, + MaxAgeSeconds: 300, + ShadowMode: true, + }) + } + } + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + // First request + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: crossSubgraphQuery}) + require.Contains(t, res.Body, `"products"`) + productsFirst := xEnv.SubgraphRequestCount.Products.Load() + + // Second request: in shadow mode, subgraph ALWAYS called + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: crossSubgraphQuery}) + require.Equal(t, productsFirst+1, xEnv.SubgraphRequestCount.Products.Load()) + }) + }) + + t.Run("list query with caching", func(t *testing.T) { + t.Parallel() + + cache := newEntityMemoryCache(t) + testenv.Run(t, &testenv.Config{ + RouterOptions: entityCachingConfig(cache), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + addEntityCacheConfig(routerConfig, 300) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + // List query that fetches multiple employees with cross-subgraph products + query := `{ employees { id products } }` + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: query}) + require.Contains(t, res.Body, `"employees"`) + productsFirst := xEnv.SubgraphRequestCount.Products.Load() + require.Equal(t, int64(1), productsFirst) + + // Second list query: all _entities calls should be cached + res2 := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: query}) + require.Equal(t, res.Body, res2.Body) + require.Equal(t, int64(1), xEnv.SubgraphRequestCount.Products.Load()) + }) + }) + + t.Run("disabled caching does not cache", func(t *testing.T) { + t.Parallel() + + testenv.Run(t, &testenv.Config{ + // No entity caching options + }, func(t *testing.T, xEnv *testenv.Environment) { + res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: crossSubgraphQuery}) + require.Contains(t, res.Body, `"products"`) + productsFirst := xEnv.SubgraphRequestCount.Products.Load() + + // Second request: products subgraph called again (no caching) + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: crossSubgraphQuery}) + require.Equal(t, productsFirst+1, xEnv.SubgraphRequestCount.Products.Load()) + }) + }) + + t.Run("cache entries written to L2", func(t *testing.T) { + t.Parallel() + + cache := newEntityMemoryCache(t) + testenv.Run(t, &testenv.Config{ + RouterOptions: entityCachingConfig(cache), + ModifyRouterConfig: func(routerConfig *nodev1.RouterConfig) { + addEntityCacheConfig(routerConfig, 300) + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + require.Equal(t, 0, cache.Len()) + + xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{Query: crossSubgraphQuery}) + + // After first request, cache should have entries + require.Equal(t, 1, cache.Len()) + }) + }) +} diff --git a/router-tests/go.mod b/router-tests/go.mod index 8b6cf45645..29429854f4 100644 --- a/router-tests/go.mod +++ b/router-tests/go.mod @@ -4,7 +4,9 @@ go 1.25.0 require ( connectrpc.com/connect v1.19.1 + github.com/99designs/gqlgen v0.17.76 github.com/MicahParks/jwkset v0.11.0 + github.com/alicebob/miniredis/v2 v2.34.0 github.com/buger/jsonparser v1.1.2 github.com/cloudflare/backoff v0.0.0-20240920015135-e46b80a3a7d0 github.com/golang-jwt/jwt/v5 v5.3.0 @@ -24,12 +26,14 @@ require ( github.com/stretchr/testify v1.11.1 github.com/twmb/franz-go v1.16.1 github.com/twmb/franz-go/pkg/kadm v1.11.0 - github.com/wundergraph/astjson v1.1.0 - github.com/wundergraph/cosmo/demo v0.0.0-20260213130455-6e3277e7b850 + github.com/vektah/gqlparser/v2 v2.5.30 + github.com/wundergraph/astjson v1.1.1-0.20260419105127-f600d161463f + github.com/wundergraph/cosmo/composition-go v0.0.0-20250820135159-bf8852195d3f + github.com/wundergraph/cosmo/demo v0.0.0-20260319123623-f186a0f724f6 github.com/wundergraph/cosmo/demo/pkg/subgraphs/projects v0.0.0-20250715110703-10f2e5f9c79e - github.com/wundergraph/cosmo/router v0.0.0-20260318232543-0e5fa811a191 + github.com/wundergraph/cosmo/router v0.0.0-20260319123623-f186a0f724f6 github.com/wundergraph/cosmo/router-plugin v0.0.0-20250808194725-de123ba1c65e - github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.269 + github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.270.0.20260419221936-771759beca58 go.opentelemetry.io/otel v1.39.0 go.opentelemetry.io/otel/sdk v1.39.0 go.opentelemetry.io/otel/sdk/metric v1.39.0 @@ -46,10 +50,10 @@ require ( require ( connectrpc.com/vanguard v0.3.0 // indirect - github.com/99designs/gqlgen v0.17.76 // indirect github.com/KimMachineGun/automemlimit v0.6.1 // indirect github.com/MicahParks/keyfunc/v3 v3.6.2 // indirect github.com/agnivade/levenshtein v1.2.1 // indirect + github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 // indirect github.com/andybalholm/brotli v1.1.0 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/benbjohnson/clock v1.3.0 // indirect @@ -68,10 +72,12 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgraph-io/ristretto/v2 v2.4.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/dlclark/regexp2 v1.11.0 // indirect github.com/docker/cli v29.2.0+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker-credential-helpers v0.9.3 // indirect github.com/docker/go-units v0.5.0 // indirect + github.com/dop251/goja v0.0.0-20230906160731-9410bcaa81d2 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/expr-lang/expr v1.17.7 // indirect github.com/fatih/color v1.18.0 // indirect @@ -82,6 +88,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-redis/redis_rate/v10 v10.0.1 // indirect + github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/gobwas/httphead v0.1.0 // indirect github.com/gobwas/pool v0.2.1 // indirect @@ -91,6 +98,7 @@ require ( github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/jsonschema-go v0.4.2 // indirect + github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect @@ -154,11 +162,11 @@ require ( github.com/twmb/franz-go/pkg/kmsg v1.7.0 // indirect github.com/urfave/cli/v2 v2.27.7 // indirect github.com/vbatts/tar-split v0.12.1 // indirect - github.com/vektah/gqlparser/v2 v2.5.30 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect - github.com/wundergraph/go-arena v1.1.0 // indirect + github.com/wundergraph/go-arena v1.2.0 // indirect github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 // indirect github.com/yosida95/uritemplate/v3 v3.0.2 // indirect + github.com/yuin/gopher-lua v1.1.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.23.0 // indirect @@ -186,6 +194,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect + rogchap.com/v8go v0.9.0 // indirect ) // Do not upgrade, it renames attributes we rely on @@ -211,6 +220,7 @@ replace ( // Use what is best for your personal workflow. See CONTRIBUTING.md for more information replace ( + github.com/wundergraph/cosmo/composition-go => ../composition-go github.com/wundergraph/cosmo/demo => ../demo github.com/wundergraph/cosmo/demo/pkg/subgraphs/projects => ../demo/pkg/subgraphs/projects github.com/wundergraph/cosmo/router => ../router diff --git a/router-tests/go.sum b/router-tests/go.sum index a54b295867..317d134fa5 100644 --- a/router-tests/go.sum +++ b/router-tests/go.sum @@ -49,6 +49,9 @@ github.com/cep21/circuit/v4 v4.0.0 h1:g1AzMmRLuwCst0eccy1nGsD/CL2XKbDnaPUHVHDvVm github.com/cep21/circuit/v4 v4.0.0/go.mod h1:Bb1fHpuiRu+AIgKf7DTM1c5U94qTZtKouKcDwtZYCXk= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY= +github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic= +github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.16.0 h1:+BiEnHL6Z7lXnlGUsXQPPAE7+kenAd4ES8MQ5min0Ok= github.com/cilium/ebpf v0.16.0/go.mod h1:L7u2Blt2jMM/vLAVgjxluxtBKlz3/GWjB0dMOEngfwE= github.com/cloudflare/backoff v0.0.0-20240920015135-e46b80a3a7d0 h1:pRcxfaAlK0vR6nOeQs7eAEvjJzdGXl8+KaBlcvpQTyQ= @@ -63,6 +66,7 @@ github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8 github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -75,6 +79,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54 h1:SG7nF6SRlWhcT7cNTs5R6Hk4V2lcmLz2NsG2VnInyNo= github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= +github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/docker/cli v29.2.0+incompatible h1:9oBd9+YM7rxjZLfyMGxjraKBKE4/nVyvVfN4qNl9XRM= @@ -85,6 +91,11 @@ github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqI github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja v0.0.0-20230906160731-9410bcaa81d2 h1:3J+RqSTu+JuyCYjoe82vvUUljEfgp8i6+nyhUsaYAbg= +github.com/dop251/goja v0.0.0-20230906160731-9410bcaa81d2/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4= +github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= +github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/expr-lang/expr v1.17.7 h1:Q0xY/e/2aCIp8g9s/LGvMDCC5PxYlvHgDZRQ4y16JX8= @@ -111,6 +122,8 @@ github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7 github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-redis/redis_rate/v10 v10.0.1 h1:calPxi7tVlxojKunJwQ72kwfozdy25RjA0bCj1h0MUo= github.com/go-redis/redis_rate/v10 v10.0.1/go.mod h1:EMiuO9+cjRkR7UvdvwMO7vbgqJkltQHtwbdIQvaBKIU= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= @@ -141,6 +154,8 @@ github.com/google/go-containerregistry v0.20.3 h1:oNx7IdTI936V8CQRveCjaxOiegWwvM github.com/google/go-containerregistry v0.20.3/go.mod h1:w00pIgBRDVUDFM6bq+Qx8lwNWK+cxgCuX1vd3PIBDNI= github.com/google/jsonschema-go v0.4.2 h1:tmrUohrwoLZZS/P3x7ex0WAVknEkBZM46iALbcqoRA8= github.com/google/jsonschema-go v0.4.2/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE= +github.com/google/pprof v0.0.0-20230207041349-798e818bf904 h1:4/hN5RUoecvl+RmJRE2YxKWtnnQls6rQjjW5oV7qg2U= +github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -169,6 +184,7 @@ github.com/hasura/go-graphql-client v0.14.3 h1:7La92TuA/FRkVmFd1IN8E+WGW8Lxyn6NK github.com/hasura/go-graphql-client v0.14.3/go.mod h1:jfSZtBER3or+88Q9vFhWHiFMPppfYILRyl+0zsgPIIw= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/invopop/jsonschema v0.13.0 h1:KvpoAJWEjR3uD9Kbm2HWJmqsEaHt8lBUpd0qHcIi21E= github.com/invopop/jsonschema v0.13.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= github.com/jensneuse/abstractlogger v0.0.4 h1:sa4EH8fhWk3zlTDbSncaWKfwxYM8tYSlQ054ETLyyQY= @@ -194,6 +210,8 @@ github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -281,6 +299,7 @@ github.com/r3labs/sse/v2 v2.8.1/go.mod h1:Igau6Whc+F17QUgML1fYe1VPZzTV6EMCnYktEm github.com/redis/go-redis/v9 v9.7.3 h1:YpPyAayJV+XErNsatSElgRZZVCwXX9QzkKYNvO7x0wM= github.com/redis/go-redis/v9 v9.7.3/go.mod h1:bGUrSggJ9X9GUmZpZNEOQKaANxSGgOEBRltRTZHSvrA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= @@ -361,16 +380,17 @@ github.com/vektah/gqlparser/v2 v2.5.30 h1:EqLwGAFLIzt1wpx1IPpY67DwUujF1OfzgEyDsL github.com/vektah/gqlparser/v2 v2.5.30/go.mod h1:D1/VCZtV3LPnQrcPBeR/q5jkSQIPti0uYCP/RI0gIeo= github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= -github.com/wundergraph/astjson v1.1.0 h1:xORDosrZ87zQFJwNGe/HIHXqzpdHOFmqWgykCLVL040= -github.com/wundergraph/astjson v1.1.0/go.mod h1:h12D/dxxnedtLzsKyBLK7/Oe4TAoGpRVC9nDpDrZSWw= -github.com/wundergraph/go-arena v1.1.0 h1:9+wSRkJAkA2vbYHp6s8tEGhPViRGQNGXqPHT0QzhdIc= -github.com/wundergraph/go-arena v1.1.0/go.mod h1:ROOysEHWJjLQ8FSfNxZCziagb7Qw2nXY3/vgKRh7eWw= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.269 h1:BFQ4/IFqucZsrmzs6vkqjHC5j2XV6rhnmoMLmtYMcp8= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.269/go.mod h1:HjTAO/cuICpu31IfHY9qmSPygx6Gza7Wt9hTSReTI+A= +github.com/wundergraph/astjson v1.1.1-0.20260419105127-f600d161463f h1:MoVoeMlgY9Ej1aoF3Y/kniBZ8pv+WfIA3YSCnPBh+6M= +github.com/wundergraph/astjson v1.1.1-0.20260419105127-f600d161463f/go.mod h1:uHSJv7uowLN/nIPvkTFqUDt1sXk4qQU0KNwHfwfDcQE= +github.com/wundergraph/go-arena v1.2.0 h1:6MlhEy0NBY3Z+BuK3rj0F9YoT3bM0SlahGkzK0lKRZ4= +github.com/wundergraph/go-arena v1.2.0/go.mod h1:ROOysEHWJjLQ8FSfNxZCziagb7Qw2nXY3/vgKRh7eWw= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.270.0.20260419221936-771759beca58 h1:lOwmludLUA0eqyYOB8LHYfn5b0s1IZMfhjdzdaNW8ew= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.270.0.20260419221936-771759beca58/go.mod h1:ARd7AYT8FBNXDOa/qhREPXgIj+9CDQqcMMW5kT3oIZQ= github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 h1:FnBeRrxr7OU4VvAzt5X7s6266i6cSVkkFPS0TuXWbIg= github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= @@ -425,23 +445,28 @@ go.withmatt.com/connect-brotli v0.4.0 h1:7ObWkYmEbUXK3EKglD0Lgj0BBnnD3jNdAxeDRct go.withmatt.com/connect-brotli v0.4.0/go.mod h1:c2eELz56za+/Mxh1yJrlglZ4VM9krpOCPqS2Vxf8NVk= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= golang.org/x/exp v0.0.0-20250813145105-42675adae3e6 h1:SbTAbRFnd5kjQXbczszQ0hdk3ctwYf3qBNH9jIsGclE= golang.org/x/exp v0.0.0-20250813145105-42675adae3e6/go.mod h1:4QTo5u+SEIbbKW1RacMZq1YEfOBqeXa19JeshGi+zc4= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c= golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191116160921-f9c825593386/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -450,11 +475,16 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -462,15 +492,24 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc= golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -494,6 +533,7 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= @@ -501,3 +541,5 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rogchap.com/v8go v0.9.0 h1:wYbUCO4h6fjTamziHrzyrPnpFNuzPpjZY+nfmZjNaew= +rogchap.com/v8go v0.9.0/go.mod h1:MxgP3pL2MW4dpme/72QRs8sgNMmM0pRc8DPhcuLWPAs= diff --git a/router-tests/protocol/headers_test.go b/router-tests/protocol/headers_test.go index 939644f8e5..5eb1b21ba2 100644 --- a/router-tests/protocol/headers_test.go +++ b/router-tests/protocol/headers_test.go @@ -298,11 +298,12 @@ func TestForwardHeaders(t *testing.T) { for _, c := range cases { c := c t.Run(c.testName, func(t *testing.T) { + subEnv := xEnv.WithT(t) header := http.Header{ c.headerName: []string{headerValue}, } - conn := xEnv.InitGraphQLWebSocketConnection(header, nil, nil) + conn := subEnv.InitGraphQLWebSocketConnection(header, nil, nil) err := conn.WriteJSON(&testenv.WebSocketMessage{ ID: "1", Type: "subscribe", @@ -366,14 +367,15 @@ func TestForwardHeaders(t *testing.T) { for _, c := range cases { c := c t.Run(c.testName, func(t *testing.T) { + subEnv := xEnv.WithT(t) header1 := http.Header{ c.headerName: []string{headerValue}, } header2 := http.Header{ c.headerName: []string{headerValue2}, } - conn1 := xEnv.InitGraphQLWebSocketConnection(header1, nil, nil) - conn2 := xEnv.InitGraphQLWebSocketConnection(header2, nil, nil) + conn1 := subEnv.InitGraphQLWebSocketConnection(header1, nil, nil) + conn2 := subEnv.InitGraphQLWebSocketConnection(header2, nil, nil) var err error err = conn1.WriteJSON(testenv.WebSocketMessage{ @@ -656,11 +658,12 @@ func TestForwardRenamedHeaders(t *testing.T) { for _, c := range cases { c := c t.Run(c.testName, func(t *testing.T) { + subEnv := xEnv.WithT(t) header := http.Header{ c.headerName: []string{headerValue}, } - conn := xEnv.InitGraphQLWebSocketConnection(header, nil, nil) + conn := subEnv.InitGraphQLWebSocketConnection(header, nil, nil) err := conn.WriteJSON(&testenv.WebSocketMessage{ ID: "1", Type: "subscribe", @@ -724,14 +727,15 @@ func TestForwardRenamedHeaders(t *testing.T) { for _, c := range cases { c := c t.Run(c.testName, func(t *testing.T) { + subEnv := xEnv.WithT(t) header1 := http.Header{ c.headerName: []string{headerValue}, } header2 := http.Header{ c.headerName: []string{headerValue2}, } - conn1 := xEnv.InitGraphQLWebSocketConnection(header1, nil, nil) - conn2 := xEnv.InitGraphQLWebSocketConnection(header2, nil, nil) + conn1 := subEnv.InitGraphQLWebSocketConnection(header1, nil, nil) + conn2 := subEnv.InitGraphQLWebSocketConnection(header2, nil, nil) var err error err = conn1.WriteJSON(testenv.WebSocketMessage{ diff --git a/router-tests/protocol/testdata/tracing.json b/router-tests/protocol/testdata/tracing.json index ff47debcfa..a27ef045e4 100644 --- a/router-tests/protocol/testdata/tracing.json +++ b/router-tests/protocol/testdata/tracing.json @@ -674,6 +674,19 @@ "duration_since_start_nanoseconds": 1, "duration_since_start_pretty": "1ns" } + }, + "cache_trace": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns", + "duration_nanoseconds": 1, + "duration_pretty": "1ns", + "l1_enabled": false, + "l2_enabled": false, + "entity_count": 0, + "l1_hit": 0, + "l1_miss": 0, + "l2_hit": 0, + "l2_miss": 0 } } } @@ -1050,6 +1063,19 @@ "duration_since_start_nanoseconds": 1, "duration_since_start_pretty": "1ns" } + }, + "cache_trace": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns", + "duration_nanoseconds": 1, + "duration_pretty": "1ns", + "l1_enabled": false, + "l2_enabled": false, + "entity_count": 0, + "l1_hit": 0, + "l1_miss": 0, + "l2_hit": 0, + "l2_miss": 0 } } } @@ -1676,6 +1702,19 @@ "duration_since_start_nanoseconds": 1, "duration_since_start_pretty": "1ns" } + }, + "cache_trace": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns", + "duration_nanoseconds": 1, + "duration_pretty": "1ns", + "l1_enabled": false, + "l2_enabled": false, + "entity_count": 0, + "l1_hit": 0, + "l1_miss": 0, + "l2_hit": 0, + "l2_miss": 0 } } } @@ -2005,6 +2044,19 @@ "duration_since_start_nanoseconds": 1, "duration_since_start_pretty": "1ns" } + }, + "cache_trace": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns", + "duration_nanoseconds": 1, + "duration_pretty": "1ns", + "l1_enabled": false, + "l2_enabled": false, + "entity_count": 0, + "l1_hit": 0, + "l1_miss": 0, + "l2_hit": 0, + "l2_miss": 0 } } } diff --git a/router-tests/testenv/testenv.go b/router-tests/testenv/testenv.go index 0702ec6243..93b0d11104 100644 --- a/router-tests/testenv/testenv.go +++ b/router-tests/testenv/testenv.go @@ -744,6 +744,22 @@ func CreateTestSupervisorEnv(t testing.TB, cfg *Config) (*Environment, error) { retryClient.RetryMax = 10 retryClient.RetryWaitMin = 100 * time.Millisecond retryClient.HTTPClient = httpClient + // Retry on HTTP 501. The router itself never returns 501 for GraphQL requests — + // the only way to see 501 from the router URL is Go's net/http server emitting + // isUnsupportedTEError during request parsing before any handler runs. Under + // heavy parallel-subtest load this has been observed at ~0.05% rate, enough to + // surface as a flake in CI. Retrying is safe because a legitimate router 501 + // is not possible in this suite. + defaultCheckRetry := retryClient.CheckRetry + retryClient.CheckRetry = func(ctx context.Context, resp *http.Response, err error) (bool, error) { + if resp != nil && resp.StatusCode == http.StatusNotImplemented { + return true, nil + } + if defaultCheckRetry != nil { + return defaultCheckRetry(ctx, resp, err) + } + return retryablehttp.DefaultRetryPolicy(ctx, resp, err) + } client = retryClient.StandardClient() } @@ -1175,6 +1191,22 @@ func CreateTestEnv(t testing.TB, cfg *Config) (*Environment, error) { retryClient.RetryMax = 10 retryClient.RetryWaitMin = 100 * time.Millisecond retryClient.HTTPClient = httpClient + // Retry on HTTP 501. The router itself never returns 501 for GraphQL requests — + // the only way to see 501 from the router URL is Go's net/http server emitting + // isUnsupportedTEError during request parsing before any handler runs. Under + // heavy parallel-subtest load this has been observed at ~0.05% rate, enough to + // surface as a flake in CI. Retrying is safe because a legitimate router 501 + // is not possible in this suite. + defaultCheckRetry := retryClient.CheckRetry + retryClient.CheckRetry = func(ctx context.Context, resp *http.Response, err error) (bool, error) { + if resp != nil && resp.StatusCode == http.StatusNotImplemented { + return true, nil + } + if defaultCheckRetry != nil { + return defaultCheckRetry(ctx, resp, err) + } + return retryablehttp.DefaultRetryPolicy(ctx, resp, err) + } client = retryClient.StandardClient() } @@ -1900,6 +1932,12 @@ type Environment struct { cmdLogChannel chan string } +func (e *Environment) WithT(t testing.TB) *Environment { + clone := *e + clone.t = t + return &clone +} + func GetPubSubNameFn(prefix string) func(name string) string { return func(name string) string { return prefix + name diff --git a/router-tests/testenv/testenv_t_context_test.go b/router-tests/testenv/testenv_t_context_test.go new file mode 100644 index 0000000000..3f03c38ac8 --- /dev/null +++ b/router-tests/testenv/testenv_t_context_test.go @@ -0,0 +1,21 @@ +package testenv + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestEnvironmentWithTOverridesTestContext(t *testing.T) { + t.Parallel() + + parent := &Environment{t: t} + + t.Run("child", func(child *testing.T) { + child.Parallel() + + cloned := parent.WithT(child) + require.Same(t, child, cloned.t) + require.Same(t, t, parent.t) + }) +} diff --git a/router/core/executor.go b/router/core/executor.go index 71bb08432c..dffcf7a885 100644 --- a/router/core/executor.go +++ b/router/core/executor.go @@ -62,10 +62,12 @@ type ExecutorBuildOptions struct { TraceClientRequired bool PluginsEnabled bool InstanceData InstanceData + EntityCacheInstances map[string]resolve.LoaderCache + EntityCachingConfig *config.EntityCachingConfiguration } func (b *ExecutorConfigurationBuilder) Build(ctx context.Context, opts *ExecutorBuildOptions) (*Executor, []pubsub_datasource.Provider, error) { - planConfig, providers, err := b.buildPlannerConfiguration(ctx, opts.EngineConfig, opts.Subgraphs, opts.RouterEngineConfig, opts.PluginsEnabled) + planConfig, providers, err := b.buildPlannerConfiguration(ctx, opts.EngineConfig, opts.Subgraphs, opts.RouterEngineConfig, opts.PluginsEnabled, opts.EntityCachingConfig) if err != nil { return nil, nil, fmt.Errorf("failed to build planner configuration: %w", err) } @@ -90,6 +92,8 @@ func (b *ExecutorConfigurationBuilder) Build(ctx context.Context, opts *Executor PropagateFetchReasons: opts.RouterEngineConfig.Execution.EnableRequireFetchReasons, ValidateRequiredExternalFields: opts.RouterEngineConfig.Execution.ValidateRequiredExternalFields, SetDeduplicationShardCountToGOMAXPROCS: true, + Caches: opts.EntityCacheInstances, + EntityCacheConfigs: buildEntityCacheInvalidationConfigs(opts.EntityCachingConfig, opts.Subgraphs, opts.EngineConfig, b.logger), } if opts.ApolloCompatibilityFlags.ValueCompletion.Enabled { @@ -203,7 +207,7 @@ func (b *ExecutorConfigurationBuilder) Build(ctx context.Context, opts *Executor }, providers, nil } -func (b *ExecutorConfigurationBuilder) buildPlannerConfiguration(ctx context.Context, engineConfig *nodev1.EngineConfiguration, subgraphs []*nodev1.Subgraph, routerEngineCfg *RouterEngineConfiguration, pluginsEnabled bool) (*plan.Configuration, []pubsub_datasource.Provider, error) { +func (b *ExecutorConfigurationBuilder) buildPlannerConfiguration(ctx context.Context, engineConfig *nodev1.EngineConfiguration, subgraphs []*nodev1.Subgraph, routerEngineCfg *RouterEngineConfiguration, pluginsEnabled bool, entityCachingConfig *config.EntityCachingConfiguration) (*plan.Configuration, []pubsub_datasource.Provider, error) { // this loader is used to take the engine config and create a plan config // the plan config is what the engine uses to turn a GraphQL Request into an execution plan // the plan config is stateful as it carries connection pools and other things @@ -219,6 +223,7 @@ func (b *ExecutorConfigurationBuilder) buildPlannerConfiguration(ctx context.Con routerEngineCfg.Execution.EnableNetPoll, b.instanceData, ), b.logger, b.subscriptionHooks) + loader.entityCachingConfig = entityCachingConfig // this generates the plan config using the data source factories from the config package planConfig, providers, err := loader.Load(engineConfig, subgraphs, routerEngineCfg, pluginsEnabled) @@ -252,3 +257,72 @@ func (b *ExecutorConfigurationBuilder) buildPlannerConfiguration(ctx context.Con return planConfig, providers, nil } + +func buildEntityCacheInvalidationConfigs( + cfg *config.EntityCachingConfiguration, + subgraphs []*nodev1.Subgraph, + engineConfig *nodev1.EngineConfiguration, + logger *zap.Logger, +) map[string]map[string]*resolve.EntityCacheInvalidationConfig { + if cfg == nil || !cfg.Enabled || len(engineConfig.GetDatasourceConfigurations()) == 0 { + return nil + } + result := make(map[string]map[string]*resolve.EntityCacheInvalidationConfig) + for _, ds := range engineConfig.GetDatasourceConfigurations() { + subgraphName := subgraphNameByID(subgraphs, ds.GetId()) + if subgraphName == "" { + // Datasource ID doesn't match any known subgraph — skip instead of + // bucketing under "" which would collide across datasources and + // produce a wrong cache lookup downstream. + if logger != nil { + logger.Warn("entity caching: skipping datasource with unknown subgraph id", + zap.String("datasource_id", ds.GetId())) + } + continue + } + for _, ec := range ds.GetEntityCacheConfigurations() { + if _, ok := result[subgraphName]; !ok { + result[subgraphName] = make(map[string]*resolve.EntityCacheInvalidationConfig) + } + result[subgraphName][ec.GetTypeName()] = &resolve.EntityCacheInvalidationConfig{ + CacheName: resolveEntityCacheProviderID(cfg, subgraphName, ec.GetTypeName()), + IncludeSubgraphHeaderPrefix: ec.GetIncludeHeaders(), + } + } + } + if len(result) == 0 { + return nil + } + return result +} + +func subgraphNameByID(subgraphs []*nodev1.Subgraph, id string) string { + for _, sg := range subgraphs { + if sg.Id == id { + return sg.Name + } + } + return "" +} + +func resolveEntityCacheProviderID(cfg *config.EntityCachingConfiguration, subgraphName, typeName string) string { + if cfg == nil { + return "default" + } + for _, sg := range cfg.SubgraphCacheOverrides { + if sg.Name == subgraphName { + // Tier 1: entity-level override + for _, e := range sg.Entities { + if e.Type == typeName && e.StorageProviderID != "" { + return e.StorageProviderID + } + } + // Tier 2: subgraph-level override + if sg.StorageProviderID != "" { + return sg.StorageProviderID + } + } + } + // Tier 3: global default + return "default" +} diff --git a/router/core/executor_entity_cache_test.go b/router/core/executor_entity_cache_test.go new file mode 100644 index 0000000000..e4c39f2898 --- /dev/null +++ b/router/core/executor_entity_cache_test.go @@ -0,0 +1,200 @@ +package core + +import ( + "testing" + + "github.com/stretchr/testify/require" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" + "go.uber.org/zap/zaptest/observer" + + nodev1 "github.com/wundergraph/cosmo/router/gen/proto/wg/cosmo/node/v1" + "github.com/wundergraph/cosmo/router/pkg/config" + "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve" +) + +func TestResolveEntityCacheProviderID(t *testing.T) { + t.Parallel() + cfg := &config.EntityCachingConfiguration{ + SubgraphCacheOverrides: []config.EntityCachingSubgraphCacheOverride{ + { + Name: "products", + StorageProviderID: "sg-redis", + Entities: []config.EntityCachingEntityConfig{ + {Type: "Product", StorageProviderID: "entity-redis"}, + }, + }, + { + Name: "reviews", + StorageProviderID: "reviews-redis", + }, + }, + } + + t.Run("default_fallback", func(t *testing.T) { + t.Parallel() + result := resolveEntityCacheProviderID(cfg, "unknown-subgraph", "AnyType") + require.Equal(t, "default", result) + }) + + t.Run("subgraph_level_match", func(t *testing.T) { + t.Parallel() + result := resolveEntityCacheProviderID(cfg, "reviews", "Review") + require.Equal(t, "reviews-redis", result) + }) + + t.Run("entity_level_match", func(t *testing.T) { + t.Parallel() + result := resolveEntityCacheProviderID(cfg, "products", "Product") + require.Equal(t, "entity-redis", result) + }) + + t.Run("entity_takes_precedence_over_subgraph", func(t *testing.T) { + t.Parallel() + // "products" subgraph has sg-redis, but Product entity has entity-redis + result := resolveEntityCacheProviderID(cfg, "products", "Product") + require.Equal(t, "entity-redis", result) + }) + + t.Run("no_entity_match_falls_to_subgraph", func(t *testing.T) { + t.Parallel() + result := resolveEntityCacheProviderID(cfg, "products", "Category") + require.Equal(t, "sg-redis", result) + }) +} + +func TestSubgraphNameByID(t *testing.T) { + t.Parallel() + subgraphs := []*nodev1.Subgraph{ + {Id: "sg-1", Name: "products"}, + {Id: "sg-2", Name: "reviews"}, + } + + t.Run("found", func(t *testing.T) { + t.Parallel() + result := subgraphNameByID(subgraphs, "sg-1") + require.Equal(t, "products", result) + }) + + t.Run("not_found", func(t *testing.T) { + t.Parallel() + result := subgraphNameByID(subgraphs, "sg-unknown") + require.Equal(t, "", result) + }) +} + +func TestBuildEntityCacheInvalidationConfigs(t *testing.T) { + t.Parallel() + t.Run("nil_config", func(t *testing.T) { + t.Parallel() + result := buildEntityCacheInvalidationConfigs(nil, nil, &nodev1.EngineConfiguration{}, zap.NewNop()) + require.Nil(t, result) + }) + + t.Run("disabled", func(t *testing.T) { + t.Parallel() + cfg := &config.EntityCachingConfiguration{Enabled: false} + result := buildEntityCacheInvalidationConfigs(cfg, nil, &nodev1.EngineConfiguration{}, zap.NewNop()) + require.Nil(t, result) + }) + + t.Run("no_datasources", func(t *testing.T) { + t.Parallel() + cfg := &config.EntityCachingConfiguration{Enabled: true} + result := buildEntityCacheInvalidationConfigs(cfg, nil, &nodev1.EngineConfiguration{}, zap.NewNop()) + require.Nil(t, result) + }) + + t.Run("skips_datasource_with_unknown_subgraph_id", func(t *testing.T) { + t.Parallel() + core, observed := observer.New(zapcore.WarnLevel) + logger := zap.New(core) + cfg := &config.EntityCachingConfiguration{Enabled: true} + subgraphs := []*nodev1.Subgraph{ + {Id: "ds-known", Name: "products"}, + } + engineConfig := &nodev1.EngineConfiguration{ + DatasourceConfigurations: []*nodev1.DataSourceConfiguration{ + { + Id: "ds-unknown", // no matching subgraph + EntityCacheConfigurations: []*nodev1.EntityCacheConfiguration{ + {TypeName: "Mystery", MaxAgeSeconds: 60}, + }, + }, + { + Id: "ds-known", + EntityCacheConfigurations: []*nodev1.EntityCacheConfiguration{ + {TypeName: "Product", MaxAgeSeconds: 60}, + }, + }, + }, + } + + result := buildEntityCacheInvalidationConfigs(cfg, subgraphs, engineConfig, logger) + + // Known subgraph is present, unknown is skipped (not bucketed under ""). + require.Equal(t, map[string]map[string]*resolve.EntityCacheInvalidationConfig{ + "products": { + "Product": {CacheName: "default", IncludeSubgraphHeaderPrefix: false}, + }, + }, result) + + // And a single warning was emitted for the unknown datasource ID. + entries := observed.FilterMessage("entity caching: skipping datasource with unknown subgraph id").All() + require.Len(t, entries, 1) + require.Equal(t, "ds-unknown", entries[0].ContextMap()["datasource_id"]) + }) + + t.Run("builds_correct_map", func(t *testing.T) { + t.Parallel() + cfg := &config.EntityCachingConfiguration{ + Enabled: true, + SubgraphCacheOverrides: []config.EntityCachingSubgraphCacheOverride{ + { + Name: "products", + StorageProviderID: "custom-redis", + }, + }, + } + subgraphs := []*nodev1.Subgraph{ + {Id: "ds-1", Name: "products"}, + {Id: "ds-2", Name: "reviews"}, + } + engineConfig := &nodev1.EngineConfiguration{ + DatasourceConfigurations: []*nodev1.DataSourceConfiguration{ + { + Id: "ds-1", + EntityCacheConfigurations: []*nodev1.EntityCacheConfiguration{ + {TypeName: "Product", MaxAgeSeconds: 60, IncludeHeaders: true}, + }, + }, + { + Id: "ds-2", + EntityCacheConfigurations: []*nodev1.EntityCacheConfiguration{ + {TypeName: "Review", MaxAgeSeconds: 30}, + }, + }, + }, + } + + result := buildEntityCacheInvalidationConfigs(cfg, subgraphs, engineConfig, zap.NewNop()) + require.NotNil(t, result) + require.Len(t, result, 2) + + // products subgraph, Product type -> custom-redis + require.Contains(t, result, "products") + require.Contains(t, result["products"], "Product") + require.Equal(t, &resolve.EntityCacheInvalidationConfig{ + CacheName: "custom-redis", + IncludeSubgraphHeaderPrefix: true, + }, result["products"]["Product"]) + + // reviews subgraph, Review type -> default + require.Contains(t, result, "reviews") + require.Contains(t, result["reviews"], "Review") + require.Equal(t, &resolve.EntityCacheInvalidationConfig{ + CacheName: "default", + IncludeSubgraphHeaderPrefix: false, + }, result["reviews"]["Review"]) + }) +} diff --git a/router/core/factoryresolver.go b/router/core/factoryresolver.go index 6fb0af8384..618275ed38 100644 --- a/router/core/factoryresolver.go +++ b/router/core/factoryresolver.go @@ -6,7 +6,6 @@ import ( "fmt" "net/http" "net/url" - "slices" "time" "github.com/buger/jsonparser" @@ -28,6 +27,13 @@ import ( "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/plan" ) +// Proto operation_type string values from the composition layer. +// CachePopulateConfiguration and CacheInvalidateConfiguration use these title-case strings +// (distinct from the router's internal lowercase OperationType constants in context.go). +const ( + protoOperationTypeSubscription = "Subscription" +) + // Loader translates the protobuf-based router engine configuration into a // plan.Configuration consumed by the GraphQL engine planner. It resolves // data source factories (HTTP, gRPC, pub/sub) for each subgraph through the @@ -37,8 +43,10 @@ type Loader struct { ctx context.Context resolver FactoryResolver subscriptionHooks subscriptionHooks - includeInfo bool - logger *zap.Logger + // includeInfo controls whether additional information like type usage and field usage is included in the plan de + includeInfo bool + logger *zap.Logger + entityCachingConfig *config.EntityCachingConfiguration } type InstanceData struct { @@ -351,6 +359,7 @@ func (l *Loader) Load(engineConfig *nodev1.EngineConfiguration, subgraphs []*nod for _, in := range engineConfig.DatasourceConfigurations { var out plan.DataSource + dataSourceName := l.subgraphName(subgraphs, in.Id) switch in.Kind { case nodev1.DataSourceKind_STATIC: @@ -362,7 +371,7 @@ func (l *Loader) Load(engineConfig *nodev1.EngineConfiguration, subgraphs []*nod out, err = plan.NewDataSourceConfiguration[staticdatasource.Configuration]( in.Id, factory, - l.dataSourceMetaData(in), + l.dataSourceMetaData(in, dataSourceName), staticdatasource.Configuration{ Data: config.LoadStringVariable(in.CustomStatic.Data), }, @@ -485,8 +494,6 @@ func (l *Loader) Load(engineConfig *nodev1.EngineConfiguration, subgraphs []*nod return nil, providers, fmt.Errorf("error creating custom configuration for data source %s: %w", in.Id, err) } - dataSourceName := l.subgraphName(subgraphs, in.Id) - factory, err := l.resolver.ResolveGraphqlFactory(dataSourceName) if err != nil { return nil, providers, err @@ -496,7 +503,7 @@ func (l *Loader) Load(engineConfig *nodev1.EngineConfiguration, subgraphs []*nod in.Id, dataSourceName, factory, - l.dataSourceMetaData(in), + l.dataSourceMetaData(in, dataSourceName), customConfiguration, ) if err != nil { @@ -506,7 +513,7 @@ func (l *Loader) Load(engineConfig *nodev1.EngineConfiguration, subgraphs []*nod case nodev1.DataSourceKind_PUBSUB: pubSubDS = append(pubSubDS, pubsub.DataSourceConfigurationWithMetadata{ Configuration: in, - Metadata: l.dataSourceMetaData(in), + Metadata: l.dataSourceMetaData(in, dataSourceName), }) default: return nil, providers, fmt.Errorf("unknown data source type %q", in.Kind) @@ -570,19 +577,11 @@ func (l *Loader) Load(engineConfig *nodev1.EngineConfiguration, subgraphs []*nod } func (l *Loader) subgraphName(subgraphs []*nodev1.Subgraph, dataSourceID string) string { - i := slices.IndexFunc(subgraphs, func(s *nodev1.Subgraph) bool { - return s.Id == dataSourceID - }) - - if i != -1 { - return subgraphs[i].Name - } - - return "" + return subgraphNameByID(subgraphs, dataSourceID) } // dataSourceMetaData converts a protobuf configuration into the planner's DataSourceMetadata. -func (l *Loader) dataSourceMetaData(in *nodev1.DataSourceConfiguration) *plan.DataSourceMetadata { +func (l *Loader) dataSourceMetaData(in *nodev1.DataSourceConfiguration, subgraphName string) *plan.DataSourceMetadata { var d plan.DirectiveConfigurations = make([]plan.DirectiveConfiguration, 0, len(in.Directives)) out := &plan.DataSourceMetadata{ @@ -678,6 +677,134 @@ func (l *Loader) dataSourceMetaData(in *nodev1.DataSourceConfiguration) *plan.Da }) } + // Entity caching configurations + for _, ec := range in.EntityCacheConfigurations { + cacheName := resolveEntityCacheProviderID(l.entityCachingConfig, subgraphName, ec.TypeName) + out.FederationMetaData.EntityCaching = append(out.FederationMetaData.EntityCaching, plan.EntityCacheConfiguration{ + TypeName: ec.TypeName, + CacheName: cacheName, + TTL: time.Duration(ec.MaxAgeSeconds) * time.Second, + NegativeCacheTTL: time.Duration(ec.NotFoundCacheTtlSeconds) * time.Second, + IncludeSubgraphHeaderPrefix: ec.IncludeHeaders, + EnablePartialCacheLoad: ec.PartialCacheLoad, + ShadowMode: ec.ShadowMode, + }) + } + + // Root field cache configurations + for _, rfc := range in.RootFieldCacheConfigurations { + cacheName := resolveEntityCacheProviderID(l.entityCachingConfig, subgraphName, rfc.EntityTypeName) + var mappings []plan.EntityKeyMapping + for _, m := range rfc.EntityKeyMappings { + var fieldMappings []plan.FieldMapping + for _, fm := range m.FieldMappings { + fieldMappings = append(fieldMappings, plan.FieldMapping{ + EntityKeyField: fm.EntityKeyField, + ArgumentPath: fm.ArgumentPath, + ArgumentIsEntityKey: fm.IsBatch, + }) + } + mappings = append(mappings, plan.EntityKeyMapping{ + EntityTypeName: m.EntityTypeName, + FieldMappings: fieldMappings, + }) + } + rootTypeName := rootTypeNameForField(in.RootNodes, rfc.FieldName) + out.FederationMetaData.RootFieldCaching = append(out.FederationMetaData.RootFieldCaching, plan.RootFieldCacheConfiguration{ + TypeName: rootTypeName, + FieldName: rfc.FieldName, + CacheName: cacheName, + TTL: time.Duration(rfc.MaxAgeSeconds) * time.Second, + IncludeSubgraphHeaderPrefix: rfc.IncludeHeaders, + ShadowMode: rfc.ShadowMode, + EntityKeyMappings: mappings, + }) + } + + // Mutation/subscription cache populate + for _, cp := range in.CachePopulateConfigurations { + if cp.OperationType == protoOperationTypeSubscription { + var targetEntity *nodev1.EntityCacheConfiguration + for _, ec := range in.EntityCacheConfigurations { + if ec.TypeName == cp.EntityTypeName { + targetEntity = ec + break + } + } + if targetEntity == nil { + continue + } + ttl := time.Duration(targetEntity.MaxAgeSeconds) * time.Second + if cp.MaxAgeSeconds != nil { + ttl = time.Duration(*cp.MaxAgeSeconds) * time.Second + } + cacheName := resolveEntityCacheProviderID(l.entityCachingConfig, subgraphName, targetEntity.TypeName) + out.FederationMetaData.SubscriptionEntityPopulation = append( + out.FederationMetaData.SubscriptionEntityPopulation, + plan.SubscriptionEntityPopulationConfiguration{ + TypeName: targetEntity.TypeName, + FieldName: cp.FieldName, + CacheName: cacheName, + TTL: ttl, + IncludeSubgraphHeaderPrefix: targetEntity.IncludeHeaders, + }, + ) + } else { + // @cachePopulate(maxAge:) — when set, override the entity's default TTL on + // mutation-time writes. Without this, the populate path falls back to the + // cache implementation's default TTL. + var mutationTTL time.Duration + if cp.MaxAgeSeconds != nil { + mutationTTL = time.Duration(*cp.MaxAgeSeconds) * time.Second + } + out.FederationMetaData.MutationFieldCaching = append(out.FederationMetaData.MutationFieldCaching, plan.MutationFieldCacheConfiguration{ + FieldName: cp.FieldName, + EnableEntityL2CachePopulation: true, + TTL: mutationTTL, + }) + } + } + + // Mutation/subscription cache invalidation + for _, ci := range in.CacheInvalidateConfigurations { + if ci.OperationType == protoOperationTypeSubscription { + cacheName := resolveEntityCacheProviderID(l.entityCachingConfig, subgraphName, ci.EntityTypeName) + var includeHeaders bool + for _, ec := range in.EntityCacheConfigurations { + if ec.TypeName == ci.EntityTypeName { + includeHeaders = ec.IncludeHeaders + break + } + } + out.FederationMetaData.SubscriptionEntityPopulation = append( + out.FederationMetaData.SubscriptionEntityPopulation, + plan.SubscriptionEntityPopulationConfiguration{ + TypeName: ci.EntityTypeName, + FieldName: ci.FieldName, + CacheName: cacheName, + IncludeSubgraphHeaderPrefix: includeHeaders, + EnableInvalidationOnKeyOnly: true, + }, + ) + } else { + out.FederationMetaData.MutationCacheInvalidation = append(out.FederationMetaData.MutationCacheInvalidation, plan.MutationCacheInvalidationConfiguration{ + FieldName: ci.FieldName, + EntityTypeName: ci.EntityTypeName, + }) + } + } + + // Request-scoped field configurations. Every field annotated with @requestScoped + // in the subgraph is both a potential reader and writer of the coordinate L1 under + // its L1Key. The planner emits both a hint (read) and an export (write) for each. + for _, rsf := range in.RequestScopedFields { + out.FederationMetaData.RequestScopedFields = append(out.FederationMetaData.RequestScopedFields, plan.RequestScopedField{ + FieldName: rsf.FieldName, + TypeName: rsf.TypeName, + L1Key: rsf.L1Key, + }) + } + // Costs costConfig := in.GetCostConfiguration() if costConfig == nil { @@ -723,6 +850,17 @@ func (l *Loader) dataSourceMetaData(in *nodev1.DataSourceConfiguration) *plan.Da return out } +func rootTypeNameForField(rootNodes []*nodev1.TypeField, fieldName string) string { + for _, node := range rootNodes { + for _, fn := range node.FieldNames { + if fn == fieldName { + return node.TypeName + } + } + } + return "" +} + func (l *Loader) fieldHasAuthorizationRule(fieldConfiguration *nodev1.FieldConfiguration) bool { if fieldConfiguration == nil { return false diff --git a/router/core/factoryresolver_entity_cache_test.go b/router/core/factoryresolver_entity_cache_test.go new file mode 100644 index 0000000000..7960cf5d53 --- /dev/null +++ b/router/core/factoryresolver_entity_cache_test.go @@ -0,0 +1,224 @@ +package core + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + nodev1 "github.com/wundergraph/cosmo/router/gen/proto/wg/cosmo/node/v1" + "github.com/wundergraph/cosmo/router/pkg/config" + "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/plan" +) + +func TestDataSourceMetaDataMapsNegativeEntityCacheTTL(t *testing.T) { + t.Parallel() + + loader := &Loader{ + entityCachingConfig: &config.EntityCachingConfiguration{Enabled: true}, + } + + meta := loader.dataSourceMetaData(&nodev1.DataSourceConfiguration{ + EntityCacheConfigurations: []*nodev1.EntityCacheConfiguration{ + { + TypeName: "Item", + MaxAgeSeconds: 300, + NotFoundCacheTtlSeconds: 15, + IncludeHeaders: true, + PartialCacheLoad: true, + ShadowMode: true, + }, + }, + }, "items") + + require.Len(t, meta.FederationMetaData.EntityCaching, 1) + + cfg := meta.FederationMetaData.EntityCaching[0] + require.Equal(t, "Item", cfg.TypeName) + require.Equal(t, "default", cfg.CacheName) + require.Equal(t, 300*time.Second, cfg.TTL) + require.Equal(t, 15*time.Second, cfg.NegativeCacheTTL) + require.True(t, cfg.IncludeSubgraphHeaderPrefix) + require.True(t, cfg.EnablePartialCacheLoad) + require.True(t, cfg.ShadowMode) +} + +func TestDataSourceMetaDataMapsRootFieldMutationSubscriptionAndRequestScopedCacheConfig(t *testing.T) { + t.Parallel() + + mutationTTL := int64(15) + loader := &Loader{ + entityCachingConfig: &config.EntityCachingConfiguration{ + Enabled: true, + L2: config.EntityCachingL2Configuration{ + Enabled: true, + Storage: config.EntityCachingL2StorageConfig{ + ProviderID: "memory-default", + }, + }, + SubgraphCacheOverrides: []config.EntityCachingSubgraphCacheOverride{ + { + Name: "items", + Entities: []config.EntityCachingEntityConfig{ + {Type: "Item", StorageProviderID: "memory-items"}, + }, + }, + }, + }, + } + + meta := loader.dataSourceMetaData(&nodev1.DataSourceConfiguration{ + RootNodes: []*nodev1.TypeField{ + {TypeName: "Query", FieldNames: []string{"item"}}, + {TypeName: "Mutation", FieldNames: []string{"createItem", "deleteItem"}}, + {TypeName: "Subscription", FieldNames: []string{"itemCreated", "itemDeleted"}}, + }, + EntityCacheConfigurations: []*nodev1.EntityCacheConfiguration{ + { + TypeName: "Item", + MaxAgeSeconds: 60, + IncludeHeaders: true, + }, + }, + RootFieldCacheConfigurations: []*nodev1.RootFieldCacheConfiguration{ + { + FieldName: "item", + EntityTypeName: "Item", + MaxAgeSeconds: 30, + IncludeHeaders: true, + ShadowMode: true, + EntityKeyMappings: []*nodev1.EntityKeyMapping{ + { + EntityTypeName: "Item", + FieldMappings: []*nodev1.EntityCacheFieldMapping{ + { + EntityKeyField: "id", + ArgumentPath: []string{"id"}, + IsBatch: true, + }, + }, + }, + }, + }, + }, + CachePopulateConfigurations: []*nodev1.CachePopulateConfiguration{ + { + FieldName: "createItem", + EntityTypeName: "Item", + OperationType: "Mutation", + MaxAgeSeconds: &mutationTTL, + }, + { + FieldName: "itemCreated", + EntityTypeName: "Item", + OperationType: "Subscription", + }, + }, + CacheInvalidateConfigurations: []*nodev1.CacheInvalidateConfiguration{ + { + FieldName: "deleteItem", + EntityTypeName: "Item", + OperationType: "Mutation", + }, + { + FieldName: "itemDeleted", + EntityTypeName: "Item", + OperationType: "Subscription", + }, + }, + RequestScopedFields: []*nodev1.RequestScopedFieldConfiguration{ + { + FieldName: "currentViewer", + TypeName: "Query", + L1Key: "items.currentViewer", + }, + }, + }, "items") + + require.Len(t, meta.FederationMetaData.RootFieldCaching, 1) + rootCfg := meta.FederationMetaData.RootFieldCaching[0] + require.Equal(t, "Query", rootCfg.TypeName) + require.Equal(t, "item", rootCfg.FieldName) + require.Equal(t, "memory-items", rootCfg.CacheName) + require.Equal(t, 30*time.Second, rootCfg.TTL) + require.True(t, rootCfg.IncludeSubgraphHeaderPrefix) + require.True(t, rootCfg.ShadowMode) + require.Len(t, rootCfg.EntityKeyMappings, 1) + require.Len(t, rootCfg.EntityKeyMappings[0].FieldMappings, 1) + require.Equal(t, "id", rootCfg.EntityKeyMappings[0].FieldMappings[0].EntityKeyField) + require.Equal(t, []string{"id"}, rootCfg.EntityKeyMappings[0].FieldMappings[0].ArgumentPath) + require.True(t, rootCfg.EntityKeyMappings[0].FieldMappings[0].ArgumentIsEntityKey) + + require.Len(t, meta.FederationMetaData.MutationFieldCaching, 1) + require.Equal(t, "createItem", meta.FederationMetaData.MutationFieldCaching[0].FieldName) + require.True(t, meta.FederationMetaData.MutationFieldCaching[0].EnableEntityL2CachePopulation) + require.Equal(t, 15*time.Second, meta.FederationMetaData.MutationFieldCaching[0].TTL) + + require.Len(t, meta.FederationMetaData.MutationCacheInvalidation, 1) + require.Equal(t, "deleteItem", meta.FederationMetaData.MutationCacheInvalidation[0].FieldName) + require.Equal(t, "Item", meta.FederationMetaData.MutationCacheInvalidation[0].EntityTypeName) + + require.Len(t, meta.FederationMetaData.SubscriptionEntityPopulation, 2) + require.Equal(t, "itemCreated", meta.FederationMetaData.SubscriptionEntityPopulation[0].FieldName) + require.Equal(t, "memory-items", meta.FederationMetaData.SubscriptionEntityPopulation[0].CacheName) + require.Equal(t, 60*time.Second, meta.FederationMetaData.SubscriptionEntityPopulation[0].TTL) + require.True(t, meta.FederationMetaData.SubscriptionEntityPopulation[0].IncludeSubgraphHeaderPrefix) + require.False(t, meta.FederationMetaData.SubscriptionEntityPopulation[0].EnableInvalidationOnKeyOnly) + + require.Equal(t, "itemDeleted", meta.FederationMetaData.SubscriptionEntityPopulation[1].FieldName) + require.Equal(t, "memory-items", meta.FederationMetaData.SubscriptionEntityPopulation[1].CacheName) + require.True(t, meta.FederationMetaData.SubscriptionEntityPopulation[1].IncludeSubgraphHeaderPrefix) + require.True(t, meta.FederationMetaData.SubscriptionEntityPopulation[1].EnableInvalidationOnKeyOnly) + + require.Len(t, meta.FederationMetaData.RequestScopedFields, 1) + require.Equal(t, plan.RequestScopedField{ + FieldName: "currentViewer", + TypeName: "Query", + L1Key: "items.currentViewer", + }, meta.FederationMetaData.RequestScopedFields[0]) +} + +func TestRootTypeNameForField(t *testing.T) { + t.Parallel() + + t.Run("field found in Query type", func(t *testing.T) { + t.Parallel() + rootNodes := []*nodev1.TypeField{ + {TypeName: "Query", FieldNames: []string{"user", "users"}}, + {TypeName: "Mutation", FieldNames: []string{"createUser"}}, + } + assert.Equal(t, "Query", rootTypeNameForField(rootNodes, "user")) + }) + + t.Run("field found in Mutation type", func(t *testing.T) { + t.Parallel() + rootNodes := []*nodev1.TypeField{ + {TypeName: "Query", FieldNames: []string{"user"}}, + {TypeName: "Mutation", FieldNames: []string{"createUser", "deleteUser"}}, + } + assert.Equal(t, "Mutation", rootTypeNameForField(rootNodes, "createUser")) + }) + + t.Run("field not found", func(t *testing.T) { + t.Parallel() + rootNodes := []*nodev1.TypeField{ + {TypeName: "Query", FieldNames: []string{"user"}}, + {TypeName: "Mutation", FieldNames: []string{"createUser"}}, + } + assert.Equal(t, "", rootTypeNameForField(rootNodes, "nonExistent")) + }) + + t.Run("empty root nodes", func(t *testing.T) { + t.Parallel() + assert.Equal(t, "", rootTypeNameForField(nil, "user")) + }) + + t.Run("field in renamed query type", func(t *testing.T) { + t.Parallel() + rootNodes := []*nodev1.TypeField{ + {TypeName: "RootQuery", FieldNames: []string{"user", "products"}}, + } + assert.Equal(t, "RootQuery", rootTypeNameForField(rootNodes, "products")) + }) +} diff --git a/router/core/factoryresolver_test.go b/router/core/factoryresolver_test.go new file mode 100644 index 0000000000..0e7b778ba6 --- /dev/null +++ b/router/core/factoryresolver_test.go @@ -0,0 +1,55 @@ +package core + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + nodev1 "github.com/wundergraph/cosmo/router/gen/proto/wg/cosmo/node/v1" + "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/plan" +) + +func TestDataSourceMetaData_RequestScopedFields(t *testing.T) { + l := &Loader{} + + in := &nodev1.DataSourceConfiguration{ + RequestScopedFields: []*nodev1.RequestScopedFieldConfiguration{ + { + FieldName: "currentUser", + TypeName: "Query", + L1Key: "viewer.user", + }, + { + FieldName: "currentUser", + TypeName: "Personalized", + L1Key: "viewer.user", + }, + }, + } + + out := l.dataSourceMetaData(in, "test-subgraph") + + assert.Len(t, out.FederationMetaData.RequestScopedFields, 2) + + assert.Equal(t, plan.RequestScopedField{ + FieldName: "currentUser", + TypeName: "Query", + L1Key: "viewer.user", + }, out.FederationMetaData.RequestScopedFields[0]) + + assert.Equal(t, plan.RequestScopedField{ + FieldName: "currentUser", + TypeName: "Personalized", + L1Key: "viewer.user", + }, out.FederationMetaData.RequestScopedFields[1]) +} + +func TestDataSourceMetaData_RequestScopedFields_Empty(t *testing.T) { + l := &Loader{} + + in := &nodev1.DataSourceConfiguration{} + + out := l.dataSourceMetaData(in, "test-subgraph") + + assert.Nil(t, out.FederationMetaData.RequestScopedFields) +} diff --git a/router/core/flushwriter.go b/router/core/flushwriter.go index 98e6ab3901..41b9009f2d 100644 --- a/router/core/flushwriter.go +++ b/router/core/flushwriter.go @@ -219,7 +219,7 @@ func wrapMultipartMessage(resp []byte, wrapPayload bool) ([]byte, error) { if err != nil { return nil, err } - respValue, _, err := astjson.MergeValuesWithPath(nil, payloadWrapper, respValuePreMerge, "payload") + respValue, err := astjson.MergeValuesWithPath(nil, payloadWrapper, respValuePreMerge, "payload") if err != nil { return nil, err } diff --git a/router/core/graph_server.go b/router/core/graph_server.go index 23812b8fe4..8f34e24993 100644 --- a/router/core/graph_server.go +++ b/router/core/graph_server.go @@ -9,7 +9,9 @@ import ( "net/http" "net/url" "path/filepath" + "reflect" "runtime" + "sort" "strings" "sync" "time" @@ -57,8 +59,8 @@ import ( "github.com/wundergraph/cosmo/router/pkg/slowplancache" "github.com/wundergraph/cosmo/router/pkg/statistics" rtrace "github.com/wundergraph/cosmo/router/pkg/trace" - "github.com/wundergraph/graphql-go-tools/v2/pkg/astparser" + "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve" ) const ( @@ -92,19 +94,31 @@ type ( mux *chi.Mux // inFlightRequests is used to track the number of requests currently being processed // does not include websocket (hijacked) connections - inFlightRequests *atomic.Uint64 - graphMuxList []*graphMux - graphMuxListLock sync.Mutex - runtimeMetrics *rmetric.RuntimeMetrics - otlpEngineMetrics *rmetric.EngineMetrics - prometheusEngineMetrics *rmetric.EngineMetrics - connectionMetrics *rmetric.ConnectionMetrics - instanceData InstanceData - pubSubProviders []datasource.Provider - traceDialer *TraceDialer - connector *grpcconnector.Connector - circuitBreakerManager *circuit.Manager - headerPropagation *HeaderPropagation + inFlightRequests *atomic.Uint64 + graphMuxList []*graphMux + graphMuxListLock sync.Mutex + metrics serverMetrics + instanceData InstanceData + pubSubProviders []datasource.Provider + traceDialer *TraceDialer + connector *grpcconnector.Connector + circuitBreakerManager *circuit.Manager + headerPropagation *HeaderPropagation + entityCacheInstances map[string]resolve.LoaderCache + entityCacheKeyInterceptors []EntityCacheKeyInterceptor + } + + // serverMetrics groups every metric instrument instantiated at graph-server + // scope. Adding a new instrument only requires adding a field here and + // extending the setup/shutdown paths, not threading a new *graphServer field + // through init/shutdown code. + serverMetrics struct { + Runtime *rmetric.RuntimeMetrics + OTLPEngine *rmetric.EngineMetrics + PromEngine *rmetric.EngineMetrics + Connection *rmetric.ConnectionMetrics + OTLPEntityCache *rmetric.EntityCacheMetrics + PromEntityCache *rmetric.EntityCacheMetrics } ) @@ -193,8 +207,24 @@ func newGraphServer(ctx context.Context, r *Router, routerConfig *nodev1.RouterC HostName: r.hostName, ListenAddress: r.listenAddr, }, - storageProviders: &r.storageProviders, - headerPropagation: r.headerPropagation, + storageProviders: &r.storageProviders, + headerPropagation: r.headerPropagation, + entityCacheKeyInterceptors: r.entityCacheKeyInterceptors, + } + + entityCacheInstances, err := r.buildEntityCacheInstances() + if err != nil { + cancel() + return nil, fmt.Errorf("failed to build entity cache instances: %w", err) + } + s.entityCacheInstances = entityCacheInstances + + if entityCacheInstances != nil && r.entityCachingConfig.Enabled { + s.logEntityCacheOverrideIssues( + &r.entityCachingConfig, + routerConfig.GetSubgraphs(), + routerConfig.GetEngineConfig(), + ) } baseOtelAttributes := []attribute.KeyValue{ @@ -219,7 +249,7 @@ func newGraphServer(ctx context.Context, r *Router, routerConfig *nodev1.RouterC if s.metricConfig.OpenTelemetry.RouterRuntime { // We track runtime metrics with base router config version - s.runtimeMetrics = rmetric.NewRuntimeMetrics( + s.metrics.Runtime = rmetric.NewRuntimeMetrics( s.logger, s.otlpMeterProvider, mappedMetricAttributes, @@ -227,7 +257,7 @@ func newGraphServer(ctx context.Context, r *Router, routerConfig *nodev1.RouterC ) // Start runtime metrics - if err := s.runtimeMetrics.Start(); err != nil { + if err := s.metrics.Runtime.Start(); err != nil { return nil, err } } @@ -244,13 +274,17 @@ func newGraphServer(ctx context.Context, r *Router, routerConfig *nodev1.RouterC if err != nil { return nil, err } - s.connectionMetrics = connStore + s.metrics.Connection = connStore } if err := s.setupEngineStatistics(mappedMetricAttributes); err != nil { return nil, fmt.Errorf("failed to setup engine statistics: %w", err) } + if err := s.setupEntityCacheMetrics(mappedMetricAttributes); err != nil { + return nil, fmt.Errorf("failed to setup entity cache metrics: %w", err) + } + if s.registrationInfo != nil { publicKey, err := jwt.ParseECPublicKeyFromPEM([]byte(s.registrationInfo.GetGraphPublicKey())) if err != nil { @@ -518,7 +552,7 @@ func (s *graphServer) buildMultiGraphHandler( func (s *graphServer) setupEngineStatistics(baseAttributes []attribute.KeyValue) (err error) { // We only include the base router config version in the attributes for the engine statistics. // Same approach is used for the runtime metrics. - s.otlpEngineMetrics, err = rmetric.NewEngineMetrics( + s.metrics.OTLPEngine, err = rmetric.NewEngineMetrics( s.logger, baseAttributes, s.otlpMeterProvider, @@ -529,7 +563,7 @@ func (s *graphServer) setupEngineStatistics(baseAttributes []attribute.KeyValue) return err } - s.prometheusEngineMetrics, err = rmetric.NewEngineMetrics( + s.metrics.PromEngine, err = rmetric.NewEngineMetrics( s.logger, baseAttributes, s.promMeterProvider, @@ -543,6 +577,77 @@ func (s *graphServer) setupEngineStatistics(baseAttributes []attribute.KeyValue) return nil } +// logEntityCacheOverrideIssues walks the entity caching overrides and emits +// warnings for references to unknown subgraphs or unknown entity types. It is +// non-fatal by design (void+log): startup continues regardless. Renaming from +// "validate*" to "log*" reflects this shape — it does not gate router startup. +func (s *graphServer) logEntityCacheOverrideIssues( + cfg *config.EntityCachingConfiguration, + configSubgraphs []*nodev1.Subgraph, + engineConfig *nodev1.EngineConfiguration, +) { + // Build lookup: subgraph name set + subgraphNames := make(map[string]bool, len(configSubgraphs)) + for _, sg := range configSubgraphs { + subgraphNames[sg.Name] = true + } + + // Build lookup: subgraph name → set of entity type names + // Datasources are keyed by ID, not name — map via subgraphNameByID + entityTypesBySubgraph := make(map[string]map[string]bool) + for _, ds := range engineConfig.DatasourceConfigurations { + sgName := subgraphNameByID(configSubgraphs, ds.Id) + if sgName == "" { + continue + } + if entityTypesBySubgraph[sgName] == nil { + entityTypesBySubgraph[sgName] = make(map[string]bool) + } + for _, ec := range ds.EntityCacheConfigurations { + entityTypesBySubgraph[sgName][ec.TypeName] = true + } + } + + for _, override := range cfg.SubgraphCacheOverrides { + if !subgraphNames[override.Name] { + s.logger.Warn("entity caching: subgraph_cache_overrides references unknown subgraph", + zap.String("subgraph", override.Name)) + continue + } + for _, entity := range override.Entities { + if entities := entityTypesBySubgraph[override.Name]; entities == nil || !entities[entity.Type] { + s.logger.Warn("entity caching: subgraph_cache_overrides references unknown entity type", + zap.String("subgraph", override.Name), + zap.String("entity_type", entity.Type)) + } + } + } +} + +func (s *graphServer) setupEntityCacheMetrics(baseAttributes []attribute.KeyValue) error { + if !s.entityCachingConfig.Enabled { + return nil + } + + if s.metricConfig.OpenTelemetry.EntityCachingStats { + var err error + s.metrics.OTLPEntityCache, err = rmetric.NewEntityCacheMetrics(s.logger, baseAttributes, s.otlpMeterProvider) + if err != nil { + return fmt.Errorf("failed to create entity cache metrics for OTLP: %w", err) + } + } + + if s.metricConfig.Prometheus.EntityCachingStats { + var err error + s.metrics.PromEntityCache, err = rmetric.NewEntityCacheMetrics(s.logger, baseAttributes, s.promMeterProvider) + if err != nil { + return fmt.Errorf("failed to create entity cache metrics for Prometheus: %w", err) + } + } + + return nil +} + type graphMux struct { mux *chi.Mux @@ -564,6 +669,65 @@ type graphMux struct { prometheusMetricsExporter *graphqlmetrics.PrometheusMetricsExporter } +type cacheMetricSource interface { + Metrics() *ristretto.Metrics + MaxSizeBytes() int64 +} + +type cacheMetricRegistration struct { + cacheType string + maxCost int64 + metrics *ristretto.Metrics +} + +func entityCacheMetricRegistrations(caches map[string]cacheMetricSource) []cacheMetricRegistration { + if len(caches) == 0 { + return nil + } + + type cacheGroup struct { + source cacheMetricSource + names []string + } + + grouped := make(map[uintptr]*cacheGroup, len(caches)) + for name, source := range caches { + if source == nil || source.Metrics() == nil || source.MaxSizeBytes() <= 0 { + continue + } + id := reflect.ValueOf(source).Pointer() + group := grouped[id] + if group == nil { + group = &cacheGroup{source: source} + grouped[id] = group + } + group.names = append(group.names, name) + } + + registrations := make([]cacheMetricRegistration, 0, len(grouped)) + for _, group := range grouped { + sort.Strings(group.names) + name := group.names[0] + for _, candidate := range group.names { + if candidate != "default" { + name = candidate + break + } + } + registrations = append(registrations, cacheMetricRegistration{ + cacheType: "entity_" + name, + maxCost: group.source.MaxSizeBytes(), + metrics: group.source.Metrics(), + }) + } + + sort.Slice(registrations, func(i, j int) bool { + return registrations[i].cacheType < registrations[j].cacheType + }) + + return registrations +} + // buildOperationCaches creates the caches for the graph mux. // The caches are created based on the engine configuration. func (s *graphMux) buildOperationCaches(srv *graphServer) (computeSha256 bool, err error) { @@ -807,6 +971,18 @@ func (s *graphMux) configureCacheMetrics(srv *graphServer, baseOtelAttributes [] metricInfos = append(metricInfos, rmetric.NewCacheMetricInfo("query_hash", srv.engineExecutionConfiguration.OperationHashCacheSize, s.operationHashCache.Metrics)) } + entityMetricSources := make(map[string]cacheMetricSource) + for name, cache := range srv.entityCacheInstances { + source, ok := cache.(cacheMetricSource) + if !ok { + continue + } + entityMetricSources[name] = source + } + for _, registration := range entityCacheMetricRegistrations(entityMetricSources) { + metricInfos = append(metricInfos, rmetric.NewCacheMetricInfo(registration.cacheType, registration.maxCost, registration.metrics)) + } + if s.otelCacheMetrics != nil { if err := s.otelCacheMetrics.RegisterObservers(metricInfos); err != nil { return fmt.Errorf("failed to register observer for OTLP cache metrics: %w", err) @@ -1283,11 +1459,11 @@ func (s *graphServer) buildGraphMux( return nil, fmt.Errorf("failed to setup plugin host: %w", err) } - enableTraceClient := s.connectionMetrics != nil || exprManager.VisitorManager.IsSubgraphTraceUsedInExpressions() + enableTraceClient := s.metrics.Connection != nil || exprManager.VisitorManager.IsSubgraphTraceUsedInExpressions() var baseConnMetricStore rmetric.ConnectionMetricStore = &rmetric.NoopConnectionMetricStore{} - if s.connectionMetrics != nil { - baseConnMetricStore = s.connectionMetrics + if s.metrics.Connection != nil { + baseConnMetricStore = s.metrics.Connection } // Build retry options and handle any expression compilation errors @@ -1339,6 +1515,8 @@ func (s *graphServer) buildGraphMux( HeartbeatInterval: s.subscriptionHeartbeatInterval, PluginsEnabled: s.plugins.Enabled, InstanceData: s.instanceData, + EntityCacheInstances: s.entityCacheInstances, + EntityCachingConfig: &s.entityCachingConfig, }, ) if err != nil { @@ -1602,6 +1780,22 @@ func (s *graphServer) buildGraphMux( handlerOpts.ApolloSubscriptionMultipartPrintBoundary = s.apolloCompatibilityFlags.SubscriptionMultipartPrintBoundary.Enabled } + if s.entityCachingConfig.Enabled { + handlerOpts.EntityCaching = EntityCachingHandlerOptions{ + L1Enabled: s.entityCachingConfig.L1.Enabled, + L2Enabled: s.entityCachingConfig.L2.Enabled, + GlobalKeyPrefix: s.entityCachingConfig.GlobalCacheKeyPrefix, + KeyInterceptors: s.entityCacheKeyInterceptors, + } + + for _, m := range []*rmetric.EntityCacheMetrics{s.metrics.OTLPEntityCache, s.metrics.PromEntityCache} { + if m != nil { + handlerOpts.EntityCaching.Metrics = append(handlerOpts.EntityCaching.Metrics, m) + } + } + // TODO: Add entity analytics exporter to handler options here once analytics pipeline is implemented (see ENTITY_CACHE_ANALYTICS.md). + } + graphqlHandler := NewGraphQLHandler(handlerOpts) executor.Resolver.SetAsyncErrorWriter(graphqlHandler) @@ -1958,26 +2152,38 @@ func (s *graphServer) Shutdown(ctx context.Context) error { ctx = newCtx } - if s.runtimeMetrics != nil { - if err := s.runtimeMetrics.Shutdown(); err != nil { + if s.metrics.Runtime != nil { + if err := s.metrics.Runtime.Shutdown(); err != nil { finalErr = errors.Join(finalErr, err) } } - if s.connectionMetrics != nil { - if aErr := s.connectionMetrics.Shutdown(ctx); aErr != nil { + if s.metrics.Connection != nil { + if aErr := s.metrics.Connection.Shutdown(ctx); aErr != nil { finalErr = errors.Join(finalErr, aErr) } } - if s.otlpEngineMetrics != nil { - if err := s.otlpEngineMetrics.Shutdown(); err != nil { + if s.metrics.OTLPEngine != nil { + if err := s.metrics.OTLPEngine.Shutdown(); err != nil { + finalErr = errors.Join(finalErr, err) + } + } + + if s.metrics.PromEngine != nil { + if err := s.metrics.PromEngine.Shutdown(); err != nil { + finalErr = errors.Join(finalErr, err) + } + } + + if s.metrics.OTLPEntityCache != nil { + if err := s.metrics.OTLPEntityCache.Shutdown(); err != nil { finalErr = errors.Join(finalErr, err) } } - if s.prometheusEngineMetrics != nil { - if err := s.prometheusEngineMetrics.Shutdown(); err != nil { + if s.metrics.PromEntityCache != nil { + if err := s.metrics.PromEntityCache.Shutdown(); err != nil { finalErr = errors.Join(finalErr, err) } } diff --git a/router/core/graph_server_cache_metrics_test.go b/router/core/graph_server_cache_metrics_test.go new file mode 100644 index 0000000000..95e5f8d05f --- /dev/null +++ b/router/core/graph_server_cache_metrics_test.go @@ -0,0 +1,134 @@ +package core + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel/attribute" + sdkmetric "go.opentelemetry.io/otel/sdk/metric" + "go.uber.org/zap" + + "github.com/wundergraph/cosmo/router/pkg/config" + "github.com/wundergraph/cosmo/router/pkg/entitycache" + rmetric "github.com/wundergraph/cosmo/router/pkg/metric" +) + +func TestEntityCacheMetricRegistrations_DeduplicatesDefaultAlias(t *testing.T) { + t.Parallel() + + cache, err := entitycache.NewMemoryEntityCache(1024) + require.NoError(t, err) + t.Cleanup(func() { _ = cache.Close() }) + + registrations := entityCacheMetricRegistrations(map[string]cacheMetricSource{ + "default": cache, + "memory-1": cache, + }) + + require.Len(t, registrations, 1) + require.Equal(t, "entity_memory-1", registrations[0].cacheType) + require.EqualValues(t, 1024, registrations[0].maxCost) + require.NotNil(t, registrations[0].metrics) +} + +func TestEntityCacheMetricRegistrations_UsesCircuitBreakerWrappedMemoryCache(t *testing.T) { + t.Parallel() + + cache, err := entitycache.NewMemoryEntityCache(2048) + require.NoError(t, err) + t.Cleanup(func() { _ = cache.Close() }) + + wrapped := entitycache.NewCircuitBreakerCache(cache, entitycache.CircuitBreakerConfig{ + Enabled: true, + FailureThreshold: 3, + CooldownPeriod: time.Second, + }) + + registrations := entityCacheMetricRegistrations(map[string]cacheMetricSource{ + "memory-2": wrapped, + }) + + require.Len(t, registrations, 1) + require.Equal(t, "entity_memory-2", registrations[0].cacheType) + require.EqualValues(t, 2048, registrations[0].maxCost) + require.NotNil(t, registrations[0].metrics) +} + +func TestSetupEntityCacheMetrics_RespectsMetricOptIn(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + metrics rmetric.Config + wantOTLP bool + wantProm bool + }{ + { + name: "default off", + metrics: rmetric.Config{}, + wantOTLP: false, + wantProm: false, + }, + { + name: "otlp only", + metrics: rmetric.Config{ + OpenTelemetry: rmetric.OpenTelemetry{ + EntityCachingStats: true, + }, + }, + wantOTLP: true, + wantProm: false, + }, + { + name: "prometheus only", + metrics: rmetric.Config{ + Prometheus: rmetric.PrometheusConfig{ + EntityCachingStats: true, + }, + }, + wantOTLP: false, + wantProm: true, + }, + { + name: "both enabled", + metrics: rmetric.Config{ + OpenTelemetry: rmetric.OpenTelemetry{ + EntityCachingStats: true, + }, + Prometheus: rmetric.PrometheusConfig{ + EntityCachingStats: true, + }, + }, + wantOTLP: true, + wantProm: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + s := &graphServer{ + Config: &Config{ + logger: zap.NewNop(), + entityCachingConfig: config.EntityCachingConfiguration{ + Enabled: true, + }, + metricConfig: &tt.metrics, + otlpMeterProvider: sdkmetric.NewMeterProvider(sdkmetric.WithReader(sdkmetric.NewManualReader())), + promMeterProvider: sdkmetric.NewMeterProvider(sdkmetric.WithReader(sdkmetric.NewManualReader())), + }, + } + + err := s.setupEntityCacheMetrics([]attribute.KeyValue{ + attribute.String("service.name", "test-router"), + }) + require.NoError(t, err) + + assert.Equal(t, tt.wantOTLP, s.metrics.OTLPEntityCache != nil) + assert.Equal(t, tt.wantProm, s.metrics.PromEntityCache != nil) + }) + } +} diff --git a/router/core/graphql_handler.go b/router/core/graphql_handler.go index d8abf7c401..1fef9c2c1e 100644 --- a/router/core/graphql_handler.go +++ b/router/core/graphql_handler.go @@ -16,6 +16,7 @@ import ( rErrors "github.com/wundergraph/cosmo/router/internal/errors" "github.com/wundergraph/cosmo/router/pkg/config" + rmetric "github.com/wundergraph/cosmo/router/pkg/metric" rotel "github.com/wundergraph/cosmo/router/pkg/otel" "github.com/wundergraph/cosmo/router/pkg/statistics" @@ -85,6 +86,17 @@ type HandlerOptions struct { ApolloSubscriptionMultipartPrintBoundary bool HeaderPropagation *HeaderPropagation + + EntityCaching EntityCachingHandlerOptions +} + +// EntityCachingHandlerOptions groups all entity caching configuration passed to the GraphQL handler. +type EntityCachingHandlerOptions struct { + L1Enabled bool + L2Enabled bool + GlobalKeyPrefix string + KeyInterceptors []EntityCacheKeyInterceptor + Metrics []*rmetric.EntityCacheMetrics } func NewGraphQLHandler(opts HandlerOptions) *GraphQLHandler { @@ -106,6 +118,7 @@ func NewGraphQLHandler(opts HandlerOptions) *GraphQLHandler { engineLoaderHooks: opts.EngineLoaderHooks, apolloSubscriptionMultipartPrintBoundary: opts.ApolloSubscriptionMultipartPrintBoundary, headerPropagation: opts.HeaderPropagation, + entityCaching: opts.EntityCaching, } return graphQLHandler } @@ -138,6 +151,8 @@ type GraphQLHandler struct { enableCostResponseHeaders bool apolloSubscriptionMultipartPrintBoundary bool + + entityCaching EntityCachingHandlerOptions } func (h *GraphQLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { @@ -163,6 +178,7 @@ func (h *GraphQLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { resolveCtx.InitialPayload = reqCtx.operation.initialPayload resolveCtx.Extensions = reqCtx.operation.extensions resolveCtx.ExecutionOptions = reqCtx.operation.executionOptions + resolveCtx.ExecutionOptions.Caching = h.cachingOptions(reqCtx) if h.headerPropagation != nil { resolveCtx.SubgraphHeadersBuilder = SubgraphHeadersBuilder( @@ -243,7 +259,7 @@ func (h *GraphQLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } } - info, err := h.executor.Resolver.ArenaResolveGraphQLResponse(resolveCtx, p.Response, hpw) + info, err := h.executor.Resolver.ResolveGraphQLResponse(resolveCtx, p.Response, hpw) reqCtx.dataSourceNames = getSubgraphNames(p.Response.DataSources) if err != nil { trackFinalResponseError(resolveCtx.Context(), err) @@ -262,6 +278,7 @@ func (h *GraphQLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { graphqlExecutionSpan.SetAttributes(rotel.WgAcquireResolverWaitTimeMs.Int64(info.ResolveAcquireWaitTime.Milliseconds())) graphqlExecutionSpan.SetAttributes(rotel.WgResolverDeduplicatedRequest.Bool(info.ResolveDeduplicated)) + h.recordEntityCacheMetrics(resolveCtx) case *plan.SubscriptionResponsePlan: var ( writer resolve.SubscriptionResponseWriter @@ -553,3 +570,73 @@ func (h *GraphQLHandler) setDebugCacheHeaders(w http.ResponseWriter, opCtx *oper } } } + +// recordEntityCacheMetrics records OTEL metrics from the cache analytics snapshot. +// TODO: Add entity analytics export here once the analytics pipeline is implemented (see ENTITY_CACHE_ANALYTICS.md). +func (h *GraphQLHandler) recordEntityCacheMetrics(resolveCtx *resolve.Context) { + if len(h.entityCaching.Metrics) == 0 { + return + } + snapshot := resolveCtx.GetCacheStats() + ctx := resolveCtx.Context() + for _, m := range h.entityCaching.Metrics { + m.RecordSnapshot(ctx, snapshot) + } +} + +const ( + disableEntityCacheHeader = "X-WG-Disable-Entity-Cache" + disableEntityCacheL1Header = "X-WG-Disable-Entity-Cache-L1" + disableEntityCacheL2Header = "X-WG-Disable-Entity-Cache-L2" + cacheKeyPrefixHeader = "X-WG-Cache-Key-Prefix" +) + +func (h *GraphQLHandler) cachingOptions(reqCtx *requestContext) resolve.CachingOptions { + enableL1 := h.entityCaching.L1Enabled + enableL2 := h.entityCaching.L2Enabled + globalKeyPrefix := h.entityCaching.GlobalKeyPrefix + + // Allow per-request cache control headers only when tracing is authorized + // (dev mode or valid studio request token). This prevents production abuse. + if reqCtx.operation.traceOptions.Enable { + if reqCtx.request.Header.Get(disableEntityCacheHeader) == "true" { + enableL1 = false + enableL2 = false + } else { + if reqCtx.request.Header.Get(disableEntityCacheL1Header) == "true" { + enableL1 = false + } + if reqCtx.request.Header.Get(disableEntityCacheL2Header) == "true" { + enableL2 = false + } + } + if prefix := reqCtx.request.Header.Get(cacheKeyPrefixHeader); prefix != "" { + if globalKeyPrefix != "" { + globalKeyPrefix = prefix + ":" + globalKeyPrefix + } else { + globalKeyPrefix = prefix + } + } + } + + return resolve.CachingOptions{ + EnableL1Cache: enableL1, + EnableL2Cache: enableL2, + EnableCacheAnalytics: len(h.entityCaching.Metrics) > 0, + GlobalCacheKeyPrefix: globalKeyPrefix, + L2CacheKeyInterceptor: h.buildL2CacheKeyInterceptor(reqCtx), + } +} + +func (h *GraphQLHandler) buildL2CacheKeyInterceptor(reqCtx *requestContext) resolve.L2CacheKeyInterceptor { + if len(h.entityCaching.KeyInterceptors) == 0 { + return nil + } + return func(ctx context.Context, key string, info resolve.L2CacheKeyInterceptorInfo) string { + keys := [][]byte{[]byte(key)} + for _, interceptor := range h.entityCaching.KeyInterceptors { + keys = interceptor.OnEntityCacheKeys(keys, reqCtx) + } + return string(keys[0]) + } +} diff --git a/router/core/graphql_handler_caching_options_test.go b/router/core/graphql_handler_caching_options_test.go new file mode 100644 index 0000000000..b3d366e400 --- /dev/null +++ b/router/core/graphql_handler_caching_options_test.go @@ -0,0 +1,187 @@ +package core + +import ( + "net/http" + "net/http/httptest" + "testing" + + "github.com/stretchr/testify/require" + "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve" + + rmetric "github.com/wundergraph/cosmo/router/pkg/metric" +) + +func newCachingOptionsHandler(entity EntityCachingHandlerOptions) *GraphQLHandler { + return &GraphQLHandler{entityCaching: entity} +} + +func newCachingOptionsReqCtx(t *testing.T, traceEnabled bool, headers map[string]string) *requestContext { + t.Helper() + req := httptest.NewRequest(http.MethodPost, "/graphql", nil) + for k, v := range headers { + req.Header.Set(k, v) + } + return &requestContext{ + request: req, + operation: &operationContext{ + traceOptions: resolve.TraceOptions{Enable: traceEnabled}, + }, + } +} + +func TestGraphQLHandler_cachingOptions_DefaultsFromHandler(t *testing.T) { + t.Parallel() + h := newCachingOptionsHandler(EntityCachingHandlerOptions{ + L1Enabled: true, + L2Enabled: true, + GlobalKeyPrefix: "router-a", + }) + reqCtx := newCachingOptionsReqCtx(t, false, nil) + + opts := h.cachingOptions(reqCtx) + require.Equal(t, resolve.CachingOptions{ + EnableL1Cache: true, + EnableL2Cache: true, + EnableCacheAnalytics: false, + GlobalCacheKeyPrefix: "router-a", + L2CacheKeyInterceptor: nil, + }, opts) +} + +func TestGraphQLHandler_cachingOptions_DisableCacheHeaderIgnoredWithoutTracing(t *testing.T) { + t.Parallel() + h := newCachingOptionsHandler(EntityCachingHandlerOptions{ + L1Enabled: true, + L2Enabled: true, + }) + // Tracing NOT enabled — headers should be ignored. + reqCtx := newCachingOptionsReqCtx(t, false, map[string]string{ + disableEntityCacheHeader: "true", + disableEntityCacheL1Header: "true", + disableEntityCacheL2Header: "true", + cacheKeyPrefixHeader: "ignored", + }) + + opts := h.cachingOptions(reqCtx) + require.Equal(t, resolve.CachingOptions{ + EnableL1Cache: true, + EnableL2Cache: true, + EnableCacheAnalytics: false, + GlobalCacheKeyPrefix: "", + L2CacheKeyInterceptor: nil, + }, opts) +} + +func TestGraphQLHandler_cachingOptions_DisableAllWithTracing(t *testing.T) { + t.Parallel() + h := newCachingOptionsHandler(EntityCachingHandlerOptions{ + L1Enabled: true, + L2Enabled: true, + }) + reqCtx := newCachingOptionsReqCtx(t, true, map[string]string{ + disableEntityCacheHeader: "true", + }) + + opts := h.cachingOptions(reqCtx) + require.Equal(t, resolve.CachingOptions{ + EnableL1Cache: false, + EnableL2Cache: false, + EnableCacheAnalytics: false, + GlobalCacheKeyPrefix: "", + L2CacheKeyInterceptor: nil, + }, opts) +} + +func TestGraphQLHandler_cachingOptions_DisableL1Only(t *testing.T) { + t.Parallel() + h := newCachingOptionsHandler(EntityCachingHandlerOptions{ + L1Enabled: true, + L2Enabled: true, + }) + reqCtx := newCachingOptionsReqCtx(t, true, map[string]string{ + disableEntityCacheL1Header: "true", + }) + + opts := h.cachingOptions(reqCtx) + require.Equal(t, resolve.CachingOptions{ + EnableL1Cache: false, + EnableL2Cache: true, + EnableCacheAnalytics: false, + GlobalCacheKeyPrefix: "", + L2CacheKeyInterceptor: nil, + }, opts) +} + +func TestGraphQLHandler_cachingOptions_DisableL2Only(t *testing.T) { + t.Parallel() + h := newCachingOptionsHandler(EntityCachingHandlerOptions{ + L1Enabled: true, + L2Enabled: true, + }) + reqCtx := newCachingOptionsReqCtx(t, true, map[string]string{ + disableEntityCacheL2Header: "true", + }) + + opts := h.cachingOptions(reqCtx) + require.Equal(t, resolve.CachingOptions{ + EnableL1Cache: true, + EnableL2Cache: false, + EnableCacheAnalytics: false, + GlobalCacheKeyPrefix: "", + L2CacheKeyInterceptor: nil, + }, opts) +} + +func TestGraphQLHandler_cachingOptions_CacheKeyPrefixPrependsToGlobal(t *testing.T) { + t.Parallel() + h := newCachingOptionsHandler(EntityCachingHandlerOptions{ + L1Enabled: true, + L2Enabled: true, + GlobalKeyPrefix: "base", + }) + reqCtx := newCachingOptionsReqCtx(t, true, map[string]string{ + cacheKeyPrefixHeader: "req-42", + }) + + opts := h.cachingOptions(reqCtx) + require.Equal(t, resolve.CachingOptions{ + EnableL1Cache: true, + EnableL2Cache: true, + EnableCacheAnalytics: false, + GlobalCacheKeyPrefix: "req-42:base", + L2CacheKeyInterceptor: nil, + }, opts) +} + +func TestGraphQLHandler_cachingOptions_CacheKeyPrefixReplacesEmptyGlobal(t *testing.T) { + t.Parallel() + h := newCachingOptionsHandler(EntityCachingHandlerOptions{ + L1Enabled: true, + L2Enabled: true, + }) + reqCtx := newCachingOptionsReqCtx(t, true, map[string]string{ + cacheKeyPrefixHeader: "standalone", + }) + + opts := h.cachingOptions(reqCtx) + require.Equal(t, resolve.CachingOptions{ + EnableL1Cache: true, + EnableL2Cache: true, + EnableCacheAnalytics: false, + GlobalCacheKeyPrefix: "standalone", + L2CacheKeyInterceptor: nil, + }, opts) +} + +func TestGraphQLHandler_cachingOptions_MetricsEnablesAnalytics(t *testing.T) { + t.Parallel() + h := newCachingOptionsHandler(EntityCachingHandlerOptions{ + L1Enabled: true, + L2Enabled: true, + Metrics: []*rmetric.EntityCacheMetrics{nil}, // just non-empty slice + }) + reqCtx := newCachingOptionsReqCtx(t, false, nil) + + opts := h.cachingOptions(reqCtx) + require.True(t, opts.EnableCacheAnalytics) +} diff --git a/router/core/modules.go b/router/core/modules.go index 086c7efda0..ea439e2b0e 100644 --- a/router/core/modules.go +++ b/router/core/modules.go @@ -143,6 +143,16 @@ type TracePropagationProvider interface { TracePropagators() []propagation.TextMapPropagator } +// EntityCacheKeyInterceptor allows custom modules to transform entity cache keys +// before they are used for L2 cache operations. +type EntityCacheKeyInterceptor interface { + // OnEntityCacheKeys transforms a batch of cache keys for an entity cache operation. + // Each key is a JSON-encoded entity key or root field key. + // Returns the transformed keys in the same order. The returned slice must have + // the same length as the input slice. + OnEntityCacheKeys(keys [][]byte, ctx RequestContext) [][]byte +} + // Provisioner is called before the server starts // It allows you to initialize your module, e.g., create a database connection // or load a configuration file. diff --git a/router/core/router.go b/router/core/router.go index cb173417d3..e6ea3385a7 100644 --- a/router/core/router.go +++ b/router/core/router.go @@ -6,6 +6,7 @@ import ( "crypto/x509" "errors" "fmt" + "io" "net" "net/http" "net/url" @@ -47,6 +48,7 @@ import ( "github.com/wundergraph/cosmo/router/pkg/controlplane/configpoller" "github.com/wundergraph/cosmo/router/pkg/controlplane/selfregister" "github.com/wundergraph/cosmo/router/pkg/cors" + "github.com/wundergraph/cosmo/router/pkg/entitycache" "github.com/wundergraph/cosmo/router/pkg/execution_config" "github.com/wundergraph/cosmo/router/pkg/health" "github.com/wundergraph/cosmo/router/pkg/mcpserver" @@ -56,6 +58,7 @@ import ( rtrace "github.com/wundergraph/cosmo/router/pkg/trace" "github.com/wundergraph/cosmo/router/pkg/trace/attributeprocessor" "github.com/wundergraph/cosmo/router/pkg/watcher" + "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve" "github.com/wundergraph/graphql-go-tools/v2/pkg/netpoll" ) @@ -337,6 +340,11 @@ func NewRouter(opts ...Option) (*Router, error) { "x-wg-token", "x-wg-skip-loader", "x-wg-include-query-plan", + // Required for the studio playground's Cache Explorer (cache-mode dropdown) + "x-wg-disable-entity-cache", + "x-wg-disable-entity-cache-l1", + "x-wg-disable-entity-cache-l2", + "x-wg-cache-key-prefix", // Required for Trace Context propagation "traceparent", "tracestate", @@ -736,6 +744,10 @@ func (r *Router) initModules(ctx context.Context) error { r.subscriptionHooks.onReceiveEvents.handlers = append(r.subscriptionHooks.onReceiveEvents.handlers, handler.OnReceiveEvents) } + if interceptor, ok := moduleInstance.(EntityCacheKeyInterceptor); ok { + r.entityCacheKeyInterceptors = append(r.entityCacheKeyInterceptors, interceptor) + } + r.modules = append(r.modules, moduleInstance) r.logger.Info("Module registered", @@ -856,21 +868,45 @@ func (r *Router) bootstrap(ctx context.Context) error { } if r.traceConfig.Enabled { - tp, err := rtrace.NewTracerProvider(ctx, &rtrace.ProviderConfig{ - Logger: r.logger, - Config: r.traceConfig, - ServiceInstanceID: r.instanceID, - IPAnonymization: &attributeprocessor.IPAnonymizationConfig{ - Enabled: r.ipAnonymization.Enabled, - Method: attributeprocessor.IPAnonymizationMethod(r.ipAnonymization.Method), - }, - SanitizeUTF8: r.traceConfig.SanitizeUTF8, - MemoryExporter: r.traceConfig.TestMemoryExporter, - }) - if err != nil { - return fmt.Errorf("failed to start trace agent: %w", err) + // Skip installing a real (recording + exporting) tracer provider when there is + // no realistic export destination. Without this, the router records 100%-sampled + // spans in memory, runs the BatchSpanProcessor, and attempts to export — work + // that's pure overhead when nothing listens on the other end. Observed at 50 + // sustained VUs on the cache demo: ~60% of all router allocations are OTel span + // attribute/snapshot work, which inflates GC pressure and produces p99 tails far + // beyond p95. Keeping the NeverSample provider installed at router.go:250 (the + // initial placeholder) means `IsRecording()` returns false on every span, and + // all the middleware-side `SetAttributes` / span creation short-circuits cheaply. + // + // "Realistic export destination" = at least one of: + // - a graph API token is set (so the default Cosmo Cloud exporter can ship spans), OR + // - the user has explicitly configured a trace exporter (env or YAML) whose + // endpoint is different from the Cosmo Cloud default. + // + // A user who self-hosts an OTLP collector at the Cosmo Cloud endpoint URL is an + // edge case; they can force recording by setting any exporter explicitly. + hasRealExporter := r.graphApiToken != "" || + r.traceConfig.TestMemoryExporter != nil || + rtrace.HasNonDefaultExporter(r.traceConfig) + if !hasRealExporter { + r.logger.Info("Tracing is enabled but no graph token and no custom exporter are configured; installing no-op tracer provider to avoid span-recording overhead. Configure a trace exporter or set a graph token to enable tracing.") + } else { + tp, err := rtrace.NewTracerProvider(ctx, &rtrace.ProviderConfig{ + Logger: r.logger, + Config: r.traceConfig, + ServiceInstanceID: r.instanceID, + IPAnonymization: &attributeprocessor.IPAnonymizationConfig{ + Enabled: r.ipAnonymization.Enabled, + Method: attributeprocessor.IPAnonymizationMethod(r.ipAnonymization.Method), + }, + SanitizeUTF8: r.traceConfig.SanitizeUTF8, + MemoryExporter: r.traceConfig.TestMemoryExporter, + }) + if err != nil { + return fmt.Errorf("failed to start trace agent: %w", err) + } + r.tracerProvider = tp } - r.tracerProvider = tp } // Prometheus metrics rely on OTLP metrics @@ -920,6 +956,8 @@ func (r *Router) bootstrap(ctx context.Context) error { r.logger.Info("GraphQL schema coverage metrics enabled") } + // TODO: Add entity analytics exporter setup here once the analytics pipeline is implemented (see ENTITY_CACHE_ANALYTICS.md). + // Create Prometheus metrics exporter for schema field usage // Note: This is separate from the Prometheus meter provider which handles OTEL metrics // This exporter is specifically for schema field usage tracking via the Prometheus sink @@ -1413,6 +1451,111 @@ func (r *Router) buildConfigPoller(registry *ProviderRegistry) error { return nil } +// buildEntityCacheInstances creates Redis-backed LoaderCache instances from storage providers +// based on the entity caching configuration. If pre-seeded instances are set (via WithEntityCacheInstances), +// those are returned directly. +func (r *Router) buildEntityCacheInstances() (map[string]resolve.LoaderCache, error) { + if r.entityCacheInstances != nil { + return r.entityCacheInstances, nil + } + if !r.entityCachingConfig.Enabled || !r.entityCachingConfig.L2.Enabled { + return nil, nil + } + + caches := make(map[string]resolve.LoaderCache) + l2Cfg := r.entityCachingConfig.L2 + + // Build default cache from l2.storage.provider_id. Store it under both the + // literal "default" key (used when no override matches) and under its real + // provider_id so an override that redirects to the same backend reuses the + // same instance instead of allocating a second one. + if l2Cfg.Storage.ProviderID != "" { + cache, err := r.buildSingleEntityCache(l2Cfg.Storage.ProviderID, l2Cfg) + if err != nil { + return nil, fmt.Errorf("entity caching default provider: %w", err) + } + caches["default"] = cache + caches[l2Cfg.Storage.ProviderID] = cache + } + + // Build per-subgraph/entity caches from subgraph_cache_overrides + for _, sg := range r.entityCachingConfig.SubgraphCacheOverrides { + // Collect unique provider IDs from subgraph-level and entity-level overrides + providerIDs := make(map[string]string) // providerID → context (for error messages) + if sg.StorageProviderID != "" && sg.StorageProviderID != "default" { + providerIDs[sg.StorageProviderID] = sg.Name + } + for _, entity := range sg.Entities { + if entity.StorageProviderID != "" && entity.StorageProviderID != "default" { + providerIDs[entity.StorageProviderID] = sg.Name + "." + entity.Type + } + } + for providerID, context := range providerIDs { + if _, exists := caches[providerID]; exists { + // Already built (either as the default cache's provider alias + // or from an earlier override); reuse the same instance. + continue + } + cache, err := r.buildSingleEntityCache(providerID, l2Cfg) + if err != nil { + return nil, fmt.Errorf("entity caching provider %q for %s: %w", + providerID, context, err) + } + caches[providerID] = cache + } + } + + return caches, nil +} + +// buildSingleEntityCache creates a cache backed by either Redis or memory, with optional circuit breaker wrapping. +func (r *Router) buildSingleEntityCache(providerID string, l2Cfg config.EntityCachingL2Configuration) (resolve.LoaderCache, error) { + var cache resolve.LoaderCache + if memProvider, ok := r.findMemoryProvider(providerID); ok { + mc, err := entitycache.NewMemoryEntityCache(int64(memProvider.MaxSize)) + if err != nil { + return nil, fmt.Errorf("creating memory cache: %w", err) + } + cache = mc + } else { + client, err := r.buildRedisClient(providerID) + if err != nil { + return nil, err + } + cache = entitycache.NewRedisEntityCache(client, l2Cfg.Storage.KeyPrefix) + } + if l2Cfg.CircuitBreaker.Enabled { + cache = entitycache.NewCircuitBreakerCache(cache, entitycache.CircuitBreakerConfig{ + Enabled: true, + FailureThreshold: l2Cfg.CircuitBreaker.FailureThreshold, + CooldownPeriod: l2Cfg.CircuitBreaker.CooldownPeriod, + }) + } + return cache, nil +} + +func (r *Router) buildRedisClient(providerID string) (rd.RDCloser, error) { + for _, provider := range r.storageProviders.Redis { + if provider.ID == providerID { + return rd.NewRedisCloser(&rd.RedisCloserOptions{ + Logger: r.logger, + URLs: provider.URLs, + ClusterEnabled: provider.ClusterEnabled, + }) + } + } + return nil, fmt.Errorf("storage provider %q not found in storage_providers (checked redis, memory)", providerID) +} + +func (r *Router) findMemoryProvider(providerID string) (*config.MemoryStorageProvider, bool) { + for i := range r.storageProviders.Memory { + if r.storageProviders.Memory[i].ID == providerID { + return &r.storageProviders.Memory[i], true + } + } + return nil, false +} + // Start starts the router. It does block until the router has been initialized. After that the server is listening // on a separate goroutine. The server can be shutdown with Router.Shutdown(). Not safe for concurrent use. // During initialization, the router will register itself with the control plane and poll the config from the CDN @@ -1788,6 +1931,15 @@ func (r *Router) Shutdown(ctx context.Context) error { r.pqlStore.Close() } + // Close entity cache instances that implement io.Closer (e.g. ristretto-backed MemoryEntityCache). + for _, cache := range r.entityCacheInstances { + if closer, ok := cache.(io.Closer); ok { + if closeErr := closer.Close(); closeErr != nil { + err.Append(fmt.Errorf("failed to close entity cache: %w", closeErr)) + } + } + } + r.usage.Close() wg.Wait() @@ -2376,6 +2528,18 @@ func WithStorageProviders(cfg config.StorageProviders) Option { } } +func WithEntityCaching(cfg config.EntityCachingConfiguration) Option { + return func(r *Router) { + r.entityCachingConfig = cfg + } +} + +func WithEntityCacheInstances(caches map[string]resolve.LoaderCache) Option { + return func(r *Router) { + r.entityCacheInstances = caches + } +} + func WithClientHeader(cfg config.ClientHeader) Option { return func(r *Router) { r.clientHeader = cfg @@ -2598,10 +2762,11 @@ func MetricConfigFromTelemetry(cfg *config.Telemetry) *rmetric.Config { ResourceAttributes: buildResourceAttributes(cfg.ResourceAttributes), CardinalityLimit: cfg.Metrics.CardinalityLimit, OpenTelemetry: rmetric.OpenTelemetry{ - Enabled: cfg.Metrics.OTLP.Enabled, - RouterRuntime: cfg.Metrics.OTLP.RouterRuntime, - GraphqlCache: cfg.Metrics.OTLP.GraphqlCache, - ConnectionStats: cfg.Metrics.OTLP.ConnectionStats, + Enabled: cfg.Metrics.OTLP.Enabled, + RouterRuntime: cfg.Metrics.OTLP.RouterRuntime, + GraphqlCache: cfg.Metrics.OTLP.GraphqlCache, + ConnectionStats: cfg.Metrics.OTLP.ConnectionStats, + EntityCachingStats: cfg.Metrics.OTLP.EntityCachingStats, EngineStats: rmetric.EngineStatsConfig{ Subscription: cfg.Metrics.OTLP.EngineStats.Subscriptions, }, @@ -2618,11 +2783,12 @@ func MetricConfigFromTelemetry(cfg *config.Telemetry) *rmetric.Config { }, }, Prometheus: rmetric.PrometheusConfig{ - Enabled: cfg.Metrics.Prometheus.Enabled, - ListenAddr: cfg.Metrics.Prometheus.ListenAddr, - Path: cfg.Metrics.Prometheus.Path, - GraphqlCache: cfg.Metrics.Prometheus.GraphqlCache, - ConnectionStats: cfg.Metrics.Prometheus.ConnectionStats, + Enabled: cfg.Metrics.Prometheus.Enabled, + ListenAddr: cfg.Metrics.Prometheus.ListenAddr, + Path: cfg.Metrics.Prometheus.Path, + GraphqlCache: cfg.Metrics.Prometheus.GraphqlCache, + ConnectionStats: cfg.Metrics.Prometheus.ConnectionStats, + EntityCachingStats: cfg.Metrics.Prometheus.EntityCachingStats, EngineStats: rmetric.EngineStatsConfig{ Subscription: cfg.Metrics.Prometheus.EngineStats.Subscriptions, }, diff --git a/router/core/router_config.go b/router/core/router_config.go index 9f4b0bf84c..2648f4bddd 100644 --- a/router/core/router_config.go +++ b/router/core/router_config.go @@ -21,6 +21,7 @@ import ( rmetric "github.com/wundergraph/cosmo/router/pkg/metric" "github.com/wundergraph/cosmo/router/pkg/pubsub/datasource" rtrace "github.com/wundergraph/cosmo/router/pkg/trace" + "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve" "go.opentelemetry.io/otel/propagation" sdkmetric "go.opentelemetry.io/otel/sdk/metric" sdktrace "go.opentelemetry.io/otel/sdk/trace" @@ -151,6 +152,9 @@ type Config struct { plugins config.PluginsConfiguration tracingAttributes []config.CustomAttribute subscriptionHooks subscriptionHooks + entityCachingConfig config.EntityCachingConfiguration + entityCacheInstances map[string]resolve.LoaderCache + entityCacheKeyInterceptors []EntityCacheKeyInterceptor } // Usage returns an anonymized version of the config for usage tracking diff --git a/router/core/router_entity_cache_test.go b/router/core/router_entity_cache_test.go new file mode 100644 index 0000000000..20cc98e791 --- /dev/null +++ b/router/core/router_entity_cache_test.go @@ -0,0 +1,170 @@ +package core + +import ( + "testing" + "time" + + ristretto "github.com/dgraph-io/ristretto/v2" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + + "github.com/wundergraph/cosmo/router/pkg/config" + "github.com/wundergraph/cosmo/router/pkg/entitycache" +) + +// TestBuildEntityCacheInstances_ReusesDefaultCacheForSameProviderID verifies +// that when an override points at the same provider_id as l2.storage.provider_id, +// no second cache instance is allocated. The default entry and the provider_id +// entry must resolve to the same *MemoryEntityCache pointer. +func TestBuildEntityCacheInstances_ReusesDefaultCacheForSameProviderID(t *testing.T) { + t.Parallel() + + r := &Router{ + Config: Config{ + logger: zap.NewNop(), + entityCachingConfig: config.EntityCachingConfiguration{ + Enabled: true, + L2: config.EntityCachingL2Configuration{ + Enabled: true, + Storage: config.EntityCachingL2StorageConfig{ + ProviderID: "memory-1", + }, + }, + SubgraphCacheOverrides: []config.EntityCachingSubgraphCacheOverride{ + { + Name: "products", + StorageProviderID: "memory-1", // same as the default + }, + }, + }, + storageProviders: config.StorageProviders{ + Memory: []config.MemoryStorageProvider{ + {ID: "memory-1", MaxSize: config.BytesString(1024 * 1024)}, + }, + }, + }, + } + + caches, err := r.buildEntityCacheInstances() + require.NoError(t, err) + require.Len(t, caches, 2, "expected exactly two keys: default and memory-1") + + defaultCache, ok := caches["default"] + require.True(t, ok, `missing "default" entry`) + namedCache, ok := caches["memory-1"] + require.True(t, ok, `missing "memory-1" entry`) + require.Same(t, defaultCache, namedCache, + "default cache and same-provider-id override must share the same instance") +} + +// TestBuildEntityCacheInstances_DistinctProviderIDs verifies that overrides +// pointing at a different provider still allocate their own cache instance. +func TestBuildEntityCacheInstances_DistinctProviderIDs(t *testing.T) { + t.Parallel() + + r := &Router{ + Config: Config{ + logger: zap.NewNop(), + entityCachingConfig: config.EntityCachingConfiguration{ + Enabled: true, + L2: config.EntityCachingL2Configuration{ + Enabled: true, + Storage: config.EntityCachingL2StorageConfig{ + ProviderID: "memory-1", + }, + }, + SubgraphCacheOverrides: []config.EntityCachingSubgraphCacheOverride{ + { + Name: "products", + StorageProviderID: "memory-2", + }, + }, + }, + storageProviders: config.StorageProviders{ + Memory: []config.MemoryStorageProvider{ + {ID: "memory-1", MaxSize: config.BytesString(1024 * 1024)}, + {ID: "memory-2", MaxSize: config.BytesString(2 * 1024 * 1024)}, + }, + }, + }, + } + + caches, err := r.buildEntityCacheInstances() + require.NoError(t, err) + require.Len(t, caches, 3, "expected three keys: default, memory-1 alias, memory-2 override") + require.NotSame(t, caches["memory-1"], caches["memory-2"], + "distinct provider ids must yield distinct cache instances") + require.Same(t, caches["default"], caches["memory-1"], + "default alias must point at the memory-1 instance") +} + +func TestBuildEntityCacheInstances_DisabledReturnsNil(t *testing.T) { + t.Parallel() + + r := &Router{ + Config: Config{ + logger: zap.NewNop(), + entityCachingConfig: config.EntityCachingConfiguration{ + Enabled: false, + }, + }, + } + + caches, err := r.buildEntityCacheInstances() + require.NoError(t, err) + require.Nil(t, caches) +} + +func TestBuildSingleEntityCache_WrapsMemoryProviderWithCircuitBreaker(t *testing.T) { + t.Parallel() + + r := &Router{ + Config: Config{ + logger: zap.NewNop(), + storageProviders: config.StorageProviders{ + Memory: []config.MemoryStorageProvider{ + {ID: "memory-1", MaxSize: config.BytesString(2048)}, + }, + }, + }, + } + + cache, err := r.buildSingleEntityCache("memory-1", config.EntityCachingL2Configuration{ + CircuitBreaker: config.EntityCachingCircuitBreakerConfig{ + Enabled: true, + FailureThreshold: 3, + CooldownPeriod: time.Second, + }, + }) + require.NoError(t, err) + + breaker, ok := cache.(*entitycache.CircuitBreakerCache) + require.True(t, ok, "expected circuit breaker wrapper") + + metricsProvider, ok := any(breaker).(interface { + Metrics() *ristretto.Metrics + MaxSizeBytes() int64 + }) + require.True(t, ok, "wrapped cache should expose metrics accessors") + require.NotNil(t, metricsProvider.Metrics()) + require.EqualValues(t, 2048, metricsProvider.MaxSizeBytes()) +} + +func TestFindMemoryProvider_ReturnsFalseForUnknownProvider(t *testing.T) { + t.Parallel() + + r := &Router{ + Config: Config{ + logger: zap.NewNop(), + storageProviders: config.StorageProviders{ + Memory: []config.MemoryStorageProvider{ + {ID: "memory-1", MaxSize: config.BytesString(1024)}, + }, + }, + }, + } + + provider, ok := r.findMemoryProvider("missing") + require.False(t, ok) + require.Nil(t, provider) +} diff --git a/router/core/supervisor_instance.go b/router/core/supervisor_instance.go index 1fd8eb8acb..c6cd88a0da 100644 --- a/router/core/supervisor_instance.go +++ b/router/core/supervisor_instance.go @@ -197,6 +197,7 @@ func optionsFromResources(logger *zap.Logger, config *config.Config, reloadPersi WithApolloCompatibilityFlagsConfig(config.ApolloCompatibilityFlags), WithApolloRouterCompatibilityFlags(config.ApolloRouterCompatibilityFlags), WithStorageProviders(config.StorageProviders), + WithEntityCaching(config.EntityCaching), WithGraphQLPath(config.GraphQLPath), WithModulesConfig(config.Modules), WithGracePeriod(config.GracePeriod), diff --git a/router/core/websocket.go b/router/core/websocket.go index 0adbd02461..45345fd852 100644 --- a/router/core/websocket.go +++ b/router/core/websocket.go @@ -1039,6 +1039,7 @@ func (h *WebSocketConnectionHandler) executeSubscription(registration *Subscript resolveCtx.TracingOptions = operationCtx.traceOptions resolveCtx.Extensions = operationCtx.extensions resolveCtx.ExecutionOptions = operationCtx.executionOptions + resolveCtx.ExecutionOptions.Caching = h.graphqlHandler.cachingOptions(reqContext) if h.forwardInitialPayload && operationCtx.initialPayload != nil { resolveCtx.InitialPayload = operationCtx.initialPayload @@ -1068,7 +1069,7 @@ func (h *WebSocketConnectionHandler) executeSubscription(registration *Subscript switch p := operationCtx.preparedPlan.preparedPlan.(type) { case *plan.SynchronousResponsePlan: - _, err = h.graphqlHandler.executor.Resolver.ResolveGraphQLResponse(resolveCtx, p.Response, nil, rw) + _, err = h.graphqlHandler.executor.Resolver.ResolveGraphQLResponse(resolveCtx, p.Response, rw) if err != nil { h.logger.Warn("Resolving GraphQL response", zap.Error(err)) h.graphqlHandler.WriteError(resolveCtx, err, p.Response, rw) diff --git a/router/entity-caching.config.yaml b/router/entity-caching.config.yaml new file mode 100644 index 0000000000..3ad63508c5 --- /dev/null +++ b/router/entity-caching.config.yaml @@ -0,0 +1,34 @@ +# yaml-language-server: $schema=./pkg/config/config.schema.json + +# Standalone entity caching config for local development and testing. +# Start: go run ./cmd/router -config entity-caching.config.yaml +# +# Uses the entity caching test subgraphs (items, details, inventory). +# Start them first: cd ../router-tests/entity_caching && go run ./cmd/subgraphs +# +# See docs/entity-caching/configuration.md for the full reference. + +version: "1" + +execution_config: + file: + path: "../router-tests/entity_caching/testdata/config.json" + +storage_providers: + memory: + - id: "default" + max_size: "100MB" + +entity_caching: + enabled: true + l1: + enabled: true + l2: + enabled: true + storage: + provider_id: "default" + key_prefix: "cosmo_entity_cache" + circuit_breaker: + enabled: false + failure_threshold: 5 + cooldown_period: "10s" diff --git a/router/gen/proto/wg/cosmo/node/v1/node.pb.go b/router/gen/proto/wg/cosmo/node/v1/node.pb.go index d444d0f1b1..380577187f 100644 --- a/router/gen/proto/wg/cosmo/node/v1/node.pb.go +++ b/router/gen/proto/wg/cosmo/node/v1/node.pb.go @@ -1070,8 +1070,15 @@ type DataSourceConfiguration struct { EntityInterfaces []*EntityInterfaceConfiguration `protobuf:"bytes,14,rep,name=entity_interfaces,json=entityInterfaces,proto3" json:"entity_interfaces,omitempty"` InterfaceObjects []*EntityInterfaceConfiguration `protobuf:"bytes,15,rep,name=interface_objects,json=interfaceObjects,proto3" json:"interface_objects,omitempty"` CostConfiguration *CostConfiguration `protobuf:"bytes,16,opt,name=cost_configuration,json=costConfiguration,proto3" json:"cost_configuration,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // Entity caching configurations (from composition directives) + EntityCacheConfigurations []*EntityCacheConfiguration `protobuf:"bytes,17,rep,name=entity_cache_configurations,json=entityCacheConfigurations,proto3" json:"entity_cache_configurations,omitempty"` + RootFieldCacheConfigurations []*RootFieldCacheConfiguration `protobuf:"bytes,18,rep,name=root_field_cache_configurations,json=rootFieldCacheConfigurations,proto3" json:"root_field_cache_configurations,omitempty"` + CachePopulateConfigurations []*CachePopulateConfiguration `protobuf:"bytes,19,rep,name=cache_populate_configurations,json=cachePopulateConfigurations,proto3" json:"cache_populate_configurations,omitempty"` + CacheInvalidateConfigurations []*CacheInvalidateConfiguration `protobuf:"bytes,20,rep,name=cache_invalidate_configurations,json=cacheInvalidateConfigurations,proto3" json:"cache_invalidate_configurations,omitempty"` + // Request-scoped field configurations (from @openfed__requestScoped directive) + RequestScopedFields []*RequestScopedFieldConfiguration `protobuf:"bytes,21,rep,name=request_scoped_fields,json=requestScopedFields,proto3" json:"request_scoped_fields,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DataSourceConfiguration) Reset() { @@ -1216,6 +1223,525 @@ func (x *DataSourceConfiguration) GetCostConfiguration() *CostConfiguration { return nil } +func (x *DataSourceConfiguration) GetEntityCacheConfigurations() []*EntityCacheConfiguration { + if x != nil { + return x.EntityCacheConfigurations + } + return nil +} + +func (x *DataSourceConfiguration) GetRootFieldCacheConfigurations() []*RootFieldCacheConfiguration { + if x != nil { + return x.RootFieldCacheConfigurations + } + return nil +} + +func (x *DataSourceConfiguration) GetCachePopulateConfigurations() []*CachePopulateConfiguration { + if x != nil { + return x.CachePopulateConfigurations + } + return nil +} + +func (x *DataSourceConfiguration) GetCacheInvalidateConfigurations() []*CacheInvalidateConfiguration { + if x != nil { + return x.CacheInvalidateConfigurations + } + return nil +} + +func (x *DataSourceConfiguration) GetRequestScopedFields() []*RequestScopedFieldConfiguration { + if x != nil { + return x.RequestScopedFields + } + return nil +} + +// Per-field declaration for @openfed__requestScoped. All fields in the same subgraph declaring +// @openfed__requestScoped(key: "X") share L1 key "{subgraphName}.X". The first field to resolve +// populates L1; subsequent fields with the same key inject from L1 and can skip their +// fetch when all required sub-fields are present. +type RequestScopedFieldConfiguration struct { + state protoimpl.MessageState `protogen:"open.v1"` + FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` + TypeName string `protobuf:"bytes,2,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` + L1Key string `protobuf:"bytes,3,opt,name=l1_key,json=l1Key,proto3" json:"l1_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RequestScopedFieldConfiguration) Reset() { + *x = RequestScopedFieldConfiguration{} + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RequestScopedFieldConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestScopedFieldConfiguration) ProtoMessage() {} + +func (x *RequestScopedFieldConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RequestScopedFieldConfiguration.ProtoReflect.Descriptor instead. +func (*RequestScopedFieldConfiguration) Descriptor() ([]byte, []int) { + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{12} +} + +func (x *RequestScopedFieldConfiguration) GetFieldName() string { + if x != nil { + return x.FieldName + } + return "" +} + +func (x *RequestScopedFieldConfiguration) GetTypeName() string { + if x != nil { + return x.TypeName + } + return "" +} + +func (x *RequestScopedFieldConfiguration) GetL1Key() string { + if x != nil { + return x.L1Key + } + return "" +} + +type EntityCacheConfiguration struct { + state protoimpl.MessageState `protogen:"open.v1"` + TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` + // TTL for cached entity values. Required: composition rejects values <= 0, + // so omit (zero) does not occur in practice. Interpreted in seconds. + MaxAgeSeconds int64 `protobuf:"varint,2,opt,name=max_age_seconds,json=maxAgeSeconds,proto3" json:"max_age_seconds,omitempty"` + IncludeHeaders bool `protobuf:"varint,3,opt,name=include_headers,json=includeHeaders,proto3" json:"include_headers,omitempty"` + PartialCacheLoad bool `protobuf:"varint,4,opt,name=partial_cache_load,json=partialCacheLoad,proto3" json:"partial_cache_load,omitempty"` + ShadowMode bool `protobuf:"varint,5,opt,name=shadow_mode,json=shadowMode,proto3" json:"shadow_mode,omitempty"` + // TTL for caching "not found" entity responses (entity returned null from + // _entities without errors). Omit or 0 disables negative caching and null + // responses are not cached. Positive values are seconds. Composition rejects + // negative values at schema validation time. + NotFoundCacheTtlSeconds int64 `protobuf:"varint,6,opt,name=not_found_cache_ttl_seconds,json=notFoundCacheTtlSeconds,proto3" json:"not_found_cache_ttl_seconds,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EntityCacheConfiguration) Reset() { + *x = EntityCacheConfiguration{} + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EntityCacheConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntityCacheConfiguration) ProtoMessage() {} + +func (x *EntityCacheConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EntityCacheConfiguration.ProtoReflect.Descriptor instead. +func (*EntityCacheConfiguration) Descriptor() ([]byte, []int) { + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{13} +} + +func (x *EntityCacheConfiguration) GetTypeName() string { + if x != nil { + return x.TypeName + } + return "" +} + +func (x *EntityCacheConfiguration) GetMaxAgeSeconds() int64 { + if x != nil { + return x.MaxAgeSeconds + } + return 0 +} + +func (x *EntityCacheConfiguration) GetIncludeHeaders() bool { + if x != nil { + return x.IncludeHeaders + } + return false +} + +func (x *EntityCacheConfiguration) GetPartialCacheLoad() bool { + if x != nil { + return x.PartialCacheLoad + } + return false +} + +func (x *EntityCacheConfiguration) GetShadowMode() bool { + if x != nil { + return x.ShadowMode + } + return false +} + +func (x *EntityCacheConfiguration) GetNotFoundCacheTtlSeconds() int64 { + if x != nil { + return x.NotFoundCacheTtlSeconds + } + return 0 +} + +type RootFieldCacheConfiguration struct { + state protoimpl.MessageState `protogen:"open.v1"` + FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` + // TTL for cached root-field responses. Required: composition rejects values + // <= 0. Interpreted in seconds. + MaxAgeSeconds int64 `protobuf:"varint,2,opt,name=max_age_seconds,json=maxAgeSeconds,proto3" json:"max_age_seconds,omitempty"` + IncludeHeaders bool `protobuf:"varint,3,opt,name=include_headers,json=includeHeaders,proto3" json:"include_headers,omitempty"` + ShadowMode bool `protobuf:"varint,4,opt,name=shadow_mode,json=shadowMode,proto3" json:"shadow_mode,omitempty"` + EntityTypeName string `protobuf:"bytes,5,opt,name=entity_type_name,json=entityTypeName,proto3" json:"entity_type_name,omitempty"` + EntityKeyMappings []*EntityKeyMapping `protobuf:"bytes,6,rep,name=entity_key_mappings,json=entityKeyMappings,proto3" json:"entity_key_mappings,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RootFieldCacheConfiguration) Reset() { + *x = RootFieldCacheConfiguration{} + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RootFieldCacheConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RootFieldCacheConfiguration) ProtoMessage() {} + +func (x *RootFieldCacheConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RootFieldCacheConfiguration.ProtoReflect.Descriptor instead. +func (*RootFieldCacheConfiguration) Descriptor() ([]byte, []int) { + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{14} +} + +func (x *RootFieldCacheConfiguration) GetFieldName() string { + if x != nil { + return x.FieldName + } + return "" +} + +func (x *RootFieldCacheConfiguration) GetMaxAgeSeconds() int64 { + if x != nil { + return x.MaxAgeSeconds + } + return 0 +} + +func (x *RootFieldCacheConfiguration) GetIncludeHeaders() bool { + if x != nil { + return x.IncludeHeaders + } + return false +} + +func (x *RootFieldCacheConfiguration) GetShadowMode() bool { + if x != nil { + return x.ShadowMode + } + return false +} + +func (x *RootFieldCacheConfiguration) GetEntityTypeName() string { + if x != nil { + return x.EntityTypeName + } + return "" +} + +func (x *RootFieldCacheConfiguration) GetEntityKeyMappings() []*EntityKeyMapping { + if x != nil { + return x.EntityKeyMappings + } + return nil +} + +type EntityKeyMapping struct { + state protoimpl.MessageState `protogen:"open.v1"` + EntityTypeName string `protobuf:"bytes,1,opt,name=entity_type_name,json=entityTypeName,proto3" json:"entity_type_name,omitempty"` + FieldMappings []*EntityCacheFieldMapping `protobuf:"bytes,2,rep,name=field_mappings,json=fieldMappings,proto3" json:"field_mappings,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EntityKeyMapping) Reset() { + *x = EntityKeyMapping{} + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EntityKeyMapping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntityKeyMapping) ProtoMessage() {} + +func (x *EntityKeyMapping) ProtoReflect() protoreflect.Message { + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EntityKeyMapping.ProtoReflect.Descriptor instead. +func (*EntityKeyMapping) Descriptor() ([]byte, []int) { + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{15} +} + +func (x *EntityKeyMapping) GetEntityTypeName() string { + if x != nil { + return x.EntityTypeName + } + return "" +} + +func (x *EntityKeyMapping) GetFieldMappings() []*EntityCacheFieldMapping { + if x != nil { + return x.FieldMappings + } + return nil +} + +type EntityCacheFieldMapping struct { + state protoimpl.MessageState `protogen:"open.v1"` + EntityKeyField string `protobuf:"bytes,1,opt,name=entity_key_field,json=entityKeyField,proto3" json:"entity_key_field,omitempty"` + ArgumentPath []string `protobuf:"bytes,2,rep,name=argument_path,json=argumentPath,proto3" json:"argument_path,omitempty"` + IsBatch bool `protobuf:"varint,3,opt,name=is_batch,json=isBatch,proto3" json:"is_batch,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EntityCacheFieldMapping) Reset() { + *x = EntityCacheFieldMapping{} + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EntityCacheFieldMapping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntityCacheFieldMapping) ProtoMessage() {} + +func (x *EntityCacheFieldMapping) ProtoReflect() protoreflect.Message { + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EntityCacheFieldMapping.ProtoReflect.Descriptor instead. +func (*EntityCacheFieldMapping) Descriptor() ([]byte, []int) { + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{16} +} + +func (x *EntityCacheFieldMapping) GetEntityKeyField() string { + if x != nil { + return x.EntityKeyField + } + return "" +} + +func (x *EntityCacheFieldMapping) GetArgumentPath() []string { + if x != nil { + return x.ArgumentPath + } + return nil +} + +func (x *EntityCacheFieldMapping) GetIsBatch() bool { + if x != nil { + return x.IsBatch + } + return false +} + +type CachePopulateConfiguration struct { + state protoimpl.MessageState `protogen:"open.v1"` + FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` + OperationType string `protobuf:"bytes,2,opt,name=operation_type,json=operationType,proto3" json:"operation_type,omitempty"` + // Optional override TTL for mutation/subscription populate writes. When omit, + // falls back to the target entity's max_age_seconds (for subscriptions) or + // the cache's default TTL (for mutations). Zero is treated as "no override". + // Composition rejects negative values. + MaxAgeSeconds *int64 `protobuf:"varint,3,opt,name=max_age_seconds,json=maxAgeSeconds,proto3,oneof" json:"max_age_seconds,omitempty"` + EntityTypeName string `protobuf:"bytes,4,opt,name=entity_type_name,json=entityTypeName,proto3" json:"entity_type_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CachePopulateConfiguration) Reset() { + *x = CachePopulateConfiguration{} + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CachePopulateConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CachePopulateConfiguration) ProtoMessage() {} + +func (x *CachePopulateConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CachePopulateConfiguration.ProtoReflect.Descriptor instead. +func (*CachePopulateConfiguration) Descriptor() ([]byte, []int) { + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{17} +} + +func (x *CachePopulateConfiguration) GetFieldName() string { + if x != nil { + return x.FieldName + } + return "" +} + +func (x *CachePopulateConfiguration) GetOperationType() string { + if x != nil { + return x.OperationType + } + return "" +} + +func (x *CachePopulateConfiguration) GetMaxAgeSeconds() int64 { + if x != nil && x.MaxAgeSeconds != nil { + return *x.MaxAgeSeconds + } + return 0 +} + +func (x *CachePopulateConfiguration) GetEntityTypeName() string { + if x != nil { + return x.EntityTypeName + } + return "" +} + +type CacheInvalidateConfiguration struct { + state protoimpl.MessageState `protogen:"open.v1"` + FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` + OperationType string `protobuf:"bytes,2,opt,name=operation_type,json=operationType,proto3" json:"operation_type,omitempty"` + EntityTypeName string `protobuf:"bytes,3,opt,name=entity_type_name,json=entityTypeName,proto3" json:"entity_type_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CacheInvalidateConfiguration) Reset() { + *x = CacheInvalidateConfiguration{} + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CacheInvalidateConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CacheInvalidateConfiguration) ProtoMessage() {} + +func (x *CacheInvalidateConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CacheInvalidateConfiguration.ProtoReflect.Descriptor instead. +func (*CacheInvalidateConfiguration) Descriptor() ([]byte, []int) { + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{18} +} + +func (x *CacheInvalidateConfiguration) GetFieldName() string { + if x != nil { + return x.FieldName + } + return "" +} + +func (x *CacheInvalidateConfiguration) GetOperationType() string { + if x != nil { + return x.OperationType + } + return "" +} + +func (x *CacheInvalidateConfiguration) GetEntityTypeName() string { + if x != nil { + return x.EntityTypeName + } + return "" +} + type CostConfiguration struct { state protoimpl.MessageState `protogen:"open.v1"` FieldWeights []*FieldWeightConfiguration `protobuf:"bytes,1,rep,name=field_weights,json=fieldWeights,proto3" json:"field_weights,omitempty"` @@ -1228,7 +1754,7 @@ type CostConfiguration struct { func (x *CostConfiguration) Reset() { *x = CostConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[12] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1240,7 +1766,7 @@ func (x *CostConfiguration) String() string { func (*CostConfiguration) ProtoMessage() {} func (x *CostConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[12] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1253,7 +1779,7 @@ func (x *CostConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use CostConfiguration.ProtoReflect.Descriptor instead. func (*CostConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{12} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{19} } func (x *CostConfiguration) GetFieldWeights() []*FieldWeightConfiguration { @@ -1296,7 +1822,7 @@ type FieldWeightConfiguration struct { func (x *FieldWeightConfiguration) Reset() { *x = FieldWeightConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[13] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1308,7 +1834,7 @@ func (x *FieldWeightConfiguration) String() string { func (*FieldWeightConfiguration) ProtoMessage() {} func (x *FieldWeightConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[13] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1321,7 +1847,7 @@ func (x *FieldWeightConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use FieldWeightConfiguration.ProtoReflect.Descriptor instead. func (*FieldWeightConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{13} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{20} } func (x *FieldWeightConfiguration) GetTypeName() string { @@ -1366,7 +1892,7 @@ type FieldListSizeConfiguration struct { func (x *FieldListSizeConfiguration) Reset() { *x = FieldListSizeConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[14] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1378,7 +1904,7 @@ func (x *FieldListSizeConfiguration) String() string { func (*FieldListSizeConfiguration) ProtoMessage() {} func (x *FieldListSizeConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[14] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1391,7 +1917,7 @@ func (x *FieldListSizeConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use FieldListSizeConfiguration.ProtoReflect.Descriptor instead. func (*FieldListSizeConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{14} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{21} } func (x *FieldListSizeConfiguration) GetTypeName() string { @@ -1446,7 +1972,7 @@ type ArgumentConfiguration struct { func (x *ArgumentConfiguration) Reset() { *x = ArgumentConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[15] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1458,7 +1984,7 @@ func (x *ArgumentConfiguration) String() string { func (*ArgumentConfiguration) ProtoMessage() {} func (x *ArgumentConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[15] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1471,7 +1997,7 @@ func (x *ArgumentConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use ArgumentConfiguration.ProtoReflect.Descriptor instead. func (*ArgumentConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{15} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{22} } func (x *ArgumentConfiguration) GetName() string { @@ -1497,7 +2023,7 @@ type Scopes struct { func (x *Scopes) Reset() { *x = Scopes{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[16] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1509,7 +2035,7 @@ func (x *Scopes) String() string { func (*Scopes) ProtoMessage() {} func (x *Scopes) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[16] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1522,7 +2048,7 @@ func (x *Scopes) ProtoReflect() protoreflect.Message { // Deprecated: Use Scopes.ProtoReflect.Descriptor instead. func (*Scopes) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{16} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{23} } func (x *Scopes) GetRequiredAndScopes() []string { @@ -1543,7 +2069,7 @@ type AuthorizationConfiguration struct { func (x *AuthorizationConfiguration) Reset() { *x = AuthorizationConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[17] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1555,7 +2081,7 @@ func (x *AuthorizationConfiguration) String() string { func (*AuthorizationConfiguration) ProtoMessage() {} func (x *AuthorizationConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[17] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1568,7 +2094,7 @@ func (x *AuthorizationConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use AuthorizationConfiguration.ProtoReflect.Descriptor instead. func (*AuthorizationConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{17} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{24} } func (x *AuthorizationConfiguration) GetRequiresAuthentication() bool { @@ -1605,7 +2131,7 @@ type FieldConfiguration struct { func (x *FieldConfiguration) Reset() { *x = FieldConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[18] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1617,7 +2143,7 @@ func (x *FieldConfiguration) String() string { func (*FieldConfiguration) ProtoMessage() {} func (x *FieldConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[18] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1630,7 +2156,7 @@ func (x *FieldConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use FieldConfiguration.ProtoReflect.Descriptor instead. func (*FieldConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{18} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{25} } func (x *FieldConfiguration) GetTypeName() string { @@ -1678,7 +2204,7 @@ type TypeConfiguration struct { func (x *TypeConfiguration) Reset() { *x = TypeConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[19] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1690,7 +2216,7 @@ func (x *TypeConfiguration) String() string { func (*TypeConfiguration) ProtoMessage() {} func (x *TypeConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[19] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1703,7 +2229,7 @@ func (x *TypeConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use TypeConfiguration.ProtoReflect.Descriptor instead. func (*TypeConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{19} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{26} } func (x *TypeConfiguration) GetTypeName() string { @@ -1732,7 +2258,7 @@ type TypeField struct { func (x *TypeField) Reset() { *x = TypeField{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[20] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1744,7 +2270,7 @@ func (x *TypeField) String() string { func (*TypeField) ProtoMessage() {} func (x *TypeField) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[20] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1757,7 +2283,7 @@ func (x *TypeField) ProtoReflect() protoreflect.Message { // Deprecated: Use TypeField.ProtoReflect.Descriptor instead. func (*TypeField) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{20} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{27} } func (x *TypeField) GetTypeName() string { @@ -1798,7 +2324,7 @@ type FieldCoordinates struct { func (x *FieldCoordinates) Reset() { *x = FieldCoordinates{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[21] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1810,7 +2336,7 @@ func (x *FieldCoordinates) String() string { func (*FieldCoordinates) ProtoMessage() {} func (x *FieldCoordinates) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[21] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1823,7 +2349,7 @@ func (x *FieldCoordinates) ProtoReflect() protoreflect.Message { // Deprecated: Use FieldCoordinates.ProtoReflect.Descriptor instead. func (*FieldCoordinates) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{21} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{28} } func (x *FieldCoordinates) GetFieldName() string { @@ -1850,7 +2376,7 @@ type FieldSetCondition struct { func (x *FieldSetCondition) Reset() { *x = FieldSetCondition{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[22] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1862,7 +2388,7 @@ func (x *FieldSetCondition) String() string { func (*FieldSetCondition) ProtoMessage() {} func (x *FieldSetCondition) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[22] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1875,7 +2401,7 @@ func (x *FieldSetCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use FieldSetCondition.ProtoReflect.Descriptor instead. func (*FieldSetCondition) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{22} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{29} } func (x *FieldSetCondition) GetFieldCoordinatesPath() []*FieldCoordinates { @@ -1905,7 +2431,7 @@ type RequiredField struct { func (x *RequiredField) Reset() { *x = RequiredField{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[23] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1917,7 +2443,7 @@ func (x *RequiredField) String() string { func (*RequiredField) ProtoMessage() {} func (x *RequiredField) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[23] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1930,7 +2456,7 @@ func (x *RequiredField) ProtoReflect() protoreflect.Message { // Deprecated: Use RequiredField.ProtoReflect.Descriptor instead. func (*RequiredField) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{23} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{30} } func (x *RequiredField) GetTypeName() string { @@ -1978,7 +2504,7 @@ type EntityInterfaceConfiguration struct { func (x *EntityInterfaceConfiguration) Reset() { *x = EntityInterfaceConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[24] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1990,7 +2516,7 @@ func (x *EntityInterfaceConfiguration) String() string { func (*EntityInterfaceConfiguration) ProtoMessage() {} func (x *EntityInterfaceConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[24] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2003,7 +2529,7 @@ func (x *EntityInterfaceConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use EntityInterfaceConfiguration.ProtoReflect.Descriptor instead. func (*EntityInterfaceConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{24} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{31} } func (x *EntityInterfaceConfiguration) GetInterfaceTypeName() string { @@ -2046,7 +2572,7 @@ type FetchConfiguration struct { func (x *FetchConfiguration) Reset() { *x = FetchConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[25] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2058,7 +2584,7 @@ func (x *FetchConfiguration) String() string { func (*FetchConfiguration) ProtoMessage() {} func (x *FetchConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[25] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2071,7 +2597,7 @@ func (x *FetchConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use FetchConfiguration.ProtoReflect.Descriptor instead. func (*FetchConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{25} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{32} } func (x *FetchConfiguration) GetUrl() *ConfigurationVariable { @@ -2155,7 +2681,7 @@ type StatusCodeTypeMapping struct { func (x *StatusCodeTypeMapping) Reset() { *x = StatusCodeTypeMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[26] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2167,7 +2693,7 @@ func (x *StatusCodeTypeMapping) String() string { func (*StatusCodeTypeMapping) ProtoMessage() {} func (x *StatusCodeTypeMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[26] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2180,7 +2706,7 @@ func (x *StatusCodeTypeMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusCodeTypeMapping.ProtoReflect.Descriptor instead. func (*StatusCodeTypeMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{26} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{33} } func (x *StatusCodeTypeMapping) GetStatusCode() int64 { @@ -2218,7 +2744,7 @@ type DataSourceCustom_GraphQL struct { func (x *DataSourceCustom_GraphQL) Reset() { *x = DataSourceCustom_GraphQL{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[27] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2230,7 +2756,7 @@ func (x *DataSourceCustom_GraphQL) String() string { func (*DataSourceCustom_GraphQL) ProtoMessage() {} func (x *DataSourceCustom_GraphQL) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[27] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2243,7 +2769,7 @@ func (x *DataSourceCustom_GraphQL) ProtoReflect() protoreflect.Message { // Deprecated: Use DataSourceCustom_GraphQL.ProtoReflect.Descriptor instead. func (*DataSourceCustom_GraphQL) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{27} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{34} } func (x *DataSourceCustom_GraphQL) GetFetch() *FetchConfiguration { @@ -2299,7 +2825,7 @@ type GRPCConfiguration struct { func (x *GRPCConfiguration) Reset() { *x = GRPCConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[28] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2311,7 +2837,7 @@ func (x *GRPCConfiguration) String() string { func (*GRPCConfiguration) ProtoMessage() {} func (x *GRPCConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[28] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2324,7 +2850,7 @@ func (x *GRPCConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use GRPCConfiguration.ProtoReflect.Descriptor instead. func (*GRPCConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{28} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{35} } func (x *GRPCConfiguration) GetMapping() *GRPCMapping { @@ -2358,7 +2884,7 @@ type ImageReference struct { func (x *ImageReference) Reset() { *x = ImageReference{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[29] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2370,7 +2896,7 @@ func (x *ImageReference) String() string { func (*ImageReference) ProtoMessage() {} func (x *ImageReference) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[29] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2383,7 +2909,7 @@ func (x *ImageReference) ProtoReflect() protoreflect.Message { // Deprecated: Use ImageReference.ProtoReflect.Descriptor instead. func (*ImageReference) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{29} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{36} } func (x *ImageReference) GetRepository() string { @@ -2413,7 +2939,7 @@ type PluginConfiguration struct { func (x *PluginConfiguration) Reset() { *x = PluginConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[30] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2425,7 +2951,7 @@ func (x *PluginConfiguration) String() string { func (*PluginConfiguration) ProtoMessage() {} func (x *PluginConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[30] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2438,7 +2964,7 @@ func (x *PluginConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use PluginConfiguration.ProtoReflect.Descriptor instead. func (*PluginConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{30} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{37} } func (x *PluginConfiguration) GetName() string { @@ -2472,7 +2998,7 @@ type SSLConfiguration struct { func (x *SSLConfiguration) Reset() { *x = SSLConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[31] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2484,7 +3010,7 @@ func (x *SSLConfiguration) String() string { func (*SSLConfiguration) ProtoMessage() {} func (x *SSLConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[31] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2497,7 +3023,7 @@ func (x *SSLConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use SSLConfiguration.ProtoReflect.Descriptor instead. func (*SSLConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{31} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{38} } func (x *SSLConfiguration) GetEnabled() bool { @@ -2530,7 +3056,7 @@ type GRPCMapping struct { func (x *GRPCMapping) Reset() { *x = GRPCMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[32] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2542,7 +3068,7 @@ func (x *GRPCMapping) String() string { func (*GRPCMapping) ProtoMessage() {} func (x *GRPCMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[32] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2555,7 +3081,7 @@ func (x *GRPCMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use GRPCMapping.ProtoReflect.Descriptor instead. func (*GRPCMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{32} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{39} } func (x *GRPCMapping) GetVersion() int32 { @@ -2626,7 +3152,7 @@ type LookupMapping struct { func (x *LookupMapping) Reset() { *x = LookupMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[33] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2638,7 +3164,7 @@ func (x *LookupMapping) String() string { func (*LookupMapping) ProtoMessage() {} func (x *LookupMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[33] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2651,7 +3177,7 @@ func (x *LookupMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use LookupMapping.ProtoReflect.Descriptor instead. func (*LookupMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{33} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{40} } func (x *LookupMapping) GetType() LookupType { @@ -2702,7 +3228,7 @@ type LookupFieldMapping struct { func (x *LookupFieldMapping) Reset() { *x = LookupFieldMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[34] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2714,7 +3240,7 @@ func (x *LookupFieldMapping) String() string { func (*LookupFieldMapping) ProtoMessage() {} func (x *LookupFieldMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[34] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2727,7 +3253,7 @@ func (x *LookupFieldMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use LookupFieldMapping.ProtoReflect.Descriptor instead. func (*LookupFieldMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{34} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{41} } func (x *LookupFieldMapping) GetType() string { @@ -2763,7 +3289,7 @@ type OperationMapping struct { func (x *OperationMapping) Reset() { *x = OperationMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[35] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2775,7 +3301,7 @@ func (x *OperationMapping) String() string { func (*OperationMapping) ProtoMessage() {} func (x *OperationMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[35] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2788,7 +3314,7 @@ func (x *OperationMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use OperationMapping.ProtoReflect.Descriptor instead. func (*OperationMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{35} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{42} } func (x *OperationMapping) GetType() OperationType { @@ -2849,7 +3375,7 @@ type EntityMapping struct { func (x *EntityMapping) Reset() { *x = EntityMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[36] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2861,7 +3387,7 @@ func (x *EntityMapping) String() string { func (*EntityMapping) ProtoMessage() {} func (x *EntityMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[36] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2874,7 +3400,7 @@ func (x *EntityMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use EntityMapping.ProtoReflect.Descriptor instead. func (*EntityMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{36} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{43} } func (x *EntityMapping) GetTypeName() string { @@ -2942,7 +3468,7 @@ type RequiredFieldMapping struct { func (x *RequiredFieldMapping) Reset() { *x = RequiredFieldMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[37] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2954,7 +3480,7 @@ func (x *RequiredFieldMapping) String() string { func (*RequiredFieldMapping) ProtoMessage() {} func (x *RequiredFieldMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[37] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2967,7 +3493,7 @@ func (x *RequiredFieldMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use RequiredFieldMapping.ProtoReflect.Descriptor instead. func (*RequiredFieldMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{37} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{44} } func (x *RequiredFieldMapping) GetFieldMapping() *FieldMapping { @@ -3011,7 +3537,7 @@ type TypeFieldMapping struct { func (x *TypeFieldMapping) Reset() { *x = TypeFieldMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[38] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3023,7 +3549,7 @@ func (x *TypeFieldMapping) String() string { func (*TypeFieldMapping) ProtoMessage() {} func (x *TypeFieldMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[38] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3036,7 +3562,7 @@ func (x *TypeFieldMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use TypeFieldMapping.ProtoReflect.Descriptor instead. func (*TypeFieldMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{38} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{45} } func (x *TypeFieldMapping) GetType() string { @@ -3068,7 +3594,7 @@ type FieldMapping struct { func (x *FieldMapping) Reset() { *x = FieldMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[39] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3080,7 +3606,7 @@ func (x *FieldMapping) String() string { func (*FieldMapping) ProtoMessage() {} func (x *FieldMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[39] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3093,7 +3619,7 @@ func (x *FieldMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use FieldMapping.ProtoReflect.Descriptor instead. func (*FieldMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{39} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{46} } func (x *FieldMapping) GetOriginal() string { @@ -3130,7 +3656,7 @@ type ArgumentMapping struct { func (x *ArgumentMapping) Reset() { *x = ArgumentMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[40] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3142,7 +3668,7 @@ func (x *ArgumentMapping) String() string { func (*ArgumentMapping) ProtoMessage() {} func (x *ArgumentMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[40] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[47] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3155,7 +3681,7 @@ func (x *ArgumentMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use ArgumentMapping.ProtoReflect.Descriptor instead. func (*ArgumentMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{40} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{47} } func (x *ArgumentMapping) GetOriginal() string { @@ -3182,7 +3708,7 @@ type EnumMapping struct { func (x *EnumMapping) Reset() { *x = EnumMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[41] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3194,7 +3720,7 @@ func (x *EnumMapping) String() string { func (*EnumMapping) ProtoMessage() {} func (x *EnumMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[41] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[48] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3207,7 +3733,7 @@ func (x *EnumMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use EnumMapping.ProtoReflect.Descriptor instead. func (*EnumMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{41} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{48} } func (x *EnumMapping) GetType() string { @@ -3234,7 +3760,7 @@ type EnumValueMapping struct { func (x *EnumValueMapping) Reset() { *x = EnumValueMapping{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[42] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3246,7 +3772,7 @@ func (x *EnumValueMapping) String() string { func (*EnumValueMapping) ProtoMessage() {} func (x *EnumValueMapping) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[42] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[49] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3259,7 +3785,7 @@ func (x *EnumValueMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use EnumValueMapping.ProtoReflect.Descriptor instead. func (*EnumValueMapping) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{42} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{49} } func (x *EnumValueMapping) GetOriginal() string { @@ -3287,7 +3813,7 @@ type NatsStreamConfiguration struct { func (x *NatsStreamConfiguration) Reset() { *x = NatsStreamConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[43] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3299,7 +3825,7 @@ func (x *NatsStreamConfiguration) String() string { func (*NatsStreamConfiguration) ProtoMessage() {} func (x *NatsStreamConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[43] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[50] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3312,7 +3838,7 @@ func (x *NatsStreamConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use NatsStreamConfiguration.ProtoReflect.Descriptor instead. func (*NatsStreamConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{43} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{50} } func (x *NatsStreamConfiguration) GetConsumerName() string { @@ -3347,7 +3873,7 @@ type NatsEventConfiguration struct { func (x *NatsEventConfiguration) Reset() { *x = NatsEventConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[44] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3359,7 +3885,7 @@ func (x *NatsEventConfiguration) String() string { func (*NatsEventConfiguration) ProtoMessage() {} func (x *NatsEventConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[44] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[51] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3372,7 +3898,7 @@ func (x *NatsEventConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use NatsEventConfiguration.ProtoReflect.Descriptor instead. func (*NatsEventConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{44} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{51} } func (x *NatsEventConfiguration) GetEngineEventConfiguration() *EngineEventConfiguration { @@ -3406,7 +3932,7 @@ type KafkaEventConfiguration struct { func (x *KafkaEventConfiguration) Reset() { *x = KafkaEventConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[45] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3418,7 +3944,7 @@ func (x *KafkaEventConfiguration) String() string { func (*KafkaEventConfiguration) ProtoMessage() {} func (x *KafkaEventConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[45] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[52] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3431,7 +3957,7 @@ func (x *KafkaEventConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use KafkaEventConfiguration.ProtoReflect.Descriptor instead. func (*KafkaEventConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{45} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{52} } func (x *KafkaEventConfiguration) GetEngineEventConfiguration() *EngineEventConfiguration { @@ -3458,7 +3984,7 @@ type RedisEventConfiguration struct { func (x *RedisEventConfiguration) Reset() { *x = RedisEventConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[46] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3470,7 +3996,7 @@ func (x *RedisEventConfiguration) String() string { func (*RedisEventConfiguration) ProtoMessage() {} func (x *RedisEventConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[46] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[53] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3483,7 +4009,7 @@ func (x *RedisEventConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use RedisEventConfiguration.ProtoReflect.Descriptor instead. func (*RedisEventConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{46} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{53} } func (x *RedisEventConfiguration) GetEngineEventConfiguration() *EngineEventConfiguration { @@ -3512,7 +4038,7 @@ type EngineEventConfiguration struct { func (x *EngineEventConfiguration) Reset() { *x = EngineEventConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[47] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3524,7 +4050,7 @@ func (x *EngineEventConfiguration) String() string { func (*EngineEventConfiguration) ProtoMessage() {} func (x *EngineEventConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[47] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[54] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3537,7 +4063,7 @@ func (x *EngineEventConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use EngineEventConfiguration.ProtoReflect.Descriptor instead. func (*EngineEventConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{47} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{54} } func (x *EngineEventConfiguration) GetProviderId() string { @@ -3579,7 +4105,7 @@ type DataSourceCustomEvents struct { func (x *DataSourceCustomEvents) Reset() { *x = DataSourceCustomEvents{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[48] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3591,7 +4117,7 @@ func (x *DataSourceCustomEvents) String() string { func (*DataSourceCustomEvents) ProtoMessage() {} func (x *DataSourceCustomEvents) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[48] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[55] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3604,7 +4130,7 @@ func (x *DataSourceCustomEvents) ProtoReflect() protoreflect.Message { // Deprecated: Use DataSourceCustomEvents.ProtoReflect.Descriptor instead. func (*DataSourceCustomEvents) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{48} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{55} } func (x *DataSourceCustomEvents) GetNats() []*NatsEventConfiguration { @@ -3637,7 +4163,7 @@ type DataSourceCustom_Static struct { func (x *DataSourceCustom_Static) Reset() { *x = DataSourceCustom_Static{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[49] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3649,7 +4175,7 @@ func (x *DataSourceCustom_Static) String() string { func (*DataSourceCustom_Static) ProtoMessage() {} func (x *DataSourceCustom_Static) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[49] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[56] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3662,7 +4188,7 @@ func (x *DataSourceCustom_Static) ProtoReflect() protoreflect.Message { // Deprecated: Use DataSourceCustom_Static.ProtoReflect.Descriptor instead. func (*DataSourceCustom_Static) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{49} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{56} } func (x *DataSourceCustom_Static) GetData() *ConfigurationVariable { @@ -3685,7 +4211,7 @@ type ConfigurationVariable struct { func (x *ConfigurationVariable) Reset() { *x = ConfigurationVariable{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[50] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3697,7 +4223,7 @@ func (x *ConfigurationVariable) String() string { func (*ConfigurationVariable) ProtoMessage() {} func (x *ConfigurationVariable) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[50] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[57] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3710,7 +4236,7 @@ func (x *ConfigurationVariable) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfigurationVariable.ProtoReflect.Descriptor instead. func (*ConfigurationVariable) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{50} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{57} } func (x *ConfigurationVariable) GetKind() ConfigurationVariableKind { @@ -3758,7 +4284,7 @@ type DirectiveConfiguration struct { func (x *DirectiveConfiguration) Reset() { *x = DirectiveConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[51] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3770,7 +4296,7 @@ func (x *DirectiveConfiguration) String() string { func (*DirectiveConfiguration) ProtoMessage() {} func (x *DirectiveConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[51] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[58] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3783,7 +4309,7 @@ func (x *DirectiveConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use DirectiveConfiguration.ProtoReflect.Descriptor instead. func (*DirectiveConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{51} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{58} } func (x *DirectiveConfiguration) GetDirectiveName() string { @@ -3810,7 +4336,7 @@ type URLQueryConfiguration struct { func (x *URLQueryConfiguration) Reset() { *x = URLQueryConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[52] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3822,7 +4348,7 @@ func (x *URLQueryConfiguration) String() string { func (*URLQueryConfiguration) ProtoMessage() {} func (x *URLQueryConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[52] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[59] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3835,7 +4361,7 @@ func (x *URLQueryConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use URLQueryConfiguration.ProtoReflect.Descriptor instead. func (*URLQueryConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{52} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{59} } func (x *URLQueryConfiguration) GetName() string { @@ -3861,7 +4387,7 @@ type HTTPHeader struct { func (x *HTTPHeader) Reset() { *x = HTTPHeader{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[53] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3873,7 +4399,7 @@ func (x *HTTPHeader) String() string { func (*HTTPHeader) ProtoMessage() {} func (x *HTTPHeader) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[53] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[60] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3886,7 +4412,7 @@ func (x *HTTPHeader) ProtoReflect() protoreflect.Message { // Deprecated: Use HTTPHeader.ProtoReflect.Descriptor instead. func (*HTTPHeader) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{53} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{60} } func (x *HTTPHeader) GetValues() []*ConfigurationVariable { @@ -3907,7 +4433,7 @@ type MTLSConfiguration struct { func (x *MTLSConfiguration) Reset() { *x = MTLSConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[54] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3919,7 +4445,7 @@ func (x *MTLSConfiguration) String() string { func (*MTLSConfiguration) ProtoMessage() {} func (x *MTLSConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[54] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[61] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3932,7 +4458,7 @@ func (x *MTLSConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use MTLSConfiguration.ProtoReflect.Descriptor instead. func (*MTLSConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{54} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{61} } func (x *MTLSConfiguration) GetKey() *ConfigurationVariable { @@ -3970,7 +4496,7 @@ type GraphQLSubscriptionConfiguration struct { func (x *GraphQLSubscriptionConfiguration) Reset() { *x = GraphQLSubscriptionConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[55] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3982,7 +4508,7 @@ func (x *GraphQLSubscriptionConfiguration) String() string { func (*GraphQLSubscriptionConfiguration) ProtoMessage() {} func (x *GraphQLSubscriptionConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[55] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[62] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3995,7 +4521,7 @@ func (x *GraphQLSubscriptionConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use GraphQLSubscriptionConfiguration.ProtoReflect.Descriptor instead. func (*GraphQLSubscriptionConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{55} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{62} } func (x *GraphQLSubscriptionConfiguration) GetEnabled() bool { @@ -4043,7 +4569,7 @@ type GraphQLFederationConfiguration struct { func (x *GraphQLFederationConfiguration) Reset() { *x = GraphQLFederationConfiguration{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[56] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4055,7 +4581,7 @@ func (x *GraphQLFederationConfiguration) String() string { func (*GraphQLFederationConfiguration) ProtoMessage() {} func (x *GraphQLFederationConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[56] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[63] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4068,7 +4594,7 @@ func (x *GraphQLFederationConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use GraphQLFederationConfiguration.ProtoReflect.Descriptor instead. func (*GraphQLFederationConfiguration) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{56} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{63} } func (x *GraphQLFederationConfiguration) GetEnabled() bool { @@ -4095,7 +4621,7 @@ type InternedString struct { func (x *InternedString) Reset() { *x = InternedString{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[57] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4107,7 +4633,7 @@ func (x *InternedString) String() string { func (*InternedString) ProtoMessage() {} func (x *InternedString) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[57] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[64] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4120,7 +4646,7 @@ func (x *InternedString) ProtoReflect() protoreflect.Message { // Deprecated: Use InternedString.ProtoReflect.Descriptor instead. func (*InternedString) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{57} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{64} } func (x *InternedString) GetKey() string { @@ -4140,7 +4666,7 @@ type SingleTypeField struct { func (x *SingleTypeField) Reset() { *x = SingleTypeField{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[58] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4152,7 +4678,7 @@ func (x *SingleTypeField) String() string { func (*SingleTypeField) ProtoMessage() {} func (x *SingleTypeField) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[58] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[65] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4165,7 +4691,7 @@ func (x *SingleTypeField) ProtoReflect() protoreflect.Message { // Deprecated: Use SingleTypeField.ProtoReflect.Descriptor instead. func (*SingleTypeField) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{58} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{65} } func (x *SingleTypeField) GetTypeName() string { @@ -4192,7 +4718,7 @@ type SubscriptionFieldCondition struct { func (x *SubscriptionFieldCondition) Reset() { *x = SubscriptionFieldCondition{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[59] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4204,7 +4730,7 @@ func (x *SubscriptionFieldCondition) String() string { func (*SubscriptionFieldCondition) ProtoMessage() {} func (x *SubscriptionFieldCondition) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[59] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[66] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4217,7 +4743,7 @@ func (x *SubscriptionFieldCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscriptionFieldCondition.ProtoReflect.Descriptor instead. func (*SubscriptionFieldCondition) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{59} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{66} } func (x *SubscriptionFieldCondition) GetFieldPath() []string { @@ -4246,7 +4772,7 @@ type SubscriptionFilterCondition struct { func (x *SubscriptionFilterCondition) Reset() { *x = SubscriptionFilterCondition{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[60] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4258,7 +4784,7 @@ func (x *SubscriptionFilterCondition) String() string { func (*SubscriptionFilterCondition) ProtoMessage() {} func (x *SubscriptionFilterCondition) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[60] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[67] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4271,7 +4797,7 @@ func (x *SubscriptionFilterCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscriptionFilterCondition.ProtoReflect.Descriptor instead. func (*SubscriptionFilterCondition) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{60} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{67} } func (x *SubscriptionFilterCondition) GetAnd() []*SubscriptionFilterCondition { @@ -4311,7 +4837,7 @@ type CacheWarmerOperations struct { func (x *CacheWarmerOperations) Reset() { *x = CacheWarmerOperations{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[61] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4323,7 +4849,7 @@ func (x *CacheWarmerOperations) String() string { func (*CacheWarmerOperations) ProtoMessage() {} func (x *CacheWarmerOperations) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[61] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[68] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4336,7 +4862,7 @@ func (x *CacheWarmerOperations) ProtoReflect() protoreflect.Message { // Deprecated: Use CacheWarmerOperations.ProtoReflect.Descriptor instead. func (*CacheWarmerOperations) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{61} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{68} } func (x *CacheWarmerOperations) GetOperations() []*Operation { @@ -4356,7 +4882,7 @@ type Operation struct { func (x *Operation) Reset() { *x = Operation{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[62] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4368,7 +4894,7 @@ func (x *Operation) String() string { func (*Operation) ProtoMessage() {} func (x *Operation) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[62] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[69] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4381,7 +4907,7 @@ func (x *Operation) ProtoReflect() protoreflect.Message { // Deprecated: Use Operation.ProtoReflect.Descriptor instead. func (*Operation) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{62} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{69} } func (x *Operation) GetRequest() *OperationRequest { @@ -4409,7 +4935,7 @@ type OperationRequest struct { func (x *OperationRequest) Reset() { *x = OperationRequest{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[63] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4421,7 +4947,7 @@ func (x *OperationRequest) String() string { func (*OperationRequest) ProtoMessage() {} func (x *OperationRequest) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[63] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[70] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4434,7 +4960,7 @@ func (x *OperationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use OperationRequest.ProtoReflect.Descriptor instead. func (*OperationRequest) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{63} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{70} } func (x *OperationRequest) GetOperationName() string { @@ -4467,7 +4993,7 @@ type Extension struct { func (x *Extension) Reset() { *x = Extension{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[64] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4479,7 +5005,7 @@ func (x *Extension) String() string { func (*Extension) ProtoMessage() {} func (x *Extension) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[64] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[71] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4492,7 +5018,7 @@ func (x *Extension) ProtoReflect() protoreflect.Message { // Deprecated: Use Extension.ProtoReflect.Descriptor instead. func (*Extension) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{64} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{71} } func (x *Extension) GetPersistedQuery() *PersistedQuery { @@ -4512,7 +5038,7 @@ type PersistedQuery struct { func (x *PersistedQuery) Reset() { *x = PersistedQuery{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[65] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4524,7 +5050,7 @@ func (x *PersistedQuery) String() string { func (*PersistedQuery) ProtoMessage() {} func (x *PersistedQuery) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[65] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[72] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4537,7 +5063,7 @@ func (x *PersistedQuery) ProtoReflect() protoreflect.Message { // Deprecated: Use PersistedQuery.ProtoReflect.Descriptor instead. func (*PersistedQuery) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{65} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{72} } func (x *PersistedQuery) GetSha256Hash() string { @@ -4564,7 +5090,7 @@ type ClientInfo struct { func (x *ClientInfo) Reset() { *x = ClientInfo{} - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[66] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4576,7 +5102,7 @@ func (x *ClientInfo) String() string { func (*ClientInfo) ProtoMessage() {} func (x *ClientInfo) ProtoReflect() protoreflect.Message { - mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[66] + mi := &file_wg_cosmo_node_v1_node_proto_msgTypes[73] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4589,7 +5115,7 @@ func (x *ClientInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientInfo.ProtoReflect.Descriptor instead. func (*ClientInfo) Descriptor() ([]byte, []int) { - return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{66} + return file_wg_cosmo_node_v1_node_proto_rawDescGZIP(), []int{73} } func (x *ClientInfo) GetName() string { @@ -4661,7 +5187,7 @@ const file_wg_cosmo_node_v1_node_proto_rawDesc = "" + "\x12StringStorageEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\x18\n" + - "\x16_graphql_client_schema\"\xce\b\n" + + "\x16_graphql_client_schema\"\x81\r\n" + "\x17DataSourceConfiguration\x124\n" + "\x04kind\x18\x01 \x01(\x0e2 .wg.cosmo.node.v1.DataSourceKindR\x04kind\x12:\n" + "\n" + @@ -4683,7 +5209,53 @@ const file_wg_cosmo_node_v1_node_proto_rawDesc = "" + "\rcustom_events\x18\r \x01(\v2(.wg.cosmo.node.v1.DataSourceCustomEventsR\fcustomEvents\x12[\n" + "\x11entity_interfaces\x18\x0e \x03(\v2..wg.cosmo.node.v1.EntityInterfaceConfigurationR\x10entityInterfaces\x12[\n" + "\x11interface_objects\x18\x0f \x03(\v2..wg.cosmo.node.v1.EntityInterfaceConfigurationR\x10interfaceObjects\x12R\n" + - "\x12cost_configuration\x18\x10 \x01(\v2#.wg.cosmo.node.v1.CostConfigurationR\x11costConfiguration\"\x98\x04\n" + + "\x12cost_configuration\x18\x10 \x01(\v2#.wg.cosmo.node.v1.CostConfigurationR\x11costConfiguration\x12j\n" + + "\x1bentity_cache_configurations\x18\x11 \x03(\v2*.wg.cosmo.node.v1.EntityCacheConfigurationR\x19entityCacheConfigurations\x12t\n" + + "\x1froot_field_cache_configurations\x18\x12 \x03(\v2-.wg.cosmo.node.v1.RootFieldCacheConfigurationR\x1crootFieldCacheConfigurations\x12p\n" + + "\x1dcache_populate_configurations\x18\x13 \x03(\v2,.wg.cosmo.node.v1.CachePopulateConfigurationR\x1bcachePopulateConfigurations\x12v\n" + + "\x1fcache_invalidate_configurations\x18\x14 \x03(\v2..wg.cosmo.node.v1.CacheInvalidateConfigurationR\x1dcacheInvalidateConfigurations\x12e\n" + + "\x15request_scoped_fields\x18\x15 \x03(\v21.wg.cosmo.node.v1.RequestScopedFieldConfigurationR\x13requestScopedFields\"\x88\x01\n" + + "\x1fRequestScopedFieldConfiguration\x12\x1d\n" + + "\n" + + "field_name\x18\x01 \x01(\tR\tfieldName\x12\x1b\n" + + "\ttype_name\x18\x02 \x01(\tR\btypeName\x12\x15\n" + + "\x06l1_key\x18\x03 \x01(\tR\x05l1KeyJ\x04\b\x04\x10\x05R\fresolve_from\"\xb1\x02\n" + + "\x18EntityCacheConfiguration\x12\x1b\n" + + "\ttype_name\x18\x01 \x01(\tR\btypeName\x12&\n" + + "\x0fmax_age_seconds\x18\x02 \x01(\x03R\rmaxAgeSeconds\x12'\n" + + "\x0finclude_headers\x18\x03 \x01(\bR\x0eincludeHeaders\x12,\n" + + "\x12partial_cache_load\x18\x04 \x01(\bR\x10partialCacheLoad\x12\x1f\n" + + "\vshadow_mode\x18\x05 \x01(\bR\n" + + "shadowMode\x12<\n" + + "\x1bnot_found_cache_ttl_seconds\x18\x06 \x01(\x03R\x17notFoundCacheTtlSecondsR\x1anegative_cache_ttl_seconds\"\xac\x02\n" + + "\x1bRootFieldCacheConfiguration\x12\x1d\n" + + "\n" + + "field_name\x18\x01 \x01(\tR\tfieldName\x12&\n" + + "\x0fmax_age_seconds\x18\x02 \x01(\x03R\rmaxAgeSeconds\x12'\n" + + "\x0finclude_headers\x18\x03 \x01(\bR\x0eincludeHeaders\x12\x1f\n" + + "\vshadow_mode\x18\x04 \x01(\bR\n" + + "shadowMode\x12(\n" + + "\x10entity_type_name\x18\x05 \x01(\tR\x0eentityTypeName\x12R\n" + + "\x13entity_key_mappings\x18\x06 \x03(\v2\".wg.cosmo.node.v1.EntityKeyMappingR\x11entityKeyMappings\"\x8e\x01\n" + + "\x10EntityKeyMapping\x12(\n" + + "\x10entity_type_name\x18\x01 \x01(\tR\x0eentityTypeName\x12P\n" + + "\x0efield_mappings\x18\x02 \x03(\v2).wg.cosmo.node.v1.EntityCacheFieldMappingR\rfieldMappings\"\x83\x01\n" + + "\x17EntityCacheFieldMapping\x12(\n" + + "\x10entity_key_field\x18\x01 \x01(\tR\x0eentityKeyField\x12#\n" + + "\rargument_path\x18\x02 \x03(\tR\fargumentPath\x12\x19\n" + + "\bis_batch\x18\x03 \x01(\bR\aisBatch\"\xcd\x01\n" + + "\x1aCachePopulateConfiguration\x12\x1d\n" + + "\n" + + "field_name\x18\x01 \x01(\tR\tfieldName\x12%\n" + + "\x0eoperation_type\x18\x02 \x01(\tR\roperationType\x12+\n" + + "\x0fmax_age_seconds\x18\x03 \x01(\x03H\x00R\rmaxAgeSeconds\x88\x01\x01\x12(\n" + + "\x10entity_type_name\x18\x04 \x01(\tR\x0eentityTypeNameB\x12\n" + + "\x10_max_age_seconds\"\x8e\x01\n" + + "\x1cCacheInvalidateConfiguration\x12\x1d\n" + + "\n" + + "field_name\x18\x01 \x01(\tR\tfieldName\x12%\n" + + "\x0eoperation_type\x18\x02 \x01(\tR\roperationType\x12(\n" + + "\x10entity_type_name\x18\x03 \x01(\tR\x0eentityTypeName\"\x98\x04\n" + "\x11CostConfiguration\x12O\n" + "\rfield_weights\x18\x01 \x03(\v2*.wg.cosmo.node.v1.FieldWeightConfigurationR\ffieldWeights\x12K\n" + "\n" + @@ -5018,7 +5590,7 @@ func file_wg_cosmo_node_v1_node_proto_rawDescGZIP() []byte { } var file_wg_cosmo_node_v1_node_proto_enumTypes = make([]protoimpl.EnumInfo, 8) -var file_wg_cosmo_node_v1_node_proto_msgTypes = make([]protoimpl.MessageInfo, 73) +var file_wg_cosmo_node_v1_node_proto_msgTypes = make([]protoimpl.MessageInfo, 80) var file_wg_cosmo_node_v1_node_proto_goTypes = []any{ (ArgumentRenderConfiguration)(0), // 0: wg.cosmo.node.v1.ArgumentRenderConfiguration (ArgumentSource)(0), // 1: wg.cosmo.node.v1.ArgumentSource @@ -5040,178 +5612,192 @@ var file_wg_cosmo_node_v1_node_proto_goTypes = []any{ (*SelfRegisterResponse)(nil), // 17: wg.cosmo.node.v1.SelfRegisterResponse (*EngineConfiguration)(nil), // 18: wg.cosmo.node.v1.EngineConfiguration (*DataSourceConfiguration)(nil), // 19: wg.cosmo.node.v1.DataSourceConfiguration - (*CostConfiguration)(nil), // 20: wg.cosmo.node.v1.CostConfiguration - (*FieldWeightConfiguration)(nil), // 21: wg.cosmo.node.v1.FieldWeightConfiguration - (*FieldListSizeConfiguration)(nil), // 22: wg.cosmo.node.v1.FieldListSizeConfiguration - (*ArgumentConfiguration)(nil), // 23: wg.cosmo.node.v1.ArgumentConfiguration - (*Scopes)(nil), // 24: wg.cosmo.node.v1.Scopes - (*AuthorizationConfiguration)(nil), // 25: wg.cosmo.node.v1.AuthorizationConfiguration - (*FieldConfiguration)(nil), // 26: wg.cosmo.node.v1.FieldConfiguration - (*TypeConfiguration)(nil), // 27: wg.cosmo.node.v1.TypeConfiguration - (*TypeField)(nil), // 28: wg.cosmo.node.v1.TypeField - (*FieldCoordinates)(nil), // 29: wg.cosmo.node.v1.FieldCoordinates - (*FieldSetCondition)(nil), // 30: wg.cosmo.node.v1.FieldSetCondition - (*RequiredField)(nil), // 31: wg.cosmo.node.v1.RequiredField - (*EntityInterfaceConfiguration)(nil), // 32: wg.cosmo.node.v1.EntityInterfaceConfiguration - (*FetchConfiguration)(nil), // 33: wg.cosmo.node.v1.FetchConfiguration - (*StatusCodeTypeMapping)(nil), // 34: wg.cosmo.node.v1.StatusCodeTypeMapping - (*DataSourceCustom_GraphQL)(nil), // 35: wg.cosmo.node.v1.DataSourceCustom_GraphQL - (*GRPCConfiguration)(nil), // 36: wg.cosmo.node.v1.GRPCConfiguration - (*ImageReference)(nil), // 37: wg.cosmo.node.v1.ImageReference - (*PluginConfiguration)(nil), // 38: wg.cosmo.node.v1.PluginConfiguration - (*SSLConfiguration)(nil), // 39: wg.cosmo.node.v1.SSLConfiguration - (*GRPCMapping)(nil), // 40: wg.cosmo.node.v1.GRPCMapping - (*LookupMapping)(nil), // 41: wg.cosmo.node.v1.LookupMapping - (*LookupFieldMapping)(nil), // 42: wg.cosmo.node.v1.LookupFieldMapping - (*OperationMapping)(nil), // 43: wg.cosmo.node.v1.OperationMapping - (*EntityMapping)(nil), // 44: wg.cosmo.node.v1.EntityMapping - (*RequiredFieldMapping)(nil), // 45: wg.cosmo.node.v1.RequiredFieldMapping - (*TypeFieldMapping)(nil), // 46: wg.cosmo.node.v1.TypeFieldMapping - (*FieldMapping)(nil), // 47: wg.cosmo.node.v1.FieldMapping - (*ArgumentMapping)(nil), // 48: wg.cosmo.node.v1.ArgumentMapping - (*EnumMapping)(nil), // 49: wg.cosmo.node.v1.EnumMapping - (*EnumValueMapping)(nil), // 50: wg.cosmo.node.v1.EnumValueMapping - (*NatsStreamConfiguration)(nil), // 51: wg.cosmo.node.v1.NatsStreamConfiguration - (*NatsEventConfiguration)(nil), // 52: wg.cosmo.node.v1.NatsEventConfiguration - (*KafkaEventConfiguration)(nil), // 53: wg.cosmo.node.v1.KafkaEventConfiguration - (*RedisEventConfiguration)(nil), // 54: wg.cosmo.node.v1.RedisEventConfiguration - (*EngineEventConfiguration)(nil), // 55: wg.cosmo.node.v1.EngineEventConfiguration - (*DataSourceCustomEvents)(nil), // 56: wg.cosmo.node.v1.DataSourceCustomEvents - (*DataSourceCustom_Static)(nil), // 57: wg.cosmo.node.v1.DataSourceCustom_Static - (*ConfigurationVariable)(nil), // 58: wg.cosmo.node.v1.ConfigurationVariable - (*DirectiveConfiguration)(nil), // 59: wg.cosmo.node.v1.DirectiveConfiguration - (*URLQueryConfiguration)(nil), // 60: wg.cosmo.node.v1.URLQueryConfiguration - (*HTTPHeader)(nil), // 61: wg.cosmo.node.v1.HTTPHeader - (*MTLSConfiguration)(nil), // 62: wg.cosmo.node.v1.MTLSConfiguration - (*GraphQLSubscriptionConfiguration)(nil), // 63: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration - (*GraphQLFederationConfiguration)(nil), // 64: wg.cosmo.node.v1.GraphQLFederationConfiguration - (*InternedString)(nil), // 65: wg.cosmo.node.v1.InternedString - (*SingleTypeField)(nil), // 66: wg.cosmo.node.v1.SingleTypeField - (*SubscriptionFieldCondition)(nil), // 67: wg.cosmo.node.v1.SubscriptionFieldCondition - (*SubscriptionFilterCondition)(nil), // 68: wg.cosmo.node.v1.SubscriptionFilterCondition - (*CacheWarmerOperations)(nil), // 69: wg.cosmo.node.v1.CacheWarmerOperations - (*Operation)(nil), // 70: wg.cosmo.node.v1.Operation - (*OperationRequest)(nil), // 71: wg.cosmo.node.v1.OperationRequest - (*Extension)(nil), // 72: wg.cosmo.node.v1.Extension - (*PersistedQuery)(nil), // 73: wg.cosmo.node.v1.PersistedQuery - (*ClientInfo)(nil), // 74: wg.cosmo.node.v1.ClientInfo - nil, // 75: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.ConfigByFeatureFlagNameEntry - nil, // 76: wg.cosmo.node.v1.EngineConfiguration.StringStorageEntry - nil, // 77: wg.cosmo.node.v1.CostConfiguration.TypeWeightsEntry - nil, // 78: wg.cosmo.node.v1.CostConfiguration.DirectiveArgumentWeightsEntry - nil, // 79: wg.cosmo.node.v1.FieldWeightConfiguration.ArgumentWeightsEntry - nil, // 80: wg.cosmo.node.v1.FetchConfiguration.HeaderEntry - (common.EnumStatusCode)(0), // 81: wg.cosmo.common.EnumStatusCode - (common.GraphQLSubscriptionProtocol)(0), // 82: wg.cosmo.common.GraphQLSubscriptionProtocol - (common.GraphQLWebsocketSubprotocol)(0), // 83: wg.cosmo.common.GraphQLWebsocketSubprotocol + (*RequestScopedFieldConfiguration)(nil), // 20: wg.cosmo.node.v1.RequestScopedFieldConfiguration + (*EntityCacheConfiguration)(nil), // 21: wg.cosmo.node.v1.EntityCacheConfiguration + (*RootFieldCacheConfiguration)(nil), // 22: wg.cosmo.node.v1.RootFieldCacheConfiguration + (*EntityKeyMapping)(nil), // 23: wg.cosmo.node.v1.EntityKeyMapping + (*EntityCacheFieldMapping)(nil), // 24: wg.cosmo.node.v1.EntityCacheFieldMapping + (*CachePopulateConfiguration)(nil), // 25: wg.cosmo.node.v1.CachePopulateConfiguration + (*CacheInvalidateConfiguration)(nil), // 26: wg.cosmo.node.v1.CacheInvalidateConfiguration + (*CostConfiguration)(nil), // 27: wg.cosmo.node.v1.CostConfiguration + (*FieldWeightConfiguration)(nil), // 28: wg.cosmo.node.v1.FieldWeightConfiguration + (*FieldListSizeConfiguration)(nil), // 29: wg.cosmo.node.v1.FieldListSizeConfiguration + (*ArgumentConfiguration)(nil), // 30: wg.cosmo.node.v1.ArgumentConfiguration + (*Scopes)(nil), // 31: wg.cosmo.node.v1.Scopes + (*AuthorizationConfiguration)(nil), // 32: wg.cosmo.node.v1.AuthorizationConfiguration + (*FieldConfiguration)(nil), // 33: wg.cosmo.node.v1.FieldConfiguration + (*TypeConfiguration)(nil), // 34: wg.cosmo.node.v1.TypeConfiguration + (*TypeField)(nil), // 35: wg.cosmo.node.v1.TypeField + (*FieldCoordinates)(nil), // 36: wg.cosmo.node.v1.FieldCoordinates + (*FieldSetCondition)(nil), // 37: wg.cosmo.node.v1.FieldSetCondition + (*RequiredField)(nil), // 38: wg.cosmo.node.v1.RequiredField + (*EntityInterfaceConfiguration)(nil), // 39: wg.cosmo.node.v1.EntityInterfaceConfiguration + (*FetchConfiguration)(nil), // 40: wg.cosmo.node.v1.FetchConfiguration + (*StatusCodeTypeMapping)(nil), // 41: wg.cosmo.node.v1.StatusCodeTypeMapping + (*DataSourceCustom_GraphQL)(nil), // 42: wg.cosmo.node.v1.DataSourceCustom_GraphQL + (*GRPCConfiguration)(nil), // 43: wg.cosmo.node.v1.GRPCConfiguration + (*ImageReference)(nil), // 44: wg.cosmo.node.v1.ImageReference + (*PluginConfiguration)(nil), // 45: wg.cosmo.node.v1.PluginConfiguration + (*SSLConfiguration)(nil), // 46: wg.cosmo.node.v1.SSLConfiguration + (*GRPCMapping)(nil), // 47: wg.cosmo.node.v1.GRPCMapping + (*LookupMapping)(nil), // 48: wg.cosmo.node.v1.LookupMapping + (*LookupFieldMapping)(nil), // 49: wg.cosmo.node.v1.LookupFieldMapping + (*OperationMapping)(nil), // 50: wg.cosmo.node.v1.OperationMapping + (*EntityMapping)(nil), // 51: wg.cosmo.node.v1.EntityMapping + (*RequiredFieldMapping)(nil), // 52: wg.cosmo.node.v1.RequiredFieldMapping + (*TypeFieldMapping)(nil), // 53: wg.cosmo.node.v1.TypeFieldMapping + (*FieldMapping)(nil), // 54: wg.cosmo.node.v1.FieldMapping + (*ArgumentMapping)(nil), // 55: wg.cosmo.node.v1.ArgumentMapping + (*EnumMapping)(nil), // 56: wg.cosmo.node.v1.EnumMapping + (*EnumValueMapping)(nil), // 57: wg.cosmo.node.v1.EnumValueMapping + (*NatsStreamConfiguration)(nil), // 58: wg.cosmo.node.v1.NatsStreamConfiguration + (*NatsEventConfiguration)(nil), // 59: wg.cosmo.node.v1.NatsEventConfiguration + (*KafkaEventConfiguration)(nil), // 60: wg.cosmo.node.v1.KafkaEventConfiguration + (*RedisEventConfiguration)(nil), // 61: wg.cosmo.node.v1.RedisEventConfiguration + (*EngineEventConfiguration)(nil), // 62: wg.cosmo.node.v1.EngineEventConfiguration + (*DataSourceCustomEvents)(nil), // 63: wg.cosmo.node.v1.DataSourceCustomEvents + (*DataSourceCustom_Static)(nil), // 64: wg.cosmo.node.v1.DataSourceCustom_Static + (*ConfigurationVariable)(nil), // 65: wg.cosmo.node.v1.ConfigurationVariable + (*DirectiveConfiguration)(nil), // 66: wg.cosmo.node.v1.DirectiveConfiguration + (*URLQueryConfiguration)(nil), // 67: wg.cosmo.node.v1.URLQueryConfiguration + (*HTTPHeader)(nil), // 68: wg.cosmo.node.v1.HTTPHeader + (*MTLSConfiguration)(nil), // 69: wg.cosmo.node.v1.MTLSConfiguration + (*GraphQLSubscriptionConfiguration)(nil), // 70: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration + (*GraphQLFederationConfiguration)(nil), // 71: wg.cosmo.node.v1.GraphQLFederationConfiguration + (*InternedString)(nil), // 72: wg.cosmo.node.v1.InternedString + (*SingleTypeField)(nil), // 73: wg.cosmo.node.v1.SingleTypeField + (*SubscriptionFieldCondition)(nil), // 74: wg.cosmo.node.v1.SubscriptionFieldCondition + (*SubscriptionFilterCondition)(nil), // 75: wg.cosmo.node.v1.SubscriptionFilterCondition + (*CacheWarmerOperations)(nil), // 76: wg.cosmo.node.v1.CacheWarmerOperations + (*Operation)(nil), // 77: wg.cosmo.node.v1.Operation + (*OperationRequest)(nil), // 78: wg.cosmo.node.v1.OperationRequest + (*Extension)(nil), // 79: wg.cosmo.node.v1.Extension + (*PersistedQuery)(nil), // 80: wg.cosmo.node.v1.PersistedQuery + (*ClientInfo)(nil), // 81: wg.cosmo.node.v1.ClientInfo + nil, // 82: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.ConfigByFeatureFlagNameEntry + nil, // 83: wg.cosmo.node.v1.EngineConfiguration.StringStorageEntry + nil, // 84: wg.cosmo.node.v1.CostConfiguration.TypeWeightsEntry + nil, // 85: wg.cosmo.node.v1.CostConfiguration.DirectiveArgumentWeightsEntry + nil, // 86: wg.cosmo.node.v1.FieldWeightConfiguration.ArgumentWeightsEntry + nil, // 87: wg.cosmo.node.v1.FetchConfiguration.HeaderEntry + (common.EnumStatusCode)(0), // 88: wg.cosmo.common.EnumStatusCode + (common.GraphQLSubscriptionProtocol)(0), // 89: wg.cosmo.common.GraphQLSubscriptionProtocol + (common.GraphQLWebsocketSubprotocol)(0), // 90: wg.cosmo.common.GraphQLWebsocketSubprotocol } var file_wg_cosmo_node_v1_node_proto_depIdxs = []int32{ - 75, // 0: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.config_by_feature_flag_name:type_name -> wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.ConfigByFeatureFlagNameEntry + 82, // 0: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.config_by_feature_flag_name:type_name -> wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.ConfigByFeatureFlagNameEntry 18, // 1: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfig.engine_config:type_name -> wg.cosmo.node.v1.EngineConfiguration 8, // 2: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfig.subgraphs:type_name -> wg.cosmo.node.v1.Subgraph 18, // 3: wg.cosmo.node.v1.RouterConfig.engine_config:type_name -> wg.cosmo.node.v1.EngineConfiguration 8, // 4: wg.cosmo.node.v1.RouterConfig.subgraphs:type_name -> wg.cosmo.node.v1.Subgraph 9, // 5: wg.cosmo.node.v1.RouterConfig.feature_flag_configs:type_name -> wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs - 81, // 6: wg.cosmo.node.v1.Response.code:type_name -> wg.cosmo.common.EnumStatusCode + 88, // 6: wg.cosmo.node.v1.Response.code:type_name -> wg.cosmo.common.EnumStatusCode 15, // 7: wg.cosmo.node.v1.RegistrationInfo.account_limits:type_name -> wg.cosmo.node.v1.AccountLimits 12, // 8: wg.cosmo.node.v1.SelfRegisterResponse.response:type_name -> wg.cosmo.node.v1.Response 14, // 9: wg.cosmo.node.v1.SelfRegisterResponse.registrationInfo:type_name -> wg.cosmo.node.v1.RegistrationInfo 19, // 10: wg.cosmo.node.v1.EngineConfiguration.datasource_configurations:type_name -> wg.cosmo.node.v1.DataSourceConfiguration - 26, // 11: wg.cosmo.node.v1.EngineConfiguration.field_configurations:type_name -> wg.cosmo.node.v1.FieldConfiguration - 27, // 12: wg.cosmo.node.v1.EngineConfiguration.type_configurations:type_name -> wg.cosmo.node.v1.TypeConfiguration - 76, // 13: wg.cosmo.node.v1.EngineConfiguration.string_storage:type_name -> wg.cosmo.node.v1.EngineConfiguration.StringStorageEntry + 33, // 11: wg.cosmo.node.v1.EngineConfiguration.field_configurations:type_name -> wg.cosmo.node.v1.FieldConfiguration + 34, // 12: wg.cosmo.node.v1.EngineConfiguration.type_configurations:type_name -> wg.cosmo.node.v1.TypeConfiguration + 83, // 13: wg.cosmo.node.v1.EngineConfiguration.string_storage:type_name -> wg.cosmo.node.v1.EngineConfiguration.StringStorageEntry 2, // 14: wg.cosmo.node.v1.DataSourceConfiguration.kind:type_name -> wg.cosmo.node.v1.DataSourceKind - 28, // 15: wg.cosmo.node.v1.DataSourceConfiguration.root_nodes:type_name -> wg.cosmo.node.v1.TypeField - 28, // 16: wg.cosmo.node.v1.DataSourceConfiguration.child_nodes:type_name -> wg.cosmo.node.v1.TypeField - 35, // 17: wg.cosmo.node.v1.DataSourceConfiguration.custom_graphql:type_name -> wg.cosmo.node.v1.DataSourceCustom_GraphQL - 57, // 18: wg.cosmo.node.v1.DataSourceConfiguration.custom_static:type_name -> wg.cosmo.node.v1.DataSourceCustom_Static - 59, // 19: wg.cosmo.node.v1.DataSourceConfiguration.directives:type_name -> wg.cosmo.node.v1.DirectiveConfiguration - 31, // 20: wg.cosmo.node.v1.DataSourceConfiguration.keys:type_name -> wg.cosmo.node.v1.RequiredField - 31, // 21: wg.cosmo.node.v1.DataSourceConfiguration.provides:type_name -> wg.cosmo.node.v1.RequiredField - 31, // 22: wg.cosmo.node.v1.DataSourceConfiguration.requires:type_name -> wg.cosmo.node.v1.RequiredField - 56, // 23: wg.cosmo.node.v1.DataSourceConfiguration.custom_events:type_name -> wg.cosmo.node.v1.DataSourceCustomEvents - 32, // 24: wg.cosmo.node.v1.DataSourceConfiguration.entity_interfaces:type_name -> wg.cosmo.node.v1.EntityInterfaceConfiguration - 32, // 25: wg.cosmo.node.v1.DataSourceConfiguration.interface_objects:type_name -> wg.cosmo.node.v1.EntityInterfaceConfiguration - 20, // 26: wg.cosmo.node.v1.DataSourceConfiguration.cost_configuration:type_name -> wg.cosmo.node.v1.CostConfiguration - 21, // 27: wg.cosmo.node.v1.CostConfiguration.field_weights:type_name -> wg.cosmo.node.v1.FieldWeightConfiguration - 22, // 28: wg.cosmo.node.v1.CostConfiguration.list_sizes:type_name -> wg.cosmo.node.v1.FieldListSizeConfiguration - 77, // 29: wg.cosmo.node.v1.CostConfiguration.type_weights:type_name -> wg.cosmo.node.v1.CostConfiguration.TypeWeightsEntry - 78, // 30: wg.cosmo.node.v1.CostConfiguration.directive_argument_weights:type_name -> wg.cosmo.node.v1.CostConfiguration.DirectiveArgumentWeightsEntry - 79, // 31: wg.cosmo.node.v1.FieldWeightConfiguration.argument_weights:type_name -> wg.cosmo.node.v1.FieldWeightConfiguration.ArgumentWeightsEntry - 1, // 32: wg.cosmo.node.v1.ArgumentConfiguration.source_type:type_name -> wg.cosmo.node.v1.ArgumentSource - 24, // 33: wg.cosmo.node.v1.AuthorizationConfiguration.required_or_scopes:type_name -> wg.cosmo.node.v1.Scopes - 24, // 34: wg.cosmo.node.v1.AuthorizationConfiguration.required_or_scopes_by_or:type_name -> wg.cosmo.node.v1.Scopes - 23, // 35: wg.cosmo.node.v1.FieldConfiguration.arguments_configuration:type_name -> wg.cosmo.node.v1.ArgumentConfiguration - 25, // 36: wg.cosmo.node.v1.FieldConfiguration.authorization_configuration:type_name -> wg.cosmo.node.v1.AuthorizationConfiguration - 68, // 37: wg.cosmo.node.v1.FieldConfiguration.subscription_filter_condition:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition - 29, // 38: wg.cosmo.node.v1.FieldSetCondition.field_coordinates_path:type_name -> wg.cosmo.node.v1.FieldCoordinates - 30, // 39: wg.cosmo.node.v1.RequiredField.conditions:type_name -> wg.cosmo.node.v1.FieldSetCondition - 58, // 40: wg.cosmo.node.v1.FetchConfiguration.url:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 7, // 41: wg.cosmo.node.v1.FetchConfiguration.method:type_name -> wg.cosmo.node.v1.HTTPMethod - 80, // 42: wg.cosmo.node.v1.FetchConfiguration.header:type_name -> wg.cosmo.node.v1.FetchConfiguration.HeaderEntry - 58, // 43: wg.cosmo.node.v1.FetchConfiguration.body:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 60, // 44: wg.cosmo.node.v1.FetchConfiguration.query:type_name -> wg.cosmo.node.v1.URLQueryConfiguration - 62, // 45: wg.cosmo.node.v1.FetchConfiguration.mtls:type_name -> wg.cosmo.node.v1.MTLSConfiguration - 58, // 46: wg.cosmo.node.v1.FetchConfiguration.base_url:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 58, // 47: wg.cosmo.node.v1.FetchConfiguration.path:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 58, // 48: wg.cosmo.node.v1.FetchConfiguration.http_proxy_url:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 33, // 49: wg.cosmo.node.v1.DataSourceCustom_GraphQL.fetch:type_name -> wg.cosmo.node.v1.FetchConfiguration - 63, // 50: wg.cosmo.node.v1.DataSourceCustom_GraphQL.subscription:type_name -> wg.cosmo.node.v1.GraphQLSubscriptionConfiguration - 64, // 51: wg.cosmo.node.v1.DataSourceCustom_GraphQL.federation:type_name -> wg.cosmo.node.v1.GraphQLFederationConfiguration - 65, // 52: wg.cosmo.node.v1.DataSourceCustom_GraphQL.upstream_schema:type_name -> wg.cosmo.node.v1.InternedString - 66, // 53: wg.cosmo.node.v1.DataSourceCustom_GraphQL.custom_scalar_type_fields:type_name -> wg.cosmo.node.v1.SingleTypeField - 36, // 54: wg.cosmo.node.v1.DataSourceCustom_GraphQL.grpc:type_name -> wg.cosmo.node.v1.GRPCConfiguration - 40, // 55: wg.cosmo.node.v1.GRPCConfiguration.mapping:type_name -> wg.cosmo.node.v1.GRPCMapping - 38, // 56: wg.cosmo.node.v1.GRPCConfiguration.plugin:type_name -> wg.cosmo.node.v1.PluginConfiguration - 37, // 57: wg.cosmo.node.v1.PluginConfiguration.image_reference:type_name -> wg.cosmo.node.v1.ImageReference - 43, // 58: wg.cosmo.node.v1.GRPCMapping.operation_mappings:type_name -> wg.cosmo.node.v1.OperationMapping - 44, // 59: wg.cosmo.node.v1.GRPCMapping.entity_mappings:type_name -> wg.cosmo.node.v1.EntityMapping - 46, // 60: wg.cosmo.node.v1.GRPCMapping.type_field_mappings:type_name -> wg.cosmo.node.v1.TypeFieldMapping - 49, // 61: wg.cosmo.node.v1.GRPCMapping.enum_mappings:type_name -> wg.cosmo.node.v1.EnumMapping - 41, // 62: wg.cosmo.node.v1.GRPCMapping.resolve_mappings:type_name -> wg.cosmo.node.v1.LookupMapping - 3, // 63: wg.cosmo.node.v1.LookupMapping.type:type_name -> wg.cosmo.node.v1.LookupType - 42, // 64: wg.cosmo.node.v1.LookupMapping.lookup_mapping:type_name -> wg.cosmo.node.v1.LookupFieldMapping - 47, // 65: wg.cosmo.node.v1.LookupFieldMapping.field_mapping:type_name -> wg.cosmo.node.v1.FieldMapping - 4, // 66: wg.cosmo.node.v1.OperationMapping.type:type_name -> wg.cosmo.node.v1.OperationType - 45, // 67: wg.cosmo.node.v1.EntityMapping.required_field_mappings:type_name -> wg.cosmo.node.v1.RequiredFieldMapping - 47, // 68: wg.cosmo.node.v1.RequiredFieldMapping.field_mapping:type_name -> wg.cosmo.node.v1.FieldMapping - 47, // 69: wg.cosmo.node.v1.TypeFieldMapping.field_mappings:type_name -> wg.cosmo.node.v1.FieldMapping - 48, // 70: wg.cosmo.node.v1.FieldMapping.argument_mappings:type_name -> wg.cosmo.node.v1.ArgumentMapping - 50, // 71: wg.cosmo.node.v1.EnumMapping.values:type_name -> wg.cosmo.node.v1.EnumValueMapping - 55, // 72: wg.cosmo.node.v1.NatsEventConfiguration.engine_event_configuration:type_name -> wg.cosmo.node.v1.EngineEventConfiguration - 51, // 73: wg.cosmo.node.v1.NatsEventConfiguration.stream_configuration:type_name -> wg.cosmo.node.v1.NatsStreamConfiguration - 55, // 74: wg.cosmo.node.v1.KafkaEventConfiguration.engine_event_configuration:type_name -> wg.cosmo.node.v1.EngineEventConfiguration - 55, // 75: wg.cosmo.node.v1.RedisEventConfiguration.engine_event_configuration:type_name -> wg.cosmo.node.v1.EngineEventConfiguration - 5, // 76: wg.cosmo.node.v1.EngineEventConfiguration.type:type_name -> wg.cosmo.node.v1.EventType - 52, // 77: wg.cosmo.node.v1.DataSourceCustomEvents.nats:type_name -> wg.cosmo.node.v1.NatsEventConfiguration - 53, // 78: wg.cosmo.node.v1.DataSourceCustomEvents.kafka:type_name -> wg.cosmo.node.v1.KafkaEventConfiguration - 54, // 79: wg.cosmo.node.v1.DataSourceCustomEvents.redis:type_name -> wg.cosmo.node.v1.RedisEventConfiguration - 58, // 80: wg.cosmo.node.v1.DataSourceCustom_Static.data:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 6, // 81: wg.cosmo.node.v1.ConfigurationVariable.kind:type_name -> wg.cosmo.node.v1.ConfigurationVariableKind - 58, // 82: wg.cosmo.node.v1.HTTPHeader.values:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 58, // 83: wg.cosmo.node.v1.MTLSConfiguration.key:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 58, // 84: wg.cosmo.node.v1.MTLSConfiguration.cert:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 58, // 85: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration.url:type_name -> wg.cosmo.node.v1.ConfigurationVariable - 82, // 86: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration.protocol:type_name -> wg.cosmo.common.GraphQLSubscriptionProtocol - 83, // 87: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration.websocketSubprotocol:type_name -> wg.cosmo.common.GraphQLWebsocketSubprotocol - 68, // 88: wg.cosmo.node.v1.SubscriptionFilterCondition.and:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition - 67, // 89: wg.cosmo.node.v1.SubscriptionFilterCondition.in:type_name -> wg.cosmo.node.v1.SubscriptionFieldCondition - 68, // 90: wg.cosmo.node.v1.SubscriptionFilterCondition.not:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition - 68, // 91: wg.cosmo.node.v1.SubscriptionFilterCondition.or:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition - 70, // 92: wg.cosmo.node.v1.CacheWarmerOperations.operations:type_name -> wg.cosmo.node.v1.Operation - 71, // 93: wg.cosmo.node.v1.Operation.request:type_name -> wg.cosmo.node.v1.OperationRequest - 74, // 94: wg.cosmo.node.v1.Operation.client:type_name -> wg.cosmo.node.v1.ClientInfo - 72, // 95: wg.cosmo.node.v1.OperationRequest.extensions:type_name -> wg.cosmo.node.v1.Extension - 73, // 96: wg.cosmo.node.v1.Extension.persisted_query:type_name -> wg.cosmo.node.v1.PersistedQuery - 10, // 97: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.ConfigByFeatureFlagNameEntry.value:type_name -> wg.cosmo.node.v1.FeatureFlagRouterExecutionConfig - 61, // 98: wg.cosmo.node.v1.FetchConfiguration.HeaderEntry.value:type_name -> wg.cosmo.node.v1.HTTPHeader - 16, // 99: wg.cosmo.node.v1.NodeService.SelfRegister:input_type -> wg.cosmo.node.v1.SelfRegisterRequest - 17, // 100: wg.cosmo.node.v1.NodeService.SelfRegister:output_type -> wg.cosmo.node.v1.SelfRegisterResponse - 100, // [100:101] is the sub-list for method output_type - 99, // [99:100] is the sub-list for method input_type - 99, // [99:99] is the sub-list for extension type_name - 99, // [99:99] is the sub-list for extension extendee - 0, // [0:99] is the sub-list for field type_name + 35, // 15: wg.cosmo.node.v1.DataSourceConfiguration.root_nodes:type_name -> wg.cosmo.node.v1.TypeField + 35, // 16: wg.cosmo.node.v1.DataSourceConfiguration.child_nodes:type_name -> wg.cosmo.node.v1.TypeField + 42, // 17: wg.cosmo.node.v1.DataSourceConfiguration.custom_graphql:type_name -> wg.cosmo.node.v1.DataSourceCustom_GraphQL + 64, // 18: wg.cosmo.node.v1.DataSourceConfiguration.custom_static:type_name -> wg.cosmo.node.v1.DataSourceCustom_Static + 66, // 19: wg.cosmo.node.v1.DataSourceConfiguration.directives:type_name -> wg.cosmo.node.v1.DirectiveConfiguration + 38, // 20: wg.cosmo.node.v1.DataSourceConfiguration.keys:type_name -> wg.cosmo.node.v1.RequiredField + 38, // 21: wg.cosmo.node.v1.DataSourceConfiguration.provides:type_name -> wg.cosmo.node.v1.RequiredField + 38, // 22: wg.cosmo.node.v1.DataSourceConfiguration.requires:type_name -> wg.cosmo.node.v1.RequiredField + 63, // 23: wg.cosmo.node.v1.DataSourceConfiguration.custom_events:type_name -> wg.cosmo.node.v1.DataSourceCustomEvents + 39, // 24: wg.cosmo.node.v1.DataSourceConfiguration.entity_interfaces:type_name -> wg.cosmo.node.v1.EntityInterfaceConfiguration + 39, // 25: wg.cosmo.node.v1.DataSourceConfiguration.interface_objects:type_name -> wg.cosmo.node.v1.EntityInterfaceConfiguration + 27, // 26: wg.cosmo.node.v1.DataSourceConfiguration.cost_configuration:type_name -> wg.cosmo.node.v1.CostConfiguration + 21, // 27: wg.cosmo.node.v1.DataSourceConfiguration.entity_cache_configurations:type_name -> wg.cosmo.node.v1.EntityCacheConfiguration + 22, // 28: wg.cosmo.node.v1.DataSourceConfiguration.root_field_cache_configurations:type_name -> wg.cosmo.node.v1.RootFieldCacheConfiguration + 25, // 29: wg.cosmo.node.v1.DataSourceConfiguration.cache_populate_configurations:type_name -> wg.cosmo.node.v1.CachePopulateConfiguration + 26, // 30: wg.cosmo.node.v1.DataSourceConfiguration.cache_invalidate_configurations:type_name -> wg.cosmo.node.v1.CacheInvalidateConfiguration + 20, // 31: wg.cosmo.node.v1.DataSourceConfiguration.request_scoped_fields:type_name -> wg.cosmo.node.v1.RequestScopedFieldConfiguration + 23, // 32: wg.cosmo.node.v1.RootFieldCacheConfiguration.entity_key_mappings:type_name -> wg.cosmo.node.v1.EntityKeyMapping + 24, // 33: wg.cosmo.node.v1.EntityKeyMapping.field_mappings:type_name -> wg.cosmo.node.v1.EntityCacheFieldMapping + 28, // 34: wg.cosmo.node.v1.CostConfiguration.field_weights:type_name -> wg.cosmo.node.v1.FieldWeightConfiguration + 29, // 35: wg.cosmo.node.v1.CostConfiguration.list_sizes:type_name -> wg.cosmo.node.v1.FieldListSizeConfiguration + 84, // 36: wg.cosmo.node.v1.CostConfiguration.type_weights:type_name -> wg.cosmo.node.v1.CostConfiguration.TypeWeightsEntry + 85, // 37: wg.cosmo.node.v1.CostConfiguration.directive_argument_weights:type_name -> wg.cosmo.node.v1.CostConfiguration.DirectiveArgumentWeightsEntry + 86, // 38: wg.cosmo.node.v1.FieldWeightConfiguration.argument_weights:type_name -> wg.cosmo.node.v1.FieldWeightConfiguration.ArgumentWeightsEntry + 1, // 39: wg.cosmo.node.v1.ArgumentConfiguration.source_type:type_name -> wg.cosmo.node.v1.ArgumentSource + 31, // 40: wg.cosmo.node.v1.AuthorizationConfiguration.required_or_scopes:type_name -> wg.cosmo.node.v1.Scopes + 31, // 41: wg.cosmo.node.v1.AuthorizationConfiguration.required_or_scopes_by_or:type_name -> wg.cosmo.node.v1.Scopes + 30, // 42: wg.cosmo.node.v1.FieldConfiguration.arguments_configuration:type_name -> wg.cosmo.node.v1.ArgumentConfiguration + 32, // 43: wg.cosmo.node.v1.FieldConfiguration.authorization_configuration:type_name -> wg.cosmo.node.v1.AuthorizationConfiguration + 75, // 44: wg.cosmo.node.v1.FieldConfiguration.subscription_filter_condition:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition + 36, // 45: wg.cosmo.node.v1.FieldSetCondition.field_coordinates_path:type_name -> wg.cosmo.node.v1.FieldCoordinates + 37, // 46: wg.cosmo.node.v1.RequiredField.conditions:type_name -> wg.cosmo.node.v1.FieldSetCondition + 65, // 47: wg.cosmo.node.v1.FetchConfiguration.url:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 7, // 48: wg.cosmo.node.v1.FetchConfiguration.method:type_name -> wg.cosmo.node.v1.HTTPMethod + 87, // 49: wg.cosmo.node.v1.FetchConfiguration.header:type_name -> wg.cosmo.node.v1.FetchConfiguration.HeaderEntry + 65, // 50: wg.cosmo.node.v1.FetchConfiguration.body:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 67, // 51: wg.cosmo.node.v1.FetchConfiguration.query:type_name -> wg.cosmo.node.v1.URLQueryConfiguration + 69, // 52: wg.cosmo.node.v1.FetchConfiguration.mtls:type_name -> wg.cosmo.node.v1.MTLSConfiguration + 65, // 53: wg.cosmo.node.v1.FetchConfiguration.base_url:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 65, // 54: wg.cosmo.node.v1.FetchConfiguration.path:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 65, // 55: wg.cosmo.node.v1.FetchConfiguration.http_proxy_url:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 40, // 56: wg.cosmo.node.v1.DataSourceCustom_GraphQL.fetch:type_name -> wg.cosmo.node.v1.FetchConfiguration + 70, // 57: wg.cosmo.node.v1.DataSourceCustom_GraphQL.subscription:type_name -> wg.cosmo.node.v1.GraphQLSubscriptionConfiguration + 71, // 58: wg.cosmo.node.v1.DataSourceCustom_GraphQL.federation:type_name -> wg.cosmo.node.v1.GraphQLFederationConfiguration + 72, // 59: wg.cosmo.node.v1.DataSourceCustom_GraphQL.upstream_schema:type_name -> wg.cosmo.node.v1.InternedString + 73, // 60: wg.cosmo.node.v1.DataSourceCustom_GraphQL.custom_scalar_type_fields:type_name -> wg.cosmo.node.v1.SingleTypeField + 43, // 61: wg.cosmo.node.v1.DataSourceCustom_GraphQL.grpc:type_name -> wg.cosmo.node.v1.GRPCConfiguration + 47, // 62: wg.cosmo.node.v1.GRPCConfiguration.mapping:type_name -> wg.cosmo.node.v1.GRPCMapping + 45, // 63: wg.cosmo.node.v1.GRPCConfiguration.plugin:type_name -> wg.cosmo.node.v1.PluginConfiguration + 44, // 64: wg.cosmo.node.v1.PluginConfiguration.image_reference:type_name -> wg.cosmo.node.v1.ImageReference + 50, // 65: wg.cosmo.node.v1.GRPCMapping.operation_mappings:type_name -> wg.cosmo.node.v1.OperationMapping + 51, // 66: wg.cosmo.node.v1.GRPCMapping.entity_mappings:type_name -> wg.cosmo.node.v1.EntityMapping + 53, // 67: wg.cosmo.node.v1.GRPCMapping.type_field_mappings:type_name -> wg.cosmo.node.v1.TypeFieldMapping + 56, // 68: wg.cosmo.node.v1.GRPCMapping.enum_mappings:type_name -> wg.cosmo.node.v1.EnumMapping + 48, // 69: wg.cosmo.node.v1.GRPCMapping.resolve_mappings:type_name -> wg.cosmo.node.v1.LookupMapping + 3, // 70: wg.cosmo.node.v1.LookupMapping.type:type_name -> wg.cosmo.node.v1.LookupType + 49, // 71: wg.cosmo.node.v1.LookupMapping.lookup_mapping:type_name -> wg.cosmo.node.v1.LookupFieldMapping + 54, // 72: wg.cosmo.node.v1.LookupFieldMapping.field_mapping:type_name -> wg.cosmo.node.v1.FieldMapping + 4, // 73: wg.cosmo.node.v1.OperationMapping.type:type_name -> wg.cosmo.node.v1.OperationType + 52, // 74: wg.cosmo.node.v1.EntityMapping.required_field_mappings:type_name -> wg.cosmo.node.v1.RequiredFieldMapping + 54, // 75: wg.cosmo.node.v1.RequiredFieldMapping.field_mapping:type_name -> wg.cosmo.node.v1.FieldMapping + 54, // 76: wg.cosmo.node.v1.TypeFieldMapping.field_mappings:type_name -> wg.cosmo.node.v1.FieldMapping + 55, // 77: wg.cosmo.node.v1.FieldMapping.argument_mappings:type_name -> wg.cosmo.node.v1.ArgumentMapping + 57, // 78: wg.cosmo.node.v1.EnumMapping.values:type_name -> wg.cosmo.node.v1.EnumValueMapping + 62, // 79: wg.cosmo.node.v1.NatsEventConfiguration.engine_event_configuration:type_name -> wg.cosmo.node.v1.EngineEventConfiguration + 58, // 80: wg.cosmo.node.v1.NatsEventConfiguration.stream_configuration:type_name -> wg.cosmo.node.v1.NatsStreamConfiguration + 62, // 81: wg.cosmo.node.v1.KafkaEventConfiguration.engine_event_configuration:type_name -> wg.cosmo.node.v1.EngineEventConfiguration + 62, // 82: wg.cosmo.node.v1.RedisEventConfiguration.engine_event_configuration:type_name -> wg.cosmo.node.v1.EngineEventConfiguration + 5, // 83: wg.cosmo.node.v1.EngineEventConfiguration.type:type_name -> wg.cosmo.node.v1.EventType + 59, // 84: wg.cosmo.node.v1.DataSourceCustomEvents.nats:type_name -> wg.cosmo.node.v1.NatsEventConfiguration + 60, // 85: wg.cosmo.node.v1.DataSourceCustomEvents.kafka:type_name -> wg.cosmo.node.v1.KafkaEventConfiguration + 61, // 86: wg.cosmo.node.v1.DataSourceCustomEvents.redis:type_name -> wg.cosmo.node.v1.RedisEventConfiguration + 65, // 87: wg.cosmo.node.v1.DataSourceCustom_Static.data:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 6, // 88: wg.cosmo.node.v1.ConfigurationVariable.kind:type_name -> wg.cosmo.node.v1.ConfigurationVariableKind + 65, // 89: wg.cosmo.node.v1.HTTPHeader.values:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 65, // 90: wg.cosmo.node.v1.MTLSConfiguration.key:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 65, // 91: wg.cosmo.node.v1.MTLSConfiguration.cert:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 65, // 92: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration.url:type_name -> wg.cosmo.node.v1.ConfigurationVariable + 89, // 93: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration.protocol:type_name -> wg.cosmo.common.GraphQLSubscriptionProtocol + 90, // 94: wg.cosmo.node.v1.GraphQLSubscriptionConfiguration.websocketSubprotocol:type_name -> wg.cosmo.common.GraphQLWebsocketSubprotocol + 75, // 95: wg.cosmo.node.v1.SubscriptionFilterCondition.and:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition + 74, // 96: wg.cosmo.node.v1.SubscriptionFilterCondition.in:type_name -> wg.cosmo.node.v1.SubscriptionFieldCondition + 75, // 97: wg.cosmo.node.v1.SubscriptionFilterCondition.not:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition + 75, // 98: wg.cosmo.node.v1.SubscriptionFilterCondition.or:type_name -> wg.cosmo.node.v1.SubscriptionFilterCondition + 77, // 99: wg.cosmo.node.v1.CacheWarmerOperations.operations:type_name -> wg.cosmo.node.v1.Operation + 78, // 100: wg.cosmo.node.v1.Operation.request:type_name -> wg.cosmo.node.v1.OperationRequest + 81, // 101: wg.cosmo.node.v1.Operation.client:type_name -> wg.cosmo.node.v1.ClientInfo + 79, // 102: wg.cosmo.node.v1.OperationRequest.extensions:type_name -> wg.cosmo.node.v1.Extension + 80, // 103: wg.cosmo.node.v1.Extension.persisted_query:type_name -> wg.cosmo.node.v1.PersistedQuery + 10, // 104: wg.cosmo.node.v1.FeatureFlagRouterExecutionConfigs.ConfigByFeatureFlagNameEntry.value:type_name -> wg.cosmo.node.v1.FeatureFlagRouterExecutionConfig + 68, // 105: wg.cosmo.node.v1.FetchConfiguration.HeaderEntry.value:type_name -> wg.cosmo.node.v1.HTTPHeader + 16, // 106: wg.cosmo.node.v1.NodeService.SelfRegister:input_type -> wg.cosmo.node.v1.SelfRegisterRequest + 17, // 107: wg.cosmo.node.v1.NodeService.SelfRegister:output_type -> wg.cosmo.node.v1.SelfRegisterResponse + 107, // [107:108] is the sub-list for method output_type + 106, // [106:107] is the sub-list for method input_type + 106, // [106:106] is the sub-list for extension type_name + 106, // [106:106] is the sub-list for extension extendee + 0, // [0:106] is the sub-list for field type_name } func init() { file_wg_cosmo_node_v1_node_proto_init() } @@ -5223,20 +5809,21 @@ func file_wg_cosmo_node_v1_node_proto_init() { file_wg_cosmo_node_v1_node_proto_msgTypes[4].OneofWrappers = []any{} file_wg_cosmo_node_v1_node_proto_msgTypes[9].OneofWrappers = []any{} file_wg_cosmo_node_v1_node_proto_msgTypes[10].OneofWrappers = []any{} - file_wg_cosmo_node_v1_node_proto_msgTypes[13].OneofWrappers = []any{} - file_wg_cosmo_node_v1_node_proto_msgTypes[14].OneofWrappers = []any{} - file_wg_cosmo_node_v1_node_proto_msgTypes[18].OneofWrappers = []any{} + file_wg_cosmo_node_v1_node_proto_msgTypes[17].OneofWrappers = []any{} + file_wg_cosmo_node_v1_node_proto_msgTypes[20].OneofWrappers = []any{} + file_wg_cosmo_node_v1_node_proto_msgTypes[21].OneofWrappers = []any{} file_wg_cosmo_node_v1_node_proto_msgTypes[25].OneofWrappers = []any{} - file_wg_cosmo_node_v1_node_proto_msgTypes[30].OneofWrappers = []any{} - file_wg_cosmo_node_v1_node_proto_msgTypes[55].OneofWrappers = []any{} - file_wg_cosmo_node_v1_node_proto_msgTypes[60].OneofWrappers = []any{} + file_wg_cosmo_node_v1_node_proto_msgTypes[32].OneofWrappers = []any{} + file_wg_cosmo_node_v1_node_proto_msgTypes[37].OneofWrappers = []any{} + file_wg_cosmo_node_v1_node_proto_msgTypes[62].OneofWrappers = []any{} + file_wg_cosmo_node_v1_node_proto_msgTypes[67].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_wg_cosmo_node_v1_node_proto_rawDesc), len(file_wg_cosmo_node_v1_node_proto_rawDesc)), NumEnums: 8, - NumMessages: 73, + NumMessages: 80, NumExtensions: 0, NumServices: 1, }, diff --git a/router/go.mod b/router/go.mod index 1b107c9753..fd86444fd1 100644 --- a/router/go.mod +++ b/router/go.mod @@ -31,7 +31,7 @@ require ( github.com/tidwall/gjson v1.18.0 github.com/tidwall/sjson v1.2.5 github.com/twmb/franz-go v1.16.1 - github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.269 + github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.270.0.20260419221936-771759beca58 // Do not upgrade, it renames attributes we rely on go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 go.opentelemetry.io/contrib/propagators/b3 v1.23.0 @@ -81,8 +81,8 @@ require ( github.com/pquerna/cachecontrol v0.2.0 github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 github.com/tonglil/opentelemetry-go-datadog-propagator v0.1.3 - github.com/wundergraph/astjson v1.1.0 - github.com/wundergraph/go-arena v1.1.0 + github.com/wundergraph/astjson v1.1.1-0.20260419105127-f600d161463f + github.com/wundergraph/go-arena v1.2.0 go.uber.org/goleak v1.3.0 go.uber.org/ratelimit v0.3.1 golang.org/x/exp v0.0.0-20250813145105-42675adae3e6 diff --git a/router/go.sum b/router/go.sum index f3e013294a..09ac92a48c 100644 --- a/router/go.sum +++ b/router/go.sum @@ -323,12 +323,12 @@ github.com/vbatts/tar-split v0.12.1 h1:CqKoORW7BUWBe7UL/iqTVvkTBOF8UvOMKOIZykxnn github.com/vbatts/tar-split v0.12.1/go.mod h1:eF6B6i6ftWQcDqEn3/iGFRFRo8cBIMSJVOpnNdfTMFA= github.com/vektah/gqlparser/v2 v2.5.30 h1:EqLwGAFLIzt1wpx1IPpY67DwUujF1OfzgEyDsLrN6kE= github.com/vektah/gqlparser/v2 v2.5.30/go.mod h1:D1/VCZtV3LPnQrcPBeR/q5jkSQIPti0uYCP/RI0gIeo= -github.com/wundergraph/astjson v1.1.0 h1:xORDosrZ87zQFJwNGe/HIHXqzpdHOFmqWgykCLVL040= -github.com/wundergraph/astjson v1.1.0/go.mod h1:h12D/dxxnedtLzsKyBLK7/Oe4TAoGpRVC9nDpDrZSWw= -github.com/wundergraph/go-arena v1.1.0 h1:9+wSRkJAkA2vbYHp6s8tEGhPViRGQNGXqPHT0QzhdIc= -github.com/wundergraph/go-arena v1.1.0/go.mod h1:ROOysEHWJjLQ8FSfNxZCziagb7Qw2nXY3/vgKRh7eWw= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.269 h1:BFQ4/IFqucZsrmzs6vkqjHC5j2XV6rhnmoMLmtYMcp8= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.269/go.mod h1:HjTAO/cuICpu31IfHY9qmSPygx6Gza7Wt9hTSReTI+A= +github.com/wundergraph/astjson v1.1.1-0.20260419105127-f600d161463f h1:MoVoeMlgY9Ej1aoF3Y/kniBZ8pv+WfIA3YSCnPBh+6M= +github.com/wundergraph/astjson v1.1.1-0.20260419105127-f600d161463f/go.mod h1:uHSJv7uowLN/nIPvkTFqUDt1sXk4qQU0KNwHfwfDcQE= +github.com/wundergraph/go-arena v1.2.0 h1:6MlhEy0NBY3Z+BuK3rj0F9YoT3bM0SlahGkzK0lKRZ4= +github.com/wundergraph/go-arena v1.2.0/go.mod h1:ROOysEHWJjLQ8FSfNxZCziagb7Qw2nXY3/vgKRh7eWw= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.270.0.20260419221936-771759beca58 h1:lOwmludLUA0eqyYOB8LHYfn5b0s1IZMfhjdzdaNW8ew= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.270.0.20260419221936-771759beca58/go.mod h1:ARd7AYT8FBNXDOa/qhREPXgIj+9CDQqcMMW5kT3oIZQ= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= diff --git a/router/internal/graphiql/graphiql.html b/router/internal/graphiql/graphiql.html index 2b7b3c41e7..4f96fe93ab 100644 --- a/router/internal/graphiql/graphiql.html +++ b/router/internal/graphiql/graphiql.html @@ -19,7 +19,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -var K=q,W=Symbol.for("react.element"),Q=Symbol.for("react.fragment"),Y=Object.prototype.hasOwnProperty,X=K.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,J={key:!0,ref:!0,__self:!0,__source:!0};function Z(e,t,n){var r,i={},o=null,a=null;for(r in void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),void 0!==t.ref&&(a=t.ref),t)Y.call(t,r)&&!J.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:W,type:e,key:o,ref:a,props:i,_owner:X.current}}s.Fragment=Q,s.jsx=Z,s.jsxs=Z,a.exports=s;var ee=a.exports,te={},ne={exports:{}},re={},ie={exports:{}},oe={}; +var K=q,W=Symbol.for("react.element"),Q=Symbol.for("react.fragment"),X=Object.prototype.hasOwnProperty,Y=K.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,J={key:!0,ref:!0,__self:!0,__source:!0};function Z(e,t,n){var r,i={},o=null,a=null;for(r in void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),void 0!==t.ref&&(a=t.ref),t)X.call(t,r)&&!J.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:W,type:e,key:o,ref:a,props:i,_owner:Y.current}}s.Fragment=Q,s.jsx=Z,s.jsxs=Z,a.exports=s;var ee=a.exports,te={},ne={exports:{}},re={},ie={exports:{}},oe={}; /** * @license React * scheduler.production.min.js @@ -38,7 +38,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */function ue(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n
)} diff --git a/studio/src/components/playground/trace-view.tsx b/studio/src/components/playground/trace-view.tsx index 04e16fa365..86e8516169 100644 --- a/studio/src/components/playground/trace-view.tsx +++ b/studio/src/components/playground/trace-view.tsx @@ -8,14 +8,16 @@ import { useMovable } from 'react-move-hook'; import { Edge, Node, ReactFlowProvider } from 'reactflow'; import { EmptyState } from '../empty-state'; import { Card } from '../ui/card'; -import { CLI } from '../ui/cli'; +import { CLI, CLISteps } from '../ui/cli'; import { Tabs, TabsList, TabsTrigger } from '../ui/tabs'; import { ARTCustomEdge, FetchFlow, ReactFlowARTFetchNode, ReactFlowARTMultiFetchNode } from './fetch-flow'; import { FetchWaterfall } from './fetch-waterfall'; -import { ARTFetchNode, LoadStats, QueryPlan } from './types'; +import { ARTFetchNode, CacheTrace, LoadStats, QueryPlan } from './types'; const initialPaneWidth = 360; +export const minimumVisibleDurationNs = (durationNs?: number) => Math.max(durationNs ?? 0, 1000); + export const TraceContext = createContext<{ query?: string; subgraphs: { id: string; name: string }[]; @@ -25,6 +27,7 @@ export const TraceContext = createContext<{ planError?: string; clientValidationEnabled: boolean; setClientValidationEnabled: (val: boolean) => void; + forcedTheme?: 'light' | 'dark' | undefined; }>({ query: undefined, subgraphs: [], @@ -34,6 +37,7 @@ export const TraceContext = createContext<{ planError: '', clientValidationEnabled: true, setClientValidationEnabled: () => {}, + forcedTheme: undefined, }); const Trace = ({ @@ -100,6 +104,29 @@ const Trace = ({ let gEndTimeNano = BigInt(0); let executeDurationSinceStart = 0; + let plannerEndNs = 0; + + const parseCacheTrace = (ct: any): CacheTrace | undefined => { + if (!ct) return undefined; + return { + l1Enabled: ct.l1_enabled, + l2Enabled: ct.l2_enabled, + cacheName: ct.cache_name, + ttlSeconds: ct.ttl_seconds, + entityCount: ct.entity_count ?? 0, + l1Hit: ct.l1_hit, + l1Miss: ct.l1_miss, + l2Hit: ct.l2_hit, + l2Miss: ct.l2_miss, + durationSinceStart: ct.duration_since_start_nanoseconds, + durationSinceStartPretty: ct.duration_since_start_pretty, + duration: ct.duration_nanoseconds, + durationPretty: ct.duration_pretty, + l2GetDurationPretty: ct.l2_get_duration_pretty, + l2SetDurationPretty: ct.l2_set_duration_pretty, + keys: ct.keys, + }; + }; const fetchMap = new Map(); @@ -146,6 +173,8 @@ const Trace = ({ fetchNode.loadStats = mappedData; } + fetchNode.cacheTrace = parseCacheTrace(fetch.datasource_load_trace?.cache_trace); + const fetchOutputTrace = fetch.datasource_load_trace?.output?.extensions?.trace; if (fetchOutputTrace) { fetchNode.outputTrace = { @@ -231,12 +260,25 @@ const Trace = ({ const parseFetchNew = (fetch: any, parentId?: string): ARTFetchNode | undefined => { if (!fetch) return; + let sourceName = fetch.source_name; + + if (!sourceName) { + // Fallback when subgraphs is set on the context. Only need as a fallback for old routers + const source = subgraphs?.find((s) => s.id === fetch.source_id); + if (source) { + sourceName = source.name; + } else { + // For old routers that didn't send the subgraph name and when subgraphs is not set on the context + sourceName = 'subgraph'; + } + } + const fetchNode: ARTFetchNode = { id: crypto.randomUUID(), parentId, type: fetch.kind, dataSourceId: fetch.source_id, - dataSourceName: subgraphs?.find((s) => s.id === fetch.source_id)?.name ?? 'subgraph', + dataSourceName: sourceName, input: fetch.trace?.input, rawInput: fetch.trace?.raw_input_data, output: fetch.trace?.output, @@ -275,6 +317,15 @@ const Trace = ({ fetchNode.loadStats = mappedData; } + fetchNode.cacheTrace = parseCacheTrace(fetch.trace?.cache_trace); + + // For cache hits with no load timing, synthesize timing from cache trace data + if (!fetchNode.durationSinceStart && fetchNode.cacheTrace) { + const ct = fetch.trace?.cache_trace; + fetchNode.durationSinceStart = ct?.duration_since_start_nanoseconds ?? plannerEndNs; + fetchNode.durationLoad = minimumVisibleDurationNs(ct?.duration_nanoseconds); // minimum 1µs so the bar is visible + } + const fetchOutputTrace = fetch.trace?.output?.extensions?.trace; if (fetchOutputTrace) { fetchNode.outputTrace = { @@ -360,6 +411,7 @@ const Trace = ({ const normalizeStats = parsedResponse.extensions.trace.info.normalize_stats; const validateStats = parsedResponse.extensions.trace.info.validate_stats; const plannerStats = parsedResponse.extensions.trace.info.planner_stats; + plannerEndNs = plannerStats.duration_since_start_nanoseconds + plannerStats.duration_nanoseconds; const parse = { id: 'parse', @@ -443,6 +495,15 @@ const Trace = ({ }, }); + // When no fetch had load timing data (e.g. all served from cache), + // gEndTimeNano was never updated. Estimate from the planner phase end. + if (gEndTimeNano <= gStartTimeNano) { + gEndTimeNano = gStartTimeNano + BigInt(plannerEndNs); + } + if (!executeDurationSinceStart) { + executeDurationSinceStart = plannerEndNs; + } + const execute = { id: 'execute', type: 'execute', @@ -589,6 +650,10 @@ export const TraceView = () => { } }, [headers, activeResponse]); + const hasTrace = hasTraceHeader && hasTraceInResponse; + + const [view, setView] = useState<'tree' | 'waterfall'>('waterfall'); + const isSubscription = useMemo(() => { try { const parsed = parse(query ?? ''); @@ -603,10 +668,6 @@ export const TraceView = () => { } }, [query]); - const hasTrace = hasTraceHeader && hasTraceInResponse; - - const [view, setView] = useState<'tree' | 'waterfall'>('tree'); - if (isSubscription) { return ( { } title="No trace found" - description="Include the below header before executing your queries. Router version 0.42.1 or above is required." - actions={} + description="Please ensure the below are configured correctly" + actions={ + + } /> ); } @@ -641,7 +715,7 @@ export const TraceView = () => { return (
- setView(v)}> + setView(v)}>
diff --git a/studio/src/components/playground/types.ts b/studio/src/components/playground/types.ts index 698247ba27..e652e0c593 100644 --- a/studio/src/components/playground/types.ts +++ b/studio/src/components/playground/types.ts @@ -18,7 +18,9 @@ export type TabsState = { activeTabIndex: number; }; -export type PlaygroundView = 'response' | 'request-trace' | 'query-plan'; +export type PlaygroundView = 'response' | 'request-trace' | 'query-plan' | 'cache-explorer'; + +export type CacheMode = 'enabled' | 'no-l1' | 'no-l2' | 'disabled'; type PlaygroundContextType = { graphId: string; @@ -27,6 +29,8 @@ type PlaygroundContextType = { statusText?: string; view: PlaygroundView; setView: (val: PlaygroundView) => void; + cacheMode: CacheMode; + setCacheMode: (val: CacheMode) => void; isHydrated: boolean; setIsHydrated: (v: boolean) => void; }; @@ -36,10 +40,54 @@ export const PlaygroundContext = createContext({ tabsState: { tabs: [], activeTabIndex: 0 }, view: 'response', setView: () => {}, + cacheMode: 'enabled', + setCacheMode: () => {}, isHydrated: false, setIsHydrated: () => {}, }); +export type CacheTrace = { + l1Enabled: boolean; + l2Enabled: boolean; + cacheName: string; + ttlSeconds: number; + entityCount: number; + l1Hit: number; + l1Miss: number; + l2Hit: number; + l2Miss: number; + durationSinceStart?: number; + durationSinceStartPretty?: string; + duration?: number; + durationPretty?: string; + l2GetDurationPretty?: string; + l2SetDurationPretty?: string; + keys?: string[]; +}; + +export type CacheStatus = 'l1-hit' | 'l2-hit' | 'miss' | 'no-lookup'; + +export const getCacheStatus = (ct: CacheTrace): CacheStatus => { + if (ct.l1Hit > 0) return 'l1-hit'; + if (ct.l2Hit > 0) return 'l2-hit'; + if (ct.l1Miss > 0 || ct.l2Miss > 0) return 'miss'; + return 'no-lookup'; +}; + +export const getCacheStatusLabel = (ct: CacheTrace): string => { + const status = getCacheStatus(ct); + switch (status) { + case 'l1-hit': + return 'L1 HIT'; + case 'l2-hit': + return 'L2 HIT'; + case 'miss': + return 'MISS'; + case 'no-lookup': + return 'NO LOOKUP'; + } +}; + export type LoadStatsEntry = { name: string; durationSinceStart: string; @@ -78,6 +126,7 @@ export type ARTFetchNode = { singleFlightSharedResponse: boolean; loadSkipped: boolean; loadStats?: LoadStats; + cacheTrace?: CacheTrace; }; export type Representation = { diff --git a/studio/src/components/playground/view-cache.tsx b/studio/src/components/playground/view-cache.tsx new file mode 100644 index 0000000000..72a1bca226 --- /dev/null +++ b/studio/src/components/playground/view-cache.tsx @@ -0,0 +1,92 @@ +import { cn } from '@/lib/utils'; +import { CodeViewer } from '../code-viewer'; +import { Button } from '../ui/button'; +import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '../ui/dialog'; +import { CacheTrace, getCacheStatus, getCacheStatusLabel } from './types'; + +export const ViewCache = ({ cacheTrace, asChild }: { cacheTrace: CacheTrace; asChild?: boolean }) => { + const status = getCacheStatus(cacheTrace); + const isHit = status === 'l1-hit' || status === 'l2-hit'; + + return ( + + + {asChild ? ( + + ) : ( + 'View Cache' + )} + + + + Entity Cache + +
+
+

Status

+

+ Result:{' '} + + {getCacheStatusLabel(cacheTrace)} + +

+

Entities: {cacheTrace.entityCount}

+
+
+

Configuration

+

Cache Name: {cacheTrace.cacheName}

+

TTL: {cacheTrace.ttlSeconds}s

+

L1 Enabled: {cacheTrace.l1Enabled ? 'Yes' : 'No'}

+

L2 Enabled: {cacheTrace.l2Enabled ? 'Yes' : 'No'}

+
+
+

Statistics

+

+ L1: {cacheTrace.l1Hit} hit / {cacheTrace.l1Miss} miss +

+

+ L2: {cacheTrace.l2Hit} hit / {cacheTrace.l2Miss} miss +

+ {cacheTrace.durationPretty && ( +

Cache Duration: {cacheTrace.durationPretty}

+ )} + {cacheTrace.l2GetDurationPretty && ( +

L2 Get: {cacheTrace.l2GetDurationPretty}

+ )} + {cacheTrace.l2SetDurationPretty && ( +

L2 Set: {cacheTrace.l2SetDurationPretty}

+ )} +
+ {cacheTrace.keys && cacheTrace.keys.length > 0 && ( +
+

Cache Keys ({cacheTrace.keys.length})

+
+ { + try { + return JSON.parse(k); + } catch { + return k; + } + }), + null, + 2, + )} + language="json" + /> +
+
+ )} +
+
+
+ ); +}; diff --git a/studio/src/pages/[organizationSlug]/[namespace]/graph/[slug]/playground.tsx b/studio/src/pages/[organizationSlug]/[namespace]/graph/[slug]/playground.tsx index 1620d134bf..49fd194570 100644 --- a/studio/src/pages/[organizationSlug]/[namespace]/graph/[slug]/playground.tsx +++ b/studio/src/pages/[organizationSlug]/[namespace]/graph/[slug]/playground.tsx @@ -8,10 +8,13 @@ import { detachPlaygroundAPI, PreFlightScript, } from '@/components/playground/custom-scripts'; +import { CacheExplorerView } from '@/components/playground/cache-explorer-view'; +import { cacheExplorerController } from '@/components/playground/cache-explorer-controller'; +import type { CacheExplorerConfig } from '@/components/playground/cache-explorer-runner'; import { PlanView } from '@/components/playground/plan-view'; import { SharePlaygroundModal } from '@/components/playground/share-playground-modal'; import { TraceContext, TraceView } from '@/components/playground/trace-view'; -import { PlaygroundContext, PlaygroundView, QueryPlan, TabsState } from '@/components/playground/types'; +import { CacheMode, PlaygroundContext, PlaygroundView, QueryPlan, TabsState } from '@/components/playground/types'; import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; @@ -70,11 +73,12 @@ import { GraphQLSchema, parse, validate } from 'graphql'; import { useTheme } from 'next-themes'; import { useRouter } from 'next/router'; import posthog from 'posthog-js'; -import { createContext, PropsWithChildren, ReactNode, useContext, useEffect, useMemo, useState } from 'react'; +import { createContext, PropsWithChildren, ReactNode, useContext, useEffect, useMemo, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; +import { BoltIcon } from '@heroicons/react/24/solid'; import { FaNetworkWired } from 'react-icons/fa'; import { FiSave } from 'react-icons/fi'; -import { LuLayoutDashboard } from 'react-icons/lu'; +import { LuActivity, LuLayoutDashboard } from 'react-icons/lu'; import { MdOutlineFeaturedPlayList } from 'react-icons/md'; import { PiBracketsCurly, PiDevices, PiGraphLight } from 'react-icons/pi'; import { TbDevicesCheck } from 'react-icons/tb'; @@ -187,6 +191,27 @@ const executePostScripts = async (graphId: string, requestBody: any, responseBod } }; +export const applyCacheModeHeaders = (headersJson: string | undefined, cacheMode: CacheMode): string => { + try { + const parsed = JSON.parse(headersJson || '{}'); + delete parsed['X-WG-Disable-Entity-Cache']; + delete parsed['X-WG-Disable-Entity-Cache-L1']; + delete parsed['X-WG-Disable-Entity-Cache-L2']; + + if (cacheMode === 'disabled') { + parsed['X-WG-Disable-Entity-Cache'] = 'true'; + } else if (cacheMode === 'no-l1') { + parsed['X-WG-Disable-Entity-Cache-L1'] = 'true'; + } else if (cacheMode === 'no-l2') { + parsed['X-WG-Disable-Entity-Cache-L2'] = 'true'; + } + + return JSON.stringify(parsed, null, 2); + } catch { + return headersJson ?? ''; + } +}; + const graphiQLFetch = async ( onFetch: any, graphRequestToken: string, @@ -195,6 +220,8 @@ const graphiQLFetch = async ( url: URL, init: RequestInit, graphId: string, + cacheMode?: CacheMode, + view?: PlaygroundView, featureFlagName?: string, ) => { try { @@ -202,6 +229,18 @@ const graphiQLFetch = async ( ...(init.headers as Record), }; + // Inject entity cache control headers based on cache mode + delete headers['X-WG-Disable-Entity-Cache']; + delete headers['X-WG-Disable-Entity-Cache-L1']; + delete headers['X-WG-Disable-Entity-Cache-L2']; + if (cacheMode === 'disabled') { + headers['X-WG-Disable-Entity-Cache'] = 'true'; + } else if (cacheMode === 'no-l1') { + headers['X-WG-Disable-Entity-Cache-L1'] = 'true'; + } else if (cacheMode === 'no-l2') { + headers['X-WG-Disable-Entity-Cache-L2'] = 'true'; + } + headers = substituteHeadersFromEnv(headers, graphId); validateHeaders(headers); @@ -224,6 +263,35 @@ const graphiQLFetch = async ( headers['X-Feature-Flag'] = featureFlagName; } + // Cache Explorer intercept: if we're in cache-explorer view AND the user + // explicitly clicked the play button (trigger gate), dispatch to the + // explorer controller. Without the gate, GraphiQL's auto-refetch on + // header/query edits would re-launch the benchmark unintentionally. + if (view === 'cache-explorer') { + const trigger = (window as any).__cacheExplorerTrigger; + if (trigger) { + (window as any).__cacheExplorerTrigger = false; + const body = JSON.parse(init.body as string); + const explorerConfig: CacheExplorerConfig = { + url: url.toString(), + query: body.query, + variables: body.variables ? JSON.stringify(body.variables) : undefined, + operationName: body.operationName, + headers, + iterations: (window as any).__cacheExplorerConfig?.iterations ?? 10, + cacheMode: cacheMode || 'enabled', + }; + // Fire and forget — the controller emits state via its subscription. + cacheExplorerController.start(explorerConfig); + } + const synthetic = new Response( + JSON.stringify({ data: null, extensions: { cacheExplorer: { status: 'running' } } }), + { headers: { 'Content-Type': 'application/json' } }, + ); + onFetch(await synthetic.clone().json(), 200, 'OK'); + return synthetic; + } + if (schema && clientValidationEnabled) { const query = JSON.parse(init.body as string)?.query; const errors = validate(schema, parse(query)); @@ -490,6 +558,117 @@ const PersistOperation = () => { ); }; +type CacheSummary = { hits: number; total: number } | null; + +const collectCacheSummary = (fetches: any): CacheSummary => { + if (!fetches) return null; + + let hits = 0; + let total = 0; + + const walkFetch = (node: any) => { + if (!node) return; + + const trace = node.trace || node.datasource_load_trace; + + // Count every fetch that has a trace (i.e., a real datasource fetch). + if (trace) { + total++; + if (trace.load_skipped) { + // Skipped fetches (e.g., @requestScoped L1 injection) count as cache hits. + hits++; + } else { + const ct = trace.cache_trace; + if (ct && (ct.l1_hit > 0 || ct.l2_hit > 0)) { + hits++; + } + } + } + + const children = node.children || node.fetches || node.traces; + if (children) { + for (const child of children) { + walkFetch(child.fetch || child); + } + } + }; + + walkFetch(fetches); + return total > 0 ? { hits, total } : null; +}; + +const CacheBadge = ({ hits, total }: { hits: number; total: number }) => { + const pct = Math.round((hits / total) * 100); + const allHit = hits === total; + const noneHit = hits === 0; + + return ( + + +
+ + + {hits}/{total} Cached + +
+
+ + {allHit + ? 'All fetches served from cache' + : noneHit + ? 'No cache hits' + : `${hits} of ${total} fetches served from cache`} + +
+ ); +}; + +const cacheModeLabels: Record = { + enabled: 'Caching enabled', + 'no-l1': 'Caching (L2 only)', + 'no-l2': 'Caching (L1 only)', + disabled: 'Caching disabled', +}; + +const cacheModeColors: Record = { + enabled: 'border-success/50 bg-success/10 text-success', + 'no-l1': 'border-orange-500/50 bg-orange-500/10 text-orange-500', + 'no-l2': 'border-orange-500/50 bg-orange-500/10 text-orange-500', + disabled: 'border-destructive/50 bg-destructive/10 text-destructive', +}; + +const CacheControl = () => { + const { cacheMode, setCacheMode } = useContext(PlaygroundContext); + + return ( + + ); +}; + const ResponseToolbar = () => { const { view, setView } = useContext(PlaygroundContext); @@ -500,34 +679,38 @@ const ResponseToolbar = () => { const plan = document.getElementById('planner-visualization') as HTMLDivElement; - if (!response || !art || !plan) { + const explorer = document.getElementById('cache-explorer-visualization') as HTMLDivElement; + + if (!response || !art || !plan || !explorer) { return; } - if (val === 'request-trace') { - response.classList.add('invisible'); - response.classList.add('-z-50'); - plan.classList.add('invisible'); - plan.classList.add('-z-50'); + const hide = (el: HTMLDivElement) => { + el.classList.add('invisible'); + el.classList.add('-z-50'); + }; + const show = (el: HTMLDivElement) => { + el.classList.remove('invisible'); + el.classList.remove('-z-50'); + }; - art.classList.remove('invisible'); - art.classList.remove('-z-50'); - } else if (val === 'query-plan') { - response.classList.add('invisible'); - response.classList.add('-z-50'); - art.classList.add('invisible'); - art.classList.add('-z-50'); + // Hide all first + hide(art); + hide(plan); + hide(explorer); + response.classList.add('invisible'); + response.classList.add('-z-50'); - plan.classList.remove('invisible'); - plan.classList.remove('-z-50'); + // Then show the chosen one + if (val === 'request-trace') { + show(art); + } else if (val === 'query-plan') { + show(plan); + } else if (val === 'cache-explorer') { + show(explorer); } else { response.classList.remove('invisible'); response.classList.remove('-z-50'); - - art.classList.add('invisible'); - art.classList.add('-z-50'); - plan.classList.add('invisible'); - plan.classList.add('-z-50'); } setView(val); @@ -538,17 +721,35 @@ const ResponseToolbar = () => { return ; } else if (val === 'request-trace') { return ; + } else if (val === 'cache-explorer') { + return ; } else { return ; } }; const { status, statusText } = useContext(PlaygroundContext); + const { response } = useContext(TraceContext); + + const cacheSummary = useMemo(() => { + try { + const parsed = JSON.parse(response || '{}'); + // Skip introspection responses — they have __schema in data + if (parsed?.data?.__schema) return null; + const trace = parsed?.extensions?.trace; + if (!trace) return null; + return collectCacheSummary(trace.fetches || trace); + } catch { + return null; + } + }, [response]); const isSuccess = !!status && status >= 200 && status < 300; return (
+ + {cacheSummary && } {(status || statusText) && ( {!isSuccess && } @@ -583,6 +784,12 @@ const ResponseToolbar = () => { Query Plan
+ +
+ {getIcon('cache-explorer')} + Cache Explorer +
+
@@ -692,6 +899,7 @@ const PlaygroundPortal = () => { const responseToolbar = document.getElementById('response-toolbar'); const artDiv = document.getElementById('art-visualization'); const plannerDiv = document.getElementById('planner-visualization'); + const cacheExplorerDiv = document.getElementById('cache-explorer-visualization'); const saveDiv = document.getElementById('save-button'); const toggleClientValidation = document.getElementById('toggle-client-validation'); const scriptsSection = document.getElementById('scripts-section'); @@ -702,6 +910,7 @@ const PlaygroundPortal = () => { !responseToolbar || !artDiv || !plannerDiv || + !cacheExplorerDiv || !saveDiv || !toggleClientValidation || !scriptsSection || @@ -716,6 +925,7 @@ const PlaygroundPortal = () => { {createPortal(, responseToolbar)} {createPortal(, plannerDiv)} {createPortal(, artDiv)} + {createPortal(, cacheExplorerDiv)} {createPortal(, saveDiv)} {createPortal(, toggleClientValidation)} {createPortal(, scriptsSection)} @@ -806,6 +1016,21 @@ const PlaygroundPage: NextPageWithLayout = () => { const [isMounted, setIsMounted] = useState(false); const [view, setView] = useState('response'); + const viewRef = useRef(view); + viewRef.current = view; + + const [cacheMode, setCacheMode] = useState('enabled'); + const cacheModeRef = useRef(cacheMode); + cacheModeRef.current = cacheMode; + + // Sync cache mode into the visible headers JSON editor so users can see exactly + // which `X-WG-Disable-Entity-Cache*` headers get forwarded to the router. + useEffect(() => { + setHeaders((prev) => { + const next = applyCacheModeHeaders(prev, cacheMode); + return next !== prev ? next : prev; + }); + }, [cacheMode]); const [tabsState, setTabsState] = useState({ activeTabIndex: 0, @@ -911,8 +1136,13 @@ const PlaygroundPage: NextPageWithLayout = () => { plannerWrapper.id = 'planner-visualization'; plannerWrapper.className = 'flex flex-1 h-full w-full absolute invisible -z-50'; + const cacheExplorerWrapper = document.createElement('div'); + cacheExplorerWrapper.id = 'cache-explorer-visualization'; + cacheExplorerWrapper.className = 'flex flex-1 absolute inset-0 invisible -z-50 overflow-hidden'; + responseSectionParent.append(artWrapper); responseSectionParent.append(plannerWrapper); + responseSectionParent.append(cacheExplorerWrapper); } } @@ -992,6 +1222,8 @@ const PlaygroundPage: NextPageWithLayout = () => { args[0] as URL, args[1] as RequestInit, graphContext?.graph?.id || '', + cacheModeRef.current, + viewRef.current, type === 'featureFlag' ? (compositionFlagsData?.featureFlags ?? []).find((f) => f.id === loadSchemaGraphId)?.name : undefined, @@ -1118,6 +1350,8 @@ const PlaygroundPage: NextPageWithLayout = () => { statusText, view, setView, + cacheMode, + setCacheMode, isHydrated, setIsHydrated, }}