mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-02 20:54:16 +03:00
Merge pull request #171 from iwaszko/patch-1
Fix invalid references to User model in Django tutorial
This commit is contained in:
commit
226f81bda1
|
@ -80,8 +80,8 @@ representation, Graphene needs to know about each *type* of object which will ap
|
||||||
the graph.
|
the graph.
|
||||||
|
|
||||||
This graph also has a *root type* through which all access begins. This is the `Query` class below.
|
This graph also has a *root type* through which all access begins. This is the `Query` class below.
|
||||||
In this example, we provide the ability to list all users via `all_users`, and the
|
In this example, we provide the ability to list all ingredients via `all_ingredients`, and the
|
||||||
ability to obtain a specific user via `get_user`.
|
ability to obtain a specific ingredient via `ingredient`.
|
||||||
|
|
||||||
Create `cookbook/ingredients/schema.py` and type the following:
|
Create `cookbook/ingredients/schema.py` and type the following:
|
||||||
|
|
||||||
|
@ -94,8 +94,8 @@ from graphene.contrib.django.types import DjangoNode
|
||||||
from cookbook.ingredients.models import Category, Ingredient
|
from cookbook.ingredients.models import Category, Ingredient
|
||||||
|
|
||||||
|
|
||||||
# Graphene will automatically map the User model's fields onto the UserType.
|
# Graphene will automatically map the Category model's fields onto the CategoryNode.
|
||||||
# This is configured in the UserType's Meta class (as you can see below)
|
# This is configured in the CategoryNode's Meta class (as you can see below)
|
||||||
class CategoryNode(DjangoNode):
|
class CategoryNode(DjangoNode):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Category
|
model = Category
|
||||||
|
|
Loading…
Reference in New Issue
Block a user