npm install
npm start
- Open the browser and go to
http://localhost:4000/graphql
- Run the following query:
query { products(first: 1) { id name discounts { id } categories { id discounts { id } } } }
- You will receive the following error:
{ "data": { "products": [ null ] }, "errors": [ { "message": "Cannot return null for non-nullable field Category.discounts.", "path": [ "products", 0, "categories", 0, "discounts" ] } ] }
- Interestingly, the following query works:
query { products(first: 1) { id name discounts { id } categories { id test: discounts { id } } } }