An open API service indexing awesome lists of open source software.

https://github.com/correttojs/swr-gql


https://github.com/correttojs/swr-gql

Last synced: 11 months ago
JSON representation

Awesome Lists containing this project

README

          

# swr graphql wrapper

This library provides an `swr` wrapper which allows to run type-safe gql requests. It consists of

- a Graphql `fetcher` for direct requests (i.e. on ssr)
- a react `hook` wrapping swr

Both the hook and the fetcher accept a `TypedDocumentNode` generated by [gql codegen](https://www.graphql-code-generator.com/plugins/typed-document-node)