Closed jnovak-SM2Dev closed 2 months ago
You might have encountered a regression that we had in 0.3.0 - could you please try it with 0.3.1 that I just released?
@phryneas Sorry, had to switch away from the app folder since there are a lot of issues with plugins. I have a test app i'll test this with later day.
@phryneas From what I can tell both getSession()
and getServerSession(authOptions)
still call the session endpoint on each call.
@phryneas An example with next-auth would be useful.
My config is identical to @SM2DevLLC.
I'm not sure if this is even related to next-auth but I've been trying to use useSuspenseQuery
but I've been getting a weird error:
⨯ node_modules/.pnpm/@apollo+client@3.8.4_graphql@16.8.1_react-dom@18.2.0_react@18.2.0/node_modules/@apollo/client/errors/errors.cjs (33:0) @ new ApolloError
⨯ ApolloError: Cannot read properties of null (reading 'user')
at new Promise (<anonymous>)
at Array.forEach (<anonymous>)
I'm not able to trace back why it was created.
It works fine if I simply do a useQuery
.
@Tanish2002 two different things ^^
next-auth
, I can take a look and see if I can point things out, but I haven't used that one myself yet.useSuspenseQuery
from this package, not from @apollo/client
. If the problem persists, please open a separate issue and provide some kind of reproduction.I'm doing some housekeeping so I'm closing some older issues that haven't seen activity in a while. If this is still relevant, please feel free to reopen the issue.
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.
I'm trying to figure out how to use this properly with Next Auth. I put what I have below, it does work, but I don't think it's correct and the client side has to keep calling to get the token on each call, which seems wrong. Any suggestions or samples would be incredibly helpful.
layout.tsx
NextAuthProvider
NextSessionProvider
ApolloWrapper
client.ts