You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to memoize the fetch function for graphql-request using lodash.memoize, but it gives "Error: Body is unusable". Is this a bug or am I missing something?
For reference the gqlSdk in the screenshot is generated by graphql-codegen using import { getSdk, type SdkFunctionWrapper } from '@/generated/gql/sdk'; export const gqlSdk = getSdk(gqlClient);, it's just a simple wrapper around gqlClient.request though so the effect should be the same:
Workaround
I've worked around the issue for now by memoizing the individual methods in that sdk instead of the underlying fetch
Description
I've tried to memoize the fetch function for graphql-request using lodash.memoize, but it gives "Error: Body is unusable". Is this a bug or am I missing something?
Thanks
Reproduction Steps/Repo Link
Screenshot
For reference the
gqlSdk
in the screenshot is generated by graphql-codegen usingimport { getSdk, type SdkFunctionWrapper } from '@/generated/gql/sdk'; export const gqlSdk = getSdk(gqlClient);
, it's just a simple wrapper aroundgqlClient.request
though so the effect should be the same:Workaround
I've worked around the issue for now by memoizing the individual methods in that sdk instead of the underlying fetch
The text was updated successfully, but these errors were encountered: