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
But I'm not able to use this library with @defer. It throws a JSON parsing error on this line. Are there plans to support it?
Since this library already calls parseAndCheckHttpResponse from @apollo/client, I think it can be easily fixed by doing it conditionally like in createHttpLink.ts - @apollo/client exports readMultipartBody function which it uses for multipart/mixed responses.
The text was updated successfully, but these errors were encountered:
FWIW, I solved this by creating a splitLink between the regular apollo link and the upload link:
// httpLink is used for defer and subscription querieslethttpLink=createHttpLink();// uploadLink is used for all other queries. Eventually we want to use to use// this only for upload queries, but for now we don't want to switch fully to// the regular Apollo Link yet.letuploadLink=createUploadLink();constsplitLink=split(({ query })=>{// does not match custom directives beginning with @deferconsthasDefer=hasDirectives(["defer"],query);constdefinition=getMainDefinition(query);return((definition.kind==="OperationDefinition"&&definition.operation==="subscription")||hasDefer);},httpLink,uploadLink);
@apollo/client
supports@defer
directive since version 3.7.0:https://www.apollographql.com/docs/react/data/defer/
But I'm not able to use this library with
@defer
. It throws a JSON parsing error on this line. Are there plans to support it?Since this library already calls
parseAndCheckHttpResponse
from@apollo/client
, I think it can be easily fixed by doing it conditionally like in createHttpLink.ts -@apollo/client
exportsreadMultipartBody
function which it uses for multipart/mixed responses.The text was updated successfully, but these errors were encountered: