django-graphql-apollo-react-demo
django-graphql-apollo-react-demo copied to clipboard
add example for how to test functions on the Type classes
Something like this:
from graphene.test import Client
c = Client(root_schema)
resp = c.execute('''
{
allSizesForProduct(productPk: 1) {
pk, inCm
}
}
''')
res = resp['data']['allSizesForProduct'][0]
self.assertEqual(res['pk'], 1, msg=(
'Should return the pk of the item'))