Skip to content

Issue #262 fix #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/tutorial-plain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ Create ``cookbook/ingredients/schema.py`` and type the following:
all_categories = graphene.List(CategoryType)
all_ingredients = graphene.List(IngredientType)

def resolve_all_categories(self, args, context, info):
def resolve_all_categories(self, info, **kwargs):
return Category.objects.all()

def resolve_all_ingredients(self, args, context, info):
def resolve_all_ingredients(self, info, **kwargs):
# We can easily optimize query count in the resolve method
return Ingredient.objects.select_related('category').all()

Expand Down Expand Up @@ -438,15 +438,15 @@ We can update our schema to support that, by adding new query for ``ingredient``
name=graphene.String())
all_ingredients = graphene.List(IngredientType)

def resolve_all_categories(self, args, context, info):
def resolve_all_categories(self, info, **kwargs):
return Category.objects.all()

def resolve_all_ingredients(self, args, context, info):
def resolve_all_ingredients(self, info, **kwargs):
return Ingredient.objects.all()

def resolve_category(self, args, context, info):
id = args.get('id')
name = args.get('name')
def resolve_category(self, info, **kwargs):
id = kargs.get('id')
name = kargs.get('name')

if id is not None:
return Category.objects.get(pk=id)
Expand All @@ -456,9 +456,9 @@ We can update our schema to support that, by adding new query for ``ingredient``

return None

def resolve_ingredient(self, args, context, info):
id = args.get('id')
name = args.get('name')
def resolve_ingredient(self, info, **kwargs):
id = kargs.get('id')
name = kargs.get('name')

if id is not None:
return Ingredient.objects.get(pk=id)
Expand Down