1.0.0 • Published 12 months ago

@cmpsr/contentful-core v1.0.0

Weekly downloads
1,411
License
MIT
Repository
github
Last release
12 months ago

contentful-core

A utility package providing the createContentfulLink method for setting up a link with Apollo Client in React/Next.js applications using Contentful.

Install

Install the package using Yarn:

yarn add @cmpsr/contentful-core

Usage

createContentfulLink

This method creates an Apollo Client HttpLink for connecting to Contentful's GraphQL API.

Here's how to use createContentfulLink to configure Apollo Client in a Next.js application:

import { ApolloClient, InMemoryCache } from "@apollo/client";
import { createContentfulLink } from "@cmpsr/contentful-core";

const apolloClient = new ApolloClient({
  link: createContentfulLink({
    space: process.env.CONTENTFUL_SPACE_ID,
    accessToken: process.env.CONTENTFUL_ACCESS_TOKEN_DELIVERY,
  }),
  cache: new InMemoryCache(),
});

export default apolloClient;
1.0.0

12 months ago

0.5.4

1 year ago

0.5.3

2 years ago

0.5.0

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.3.0

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago