1.1.0 • Published 2 years ago

babel-plugin-modular-graphql v1.1.0

Weekly downloads
33
License
MIT
Repository
github
Last release
2 years ago

babel-plugin-modular-graphql

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

This automatically finds the most specific import from the graphql module's files and folders that works across GraphQL.js v14, v15, and v16.

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";

Limitations

  • The plugin currently does not support require()
  • The plugin automatically generates an import-map that drills down into graphql's files. This may break if files at a depth of 1–2 change their names.
1.1.0

2 years ago

1.0.1

3 years ago

1.0.0

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