1.3.1 • Published 1 year ago

nuxt-codegen v1.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

nuxt-codegen

This module integrates GraphQL Code Generator in your development flow.

Quick setup

  1. Add nuxt-codegen dependency to your project
# Using yarn
yarn add nuxt-codegen -D

# Using npm
npm install nuxt-codegen -D

# Using pnpm 
pnpm add nuxt-codegen -D
  1. Add nuxt-codegen to the modules section of nuxt.config.ts
export default defineNuxtConfig({
    modules: ['nuxt-codegen']
})

Note you also need graphql, and the plugins you want to use.

  1. Create your codegen.ts configuration file in the project's rootDir or use the Initialization Wizard

The code generator will now be executed before each build or after any changes made to your graphql documents.

Configuration

export default defineNuxtConfig({
  modules: ["nuxt-codegen", {
    /**
     * @default true
     * Only run codegen in development mode
     */

    devOnly: boolean;
    /**
     * @default ['.graphql', '.gql']
     * Which file extensions to watch for changes.
     */
    extensions: string[];

    /**
     * @default codegen.ts
     * Path to the config file (e.g. ./configs/codegen.config.ts)
     */
    configFile: string
  }],
});

Prior art

Development

  1. Clone this repository
  2. Install dependencies using pnpm pnpm install
  3. Prepare for development using pnpm dev:prepare
  4. Start development server using pnpm dev
1.3.1

1 year ago

1.3.0

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago