@@ -157,10 +157,10 @@ Create ``cookbook/ingredients/schema.py`` and type the following:
157157 all_categories = graphene.List(CategoryType)
158158 all_ingredients = graphene.List(IngredientType)
159159
160- def resolve_all_categories (self , args , context , info ):
160+ def resolve_all_categories (self , info , ** kwargs ):
161161 return Category.objects.all()
162162
163- def resolve_all_ingredients (self , args , context , info ):
163+ def resolve_all_ingredients (self , info , ** kwargs ):
164164 # We can easily optimize query count in the resolve method
165165 return Ingredient.objects.select_related(' category' ).all()
166166
@@ -438,15 +438,15 @@ We can update our schema to support that, by adding new query for ``ingredient``
438438 name = graphene.String())
439439 all_ingredients = graphene.List(IngredientType)
440440
441- def resolve_all_categories (self , args , context , info ):
441+ def resolve_all_categories (self , info , ** kwargs ):
442442 return Category.objects.all()
443443
444- def resolve_all_ingredients (self , args , context , info ):
444+ def resolve_all_ingredients (self , info , ** kwargs ):
445445 return Ingredient.objects.all()
446446
447- def resolve_category (self , args , context , info ):
448- id = args .get(' id' )
449- name = args .get(' name' )
447+ def resolve_category (self , info , ** kwargs ):
448+ id = kargs .get(' id' )
449+ name = kargs .get(' name' )
450450
451451 if id is not None :
452452 return Category.objects.get(pk = id )
@@ -456,9 +456,9 @@ We can update our schema to support that, by adding new query for ``ingredient``
456456
457457 return None
458458
459- def resolve_ingredient (self , args , context , info ):
460- id = args .get(' id' )
461- name = args .get(' name' )
459+ def resolve_ingredient (self , info , ** kwargs ):
460+ id = kargs .get(' id' )
461+ name = kargs .get(' name' )
462462
463463 if id is not None :
464464 return Ingredient.objects.get(pk = id )
0 commit comments