Skip to content

Commit

Permalink
PWA-3154: GraphQL cacheable requests always have Authorization Bearer…
Browse files Browse the repository at this point in the history
… header
  • Loading branch information
glo11372 committed Mar 4, 2024
1 parent 34b2d44 commit e2e138e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ exports[`returns a map with expected keys and values 1`] = `
Map {
"MUTATION_QUEUE" => "mutationQueue",
"RETRY" => "retry",
"AUTH" => "auth",
"GQL_CACHE" => "gqlCache",
"STORE" => "store",
"ERROR" => "error",
Expand Down
2 changes: 1 addition & 1 deletion packages/peregrine/lib/Apollo/links/authLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function createAuthLink() {
// return the headers to the context so httpLink can read them
return {
headers: {
...headers,
...headers
// authorization: token ? `Bearer ${token}` : ''
}
};
Expand Down
6 changes: 3 additions & 3 deletions packages/peregrine/lib/Apollo/links/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createHttpLink } from '@apollo/client';

import createAuthLink from '@magento/peregrine/lib/Apollo/links/authLink';
// import createAuthLink from '@magento/peregrine/lib/Apollo/links/authLink';
import createErrorLink from '@magento/peregrine/lib/Apollo/links/errorLink';
import createGqlCacheLink from '@magento/peregrine/lib/Apollo/links/gqlCacheLink';
import createMutationQueueLink from '@magento/peregrine/lib/Apollo/links/mutationQueueLink';
Expand Down Expand Up @@ -32,7 +32,7 @@ export const customFetchToShrinkQuery = (uri, options) => {
};

const getLinks = apiBase => {
const authLink = createAuthLink();
// const authLink = createAuthLink();
const storeLink = createStoreLink();
const errorLink = createErrorLink();
const retryLink = createRetryLink();
Expand All @@ -54,7 +54,7 @@ const getLinks = apiBase => {
const links = new Map()
.set('MUTATION_QUEUE', mutationQueueLink)
.set('RETRY', retryLink)
.set('AUTH', authLink)
// .set('AUTH', authLink)
.set('GQL_CACHE', gqlCacheLink)
.set('STORE', storeLink)
.set('ERROR', errorLink)
Expand Down

0 comments on commit e2e138e

Please sign in to comment.