@airbnb/lunar-apollo
Apollo and GraphQL utilities.
Last updated a year ago by milesj .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @airbnb/lunar-apollo 
SYNC missed versions from official npm registry.

Lunar Apollo

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

yarn add @airbnb/lunar-apollo

This package relies on GraphQL related packages to also be installed.

yarn add graphql graphql-tag

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>
  );
}

Current Tags

  • 3.0.2                                ...           latest (6 months ago)
  • 2.5.0-alpha.0                                ...           next (a year ago)

36 Versions

  • 3.0.2                                ...           6 months ago
  • 3.0.1                                ...           6 months ago
  • 3.0.0                                ...           7 months ago
  • 2.8.2                                ...           8 months ago
  • 2.8.1                                ...           8 months ago
  • 2.8.0                                ...           9 months ago
  • 2.7.0                                ...           9 months ago
  • 2.6.3                                ...           10 months ago
  • 2.6.2                                ...           a year ago
  • 2.6.1                                ...           a year ago
  • 2.6.0                                ...           a year ago
  • 2.5.0                                ...           a year ago
  • 2.5.0-alpha.1                                ...           a year ago
  • 2.5.0-alpha.0                                ...           a year ago
  • 2.4.1                                ...           a year ago
  • 2.4.0                                ...           a year ago
  • 2.3.1                                ...           a year ago
  • 2.3.0                                ...           a year ago
  • 2.2.1                                ...           a year ago
  • 2.2.0                                ...           a year ago
  • 2.1.2                                ...           a year ago
  • 2.1.1                                ...           a year ago
  • 2.1.0                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 2.0.0-rc.0                                ...           a year ago
  • 2.0.0-alpha.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
  • 1.0.0-alpha.1                                ...           a year ago
  • 1.0.0-alpha.0                                ...           a year ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (10)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |