@apollo/client 4.2.5 → 4.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apollo/client",
3
- "version": "4.2.5",
3
+ "version": "4.2.6",
4
4
  "description": "A fully-featured caching GraphQL client.",
5
5
  "private": false,
6
6
  "keywords": [
@@ -20,6 +20,7 @@ export function createFetchMultipartSubscription(uri, { fetch: preferredFetch, h
20
20
  }
21
21
  catch (parseError) {
22
22
  sink.error(parseError);
23
+ return;
23
24
  }
24
25
  const currentFetch = preferredFetch || maybe(() => fetch) || backupFetch;
25
26
  const observerNext = sink.next.bind(sink);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/subscriptions/relay/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAElE,uEAAuE;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACpF,uEAAuE;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAEpF,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;AAOvC,MAAM,UAAU,gCAAgC,CAC9C,GAAW,EACX,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,KAAyC,EAAE;IAE3E,OAAO,SAAS,0BAA0B,CACxC,SAA4B,EAC5B,SAA6B;QAE7B,MAAM,IAAI,GAAsB;YAC9B,aAAa,EAAE,SAAS,CAAC,IAAI;YAC7B,SAAS;YACT,KAAK,EAAE,SAAS,CAAC,IAAI,IAAI,EAAE;SAC5B,CAAC;QACF,MAAM,OAAO,GAAG,uCAAuC,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QAEvE,OAAO,UAAU,CAA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V,UAAU,CAAC,KAAK,EAAE,CAAC;YACrB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,uCAAuC,CAC9C,OAA+B;IAE/B,MAAM,OAAO,GAAoD;QAC/D,GAAG,kBAAkB,CAAC,OAAO;QAC7B,OAAO,EAAE;YACP,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;YAClB,GAAG,kBAAkB,CAAC,OAAO;YAC7B,MAAM,EACJ,wEAAwE;SAC3E;KACF,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import type { GraphQLResponse, RequestParameters } from \"relay-runtime\";\nimport { Observable } from \"relay-runtime\";\n\nimport type { OperationVariables } from \"@apollo/client\";\nimport type { BaseHttpLink } from \"@apollo/client/link/http\";\nimport { maybe } from \"@apollo/client/utilities/internal/globals\";\n\n// eslint-disable-next-line local-rules/import-from-inside-other-export\nimport { readMultipartBody } from \"../../../link/http/parseAndCheckHttpResponse.js\";\n// eslint-disable-next-line local-rules/import-from-inside-other-export\nimport { fallbackHttpConfig } from \"../../../link/http/selectHttpOptionsAndBody.js\";\n\nconst backupFetch = maybe(() => fetch);\n\ntype CreateMultipartSubscriptionOptions = {\n fetch?: WindowOrWorkerGlobalScope[\"fetch\"];\n headers?: Record<string, string>;\n};\n\nexport function createFetchMultipartSubscription(\n uri: string,\n { fetch: preferredFetch, headers }: CreateMultipartSubscriptionOptions = {}\n) {\n return function fetchMultipartSubscription(\n operation: RequestParameters,\n variables: OperationVariables\n ): Observable<GraphQLResponse> {\n const body: BaseHttpLink.Body = {\n operationName: operation.name,\n variables,\n query: operation.text || \"\",\n };\n const options = generateOptionsForMultipartSubscription(headers || {});\n\n return Observable.create((sink) => {\n const controller = new AbortController();\n\n try {\n options.body = JSON.stringify(body);\n } catch (parseError) {\n sink.error(parseError as Error);\n }\n\n const currentFetch = preferredFetch || maybe(() => fetch) || backupFetch;\n const observerNext = sink.next.bind(sink);\n\n currentFetch!(uri, { ...options, signal: controller.signal })\n .then((response) => {\n const ctype = response.headers?.get(\"content-type\");\n\n if (ctype !== null && /^multipart\\/mixed/i.test(ctype)) {\n return readMultipartBody(response, observerNext);\n }\n\n sink.error(new Error(\"Expected multipart response\"));\n })\n .then(() => {\n sink.complete();\n })\n .catch((err: any) => {\n if (err.name !== \"AbortError\") {\n sink.error(err);\n }\n });\n\n return () => {\n controller.abort();\n };\n });\n };\n}\n\nfunction generateOptionsForMultipartSubscription(\n headers: Record<string, string>\n) {\n const options: { headers: Record<string, any>; body?: string } = {\n ...fallbackHttpConfig.options,\n headers: {\n ...(headers || {}),\n ...fallbackHttpConfig.headers,\n accept:\n \"multipart/mixed;boundary=graphql;subscriptionSpec=1.0,application/json\",\n },\n };\n return options;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/subscriptions/relay/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAElE,uEAAuE;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACpF,uEAAuE;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAEpF,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;AAOvC,MAAM,UAAU,gCAAgC,CAC9C,GAAW,EACX,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,KAAyC,EAAE;IAE3E,OAAO,SAAS,0BAA0B,CACxC,SAA4B,EAC5B,SAA6B;QAE7B,MAAM,IAAI,GAAsB;YAC9B,aAAa,EAAE,SAAS,CAAC,IAAI;YAC7B,SAAS;YACT,KAAK,EAAE,SAAS,CAAC,IAAI,IAAI,EAAE;SAC5B,CAAC;QACF,MAAM,OAAO,GAAG,uCAAuC,CAAC,OAAO,IAAI,EAAE,CAAC,CAA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AC,CAAC;YAEL,OAAO,GAAG,EAAE;gBACV,UAAU,CAAC,KAAK,EAAE,CAAC;YACrB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,uCAAuC,CAC9C,OAA+B;IAE/B,MAAM,OAAO,GAAoD;QAC/D,GAAG,kBAAkB,CAAC,OAAO;QAC7B,OAAO,EAAE;YACP,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;YAClB,GAAG,kBAAkB,CAAC,OAAO;YAC7B,MAAM,EACJ,wEAAwE;SAC3E;KACF,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import type { GraphQLResponse, RequestParameters } from \"relay-runtime\";\nimport { Observable } from \"relay-runtime\";\n\nimport type { OperationVariables } from \"@apollo/client\";\nimport type { BaseHttpLink } from \"@apollo/client/link/http\";\nimport { maybe } from \"@apollo/client/utilities/internal/globals\";\n\n// eslint-disable-next-line local-rules/import-from-inside-other-export\nimport { readMultipartBody } from \"../../../link/http/parseAndCheckHttpResponse.js\";\n// eslint-disable-next-line local-rules/import-from-inside-other-export\nimport { fallbackHttpConfig } from \"../../../link/http/selectHttpOptionsAndBody.js\";\n\nconst backupFetch = maybe(() => fetch);\n\ntype CreateMultipartSubscriptionOptions = {\n fetch?: WindowOrWorkerGlobalScope[\"fetch\"];\n headers?: Record<string, string>;\n};\n\nexport function createFetchMultipartSubscription(\n uri: string,\n { fetch: preferredFetch, headers }: CreateMultipartSubscriptionOptions = {}\n) {\n return function fetchMultipartSubscription(\n operation: RequestParameters,\n variables: OperationVariables\n ): Observable<GraphQLResponse> {\n const body: BaseHttpLink.Body = {\n operationName: operation.name,\n variables,\n query: operation.text || \"\",\n };\n const options = generateOptionsForMultipartSubscription(headers || {});\n\n return Observable.create((sink) => {\n const controller = new AbortController();\n\n try {\n options.body = JSON.stringify(body);\n } catch (parseError) {\n sink.error(parseError as Error);\n return;\n }\n\n const currentFetch = preferredFetch || maybe(() => fetch) || backupFetch;\n const observerNext = sink.next.bind(sink);\n\n currentFetch!(uri, { ...options, signal: controller.signal })\n .then((response) => {\n const ctype = response.headers?.get(\"content-type\");\n\n if (ctype !== null && /^multipart\\/mixed/i.test(ctype)) {\n return readMultipartBody(response, observerNext);\n }\n\n sink.error(new Error(\"Expected multipart response\"));\n })\n .then(() => {\n sink.complete();\n })\n .catch((err: any) => {\n if (err.name !== \"AbortError\") {\n sink.error(err);\n }\n });\n\n return () => {\n controller.abort();\n };\n });\n };\n}\n\nfunction generateOptionsForMultipartSubscription(\n headers: Record<string, string>\n) {\n const options: { headers: Record<string, any>; body?: string } = {\n ...fallbackHttpConfig.options,\n headers: {\n ...(headers || {}),\n ...fallbackHttpConfig.headers,\n accept:\n \"multipart/mixed;boundary=graphql;subscriptionSpec=1.0,application/json\",\n },\n };\n return options;\n}\n"]}
package/version.js CHANGED
@@ -1,3 +1,3 @@
1
- export const version = "4.2.5";
1
+ export const version = "4.2.6";
2
2
  export const build = "esm";
3
3
  //# sourceMappingURL=version.js.map