0.3.3 • Published 2 years ago

nuxt-graphql-codegen v0.3.3

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

nuxt-graphql-codegen

GraphQL Code Generator module for Nuxt3 / Nuxt Bridge.

Quick setup

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

# Using npm
npm install --save-dev nuxt-graphql-codegen

Note you also need graphql, @graphql-codegen/cli and the plugins you want to use.

  1. Add nuxt-graphql-codegen to the modules section of your nuxt.config.ts
import { defineNuxtConfig } from "nuxt";

export default defineNuxtConfig({
  modules: ["nuxt-graphql-codegen"],
});
  1. Create your codegen.yml or codegen.json configuration file in the project's rootDir with the Initialization Wizard or manually
yarn graphql-codegen init

That's it! The code generator will now be executed before each build, it will also watch for changes in .graphql and .gql files in development mode.

Configuration

import { defineNuxtConfig } from 'nuxt'

export default defineNuxtConfig({
  modules: ["nuxt-graphql-codegen", {
    /**
     * @default false
     */
    devOnly: boolean;
    /**
     * @default ['.graphql', '.gql']
     */
    extensions: string[];
  }],
});

Development

  • Run npm run dev:prepare to generate type stubs.
  • Use npm run dev to start playground in development mode.
0.3.2

2 years ago

0.3.3

2 years ago

0.3.0

2 years ago

0.3.1

2 years ago

0.2.0

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago