How to use the tartiflette.Resolver function in tartiflette

To help you get started, we’ve selected a few tartiflette 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 tartiflette / tartiflette / tests / functional / test_type_resolvers.py View on Github external
    @Resolver("Query.named", schema_name=random_schema_name)
    async def resolve_query_named(parent, args, ctx, info):
        return result
github tartiflette / tartiflette / tests / functional / regressions / test_issue127.py View on Github external
    @Resolver("Mutation.patchRecipe", schema_name="test_issue127")
    async def update_recipe(_, args, *__, **kwargs):
        return args["input"]
github tartiflette / tartiflette / tests / functional / regressions / test_oh_god.py View on Github external
    @Resolver("Dog.friends", schema_name="test_oh_god")
    async def resolve_pet_friends(*_, **__):
        return _PET_DATASET
github tartiflette / tartiflette / tests / functional / types / test_directive.py View on Github external
    @Resolver("Query.fieldDeprecatedDefault")
    async def func_field_resolver5(parent, arguments, request_ctx, info):
        return 42
github tartiflette / tartiflette / tests / functional / test_empty_value.py View on Github external
@Resolver("Query.stringListNonNull", schema_name="test_empty_values")
@Resolver("Query.nonNullStringList", schema_name="test_empty_values")
@Resolver("Query.nonNullStringListNonNull", schema_name="test_empty_values")
@Resolver("bobby.c", schema_name="test_empty_values")
@Resolver("boby.b", schema_name="test_empty_values")
async def resolver_x(_pr, _args, _ctx, _info):
    return None
github tartiflette / tartiflette / tests / functional / regressions / test_issue101.py View on Github external
    @Resolver("Query.cats", schema_name="test_issue101")
    async def resolve_query_cats(parent, args, ctx, info):
        return [{"name": "Cat"}]
github tartiflette / tartiflette / tests / functional / test_tartiflette.py View on Github external
    @Resolver("Test.field", schema_name="test_tartiflette_execute_basic")
    async def func_field_resolver(*_args, **_kwargs):
        mock_one()
        return None
github tartiflette / tartiflette / tests / functional / types / test_object.py View on Github external
    @Resolver("Query.posts")
    async def func_field_resolver(*args, **kwargs):
        return [
            Post(content=Content(title="Test"), meta_creator="Dailymotion")
        ]
github tartiflette / tartiflette / tests / functional / regressions / test_issue233.py View on Github external
    @Resolver("Query.listEnum", schema_name="test_issue_233")
    async def resolve_query_fields(parent, args, ctx, info):
        return args.get("param")
github tartiflette / tartiflette-aiohttp / examples / aiohttp / dogs / resolvers / dogs.py View on Github external
@Resolver("Query.dog")
async def query_dog_resolver(parent_result, args, ctx, info):
    dog = get_dog_by_id(args["id"])
    if dog is None:
        raise Exception("Dog < %s > not found." % args["id"])
    return dog