Skip to content

Commit

Permalink
more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Apr 4, 2024
1 parent 5b04deb commit eec186e
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type User @extends @key(fields: "id") {
type User @key(fields: "id") {
a: String
id: ID! @external
}
Expand Down
9 changes: 9 additions & 0 deletions rfcs/test-cases/basic-example-with-requires/fusion/a.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type User {
a: String
id: ID! @external
}

type Query {
a: String
userById(id: ID!): User
}
9 changes: 9 additions & 0 deletions rfcs/test-cases/basic-example-with-requires/fusion/b.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type User {
b(uuid: String! @requires(fields: "uuid")): String
id: ID! @external
}

type Query {
b: String
userById(id: ID!): User
}
10 changes: 10 additions & 0 deletions rfcs/test-cases/basic-example-with-requires/fusion/c.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type User {
c: String
id: ID!
uuid: ID!
}

type Query {
c: User
userById(id: ID!): User
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Query {
extra: String
}
8 changes: 8 additions & 0 deletions rfcs/test-cases/basic-interface-usage/fusion/a.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type Query {
a: String
}

interface Node {
id: ID!
name: String
}
13 changes: 13 additions & 0 deletions rfcs/test-cases/basic-interface-usage/fusion/b.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type Query {
b: String
node(id: ID!): Node
}

interface Node {
id: ID!
}

type User implements Node {
id: ID!
name: String
}
12 changes: 12 additions & 0 deletions rfcs/test-cases/composed-directive/fusion/a.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extend schema @exports(directives: ["@lowercase"])

directive @lowercase on FIELD_DEFINITION

type User {
id: ID! @lowercase
age: Int!
}

type Query {
a: String
}
19 changes: 19 additions & 0 deletions rfcs/test-cases/composed-directive/fusion/b.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
extend schema
@link(
url: "https://specs.apollo.dev/federation/v2.3"
import: ["@key", "@external", "@requires", "@composeDirective"]
)
@link(url: "https://myspecs.dev/lowercase/v1.0", import: ["@lowercase"])
@composeDirective(name: "@lowercase")

directive @lowercase on FIELD_DEFINITION

type User @key(fields: "id") {
id: ID! @lowercase
age: Int! @external
birthday: String @requires(fields: "age")
}

type Query {
b: String
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type Query {
users: [User!]!
}

type User {
id: ID
friends(type: FriendType = FAMILY): [User!]!
}

enum FriendType {
FAMILY @internal
FRIEND
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type Query {
users: [User!]!
}

type User {
id: ID
friends(type: FriendType = FAMILY @internal): [User!]!
}

enum FriendType {
FAMILY @internal
FRIEND
}

0 comments on commit eec186e

Please sign in to comment.