apollo-client-nextjs: __typename field missing in suspense queries

In version 0.8.0: __typename in every type by default In version 0.9.0: __typename missing by default, it’s included only when specific type has explicit __typename field to resolve in operation

even with cache config option addTypename: true.

About this issue

  • Original URL
  • State: open
  • Created 3 months ago
  • Comments: 22 (11 by maintainers)

Most upvoted comments

One thing that has come up by investigating that I wanted to run by you:

This code path has not changed since 0.8.0. What has changed is when it is executed:

In 0.8.0 it would be executed if:

  • the connection has closed before a result could be streamed over

In 0.9.0 it would be executed it:

  • the connection has closed before a result could be streamed over
  • a query has resulted in an error during SSR

So, this should only happen in “fallback” situations.

Are you seeing this all the time in your code? If yes, could you please give an example on how you use the library, or maybe even a reproduction of this happening?

Could you please try this release and report back if it fixes your issue?

npm i @apollo/experimental-nextjs-app-support@0.0.0-commit-4875530

It’s the end of my day now, but I’ll pick this back up tomorrow and your feedback would be very valuable to me!

That’s very curious, thank you for the report.

I can see the __typename added in SSR requests, but not in the browser. I’ll investigate.