Created
November 10, 2021 22:48
-
-
Save niieani/f3d0eebb9c229efd03dce1c7e7369d53 to your computer and use it in GitHub Desktop.
Loading Laika in production code conditionally
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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