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 1212
1313
1414class Ship (DjangoNode ):
15-
1615 class Meta :
1716 model = ShipModel
1817
@@ -21,15 +20,12 @@ def get_node(cls, id):
2120 return Ship (get_ship (id ))
2221
2322
24- @schema .register
2523class Character (DjangoObjectType ):
26-
2724 class Meta :
2825 model = CharacterModel
2926
3027
3128class Faction (DjangoNode ):
32-
3329 class Meta :
3430 model = FactionModel
3531
@@ -39,7 +35,6 @@ def get_node(cls, id):
3935
4036
4137class IntroduceShip (relay .ClientIDMutation ):
42-
4338 class Input :
4439 ship_name = graphene .StringField (required = True )
4540 faction_id = graphene .StringField (required = True )
@@ -79,5 +74,9 @@ class Mutation(graphene.ObjectType):
7974 introduce_ship = graphene .Field (IntroduceShip )
8075
8176
77+ # We register the Character Model because if not would be
78+ # inaccessible for the schema
79+ schema .register (Character )
80+
8281schema .query = Query
8382schema .mutation = Mutation
You can’t perform that action at this time.
0 commit comments