-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathschema.graphql
More file actions
168 lines (144 loc) · 3.32 KB
/
schema.graphql
File metadata and controls
168 lines (144 loc) · 3.32 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
schema {
query: Input
mutation: MutationRoot
}
"""
Only allow the field to be queried when targeting one of the specified targets.
"""
directive @restrictTarget(only: [String!]!) on FIELD_DEFINITION
"""
Requires that exactly one field must be supplied and that field must not be `null`.
"""
directive @oneOf on INPUT_OBJECT
"""
Represents an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-encoded date string.
For example, September 7, 2019 is represented as `"2019-07-16"`.
"""
scalar Date
"""
Represents an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-encoded date and time string.
For example, 3:50 pm on September 7, 2019 in the time zone of UTC (Coordinated Universal Time) is
represented as `"2019-09-07T15:50:00Z`".
"""
scalar DateTime
"""
A subset of the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format that
includes the date and time but not the timezone which is determined from context.
For example, "2018-01-01T00:00:00".
"""
scalar DateTimeWithoutTimezone
"""
A signed decimal number, which supports arbitrary precision and is serialized as a string.
Example values: `"29.99"`, `"29.999"`.
"""
scalar Decimal
"""
Represents a unique identifier, often used to refetch an object.
The ID type appears in a JSON response as a String, but it is not intended to be human-readable.
Example value: `"gid://shopify/Product/10079785100"`
"""
scalar ID
"""
A subset of the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format that
includes the time but not the date or timezone which is determined from context.
For example, "05:43:21".
"""
scalar TimeWithoutTimezone
"""
A void type that can be used to return a null value from a mutation.
"""
scalar Void
"""
A cart line representing an item in the cart.
"""
type CartLine {
id: ID!
quantity: Int!
title: String!
}
"""
The input object for the function.
"""
type Input {
id: ID!
num: Int
name: String
date: Date
dateTime: DateTime
dateTimeWithoutTimezone: DateTimeWithoutTimezone
timeWithoutTimezone: TimeWithoutTimezone
targetAResult: Int @restrictTarget(only: ["test.target-b"])
country: CountryCode
optionalArray: [String!]
optionalArrayOfArrays: [[String!]!]
optionalArrayOfOptionalArrays: [[String!]]
cartLines: [CartLine!] @restrictTarget(only: ["test.target-cart"])
}
"""
The root mutation for the API.
"""
type MutationRoot {
"""
The function for API target A.
"""
targetA(
"""
The result of calling the function for API target A.
"""
result: FunctionTargetAResult!
): Void!
"""
The function for API target B.
"""
targetB(
"""
The result of calling the function for API target B.
"""
result: FunctionTargetBResult!
): Void!
"""
The function for API target Cart.
"""
targetCart(
"""
The result of calling the function for API target Cart.
"""
result: FunctionTargetCartResult!
): Void!
}
"""
The result of API target A.
"""
input FunctionTargetAResult {
status: Int
}
"""
The result of API target B.
"""
input FunctionTargetBResult {
name: String
operations: [Operation!]!
}
"""
The result of API target Cart.
"""
input FunctionTargetCartResult {
totalQuantity: Int!
}
input Operation @oneOf {
doThis: This
doThat: That
}
input This {
thisField: String!
}
input That {
thatField: Int!
}
"""
The country code for the function.
"""
enum CountryCode {
AC
CA
}