Mirror: Modular GraphQL.js import paths without the hassle.
JavaScript 100.0%
2 1 7

Clone this repository

https://tangled.org/kitten.sh/babel-plugin-modular-graphql
git@knot.kitten.sh:kitten.sh/babel-plugin-modular-graphql

For self-hosted knots, clone URLs may differ based on your setup.

README.md

babel-plugin-modular-graphql#

A small transform plugin to cherry-pick GraphQL modules so you don’t have to. Basicaly babel-plugin-lodash for graphql.

Getting Started#

npm install --save-dev babel-plugin-modular-graphql
# or
yarn add --dev babel-plugin-modular-graphql

And add the plugin to your Babel config; it doesn't take any options.

Example#

Imports like these:

import { parse, Kind } from 'graphql';

Become:

import { parse } from "graphql/language/parser";
import { Kind } from "graphql/language/kinds";