Add explicit fields = "__all__" in examples as it will be required soon

This commit is contained in:
radoslaw.kowalski 2020-06-07 12:26:41 +02:00
parent 64c2371cf7
commit d478275bca
5 changed files with 11 additions and 0 deletions

View File

@ -7,11 +7,13 @@ from .models import Category, Ingredient
class CategoryType(DjangoObjectType):
class Meta:
model = Category
fields = "__all__"
class IngredientType(DjangoObjectType):
class Meta:
model = Ingredient
fields = "__all__"
class Query(object):

View File

@ -7,11 +7,13 @@ from .models import Recipe, RecipeIngredient
class RecipeType(DjangoObjectType):
class Meta:
model = Recipe
fields = "__all__"
class RecipeIngredientType(DjangoObjectType):
class Meta:
model = RecipeIngredient
fields = "__all__"
class Query(object):

View File

@ -10,6 +10,7 @@ class CategoryNode(DjangoObjectType):
class Meta:
model = Category
interfaces = (Node,)
fields = "__all__"
filter_fields = ["name", "ingredients"]
@ -18,6 +19,7 @@ class IngredientNode(DjangoObjectType):
model = Ingredient
# Allow for some more advanced filtering here
interfaces = (Node,)
fields = "__all__"
filter_fields = {
"name": ["exact", "icontains", "istartswith"],
"notes": ["exact", "icontains"],

View File

@ -8,6 +8,7 @@ class RecipeNode(DjangoObjectType):
class Meta:
model = Recipe
interfaces = (Node,)
fields = "__all__"
filter_fields = ["title", "amounts"]
@ -16,6 +17,7 @@ class RecipeIngredientNode(DjangoObjectType):
model = RecipeIngredient
# Allow for some more advanced filtering here
interfaces = (Node,)
fields = "__all__"
filter_fields = {
"ingredient__name": ["exact", "icontains", "istartswith"],
"recipe": ["exact"],

View File

@ -12,6 +12,7 @@ class Ship(DjangoObjectType):
class Meta:
model = ShipModel
interfaces = (relay.Node,)
fields = "__all__"
@classmethod
def get_node(cls, info, id):
@ -22,12 +23,14 @@ class Ship(DjangoObjectType):
class Character(DjangoObjectType):
class Meta:
model = CharacterModel
fields = "__all__"
class Faction(DjangoObjectType):
class Meta:
model = FactionModel
interfaces = (relay.Node,)
fields = "__all__"
@classmethod
def get_node(cls, info, id):