How to use the graphene-django.examples.starwars.data.get_faction function in graphene-django

To help you get started, we’ve selected a few graphene-django examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graphql-python / graphene / graphene-django / examples / starwars / schema.py View on Github external
def mutate_and_get_payload(cls, input, context, info):
        ship_name = input.get('shipName')
        faction_id = input.get('factionId')
        ship = create_ship(ship_name, faction_id)
        faction = get_faction(faction_id)
        return IntroduceShip(ship=ship, faction=faction)