1.0.0 • Published 1 year ago

@mindful-web/graphql-fragment-types v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Mindful Web GraphQL Fragment Types

Provides fragment types for the Mindful Web GraphQL API. For use with Apollo GraphQL clients.

Usage

import introspectionQueryResultData from '@mindful-web/graphql-fragment-types';
import { ApolloClient } from 'apollo-client';
import { InMemoryCache, IntrospectionFragmentMatcher } from 'apollo-cache-inmemory';

const fragmentMatcher = new IntrospectionFragmentMatcher({ introspectionQueryResultData });
const cache = new InMemoryCache({ fragmentMatcher });

export default new ApolloClient({ cache });

Developing / Building

To build a new version of types.json, run the following command inside the monorepo.

GRAPHQL_URL=[the graphql url to build from] node packages/graphql-fragment-types/build.js
1.0.0

1 year ago