0.0.2 • Published 2 years ago

@julr/gql-generator-full-blown-preset v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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