@gql2ts/loader
TypeScript icon, indicating that this package has built-in type declarations

2.0.0-4 • Public • Published

@gql2ts/from-query

This package is used to load graphql files into webpack using @gql2ts/from-query. generate types/interfaces from a GraphQL Schema and a query.

Installation

npm install @gql2ts/loader

Basic Usage in webpack configuration file:

Note: It is recommended to also include graphql-tag/loader in your webpack config, see below for an example

import Schema from './schema';

{
// ...
  module: {
    rules: {
      {
        test: /\.(graphql|gql)$/,
        exclude: /node_modules/,
        use: [
          {
            loader: 'graphql-tag/loader' // Recommended
          },
          {
            loader: '@gql2ts/loader',
            options: {
              schema: Schema, // Required
              typeMap: { }, // Optional: Partial<ITypeMap> from @gql2ts/types
              options: { } // Optional: IProvidedOptions from @gql2ts/types
            }
          }
        },
      ]
    },
  }
// ...
}

Package Sidebar

Install

npm i @gql2ts/loader

Weekly Downloads

0

Version

2.0.0-4

License

ISC

Unpacked Size

4.68 kB

Total Files

8

Last publish

Collaborators

  • brandon.herman
  • brettjurgens