RevereCRE / relay-nextjs

⚡️ Relay integration for Next.js apps
https://reverecre.github.io/relay-nextjs/
MIT License
251 stars 30 forks source link

Make fetch policy configurable #46

Closed FINDarkside closed 2 years ago

FINDarkside commented 2 years ago

Add (optional) fetchPolicy option to RelayOptions. Defaults to store-and-network so the change should be backwards compatible.

What I'd ideally want to do (not in this PR) is that we could use store-and-network on page change and store-or-network when only query params change. Do you think that would be doable? Just asking in case you already know, but I can also think about this later :)

From quick look I'm unsure how I would detect what the previous page was in the function where I need to decide fetch policy. or maybe it would be possible to move the decision to the actual react component. We'll see.

rrdelaney commented 2 years ago

Published in v0.7.0!