File tree 1 file changed +17
-5
lines changed
1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -164,10 +164,7 @@ class RealHumanBean(models.Model):
164
164
R.Human.CanBe(Human)
165
165
```
166
166
167
- # # Relay Support (WIP)
168
- - [x] Node
169
- - [x] Connection & Edges
170
- - [ ] Mutations
167
+ # # Relay Support
171
168
172
169
At this point, Epoxy has rudimentary `relay` support. Enable support for `Relay` by mixing in the `RelayMixin` using
173
170
`TypeResolver.Mixin` .
@@ -206,6 +203,21 @@ class Query(R.ObjectType):
206
203
207
204
```
208
205
206
+ # ## Mutations
207
+ ```python
208
+ class SimpleAddition(Relay.Mutation):
209
+ class Input:
210
+ a = R.Int
211
+ b = R.Int
212
+
213
+ class Output:
214
+ sum = R.Int
215
+
216
+ def execute(self , obj, input , info):
217
+ return self .Output(sum = input .a + input .b)
218
+
219
+ ```
220
+
209
221
# ## Adding some data!
210
222
Let' s add some pets to the `data_source` and query them!
211
223
@@ -254,7 +266,7 @@ result = graphql(Schema, '''
254
266
```
255
267
256
268
257
- # # Mutations (Coming Soon)
269
+ # # Mutations
258
270
259
271
Epoxy also supports defining mutations. Making a Mutation a Relay mutation is as simple as changing `R.Mutation` to
260
272
`Relay.Mutation` .
You can’t perform that action at this time.
0 commit comments