Socket
Book a DemoInstallSign in
Socket

@edgio/apollo

Package Overview
Dependencies
Maintainers
1
Versions
2555
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@edgio/apollo

Apollo GraphQL middleware for enabling edge caching on Edgio.

7.5.0
latest
npmnpm
Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

@edgio/apollo

Allows you derive the URL for apollo queries so you can prefetch them using @edgio/prefetch

Configuration

// apollo client configuration
import { createHttpLink } from '@edgio/apollo'

export default () => ({
  defaultHttpLink: false,
  link: createHttpLink({
    uri: typeof window === 'undefined' ? process.env.SHOPIFY_GQL_ENDPOINT : '/api/graphql',
    headers: { 'Access-Token': process.env.GQL_ACCESS_TOKEN },
  }),
})

If you're using @nuxtjs/apollo, you can use the configuration above by linking it to the apollo config in your nuxt.config.js:

  apollo: {
    clientConfigs: {
      default: '~/apollo.config.js' // path to the apollo client config shown above
    }
  }

Getting the URL to prefetch

import { createApolloURL } from '@edgio/apollo'

const urlToPrefetch = createApolloURL(apolloClient, query, variables)

FAQs

Package last updated on 11 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.