Closed modbender closed 4 years ago
There are several examples you can look at:
Note the fetch options are centrally configured. In my own apps, I both configure the fetch options override and have my own use_API
hook (replace _
with you API name), which wraps useGraphQL
and sets the fetch options override from the config.
I don't have a need for static site generation in my projects; if content is coming from my GraphQL API that means it's dynamic - it wouldn't make sense to deploy a static HTML snapshot of that content.
Some people might find it SSG useful, so there is an issue to support it you can track here: https://github.com/jaydenseric/next-graphql-react/issues/4 .
There is no issue for it, but I intend to replace the withGraphQLApp
decorator with one that can be applied to either a page or the whole app (the way it works currently).
Hey, I checked a lots of places for examples of
withGraphQLConfig
, couldn't find what I needed. I am using django graphene as backend and having url like :http://127.0.0.1:8000/graphql
, after checking out some pages all I found is to use fetchOptionsOverride, but I don't want to use it every time I want to call query, is it possible that I put this in one place likenext.config.js
and it automatically uses it while calling queries? i'm new to nextjs + graphql, have worked with nextjs + apollo + graphql but the page did not prerender instead became csr (maybe I missed some things but this is what I tried : https://github.com/tomanagle/GraphQL-Apollo-Next.js/blob/master/pages/index.js)