# graphql-import-webpack-loader

> Webpack loader for [`graphql-import`](https://github.com/graphcool/graphql-import)

Latest version **1.0.2** (published 2019-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install graphql-import-webpack-loader
pnpm add graphql-import-webpack-loader
yarn add graphql-import-webpack-loader
bun add graphql-import-webpack-loader
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-08-23 |
| First published | 2019-08-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jeehyukwon |
| Keywords | graphql, import, webpack, loader, module |

## Links

- npm: https://www.npmjs.com/package/graphql-import-webpack-loader
- Repository: https://github.com/tonyfromundefined/graphql-import-webpack-loader
- Issues: https://github.com/tonyfromundefined/graphql-import-webpack-loader/issues
- npm.io page: https://npm.io/package/graphql-import-webpack-loader

## Dependencies (1)

- [graphql-import](https://npm.io/package/graphql-import.md) ^0.4.5

## 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.2 (latest) — 2019-08-23
- 1.0.1 — 2019-08-23
- 1.0.0 — 2019-08-23

## README

# graphql-import-webpack-loader

Webpack loader for [`graphql-import`](https://github.com/graphcool/graphql-import)

## Install

```console
yarn add --dev graphql-import-webpack-loader
```

## Usage

Resolve GraphQL file import statements as a string. See the tests for more details

```graphql
# import { A } from 'src/schema/a.graphql'
# import { B } from 'src/schema/b.graphql'
# import { C, D } from 'src/schema/cd.graphql'

type Complex  {
  id: ID!
  a: A!
  b: B!
  c: C!
  d: D!
}
```

```js
import typeDefs from './schema.graphql'
```

```js
// webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        exclude: /node_modules/,
        test: /\.graphql$/,
        use: [{ loader: 'graphql-import-webpack-loader' }]
      }
    ]
  }
}
```

## Examples

Simple Server:

```ts
import { GraphQLServer } from 'graphql-yoga'
import resolvers from './resolvers'
import typeDefs from './schema.graphql'

const server = new GraphQLServer({ typeDefs, resolvers })
server.start(() => console.log('Server running on :4000'))
```

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