-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
I'm having an issue using this library that whenever I change something in my backend, the next js app does not update with the new results(when refreshing the page) even if the fetch policy is network-only o no-cache, any ideas why this is happening, or is there some documentation on how to accomplish that.
import {ssrGetRanking, PageGetRankingComp} from 'generated/page'
import {GetServerSidePropsContext} from 'next'
import React from 'react'
import {withApollo} from 'withApollo'
const RankingPage: PageGetRankingComp = ({data, error}) => {
// Comp logic goes here
}
export async function getServerSideProps(ctx: GetServerSidePropsContext) {
return await ssrGetRanking.getServerPage({fetchPolicy: 'network-only'}, ctx)
}
export default withApollo(ssrGetRanking.withPage(() => ({}))(RankingPage))
I also try to add the fetch policy in the HOC wrap but then I notice that the component was having a delay with the data values because it displays undefined and after that the data is valid.
import {ssrGetRanking, PageGetRankingComp} from 'generated/page'
import {GetServerSidePropsContext} from 'next'
import React from 'react'
import {withApollo} from 'withApollo'
const RankingPage: PageGetRankingComp = ({data, error}) => {
// Comp logic goes here
}
export async function getServerSideProps(ctx: GetServerSidePropsContext) {
return await ssrGetRanking.getServerPage({fetchPolicy: 'network-only'}, ctx)
}
export default withApollo(
ssrGetRanking.withPage(() => ({fetchPolicy: 'network-only'}))(RankingPage),
)
Metadata
Metadata
Assignees
Labels
No labels