/
interfaces.graphql
79 lines (68 loc) · 1.34 KB
/
interfaces.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
extend type Query {
shapes: [Shape]
noShape: Shape @makeNil
node: Node!
noShapeTypedNil: Shape @makeTypedNil
animal: Animal @makeTypedNil
notAnInterface: BackedByInterface
dog: Dog
}
interface Animal {
species: String!
size: Size!
}
type Size {
height: Int!
weight: Int!
}
type BackedByInterface {
id: String!
thisShouldBind: String!
thisShouldBindWithError: String!
}
type Dog implements Animal {
species: String!
size: Size!
dogBreed: String!
}
type Cat implements Animal {
species: String!
size: Size!
catBreed: String!
}
type Coordinates {
x: Float!
y: Float!
}
interface Shape {
area: Float
coordinates: Coordinates
}
type Circle implements Shape {
radius: Float
area: Float
coordinates: Coordinates
}
type Rectangle implements Shape {
length: Float
width: Float
area: Float
coordinates: Coordinates
}
union ShapeUnion @goModel(model: "followschema.ShapeUnion") = Circle | Rectangle
directive @makeNil on FIELD_DEFINITION
directive @makeTypedNil on FIELD_DEFINITION
interface Node {
id: ID!
child: Node!
}
type ConcreteNodeA implements Node {
id: ID!
child: Node!
name: String!
}
" Implements the Node interface with another interface "
type ConcreteNodeInterface implements Node {
id: ID!
child: Node!
}