django-graphql-apollo-react-demo icon indicating copy to clipboard operation
django-graphql-apollo-react-demo copied to clipboard

add example for how to test functions on the Type classes

Open mbrochh opened this issue 7 years ago • 0 comments

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'))

mbrochh avatar Jul 07 '17 07:07 mbrochh