🚀. Socket Launch Week Day 2:Introducing Manifest Alerts.Learn more
Sign In

nuxt-codegen

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-codegen

GraphQL Code Generator module for Nuxt 3

latest
Source
npmnpm
Version
1.3.1
Version published
Weekly downloads
17
142.86%
Maintainers
1
Weekly downloads
 
Created
Source

nuxt-codegen

This module integrates GraphQL Code Generator in your development flow.

Quick setup

  • 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
  • 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.

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

  • Clone this repository
  • Install dependencies using pnpm pnpm install
  • Prepare for development using pnpm dev:prepare
  • Start development server using pnpm dev

FAQs

Package last updated on 16 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts