From bb3fe2238d15197a24c8a59f520c1ba877e3cea6 Mon Sep 17 00:00:00 2001 From: Michael Staib Date: Thu, 4 Apr 2024 14:01:27 +0200 Subject: [PATCH] more examples --- .../fusion/reviews.graphql | 21 +++++++++++++++++++ .../fusion/users.graphql | 14 +++++++++++++ .../interface-object-another/fusion/a.graphql | 14 +++++++++++++ .../interface-object-another/fusion/b.graphql | 9 ++++++++ 4 files changed, 58 insertions(+) create mode 100644 rfcs/test-cases/external-requires-extension/fusion/reviews.graphql create mode 100644 rfcs/test-cases/external-requires-extension/fusion/users.graphql create mode 100644 rfcs/test-cases/interface-object-another/fusion/a.graphql create mode 100644 rfcs/test-cases/interface-object-another/fusion/b.graphql diff --git a/rfcs/test-cases/external-requires-extension/fusion/reviews.graphql b/rfcs/test-cases/external-requires-extension/fusion/reviews.graphql new file mode 100644 index 0000000..7a359f1 --- /dev/null +++ b/rfcs/test-cases/external-requires-extension/fusion/reviews.graphql @@ -0,0 +1,21 @@ +type Query { + reviews: [Review] + reviewById(id: ID!): Review + userById(id: ID!): User +} + +type Review { + id: ID! + title: String! + author: User! +} + +type User { + id: ID! @external + profile: Profile! @external + reviews: [Review] @requires(fields: "profile { id __typename }") +} + +type Profile { + id: ID! @external +} diff --git a/rfcs/test-cases/external-requires-extension/fusion/users.graphql b/rfcs/test-cases/external-requires-extension/fusion/users.graphql new file mode 100644 index 0000000..467c102 --- /dev/null +++ b/rfcs/test-cases/external-requires-extension/fusion/users.graphql @@ -0,0 +1,14 @@ +type Query { + users: [User] + userById(id: ID!): User +} + +type User { + id: ID! + profile: Profile! +} + +type Profile { + id: ID! + name: String! +} diff --git a/rfcs/test-cases/interface-object-another/fusion/a.graphql b/rfcs/test-cases/interface-object-another/fusion/a.graphql new file mode 100644 index 0000000..257e789 --- /dev/null +++ b/rfcs/test-cases/interface-object-another/fusion/a.graphql @@ -0,0 +1,14 @@ +type Query { + hello: String + myInterfaceById(id: ID!): MyInterface +} + +interface MyInterface { + id: ID! + field: String +} + +type IimplementMyInterface implements MyInterface { + id: ID! + field: String +} diff --git a/rfcs/test-cases/interface-object-another/fusion/b.graphql b/rfcs/test-cases/interface-object-another/fusion/b.graphql new file mode 100644 index 0000000..4411fef --- /dev/null +++ b/rfcs/test-cases/interface-object-another/fusion/b.graphql @@ -0,0 +1,9 @@ +type Query { + otherField: String + someTypeById(id: ID!): SomeType +} + +type SomeType @baseType(of: "MyInterface") { + id: ID! + hello: Int +}