Next.js + SWR
You can use Next.js in conjuntion with SWR (opens in a new tab):
import { request } from 'graphql-request'
const fetcher = query =>
request('https://api.baseql.com/airtable/graphql/appuzDcQEvfnkzXjD', query)
function App () {
const { data, error } = useSWR(`{
people(vegan: true) {
name
}
}`,
fetcher
)
// ...
}
💡
In fact this documentation is written in Next.js and all live examples use BaseQL requests!
See full source code at: github.com/BaseQL/baseql-docs (opens in a new tab)