Created
June 27, 2019 15:39
-
-
Save chris001177/c40342ab6ed99ab271c7de41348c43da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cookbook/ingredients/schema.py | |
import graphene | |
from graphene_django.types import DjangoObjectType | |
from ingredients.models import Category, Ingredient | |
class CategoryType(DjangoObjectType): | |
class Meta: | |
model = Category | |
class IngredientType(DjangoObjectType): | |
class Meta: | |
model = Ingredient | |
class Query(object): | |
hello = graphene.String() | |
def resolve_hello(self, info, **kwargs): | |
return "world" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment