# extract-gql

> A tool to extract GraphQL documents from projects.

Latest version **0.0.1-alpha** (published 2017-04-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install extract-gql
pnpm add extract-gql
yarn add extract-gql
bun add extract-gql
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1-alpha |
| Published | 2017-04-17 |
| First published | 2017-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | lewisf |

## Links

- npm: https://www.npmjs.com/package/extract-gql
- Repository: https://github.com/lewisf/extract-gql
- Homepage: https://github.com/lewisf/extract-gql#readme
- Issues: https://github.com/lewisf/extract-gql/issues
- npm.io page: https://npm.io/package/extract-gql

## Dependencies (4)

- [graphql](https://npm.io/package/graphql.md) ^0.9.1
- [@types/node](https://npm.io/package/@types/node.md) ^7.0.11
- [@types/yargs](https://npm.io/package/@types/yargs.md) ^6.6.0
- [@types/lodash](https://npm.io/package/@types/lodash.md) ^4.14.58

## Recent versions

- 0.0.1-alpha (latest) — 2017-04-17
- 0.0.1 (alpha) — 2017-04-17

## README

# extract-gql

A utility for extracting graphql documents from multiple files into a single string.

## Setup

This isn't published yet ... clone and use `npm link` or install it from a file path.

## Usage

```js
import { ExtractGQL } from 'extract-gql';

const extractor = new ExtractGQL();
const queryDocument = extractor.fromFiles([
  'path/to/oneQuery.graphl',
  'path/to/sourceFileWithEmbeddedGraphQL.js',
]);
```

If you have graphql documents embedded within your source files and use a template tag other than `gql`, then make sure to initialize your extractor accordingly.

```js
const extractor = new ExtractGQL({ templateTag: 'MyTag' });
```

## API
- ExtractGQL#constructor `(options: { templateTag: string }) => void`
- ExtractGQL#fromFiles `(filePaths: string) => string`
- ExtractGQL#fromFile `(filePath: string) => string`
- ExtractGQL#fromJS `(filePath: string) => string`
- ExtractGQL#fromGraphQL `(filePath: string) => string`

`

## More to come!

---
_Source: https://npm.io/package/extract-gql · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
