All files / src/clients/graphql storefront_client.ts

100% Statements 15/15
85.71% Branches 6/7
100% Functions 3/3
100% Lines 15/15

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  1x 1x 1x 1x 1x 1x 1x 1x   2x 2x 2x   1x 2x    
import {Context} from '../../context';
import {ShopifyHeader} from '../../base-types';
 
import {GraphqlClient, AccessTokenHeader} from './graphql_client';
 
export class StorefrontClient extends GraphqlClient {
  protected baseApiPath = '/api';
 
  protected getAccessTokenHeader(): AccessTokenHeader {
    return {
      header: ShopifyHeader.StorefrontAccessToken,
      value: (Context.IS_PRIVATE_APP
        ? Context.PRIVATE_APP_STOREFRONT_ACCESS_TOKEN || this.accessToken
        : this.accessToken) as string,
    };
  }
}