Skip to content

Commit

Permalink
Merge pull request #263 from jeremytiki/tutorial-update-graphene-2.0.dev
Browse files Browse the repository at this point in the history
Issue #262 fix
  • Loading branch information
syrusakbary authored Sep 7, 2017
2 parents 0e28ccc + 84d0632 commit f35e445
Showing 1 changed file with 10 additions and 10 deletions.
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

0 comments on commit f35e445

Please sign in to comment.