Documentation
¶
Overview ¶
This example demonstrates a 3-level hierarchy (Author -> Books -> Reviews) with data prefetching at each level to avoid N+1 query problems. To run the example, execute:
go run example/prefetch/main.go
Then send a query like this (using curl or any GraphQL client):
curl -X POST http://localhost:8080/query \ -H 'Content-Type: application/json' \ -d '{"query":"query GetAuthors($top:Int!,$last:Int!){ authors { id name books(top:$top){ id title reviews(last:$last){ id content rating } } }}","variables":{"top":2,"last":2}}'
Click to show internal directories.
Click to hide internal directories.