Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d0afaa7815 | |||
|
ee378dc6a3
|
|||
|
7ffa9a3881
|
|||
|
683bf6bd85
|
|||
|
17a3edbc07
|
|||
|
318e211196
|
|||
| bf0b8f5935 | |||
| 1232ca62b2 | |||
| f6a1e47361 | |||
| f96e6e860b | |||
| 44cc6ccd16 | |||
| 6abc49a3fc | |||
| 7d7836fedf | |||
|
f62a8037bc
|
|||
| 08bba81ba0 | |||
| 881ff122f8 | |||
| 0d384e8a3f | |||
|
f49156f637
|
|||
| 62869e4a77 | |||
| ab2c55fb39 | |||
| ef271a88a9 | |||
|
14d3733bf5
|
|||
| 2cc4e379bc | |||
| d39427c9ff | |||
| 2cb2ba9754 | |||
| 53d5c21b77 | |||
| 2b09f6c3c5 | |||
| 9f2be264c3 | |||
| 31e8d8cd49 | |||
| b4e4c9e2e3 | |||
| 35bf4eb6dc | |||
| 7ddca97cce | |||
| 3a78d90c4b | |||
|
84b7d2bf74
|
+8
-4
@@ -19,7 +19,7 @@ variables:
|
|||||||
|
|
||||||
check:
|
check:
|
||||||
stage: .pre
|
stage: .pre
|
||||||
image: golang:1.23.5@sha256:8c10f21bec412f08f73aa7b97ca5ac5f28a39d8a88030ad8a339fd0a781d72b4
|
image: amd64/golang:1.24.0@sha256:4a3f1013f696a1f86314902f2c9907fe712eabc91e911cc9fde4fdc57a16d35d
|
||||||
script:
|
script:
|
||||||
- go install mvdan.cc/gofumpt@latest
|
- go install mvdan.cc/gofumpt@latest
|
||||||
- go install golang.org/x/tools/cmd/goimports@latest
|
- go install golang.org/x/tools/cmd/goimports@latest
|
||||||
@@ -38,7 +38,7 @@ build:
|
|||||||
|
|
||||||
vulnerabilities:
|
vulnerabilities:
|
||||||
stage: build
|
stage: build
|
||||||
image: golang:1.23.5@sha256:8c10f21bec412f08f73aa7b97ca5ac5f28a39d8a88030ad8a339fd0a781d72b4
|
image: amd64/golang:1.24.0@sha256:4a3f1013f696a1f86314902f2c9907fe712eabc91e911cc9fde4fdc57a16d35d
|
||||||
script:
|
script:
|
||||||
- go install golang.org/x/vuln/cmd/govulncheck@latest
|
- go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||||
- govulncheck ./...
|
- govulncheck ./...
|
||||||
@@ -54,12 +54,15 @@ deploy-prod:
|
|||||||
- if: $CI_COMMIT_BRANCH == "main"
|
- if: $CI_COMMIT_BRANCH == "main"
|
||||||
environment:
|
environment:
|
||||||
name: prod
|
name: prod
|
||||||
|
resource_group: prod
|
||||||
|
|
||||||
check_release:
|
check_release:
|
||||||
stage: test
|
stage: test
|
||||||
image:
|
image:
|
||||||
name: goreleaser/goreleaser:v2.6.1@sha256:8577ee8e351783b8c89ce26c973c3dbd4f854121e0c5456893ea4c9a3a6d76ce
|
name: goreleaser/goreleaser:v2.7.0@sha256:41247b711fc423eddcd8395b998b9de5c7d169bfe99e6a474ba35e87896c1343
|
||||||
entrypoint: [ '' ]
|
entrypoint: [ '' ]
|
||||||
|
variables:
|
||||||
|
GOTOOLCHAIN: auto
|
||||||
script: |
|
script: |
|
||||||
goreleaser check
|
goreleaser check
|
||||||
goreleaser release --snapshot --clean
|
goreleaser release --snapshot --clean
|
||||||
@@ -69,13 +72,14 @@ release:
|
|||||||
needs:
|
needs:
|
||||||
- unbound_release_prepare_release
|
- unbound_release_prepare_release
|
||||||
image:
|
image:
|
||||||
name: goreleaser/goreleaser:v2.6.1@sha256:8577ee8e351783b8c89ce26c973c3dbd4f854121e0c5456893ea4c9a3a6d76ce
|
name: goreleaser/goreleaser:v2.7.0@sha256:41247b711fc423eddcd8395b998b9de5c7d169bfe99e6a474ba35e87896c1343
|
||||||
entrypoint: [ '' ]
|
entrypoint: [ '' ]
|
||||||
variables:
|
variables:
|
||||||
# Disable shallow cloning so that goreleaser can diff between tags to
|
# Disable shallow cloning so that goreleaser can diff between tags to
|
||||||
# generate a changelog.
|
# generate a changelog.
|
||||||
GIT_DEPTH: 0
|
GIT_DEPTH: 0
|
||||||
GITLAB_TOKEN: $GITLAB_CI_TOKEN
|
GITLAB_TOKEN: $GITLAB_CI_TOKEN
|
||||||
|
GOTOOLCHAIN: auto
|
||||||
# Only run this release job for tags, not every commit (for example).
|
# Only run this release job for tags, not every commit (for example).
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ repos:
|
|||||||
- --project
|
- --project
|
||||||
- unboundsoftware/schemas
|
- unboundsoftware/schemas
|
||||||
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
|
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
|
||||||
rev: v9.20.0
|
rev: v9.21.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: commitlint
|
- id: commitlint
|
||||||
stages: [ commit-msg ]
|
stages: [ commit-msg ]
|
||||||
@@ -37,11 +37,11 @@ repos:
|
|||||||
- id: go-test
|
- id: go-test
|
||||||
- id: gofumpt
|
- id: gofumpt
|
||||||
- repo: https://github.com/golangci/golangci-lint
|
- repo: https://github.com/golangci/golangci-lint
|
||||||
rev: v1.63.4
|
rev: v1.64.5
|
||||||
hooks:
|
hooks:
|
||||||
- id: golangci-lint-full
|
- id: golangci-lint-full
|
||||||
- repo: https://github.com/gitleaks/gitleaks
|
- repo: https://github.com/gitleaks/gitleaks
|
||||||
rev: v8.23.2
|
rev: v8.24.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: gitleaks
|
- id: gitleaks
|
||||||
exclude: '^ctl/generated.go|graph/generated/.*$|^graph/model/models_gen.go|^tools/.*$$'
|
exclude: '^ctl/generated.go|graph/generated/.*$|^graph/model/models_gen.go|^tools/.*$$'
|
||||||
|
|||||||
@@ -2,6 +2,33 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [0.2.0] - 2025-02-28
|
||||||
|
|
||||||
|
### 🚀 Features
|
||||||
|
|
||||||
|
- *(dependencies)* Add Eventsourced package group for updates
|
||||||
|
- *(sdlmerge)* Add shared types for GraphQL schema handling
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.64
|
||||||
|
- *(deps)* Update module github.com/alecthomas/kong to v1.7.0
|
||||||
|
- *(deps)* Update module github.com/khan/genqlient to v0.8.0
|
||||||
|
- *(deps)* Update module github.com/alecthomas/kong to v1.8.0
|
||||||
|
- *(ci)* Update golang image to improve compatibility
|
||||||
|
- *(ci)* Add resource group to production deployment configuration
|
||||||
|
- *(deps)* Update module github.com/alecthomas/kong to v1.8.1
|
||||||
|
- *(deps)* Update dependencies to latest versions
|
||||||
|
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.65
|
||||||
|
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.66
|
||||||
|
- *(deps)* Update eventsourced
|
||||||
|
- *(deps)* Update module github.com/vektah/gqlparser/v2 to v2.5.23
|
||||||
|
|
||||||
|
### ⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- *(go)* Update go version to 1.23.6 and remove toolchain
|
||||||
|
- *(docker)* Update base image architecture to amd64
|
||||||
|
|
||||||
## [0.1.1] - 2025-01-24
|
## [0.1.1] - 2025-01-24
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
### 🐛 Bug Fixes
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.23.5@sha256:8c10f21bec412f08f73aa7b97ca5ac5f28a39d8a88030ad8a339fd0a781d72b4 as modules
|
FROM amd64/golang:1.24.0@sha256:4a3f1013f696a1f86314902f2c9907fe712eabc91e911cc9fde4fdc57a16d35d as modules
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
ADD go.* /build
|
ADD go.* /build
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
module gitlab.com/unboundsoftware/schemas
|
module gitlab.com/unboundsoftware/schemas
|
||||||
|
|
||||||
go 1.22.5
|
go 1.23.6
|
||||||
|
|
||||||
toolchain go1.23.5
|
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/99designs/gqlgen v0.17.63
|
github.com/99designs/gqlgen v0.17.66
|
||||||
github.com/Khan/genqlient v0.7.0
|
github.com/Khan/genqlient v0.8.0
|
||||||
github.com/alecthomas/kong v1.6.1
|
github.com/alecthomas/kong v1.8.1
|
||||||
github.com/apex/log v1.9.0
|
github.com/apex/log v1.9.0
|
||||||
github.com/auth0/go-jwt-middleware/v2 v2.2.2
|
github.com/auth0/go-jwt-middleware/v2 v2.2.2
|
||||||
github.com/getsentry/sentry-go v0.31.1
|
github.com/getsentry/sentry-go v0.31.1
|
||||||
@@ -18,15 +16,15 @@ require (
|
|||||||
github.com/rs/cors v1.11.1
|
github.com/rs/cors v1.11.1
|
||||||
github.com/sparetimecoders/goamqp v0.3.1
|
github.com/sparetimecoders/goamqp v0.3.1
|
||||||
github.com/stretchr/testify v1.10.0
|
github.com/stretchr/testify v1.10.0
|
||||||
github.com/vektah/gqlparser/v2 v2.5.21
|
github.com/vektah/gqlparser/v2 v2.5.23
|
||||||
github.com/wundergraph/graphql-go-tools v1.67.4
|
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.160
|
||||||
gitlab.com/unboundsoftware/eventsourced/amqp v1.7.0
|
gitlab.com/unboundsoftware/eventsourced/amqp v1.8.0
|
||||||
gitlab.com/unboundsoftware/eventsourced/eventsourced v1.16.0
|
gitlab.com/unboundsoftware/eventsourced/eventsourced v1.17.0
|
||||||
gitlab.com/unboundsoftware/eventsourced/pg v1.15.0
|
gitlab.com/unboundsoftware/eventsourced/pg v1.16.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/agnivade/levenshtein v1.2.0 // indirect
|
github.com/agnivade/levenshtein v1.2.1 // indirect
|
||||||
github.com/buger/jsonparser v1.1.1 // indirect
|
github.com/buger/jsonparser v1.1.1 // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
|
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
|
||||||
@@ -35,13 +33,11 @@ require (
|
|||||||
github.com/google/uuid v1.6.0 // indirect
|
github.com/google/uuid v1.6.0 // indirect
|
||||||
github.com/gorilla/websocket v1.5.1 // indirect
|
github.com/gorilla/websocket v1.5.1 // indirect
|
||||||
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
||||||
github.com/jensneuse/byte-template v0.0.0-20200214152254-4f3cf06e5c68 // indirect
|
|
||||||
github.com/lib/pq v1.10.9 // indirect
|
github.com/lib/pq v1.10.9 // indirect
|
||||||
github.com/mfridman/interpolate v0.0.2 // indirect
|
github.com/mfridman/interpolate v0.0.2 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/rabbitmq/amqp091-go v1.10.0 // indirect
|
github.com/rabbitmq/amqp091-go v1.10.0 // indirect
|
||||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||||
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
|
|
||||||
github.com/sethvargo/go-retry v0.3.0 // indirect
|
github.com/sethvargo/go-retry v0.3.0 // indirect
|
||||||
github.com/sosodev/duration v1.3.1 // indirect
|
github.com/sosodev/duration v1.3.1 // indirect
|
||||||
github.com/tidwall/gjson v1.17.0 // indirect
|
github.com/tidwall/gjson v1.17.0 // indirect
|
||||||
@@ -49,13 +45,14 @@ require (
|
|||||||
github.com/tidwall/pretty v1.2.1 // indirect
|
github.com/tidwall/pretty v1.2.1 // indirect
|
||||||
github.com/tidwall/sjson v1.2.5 // indirect
|
github.com/tidwall/sjson v1.2.5 // indirect
|
||||||
github.com/urfave/cli/v2 v2.27.5 // indirect
|
github.com/urfave/cli/v2 v2.27.5 // indirect
|
||||||
|
github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083 // indirect
|
||||||
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
|
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
|
||||||
go.uber.org/multierr v1.11.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
golang.org/x/mod v0.20.0 // indirect
|
golang.org/x/mod v0.23.0 // indirect
|
||||||
golang.org/x/net v0.33.0 // indirect
|
golang.org/x/net v0.35.0 // indirect
|
||||||
golang.org/x/sync v0.10.0 // indirect
|
golang.org/x/sync v0.11.0 // indirect
|
||||||
golang.org/x/sys v0.28.0 // indirect
|
golang.org/x/sys v0.30.0 // indirect
|
||||||
golang.org/x/text v0.21.0 // indirect
|
golang.org/x/text v0.22.0 // indirect
|
||||||
golang.org/x/tools v0.24.0 // indirect
|
golang.org/x/tools v0.30.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
||||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||||
github.com/99designs/gqlgen v0.17.63 h1:HCdaYDPd9HqUXRchEvmE3EFzELRwLlaJ8DBuyC8Cqto=
|
github.com/99designs/gqlgen v0.17.66 h1:2/SRc+h3115fCOZeTtsqrB5R5gTGm+8qCAwcrZa+CXA=
|
||||||
github.com/99designs/gqlgen v0.17.63/go.mod h1:sVCM2iwIZisJjTI/DEC3fpH+HFgxY1496ZJ+jbT9IjA=
|
github.com/99designs/gqlgen v0.17.66/go.mod h1:gucrb5jK5pgCKzAGuOMMVU9C8PnReecHEHd2UxLQwCg=
|
||||||
github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU=
|
github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU=
|
||||||
github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU=
|
github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU=
|
||||||
github.com/Khan/genqlient v0.7.0 h1:GZ1meyRnzcDTK48EjqB8t3bcfYvHArCUUvgOwpz1D4w=
|
github.com/Khan/genqlient v0.8.0 h1:Hd1a+E1CQHYbMEKakIkvBH3zW0PWEeiX6Hp1i2kP2WE=
|
||||||
github.com/Khan/genqlient v0.7.0/go.mod h1:HNyy3wZvuYwmW3Y7mkoQLZsa/R5n5yIRajS1kPBvSFM=
|
github.com/Khan/genqlient v0.8.0/go.mod h1:hn70SpYjWteRGvxTwo0kfaqg4wxvndECGkfa1fdDdYI=
|
||||||
github.com/PuerkitoBio/goquery v1.9.3 h1:mpJr/ikUA9/GNJB/DBZcGeFDXUtosHRyRrwh7KGdTG0=
|
github.com/PuerkitoBio/goquery v1.9.3 h1:mpJr/ikUA9/GNJB/DBZcGeFDXUtosHRyRrwh7KGdTG0=
|
||||||
github.com/PuerkitoBio/goquery v1.9.3/go.mod h1:1ndLHPdTz+DyQPICCWYlYQMPl0oXZj0G6D4LCYA6u4U=
|
github.com/PuerkitoBio/goquery v1.9.3/go.mod h1:1ndLHPdTz+DyQPICCWYlYQMPl0oXZj0G6D4LCYA6u4U=
|
||||||
github.com/agnivade/levenshtein v1.2.0 h1:U9L4IOT0Y3i0TIlUIDJ7rVUziKi/zPbrJGaFrtYH3SY=
|
github.com/agnivade/levenshtein v1.2.1 h1:EHBY3UOn1gwdy/VbFwgo4cxecRznFk7fKWN1KOX7eoM=
|
||||||
github.com/agnivade/levenshtein v1.2.0/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU=
|
github.com/agnivade/levenshtein v1.2.1/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU=
|
||||||
github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0=
|
github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0=
|
||||||
github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
|
github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
|
||||||
github.com/alecthomas/kong v1.6.1 h1:/7bVimARU3uxPD0hbryPE8qWrS3Oz3kPQoxA/H2NKG8=
|
github.com/alecthomas/kong v1.8.1 h1:6aamvWBE/REnR/BCq10EcozmcpUPc5aGI1lPAWdB0EE=
|
||||||
github.com/alecthomas/kong v1.6.1/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU=
|
github.com/alecthomas/kong v1.8.1/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU=
|
||||||
github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc=
|
github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc=
|
||||||
github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||||
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
|
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
|
||||||
@@ -44,8 +44,6 @@ github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54 h1:SG7nF6SRlWhcT7c
|
|||||||
github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
|
github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
|
||||||
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
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/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||||
github.com/evanphx/json-patch/v5 v5.1.0 h1:B0aXl1o/1cP8NbviYiBMkcHBtUjIJ1/Ccg6b+SwCLQg=
|
|
||||||
github.com/evanphx/json-patch/v5 v5.1.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
|
|
||||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||||
github.com/getsentry/sentry-go v0.31.1 h1:ELVc0h7gwyhnXHDouXkhqTFSO5oslsRDk0++eyE0KJ4=
|
github.com/getsentry/sentry-go v0.31.1 h1:ELVc0h7gwyhnXHDouXkhqTFSO5oslsRDk0++eyE0KJ4=
|
||||||
@@ -59,8 +57,6 @@ github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIx
|
|||||||
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
|
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
|
||||||
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
|
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
|
||||||
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
|
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
|
||||||
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
|
|
||||||
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
|
|
||||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
@@ -75,8 +71,6 @@ github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyf
|
|||||||
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
|
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
|
||||||
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
|
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
|
||||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||||
github.com/jensneuse/byte-template v0.0.0-20200214152254-4f3cf06e5c68 h1:E80wOd3IFQcoBxLkAUpUQ3BoGrZ4DxhQdP21+HH1s6A=
|
|
||||||
github.com/jensneuse/byte-template v0.0.0-20200214152254-4f3cf06e5c68/go.mod h1:0D5r/VSW6D/o65rKLL9xk7sZxL2+oku2HvFPYeIMFr4=
|
|
||||||
github.com/jensneuse/diffview v1.0.0 h1:4b6FQJ7y3295JUHU3tRko6euyEboL825ZsXeZZM47Z4=
|
github.com/jensneuse/diffview v1.0.0 h1:4b6FQJ7y3295JUHU3tRko6euyEboL825ZsXeZZM47Z4=
|
||||||
github.com/jensneuse/diffview v1.0.0/go.mod h1:i6IacuD8LnEaPuiyzMHA+Wfz5mAuycMOf3R/orUY9y4=
|
github.com/jensneuse/diffview v1.0.0/go.mod h1:i6IacuD8LnEaPuiyzMHA+Wfz5mAuycMOf3R/orUY9y4=
|
||||||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
|
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
|
||||||
@@ -127,10 +121,8 @@ github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA=
|
|||||||
github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
|
github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
|
||||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQo=
|
github.com/sanity-io/litter v1.5.8 h1:uM/2lKrWdGbRXDrIq08Lh9XtVYoeGtcQxk9rtQ7+rYg=
|
||||||
github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U=
|
github.com/sanity-io/litter v1.5.8/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U=
|
||||||
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4=
|
|
||||||
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY=
|
|
||||||
github.com/sebdah/goldie/v2 v2.5.3 h1:9ES/mNN+HNUbNWpVAlrzuZ7jE+Nrczbj8uFRjM7624Y=
|
github.com/sebdah/goldie/v2 v2.5.3 h1:9ES/mNN+HNUbNWpVAlrzuZ7jE+Nrczbj8uFRjM7624Y=
|
||||||
github.com/sebdah/goldie/v2 v2.5.3/go.mod h1:oZ9fp0+se1eapSRjfYbsV/0Hqhbuu3bJVvKI/NNtssI=
|
github.com/sebdah/goldie/v2 v2.5.3/go.mod h1:oZ9fp0+se1eapSRjfYbsV/0Hqhbuu3bJVvKI/NNtssI=
|
||||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||||
@@ -146,14 +138,8 @@ github.com/sosodev/duration v1.3.1/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERA
|
|||||||
github.com/sparetimecoders/goamqp v0.3.1 h1:NCzdyAz84G679HlO+ivhyoI1aMgXEe3qfqpn4EChu1s=
|
github.com/sparetimecoders/goamqp v0.3.1 h1:NCzdyAz84G679HlO+ivhyoI1aMgXEe3qfqpn4EChu1s=
|
||||||
github.com/sparetimecoders/goamqp v0.3.1/go.mod h1:PjkgrmsuMVgRbiQDTLs0pCWYrcQgqcUee38JjCDZdlk=
|
github.com/sparetimecoders/goamqp v0.3.1/go.mod h1:PjkgrmsuMVgRbiQDTLs0pCWYrcQgqcUee38JjCDZdlk=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
|
||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
|
||||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
|
||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
|
||||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
|
||||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||||
@@ -175,49 +161,51 @@ github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPf
|
|||||||
github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4=
|
github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4=
|
||||||
github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w=
|
github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w=
|
||||||
github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
|
github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
|
||||||
github.com/vektah/gqlparser/v2 v2.5.21 h1:Zw1rG2dr1pRR4wqwbVq4d6+xk2f4ut/yo+hwr4QjE08=
|
github.com/vektah/gqlparser/v2 v2.5.23 h1:PurJ9wpgEVB7tty1seRUwkIDa/QH5RzkzraiKIjKLfA=
|
||||||
github.com/vektah/gqlparser/v2 v2.5.21/go.mod h1:xMl+ta8a5M1Yo1A1Iwt/k7gSpscwSnHZdw7tfhEGfTM=
|
github.com/vektah/gqlparser/v2 v2.5.23/go.mod h1:D1/VCZtV3LPnQrcPBeR/q5jkSQIPti0uYCP/RI0gIeo=
|
||||||
github.com/wundergraph/graphql-go-tools v1.67.4 h1:1QtoftaZz5sScV/J6XLZ/oTfi1lMHp6UmFkYRQfY2/g=
|
github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083 h1:8/D7f8gKxTBjW+SZK4mhxTTBVpxcqeBgWF1Rfmltbfk=
|
||||||
github.com/wundergraph/graphql-go-tools v1.67.4/go.mod h1:UFvflYjB/qnSCdgcHQuE6dTfwZ6viJB7yPnGOtBuibo=
|
github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083/go.mod h1:eOTL6acwctsN4F3b7YE+eE2t8zcJ/doLm9sZzsxxxrE=
|
||||||
|
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.160 h1:whZcpumOJNwJg71M56VGZ/Ex4TnYeGjmzhWa6+1X+uI=
|
||||||
|
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.160/go.mod h1:B7eV0Qh8Lop9QzIOQcsvKp3S0ejfC6mgyWoJnI917yQ=
|
||||||
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
|
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
|
||||||
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
|
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
|
||||||
gitlab.com/unboundsoftware/eventsourced/amqp v1.7.0 h1:AyYVqo/2gNtgtx6Nq4USu9uH2MIE9pV5YXsMk5utdKw=
|
gitlab.com/unboundsoftware/eventsourced/amqp v1.8.0 h1:Ez3UuXvveyV/HlphqWUWZU/05DuhqKfgF9r6tCJigEI=
|
||||||
gitlab.com/unboundsoftware/eventsourced/amqp v1.7.0/go.mod h1:gmA1jjRBNPtOawpzwEkOABvRYE0rE187wSsBrCtnEBA=
|
gitlab.com/unboundsoftware/eventsourced/amqp v1.8.0/go.mod h1:HO9ZBFAvBNRhVS3hXPuGMW7zyENDfoqjLCUAzPWw3so=
|
||||||
gitlab.com/unboundsoftware/eventsourced/eventsourced v1.16.0 h1:M23pbqxgwFc+bzLKEio4lj+fRSDoWjp6QHOHzdRRtw4=
|
gitlab.com/unboundsoftware/eventsourced/eventsourced v1.17.0 h1:CWttfHbytJb7eZ1hflwYkQ7W/c9meHLOjjxguPeZm28=
|
||||||
gitlab.com/unboundsoftware/eventsourced/eventsourced v1.16.0/go.mod h1:UAf1o59zIANqyzFzcR7Z0pWp5rfd2wyz2XDSP4LJIdI=
|
gitlab.com/unboundsoftware/eventsourced/eventsourced v1.17.0/go.mod h1:KeLn3U67hxbdFLfeXd0c0LI/r1C5rijbWrfNdARWe98=
|
||||||
gitlab.com/unboundsoftware/eventsourced/pg v1.15.0 h1:wH74r4MIiLgFxV8U+aF6OfjpwBLjVmeWnd/dilgQmwY=
|
gitlab.com/unboundsoftware/eventsourced/pg v1.16.0 h1:n4ZoGseeBM/+12pRxMdNI0XYPaWghxPGJNcWbN30c0o=
|
||||||
gitlab.com/unboundsoftware/eventsourced/pg v1.15.0/go.mod h1:u3niHnTGKssMUyHxiMDkl6IUEED8qHyX1pKJyy5cRmk=
|
gitlab.com/unboundsoftware/eventsourced/pg v1.16.0/go.mod h1:zHnnTcR7xzh6Z/iZASZaDQpFsa8kefcXDbcMEeFFbNc=
|
||||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
|
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
|
||||||
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
|
||||||
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
|
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
|
||||||
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
|
||||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/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-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
|
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
|
||||||
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
|
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
|
||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
|
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
|
||||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
|
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
|
||||||
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||||
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
|
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
|
||||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
|
golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY=
|
||||||
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
|
golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
|
|||||||
+321
-76
@@ -767,6 +767,62 @@ func (ec *executionContext) field_Query_supergraph_argsIsAfter(
|
|||||||
return zeroVal, nil
|
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) {
|
func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
||||||
var err error
|
var err error
|
||||||
args := map[string]any{}
|
args := map[string]any{}
|
||||||
@@ -1835,6 +1891,8 @@ func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field
|
|||||||
return ec.fieldContext___Type_name(ctx, field)
|
return ec.fieldContext___Type_name(ctx, field)
|
||||||
case "description":
|
case "description":
|
||||||
return ec.fieldContext___Type_description(ctx, field)
|
return ec.fieldContext___Type_description(ctx, field)
|
||||||
|
case "specifiedByURL":
|
||||||
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
||||||
case "fields":
|
case "fields":
|
||||||
return ec.fieldContext___Type_fields(ctx, field)
|
return ec.fieldContext___Type_fields(ctx, field)
|
||||||
case "interfaces":
|
case "interfaces":
|
||||||
@@ -1847,8 +1905,8 @@ func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field
|
|||||||
return ec.fieldContext___Type_inputFields(ctx, field)
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
||||||
case "ofType":
|
case "ofType":
|
||||||
return ec.fieldContext___Type_ofType(ctx, field)
|
return ec.fieldContext___Type_ofType(ctx, field)
|
||||||
case "specifiedByURL":
|
case "isOneOf":
|
||||||
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
||||||
},
|
},
|
||||||
@@ -2633,6 +2691,50 @@ func (ec *executionContext) fieldContext___Directive_description(_ context.Conte
|
|||||||
return fc, nil
|
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) {
|
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)
|
fc, err := ec.fieldContext___Directive_locations(ctx, field)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -2708,7 +2810,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql
|
|||||||
return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
|
return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
fc = &graphql.FieldContext{
|
fc = &graphql.FieldContext{
|
||||||
Object: "__Directive",
|
Object: "__Directive",
|
||||||
Field: field,
|
Field: field,
|
||||||
@@ -2724,53 +2826,24 @@ func (ec *executionContext) fieldContext___Directive_args(_ context.Context, fie
|
|||||||
return ec.fieldContext___InputValue_type(ctx, field)
|
return ec.fieldContext___InputValue_type(ctx, field)
|
||||||
case "defaultValue":
|
case "defaultValue":
|
||||||
return ec.fieldContext___InputValue_defaultValue(ctx, field)
|
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 nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
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() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
ec.Error(ctx, ec.Recover(ctx, r))
|
err = ec.Recover(ctx, r)
|
||||||
ret = graphql.Null
|
ec.Error(ctx, err)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
ctx = graphql.WithFieldContext(ctx, fc)
|
||||||
ctx = rctx // use context from middleware stack in children
|
if fc.Args, err = ec.field___Directive_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
||||||
return obj.IsRepeatable, nil
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
ec.Error(ctx, err)
|
ec.Error(ctx, err)
|
||||||
return graphql.Null
|
return fc, err
|
||||||
}
|
|
||||||
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
|
return fc, nil
|
||||||
}
|
}
|
||||||
@@ -3061,7 +3134,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col
|
|||||||
return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
|
return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
fc = &graphql.FieldContext{
|
fc = &graphql.FieldContext{
|
||||||
Object: "__Field",
|
Object: "__Field",
|
||||||
Field: field,
|
Field: field,
|
||||||
@@ -3077,10 +3150,25 @@ func (ec *executionContext) fieldContext___Field_args(_ context.Context, field g
|
|||||||
return ec.fieldContext___InputValue_type(ctx, field)
|
return ec.fieldContext___InputValue_type(ctx, field)
|
||||||
case "defaultValue":
|
case "defaultValue":
|
||||||
return ec.fieldContext___InputValue_defaultValue(ctx, field)
|
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 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
|
return fc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3129,6 +3217,8 @@ func (ec *executionContext) fieldContext___Field_type(_ context.Context, field g
|
|||||||
return ec.fieldContext___Type_name(ctx, field)
|
return ec.fieldContext___Type_name(ctx, field)
|
||||||
case "description":
|
case "description":
|
||||||
return ec.fieldContext___Type_description(ctx, field)
|
return ec.fieldContext___Type_description(ctx, field)
|
||||||
|
case "specifiedByURL":
|
||||||
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
||||||
case "fields":
|
case "fields":
|
||||||
return ec.fieldContext___Type_fields(ctx, field)
|
return ec.fieldContext___Type_fields(ctx, field)
|
||||||
case "interfaces":
|
case "interfaces":
|
||||||
@@ -3141,8 +3231,8 @@ func (ec *executionContext) fieldContext___Field_type(_ context.Context, field g
|
|||||||
return ec.fieldContext___Type_inputFields(ctx, field)
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
||||||
case "ofType":
|
case "ofType":
|
||||||
return ec.fieldContext___Type_ofType(ctx, field)
|
return ec.fieldContext___Type_ofType(ctx, field)
|
||||||
case "specifiedByURL":
|
case "isOneOf":
|
||||||
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
||||||
},
|
},
|
||||||
@@ -3365,6 +3455,8 @@ func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, fi
|
|||||||
return ec.fieldContext___Type_name(ctx, field)
|
return ec.fieldContext___Type_name(ctx, field)
|
||||||
case "description":
|
case "description":
|
||||||
return ec.fieldContext___Type_description(ctx, field)
|
return ec.fieldContext___Type_description(ctx, field)
|
||||||
|
case "specifiedByURL":
|
||||||
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
||||||
case "fields":
|
case "fields":
|
||||||
return ec.fieldContext___Type_fields(ctx, field)
|
return ec.fieldContext___Type_fields(ctx, field)
|
||||||
case "interfaces":
|
case "interfaces":
|
||||||
@@ -3377,8 +3469,8 @@ func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, fi
|
|||||||
return ec.fieldContext___Type_inputFields(ctx, field)
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
||||||
case "ofType":
|
case "ofType":
|
||||||
return ec.fieldContext___Type_ofType(ctx, field)
|
return ec.fieldContext___Type_ofType(ctx, field)
|
||||||
case "specifiedByURL":
|
case "isOneOf":
|
||||||
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
||||||
},
|
},
|
||||||
@@ -3427,6 +3519,91 @@ func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Con
|
|||||||
return fc, nil
|
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) {
|
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)
|
fc, err := ec.fieldContext___Schema_description(ctx, field)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -3513,6 +3690,8 @@ func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field
|
|||||||
return ec.fieldContext___Type_name(ctx, field)
|
return ec.fieldContext___Type_name(ctx, field)
|
||||||
case "description":
|
case "description":
|
||||||
return ec.fieldContext___Type_description(ctx, field)
|
return ec.fieldContext___Type_description(ctx, field)
|
||||||
|
case "specifiedByURL":
|
||||||
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
||||||
case "fields":
|
case "fields":
|
||||||
return ec.fieldContext___Type_fields(ctx, field)
|
return ec.fieldContext___Type_fields(ctx, field)
|
||||||
case "interfaces":
|
case "interfaces":
|
||||||
@@ -3525,8 +3704,8 @@ func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field
|
|||||||
return ec.fieldContext___Type_inputFields(ctx, field)
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
||||||
case "ofType":
|
case "ofType":
|
||||||
return ec.fieldContext___Type_ofType(ctx, field)
|
return ec.fieldContext___Type_ofType(ctx, field)
|
||||||
case "specifiedByURL":
|
case "isOneOf":
|
||||||
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
||||||
},
|
},
|
||||||
@@ -3579,6 +3758,8 @@ func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, f
|
|||||||
return ec.fieldContext___Type_name(ctx, field)
|
return ec.fieldContext___Type_name(ctx, field)
|
||||||
case "description":
|
case "description":
|
||||||
return ec.fieldContext___Type_description(ctx, field)
|
return ec.fieldContext___Type_description(ctx, field)
|
||||||
|
case "specifiedByURL":
|
||||||
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
||||||
case "fields":
|
case "fields":
|
||||||
return ec.fieldContext___Type_fields(ctx, field)
|
return ec.fieldContext___Type_fields(ctx, field)
|
||||||
case "interfaces":
|
case "interfaces":
|
||||||
@@ -3591,8 +3772,8 @@ func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, f
|
|||||||
return ec.fieldContext___Type_inputFields(ctx, field)
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
||||||
case "ofType":
|
case "ofType":
|
||||||
return ec.fieldContext___Type_ofType(ctx, field)
|
return ec.fieldContext___Type_ofType(ctx, field)
|
||||||
case "specifiedByURL":
|
case "isOneOf":
|
||||||
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
||||||
},
|
},
|
||||||
@@ -3642,6 +3823,8 @@ func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context
|
|||||||
return ec.fieldContext___Type_name(ctx, field)
|
return ec.fieldContext___Type_name(ctx, field)
|
||||||
case "description":
|
case "description":
|
||||||
return ec.fieldContext___Type_description(ctx, field)
|
return ec.fieldContext___Type_description(ctx, field)
|
||||||
|
case "specifiedByURL":
|
||||||
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
||||||
case "fields":
|
case "fields":
|
||||||
return ec.fieldContext___Type_fields(ctx, field)
|
return ec.fieldContext___Type_fields(ctx, field)
|
||||||
case "interfaces":
|
case "interfaces":
|
||||||
@@ -3654,8 +3837,8 @@ func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context
|
|||||||
return ec.fieldContext___Type_inputFields(ctx, field)
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
||||||
case "ofType":
|
case "ofType":
|
||||||
return ec.fieldContext___Type_ofType(ctx, field)
|
return ec.fieldContext___Type_ofType(ctx, field)
|
||||||
case "specifiedByURL":
|
case "isOneOf":
|
||||||
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
||||||
},
|
},
|
||||||
@@ -3705,6 +3888,8 @@ func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Con
|
|||||||
return ec.fieldContext___Type_name(ctx, field)
|
return ec.fieldContext___Type_name(ctx, field)
|
||||||
case "description":
|
case "description":
|
||||||
return ec.fieldContext___Type_description(ctx, field)
|
return ec.fieldContext___Type_description(ctx, field)
|
||||||
|
case "specifiedByURL":
|
||||||
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
||||||
case "fields":
|
case "fields":
|
||||||
return ec.fieldContext___Type_fields(ctx, field)
|
return ec.fieldContext___Type_fields(ctx, field)
|
||||||
case "interfaces":
|
case "interfaces":
|
||||||
@@ -3717,8 +3902,8 @@ func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Con
|
|||||||
return ec.fieldContext___Type_inputFields(ctx, field)
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
||||||
case "ofType":
|
case "ofType":
|
||||||
return ec.fieldContext___Type_ofType(ctx, field)
|
return ec.fieldContext___Type_ofType(ctx, field)
|
||||||
case "specifiedByURL":
|
case "isOneOf":
|
||||||
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
||||||
},
|
},
|
||||||
@@ -3769,12 +3954,12 @@ func (ec *executionContext) fieldContext___Schema_directives(_ context.Context,
|
|||||||
return ec.fieldContext___Directive_name(ctx, field)
|
return ec.fieldContext___Directive_name(ctx, field)
|
||||||
case "description":
|
case "description":
|
||||||
return ec.fieldContext___Directive_description(ctx, field)
|
return ec.fieldContext___Directive_description(ctx, field)
|
||||||
|
case "isRepeatable":
|
||||||
|
return ec.fieldContext___Directive_isRepeatable(ctx, field)
|
||||||
case "locations":
|
case "locations":
|
||||||
return ec.fieldContext___Directive_locations(ctx, field)
|
return ec.fieldContext___Directive_locations(ctx, field)
|
||||||
case "args":
|
case "args":
|
||||||
return ec.fieldContext___Directive_args(ctx, field)
|
return ec.fieldContext___Directive_args(ctx, field)
|
||||||
case "isRepeatable":
|
|
||||||
return ec.fieldContext___Directive_isRepeatable(ctx, field)
|
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name)
|
||||||
},
|
},
|
||||||
@@ -3908,6 +4093,47 @@ func (ec *executionContext) fieldContext___Type_description(_ context.Context, f
|
|||||||
return fc, nil
|
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) {
|
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)
|
fc, err := ec.fieldContext___Type_fields(ctx, field)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -4016,6 +4242,8 @@ func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, fi
|
|||||||
return ec.fieldContext___Type_name(ctx, field)
|
return ec.fieldContext___Type_name(ctx, field)
|
||||||
case "description":
|
case "description":
|
||||||
return ec.fieldContext___Type_description(ctx, field)
|
return ec.fieldContext___Type_description(ctx, field)
|
||||||
|
case "specifiedByURL":
|
||||||
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
||||||
case "fields":
|
case "fields":
|
||||||
return ec.fieldContext___Type_fields(ctx, field)
|
return ec.fieldContext___Type_fields(ctx, field)
|
||||||
case "interfaces":
|
case "interfaces":
|
||||||
@@ -4028,8 +4256,8 @@ func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, fi
|
|||||||
return ec.fieldContext___Type_inputFields(ctx, field)
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
||||||
case "ofType":
|
case "ofType":
|
||||||
return ec.fieldContext___Type_ofType(ctx, field)
|
return ec.fieldContext___Type_ofType(ctx, field)
|
||||||
case "specifiedByURL":
|
case "isOneOf":
|
||||||
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
||||||
},
|
},
|
||||||
@@ -4079,6 +4307,8 @@ func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context,
|
|||||||
return ec.fieldContext___Type_name(ctx, field)
|
return ec.fieldContext___Type_name(ctx, field)
|
||||||
case "description":
|
case "description":
|
||||||
return ec.fieldContext___Type_description(ctx, field)
|
return ec.fieldContext___Type_description(ctx, field)
|
||||||
|
case "specifiedByURL":
|
||||||
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
||||||
case "fields":
|
case "fields":
|
||||||
return ec.fieldContext___Type_fields(ctx, field)
|
return ec.fieldContext___Type_fields(ctx, field)
|
||||||
case "interfaces":
|
case "interfaces":
|
||||||
@@ -4091,8 +4321,8 @@ func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context,
|
|||||||
return ec.fieldContext___Type_inputFields(ctx, field)
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
||||||
case "ofType":
|
case "ofType":
|
||||||
return ec.fieldContext___Type_ofType(ctx, field)
|
return ec.fieldContext___Type_ofType(ctx, field)
|
||||||
case "specifiedByURL":
|
case "isOneOf":
|
||||||
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
||||||
},
|
},
|
||||||
@@ -4206,6 +4436,10 @@ func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, f
|
|||||||
return ec.fieldContext___InputValue_type(ctx, field)
|
return ec.fieldContext___InputValue_type(ctx, field)
|
||||||
case "defaultValue":
|
case "defaultValue":
|
||||||
return ec.fieldContext___InputValue_defaultValue(ctx, field)
|
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 nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name)
|
||||||
},
|
},
|
||||||
@@ -4255,6 +4489,8 @@ func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field
|
|||||||
return ec.fieldContext___Type_name(ctx, field)
|
return ec.fieldContext___Type_name(ctx, field)
|
||||||
case "description":
|
case "description":
|
||||||
return ec.fieldContext___Type_description(ctx, field)
|
return ec.fieldContext___Type_description(ctx, field)
|
||||||
|
case "specifiedByURL":
|
||||||
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
||||||
case "fields":
|
case "fields":
|
||||||
return ec.fieldContext___Type_fields(ctx, field)
|
return ec.fieldContext___Type_fields(ctx, field)
|
||||||
case "interfaces":
|
case "interfaces":
|
||||||
@@ -4267,8 +4503,8 @@ func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field
|
|||||||
return ec.fieldContext___Type_inputFields(ctx, field)
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
||||||
case "ofType":
|
case "ofType":
|
||||||
return ec.fieldContext___Type_ofType(ctx, field)
|
return ec.fieldContext___Type_ofType(ctx, field)
|
||||||
case "specifiedByURL":
|
case "isOneOf":
|
||||||
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
||||||
},
|
},
|
||||||
@@ -4276,8 +4512,8 @@ func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field
|
|||||||
return fc, nil
|
return fc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
func (ec *executionContext) ___Type_isOneOf(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
||||||
fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field)
|
fc, err := ec.fieldContext___Type_isOneOf(ctx, field)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return graphql.Null
|
return graphql.Null
|
||||||
}
|
}
|
||||||
@@ -4290,7 +4526,7 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr
|
|||||||
}()
|
}()
|
||||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||||
ctx = rctx // use context from middleware stack in children
|
ctx = rctx // use context from middleware stack in children
|
||||||
return obj.SpecifiedByURL(), nil
|
return obj.IsOneOf(), nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ec.Error(ctx, err)
|
ec.Error(ctx, err)
|
||||||
@@ -4299,19 +4535,19 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr
|
|||||||
if resTmp == nil {
|
if resTmp == nil {
|
||||||
return graphql.Null
|
return graphql.Null
|
||||||
}
|
}
|
||||||
res := resTmp.(*string)
|
res := resTmp.(bool)
|
||||||
fc.Result = res
|
fc.Result = res
|
||||||
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
return ec.marshalOBoolean2bool(ctx, field.Selections, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
func (ec *executionContext) fieldContext___Type_isOneOf(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
fc = &graphql.FieldContext{
|
fc = &graphql.FieldContext{
|
||||||
Object: "__Type",
|
Object: "__Type",
|
||||||
Field: field,
|
Field: field,
|
||||||
IsMethod: true,
|
IsMethod: true,
|
||||||
IsResolver: false,
|
IsResolver: false,
|
||||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
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 nil, errors.New("field of type Boolean does not have child fields")
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return fc, nil
|
return fc, nil
|
||||||
@@ -4957,6 +5193,11 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS
|
|||||||
}
|
}
|
||||||
case "description":
|
case "description":
|
||||||
out.Values[i] = ec.___Directive_description(ctx, field, obj)
|
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":
|
case "locations":
|
||||||
out.Values[i] = ec.___Directive_locations(ctx, field, obj)
|
out.Values[i] = ec.___Directive_locations(ctx, field, obj)
|
||||||
if out.Values[i] == graphql.Null {
|
if out.Values[i] == graphql.Null {
|
||||||
@@ -4967,11 +5208,6 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS
|
|||||||
if out.Values[i] == graphql.Null {
|
if out.Values[i] == graphql.Null {
|
||||||
out.Invalids++
|
out.Invalids++
|
||||||
}
|
}
|
||||||
case "isRepeatable":
|
|
||||||
out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj)
|
|
||||||
if out.Values[i] == graphql.Null {
|
|
||||||
out.Invalids++
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
panic("unknown field " + strconv.Quote(field.Name))
|
panic("unknown field " + strconv.Quote(field.Name))
|
||||||
}
|
}
|
||||||
@@ -5126,6 +5362,13 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection
|
|||||||
}
|
}
|
||||||
case "defaultValue":
|
case "defaultValue":
|
||||||
out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj)
|
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:
|
default:
|
||||||
panic("unknown field " + strconv.Quote(field.Name))
|
panic("unknown field " + strconv.Quote(field.Name))
|
||||||
}
|
}
|
||||||
@@ -5224,6 +5467,8 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o
|
|||||||
out.Values[i] = ec.___Type_name(ctx, field, obj)
|
out.Values[i] = ec.___Type_name(ctx, field, obj)
|
||||||
case "description":
|
case "description":
|
||||||
out.Values[i] = ec.___Type_description(ctx, field, obj)
|
out.Values[i] = ec.___Type_description(ctx, field, obj)
|
||||||
|
case "specifiedByURL":
|
||||||
|
out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj)
|
||||||
case "fields":
|
case "fields":
|
||||||
out.Values[i] = ec.___Type_fields(ctx, field, obj)
|
out.Values[i] = ec.___Type_fields(ctx, field, obj)
|
||||||
case "interfaces":
|
case "interfaces":
|
||||||
@@ -5236,8 +5481,8 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o
|
|||||||
out.Values[i] = ec.___Type_inputFields(ctx, field, obj)
|
out.Values[i] = ec.___Type_inputFields(ctx, field, obj)
|
||||||
case "ofType":
|
case "ofType":
|
||||||
out.Values[i] = ec.___Type_ofType(ctx, field, obj)
|
out.Values[i] = ec.___Type_ofType(ctx, field, obj)
|
||||||
case "specifiedByURL":
|
case "isOneOf":
|
||||||
out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj)
|
out.Values[i] = ec.___Type_isOneOf(ctx, field, obj)
|
||||||
default:
|
default:
|
||||||
panic("unknown field " + strconv.Quote(field.Name))
|
panic("unknown field " + strconv.Quote(field.Name))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/wundergraph/graphql-go-tools/pkg/federation/sdlmerge"
|
|
||||||
"gitlab.com/unboundsoftware/eventsourced/eventsourced"
|
"gitlab.com/unboundsoftware/eventsourced/eventsourced"
|
||||||
|
|
||||||
"gitlab.com/unboundsoftware/schemas/domain"
|
"gitlab.com/unboundsoftware/schemas/domain"
|
||||||
@@ -17,6 +16,7 @@ import (
|
|||||||
"gitlab.com/unboundsoftware/schemas/graph/model"
|
"gitlab.com/unboundsoftware/schemas/graph/model"
|
||||||
"gitlab.com/unboundsoftware/schemas/middleware"
|
"gitlab.com/unboundsoftware/schemas/middleware"
|
||||||
"gitlab.com/unboundsoftware/schemas/rand"
|
"gitlab.com/unboundsoftware/schemas/rand"
|
||||||
|
"gitlab.com/unboundsoftware/schemas/sdlmerge"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AddOrganization is the resolver for the addOrganization field.
|
// AddOrganization is the resolver for the addOrganization field.
|
||||||
|
|||||||
@@ -12,6 +12,12 @@
|
|||||||
"registry.gitlab.com/unboundsoftware/schemas"
|
"registry.gitlab.com/unboundsoftware/schemas"
|
||||||
],
|
],
|
||||||
"enabled": false
|
"enabled": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"groupName": "Eventsourced",
|
||||||
|
"matchPackageNames": [
|
||||||
|
"gitlab.com/unboundsoftware/eventsourced/**"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/operationreport"
|
||||||
|
)
|
||||||
|
|
||||||
|
type collectEntitiesVisitor struct {
|
||||||
|
*astvisitor.Walker
|
||||||
|
document *ast.Document
|
||||||
|
collectedEntities entitySet
|
||||||
|
}
|
||||||
|
|
||||||
|
func newCollectEntitiesVisitor(collectedEntities entitySet) *collectEntitiesVisitor {
|
||||||
|
return &collectEntitiesVisitor{
|
||||||
|
collectedEntities: collectedEntities,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *collectEntitiesVisitor) Register(walker *astvisitor.Walker) {
|
||||||
|
c.Walker = walker
|
||||||
|
walker.RegisterEnterDocumentVisitor(c)
|
||||||
|
walker.RegisterEnterInterfaceTypeDefinitionVisitor(c)
|
||||||
|
walker.RegisterEnterObjectTypeDefinitionVisitor(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *collectEntitiesVisitor) EnterDocument(operation, _ *ast.Document) {
|
||||||
|
c.document = operation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *collectEntitiesVisitor) EnterInterfaceTypeDefinition(ref int) {
|
||||||
|
interfaceType := c.document.InterfaceTypeDefinitions[ref]
|
||||||
|
name := c.document.InterfaceTypeDefinitionNameString(ref)
|
||||||
|
if err := c.resolvePotentialEntity(name, interfaceType.Directives.Refs); err != nil {
|
||||||
|
c.StopWithExternalErr(*err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *collectEntitiesVisitor) EnterObjectTypeDefinition(ref int) {
|
||||||
|
objectType := c.document.ObjectTypeDefinitions[ref]
|
||||||
|
name := c.document.ObjectTypeDefinitionNameString(ref)
|
||||||
|
if err := c.resolvePotentialEntity(name, objectType.Directives.Refs); err != nil {
|
||||||
|
c.StopWithExternalErr(*err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *collectEntitiesVisitor) resolvePotentialEntity(name string, directiveRefs []int) *operationreport.ExternalError {
|
||||||
|
if _, exists := c.collectedEntities[name]; exists {
|
||||||
|
err := operationreport.ErrEntitiesMustNotBeDuplicated(name)
|
||||||
|
return &err
|
||||||
|
}
|
||||||
|
for _, directiveRef := range directiveRefs {
|
||||||
|
if c.document.DirectiveNameString(directiveRef) != "key" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
c.collectedEntities[name] = struct{}{}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/operationreport"
|
||||||
|
)
|
||||||
|
|
||||||
|
type extendEnumTypeDefinitionVisitor struct {
|
||||||
|
*astvisitor.Walker
|
||||||
|
document *ast.Document
|
||||||
|
}
|
||||||
|
|
||||||
|
func newExtendEnumTypeDefinition() *extendEnumTypeDefinitionVisitor {
|
||||||
|
return &extendEnumTypeDefinitionVisitor{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendEnumTypeDefinitionVisitor) Register(walker *astvisitor.Walker) {
|
||||||
|
e.Walker = walker
|
||||||
|
walker.RegisterEnterDocumentVisitor(e)
|
||||||
|
walker.RegisterEnterEnumTypeExtensionVisitor(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendEnumTypeDefinitionVisitor) EnterDocument(operation, _ *ast.Document) {
|
||||||
|
e.document = operation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendEnumTypeDefinitionVisitor) EnterEnumTypeExtension(ref int) {
|
||||||
|
nodes, exists := e.document.Index.NodesByNameBytes(e.document.EnumTypeExtensionNameBytes(ref))
|
||||||
|
if !exists {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
hasExtended := false
|
||||||
|
for i := range nodes {
|
||||||
|
if nodes[i].Kind != ast.NodeKindEnumTypeDefinition {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if hasExtended {
|
||||||
|
e.StopWithExternalErr(operationreport.ErrSharedTypesMustNotBeExtended(e.document.EnumTypeExtensionNameString(ref)))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
e.document.ExtendEnumTypeDefinitionByEnumTypeExtension(nodes[i].Ref, ref)
|
||||||
|
hasExtended = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if !hasExtended {
|
||||||
|
e.StopWithExternalErr(operationreport.ErrExtensionOrphansMustResolveInSupergraph(e.document.EnumTypeExtensionNameBytes(ref)))
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/operationreport"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newExtendInputObjectTypeDefinition() *extendInputObjectTypeDefinitionVisitor {
|
||||||
|
return &extendInputObjectTypeDefinitionVisitor{}
|
||||||
|
}
|
||||||
|
|
||||||
|
type extendInputObjectTypeDefinitionVisitor struct {
|
||||||
|
*astvisitor.Walker
|
||||||
|
document *ast.Document
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendInputObjectTypeDefinitionVisitor) Register(walker *astvisitor.Walker) {
|
||||||
|
e.Walker = walker
|
||||||
|
walker.RegisterEnterDocumentVisitor(e)
|
||||||
|
walker.RegisterEnterInputObjectTypeExtensionVisitor(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendInputObjectTypeDefinitionVisitor) EnterDocument(operation, _ *ast.Document) {
|
||||||
|
e.document = operation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendInputObjectTypeDefinitionVisitor) EnterInputObjectTypeExtension(ref int) {
|
||||||
|
nodes, exists := e.document.Index.NodesByNameBytes(e.document.InputObjectTypeExtensionNameBytes(ref))
|
||||||
|
if !exists {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
hasExtended := false
|
||||||
|
for i := range nodes {
|
||||||
|
if nodes[i].Kind != ast.NodeKindInputObjectTypeDefinition {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if hasExtended {
|
||||||
|
e.StopWithExternalErr(operationreport.ErrSharedTypesMustNotBeExtended(e.document.InputObjectTypeExtensionNameString(ref)))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
e.document.ExtendInputObjectTypeDefinitionByInputObjectTypeExtension(nodes[i].Ref, ref)
|
||||||
|
hasExtended = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if !hasExtended {
|
||||||
|
e.StopWithExternalErr(operationreport.ErrExtensionOrphansMustResolveInSupergraph(e.document.InputObjectTypeExtensionNameBytes(ref)))
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/operationreport"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newExtendInterfaceTypeDefinition(collectedEntities entitySet) *extendInterfaceTypeDefinitionVisitor {
|
||||||
|
return &extendInterfaceTypeDefinitionVisitor{
|
||||||
|
collectedEntities: collectedEntities,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type extendInterfaceTypeDefinitionVisitor struct {
|
||||||
|
*astvisitor.Walker
|
||||||
|
document *ast.Document
|
||||||
|
collectedEntities entitySet
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendInterfaceTypeDefinitionVisitor) Register(walker *astvisitor.Walker) {
|
||||||
|
e.Walker = walker
|
||||||
|
walker.RegisterEnterDocumentVisitor(e)
|
||||||
|
walker.RegisterEnterInterfaceTypeExtensionVisitor(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendInterfaceTypeDefinitionVisitor) EnterDocument(operation, _ *ast.Document) {
|
||||||
|
e.document = operation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendInterfaceTypeDefinitionVisitor) EnterInterfaceTypeExtension(ref int) {
|
||||||
|
nameBytes := e.document.InterfaceTypeExtensionNameBytes(ref)
|
||||||
|
nodes, exists := e.document.Index.NodesByNameBytes(nameBytes)
|
||||||
|
if !exists {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var nodeToExtend *ast.Node
|
||||||
|
isEntity := false
|
||||||
|
for i := range nodes {
|
||||||
|
if nodes[i].Kind != ast.NodeKindInterfaceTypeDefinition {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if nodeToExtend != nil {
|
||||||
|
e.StopWithExternalErr(*multipleExtensionError(isEntity, nameBytes))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var err *operationreport.ExternalError
|
||||||
|
extension := e.document.InterfaceTypeExtensions[ref]
|
||||||
|
if isEntity, err = e.collectedEntities.isExtensionForEntity(nameBytes, extension.Directives.Refs, e.document); err != nil {
|
||||||
|
e.StopWithExternalErr(*err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
nodeToExtend = &nodes[i]
|
||||||
|
}
|
||||||
|
|
||||||
|
if nodeToExtend == nil {
|
||||||
|
e.StopWithExternalErr(operationreport.ErrExtensionOrphansMustResolveInSupergraph(e.document.InterfaceTypeExtensionNameBytes(ref)))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
e.document.ExtendInterfaceTypeDefinitionByInterfaceTypeExtension(nodeToExtend.Ref, ref)
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/operationreport"
|
||||||
|
)
|
||||||
|
|
||||||
|
type mergeDuplicatedFieldsVisitor struct {
|
||||||
|
*astvisitor.Walker
|
||||||
|
document *ast.Document
|
||||||
|
}
|
||||||
|
|
||||||
|
func newMergeDuplicatedFieldsVisitor() *mergeDuplicatedFieldsVisitor {
|
||||||
|
return &mergeDuplicatedFieldsVisitor{
|
||||||
|
nil,
|
||||||
|
nil,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *mergeDuplicatedFieldsVisitor) Register(walker *astvisitor.Walker) {
|
||||||
|
m.Walker = walker
|
||||||
|
walker.RegisterEnterDocumentVisitor(m)
|
||||||
|
walker.RegisterLeaveObjectTypeDefinitionVisitor(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *mergeDuplicatedFieldsVisitor) EnterDocument(document, _ *ast.Document) {
|
||||||
|
m.document = document
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *mergeDuplicatedFieldsVisitor) LeaveObjectTypeDefinition(ref int) {
|
||||||
|
var refsForDeletion []int
|
||||||
|
fieldByTypeRefSet := make(map[string]int)
|
||||||
|
for _, fieldRef := range m.document.ObjectTypeDefinitions[ref].FieldsDefinition.Refs {
|
||||||
|
fieldName := m.document.FieldDefinitionNameString(fieldRef)
|
||||||
|
newTypeRef := m.document.FieldDefinitions[fieldRef].Type
|
||||||
|
if oldTypeRef, ok := fieldByTypeRefSet[fieldName]; ok {
|
||||||
|
if m.document.TypesAreEqualDeep(oldTypeRef, newTypeRef) {
|
||||||
|
refsForDeletion = append(refsForDeletion, fieldRef)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
oldFieldTypeNameBytes, err := m.document.PrintTypeBytes(oldTypeRef, nil)
|
||||||
|
if err != nil {
|
||||||
|
m.Walker.StopWithInternalErr(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
newFieldTypeNameBytes, err := m.document.PrintTypeBytes(newTypeRef, nil)
|
||||||
|
if err != nil {
|
||||||
|
m.Walker.StopWithInternalErr(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
m.Walker.StopWithExternalErr(operationreport.ErrDuplicateFieldsMustBeIdentical(
|
||||||
|
fieldName, m.document.ObjectTypeDefinitionNameString(ref), string(oldFieldTypeNameBytes), string(newFieldTypeNameBytes),
|
||||||
|
))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldByTypeRefSet[fieldName] = newTypeRef
|
||||||
|
}
|
||||||
|
|
||||||
|
m.document.RemoveFieldDefinitionsFromObjectTypeDefinition(refsForDeletion, ref)
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/operationreport"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newExtendObjectTypeDefinition(collectedEntities entitySet) *extendObjectTypeDefinitionVisitor {
|
||||||
|
return &extendObjectTypeDefinitionVisitor{
|
||||||
|
collectedEntities: collectedEntities,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type extendObjectTypeDefinitionVisitor struct {
|
||||||
|
*astvisitor.Walker
|
||||||
|
document *ast.Document
|
||||||
|
collectedEntities entitySet
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendObjectTypeDefinitionVisitor) Register(walker *astvisitor.Walker) {
|
||||||
|
e.Walker = walker
|
||||||
|
walker.RegisterEnterDocumentVisitor(e)
|
||||||
|
walker.RegisterEnterObjectTypeExtensionVisitor(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendObjectTypeDefinitionVisitor) EnterDocument(operation, _ *ast.Document) {
|
||||||
|
e.document = operation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendObjectTypeDefinitionVisitor) EnterObjectTypeExtension(ref int) {
|
||||||
|
nameBytes := e.document.ObjectTypeExtensionNameBytes(ref)
|
||||||
|
nodes, exists := e.document.Index.NodesByNameBytes(nameBytes)
|
||||||
|
if !exists {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var nodeToExtend *ast.Node
|
||||||
|
isEntity := false
|
||||||
|
for i := range nodes {
|
||||||
|
if nodes[i].Kind != ast.NodeKindObjectTypeDefinition {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if nodeToExtend != nil {
|
||||||
|
e.StopWithExternalErr(*multipleExtensionError(isEntity, nameBytes))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var err *operationreport.ExternalError
|
||||||
|
extension := e.document.ObjectTypeExtensions[ref]
|
||||||
|
if isEntity, err = e.collectedEntities.isExtensionForEntity(nameBytes, extension.Directives.Refs, e.document); err != nil {
|
||||||
|
e.StopWithExternalErr(*err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
nodeToExtend = &nodes[i]
|
||||||
|
if ast.IsRootType(nameBytes) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if nodeToExtend == nil {
|
||||||
|
e.StopWithExternalErr(operationreport.ErrExtensionOrphansMustResolveInSupergraph(nameBytes))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
e.document.ExtendObjectTypeDefinitionByObjectTypeExtension(nodeToExtend.Ref, ref)
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/operationreport"
|
||||||
|
)
|
||||||
|
|
||||||
|
type removeDuplicateFieldedSharedTypesVisitor struct {
|
||||||
|
*astvisitor.Walker
|
||||||
|
document *ast.Document
|
||||||
|
sharedTypeSet map[string]fieldedSharedType
|
||||||
|
rootNodesToRemove []ast.Node
|
||||||
|
lastInputRef int
|
||||||
|
lastInterfaceRef int
|
||||||
|
lastObjectRef int
|
||||||
|
}
|
||||||
|
|
||||||
|
func newRemoveDuplicateFieldedSharedTypesVisitor() *removeDuplicateFieldedSharedTypesVisitor {
|
||||||
|
return &removeDuplicateFieldedSharedTypesVisitor{
|
||||||
|
nil,
|
||||||
|
nil,
|
||||||
|
make(map[string]fieldedSharedType),
|
||||||
|
nil,
|
||||||
|
ast.InvalidRef,
|
||||||
|
ast.InvalidRef,
|
||||||
|
ast.InvalidRef,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeDuplicateFieldedSharedTypesVisitor) Register(walker *astvisitor.Walker) {
|
||||||
|
r.Walker = walker
|
||||||
|
walker.RegisterEnterDocumentVisitor(r)
|
||||||
|
walker.RegisterEnterInputObjectTypeDefinitionVisitor(r)
|
||||||
|
walker.RegisterEnterInterfaceTypeDefinitionVisitor(r)
|
||||||
|
walker.RegisterEnterObjectTypeDefinitionVisitor(r)
|
||||||
|
walker.RegisterLeaveDocumentVisitor(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeDuplicateFieldedSharedTypesVisitor) EnterDocument(operation, _ *ast.Document) {
|
||||||
|
r.document = operation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeDuplicateFieldedSharedTypesVisitor) EnterInputObjectTypeDefinition(ref int) {
|
||||||
|
if ref <= r.lastInputRef {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
name := r.document.InputObjectTypeDefinitionNameString(ref)
|
||||||
|
refs := r.document.InputObjectTypeDefinitions[ref].InputFieldsDefinition.Refs
|
||||||
|
input, exists := r.sharedTypeSet[name]
|
||||||
|
if exists {
|
||||||
|
if !input.areFieldsIdentical(refs) {
|
||||||
|
r.StopWithExternalErr(operationreport.ErrSharedTypesMustBeIdenticalToFederate(name))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r.rootNodesToRemove = append(r.rootNodesToRemove, ast.Node{Kind: ast.NodeKindInputObjectTypeDefinition, Ref: ref})
|
||||||
|
} else {
|
||||||
|
r.sharedTypeSet[name] = newFieldedSharedType(r.document, ast.NodeKindInputValueDefinition, refs)
|
||||||
|
}
|
||||||
|
r.lastInputRef = ref
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeDuplicateFieldedSharedTypesVisitor) EnterInterfaceTypeDefinition(ref int) {
|
||||||
|
if ref <= r.lastInterfaceRef {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
name := r.document.InterfaceTypeDefinitionNameString(ref)
|
||||||
|
interfaceType := r.document.InterfaceTypeDefinitions[ref]
|
||||||
|
refs := interfaceType.FieldsDefinition.Refs
|
||||||
|
iFace, exists := r.sharedTypeSet[name]
|
||||||
|
if exists {
|
||||||
|
if !iFace.areFieldsIdentical(refs) {
|
||||||
|
r.StopWithExternalErr(operationreport.ErrSharedTypesMustBeIdenticalToFederate(name))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r.rootNodesToRemove = append(r.rootNodesToRemove, ast.Node{Kind: ast.NodeKindInterfaceTypeDefinition, Ref: ref})
|
||||||
|
} else {
|
||||||
|
r.sharedTypeSet[name] = newFieldedSharedType(r.document, ast.NodeKindFieldDefinition, refs)
|
||||||
|
}
|
||||||
|
r.lastInterfaceRef = ref
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeDuplicateFieldedSharedTypesVisitor) EnterObjectTypeDefinition(ref int) {
|
||||||
|
if ref <= r.lastObjectRef {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
name := r.document.ObjectTypeDefinitionNameString(ref)
|
||||||
|
objectType := r.document.ObjectTypeDefinitions[ref]
|
||||||
|
refs := objectType.FieldsDefinition.Refs
|
||||||
|
object, exists := r.sharedTypeSet[name]
|
||||||
|
if exists {
|
||||||
|
if !object.areFieldsIdentical(refs) {
|
||||||
|
r.StopWithExternalErr(operationreport.ErrSharedTypesMustBeIdenticalToFederate(name))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r.rootNodesToRemove = append(r.rootNodesToRemove, ast.Node{Kind: ast.NodeKindObjectTypeDefinition, Ref: ref})
|
||||||
|
} else {
|
||||||
|
r.sharedTypeSet[name] = newFieldedSharedType(r.document, ast.NodeKindFieldDefinition, refs)
|
||||||
|
}
|
||||||
|
r.lastObjectRef = ref
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeDuplicateFieldedSharedTypesVisitor) LeaveDocument(_, _ *ast.Document) {
|
||||||
|
if r.rootNodesToRemove != nil {
|
||||||
|
r.document.DeleteRootNodes(r.rootNodesToRemove)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/operationreport"
|
||||||
|
)
|
||||||
|
|
||||||
|
type removeDuplicateFieldlessSharedTypesVisitor struct {
|
||||||
|
*astvisitor.Walker
|
||||||
|
document *ast.Document
|
||||||
|
sharedTypeSet map[string]fieldlessSharedType
|
||||||
|
rootNodesToRemove []ast.Node
|
||||||
|
lastEnumRef int
|
||||||
|
lastUnionRef int
|
||||||
|
lastScalarRef int
|
||||||
|
}
|
||||||
|
|
||||||
|
func newRemoveDuplicateFieldlessSharedTypesVisitor() *removeDuplicateFieldlessSharedTypesVisitor {
|
||||||
|
return &removeDuplicateFieldlessSharedTypesVisitor{
|
||||||
|
nil,
|
||||||
|
nil,
|
||||||
|
make(map[string]fieldlessSharedType),
|
||||||
|
nil,
|
||||||
|
ast.InvalidRef,
|
||||||
|
ast.InvalidRef,
|
||||||
|
ast.InvalidRef,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeDuplicateFieldlessSharedTypesVisitor) Register(walker *astvisitor.Walker) {
|
||||||
|
r.Walker = walker
|
||||||
|
walker.RegisterEnterDocumentVisitor(r)
|
||||||
|
walker.RegisterEnterEnumTypeDefinitionVisitor(r)
|
||||||
|
walker.RegisterEnterScalarTypeDefinitionVisitor(r)
|
||||||
|
walker.RegisterEnterUnionTypeDefinitionVisitor(r)
|
||||||
|
walker.RegisterLeaveDocumentVisitor(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeDuplicateFieldlessSharedTypesVisitor) EnterDocument(operation, _ *ast.Document) {
|
||||||
|
r.document = operation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeDuplicateFieldlessSharedTypesVisitor) EnterEnumTypeDefinition(ref int) {
|
||||||
|
if ref <= r.lastEnumRef {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
name := r.document.EnumTypeDefinitionNameString(ref)
|
||||||
|
enum, exists := r.sharedTypeSet[name]
|
||||||
|
if exists {
|
||||||
|
if !enum.areValuesIdentical(r.document.EnumTypeDefinitions[ref].EnumValuesDefinition.Refs) {
|
||||||
|
r.StopWithExternalErr(operationreport.ErrSharedTypesMustBeIdenticalToFederate(name))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r.rootNodesToRemove = append(r.rootNodesToRemove, ast.Node{Kind: ast.NodeKindEnumTypeDefinition, Ref: ref})
|
||||||
|
} else {
|
||||||
|
r.sharedTypeSet[name] = newEnumSharedType(r.document, ref)
|
||||||
|
}
|
||||||
|
r.lastEnumRef = ref
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeDuplicateFieldlessSharedTypesVisitor) EnterScalarTypeDefinition(ref int) {
|
||||||
|
if ref <= r.lastScalarRef {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
name := r.document.ScalarTypeDefinitionNameString(ref)
|
||||||
|
_, exists := r.sharedTypeSet[name]
|
||||||
|
if exists {
|
||||||
|
r.rootNodesToRemove = append(r.rootNodesToRemove, ast.Node{Kind: ast.NodeKindScalarTypeDefinition, Ref: ref})
|
||||||
|
} else {
|
||||||
|
r.sharedTypeSet[name] = scalarSharedType{}
|
||||||
|
}
|
||||||
|
r.lastScalarRef = ref
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeDuplicateFieldlessSharedTypesVisitor) EnterUnionTypeDefinition(ref int) {
|
||||||
|
if ref <= r.lastUnionRef {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
name := r.document.UnionTypeDefinitionNameString(ref)
|
||||||
|
union, exists := r.sharedTypeSet[name]
|
||||||
|
if exists {
|
||||||
|
if !union.areValuesIdentical(r.document.UnionTypeDefinitions[ref].UnionMemberTypes.Refs) {
|
||||||
|
r.StopWithExternalErr(operationreport.ErrSharedTypesMustBeIdenticalToFederate(name))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r.rootNodesToRemove = append(r.rootNodesToRemove, ast.Node{Kind: ast.NodeKindUnionTypeDefinition, Ref: ref})
|
||||||
|
} else {
|
||||||
|
r.sharedTypeSet[name] = newUnionSharedType(r.document, ref)
|
||||||
|
}
|
||||||
|
r.lastUnionRef = ref
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeDuplicateFieldlessSharedTypesVisitor) LeaveDocument(_, _ *ast.Document) {
|
||||||
|
if r.rootNodesToRemove != nil {
|
||||||
|
r.document.DeleteRootNodes(r.rootNodesToRemove)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newRemoveEmptyObjectTypeDefinition() *removeEmptyObjectTypeDefinition {
|
||||||
|
return &removeEmptyObjectTypeDefinition{}
|
||||||
|
}
|
||||||
|
|
||||||
|
type removeEmptyObjectTypeDefinition struct{}
|
||||||
|
|
||||||
|
func (r *removeEmptyObjectTypeDefinition) Register(walker *astvisitor.Walker) {
|
||||||
|
walker.RegisterLeaveDocumentVisitor(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeEmptyObjectTypeDefinition) LeaveDocument(operation, _ *ast.Document) {
|
||||||
|
for ref := range operation.ObjectTypeDefinitions {
|
||||||
|
if operation.ObjectTypeDefinitions[ref].HasFieldDefinitions {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
name := operation.ObjectTypeDefinitionNameString(ref)
|
||||||
|
node, ok := operation.Index.FirstNodeByNameStr(name)
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
operation.RemoveRootNode(node)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newRemoveFieldDefinitions(directives ...string) *removeFieldDefinitionByDirective {
|
||||||
|
directivesSet := make(map[string]struct{}, len(directives))
|
||||||
|
for _, directive := range directives {
|
||||||
|
directivesSet[directive] = struct{}{}
|
||||||
|
}
|
||||||
|
|
||||||
|
return &removeFieldDefinitionByDirective{
|
||||||
|
directives: directivesSet,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type removeFieldDefinitionByDirective struct {
|
||||||
|
operation *ast.Document
|
||||||
|
directives map[string]struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeFieldDefinitionByDirective) Register(walker *astvisitor.Walker) {
|
||||||
|
walker.RegisterEnterDocumentVisitor(r)
|
||||||
|
walker.RegisterLeaveObjectTypeDefinitionVisitor(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeFieldDefinitionByDirective) EnterDocument(operation, _ *ast.Document) {
|
||||||
|
r.operation = operation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeFieldDefinitionByDirective) LeaveObjectTypeDefinition(ref int) {
|
||||||
|
var refsForDeletion []int
|
||||||
|
// select fields for deletion
|
||||||
|
for _, fieldRef := range r.operation.ObjectTypeDefinitions[ref].FieldsDefinition.Refs {
|
||||||
|
for _, directiveRef := range r.operation.FieldDefinitions[fieldRef].Directives.Refs {
|
||||||
|
directiveName := r.operation.DirectiveNameString(directiveRef)
|
||||||
|
if _, ok := r.directives[directiveName]; ok {
|
||||||
|
refsForDeletion = append(refsForDeletion, fieldRef)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// delete fields
|
||||||
|
r.operation.RemoveFieldDefinitionsFromObjectTypeDefinition(refsForDeletion, ref)
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newRemoveFieldDefinitionDirective(directives ...string) *removeFieldDefinitionDirective {
|
||||||
|
directivesSet := make(map[string]struct{}, len(directives))
|
||||||
|
for _, directive := range directives {
|
||||||
|
directivesSet[directive] = struct{}{}
|
||||||
|
}
|
||||||
|
|
||||||
|
return &removeFieldDefinitionDirective{
|
||||||
|
directives: directivesSet,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type removeFieldDefinitionDirective struct {
|
||||||
|
operation *ast.Document
|
||||||
|
directives map[string]struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeFieldDefinitionDirective) Register(walker *astvisitor.Walker) {
|
||||||
|
walker.RegisterEnterDocumentVisitor(r)
|
||||||
|
walker.RegisterEnterFieldDefinitionVisitor(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeFieldDefinitionDirective) EnterDocument(operation, _ *ast.Document) {
|
||||||
|
r.operation = operation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeFieldDefinitionDirective) EnterFieldDefinition(ref int) {
|
||||||
|
var refsForDeletion []int
|
||||||
|
// select directives for deletion
|
||||||
|
for _, directiveRef := range r.operation.FieldDefinitions[ref].Directives.Refs {
|
||||||
|
directiveName := r.operation.DirectiveNameString(directiveRef)
|
||||||
|
if _, ok := r.directives[directiveName]; ok {
|
||||||
|
refsForDeletion = append(refsForDeletion, directiveRef)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// delete directives
|
||||||
|
r.operation.RemoveDirectivesFromNode(ast.Node{Kind: ast.NodeKindFieldDefinition, Ref: ref}, refsForDeletion)
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newRemoveInterfaceDefinitionDirective(directives ...string) *removeInterfaceDefinitionDirective {
|
||||||
|
directivesSet := make(map[string]struct{}, len(directives))
|
||||||
|
for _, directive := range directives {
|
||||||
|
directivesSet[directive] = struct{}{}
|
||||||
|
}
|
||||||
|
|
||||||
|
return &removeInterfaceDefinitionDirective{
|
||||||
|
directives: directivesSet,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type removeInterfaceDefinitionDirective struct {
|
||||||
|
*astvisitor.Walker
|
||||||
|
operation *ast.Document
|
||||||
|
directives map[string]struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeInterfaceDefinitionDirective) Register(walker *astvisitor.Walker) {
|
||||||
|
walker.RegisterEnterDocumentVisitor(r)
|
||||||
|
walker.RegisterEnterInterfaceTypeDefinitionVisitor(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeInterfaceDefinitionDirective) EnterDocument(operation, _ *ast.Document) {
|
||||||
|
r.operation = operation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeInterfaceDefinitionDirective) EnterInterfaceTypeDefinition(ref int) {
|
||||||
|
var refsForDeletion []int
|
||||||
|
// select fields for deletion
|
||||||
|
for _, directiveRef := range r.operation.InterfaceTypeDefinitions[ref].Directives.Refs {
|
||||||
|
directiveName := r.operation.DirectiveNameString(directiveRef)
|
||||||
|
if _, ok := r.directives[directiveName]; ok {
|
||||||
|
refsForDeletion = append(refsForDeletion, directiveRef)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// delete directives
|
||||||
|
r.operation.RemoveDirectivesFromNode(ast.Node{Kind: ast.NodeKindInterfaceTypeDefinition, Ref: ref}, refsForDeletion)
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newRemoveObjectTypeDefinitionDirective(directives ...string) *removeObjectTypeDefinitionDirective {
|
||||||
|
directivesSet := make(map[string]struct{}, len(directives))
|
||||||
|
for _, directive := range directives {
|
||||||
|
directivesSet[directive] = struct{}{}
|
||||||
|
}
|
||||||
|
|
||||||
|
return &removeObjectTypeDefinitionDirective{
|
||||||
|
directives: directivesSet,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type removeObjectTypeDefinitionDirective struct {
|
||||||
|
operation *ast.Document
|
||||||
|
directives map[string]struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeObjectTypeDefinitionDirective) Register(walker *astvisitor.Walker) {
|
||||||
|
walker.RegisterEnterDocumentVisitor(r)
|
||||||
|
walker.RegisterEnterObjectTypeDefinitionVisitor(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeObjectTypeDefinitionDirective) EnterDocument(operation, _ *ast.Document) {
|
||||||
|
r.operation = operation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeObjectTypeDefinitionDirective) EnterObjectTypeDefinition(ref int) {
|
||||||
|
var refsForDeletion []int
|
||||||
|
// select fields for deletion
|
||||||
|
for _, directiveRef := range r.operation.ObjectTypeDefinitions[ref].Directives.Refs {
|
||||||
|
directiveName := r.operation.DirectiveNameString(directiveRef)
|
||||||
|
if _, ok := r.directives[directiveName]; ok {
|
||||||
|
refsForDeletion = append(refsForDeletion, directiveRef)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// delete directives
|
||||||
|
r.operation.RemoveDirectivesFromNode(ast.Node{Kind: ast.NodeKindObjectTypeDefinition, Ref: ref}, refsForDeletion)
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newRemoveMergedTypeExtensions() *removeMergedTypeExtensionsVisitor {
|
||||||
|
return &removeMergedTypeExtensionsVisitor{}
|
||||||
|
}
|
||||||
|
|
||||||
|
type removeMergedTypeExtensionsVisitor struct{}
|
||||||
|
|
||||||
|
func (r *removeMergedTypeExtensionsVisitor) Register(walker *astvisitor.Walker) {
|
||||||
|
walker.RegisterLeaveDocumentVisitor(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *removeMergedTypeExtensionsVisitor) LeaveDocument(operation, definition *ast.Document) {
|
||||||
|
operation.RemoveMergedTypeExtensions()
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/operationreport"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newExtendScalarTypeDefinition() *extendScalarTypeDefinitionVisitor {
|
||||||
|
return &extendScalarTypeDefinitionVisitor{}
|
||||||
|
}
|
||||||
|
|
||||||
|
type extendScalarTypeDefinitionVisitor struct {
|
||||||
|
*astvisitor.Walker
|
||||||
|
document *ast.Document
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendScalarTypeDefinitionVisitor) Register(walker *astvisitor.Walker) {
|
||||||
|
e.Walker = walker
|
||||||
|
walker.RegisterEnterDocumentVisitor(e)
|
||||||
|
walker.RegisterEnterScalarTypeExtensionVisitor(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendScalarTypeDefinitionVisitor) EnterDocument(operation, _ *ast.Document) {
|
||||||
|
e.document = operation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendScalarTypeDefinitionVisitor) EnterScalarTypeExtension(ref int) {
|
||||||
|
nodes, exists := e.document.Index.NodesByNameBytes(e.document.ScalarTypeExtensionNameBytes(ref))
|
||||||
|
if !exists {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
hasExtended := false
|
||||||
|
for i := range nodes {
|
||||||
|
if nodes[i].Kind != ast.NodeKindScalarTypeDefinition {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if hasExtended {
|
||||||
|
e.StopWithExternalErr(operationreport.ErrSharedTypesMustNotBeExtended(e.document.ScalarTypeExtensionNameString(ref)))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
e.document.ExtendScalarTypeDefinitionByScalarTypeExtension(nodes[i].Ref, ref)
|
||||||
|
hasExtended = true
|
||||||
|
}
|
||||||
|
if !hasExtended {
|
||||||
|
e.StopWithExternalErr(operationreport.ErrExtensionOrphansMustResolveInSupergraph(e.document.ScalarTypeExtensionNameBytes(ref)))
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,205 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/asttransform"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvalidation"
|
||||||
|
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astnormalization"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astparser"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astprinter"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/operationreport"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
rootOperationTypeDefinitions = `
|
||||||
|
type Query {}
|
||||||
|
type Mutation {}
|
||||||
|
type Subscription {}
|
||||||
|
`
|
||||||
|
|
||||||
|
parseDocumentError = "parse graphql document string: %w"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Visitor interface {
|
||||||
|
Register(walker *astvisitor.Walker)
|
||||||
|
}
|
||||||
|
|
||||||
|
func MergeAST(ast *ast.Document) error {
|
||||||
|
normalizer := normalizer{}
|
||||||
|
normalizer.setupWalkers()
|
||||||
|
|
||||||
|
return normalizer.normalize(ast)
|
||||||
|
}
|
||||||
|
|
||||||
|
func MergeSDLs(SDLs ...string) (string, error) {
|
||||||
|
rawDocs := make([]string, 0, len(SDLs)+1)
|
||||||
|
rawDocs = append(rawDocs, rootOperationTypeDefinitions)
|
||||||
|
rawDocs = append(rawDocs, SDLs...)
|
||||||
|
if validationError := validateSubgraphs(rawDocs[1:]); validationError != nil {
|
||||||
|
return "", validationError
|
||||||
|
}
|
||||||
|
if normalizationError := normalizeSubgraphs(rawDocs[1:]); normalizationError != nil {
|
||||||
|
return "", normalizationError
|
||||||
|
}
|
||||||
|
|
||||||
|
doc, report := astparser.ParseGraphqlDocumentString(strings.Join(rawDocs, "\n"))
|
||||||
|
if report.HasErrors() {
|
||||||
|
return "", fmt.Errorf("parse graphql document string: %w", report)
|
||||||
|
}
|
||||||
|
|
||||||
|
astnormalization.NormalizeSubgraphSDL(&doc, &report)
|
||||||
|
if report.HasErrors() {
|
||||||
|
return "", fmt.Errorf("merge ast: %w", report)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := MergeAST(&doc); err != nil {
|
||||||
|
return "", fmt.Errorf("merge ast: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
out, err := astprinter.PrintString(&doc)
|
||||||
|
if err != nil {
|
||||||
|
return "", fmt.Errorf("stringify schema: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func validateSubgraphs(subgraphs []string) error {
|
||||||
|
validator := astvalidation.NewDefinitionValidator(
|
||||||
|
astvalidation.PopulatedTypeBodies(), astvalidation.KnownTypeNames(),
|
||||||
|
)
|
||||||
|
for _, subgraph := range subgraphs {
|
||||||
|
doc, report := astparser.ParseGraphqlDocumentString(subgraph)
|
||||||
|
if err := asttransform.MergeDefinitionWithBaseSchema(&doc); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if report.HasErrors() {
|
||||||
|
return fmt.Errorf(parseDocumentError, report)
|
||||||
|
}
|
||||||
|
validator.Validate(&doc, &report)
|
||||||
|
if report.HasErrors() {
|
||||||
|
return fmt.Errorf("validate schema: %w", report)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func normalizeSubgraphs(subgraphs []string) error {
|
||||||
|
subgraphNormalizer := astnormalization.NewSubgraphDefinitionNormalizer()
|
||||||
|
for i, subgraph := range subgraphs {
|
||||||
|
doc, report := astparser.ParseGraphqlDocumentString(subgraph)
|
||||||
|
if report.HasErrors() {
|
||||||
|
return fmt.Errorf(parseDocumentError, report)
|
||||||
|
}
|
||||||
|
subgraphNormalizer.NormalizeDefinition(&doc, &report)
|
||||||
|
if report.HasErrors() {
|
||||||
|
return fmt.Errorf("normalize schema: %w", report)
|
||||||
|
}
|
||||||
|
out, err := astprinter.PrintString(&doc)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("stringify schema: %w", err)
|
||||||
|
}
|
||||||
|
subgraphs[i] = out
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type normalizer struct {
|
||||||
|
walkers []*astvisitor.Walker
|
||||||
|
}
|
||||||
|
|
||||||
|
type entitySet map[string]struct{}
|
||||||
|
|
||||||
|
func (m *normalizer) setupWalkers() {
|
||||||
|
collectedEntities := make(entitySet)
|
||||||
|
visitorGroups := [][]Visitor{
|
||||||
|
{
|
||||||
|
newCollectEntitiesVisitor(collectedEntities),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
newExtendEnumTypeDefinition(),
|
||||||
|
newExtendInputObjectTypeDefinition(),
|
||||||
|
newExtendInterfaceTypeDefinition(collectedEntities),
|
||||||
|
newExtendScalarTypeDefinition(),
|
||||||
|
newExtendUnionTypeDefinition(),
|
||||||
|
newExtendObjectTypeDefinition(collectedEntities),
|
||||||
|
newRemoveEmptyObjectTypeDefinition(),
|
||||||
|
newRemoveMergedTypeExtensions(),
|
||||||
|
},
|
||||||
|
// visitors for cleaning up federated duplicated fields and directives
|
||||||
|
{
|
||||||
|
newRemoveFieldDefinitions("external"),
|
||||||
|
newRemoveDuplicateFieldedSharedTypesVisitor(),
|
||||||
|
newRemoveDuplicateFieldlessSharedTypesVisitor(),
|
||||||
|
newMergeDuplicatedFieldsVisitor(),
|
||||||
|
newRemoveInterfaceDefinitionDirective("key"),
|
||||||
|
newRemoveObjectTypeDefinitionDirective("key"),
|
||||||
|
newRemoveFieldDefinitionDirective("provides", "requires"),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, visitorGroup := range visitorGroups {
|
||||||
|
walker := astvisitor.NewWalker(48)
|
||||||
|
for _, visitor := range visitorGroup {
|
||||||
|
visitor.Register(&walker)
|
||||||
|
m.walkers = append(m.walkers, &walker)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *normalizer) normalize(operation *ast.Document) error {
|
||||||
|
report := operationreport.Report{}
|
||||||
|
|
||||||
|
for _, walker := range m.walkers {
|
||||||
|
walker.Walk(operation, nil, &report)
|
||||||
|
if report.HasErrors() {
|
||||||
|
return fmt.Errorf("walk: %w", report)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e entitySet) isExtensionForEntity(nameBytes []byte, directiveRefs []int, document *ast.Document) (bool, *operationreport.ExternalError) {
|
||||||
|
name := string(nameBytes)
|
||||||
|
hasDirectives := len(directiveRefs) > 0
|
||||||
|
if _, exists := e[name]; !exists {
|
||||||
|
if !hasDirectives || !isEntityExtension(directiveRefs, document) {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
err := operationreport.ErrExtensionWithKeyDirectiveMustExtendEntity(name)
|
||||||
|
return false, &err
|
||||||
|
}
|
||||||
|
if !hasDirectives {
|
||||||
|
err := operationreport.ErrEntityExtensionMustHaveKeyDirective(name)
|
||||||
|
return false, &err
|
||||||
|
}
|
||||||
|
if isEntityExtension(directiveRefs, document) {
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
err := operationreport.ErrEntityExtensionMustHaveKeyDirective(name)
|
||||||
|
return false, &err
|
||||||
|
}
|
||||||
|
|
||||||
|
func isEntityExtension(directiveRefs []int, document *ast.Document) bool {
|
||||||
|
for _, directiveRef := range directiveRefs {
|
||||||
|
if document.DirectiveNameString(directiveRef) == "key" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func multipleExtensionError(isEntity bool, nameBytes []byte) *operationreport.ExternalError {
|
||||||
|
if isEntity {
|
||||||
|
err := operationreport.ErrEntitiesMustNotBeDuplicated(string(nameBytes))
|
||||||
|
return &err
|
||||||
|
}
|
||||||
|
err := operationreport.ErrSharedTypesMustNotBeExtended(string(nameBytes))
|
||||||
|
return &err
|
||||||
|
}
|
||||||
@@ -0,0 +1,167 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import "github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
|
||||||
|
type fieldlessSharedType interface {
|
||||||
|
areValuesIdentical(valueRefsToCompare []int) bool
|
||||||
|
valueRefs() []int
|
||||||
|
valueName(ref int) string
|
||||||
|
}
|
||||||
|
|
||||||
|
func createValueSet(f fieldlessSharedType) map[string]bool {
|
||||||
|
valueSet := make(map[string]bool)
|
||||||
|
for _, valueRef := range f.valueRefs() {
|
||||||
|
valueSet[f.valueName(valueRef)] = true
|
||||||
|
}
|
||||||
|
return valueSet
|
||||||
|
}
|
||||||
|
|
||||||
|
type fieldedSharedType struct {
|
||||||
|
document *ast.Document
|
||||||
|
fieldKind ast.NodeKind
|
||||||
|
fieldRefs []int
|
||||||
|
fieldSet map[string]int
|
||||||
|
}
|
||||||
|
|
||||||
|
func newFieldedSharedType(document *ast.Document, fieldKind ast.NodeKind, fieldRefs []int) fieldedSharedType {
|
||||||
|
f := fieldedSharedType{
|
||||||
|
document,
|
||||||
|
fieldKind,
|
||||||
|
fieldRefs,
|
||||||
|
nil,
|
||||||
|
}
|
||||||
|
f.createFieldSet()
|
||||||
|
return f
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f fieldedSharedType) areFieldsIdentical(fieldRefsToCompare []int) bool {
|
||||||
|
if len(f.fieldRefs) != len(fieldRefsToCompare) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
for _, fieldRef := range fieldRefsToCompare {
|
||||||
|
actualFieldName := f.fieldName(fieldRef)
|
||||||
|
expectedTypeRef, exists := f.fieldSet[actualFieldName]
|
||||||
|
if !exists {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
actualTypeRef := f.fieldTypeRef(fieldRef)
|
||||||
|
if !f.document.TypesAreCompatibleDeep(expectedTypeRef, actualTypeRef) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *fieldedSharedType) createFieldSet() {
|
||||||
|
fieldSet := make(map[string]int)
|
||||||
|
for _, fieldRef := range f.fieldRefs {
|
||||||
|
fieldSet[f.fieldName(fieldRef)] = f.fieldTypeRef(fieldRef)
|
||||||
|
}
|
||||||
|
f.fieldSet = fieldSet
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f fieldedSharedType) fieldName(ref int) string {
|
||||||
|
switch f.fieldKind {
|
||||||
|
case ast.NodeKindInputValueDefinition:
|
||||||
|
return f.document.InputValueDefinitionNameString(ref)
|
||||||
|
default:
|
||||||
|
return f.document.FieldDefinitionNameString(ref)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f fieldedSharedType) fieldTypeRef(ref int) int {
|
||||||
|
switch f.fieldKind {
|
||||||
|
case ast.NodeKindInputValueDefinition:
|
||||||
|
return f.document.InputValueDefinitions[ref].Type
|
||||||
|
default:
|
||||||
|
return f.document.FieldDefinitions[ref].Type
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type enumSharedType struct {
|
||||||
|
*ast.EnumTypeDefinition
|
||||||
|
document *ast.Document
|
||||||
|
valueSet map[string]bool
|
||||||
|
}
|
||||||
|
|
||||||
|
func newEnumSharedType(document *ast.Document, ref int) enumSharedType {
|
||||||
|
e := enumSharedType{
|
||||||
|
&document.EnumTypeDefinitions[ref],
|
||||||
|
document,
|
||||||
|
nil,
|
||||||
|
}
|
||||||
|
e.valueSet = createValueSet(e)
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e enumSharedType) areValuesIdentical(valueRefsToCompare []int) bool {
|
||||||
|
if len(e.valueRefs()) != len(valueRefsToCompare) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
for _, valueRefToCompare := range valueRefsToCompare {
|
||||||
|
name := e.valueName(valueRefToCompare)
|
||||||
|
if !e.valueSet[name] {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e enumSharedType) valueRefs() []int {
|
||||||
|
return e.EnumValuesDefinition.Refs
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e enumSharedType) valueName(ref int) string {
|
||||||
|
return e.document.EnumValueDefinitionNameString(ref)
|
||||||
|
}
|
||||||
|
|
||||||
|
type unionSharedType struct {
|
||||||
|
*ast.UnionTypeDefinition
|
||||||
|
document *ast.Document
|
||||||
|
valueSet map[string]bool
|
||||||
|
}
|
||||||
|
|
||||||
|
func newUnionSharedType(document *ast.Document, ref int) unionSharedType {
|
||||||
|
u := unionSharedType{
|
||||||
|
&document.UnionTypeDefinitions[ref],
|
||||||
|
document,
|
||||||
|
nil,
|
||||||
|
}
|
||||||
|
u.valueSet = createValueSet(u)
|
||||||
|
return u
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u unionSharedType) areValuesIdentical(valueRefsToCompare []int) bool {
|
||||||
|
if len(u.valueRefs()) != len(valueRefsToCompare) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
for _, refToCompare := range valueRefsToCompare {
|
||||||
|
name := u.valueName(refToCompare)
|
||||||
|
if !u.valueSet[name] {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u unionSharedType) valueRefs() []int {
|
||||||
|
return u.UnionMemberTypes.Refs
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u unionSharedType) valueName(ref int) string {
|
||||||
|
return u.document.TypeNameString(ref)
|
||||||
|
}
|
||||||
|
|
||||||
|
type scalarSharedType struct{}
|
||||||
|
|
||||||
|
func (_ scalarSharedType) areValuesIdentical(_ []int) bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_ scalarSharedType) valueRefs() []int {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_ scalarSharedType) valueName(_ int) string {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package sdlmerge
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/astvisitor"
|
||||||
|
"github.com/wundergraph/graphql-go-tools/v2/pkg/operationreport"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newExtendUnionTypeDefinition() *extendUnionTypeDefinitionVisitor {
|
||||||
|
return &extendUnionTypeDefinitionVisitor{}
|
||||||
|
}
|
||||||
|
|
||||||
|
type extendUnionTypeDefinitionVisitor struct {
|
||||||
|
*astvisitor.Walker
|
||||||
|
document *ast.Document
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendUnionTypeDefinitionVisitor) Register(walker *astvisitor.Walker) {
|
||||||
|
e.Walker = walker
|
||||||
|
walker.RegisterEnterDocumentVisitor(e)
|
||||||
|
walker.RegisterEnterUnionTypeExtensionVisitor(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendUnionTypeDefinitionVisitor) EnterDocument(operation, _ *ast.Document) {
|
||||||
|
e.document = operation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *extendUnionTypeDefinitionVisitor) EnterUnionTypeExtension(ref int) {
|
||||||
|
nodes, exists := e.document.Index.NodesByNameBytes(e.document.UnionTypeExtensionNameBytes(ref))
|
||||||
|
if !exists {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
hasExtended := false
|
||||||
|
for i := range nodes {
|
||||||
|
if nodes[i].Kind != ast.NodeKindUnionTypeDefinition {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if hasExtended {
|
||||||
|
e.StopWithExternalErr(operationreport.ErrSharedTypesMustNotBeExtended(e.document.UnionTypeExtensionNameString(ref)))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
e.document.ExtendUnionTypeDefinitionByUnionTypeExtension(nodes[i].Ref, ref)
|
||||||
|
hasExtended = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if !hasExtended {
|
||||||
|
e.StopWithExternalErr(operationreport.ErrExtensionOrphansMustResolveInSupergraph(e.document.UnionTypeExtensionNameBytes(ref)))
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user