File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 12
12
13
13
14
14
class Ship (DjangoNode ):
15
-
16
15
class Meta :
17
16
model = ShipModel
18
17
@@ -21,15 +20,12 @@ def get_node(cls, id):
21
20
return Ship (get_ship (id ))
22
21
23
22
24
- @schema .register
25
23
class Character (DjangoObjectType ):
26
-
27
24
class Meta :
28
25
model = CharacterModel
29
26
30
27
31
28
class Faction (DjangoNode ):
32
-
33
29
class Meta :
34
30
model = FactionModel
35
31
@@ -39,7 +35,6 @@ def get_node(cls, id):
39
35
40
36
41
37
class IntroduceShip (relay .ClientIDMutation ):
42
-
43
38
class Input :
44
39
ship_name = graphene .StringField (required = True )
45
40
faction_id = graphene .StringField (required = True )
@@ -79,5 +74,9 @@ class Mutation(graphene.ObjectType):
79
74
introduce_ship = graphene .Field (IntroduceShip )
80
75
81
76
77
+ # We register the Character Model because if not would be
78
+ # inaccessible for the schema
79
+ schema .register (Character )
80
+
82
81
schema .query = Query
83
82
schema .mutation = Mutation
You can’t perform that action at this time.
0 commit comments