Webpack loader for graphql-import that resolves GraphQL import statements (e.g., `# import { Type } from './type.graphql'`) in `.graphql` files. Current version 0.2.1, last updated in 2018. This package is unmaintained; the repository is archived. It was part of the deprecated Graphcool ecosystem. Alternatives: use `graphql-import` directly with `raw-loader` or `@graphql-tools/load` and `@graphql-tools/graphql-file-loader`. The loader returns the imported schema as a string.
npm install graphql-import-loaderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures webpack to resolve GraphQL import statements and use the resulting string in JavaScript.
Use @graphql-tools/load and @graphql-tools/graphql-file-loader or use raw-loader with graphql-import directly.
Ensure all import paths are relative or use webpack resolve.alias.
Add a declaration file: declare module '*.graphql' { const content: string; export default content; }Add the loader rule as shown in the quickstart. Ensure the test matches .graphql and the exclude is correct.
npm install --save-dev graphql-import
Check the relative path and ensure the source file exists. The import paths are relative to the current file.