diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /app/assets/javascripts/lib/utils/apollo_startup_js_link.js | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'app/assets/javascripts/lib/utils/apollo_startup_js_link.js')
-rw-r--r-- | app/assets/javascripts/lib/utils/apollo_startup_js_link.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/assets/javascripts/lib/utils/apollo_startup_js_link.js b/app/assets/javascripts/lib/utils/apollo_startup_js_link.js index 5c120dd532f..014823f3831 100644 --- a/app/assets/javascripts/lib/utils/apollo_startup_js_link.js +++ b/app/assets/javascripts/lib/utils/apollo_startup_js_link.js @@ -7,7 +7,7 @@ import { isEqual, pickBy } from 'lodash'; * @param obj * @returns {Dictionary<unknown>} */ -const pickDefinedValues = obj => pickBy(obj, x => x !== undefined); +const pickDefinedValues = (obj) => pickBy(obj, (x) => x !== undefined); /** * Compares two set of variables, order independent @@ -28,9 +28,9 @@ export class StartupJSLink extends ApolloLink { // Extract operationNames from the queries and ensure that we can // match operationName => element from result array parseStartupCalls(calls) { - calls.forEach(call => { + calls.forEach((call) => { const { query, variables, fetchCall } = call; - const operationName = parse(query)?.definitions?.find(x => x.kind === 'OperationDefinition') + const operationName = parse(query)?.definitions?.find((x) => x.kind === 'OperationDefinition') ?.name?.value; if (operationName) { @@ -71,9 +71,9 @@ export class StartupJSLink extends ApolloLink { return forward(operation); } - return new Observable(observer => { + return new Observable((observer) => { fetchCall - .then(response => { + .then((response) => { // Handle HTTP errors if (!response.ok) { throw new Error('fetchCall failed'); @@ -81,7 +81,7 @@ export class StartupJSLink extends ApolloLink { operation.setContext({ response }); return response.json(); }) - .then(result => { + .then((result) => { if (result && (result.errors || !result.data)) { throw new Error('Received GraphQL error'); } @@ -92,10 +92,10 @@ export class StartupJSLink extends ApolloLink { }) .catch(() => { forward(operation).subscribe({ - next: result => { + next: (result) => { observer.next(result); }, - error: error => { + error: (error) => { observer.error(error); }, complete: observer.complete.bind(observer), |