Skip to content

Instantly share code, notes, and snippets.

@niieani
Created November 10, 2021 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niieani/f3d0eebb9c229efd03dce1c7e7369d53 to your computer and use it in GitHub Desktop.
Save niieani/f3d0eebb9c229efd03dce1c7e7369d53 to your computer and use it in GitHub Desktop.
Loading Laika in production code conditionally
import { createLazyLoadableLaikaLink } from '@zendesk/laika'
const conditionalLinks = window.Cypress
? [createLazyLoadableLaikaLink({ clientName: 'my-graph' })
: []
const apolloClient = new ApolloClient({
link: ApolloLink.from([
...conditionalLinks,
new HttpLink({ uri: 'https://api.example.com/graphql' }),
]),
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment