-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomplex_uses.graphql
92 lines (73 loc) · 2.77 KB
/
complex_uses.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
80
81
82
83
84
85
86
87
88
89
90
91
92
extend schema
@compose(directiveName: "lowercase")
@compose(directiveName: "uppercase")
@compose(directiveName: "pascalcase")
"""Caching directive to control cache behavior of fields or fragments."""
directive @cache(
"""Specifies the maximum age for cache in seconds."""
maxAge: Int!
"""Stale-while-revalidate value in seconds. Optional."""
swr: Int
"""Scope of the cache. Optional."""
scope: String
) on OBJECT | INTERFACE | ENUM | UNION | INPUT_OBJECT | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | SCALAR
"""Auth directive to control authorization behavior."""
directive @authenticated(
"""Auth required"""
required: Boolean!
) on OBJECT | INTERFACE | ENUM | ENUM_VALUE | UNION | INPUT_OBJECT | FIELD_DEFINITION | SCALAR | ARGUMENT_DEFINITION
"""Directive to indicate this is a internal field."""
directive @internal on OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION
"""A repeatable directive."""
directive @repeatable_directive(
"""Service Name required"""
serviceName: String!
) repeatable on OBJECT | FIELD_DEFINITION
union SearchResult @cache(maxAge: 500, swr: 30) @authenticated(required: true) = Human | Droid | Starship
type Human @cache(maxAge: 60) {
name: String
bornIn: String
}
type Droid @cache(maxAge: 200) {
"""Test Description"""
name: String @deprecated(reason: "Deprecated use born in") @cache(maxAge: 300, swr: 30)
primaryFunction: String
}
type Starship @cache(maxAge: 200) {
name: String
length: Int @deprecated(reason: "Use another field") @cache(maxAge: 60)
}
interface Animal @cache(maxAge: 100) @authenticated(required: true) {
age: Int!
kind: Int! @cache(maxAge: 60)
}
type Admin @internal @key {
name: String
password: String
}
input HumanInput @cache(maxAge: 60) @authenticated(required: true) {
bornIn: String
"""Test Description"""
name: String @deprecated(reason: "Deprecated use born in") @cache(maxAge: 300, swr: 30)
}
enum TruthEnum @cache(maxAge: 100) @authenticated(required: true) {
A @authenticated(required: true)
B
}
scalar DateNewScalar @cache(maxAge: 500, swr: 30) @authenticated(required: true)
type User @authenticated(required: true) {
name: String
password: String
price(currency: Int @internal, country: Int @authenticated(required: true) @internal): String
}
type Company @authenticated(required: true) @repeatable_directive(serviceName: "CompanyService") @repeatable_directive(serviceName: "ProductService") {
established: Int!
name: String! @deprecated(reason: "This field is deprecated and will be removed in future") @repeatable_directive(serviceName: "CompanyService Field") @repeatable_directive(serviceName: "ProductService Field")
}
type Query {
position: Position @deprecated(reason: "unused field")
}
type Position @cache(maxAge: 100) {
x: Int!
y: Int! @cache(maxAge: 60)
}