Replies: 1 comment
-
When using Prisma's graphql-request library with useSWR (following documentation) things work as expected under common scenarios. However, we would like to utilize the @defer directive within GraphQL to asynchronously return data as it is available from the GraphQL server. Using other graphql clients, this works okay. But we would really like to use SWR with graphql-request to keep the build size down (and because we love SWR and are familiar with it). When using the @defer directive, the GraphQL server returns back a multipart/mixed stream. and I don't think SWR knows how to handle this response. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bug report
Description / Observed Behavior
I am trying to use the graphql-request library as recommended in the documentation. If my graphql query contains the @defer directive in it, SWR does not seem to know how to map/handle the response.
Expected Behavior
I would expect to see the data rendered from the initial query, and when the deferred data comes back, for it to then update the UX.
Beta Was this translation helpful? Give feedback.
All reactions