Skip to content

🛩 A cool and opinionated base configuration for graphql-code-generator

License

Notifications You must be signed in to change notification settings

Julien-R44/gql-generator-full-blown-preset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

🛩 A cool and opinionated base configuration for graphql-code-generator

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published