-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
175 additions
and
0 deletions.
There are no files selected for viewing
104 changes: 104 additions & 0 deletions
104
rfcs/test-cases/requires-with-fragments-shareable/federation/_supergraph.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
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) | ||
{ | ||
query: Query | ||
} | ||
|
||
directive @inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_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) 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 | ||
|
||
interface Bar implements Foo | ||
@join__implements(graph: LOCATIONS, interface: "Foo") | ||
@join__implements(graph: REVIEWS, interface: "Foo") | ||
@join__type(graph: LOCATIONS) | ||
@join__type(graph: REVIEWS) | ||
{ | ||
foo: String! | ||
bar: String! | ||
} | ||
|
||
type Baz implements Foo & Bar | ||
@join__implements(graph: LOCATIONS, interface: "Foo") | ||
@join__implements(graph: LOCATIONS, interface: "Bar") | ||
@join__implements(graph: REVIEWS, interface: "Foo") | ||
@join__implements(graph: REVIEWS, interface: "Bar") | ||
@join__type(graph: LOCATIONS) | ||
@join__type(graph: REVIEWS) | ||
@inaccessible | ||
{ | ||
foo: String! | ||
bar: String! | ||
baz: String! | ||
} | ||
|
||
type Entity | ||
@join__type(graph: LOCATIONS, key: "id") | ||
@join__type(graph: REVIEWS, key: "id") | ||
{ | ||
id: ID! | ||
data: Foo @join__field(graph: LOCATIONS) @join__field(graph: REVIEWS, external: true) | ||
requirer: String! @join__field(graph: REVIEWS, requires: "data { foo ... on Bar { bar ... on Baz { baz } ... on Qux { qux } } }") | ||
} | ||
|
||
interface Foo | ||
@join__type(graph: LOCATIONS) | ||
@join__type(graph: REVIEWS) | ||
{ | ||
foo: String! | ||
} | ||
|
||
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 Query | ||
@join__type(graph: LOCATIONS) | ||
@join__type(graph: REVIEWS) | ||
{ | ||
dummy: Entity | ||
} | ||
|
||
type Qux implements Foo & Bar | ||
@join__implements(graph: LOCATIONS, interface: "Foo") | ||
@join__implements(graph: LOCATIONS, interface: "Bar") | ||
@join__implements(graph: REVIEWS, interface: "Foo") | ||
@join__implements(graph: REVIEWS, interface: "Bar") | ||
@join__type(graph: LOCATIONS) | ||
@join__type(graph: REVIEWS) | ||
{ | ||
foo: String! | ||
bar: String! | ||
qux: String! | ||
} |
35 changes: 35 additions & 0 deletions
35
rfcs/test-cases/requires-with-fragments-shareable/federation/a.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
extend schema | ||
@link( | ||
url: "https://specs.apollo.dev/federation/v2.5", | ||
import: ["@key", "@shareable"] | ||
) | ||
|
||
type Query @shareable { | ||
dummy: Entity | ||
} | ||
|
||
type Entity @key(fields: "id") { | ||
id: ID! | ||
data: Foo | ||
} | ||
|
||
interface Foo { | ||
foo: String! | ||
} | ||
|
||
interface Bar implements Foo { | ||
foo: String! | ||
bar: String! | ||
} | ||
|
||
type Baz implements Foo & Bar @shareable { | ||
foo: String! | ||
bar: String! | ||
baz: String! | ||
} | ||
|
||
type Qux implements Foo & Bar @shareable { | ||
foo: String! | ||
bar: String! | ||
qux: String! | ||
} |
36 changes: 36 additions & 0 deletions
36
rfcs/test-cases/requires-with-fragments-shareable/federation/b.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
extend schema | ||
@link( | ||
url: "https://specs.apollo.dev/federation/v2.5", | ||
import: ["@key", "@shareable", "@inaccessible", "@external", "@requires"] | ||
) | ||
|
||
type Query @shareable { | ||
dummy: Entity | ||
} | ||
|
||
type Entity @key(fields: "id") { | ||
id: ID! | ||
data: Foo @external | ||
requirer: String! @requires(fields: "data { foo ... on Bar { bar ... on Baz { baz } ... on Qux { qux } } }") | ||
} | ||
|
||
interface Foo { | ||
foo: String! | ||
} | ||
|
||
interface Bar implements Foo { | ||
foo: String! | ||
bar: String! | ||
} | ||
|
||
type Baz implements Foo & Bar @shareable @inaccessible { | ||
foo: String! | ||
bar: String! | ||
baz: String! | ||
} | ||
|
||
type Qux implements Foo & Bar @shareable { | ||
foo: String! | ||
bar: String! | ||
qux: String! | ||
} |