diff --git a/examples/starwars_django/schema.py b/examples/starwars_django/schema.py index e7530ecf..21b29a1f 100644 --- a/examples/starwars_django/schema.py +++ b/examples/starwars_django/schema.py @@ -12,7 +12,6 @@ schema = graphene.Schema(name='Starwars Django Relay Schema') class Ship(DjangoNode): - class Meta: model = ShipModel @@ -21,15 +20,12 @@ class Ship(DjangoNode): return Ship(get_ship(id)) -@schema.register class Character(DjangoObjectType): - class Meta: model = CharacterModel class Faction(DjangoNode): - class Meta: model = FactionModel @@ -39,7 +35,6 @@ class Faction(DjangoNode): class IntroduceShip(relay.ClientIDMutation): - class Input: ship_name = graphene.StringField(required=True) faction_id = graphene.StringField(required=True) @@ -79,5 +74,9 @@ class Mutation(graphene.ObjectType): introduce_ship = graphene.Field(IntroduceShip) +# We register the Character Model because if not would be +# inaccessible for the schema +schema.register(Character) + schema.query = Query schema.mutation = Mutation