From d4657f066c012817f8f0b76466d9ad00cc5ec2eb Mon Sep 17 00:00:00 2001 From: Dylan Anthony Date: Tue, 29 Oct 2024 09:06:16 -0600 Subject: [PATCH] Regenerate expansion supergraphs (#6201) --- .../tests/schemas/expand/carryover.graphql | 10 +-- .../tests/schemas/expand/carryover.yaml | 2 - .../tests/schemas/expand/circular.graphql | 68 ------------------- .../expand/tests/schemas/expand/circular.yaml | 33 --------- .../expand/tests/schemas/expand/keys.graphql | 1 + .../expand/tests/schemas/expand/keys.yaml | 4 +- .../schemas/expand/nested_inputs.graphql | 14 +++- .../tests/schemas/expand/nested_inputs.yaml | 1 - .../schemas/expand/normalize_names.graphql | 56 ++++++++------- .../tests/schemas/expand/normalize_names.yaml | 1 - .../tests/schemas/expand/realistic.graphql | 5 +- .../tests/schemas/expand/realistic.yaml | 10 +-- .../tests/schemas/expand/simple.graphql | 14 +++- .../expand/tests/schemas/expand/simple.yaml | 1 - .../tests/schemas/expand/steelthread.graphql | 7 -- .../tests/schemas/expand/steelthread.yaml | 7 -- .../schemas/expand/types_used_twice.graphql | 14 +++- .../schemas/expand/types_used_twice.yaml | 2 - .../tests/schemas/ignore/directives.yaml | 2 - .../expand/tests/schemas/ignore/ignored.yaml | 1 - .../expand/tests/schemas/regenerate.sh | 8 +++ ...expand_supergraph@carryover.graphql-3.snap | 2 +- ...expand_supergraph@realistic.graphql-3.snap | 4 +- ...t_expand_supergraph@realistic.graphql.snap | 5 +- ...expand_supergraph@steelthread.graphql.snap | 5 -- 25 files changed, 94 insertions(+), 183 deletions(-) delete mode 100644 apollo-federation/src/sources/connect/expand/tests/schemas/expand/circular.graphql delete mode 100644 apollo-federation/src/sources/connect/expand/tests/schemas/expand/circular.yaml create mode 100644 apollo-federation/src/sources/connect/expand/tests/schemas/regenerate.sh diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/carryover.graphql b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/carryover.graphql index 6df2b31624..94d0229f0a 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/carryover.graphql +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/carryover.graphql @@ -1,11 +1,11 @@ schema @link(url: "https://specs.apollo.dev/link/v1.0") @link(url: "https://specs.apollo.dev/join/v0.5", for: EXECUTION) - @link(url: "https://specs.apollo.dev/tag/v0.3", import: ["@tag"]) - @link(url: "https://specs.apollo.dev/inaccessible/v0.2", import: ["@inaccessible"], for: SECURITY) - @link(url: "https://specs.apollo.dev/authenticated/v0.1", import: ["@authenticated"], for: SECURITY) - @link(url: "https://specs.apollo.dev/requiresScopes/v0.1", import: ["@requiresScopes"], for: SECURITY) - @link(url: "https://specs.apollo.dev/policy/v0.1", import: ["@policy"], for: SECURITY) + @link(url: "https://specs.apollo.dev/tag/v0.3") + @link(url: "https://specs.apollo.dev/inaccessible/v0.2", for: SECURITY) + @link(url: "https://specs.apollo.dev/authenticated/v0.1", for: SECURITY) + @link(url: "https://specs.apollo.dev/requiresScopes/v0.1", for: SECURITY) + @link(url: "https://specs.apollo.dev/policy/v0.1", for: SECURITY) @link(url: "http://specs.example.org/custom/v0.1", import: ["@custom"]) @link(url: "https://specs.apollo.dev/connect/v0.1", for: EXECUTION) @join__directive(graphs: [ONE], name: "link", args: {url: "https://specs.apollo.dev/connect/v0.1", import: ["@connect", "@source"]}) diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/carryover.yaml b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/carryover.yaml index 1285641eea..97a6c6e900 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/carryover.yaml +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/carryover.yaml @@ -1,5 +1,3 @@ -# rover supergraph compose --config apollo-federation/src/sources/connect/expand/tests/schemas/carryover.yaml > apollo-federation/src/sources/connect/expand/tests/schemas/carryover.graphql -federation_version: =2.10.0-alpha.0 subgraphs: one: routing_url: none diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/circular.graphql b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/circular.graphql deleted file mode 100644 index aea94f29b6..0000000000 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/circular.graphql +++ /dev/null @@ -1,68 +0,0 @@ -schema - @link(url: "https://specs.apollo.dev/link/v1.0") - @link(url: "https://specs.apollo.dev/join/v0.5", for: EXECUTION) - @join__directive(graphs: [ONE], name: "link", args: {url: "https://specs.apollo.dev/connect/v0.1", import: ["@connect", "@source"]}) - @join__directive(graphs: [ONE], name: "source", args: {name: "json", http: {baseURL: "http://example/"}}) -{ - query: Query -} - -directive @join__directive(graphs: [join__Graph!], name: String!, args: join__DirectiveArguments) repeatable on SCHEMA | OBJECT | INTERFACE | FIELD_DEFINITION - -directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE - -directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean, overrideLabel: String, contextArguments: [join__ContextArgument!]) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION - -directive @join__graph(name: String!, url: String!) on ENUM_VALUE - -directive @join__implements(graph: join__Graph!, interface: String!) repeatable on OBJECT | INTERFACE - -directive @join__type(graph: join__Graph!, key: join__FieldSet, extension: Boolean! = false, resolvable: Boolean! = true, isInterfaceObject: Boolean! = false) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR - -directive @join__unionMember(graph: join__Graph!, member: String!) repeatable on UNION - -directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA - -input join__ContextArgument { - name: String! - type: String! - context: String! - selection: join__FieldValue! -} - -scalar join__DirectiveArguments - -scalar join__FieldSet - -scalar join__FieldValue - -enum join__Graph { - ONE @join__graph(name: "one", url: "none") -} - -scalar link__Import - -enum link__Purpose { - """ - `SECURITY` features provide metadata necessary to securely resolve fields. - """ - SECURITY - - """ - `EXECUTION` features provide metadata necessary for operation execution. - """ - EXECUTION -} - -type Query - @join__type(graph: ONE) -{ - t(id: ID): T @join__directive(graphs: [ONE], name: "connect", args: {source: "json", http: {GET: "/t/{$args.id}"}, selection: "id"}) -} - -type T - @join__type(graph: ONE) -{ - id: ID! - ts: [T] @join__directive(graphs: [ONE], name: "connect", args: {source: "json", http: {GET: "/t/{$this.id}/ts"}, selection: "id"}) -} diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/circular.yaml b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/circular.yaml deleted file mode 100644 index f33d3a5b6a..0000000000 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/circular.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# rover supergraph compose --config apollo-federation/src/sources/connect/expand/tests/schemas/circular.yaml > apollo-federation/src/sources/connect/expand/tests/schemas/circular.graphql -federation_version: =2.9.0-connectors.12 -subgraphs: - one: - routing_url: none - schema: - sdl: | - extend schema - @link(url: "https://specs.apollo.dev/federation/v2.8") - @link(url: "https://specs.apollo.dev/connect/v0.1", import: ["@connect", "@source"]) - @source(name: "json" http: { baseURL: "http://example/" }) - - type Query { - t(id: ID): T @connect( - source: "json" - http: { GET: "/t/{$$args.id}" } - selection: """ - id - """ - ) - } - - type T { - id: ID! - ts: [T] - @connect( - source: "json" - http: { GET: "/t/{$$this.id}/ts" } - selection: """ - id - """ - ) - } \ No newline at end of file diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/keys.graphql b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/keys.graphql index fd6fdbb84f..477d52282b 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/keys.graphql +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/keys.graphql @@ -70,6 +70,7 @@ type R type T @join__type(graph: ONE, key: "id") + @join__type(graph: ONE, key: "id id2") { id: ID! id2: ID! diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/keys.yaml b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/keys.yaml index 1c43cf0915..b9c643b4d4 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/keys.yaml +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/keys.yaml @@ -1,5 +1,3 @@ -# rover supergraph compose --config apollo-federation/src/sources/connect/expand/tests/schemas/expand/keys.yaml > apollo-federation/src/sources/connect/expand/tests/schemas/expand/keys.graphql -federation_version: =2.10.0-alpha.3 subgraphs: one: routing_url: none @@ -22,7 +20,7 @@ subgraphs: entity: true ) } - type T @key(fields: "id") { + type T @key(fields: "id") @key(fields: "id id2") { id: ID! id2: ID! r1: R @connect(http: { GET: "http://localhost/rs/{$$this.id}" }, selection: "id id2") # expect `key: "id"`` diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/nested_inputs.graphql b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/nested_inputs.graphql index cc0ff9e4df..192ab5c497 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/nested_inputs.graphql +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/nested_inputs.graphql @@ -1,6 +1,7 @@ schema @link(url: "https://specs.apollo.dev/link/v1.0") - @link(url: "https://specs.apollo.dev/join/v0.4", for: EXECUTION) + @link(url: "https://specs.apollo.dev/join/v0.5", for: EXECUTION) + @link(url: "https://specs.apollo.dev/connect/v0.1", for: EXECUTION) @join__directive(graphs: [CONNECTORS], name: "link", args: {url: "https://specs.apollo.dev/connect/v0.1", import: ["@connect", "@source"]}) @join__directive(graphs: [CONNECTORS], name: "source", args: {name: "example", http: {baseURL: "http://example"}}) { @@ -11,7 +12,7 @@ directive @join__directive(graphs: [join__Graph!], name: String!, args: join__Di directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE -directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean, overrideLabel: String) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION +directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean, overrideLabel: String, contextArguments: [join__ContextArgument!]) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION directive @join__graph(name: String!, url: String!) on ENUM_VALUE @@ -30,10 +31,19 @@ input BazInput quux: QuuxInput } +input join__ContextArgument { + name: String! + type: String! + context: String! + selection: join__FieldValue! +} + scalar join__DirectiveArguments scalar join__FieldSet +scalar join__FieldValue + enum join__Graph { CONNECTORS @join__graph(name: "connectors", url: "none") } diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/nested_inputs.yaml b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/nested_inputs.yaml index 6a7607dba7..5d0ca4fa09 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/nested_inputs.yaml +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/nested_inputs.yaml @@ -1,4 +1,3 @@ -federation_version: =2.9.0-connectors.0 subgraphs: connectors: routing_url: none diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/normalize_names.graphql b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/normalize_names.graphql index 7fe8478a8e..346fd6e0c5 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/normalize_names.graphql +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/normalize_names.graphql @@ -1,17 +1,18 @@ schema -@link(url: "https://specs.apollo.dev/link/v1.0") -@link(url: "https://specs.apollo.dev/join/v0.4", for: EXECUTION) -@join__directive(graphs: [CONNECTORS_SUBGRAPH], name: "link", args: {url: "https://specs.apollo.dev/connect/v0.1", import: ["@connect", "@source"]}) -@join__directive(graphs: [CONNECTORS_SUBGRAPH], name: "source", args: {name: "example", http: {baseURL: "http://example"}}) + @link(url: "https://specs.apollo.dev/link/v1.0") + @link(url: "https://specs.apollo.dev/join/v0.5", for: EXECUTION) + @link(url: "https://specs.apollo.dev/connect/v0.1", for: EXECUTION) + @join__directive(graphs: [CONNECTORS_SUBGRAPH], name: "link", args: {url: "https://specs.apollo.dev/connect/v0.1", import: ["@connect", "@source"]}) + @join__directive(graphs: [CONNECTORS_SUBGRAPH], name: "source", args: {name: "example", http: {baseURL: "http://example"}}) { - query: Query + query: Query } directive @join__directive(graphs: [join__Graph!], name: String!, args: join__DirectiveArguments) repeatable on SCHEMA | OBJECT | INTERFACE | FIELD_DEFINITION directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE -directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean, overrideLabel: String) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION +directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean, overrideLabel: String, contextArguments: [join__ContextArgument!]) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION directive @join__graph(name: String!, url: String!) on ENUM_VALUE @@ -23,39 +24,48 @@ directive @join__unionMember(graph: join__Graph!, member: String!) repeatable on directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA +input join__ContextArgument { + name: String! + type: String! + context: String! + selection: join__FieldValue! +} + scalar join__DirectiveArguments scalar join__FieldSet +scalar join__FieldValue + enum join__Graph { - CONNECTORS_SUBGRAPH @join__graph(name: "connectors-subgraph", url: "none") + CONNECTORS_SUBGRAPH @join__graph(name: "connectors-subgraph", url: "none") } scalar link__Import enum link__Purpose { - """ - `SECURITY` features provide metadata necessary to securely resolve fields. - """ - SECURITY - - """ - `EXECUTION` features provide metadata necessary for operation execution. - """ - EXECUTION + """ + `SECURITY` features provide metadata necessary to securely resolve fields. + """ + SECURITY + + """ + `EXECUTION` features provide metadata necessary for operation execution. + """ + EXECUTION } type Query -@join__type(graph: CONNECTORS_SUBGRAPH) + @join__type(graph: CONNECTORS_SUBGRAPH) { - users: [User] @join__field(graph: CONNECTORS_SUBGRAPH) @join__directive(graphs: [CONNECTORS_SUBGRAPH], name: "connect", args: {source: "example", http: {GET: "/"}, selection: "id a"}) - user(id: ID!): User @join__field(graph: CONNECTORS_SUBGRAPH) @join__directive(graphs: [CONNECTORS_SUBGRAPH], name: "connect", args: {source: "example", http: {GET: "/{$args.id}"}, selection: "id a b", entity: true}) + users: [User] @join__directive(graphs: [CONNECTORS_SUBGRAPH], name: "connect", args: {source: "example", http: {GET: "/"}, selection: "id a"}) + user(id: ID!): User @join__directive(graphs: [CONNECTORS_SUBGRAPH], name: "connect", args: {source: "example", http: {GET: "/{$args.id}"}, selection: "id a b", entity: true}) } type User -@join__type(graph: CONNECTORS_SUBGRAPH, key: "id") + @join__type(graph: CONNECTORS_SUBGRAPH, key: "id") { - id: ID! - a: String @join__field(graph: CONNECTORS_SUBGRAPH) - b: String @join__field(graph: CONNECTORS_SUBGRAPH) + id: ID! + a: String + b: String } diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/normalize_names.yaml b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/normalize_names.yaml index b79da39cee..c0f92868e0 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/normalize_names.yaml +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/normalize_names.yaml @@ -1,4 +1,3 @@ -federation_version: =2.9.0-connectors.12 subgraphs: connectors-subgraph: routing_url: none diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/realistic.graphql b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/realistic.graphql index bbb5bc6cf3..888fbb3ebc 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/realistic.graphql +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/realistic.graphql @@ -80,8 +80,8 @@ input CreateUserInput { name: String! username: String! - email: EmailAddress - status: Status + email: EmailAddress! + status: Status! address: AddressInput } @@ -151,5 +151,4 @@ type User phone: String website: String company: CompanyInfo - status: Status } diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/realistic.yaml b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/realistic.yaml index 10df54538e..62d16264a9 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/realistic.yaml +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/realistic.yaml @@ -1,6 +1,3 @@ -# rover supergraph compose --config apollo-federation/src/sources/connect/expand/tests/schemas/realistic.yaml > apollo-federation/src/sources/connect/expand/tests/schemas/realistic.graphql -# this is currently manually edited to add Status enum and EmailAddress scalars to the input type -federation_version: =2.10.0-alpha.0 subgraphs: connectors: routing_url: none @@ -66,7 +63,6 @@ subgraphs: phone: String website: String company: CompanyInfo - status: String # Status } type Address { @@ -86,7 +82,7 @@ subgraphs: name: String catchPhrase: String bs: String - email: String # EmailAddress + email: EmailAddress } input CompanyInput { @@ -109,8 +105,8 @@ subgraphs: input CreateUserInput { name: String! username: String! - email: String # EmailAddress! - status: String # Status! + email: EmailAddress! + status: Status! address: AddressInput } diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/simple.graphql b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/simple.graphql index 98e7ceef5a..aa26ff6f2f 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/simple.graphql +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/simple.graphql @@ -1,6 +1,7 @@ schema @link(url: "https://specs.apollo.dev/link/v1.0") - @link(url: "https://specs.apollo.dev/join/v0.4", for: EXECUTION) + @link(url: "https://specs.apollo.dev/join/v0.5", for: EXECUTION) + @link(url: "https://specs.apollo.dev/connect/v0.1", for: EXECUTION) @join__directive(graphs: [CONNECTORS], name: "link", args: {url: "https://specs.apollo.dev/connect/v0.1", import: ["@connect", "@source"]}) @join__directive(graphs: [CONNECTORS], name: "source", args: {name: "example", http: {baseURL: "http://example"}}) { @@ -11,7 +12,7 @@ directive @join__directive(graphs: [join__Graph!], name: String!, args: join__Di directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE -directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean, overrideLabel: String) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION +directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean, overrideLabel: String, contextArguments: [join__ContextArgument!]) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION directive @join__graph(name: String!, url: String!) on ENUM_VALUE @@ -23,10 +24,19 @@ directive @join__unionMember(graph: join__Graph!, member: String!) repeatable on directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA +input join__ContextArgument { + name: String! + type: String! + context: String! + selection: join__FieldValue! +} + scalar join__DirectiveArguments scalar join__FieldSet +scalar join__FieldValue + enum join__Graph { CONNECTORS @join__graph(name: "connectors", url: "none") GRAPHQL @join__graph(name: "graphql", url: "https://graphql") diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/simple.yaml b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/simple.yaml index df71b38d23..c29b7fe604 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/simple.yaml +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/simple.yaml @@ -1,4 +1,3 @@ -federation_version: =2.9.0-connectors.0 subgraphs: connectors: routing_url: none diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/steelthread.graphql b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/steelthread.graphql index 3e4b8ba6ab..462a345fbd 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/steelthread.graphql +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/steelthread.graphql @@ -24,13 +24,6 @@ directive @join__unionMember(graph: join__Graph!, member: String!) repeatable on directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA -type Contact - @join__type(graph: CONNECTORS) -{ - phone: String - email: String -} - input join__ContextArgument { name: String! type: String! diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/steelthread.yaml b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/steelthread.yaml index f78235ff63..25c07a8b40 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/steelthread.yaml +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/steelthread.yaml @@ -1,5 +1,3 @@ -# rover supergraph compose --config apollo-federation/src/sources/connect/expand/tests/schemas/steelthread.yaml > apollo-federation/src/sources/connect/expand/tests/schemas/steelthread.graphql -federation_version: =2.10.0-alpha.0 subgraphs: connectors: routing_url: none @@ -36,11 +34,6 @@ subgraphs: ) } - type Contact { - phone: String - email: String - } - type User @key(fields: "id") { id: ID! name: String diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/types_used_twice.graphql b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/types_used_twice.graphql index a7c772dcbd..1658ad5162 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/types_used_twice.graphql +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/types_used_twice.graphql @@ -1,6 +1,7 @@ schema @link(url: "https://specs.apollo.dev/link/v1.0") - @link(url: "https://specs.apollo.dev/join/v0.4", for: EXECUTION) + @link(url: "https://specs.apollo.dev/join/v0.5", for: EXECUTION) + @link(url: "https://specs.apollo.dev/connect/v0.1", for: EXECUTION) @join__directive(graphs: [CONNECTORS], name: "link", args: {url: "https://specs.apollo.dev/connect/v0.1", import: ["@connect", "@source"]}) @join__directive(graphs: [CONNECTORS], name: "source", args: {name: "example", http: {baseURL: "http://example"}}) { @@ -11,7 +12,7 @@ directive @join__directive(graphs: [join__Graph!], name: String!, args: join__Di directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE -directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean, overrideLabel: String) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION +directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean, overrideLabel: String, contextArguments: [join__ContextArgument!]) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION directive @join__graph(name: String!, url: String!) on ENUM_VALUE @@ -35,10 +36,19 @@ type B a: A } +input join__ContextArgument { + name: String! + type: String! + context: String! + selection: join__FieldValue! +} + scalar join__DirectiveArguments scalar join__FieldSet +scalar join__FieldValue + enum join__Graph { CONNECTORS @join__graph(name: "connectors", url: "none") } diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/types_used_twice.yaml b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/types_used_twice.yaml index 4d20b44856..379b183d97 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/expand/types_used_twice.yaml +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/expand/types_used_twice.yaml @@ -1,5 +1,3 @@ -# rover supergraph compose --config apollo-federation/src/sources/connect/expand/tests/schemas/types_used_twice.yaml > apollo-federation/src/sources/connect/expand/tests/schemas/types_used_twice.graphql -federation_version: =2.9.0-connectors.0 subgraphs: connectors: routing_url: none diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/ignore/directives.yaml b/apollo-federation/src/sources/connect/expand/tests/schemas/ignore/directives.yaml index 8299163ec5..5186b0d0e7 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/ignore/directives.yaml +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/ignore/directives.yaml @@ -1,5 +1,3 @@ -# rover supergraph compose --config apollo-federation/src/sources/connect/expand/tests/schemas/ignore/directives.yaml > apollo-federation/src/sources/connect/expand/tests/schemas/ignore/directives.graphql -federation_version: =2.8.1 subgraphs: one: routing_url: none diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/ignore/ignored.yaml b/apollo-federation/src/sources/connect/expand/tests/schemas/ignore/ignored.yaml index d1f6aa6f4c..b51befad9d 100644 --- a/apollo-federation/src/sources/connect/expand/tests/schemas/ignore/ignored.yaml +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/ignore/ignored.yaml @@ -1,4 +1,3 @@ -federation_version: =2.8.0-connectors.5 subgraphs: graphql: routing_url: https://graphql diff --git a/apollo-federation/src/sources/connect/expand/tests/schemas/regenerate.sh b/apollo-federation/src/sources/connect/expand/tests/schemas/regenerate.sh new file mode 100644 index 0000000000..4c87cb9613 --- /dev/null +++ b/apollo-federation/src/sources/connect/expand/tests/schemas/regenerate.sh @@ -0,0 +1,8 @@ +set -euo pipefail + +for supergraph_config in */*.yaml; do + test_name=$(basename "$supergraph_config" .yaml) + dir_name=$(dirname "$supergraph_config") + echo "Regenerating $dir_name/$test_name.graphql" + rover supergraph compose --federation-version "=2.10.0-preview.0" --config "$supergraph_config" > "$dir_name/$test_name.graphql" +done \ No newline at end of file diff --git a/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@carryover.graphql-3.snap b/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@carryover.graphql-3.snap index 0dd9a98d78..7f25ff26b4 100644 --- a/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@carryover.graphql-3.snap +++ b/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@carryover.graphql-3.snap @@ -3,7 +3,7 @@ source: apollo-federation/src/sources/connect/expand/tests/mod.rs expression: raw_sdl input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/carryover.graphql --- -schema @link(url: "https://specs.apollo.dev/link/v1.0") @link(url: "https://specs.apollo.dev/join/v0.3", for: EXECUTION) @link(url: "https://specs.apollo.dev/inaccessible/v0.2", for: SECURITY) @join__directive(graphs: [], name: "link", args: {url: "https://specs.apollo.dev/connect/v0.1"}) @link(url: "https://specs.apollo.dev/tag/v0.3", import: ["@tag"]) @link(url: "https://specs.apollo.dev/authenticated/v0.1", for: SECURITY, import: ["@authenticated"]) @link(url: "https://specs.apollo.dev/requiresScopes/v0.1", for: SECURITY, import: ["@requiresScopes"]) @link(url: "https://specs.apollo.dev/policy/v0.1", for: SECURITY, import: ["@policy"]) @link(url: "http://specs.example.org/custom/v0.1", import: ["@custom"]) { +schema @link(url: "https://specs.apollo.dev/link/v1.0") @link(url: "https://specs.apollo.dev/join/v0.3", for: EXECUTION) @link(url: "https://specs.apollo.dev/inaccessible/v0.2", for: SECURITY) @join__directive(graphs: [], name: "link", args: {url: "https://specs.apollo.dev/connect/v0.1"}) @link(url: "https://specs.apollo.dev/tag/v0.3") @link(url: "https://specs.apollo.dev/authenticated/v0.1", for: SECURITY) @link(url: "https://specs.apollo.dev/requiresScopes/v0.1", for: SECURITY) @link(url: "https://specs.apollo.dev/policy/v0.1", for: SECURITY) @link(url: "http://specs.example.org/custom/v0.1", import: ["@custom"]) { query: Query } diff --git a/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@realistic.graphql-3.snap b/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@realistic.graphql-3.snap index 17517c23f0..555ef2f017 100644 --- a/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@realistic.graphql-3.snap +++ b/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@realistic.graphql-3.snap @@ -70,8 +70,8 @@ input AddressInput @join__type(graph: CONNECTORS_MUTATION_CREATEUSER_0) { input CreateUserInput @join__type(graph: CONNECTORS_MUTATION_CREATEUSER_0) { name: String! username: String! - email: EmailAddress - status: Status + email: EmailAddress! + status: Status! address: AddressInput } diff --git a/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@realistic.graphql.snap b/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@realistic.graphql.snap index 93906e02a4..137fc3f565 100644 --- a/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@realistic.graphql.snap +++ b/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@realistic.graphql.snap @@ -46,8 +46,8 @@ input CompanyInput { input CreateUserInput { name: String! username: String! - email: EmailAddress - status: Status + email: EmailAddress! + status: Status! address: AddressInput } @@ -77,5 +77,4 @@ type User { phone: String website: String company: CompanyInfo - status: Status } diff --git a/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@steelthread.graphql.snap b/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@steelthread.graphql.snap index 3431ded5db..830dd64961 100644 --- a/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@steelthread.graphql.snap +++ b/apollo-federation/src/sources/connect/expand/tests/snapshots/it_expand_supergraph@steelthread.graphql.snap @@ -5,11 +5,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/st --- directive @defer(label: String, if: Boolean! = true) on FRAGMENT_SPREAD | INLINE_FRAGMENT -type Contact { - phone: String - email: String -} - scalar JSON type Query {