Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-modular-graphql

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-modular-graphql

Modular GraphQL.js import paths without the hassle

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-68.42%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 13 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc