Skip to content

Instantly share code, notes, and snippets.

@chris001177
Created June 27, 2019 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris001177/c40342ab6ed99ab271c7de41348c43da to your computer and use it in GitHub Desktop.
Save chris001177/c40342ab6ed99ab271c7de41348c43da to your computer and use it in GitHub Desktop.
# 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