Querying

Relay Schema

classShip(relay.Node):'''A ship in the Star Wars saga'''name=graphene.StringField(description='The name of the ship.')@classmethoddefget_node(cls,id):returnShip(getShip(id))classQuery(graphene.ObjectType):ships=relay.ConnectionField(Ship,description='The ships used by the faction.')node=relay.NodeField()@resolve_only_argsdefresolve_ships(self):return[Ship(s)forsingetShips()]