# gatsby-plugin-graphql-tag-loader

> Gatsby plugin for importing .graphql and .gql directly into js using graphql-tag/loader.

Latest version **1.0.1** (published 2020-04-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install gatsby-plugin-graphql-tag-loader
pnpm add gatsby-plugin-graphql-tag-loader
yarn add gatsby-plugin-graphql-tag-loader
bun add gatsby-plugin-graphql-tag-loader
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-04-28 |
| First published | 2020-04-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gabriel Pérez |
| Maintainers | garox |
| Keywords | gatsby, gatsby-plugin, graphql, gql, graphql-loader, loader, import |

## Links

- npm: https://www.npmjs.com/package/gatsby-plugin-graphql-tag-loader
- Repository: https://github.com/Yhozen/gatsby-plugin-graphql-tag-loader
- Issues: https://github.com/Yhozen/gatsby-plugin-graphql-tag-loader/issues
- npm.io page: https://npm.io/package/gatsby-plugin-graphql-tag-loader

## Dependencies (1)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.2.0

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-04-28
- 1.0.0 — 2020-04-28

## README

# gatsby-plugin-graphql-tag-loader

Gatsby plugin for importing .graphql and .gql directly into js using graphql-tag/loader.

## Install

`$ yarn add gatsby-plugin-graphql-tag-loader`

or

`$ npm i --save gatsby-plugin-graphql-tag-loader`

## How to use

Simply add the plugin to your gatsby-config.js.

```javascript
{
  plugins: [`gatsby-plugin-graphql-tag-loader`];
}
```

or use custom options

```javascript
{
  plugins: [
    {
      resolve: `gatsby-plugin-graphql-tag-loader`,
      options: {
        exclude: /node_modules/, // default exclude value
        test: /\.(graphql|gql)$/, // default test value
      },
    },
  ];
}
```

## Example

### gatsby-config.js

```javascript
{
  plugins: [`gatsby-plugin-graphql-tag-loader`];
}
```

### currentUser.gql

```graphql
query CurrentUserForLayout {
  currentUser {
    login
    avatar_url
  }
}
```

### twoQueries.graphql

```graphql
query MyQuery1 {
  ...
}

query MyQuery2 {
  ...
}
```

### index.js

```javascript
import currentUserQuery from "./currentUser.gql";
import { MyQuery1, MyQuery2 } from "./twoQueries.graphql";
```

---
_Source: https://npm.io/package/gatsby-plugin-graphql-tag-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
