Class CommerceApiClientFactory
Constructors
constructor
- new CommerceApiClientFactory(graphqlServiceUrl: string, connector: string, defaultRequestHeaders?: HeadersInit, defaultAnonymousCredentials?: Credentials, ssrMode?: boolean, initialToken?: string): CommerceApiClientFactory
Parameters
graphqlServiceUrl: string
connector: string
Optional defaultRequestHeaders: HeadersInit
Optional defaultAnonymousCredentials: Credentials
ssrMode: boolean = false
Optional initialToken: string
Methods
addApolloState
- addApolloState(props: any): any
Parameters
Returns any
getApolloClient
- getApolloClient(initialState?: any): ApolloClient<NormalizedCacheObject>
Parameters
Optional initialState: any
Returns ApolloClient<NormalizedCacheObject>
getCurrentToken
- getCurrentToken(): undefined | string
Returns undefined | string
getDataFromTree
- getDataFromTree(tree: ReactElement<any, string | JSXElementConstructor<any>>): Promise<SSRContent>
Parameters
tree: ReactElement<any, string | JSXElementConstructor<any>>
Returns Promise<SSRContent>