From 0953e6650b3d141a1ed4b52c3e0d3042e82bcb8c Mon Sep 17 00:00:00 2001 From: Michael Staib Date: Thu, 28 Mar 2024 15:53:53 +0100 Subject: [PATCH] Added more test cases --- .../invalid/composite/users.graphql | 13 +++++++++++++ .../{ => federation}/_supergraph.graphql | 0 .../invalid/{ => federation}/users.graphql | 0 .../valid/composite/users.graphql | 13 +++++++++++++ .../{ => federation}/_supergraph.graphql | 0 .../valid/{ => federation}/users.graphql | 0 .../composite/reviews.graphql | 19 +++++++++++++++++++ .../{ => composite}/users.graphql | 0 .../{ => federation}/_supergraph.graphql | 0 .../{ => federation}/reviews.graphql | 0 .../federation/users.graphql | 15 +++++++++++++++ 11 files changed, 60 insertions(+) create mode 100644 rfcs/test-cases/default-value-not-accessible/invalid/composite/users.graphql rename rfcs/test-cases/default-value-not-accessible/invalid/{ => federation}/_supergraph.graphql (100%) rename rfcs/test-cases/default-value-not-accessible/invalid/{ => federation}/users.graphql (100%) create mode 100644 rfcs/test-cases/default-value-not-accessible/valid/composite/users.graphql rename rfcs/test-cases/default-value-not-accessible/valid/{ => federation}/_supergraph.graphql (100%) rename rfcs/test-cases/default-value-not-accessible/valid/{ => federation}/users.graphql (100%) create mode 100644 rfcs/test-cases/external-requires-extension/composite/reviews.graphql rename rfcs/test-cases/external-requires-extension/{ => composite}/users.graphql (100%) rename rfcs/test-cases/external-requires-extension/{ => federation}/_supergraph.graphql (100%) rename rfcs/test-cases/external-requires-extension/{ => federation}/reviews.graphql (100%) create mode 100644 rfcs/test-cases/external-requires-extension/federation/users.graphql diff --git a/rfcs/test-cases/default-value-not-accessible/invalid/composite/users.graphql b/rfcs/test-cases/default-value-not-accessible/invalid/composite/users.graphql new file mode 100644 index 0000000..221dcf3 --- /dev/null +++ b/rfcs/test-cases/default-value-not-accessible/invalid/composite/users.graphql @@ -0,0 +1,13 @@ +type Query { + users: [User!]! +} + +type User @key(fields: "id") { + id: ID + friends(type: FriendType = FAMILY): [User!]! +} + +enum FriendType { + FAMILY @internal + FRIEND +} diff --git a/rfcs/test-cases/default-value-not-accessible/invalid/_supergraph.graphql b/rfcs/test-cases/default-value-not-accessible/invalid/federation/_supergraph.graphql similarity index 100% rename from rfcs/test-cases/default-value-not-accessible/invalid/_supergraph.graphql rename to rfcs/test-cases/default-value-not-accessible/invalid/federation/_supergraph.graphql diff --git a/rfcs/test-cases/default-value-not-accessible/invalid/users.graphql b/rfcs/test-cases/default-value-not-accessible/invalid/federation/users.graphql similarity index 100% rename from rfcs/test-cases/default-value-not-accessible/invalid/users.graphql rename to rfcs/test-cases/default-value-not-accessible/invalid/federation/users.graphql diff --git a/rfcs/test-cases/default-value-not-accessible/valid/composite/users.graphql b/rfcs/test-cases/default-value-not-accessible/valid/composite/users.graphql new file mode 100644 index 0000000..85da4e6 --- /dev/null +++ b/rfcs/test-cases/default-value-not-accessible/valid/composite/users.graphql @@ -0,0 +1,13 @@ +type Query { + users: [User!]! +} + +type User @key(fields: "id") { + id: ID + friends(type: FriendType = FAMILY @internal): [User!]! +} + +enum FriendType { + FAMILY @internal + FRIEND +} diff --git a/rfcs/test-cases/default-value-not-accessible/valid/_supergraph.graphql b/rfcs/test-cases/default-value-not-accessible/valid/federation/_supergraph.graphql similarity index 100% rename from rfcs/test-cases/default-value-not-accessible/valid/_supergraph.graphql rename to rfcs/test-cases/default-value-not-accessible/valid/federation/_supergraph.graphql diff --git a/rfcs/test-cases/default-value-not-accessible/valid/users.graphql b/rfcs/test-cases/default-value-not-accessible/valid/federation/users.graphql similarity index 100% rename from rfcs/test-cases/default-value-not-accessible/valid/users.graphql rename to rfcs/test-cases/default-value-not-accessible/valid/federation/users.graphql diff --git a/rfcs/test-cases/external-requires-extension/composite/reviews.graphql b/rfcs/test-cases/external-requires-extension/composite/reviews.graphql new file mode 100644 index 0000000..373b652 --- /dev/null +++ b/rfcs/test-cases/external-requires-extension/composite/reviews.graphql @@ -0,0 +1,19 @@ +type Query { + reviews: [Review] +} + +type Review @key(fields: "id") { + id: ID! + title: String! + author: User! +} + +extend type User @key(fields: "id") { + id: ID! @external + profile: Profile! @external + reviews: [Review] @requires(fields: "profile { id __typename }") +} + +extend type Profile { + id: ID! @external +} diff --git a/rfcs/test-cases/external-requires-extension/users.graphql b/rfcs/test-cases/external-requires-extension/composite/users.graphql similarity index 100% rename from rfcs/test-cases/external-requires-extension/users.graphql rename to rfcs/test-cases/external-requires-extension/composite/users.graphql diff --git a/rfcs/test-cases/external-requires-extension/_supergraph.graphql b/rfcs/test-cases/external-requires-extension/federation/_supergraph.graphql similarity index 100% rename from rfcs/test-cases/external-requires-extension/_supergraph.graphql rename to rfcs/test-cases/external-requires-extension/federation/_supergraph.graphql diff --git a/rfcs/test-cases/external-requires-extension/reviews.graphql b/rfcs/test-cases/external-requires-extension/federation/reviews.graphql similarity index 100% rename from rfcs/test-cases/external-requires-extension/reviews.graphql rename to rfcs/test-cases/external-requires-extension/federation/reviews.graphql diff --git a/rfcs/test-cases/external-requires-extension/federation/users.graphql b/rfcs/test-cases/external-requires-extension/federation/users.graphql new file mode 100644 index 0000000..2a83e29 --- /dev/null +++ b/rfcs/test-cases/external-requires-extension/federation/users.graphql @@ -0,0 +1,15 @@ +extend schema @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@key"]) + +type Query { + users: [User] +} + +type User @key(fields: "id") { + id: ID! + profile: Profile! +} + +type Profile { + id: ID! + name: String! +}