Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@airbnb/lunar-apollo

Package Overview
Dependencies
Maintainers
6
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@airbnb/lunar-apollo

Apollo and GraphQL utilities.

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
45
increased by95.65%
Maintainers
6
Weekly downloads
 
Created
Source

Lunar Apollo

Provides out of the box support for GraphQL, powered by Apollo.

yarn add @airbnb/lunar-apollo

Setup

Initialize the package to create an Apollo client. The following option settings may be passed to customize this package.

  • links (ApolloLink[]) - Collection of Apollo links (middleware) to apply to the client.
import Apollo, { HttpLink } from '@airbnb/lunar-apollo';

const httpLink = new HttpLink({
  uri: '/api/graphql',
  credentials: 'same-origin',
});

Apollo.initialize({
  links: [httpLink],
});

The client can be accessed with Apollo.getClient().

Usage

Once the Apollo client has been created, we can make it available to our queries and mutations by wrapping our application in a provider.

import { Provider } from '@airbnb/lunar-apollo';

function Root() {
  return (
    <Provider>
      <App />
    </Provider>
  );
}

FAQs

Package last updated on 13 May 2021

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc