withUrqlClient with exchange-graphcache example(next.js)? #3325
-
I have tried to use exchange-graphcache for pagination with next.js It isn't worked, I can't find example about it Anyone have example for this?
|
Beta Was this translation helpful? Give feedback.
Answered by
JoviDeCroock
Jul 21, 2023
Replies: 1 comment 5 replies
-
Your description is quite unclear here 😅 what didn't work... Generally how it would look is as followed: import { fetchExchange } from '@urql/core';
import { relayPagination } from '@urql/exchange-graphcache/extras'
import { cacheExchange } from '@urql/exchange-graphcache'
const cache = cacheExchange({
resolvers: { YourType: { field: relayPagination() }}
})
export default withUrqlClient(
ssrExchange => ({
url: 'https://trygql.formidable.dev/graphql/basic-pokedex',
exchanges: [cache, ssrExchange, fetchExchange],
}),
{ ssr: true }
)(YourComponent; |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
kitten
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your description is quite unclear here 😅 what didn't work...
Generally how it would look is as followed: