From c1ca88ec0152db8ca827ed70cb621047c9558218 Mon Sep 17 00:00:00 2001 From: Shane Myrick Date: Fri, 12 Apr 2024 16:08:57 -0700 Subject: [PATCH 1/3] Shareable example --- .../shareable-basic/federation/a.graphql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 rfcs/test-cases/shareable-basic/federation/a.graphql diff --git a/rfcs/test-cases/shareable-basic/federation/a.graphql b/rfcs/test-cases/shareable-basic/federation/a.graphql new file mode 100644 index 0000000..9346427 --- /dev/null +++ b/rfcs/test-cases/shareable-basic/federation/a.graphql @@ -0,0 +1,15 @@ +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5", + import: ["@key", "@shareable"] + ) + +type Query { + locations: [Location!]! +} + +type Location @key(fields: "id") { + id: ID! + name: String! + description: String! @shareable +} From 3bf9f8523dfebdddb7f62e94064fe0098a20248b Mon Sep 17 00:00:00 2001 From: Shane Myrick Date: Fri, 12 Apr 2024 16:09:54 -0700 Subject: [PATCH 2/3] Create b.graphql --- .../shareable-basic/federation/b.graphql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 rfcs/test-cases/shareable-basic/federation/b.graphql diff --git a/rfcs/test-cases/shareable-basic/federation/b.graphql b/rfcs/test-cases/shareable-basic/federation/b.graphql new file mode 100644 index 0000000..31378ef --- /dev/null +++ b/rfcs/test-cases/shareable-basic/federation/b.graphql @@ -0,0 +1,14 @@ +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.5", + import: ["@key", "@shareable"] + ) + +type Query { + topLocations: [Location!]! +} + +type Location @key(fields: "id") { + id: ID! + description: String! @shareable +} From 9879df763a567dfbb46053d4e672f0d68732f20d Mon Sep 17 00:00:00 2001 From: Shane Myrick Date: Fri, 12 Apr 2024 16:10:26 -0700 Subject: [PATCH 3/3] Create _supergraph.graphql --- .../federation/_supergraph.graphql | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 rfcs/test-cases/shareable-basic/federation/_supergraph.graphql diff --git a/rfcs/test-cases/shareable-basic/federation/_supergraph.graphql b/rfcs/test-cases/shareable-basic/federation/_supergraph.graphql new file mode 100644 index 0000000..54f108f --- /dev/null +++ b/rfcs/test-cases/shareable-basic/federation/_supergraph.graphql @@ -0,0 +1,58 @@ +schema + @link(url: "https://specs.apollo.dev/link/v1.0") + @link(url: "https://specs.apollo.dev/join/v0.3", for: EXECUTION) +{ + query: Query +} + +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) 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 + +scalar join__FieldSet + +enum join__Graph { + LOCATIONS @join__graph(name: "locations", url: "https://flyby-locations-sub.herokuapp.com/") + REVIEWS @join__graph(name: "reviews", url: "https://flyby-reviews-sub.herokuapp.com/") +} + +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 Location + @join__type(graph: LOCATIONS, key: "id") + @join__type(graph: REVIEWS, key: "id") +{ + id: ID! + name: String! @join__field(graph: LOCATIONS) + description: String! +} + +type Query + @join__type(graph: LOCATIONS) + @join__type(graph: REVIEWS) +{ + locations: [Location!]! @join__field(graph: LOCATIONS) + topLocations: [Location!]! @join__field(graph: REVIEWS) +}