@julr/gql-generator-full-blown-preset
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

gql-generator-full-blown-preset

🛩 A cool and opinionated base configuration for Graphql Code Generator.

Features

Installation

pnpm add -D @julr/gql-generator-full-blown-preset 
pnpm add @graphql-typed-document-node/core

If you are using pnpm you must hoist the @graphql-codegen dependencies to the root modules directory. This could be done by adding the following content to your project .npmrc file :

public-hoist-pattern[]=@graphql-codegen/*

Usage

Create a graphql.config.js file in the root of your project.

require("dotenv").config();
const defineConfig = require("@julr/gql-generator-full-blown-preset");

module.exports = defineConfig({
  // The path to your GraphQL schema file. Can be a local file or a remote URL.
  schema: {
    url: process.env.HASURA_URL,
    secret: process.env.HASURA_SECRET,
  },

  // Since we're using graphql-config, you may need to define 
  // additional extensions configurations
  additionalExtensions: {
    myExtension: {
      config: 'foo'
    }
  }
});

License

MIT License © 2022 Julien Ripouteau

Package Sidebar

Install

npm i @julr/gql-generator-full-blown-preset

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

9.17 kB

Total Files

6

Last publish

Collaborators

  • julien-r44