Skip to content

Commit 841634b

Browse files
glo11372glo82145
andauthored
PWA-3267:Login issue with PWA 14.0 (#4280)
Co-authored-by: glo82145 <glo82145@adobe.com>
1 parent 2614c63 commit 841634b

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

packages/peregrine/lib/Apollo/links/__tests__/__snapshots__/index.spec.js.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ exports[`returns a map with expected keys and values 1`] = `
44
Map {
55
"MUTATION_QUEUE" => "mutationQueue",
66
"RETRY" => "retry",
7+
"AUTH" => "auth",
78
"GQL_CACHE" => "gqlCache",
89
"STORE" => "store",
910
"ERROR" => "error",

packages/peregrine/lib/Apollo/links/__tests__/index.spec.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ jest.mock('@apollo/client', () => ({
77
__esModule: true,
88
createHttpLink: jest.fn(() => 'http')
99
}));
10+
jest.mock('@magento/peregrine/lib/Apollo/links/authLink', () => ({
11+
__esModule: true,
12+
default: jest.fn(() => 'auth')
13+
}));
1014
jest.mock('@magento/peregrine/lib/Apollo/links/errorLink', () => ({
1115
__esModule: true,
1216
default: jest.fn(() => 'error')

packages/peregrine/lib/Apollo/links/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createHttpLink } from '@apollo/client';
22

3+
import createAuthLink from '@magento/peregrine/lib/Apollo/links/authLink';
34
import createErrorLink from '@magento/peregrine/lib/Apollo/links/errorLink';
45
import createGqlCacheLink from '@magento/peregrine/lib/Apollo/links/gqlCacheLink';
56
import createMutationQueueLink from '@magento/peregrine/lib/Apollo/links/mutationQueueLink';
@@ -31,6 +32,7 @@ export const customFetchToShrinkQuery = (uri, options) => {
3132
};
3233

3334
const getLinks = apiBase => {
35+
const authLink = createAuthLink();
3436
const storeLink = createStoreLink();
3537
const errorLink = createErrorLink();
3638
const retryLink = createRetryLink();
@@ -52,6 +54,7 @@ const getLinks = apiBase => {
5254
const links = new Map()
5355
.set('MUTATION_QUEUE', mutationQueueLink)
5456
.set('RETRY', retryLink)
57+
.set('AUTH', authLink)
5558
.set('GQL_CACHE', gqlCacheLink)
5659
.set('STORE', storeLink)
5760
.set('ERROR', errorLink)

0 commit comments

Comments
 (0)