diff --git a/.github/workflows/demo-ci.yaml b/.github/workflows/demo-ci.yaml new file mode 100644 index 0000000000..fdccec3a57 --- /dev/null +++ b/.github/workflows/demo-ci.yaml @@ -0,0 +1,28 @@ +name: Demo CI +on: + pull_request: + paths: + - "demo/**/*" + - ".github/workflows/demo-ci.yaml" + +concurrency: + group: ${{github.workflow}}-${{github.head_ref}} + cancel-in-progress: true + +env: + CI: true + +jobs: + build_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/go + + - name: Generate code + working-directory: demo + run: make generate + + - uses: ./.github/actions/git-dirty-check + with: + package-name: demo diff --git a/.github/workflows/router-ci.yaml b/.github/workflows/router-ci.yaml index df0537020e..0758f1248c 100644 --- a/.github/workflows/router-ci.yaml +++ b/.github/workflows/router-ci.yaml @@ -63,9 +63,13 @@ jobs: with: bun-version: 1.2.15 - - name: Generate code + - name: Generate Go code run: make generate-go + - name: Generate test configs from demo + working-directory: ./router-tests + run: ./update-config-no-edg.sh + - uses: ./.github/actions/git-dirty-check with: package-name: router @@ -155,11 +159,16 @@ jobs: with: bun-version: 1.2.15 - - name: Generate code + - name: Generate Go code run: make generate-go - - name: Check if git is not dirty after generating files - run: git diff --no-ext-diff --exit-code + - name: Generate test configs from demo + working-directory: ./router-tests + run: ./update-config-no-edg.sh + + - uses: ./.github/actions/git-dirty-check + with: + package-name: router - name: Install dependencies working-directory: ./router diff --git a/demo/go.mod b/demo/go.mod index 6974e21f36..b402d0b4f7 100644 --- a/demo/go.mod +++ b/demo/go.mod @@ -11,8 +11,8 @@ require ( github.com/rs/cors v1.11.0 github.com/vektah/gqlparser/v2 v2.5.30 github.com/wundergraph/cosmo/composition-go v0.0.0-20250820135159-bf8852195d3f - github.com/wundergraph/cosmo/router v0.0.0-20260213130455-6e3277e7b850 - github.com/wundergraph/cosmo/router-tests v0.0.0-20260213130455-6e3277e7b850 + github.com/wundergraph/cosmo/router v0.0.0-20260318232543-0e5fa811a191 + github.com/wundergraph/cosmo/router-tests v0.0.0-20260318232543-0e5fa811a191 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 go.opentelemetry.io/otel v1.36.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0 @@ -23,7 +23,8 @@ require ( ) require ( - connectrpc.com/connect v1.16.2 // indirect + connectrpc.com/connect v1.19.1 // indirect + connectrpc.com/vanguard v0.3.0 // indirect github.com/KimMachineGun/automemlimit v0.6.1 // indirect github.com/MicahParks/jwkset v0.11.0 // indirect github.com/MicahParks/keyfunc/v3 v3.6.2 // indirect @@ -145,10 +146,10 @@ require ( github.com/urfave/cli/v2 v2.27.7 // indirect github.com/vbatts/tar-split v0.12.1 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect - github.com/wundergraph/astjson v1.0.0 // indirect + github.com/wundergraph/astjson v1.1.0 // indirect github.com/wundergraph/cosmo/demo/pkg/subgraphs/projects v0.0.0-20250715110703-10f2e5f9c79e // indirect github.com/wundergraph/go-arena v1.1.0 // indirect - github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.248 // indirect + github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.265 // indirect github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 // indirect github.com/yosida95/uritemplate/v3 v3.0.2 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect diff --git a/demo/go.sum b/demo/go.sum index fb48cfef4f..98689404bf 100644 --- a/demo/go.sum +++ b/demo/go.sum @@ -1,5 +1,7 @@ -connectrpc.com/connect v1.16.2 h1:ybd6y+ls7GOlb7Bh5C8+ghA6SvCBajHwxssO2CGFjqE= -connectrpc.com/connect v1.16.2/go.mod h1:n2kgwskMHXC+lVqb18wngEpF95ldBHXjZYJussz5FRc= +connectrpc.com/connect v1.19.1 h1:R5M57z05+90EfEvCY1b7hBxDVOUl45PrtXtAV2fOC14= +connectrpc.com/connect v1.19.1/go.mod h1:tN20fjdGlewnSFeZxLKb0xwIZ6ozc3OQs2hTXy4du9w= +connectrpc.com/vanguard v0.3.0 h1:prUKFm8rYDwvpvnOSoqdUowPMK0tRA0pbSrQoMd6Zng= +connectrpc.com/vanguard v0.3.0/go.mod h1:nxQ7+N6qhBiQczqGwdTw4oCqx1rDryIt20cEdECqToM= github.com/99designs/gqlgen v0.17.76 h1:YsJBcfACWmXWU2t1yCjoGdOmqcTfOFpjbLAE443fmYI= github.com/99designs/gqlgen v0.17.76/go.mod h1:miiU+PkAnTIDKMQ1BseUOIVeQHoiwYDZGCswoxl7xec= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -187,8 +189,8 @@ github.com/jensneuse/byte-template v0.0.0-20231025215717-69252eb3ed56 h1:wo26fh6 github.com/jensneuse/byte-template v0.0.0-20231025215717-69252eb3ed56/go.mod h1:0D5r/VSW6D/o65rKLL9xk7sZxL2+oku2HvFPYeIMFr4= github.com/jensneuse/diffview v1.0.0 h1:4b6FQJ7y3295JUHU3tRko6euyEboL825ZsXeZZM47Z4= github.com/jensneuse/diffview v1.0.0/go.mod h1:i6IacuD8LnEaPuiyzMHA+Wfz5mAuycMOf3R/orUY9y4= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= -github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94= +github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA= github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= @@ -371,20 +373,20 @@ github.com/vektah/gqlparser/v2 v2.5.30 h1:EqLwGAFLIzt1wpx1IPpY67DwUujF1OfzgEyDsL github.com/vektah/gqlparser/v2 v2.5.30/go.mod h1:D1/VCZtV3LPnQrcPBeR/q5jkSQIPti0uYCP/RI0gIeo= github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= -github.com/wundergraph/astjson v1.0.0 h1:rETLJuQkMWWW03HCF6WBttEBOu8gi5vznj5KEUPVV2Q= -github.com/wundergraph/astjson v1.0.0/go.mod h1:h12D/dxxnedtLzsKyBLK7/Oe4TAoGpRVC9nDpDrZSWw= +github.com/wundergraph/astjson v1.1.0 h1:xORDosrZ87zQFJwNGe/HIHXqzpdHOFmqWgykCLVL040= +github.com/wundergraph/astjson v1.1.0/go.mod h1:h12D/dxxnedtLzsKyBLK7/Oe4TAoGpRVC9nDpDrZSWw= github.com/wundergraph/cosmo/composition-go v0.0.0-20250820135159-bf8852195d3f h1:TjxywtqT+D6Qa/WGg1Vqn4ogT6P7M+iuUxPgDds1/kU= github.com/wundergraph/cosmo/composition-go v0.0.0-20250820135159-bf8852195d3f/go.mod h1:S3y/4/28Iut0SHMbmfXXa/6qyP55BA2rS4K3VI8A4Pg= github.com/wundergraph/cosmo/demo/pkg/subgraphs/projects v0.0.0-20250715110703-10f2e5f9c79e h1:VdJNlsiyWYxJzAD3jEe+DAQdzxkf9btD8qQNYNU+xQU= github.com/wundergraph/cosmo/demo/pkg/subgraphs/projects v0.0.0-20250715110703-10f2e5f9c79e/go.mod h1:WZ0yBeaDSGHqDMcQrP1JRYgCj9atF7ORXF8srnd2Sro= -github.com/wundergraph/cosmo/router v0.0.0-20260213130455-6e3277e7b850 h1:KpamF+1Vo3Dm8gcayYXTPZuKgPw/zVgJAI/NeODVVeU= -github.com/wundergraph/cosmo/router v0.0.0-20260213130455-6e3277e7b850/go.mod h1:We+sYVVSnWyylJRHpELaR0GOZndk1UI4gtf2zceZEmA= -github.com/wundergraph/cosmo/router-tests v0.0.0-20260213130455-6e3277e7b850 h1:ddKb9MX85UdRTrLzzYFnob2dU0VHhKqNSwUa0UEr1cs= -github.com/wundergraph/cosmo/router-tests v0.0.0-20260213130455-6e3277e7b850/go.mod h1:T5l+RrKg83m7G5OLJeHO9fEJT3zUeZ/VfKf+k98Ol0g= +github.com/wundergraph/cosmo/router v0.0.0-20260318232543-0e5fa811a191 h1:PCEyCEchpG/2IY4uH0tizZQlqSKuspv4lHtiFbl+fZM= +github.com/wundergraph/cosmo/router v0.0.0-20260318232543-0e5fa811a191/go.mod h1:YawmJF/Oue/8PCCtP7x2smoRsKsL6h/wpjje5gqSOmw= +github.com/wundergraph/cosmo/router-tests v0.0.0-20260318232543-0e5fa811a191 h1:q4T4N463s+mhf7v3mEU4zW71qX1tBeT/IwD29oQ/wPM= +github.com/wundergraph/cosmo/router-tests v0.0.0-20260318232543-0e5fa811a191/go.mod h1:x/MoiTDyaRkTrfh5EMJTSzGLsB1eZ8mI/zrZgRRAvhA= github.com/wundergraph/go-arena v1.1.0 h1:9+wSRkJAkA2vbYHp6s8tEGhPViRGQNGXqPHT0QzhdIc= github.com/wundergraph/go-arena v1.1.0/go.mod h1:ROOysEHWJjLQ8FSfNxZCziagb7Qw2nXY3/vgKRh7eWw= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.248 h1:+6Byi9AMVT2eP6hJhNH6unRXjTtkzVs3fc/2XExbJpY= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.248/go.mod h1:MFbY0QI8ncF60DHs7yyyiyyhWyld0WE1JokiyTVY8j4= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.265 h1:KVmojt3oH13VX8Yr8NZ+fuOiruLyznderHITJs1MyWE= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.265/go.mod h1:HjTAO/cuICpu31IfHY9qmSPygx6Gza7Wt9hTSReTI+A= github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 h1:FnBeRrxr7OU4VvAzt5X7s6266i6cSVkkFPS0TuXWbIg= github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= diff --git a/demo/pkg/subgraphs/employees/gqlgen.yml b/demo/pkg/subgraphs/employees/gqlgen.yml index 3ba1ed6e37..aa12fa16a2 100644 --- a/demo/pkg/subgraphs/employees/gqlgen.yml +++ b/demo/pkg/subgraphs/employees/gqlgen.yml @@ -26,6 +26,10 @@ resolver: package: subgraph directives: + cost: + skip_runtime: true + listSize: + skip_runtime: true openfed__requireFetchReasons: skip_runtime: true diff --git a/demo/pkg/subgraphs/employees/subgraph/generated/generated.go b/demo/pkg/subgraphs/employees/subgraph/generated/generated.go index 2bc2a2010e..8151f5e5ac 100644 --- a/demo/pkg/subgraphs/employees/subgraph/generated/generated.go +++ b/demo/pkg/subgraphs/employees/subgraph/generated/generated.go @@ -958,6 +958,21 @@ var sources = []*ast.Source{ ] ) +directive @cost(weight: Int!) on + | ARGUMENT_DEFINITION + | ENUM + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | OBJECT + | SCALAR + +directive @listSize( + assumedSize: Int, + slicingArguments: [String!], + sizedFields: [String!], + requireOneSlicingArgument: Boolean = true +) on FIELD_DEFINITION + directive @goField( forceResolver: Boolean name: String @@ -967,9 +982,9 @@ directive @goField( directive @openfed__requireFetchReasons repeatable on FIELD_DEFINITION | INTERFACE | OBJECT type Query { - employee(id: Int!): Employee @openfed__requireFetchReasons + employee(id: Int! @cost(weight: 2)): Employee @cost(weight: 5) @openfed__requireFetchReasons employeeAsList(id: Int!): [Employee] - employees: [Employee] + employees: [Employee] @listSize(assumedSize: 50) products: [Products!]! teammates(team: Department!): [Employee!]! firstEmployee: Employee! @tag(name: "internal") @@ -1005,7 +1020,7 @@ type Subscription { countFor(count: Int!): Int! } -enum Department { +enum Department @cost(weight: 1) { ENGINEERING MARKETING OPERATIONS @@ -1085,7 +1100,7 @@ type Employee implements Identifiable @key(fields: "id") { id: Int! tag: String! expertise: String! - role: RoleType! + role: RoleType! @listSize(assumedSize: 3, sizedFields: ["departments"]) notes: String @shareable updatedAt: String! startDate: String! @requiresScopes(scopes: [["read:employee", "read:private"], ["read:all"]]) @@ -1120,7 +1135,7 @@ type Consultancy @key(fields: "upc") { isLeadAvailable: Boolean @requires(fields: "lead { isAvailable }") } -type Cosmo implements IProduct @key(fields: "upc") { +type Cosmo implements IProduct @key(fields: "upc") @cost(weight: 5) { upc: ID! engineers: [Employee!]! lead: Employee! diff --git a/demo/pkg/subgraphs/employees/subgraph/schema.graphqls b/demo/pkg/subgraphs/employees/subgraph/schema.graphqls index f2a31001d5..5d9b2e8d63 100644 --- a/demo/pkg/subgraphs/employees/subgraph/schema.graphqls +++ b/demo/pkg/subgraphs/employees/subgraph/schema.graphqls @@ -18,6 +18,21 @@ extend schema ] ) +directive @cost(weight: Int!) on + | ARGUMENT_DEFINITION + | ENUM + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | OBJECT + | SCALAR + +directive @listSize( + assumedSize: Int, + slicingArguments: [String!], + sizedFields: [String!], + requireOneSlicingArgument: Boolean = true +) on FIELD_DEFINITION + directive @goField( forceResolver: Boolean name: String diff --git a/demo/pkg/subgraphs/products/gqlgen.yml b/demo/pkg/subgraphs/products/gqlgen.yml index c894529ca7..f51cd3a052 100644 --- a/demo/pkg/subgraphs/products/gqlgen.yml +++ b/demo/pkg/subgraphs/products/gqlgen.yml @@ -25,6 +25,12 @@ resolver: dir: subgraph package: subgraph +directives: + cost: + skip_runtime: true + listSize: + skip_runtime: true + # Optional: turn on use `gqlgen:"fieldName"` tags in your models # struct_tag: json diff --git a/demo/pkg/subgraphs/products/subgraph/generated/generated.go b/demo/pkg/subgraphs/products/subgraph/generated/generated.go index b5ccc0731f..0ca0e54957 100644 --- a/demo/pkg/subgraphs/products/subgraph/generated/generated.go +++ b/demo/pkg/subgraphs/products/subgraph/generated/generated.go @@ -521,16 +521,31 @@ var sources = []*ast.Source{ {Name: "../schema.graphqls", Input: `extend schema @link(url: "https://specs.apollo.dev/federation/v2.5", import: ["@authenticated", "@composeDirective", "@external", "@extends", "@inaccessible", "@interfaceObject", "@override", "@provides", "@key", "@requires", "@requiresScopes", "@shareable", "@tag"]) +directive @cost(weight: Int!) on + | ARGUMENT_DEFINITION + | ENUM + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | OBJECT + | SCALAR + +directive @listSize( + assumedSize: Int, + slicingArguments: [String!], + sizedFields: [String!], + requireOneSlicingArgument: Boolean = true +) on FIELD_DEFINITION + schema { query: Queries mutation: Mutation } type Queries { - productTypes: [Products!]! + productTypes: [Products!]! @listSize(assumedSize: 50) topSecretFederationFacts: [TopSecretFact!]! @requiresScopes(scopes: [["read:fact"], ["read:all"]]) factTypes: [TopSecretFactType!] - sharedThings(numOfA: Int! numOfB: Int!): [Thing!]! @shareable + sharedThings(numOfA: Int! numOfB: Int!): [Thing!]! @listSize(slicingArguments: ["numOfA"]) @shareable } type Mutation { @@ -558,7 +573,7 @@ interface TopSecretFact @authenticated { factType: TopSecretFactType } -scalar FactContent @requiresScopes(scopes: [["read:scalar"], ["read:all"]]) +scalar FactContent @cost(weight: 10) @requiresScopes(scopes: [["read:scalar"], ["read:all"]]) type DirectiveFact implements TopSecretFact @authenticated { title: String! @@ -601,7 +616,7 @@ type Consultancy @key(fields: "upc") { name: ProductName! } -type Cosmo @key(fields: "upc") { +type Cosmo @key(fields: "upc") @cost(weight: 8) { upc: ID! name: ProductName! repositoryURL: String! @@ -6842,6 +6857,24 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast return res } +func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v any) (*int, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalInt(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { + if v == nil { + return graphql.Null + } + _ = sel + _ = ctx + res := graphql.MarshalInt(*v) + return res +} + func (ec *executionContext) unmarshalOString2string(ctx context.Context, v any) (string, error) { res, err := graphql.UnmarshalString(v) return res, graphql.ErrorOnPath(ctx, err) diff --git a/demo/pkg/subgraphs/products/subgraph/schema.graphqls b/demo/pkg/subgraphs/products/subgraph/schema.graphqls index 105e2b87a3..7db2962346 100644 --- a/demo/pkg/subgraphs/products/subgraph/schema.graphqls +++ b/demo/pkg/subgraphs/products/subgraph/schema.graphqls @@ -1,6 +1,21 @@ extend schema @link(url: "https://specs.apollo.dev/federation/v2.5", import: ["@authenticated", "@composeDirective", "@external", "@extends", "@inaccessible", "@interfaceObject", "@override", "@provides", "@key", "@requires", "@requiresScopes", "@shareable", "@tag"]) +directive @cost(weight: Int!) on + | ARGUMENT_DEFINITION + | ENUM + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | OBJECT + | SCALAR + +directive @listSize( + assumedSize: Int, + slicingArguments: [String!], + sizedFields: [String!], + requireOneSlicingArgument: Boolean = true +) on FIELD_DEFINITION + schema { query: Queries mutation: Mutation diff --git a/router-tests/go.mod b/router-tests/go.mod index 09d0f37375..7e079a84ce 100644 --- a/router-tests/go.mod +++ b/router-tests/go.mod @@ -24,9 +24,9 @@ require ( github.com/twmb/franz-go v1.16.1 github.com/twmb/franz-go/pkg/kadm v1.11.0 github.com/wundergraph/astjson v1.1.0 - github.com/wundergraph/cosmo/demo v0.0.0-20260213130455-6e3277e7b850 + github.com/wundergraph/cosmo/demo v0.0.0-20260319123623-f186a0f724f6 github.com/wundergraph/cosmo/demo/pkg/subgraphs/projects v0.0.0-20250715110703-10f2e5f9c79e - github.com/wundergraph/cosmo/router v0.0.0-20260213130455-6e3277e7b850 + github.com/wundergraph/cosmo/router v0.0.0-20260319123623-f186a0f724f6 github.com/wundergraph/cosmo/router-plugin v0.0.0-20250808194725-de123ba1c65e github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.265 go.opentelemetry.io/otel v1.39.0 diff --git a/router-tests/testenv/testdata/config.json b/router-tests/testenv/testdata/config.json index 37e602a93f..64745343a9 100644 --- a/router-tests/testenv/testdata/config.json +++ b/router-tests/testenv/testdata/config.json @@ -200,7 +200,7 @@ }, "federation": { "enabled": true, - "serviceSdl": "extend schema\n@link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\n \"@authenticated\"\n \"@composeDirective\"\n \"@external\"\n \"@extends\"\n \"@inaccessible\"\n \"@interfaceObject\"\n \"@override\"\n \"@provides\"\n \"@key\"\n \"@requires\"\n \"@requiresScopes\"\n \"@shareable\"\n \"@tag\"\n ]\n)\n\ndirective @goField(\n forceResolver: Boolean\n name: String\n omittable: Boolean\n) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION\n\ndirective @openfed__requireFetchReasons repeatable on FIELD_DEFINITION | INTERFACE | OBJECT\n\ntype Query {\n employee(id: Int! @cost(weight: 2)): Employee @cost(weight: 5) @openfed__requireFetchReasons\n employeeAsList(id: Int!): [Employee]\n employees: [Employee] @listSize(assumedSize: 50)\n products: [Products!]!\n teammates(team: Department!): [Employee!]!\n firstEmployee: Employee! @tag(name: \"internal\")\n findEmployeesBy(criteria: FindEmployeeCriteria!): [Employee!]!\n}\n\nscalar Upload\n\ntype Mutation {\n updateEmployeeTag(id: Int!, tag: String!): Employee\n\n singleUpload(file: Upload!): Boolean!\n singleUploadWithInput(arg: FileUpload!): Boolean!\n multipleUpload(files: [Upload!]!): Boolean!\n}\n\ninput FileUpload {\n nested: DeeplyNestedFileUpload\n nestedList: [Upload!]\n}\n\ninput DeeplyNestedFileUpload {\n file: Upload!\n}\n\ntype Subscription {\n \"\"\"\n `currentTime` will return a stream of `Time` objects.\n \"\"\"\n currentTime: Time!\n countEmp(max: Int!, intervalMilliseconds: Int!): Int!\n countEmp2(max: Int!, intervalMilliseconds: Int!): Int!\n countFor(count: Int!): Int!\n}\n\nenum Department @cost(weight: 1) {\n ENGINEERING\n MARKETING\n OPERATIONS\n}\n\ninterface RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum EngineerType {\n BACKEND\n FRONTEND\n FULLSTACK\n}\n\ninterface Identifiable @openfed__requireFetchReasons {\n id: Int!\n}\n\ntype Engineer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n engineerType: EngineerType!\n}\n\ntype Marketer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum OperationType {\n FINANCE\n HUMAN_RESOURCES\n}\n\ntype Operator implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n operatorType: [OperationType!]!\n}\n\ntype Details {\n forename: String! @shareable\n location: Country!\n surname: String! @shareable\n pastLocations: [City!]!\n}\n\ntype City {\n type: String!\n name: String!\n country: Country\n}\n\n# Using a nested key field simply because it can showcase potential bug\n# vectors / Federation capabilities.\ntype Country @key(fields: \"key { name }\", resolvable: false) {\n key: CountryKey!\n}\n\ntype CountryKey {\n name: String!\n}\n\nenum Mood {\n HAPPY\n SAD\n}\n\ntype Employee implements Identifiable @key(fields: \"id\") {\n details: Details! @shareable\n id: Int!\n tag: String!\n expertise: String!\n role: RoleType! @listSize(assumedSize: 3, sizedFields: [\"departments\"])\n notes: String @shareable\n updatedAt: String!\n startDate: String! @requiresScopes(scopes: [[\"read:employee\", \"read:private\"], [\"read:all\"]])\n currentMood: Mood! @external\n derivedMood: Mood! @requires(fields: \"currentMood\")\n # From the `availability` service. Only defined for use in @requires\n isAvailable: Boolean @external\n rootFieldThrowsError: String @goField(forceResolver: true)\n rootFieldErrorWrapper: ErrorWrapper @goField(forceResolver: true)\n}\n\ntype ErrorWrapper {\n okField: String\n errorField: String @goField(forceResolver: true)\n}\n\ntype Time {\n unixTime: Int!\n timeStamp: String!\n}\n\nunion Products = Consultancy | Cosmo | SDK\n\ninterface IProduct {\n upc: ID!\n engineers: [Employee!]!\n}\n\ntype Consultancy @key(fields: \"upc\") {\n upc: ID!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype Cosmo implements IProduct @key(fields: \"upc\") @cost(weight: 5) {\n upc: ID!\n engineers: [Employee!]!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype SDK implements IProduct @key(fields: \"upc\") {\n upc: ID!\n engineers: [Employee!]!\n owner: Employee!\n unicode: String!\n}\n\ninput FindEmployeeCriteria @oneOf {\n id: Int\n department: Department\n title: String\n}" + "serviceSdl": "extend schema\n@link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\n \"@authenticated\"\n \"@composeDirective\"\n \"@external\"\n \"@extends\"\n \"@inaccessible\"\n \"@interfaceObject\"\n \"@override\"\n \"@provides\"\n \"@key\"\n \"@requires\"\n \"@requiresScopes\"\n \"@shareable\"\n \"@tag\"\n ]\n)\n\ndirective @cost(weight: Int!) on\n | ARGUMENT_DEFINITION\n | ENUM\n | FIELD_DEFINITION\n | INPUT_FIELD_DEFINITION\n | OBJECT\n | SCALAR\n\ndirective @listSize(\n assumedSize: Int,\n slicingArguments: [String!],\n sizedFields: [String!],\n requireOneSlicingArgument: Boolean = true\n) on FIELD_DEFINITION\n\ndirective @goField(\n forceResolver: Boolean\n name: String\n omittable: Boolean\n) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION\n\ndirective @openfed__requireFetchReasons repeatable on FIELD_DEFINITION | INTERFACE | OBJECT\n\ntype Query {\n employee(id: Int! @cost(weight: 2)): Employee @cost(weight: 5) @openfed__requireFetchReasons\n employeeAsList(id: Int!): [Employee]\n employees: [Employee] @listSize(assumedSize: 50)\n products: [Products!]!\n teammates(team: Department!): [Employee!]!\n firstEmployee: Employee! @tag(name: \"internal\")\n findEmployeesBy(criteria: FindEmployeeCriteria!): [Employee!]!\n}\n\nscalar Upload\n\ntype Mutation {\n updateEmployeeTag(id: Int!, tag: String!): Employee\n\n singleUpload(file: Upload!): Boolean!\n singleUploadWithInput(arg: FileUpload!): Boolean!\n multipleUpload(files: [Upload!]!): Boolean!\n}\n\ninput FileUpload {\n nested: DeeplyNestedFileUpload\n nestedList: [Upload!]\n}\n\ninput DeeplyNestedFileUpload {\n file: Upload!\n}\n\ntype Subscription {\n \"\"\"\n `currentTime` will return a stream of `Time` objects.\n \"\"\"\n currentTime: Time!\n countEmp(max: Int!, intervalMilliseconds: Int!): Int!\n countEmp2(max: Int!, intervalMilliseconds: Int!): Int!\n countFor(count: Int!): Int!\n}\n\nenum Department @cost(weight: 1) {\n ENGINEERING\n MARKETING\n OPERATIONS\n}\n\ninterface RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum EngineerType {\n BACKEND\n FRONTEND\n FULLSTACK\n}\n\ninterface Identifiable @openfed__requireFetchReasons {\n id: Int!\n}\n\ntype Engineer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n engineerType: EngineerType!\n}\n\ntype Marketer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum OperationType {\n FINANCE\n HUMAN_RESOURCES\n}\n\ntype Operator implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n operatorType: [OperationType!]!\n}\n\ntype Details {\n forename: String! @shareable\n location: Country!\n surname: String! @shareable\n pastLocations: [City!]!\n}\n\ntype City {\n type: String!\n name: String!\n country: Country\n}\n\n# Using a nested key field simply because it can showcase potential bug\n# vectors / Federation capabilities.\ntype Country @key(fields: \"key { name }\", resolvable: false) {\n key: CountryKey!\n}\n\ntype CountryKey {\n name: String!\n}\n\nenum Mood {\n HAPPY\n SAD\n}\n\ntype Employee implements Identifiable @key(fields: \"id\") {\n details: Details! @shareable\n id: Int!\n tag: String!\n expertise: String!\n role: RoleType! @listSize(assumedSize: 3, sizedFields: [\"departments\"])\n notes: String @shareable\n updatedAt: String!\n startDate: String! @requiresScopes(scopes: [[\"read:employee\", \"read:private\"], [\"read:all\"]])\n currentMood: Mood! @external\n derivedMood: Mood! @requires(fields: \"currentMood\")\n # From the `availability` service. Only defined for use in @requires\n isAvailable: Boolean @external\n rootFieldThrowsError: String @goField(forceResolver: true)\n rootFieldErrorWrapper: ErrorWrapper @goField(forceResolver: true)\n}\n\ntype ErrorWrapper {\n okField: String\n errorField: String @goField(forceResolver: true)\n}\n\ntype Time {\n unixTime: Int!\n timeStamp: String!\n}\n\nunion Products = Consultancy | Cosmo | SDK\n\ninterface IProduct {\n upc: ID!\n engineers: [Employee!]!\n}\n\ntype Consultancy @key(fields: \"upc\") {\n upc: ID!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype Cosmo implements IProduct @key(fields: \"upc\") @cost(weight: 5) {\n upc: ID!\n engineers: [Employee!]!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype SDK implements IProduct @key(fields: \"upc\") {\n upc: ID!\n engineers: [Employee!]!\n owner: Employee!\n unicode: String!\n}\n\ninput FindEmployeeCriteria @oneOf {\n id: Int\n department: Department\n title: String\n}" }, "upstreamSchema": { "key": "5a6472c2e0ff922b296480a3d90be693885d95a5" @@ -656,7 +656,7 @@ }, "federation": { "enabled": true, - "serviceSdl": "extend schema\n@link(url: \"https://specs.apollo.dev/federation/v2.5\", import: [\"@authenticated\", \"@composeDirective\", \"@external\", \"@extends\", \"@inaccessible\", \"@interfaceObject\", \"@override\", \"@provides\", \"@key\", \"@requires\", \"@requiresScopes\", \"@shareable\", \"@tag\"])\n\nschema {\n query: Queries\n mutation: Mutation\n}\n\ntype Queries {\n productTypes: [Products!]! @listSize(assumedSize: 50)\n topSecretFederationFacts: [TopSecretFact!]! @requiresScopes(scopes: [[\"read:fact\"], [\"read:all\"]])\n factTypes: [TopSecretFactType!]\n sharedThings(numOfA: Int! numOfB: Int!): [Thing!]! @listSize(slicingArguments: [\"numOfA\"]) @shareable\n}\n\ntype Mutation {\n addFact(fact: TopSecretFactInput!): TopSecretFact! @requiresScopes(scopes: [[\"write:fact\"], [\"write:all\"]])\n}\n\ntype Thing @shareable {\n a: String!\n}\n\ninput TopSecretFactInput {\n title: String!\n description: FactContent!\n factType: TopSecretFactType!\n}\n\nenum TopSecretFactType @authenticated {\n DIRECTIVE,\n ENTITY,\n MISCELLANEOUS,\n}\n\ninterface TopSecretFact @authenticated {\n description: FactContent!\n factType: TopSecretFactType\n}\n\nscalar FactContent @cost(weight: 10) @requiresScopes(scopes: [[\"read:scalar\"], [\"read:all\"]])\n\ntype DirectiveFact implements TopSecretFact @authenticated {\n title: String!\n description: FactContent!\n factType: TopSecretFactType\n}\n\ntype EntityFact implements TopSecretFact @requiresScopes(scopes: [[\"read:entity\"]]){\n title: String!\n description: FactContent!\n factType: TopSecretFactType\n}\n\ntype MiscellaneousFact implements TopSecretFact {\n title: String!\n description: FactContent! @requiresScopes(scopes: [[\"read:miscellaneous\"]])\n factType: TopSecretFactType\n}\n\nenum ProductName {\n CONSULTANCY\n COSMO\n ENGINE\n FINANCE\n HUMAN_RESOURCES\n MARKETING\n SDK\n}\n\ntype Employee @key(fields: \"id\") {\n id: Int!\n products: [ProductName!]!\n notes: String @override(from: \"employees\")\n}\n\nunion Products = Consultancy | Cosmo | Documentation\n\ntype Consultancy @key(fields: \"upc\") {\n upc: ID!\n name: ProductName!\n}\n\ntype Cosmo @key(fields: \"upc\") @cost(weight: 8) {\n upc: ID!\n name: ProductName!\n repositoryURL: String!\n}\n\ntype Documentation {\n url(product: ProductName!): String!\n urls(products: [ProductName!]!): [String!]!\n}\n" + "serviceSdl": "extend schema\n@link(url: \"https://specs.apollo.dev/federation/v2.5\", import: [\"@authenticated\", \"@composeDirective\", \"@external\", \"@extends\", \"@inaccessible\", \"@interfaceObject\", \"@override\", \"@provides\", \"@key\", \"@requires\", \"@requiresScopes\", \"@shareable\", \"@tag\"])\n\ndirective @cost(weight: Int!) on\n | ARGUMENT_DEFINITION\n | ENUM\n | FIELD_DEFINITION\n | INPUT_FIELD_DEFINITION\n | OBJECT\n | SCALAR\n\ndirective @listSize(\n assumedSize: Int,\n slicingArguments: [String!],\n sizedFields: [String!],\n requireOneSlicingArgument: Boolean = true\n) on FIELD_DEFINITION\n\nschema {\n query: Queries\n mutation: Mutation\n}\n\ntype Queries {\n productTypes: [Products!]! @listSize(assumedSize: 50)\n topSecretFederationFacts: [TopSecretFact!]! @requiresScopes(scopes: [[\"read:fact\"], [\"read:all\"]])\n factTypes: [TopSecretFactType!]\n sharedThings(numOfA: Int! numOfB: Int!): [Thing!]! @listSize(slicingArguments: [\"numOfA\"]) @shareable\n}\n\ntype Mutation {\n addFact(fact: TopSecretFactInput!): TopSecretFact! @requiresScopes(scopes: [[\"write:fact\"], [\"write:all\"]])\n}\n\ntype Thing @shareable {\n a: String!\n}\n\ninput TopSecretFactInput {\n title: String!\n description: FactContent!\n factType: TopSecretFactType!\n}\n\nenum TopSecretFactType @authenticated {\n DIRECTIVE,\n ENTITY,\n MISCELLANEOUS,\n}\n\ninterface TopSecretFact @authenticated {\n description: FactContent!\n factType: TopSecretFactType\n}\n\nscalar FactContent @cost(weight: 10) @requiresScopes(scopes: [[\"read:scalar\"], [\"read:all\"]])\n\ntype DirectiveFact implements TopSecretFact @authenticated {\n title: String!\n description: FactContent!\n factType: TopSecretFactType\n}\n\ntype EntityFact implements TopSecretFact @requiresScopes(scopes: [[\"read:entity\"]]){\n title: String!\n description: FactContent!\n factType: TopSecretFactType\n}\n\ntype MiscellaneousFact implements TopSecretFact {\n title: String!\n description: FactContent! @requiresScopes(scopes: [[\"read:miscellaneous\"]])\n factType: TopSecretFactType\n}\n\nenum ProductName {\n CONSULTANCY\n COSMO\n ENGINE\n FINANCE\n HUMAN_RESOURCES\n MARKETING\n SDK\n}\n\ntype Employee @key(fields: \"id\") {\n id: Int!\n products: [ProductName!]!\n notes: String @override(from: \"employees\")\n}\n\nunion Products = Consultancy | Cosmo | Documentation\n\ntype Consultancy @key(fields: \"upc\") {\n upc: ID!\n name: ProductName!\n}\n\ntype Cosmo @key(fields: \"upc\") @cost(weight: 8) {\n upc: ID!\n name: ProductName!\n repositoryURL: String!\n}\n\ntype Documentation {\n url(product: ProductName!): String!\n urls(products: [ProductName!]!): [String!]!\n}\n" }, "upstreamSchema": { "key": "d50db561f5f30b98dc797f7c9b4a927da2cb7e3e" @@ -2741,7 +2741,7 @@ }, "federation": { "enabled": true, - "serviceSdl": "extend schema\n@link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\n \"@authenticated\"\n \"@composeDirective\"\n \"@external\"\n \"@extends\"\n \"@inaccessible\"\n \"@interfaceObject\"\n \"@override\"\n \"@provides\"\n \"@key\"\n \"@requires\"\n \"@requiresScopes\"\n \"@shareable\"\n \"@tag\"\n ]\n)\n\ndirective @goField(\n forceResolver: Boolean\n name: String\n omittable: Boolean\n) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION\n\ndirective @openfed__requireFetchReasons repeatable on FIELD_DEFINITION | INTERFACE | OBJECT\n\ntype Query {\n employee(id: Int! @cost(weight: 2)): Employee @cost(weight: 5) @openfed__requireFetchReasons\n employeeAsList(id: Int!): [Employee]\n employees: [Employee] @listSize(assumedSize: 50)\n products: [Products!]!\n teammates(team: Department!): [Employee!]!\n firstEmployee: Employee! @tag(name: \"internal\")\n findEmployeesBy(criteria: FindEmployeeCriteria!): [Employee!]!\n}\n\nscalar Upload\n\ntype Mutation {\n updateEmployeeTag(id: Int!, tag: String!): Employee\n\n singleUpload(file: Upload!): Boolean!\n singleUploadWithInput(arg: FileUpload!): Boolean!\n multipleUpload(files: [Upload!]!): Boolean!\n}\n\ninput FileUpload {\n nested: DeeplyNestedFileUpload\n nestedList: [Upload!]\n}\n\ninput DeeplyNestedFileUpload {\n file: Upload!\n}\n\ntype Subscription {\n \"\"\"\n `currentTime` will return a stream of `Time` objects.\n \"\"\"\n currentTime: Time!\n countEmp(max: Int!, intervalMilliseconds: Int!): Int!\n countEmp2(max: Int!, intervalMilliseconds: Int!): Int!\n countFor(count: Int!): Int!\n}\n\nenum Department @cost(weight: 1) {\n ENGINEERING\n MARKETING\n OPERATIONS\n}\n\ninterface RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum EngineerType {\n BACKEND\n FRONTEND\n FULLSTACK\n}\n\ninterface Identifiable @openfed__requireFetchReasons {\n id: Int!\n}\n\ntype Engineer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n engineerType: EngineerType!\n}\n\ntype Marketer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum OperationType {\n FINANCE\n HUMAN_RESOURCES\n}\n\ntype Operator implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n operatorType: [OperationType!]!\n}\n\ntype Details {\n forename: String! @shareable\n location: Country!\n surname: String! @shareable\n pastLocations: [City!]!\n}\n\ntype City {\n type: String!\n name: String!\n country: Country\n}\n\n# Using a nested key field simply because it can showcase potential bug\n# vectors / Federation capabilities.\ntype Country @key(fields: \"key { name }\", resolvable: false) {\n key: CountryKey!\n}\n\ntype CountryKey {\n name: String!\n}\n\nenum Mood {\n HAPPY\n SAD\n}\n\ntype Employee implements Identifiable @key(fields: \"id\") {\n details: Details! @shareable\n id: Int!\n tag: String!\n expertise: String!\n role: RoleType! @listSize(assumedSize: 3, sizedFields: [\"departments\"])\n notes: String @shareable\n updatedAt: String!\n startDate: String! @requiresScopes(scopes: [[\"read:employee\", \"read:private\"], [\"read:all\"]])\n currentMood: Mood! @external\n derivedMood: Mood! @requires(fields: \"currentMood\")\n # From the `availability` service. Only defined for use in @requires\n isAvailable: Boolean @external\n rootFieldThrowsError: String @goField(forceResolver: true)\n rootFieldErrorWrapper: ErrorWrapper @goField(forceResolver: true)\n}\n\ntype ErrorWrapper {\n okField: String\n errorField: String @goField(forceResolver: true)\n}\n\ntype Time {\n unixTime: Int!\n timeStamp: String!\n}\n\nunion Products = Consultancy | Cosmo | SDK\n\ninterface IProduct {\n upc: ID!\n engineers: [Employee!]!\n}\n\ntype Consultancy @key(fields: \"upc\") {\n upc: ID!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype Cosmo implements IProduct @key(fields: \"upc\") @cost(weight: 5) {\n upc: ID!\n engineers: [Employee!]!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype SDK implements IProduct @key(fields: \"upc\") {\n upc: ID!\n engineers: [Employee!]!\n owner: Employee!\n unicode: String!\n}\n\ninput FindEmployeeCriteria @oneOf {\n id: Int\n department: Department\n title: String\n}" + "serviceSdl": "extend schema\n@link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\n \"@authenticated\"\n \"@composeDirective\"\n \"@external\"\n \"@extends\"\n \"@inaccessible\"\n \"@interfaceObject\"\n \"@override\"\n \"@provides\"\n \"@key\"\n \"@requires\"\n \"@requiresScopes\"\n \"@shareable\"\n \"@tag\"\n ]\n)\n\ndirective @cost(weight: Int!) on\n | ARGUMENT_DEFINITION\n | ENUM\n | FIELD_DEFINITION\n | INPUT_FIELD_DEFINITION\n | OBJECT\n | SCALAR\n\ndirective @listSize(\n assumedSize: Int,\n slicingArguments: [String!],\n sizedFields: [String!],\n requireOneSlicingArgument: Boolean = true\n) on FIELD_DEFINITION\n\ndirective @goField(\n forceResolver: Boolean\n name: String\n omittable: Boolean\n) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION\n\ndirective @openfed__requireFetchReasons repeatable on FIELD_DEFINITION | INTERFACE | OBJECT\n\ntype Query {\n employee(id: Int! @cost(weight: 2)): Employee @cost(weight: 5) @openfed__requireFetchReasons\n employeeAsList(id: Int!): [Employee]\n employees: [Employee] @listSize(assumedSize: 50)\n products: [Products!]!\n teammates(team: Department!): [Employee!]!\n firstEmployee: Employee! @tag(name: \"internal\")\n findEmployeesBy(criteria: FindEmployeeCriteria!): [Employee!]!\n}\n\nscalar Upload\n\ntype Mutation {\n updateEmployeeTag(id: Int!, tag: String!): Employee\n\n singleUpload(file: Upload!): Boolean!\n singleUploadWithInput(arg: FileUpload!): Boolean!\n multipleUpload(files: [Upload!]!): Boolean!\n}\n\ninput FileUpload {\n nested: DeeplyNestedFileUpload\n nestedList: [Upload!]\n}\n\ninput DeeplyNestedFileUpload {\n file: Upload!\n}\n\ntype Subscription {\n \"\"\"\n `currentTime` will return a stream of `Time` objects.\n \"\"\"\n currentTime: Time!\n countEmp(max: Int!, intervalMilliseconds: Int!): Int!\n countEmp2(max: Int!, intervalMilliseconds: Int!): Int!\n countFor(count: Int!): Int!\n}\n\nenum Department @cost(weight: 1) {\n ENGINEERING\n MARKETING\n OPERATIONS\n}\n\ninterface RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum EngineerType {\n BACKEND\n FRONTEND\n FULLSTACK\n}\n\ninterface Identifiable @openfed__requireFetchReasons {\n id: Int!\n}\n\ntype Engineer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n engineerType: EngineerType!\n}\n\ntype Marketer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum OperationType {\n FINANCE\n HUMAN_RESOURCES\n}\n\ntype Operator implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n operatorType: [OperationType!]!\n}\n\ntype Details {\n forename: String! @shareable\n location: Country!\n surname: String! @shareable\n pastLocations: [City!]!\n}\n\ntype City {\n type: String!\n name: String!\n country: Country\n}\n\n# Using a nested key field simply because it can showcase potential bug\n# vectors / Federation capabilities.\ntype Country @key(fields: \"key { name }\", resolvable: false) {\n key: CountryKey!\n}\n\ntype CountryKey {\n name: String!\n}\n\nenum Mood {\n HAPPY\n SAD\n}\n\ntype Employee implements Identifiable @key(fields: \"id\") {\n details: Details! @shareable\n id: Int!\n tag: String!\n expertise: String!\n role: RoleType! @listSize(assumedSize: 3, sizedFields: [\"departments\"])\n notes: String @shareable\n updatedAt: String!\n startDate: String! @requiresScopes(scopes: [[\"read:employee\", \"read:private\"], [\"read:all\"]])\n currentMood: Mood! @external\n derivedMood: Mood! @requires(fields: \"currentMood\")\n # From the `availability` service. Only defined for use in @requires\n isAvailable: Boolean @external\n rootFieldThrowsError: String @goField(forceResolver: true)\n rootFieldErrorWrapper: ErrorWrapper @goField(forceResolver: true)\n}\n\ntype ErrorWrapper {\n okField: String\n errorField: String @goField(forceResolver: true)\n}\n\ntype Time {\n unixTime: Int!\n timeStamp: String!\n}\n\nunion Products = Consultancy | Cosmo | SDK\n\ninterface IProduct {\n upc: ID!\n engineers: [Employee!]!\n}\n\ntype Consultancy @key(fields: \"upc\") {\n upc: ID!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype Cosmo implements IProduct @key(fields: \"upc\") @cost(weight: 5) {\n upc: ID!\n engineers: [Employee!]!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype SDK implements IProduct @key(fields: \"upc\") {\n upc: ID!\n engineers: [Employee!]!\n owner: Employee!\n unicode: String!\n}\n\ninput FindEmployeeCriteria @oneOf {\n id: Int\n department: Department\n title: String\n}" }, "upstreamSchema": { "key": "5a6472c2e0ff922b296480a3d90be693885d95a5" diff --git a/router-tests/testenv/testdata/configWithEdfs.json b/router-tests/testenv/testdata/configWithEdfs.json index 1c327fc552..b01154e2f0 100644 --- a/router-tests/testenv/testdata/configWithEdfs.json +++ b/router-tests/testenv/testdata/configWithEdfs.json @@ -200,7 +200,7 @@ }, "federation": { "enabled": true, - "serviceSdl": "extend schema\n@link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\n \"@authenticated\"\n \"@composeDirective\"\n \"@external\"\n \"@extends\"\n \"@inaccessible\"\n \"@interfaceObject\"\n \"@override\"\n \"@provides\"\n \"@key\"\n \"@requires\"\n \"@requiresScopes\"\n \"@shareable\"\n \"@tag\"\n ]\n)\n\ndirective @goField(\n forceResolver: Boolean\n name: String\n omittable: Boolean\n) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION\n\ndirective @openfed__requireFetchReasons repeatable on FIELD_DEFINITION | INTERFACE | OBJECT\n\ntype Query {\n employee(id: Int! @cost(weight: 2)): Employee @cost(weight: 5) @openfed__requireFetchReasons\n employeeAsList(id: Int!): [Employee]\n employees: [Employee] @listSize(assumedSize: 50)\n products: [Products!]!\n teammates(team: Department!): [Employee!]!\n firstEmployee: Employee! @tag(name: \"internal\")\n findEmployeesBy(criteria: FindEmployeeCriteria!): [Employee!]!\n}\n\nscalar Upload\n\ntype Mutation {\n updateEmployeeTag(id: Int!, tag: String!): Employee\n\n singleUpload(file: Upload!): Boolean!\n singleUploadWithInput(arg: FileUpload!): Boolean!\n multipleUpload(files: [Upload!]!): Boolean!\n}\n\ninput FileUpload {\n nested: DeeplyNestedFileUpload\n nestedList: [Upload!]\n}\n\ninput DeeplyNestedFileUpload {\n file: Upload!\n}\n\ntype Subscription {\n \"\"\"\n `currentTime` will return a stream of `Time` objects.\n \"\"\"\n currentTime: Time!\n countEmp(max: Int!, intervalMilliseconds: Int!): Int!\n countEmp2(max: Int!, intervalMilliseconds: Int!): Int!\n countFor(count: Int!): Int!\n}\n\nenum Department @cost(weight: 1) {\n ENGINEERING\n MARKETING\n OPERATIONS\n}\n\ninterface RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum EngineerType {\n BACKEND\n FRONTEND\n FULLSTACK\n}\n\ninterface Identifiable @openfed__requireFetchReasons {\n id: Int!\n}\n\ntype Engineer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n engineerType: EngineerType!\n}\n\ntype Marketer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum OperationType {\n FINANCE\n HUMAN_RESOURCES\n}\n\ntype Operator implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n operatorType: [OperationType!]!\n}\n\ntype Details {\n forename: String! @shareable\n location: Country!\n surname: String! @shareable\n pastLocations: [City!]!\n}\n\ntype City {\n type: String!\n name: String!\n country: Country\n}\n\n# Using a nested key field simply because it can showcase potential bug\n# vectors / Federation capabilities.\ntype Country @key(fields: \"key { name }\", resolvable: false) {\n key: CountryKey!\n}\n\ntype CountryKey {\n name: String!\n}\n\nenum Mood {\n HAPPY\n SAD\n}\n\ntype Employee implements Identifiable @key(fields: \"id\") {\n details: Details! @shareable\n id: Int!\n tag: String!\n expertise: String!\n role: RoleType! @listSize(assumedSize: 3, sizedFields: [\"departments\"])\n notes: String @shareable\n updatedAt: String!\n startDate: String! @requiresScopes(scopes: [[\"read:employee\", \"read:private\"], [\"read:all\"]])\n currentMood: Mood! @external\n derivedMood: Mood! @requires(fields: \"currentMood\")\n # From the `availability` service. Only defined for use in @requires\n isAvailable: Boolean @external\n rootFieldThrowsError: String @goField(forceResolver: true)\n rootFieldErrorWrapper: ErrorWrapper @goField(forceResolver: true)\n}\n\ntype ErrorWrapper {\n okField: String\n errorField: String @goField(forceResolver: true)\n}\n\ntype Time {\n unixTime: Int!\n timeStamp: String!\n}\n\nunion Products = Consultancy | Cosmo | SDK\n\ninterface IProduct {\n upc: ID!\n engineers: [Employee!]!\n}\n\ntype Consultancy @key(fields: \"upc\") {\n upc: ID!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype Cosmo implements IProduct @key(fields: \"upc\") @cost(weight: 5) {\n upc: ID!\n engineers: [Employee!]!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype SDK implements IProduct @key(fields: \"upc\") {\n upc: ID!\n engineers: [Employee!]!\n owner: Employee!\n unicode: String!\n}\n\ninput FindEmployeeCriteria @oneOf {\n id: Int\n department: Department\n title: String\n}" + "serviceSdl": "extend schema\n@link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\n \"@authenticated\"\n \"@composeDirective\"\n \"@external\"\n \"@extends\"\n \"@inaccessible\"\n \"@interfaceObject\"\n \"@override\"\n \"@provides\"\n \"@key\"\n \"@requires\"\n \"@requiresScopes\"\n \"@shareable\"\n \"@tag\"\n ]\n)\n\ndirective @cost(weight: Int!) on\n | ARGUMENT_DEFINITION\n | ENUM\n | FIELD_DEFINITION\n | INPUT_FIELD_DEFINITION\n | OBJECT\n | SCALAR\n\ndirective @listSize(\n assumedSize: Int,\n slicingArguments: [String!],\n sizedFields: [String!],\n requireOneSlicingArgument: Boolean = true\n) on FIELD_DEFINITION\n\ndirective @goField(\n forceResolver: Boolean\n name: String\n omittable: Boolean\n) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION\n\ndirective @openfed__requireFetchReasons repeatable on FIELD_DEFINITION | INTERFACE | OBJECT\n\ntype Query {\n employee(id: Int! @cost(weight: 2)): Employee @cost(weight: 5) @openfed__requireFetchReasons\n employeeAsList(id: Int!): [Employee]\n employees: [Employee] @listSize(assumedSize: 50)\n products: [Products!]!\n teammates(team: Department!): [Employee!]!\n firstEmployee: Employee! @tag(name: \"internal\")\n findEmployeesBy(criteria: FindEmployeeCriteria!): [Employee!]!\n}\n\nscalar Upload\n\ntype Mutation {\n updateEmployeeTag(id: Int!, tag: String!): Employee\n\n singleUpload(file: Upload!): Boolean!\n singleUploadWithInput(arg: FileUpload!): Boolean!\n multipleUpload(files: [Upload!]!): Boolean!\n}\n\ninput FileUpload {\n nested: DeeplyNestedFileUpload\n nestedList: [Upload!]\n}\n\ninput DeeplyNestedFileUpload {\n file: Upload!\n}\n\ntype Subscription {\n \"\"\"\n `currentTime` will return a stream of `Time` objects.\n \"\"\"\n currentTime: Time!\n countEmp(max: Int!, intervalMilliseconds: Int!): Int!\n countEmp2(max: Int!, intervalMilliseconds: Int!): Int!\n countFor(count: Int!): Int!\n}\n\nenum Department @cost(weight: 1) {\n ENGINEERING\n MARKETING\n OPERATIONS\n}\n\ninterface RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum EngineerType {\n BACKEND\n FRONTEND\n FULLSTACK\n}\n\ninterface Identifiable @openfed__requireFetchReasons {\n id: Int!\n}\n\ntype Engineer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n engineerType: EngineerType!\n}\n\ntype Marketer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum OperationType {\n FINANCE\n HUMAN_RESOURCES\n}\n\ntype Operator implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n operatorType: [OperationType!]!\n}\n\ntype Details {\n forename: String! @shareable\n location: Country!\n surname: String! @shareable\n pastLocations: [City!]!\n}\n\ntype City {\n type: String!\n name: String!\n country: Country\n}\n\n# Using a nested key field simply because it can showcase potential bug\n# vectors / Federation capabilities.\ntype Country @key(fields: \"key { name }\", resolvable: false) {\n key: CountryKey!\n}\n\ntype CountryKey {\n name: String!\n}\n\nenum Mood {\n HAPPY\n SAD\n}\n\ntype Employee implements Identifiable @key(fields: \"id\") {\n details: Details! @shareable\n id: Int!\n tag: String!\n expertise: String!\n role: RoleType! @listSize(assumedSize: 3, sizedFields: [\"departments\"])\n notes: String @shareable\n updatedAt: String!\n startDate: String! @requiresScopes(scopes: [[\"read:employee\", \"read:private\"], [\"read:all\"]])\n currentMood: Mood! @external\n derivedMood: Mood! @requires(fields: \"currentMood\")\n # From the `availability` service. Only defined for use in @requires\n isAvailable: Boolean @external\n rootFieldThrowsError: String @goField(forceResolver: true)\n rootFieldErrorWrapper: ErrorWrapper @goField(forceResolver: true)\n}\n\ntype ErrorWrapper {\n okField: String\n errorField: String @goField(forceResolver: true)\n}\n\ntype Time {\n unixTime: Int!\n timeStamp: String!\n}\n\nunion Products = Consultancy | Cosmo | SDK\n\ninterface IProduct {\n upc: ID!\n engineers: [Employee!]!\n}\n\ntype Consultancy @key(fields: \"upc\") {\n upc: ID!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype Cosmo implements IProduct @key(fields: \"upc\") @cost(weight: 5) {\n upc: ID!\n engineers: [Employee!]!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype SDK implements IProduct @key(fields: \"upc\") {\n upc: ID!\n engineers: [Employee!]!\n owner: Employee!\n unicode: String!\n}\n\ninput FindEmployeeCriteria @oneOf {\n id: Int\n department: Department\n title: String\n}" }, "upstreamSchema": { "key": "5a6472c2e0ff922b296480a3d90be693885d95a5" @@ -656,7 +656,7 @@ }, "federation": { "enabled": true, - "serviceSdl": "extend schema\n@link(url: \"https://specs.apollo.dev/federation/v2.5\", import: [\"@authenticated\", \"@composeDirective\", \"@external\", \"@extends\", \"@inaccessible\", \"@interfaceObject\", \"@override\", \"@provides\", \"@key\", \"@requires\", \"@requiresScopes\", \"@shareable\", \"@tag\"])\n\nschema {\n query: Queries\n mutation: Mutation\n}\n\ntype Queries {\n productTypes: [Products!]! @listSize(assumedSize: 50)\n topSecretFederationFacts: [TopSecretFact!]! @requiresScopes(scopes: [[\"read:fact\"], [\"read:all\"]])\n factTypes: [TopSecretFactType!]\n sharedThings(numOfA: Int! numOfB: Int!): [Thing!]! @listSize(slicingArguments: [\"numOfA\"]) @shareable\n}\n\ntype Mutation {\n addFact(fact: TopSecretFactInput!): TopSecretFact! @requiresScopes(scopes: [[\"write:fact\"], [\"write:all\"]])\n}\n\ntype Thing @shareable {\n a: String!\n}\n\ninput TopSecretFactInput {\n title: String!\n description: FactContent!\n factType: TopSecretFactType!\n}\n\nenum TopSecretFactType @authenticated {\n DIRECTIVE,\n ENTITY,\n MISCELLANEOUS,\n}\n\ninterface TopSecretFact @authenticated {\n description: FactContent!\n factType: TopSecretFactType\n}\n\nscalar FactContent @cost(weight: 10) @requiresScopes(scopes: [[\"read:scalar\"], [\"read:all\"]])\n\ntype DirectiveFact implements TopSecretFact @authenticated {\n title: String!\n description: FactContent!\n factType: TopSecretFactType\n}\n\ntype EntityFact implements TopSecretFact @requiresScopes(scopes: [[\"read:entity\"]]){\n title: String!\n description: FactContent!\n factType: TopSecretFactType\n}\n\ntype MiscellaneousFact implements TopSecretFact {\n title: String!\n description: FactContent! @requiresScopes(scopes: [[\"read:miscellaneous\"]])\n factType: TopSecretFactType\n}\n\nenum ProductName {\n CONSULTANCY\n COSMO\n ENGINE\n FINANCE\n HUMAN_RESOURCES\n MARKETING\n SDK\n}\n\ntype Employee @key(fields: \"id\") {\n id: Int!\n products: [ProductName!]!\n notes: String @override(from: \"employees\")\n}\n\nunion Products = Consultancy | Cosmo | Documentation\n\ntype Consultancy @key(fields: \"upc\") {\n upc: ID!\n name: ProductName!\n}\n\ntype Cosmo @key(fields: \"upc\") @cost(weight: 8) {\n upc: ID!\n name: ProductName!\n repositoryURL: String!\n}\n\ntype Documentation {\n url(product: ProductName!): String!\n urls(products: [ProductName!]!): [String!]!\n}\n" + "serviceSdl": "extend schema\n@link(url: \"https://specs.apollo.dev/federation/v2.5\", import: [\"@authenticated\", \"@composeDirective\", \"@external\", \"@extends\", \"@inaccessible\", \"@interfaceObject\", \"@override\", \"@provides\", \"@key\", \"@requires\", \"@requiresScopes\", \"@shareable\", \"@tag\"])\n\ndirective @cost(weight: Int!) on\n | ARGUMENT_DEFINITION\n | ENUM\n | FIELD_DEFINITION\n | INPUT_FIELD_DEFINITION\n | OBJECT\n | SCALAR\n\ndirective @listSize(\n assumedSize: Int,\n slicingArguments: [String!],\n sizedFields: [String!],\n requireOneSlicingArgument: Boolean = true\n) on FIELD_DEFINITION\n\nschema {\n query: Queries\n mutation: Mutation\n}\n\ntype Queries {\n productTypes: [Products!]! @listSize(assumedSize: 50)\n topSecretFederationFacts: [TopSecretFact!]! @requiresScopes(scopes: [[\"read:fact\"], [\"read:all\"]])\n factTypes: [TopSecretFactType!]\n sharedThings(numOfA: Int! numOfB: Int!): [Thing!]! @listSize(slicingArguments: [\"numOfA\"]) @shareable\n}\n\ntype Mutation {\n addFact(fact: TopSecretFactInput!): TopSecretFact! @requiresScopes(scopes: [[\"write:fact\"], [\"write:all\"]])\n}\n\ntype Thing @shareable {\n a: String!\n}\n\ninput TopSecretFactInput {\n title: String!\n description: FactContent!\n factType: TopSecretFactType!\n}\n\nenum TopSecretFactType @authenticated {\n DIRECTIVE,\n ENTITY,\n MISCELLANEOUS,\n}\n\ninterface TopSecretFact @authenticated {\n description: FactContent!\n factType: TopSecretFactType\n}\n\nscalar FactContent @cost(weight: 10) @requiresScopes(scopes: [[\"read:scalar\"], [\"read:all\"]])\n\ntype DirectiveFact implements TopSecretFact @authenticated {\n title: String!\n description: FactContent!\n factType: TopSecretFactType\n}\n\ntype EntityFact implements TopSecretFact @requiresScopes(scopes: [[\"read:entity\"]]){\n title: String!\n description: FactContent!\n factType: TopSecretFactType\n}\n\ntype MiscellaneousFact implements TopSecretFact {\n title: String!\n description: FactContent! @requiresScopes(scopes: [[\"read:miscellaneous\"]])\n factType: TopSecretFactType\n}\n\nenum ProductName {\n CONSULTANCY\n COSMO\n ENGINE\n FINANCE\n HUMAN_RESOURCES\n MARKETING\n SDK\n}\n\ntype Employee @key(fields: \"id\") {\n id: Int!\n products: [ProductName!]!\n notes: String @override(from: \"employees\")\n}\n\nunion Products = Consultancy | Cosmo | Documentation\n\ntype Consultancy @key(fields: \"upc\") {\n upc: ID!\n name: ProductName!\n}\n\ntype Cosmo @key(fields: \"upc\") @cost(weight: 8) {\n upc: ID!\n name: ProductName!\n repositoryURL: String!\n}\n\ntype Documentation {\n url(product: ProductName!): String!\n urls(products: [ProductName!]!): [String!]!\n}\n" }, "upstreamSchema": { "key": "d50db561f5f30b98dc797f7c9b4a927da2cb7e3e" @@ -3245,7 +3245,7 @@ }, "federation": { "enabled": true, - "serviceSdl": "extend schema\n@link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\n \"@authenticated\"\n \"@composeDirective\"\n \"@external\"\n \"@extends\"\n \"@inaccessible\"\n \"@interfaceObject\"\n \"@override\"\n \"@provides\"\n \"@key\"\n \"@requires\"\n \"@requiresScopes\"\n \"@shareable\"\n \"@tag\"\n ]\n)\n\ndirective @goField(\n forceResolver: Boolean\n name: String\n omittable: Boolean\n) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION\n\ndirective @openfed__requireFetchReasons repeatable on FIELD_DEFINITION | INTERFACE | OBJECT\n\ntype Query {\n employee(id: Int! @cost(weight: 2)): Employee @cost(weight: 5) @openfed__requireFetchReasons\n employeeAsList(id: Int!): [Employee]\n employees: [Employee] @listSize(assumedSize: 50)\n products: [Products!]!\n teammates(team: Department!): [Employee!]!\n firstEmployee: Employee! @tag(name: \"internal\")\n findEmployeesBy(criteria: FindEmployeeCriteria!): [Employee!]!\n}\n\nscalar Upload\n\ntype Mutation {\n updateEmployeeTag(id: Int!, tag: String!): Employee\n\n singleUpload(file: Upload!): Boolean!\n singleUploadWithInput(arg: FileUpload!): Boolean!\n multipleUpload(files: [Upload!]!): Boolean!\n}\n\ninput FileUpload {\n nested: DeeplyNestedFileUpload\n nestedList: [Upload!]\n}\n\ninput DeeplyNestedFileUpload {\n file: Upload!\n}\n\ntype Subscription {\n \"\"\"\n `currentTime` will return a stream of `Time` objects.\n \"\"\"\n currentTime: Time!\n countEmp(max: Int!, intervalMilliseconds: Int!): Int!\n countEmp2(max: Int!, intervalMilliseconds: Int!): Int!\n countFor(count: Int!): Int!\n}\n\nenum Department @cost(weight: 1) {\n ENGINEERING\n MARKETING\n OPERATIONS\n}\n\ninterface RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum EngineerType {\n BACKEND\n FRONTEND\n FULLSTACK\n}\n\ninterface Identifiable @openfed__requireFetchReasons {\n id: Int!\n}\n\ntype Engineer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n engineerType: EngineerType!\n}\n\ntype Marketer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum OperationType {\n FINANCE\n HUMAN_RESOURCES\n}\n\ntype Operator implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n operatorType: [OperationType!]!\n}\n\ntype Details {\n forename: String! @shareable\n location: Country!\n surname: String! @shareable\n pastLocations: [City!]!\n}\n\ntype City {\n type: String!\n name: String!\n country: Country\n}\n\n# Using a nested key field simply because it can showcase potential bug\n# vectors / Federation capabilities.\ntype Country @key(fields: \"key { name }\", resolvable: false) {\n key: CountryKey!\n}\n\ntype CountryKey {\n name: String!\n}\n\nenum Mood {\n HAPPY\n SAD\n}\n\ntype Employee implements Identifiable @key(fields: \"id\") {\n details: Details! @shareable\n id: Int!\n tag: String!\n expertise: String!\n role: RoleType! @listSize(assumedSize: 3, sizedFields: [\"departments\"])\n notes: String @shareable\n updatedAt: String!\n startDate: String! @requiresScopes(scopes: [[\"read:employee\", \"read:private\"], [\"read:all\"]])\n currentMood: Mood! @external\n derivedMood: Mood! @requires(fields: \"currentMood\")\n # From the `availability` service. Only defined for use in @requires\n isAvailable: Boolean @external\n rootFieldThrowsError: String @goField(forceResolver: true)\n rootFieldErrorWrapper: ErrorWrapper @goField(forceResolver: true)\n}\n\ntype ErrorWrapper {\n okField: String\n errorField: String @goField(forceResolver: true)\n}\n\ntype Time {\n unixTime: Int!\n timeStamp: String!\n}\n\nunion Products = Consultancy | Cosmo | SDK\n\ninterface IProduct {\n upc: ID!\n engineers: [Employee!]!\n}\n\ntype Consultancy @key(fields: \"upc\") {\n upc: ID!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype Cosmo implements IProduct @key(fields: \"upc\") @cost(weight: 5) {\n upc: ID!\n engineers: [Employee!]!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype SDK implements IProduct @key(fields: \"upc\") {\n upc: ID!\n engineers: [Employee!]!\n owner: Employee!\n unicode: String!\n}\n\ninput FindEmployeeCriteria @oneOf {\n id: Int\n department: Department\n title: String\n}" + "serviceSdl": "extend schema\n@link(\n url: \"https://specs.apollo.dev/federation/v2.5\"\n import: [\n \"@authenticated\"\n \"@composeDirective\"\n \"@external\"\n \"@extends\"\n \"@inaccessible\"\n \"@interfaceObject\"\n \"@override\"\n \"@provides\"\n \"@key\"\n \"@requires\"\n \"@requiresScopes\"\n \"@shareable\"\n \"@tag\"\n ]\n)\n\ndirective @cost(weight: Int!) on\n | ARGUMENT_DEFINITION\n | ENUM\n | FIELD_DEFINITION\n | INPUT_FIELD_DEFINITION\n | OBJECT\n | SCALAR\n\ndirective @listSize(\n assumedSize: Int,\n slicingArguments: [String!],\n sizedFields: [String!],\n requireOneSlicingArgument: Boolean = true\n) on FIELD_DEFINITION\n\ndirective @goField(\n forceResolver: Boolean\n name: String\n omittable: Boolean\n) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION\n\ndirective @openfed__requireFetchReasons repeatable on FIELD_DEFINITION | INTERFACE | OBJECT\n\ntype Query {\n employee(id: Int! @cost(weight: 2)): Employee @cost(weight: 5) @openfed__requireFetchReasons\n employeeAsList(id: Int!): [Employee]\n employees: [Employee] @listSize(assumedSize: 50)\n products: [Products!]!\n teammates(team: Department!): [Employee!]!\n firstEmployee: Employee! @tag(name: \"internal\")\n findEmployeesBy(criteria: FindEmployeeCriteria!): [Employee!]!\n}\n\nscalar Upload\n\ntype Mutation {\n updateEmployeeTag(id: Int!, tag: String!): Employee\n\n singleUpload(file: Upload!): Boolean!\n singleUploadWithInput(arg: FileUpload!): Boolean!\n multipleUpload(files: [Upload!]!): Boolean!\n}\n\ninput FileUpload {\n nested: DeeplyNestedFileUpload\n nestedList: [Upload!]\n}\n\ninput DeeplyNestedFileUpload {\n file: Upload!\n}\n\ntype Subscription {\n \"\"\"\n `currentTime` will return a stream of `Time` objects.\n \"\"\"\n currentTime: Time!\n countEmp(max: Int!, intervalMilliseconds: Int!): Int!\n countEmp2(max: Int!, intervalMilliseconds: Int!): Int!\n countFor(count: Int!): Int!\n}\n\nenum Department @cost(weight: 1) {\n ENGINEERING\n MARKETING\n OPERATIONS\n}\n\ninterface RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum EngineerType {\n BACKEND\n FRONTEND\n FULLSTACK\n}\n\ninterface Identifiable @openfed__requireFetchReasons {\n id: Int!\n}\n\ntype Engineer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n engineerType: EngineerType!\n}\n\ntype Marketer implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n}\n\nenum OperationType {\n FINANCE\n HUMAN_RESOURCES\n}\n\ntype Operator implements RoleType {\n departments: [Department!]!\n title: [String!]!\n employees: [Employee!]! @goField(forceResolver: true)\n operatorType: [OperationType!]!\n}\n\ntype Details {\n forename: String! @shareable\n location: Country!\n surname: String! @shareable\n pastLocations: [City!]!\n}\n\ntype City {\n type: String!\n name: String!\n country: Country\n}\n\n# Using a nested key field simply because it can showcase potential bug\n# vectors / Federation capabilities.\ntype Country @key(fields: \"key { name }\", resolvable: false) {\n key: CountryKey!\n}\n\ntype CountryKey {\n name: String!\n}\n\nenum Mood {\n HAPPY\n SAD\n}\n\ntype Employee implements Identifiable @key(fields: \"id\") {\n details: Details! @shareable\n id: Int!\n tag: String!\n expertise: String!\n role: RoleType! @listSize(assumedSize: 3, sizedFields: [\"departments\"])\n notes: String @shareable\n updatedAt: String!\n startDate: String! @requiresScopes(scopes: [[\"read:employee\", \"read:private\"], [\"read:all\"]])\n currentMood: Mood! @external\n derivedMood: Mood! @requires(fields: \"currentMood\")\n # From the `availability` service. Only defined for use in @requires\n isAvailable: Boolean @external\n rootFieldThrowsError: String @goField(forceResolver: true)\n rootFieldErrorWrapper: ErrorWrapper @goField(forceResolver: true)\n}\n\ntype ErrorWrapper {\n okField: String\n errorField: String @goField(forceResolver: true)\n}\n\ntype Time {\n unixTime: Int!\n timeStamp: String!\n}\n\nunion Products = Consultancy | Cosmo | SDK\n\ninterface IProduct {\n upc: ID!\n engineers: [Employee!]!\n}\n\ntype Consultancy @key(fields: \"upc\") {\n upc: ID!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype Cosmo implements IProduct @key(fields: \"upc\") @cost(weight: 5) {\n upc: ID!\n engineers: [Employee!]!\n lead: Employee!\n isLeadAvailable: Boolean @requires(fields: \"lead { isAvailable }\")\n}\n\ntype SDK implements IProduct @key(fields: \"upc\") {\n upc: ID!\n engineers: [Employee!]!\n owner: Employee!\n unicode: String!\n}\n\ninput FindEmployeeCriteria @oneOf {\n id: Int\n department: Department\n title: String\n}" }, "upstreamSchema": { "key": "5a6472c2e0ff922b296480a3d90be693885d95a5" diff --git a/router-tests/update-config-no-edg.sh b/router-tests/update-config-no-edg.sh index b017145b6b..e26bccbd56 100755 --- a/router-tests/update-config-no-edg.sh +++ b/router-tests/update-config-no-edg.sh @@ -1,11 +1,13 @@ #!/bin/bash +set -e + # js composition ## using source code echo "Generating config using 'wgc router compose'" -pnpx tsx --env-file ../cli/.env ../cli/src/index.ts router compose -i ../demo/graph-no-edg.yaml -o ../router-tests/testenv/testdata/config.json +pnpx tsx ../cli/src/index.ts router compose -i ../demo/graph-no-edg.yaml -o ../router-tests/testenv/testdata/config.json ## using npm package diff --git a/router-tests/update-config.sh b/router-tests/update-config.sh index c7136e7274..9aad587d96 100755 --- a/router-tests/update-config.sh +++ b/router-tests/update-config.sh @@ -1,12 +1,14 @@ #!/bin/bash +set -e + # js composition ## using source code echo "Generating config using 'wgc router compose'" cd "../cli" || exit -pnpx tsx --env-file ../cli/.env ../cli/src/index.ts router compose -i ../demo/graph.yaml -o ../router-tests/testenv/testdata/configWithEdfs.json +pnpx tsx ../cli/src/index.ts router compose -i ../demo/graph.yaml -o ../router-tests/testenv/testdata/configWithEdfs.json ## using npm package