Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@Resolver("Query.named", schema_name=random_schema_name)
async def resolve_query_named(parent, args, ctx, info):
return result
@Resolver("Mutation.patchRecipe", schema_name="test_issue127")
async def update_recipe(_, args, *__, **kwargs):
return args["input"]
@Resolver("Dog.friends", schema_name="test_oh_god")
async def resolve_pet_friends(*_, **__):
return _PET_DATASET
@Resolver("Query.fieldDeprecatedDefault")
async def func_field_resolver5(parent, arguments, request_ctx, info):
return 42
@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
@Resolver("Query.cats", schema_name="test_issue101")
async def resolve_query_cats(parent, args, ctx, info):
return [{"name": "Cat"}]
@Resolver("Test.field", schema_name="test_tartiflette_execute_basic")
async def func_field_resolver(*_args, **_kwargs):
mock_one()
return None
@Resolver("Query.posts")
async def func_field_resolver(*args, **kwargs):
return [
Post(content=Content(title="Test"), meta_creator="Dailymotion")
]
@Resolver("Query.listEnum", schema_name="test_issue_233")
async def resolve_query_fields(parent, args, ctx, info):
return args.get("param")
@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