@nuxt3-graphql/codegen
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

@nuxt3-graphql/codegen

GraphQL Code Generator for Nuxt.js! ⚡️

Features

  • Load your codegen config file from the root of your Nuxt3 project
  • Generate code from your GraphQL schema and operations on every build and in dev mode

Install

yarn add -D @nuxt3-graphql/codegen @graphql-codegen/cli graphql
# npm i -D @nuxt3-graphql/codegen @graphql-codegen/cli graphql

Create a condegen config file either manually or with the wizard:

yarn graphql-codegen init

Usage

Within your nuxt.config.js add the following:

import { defineNuxtConfig } from "nuxt3";

export default defineNuxtConfig({
  buildModules: [
    "@nuxt3-graphql/codegen",
  ],
});

This will automativally generate the GraphQL code based on your codegen config file each time Nuxt builds your project (this also works in dev mode).

Refer to the GraphQL Code Generator documentation for more information.

Readme

Keywords

Package Sidebar

Install

npm i @nuxt3-graphql/codegen

Weekly Downloads

5

Version

0.4.0

License

MIT

Unpacked Size

4.67 kB

Total Files

5

Last publish

Collaborators

  • pascalmartineau