add-graphql-type

Create GraphQL ObjectType, InputType, and Enum definitions for NestJS/Mercurius projects.

30|3|Updated Mar 8, 2020
One-click install
npx skills add https://github.com/uxname/liteend --skill add-graphql-type
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-graphql-type
Source: https://github.com/uxname/liteend/tree/main/.agents/skills/add-graphql-type
Command: npx skills add https://github.com/uxname/liteend --skill add-graphql-type

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create GraphQL types (ObjectType, InputType, or Enum) for a NestJS + Mercurius project using a code-first approach.

Core Features & Use Cases

  • Provides templates for ObjectType, InputType, and Enum definitions to ensure consistent GraphQL type structures.
  • Organizes types under the module-specific types/ directory at src/modules/<module>/types/ for easy discovery and maintenance.
  • Guides integration with resolvers and subscriptions, including patterns for connecting new types to queries, mutations, and subscriptions.

Quick Start

Create a new GraphQL type by placing the corresponding <name>.object-type.ts, <name>.input.ts, or <name>.enum.ts under src/modules/<module>/types/ and wire it into the module's resolver.

Frequently Asked Questions about add-graphql-type

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create GraphQL types in a NestJS Mercurius project using a code-first approach?

To create GraphQL types in a NestJS Mercurius project, you generate ObjectType, InputType, or Enum files under the module-specific types/ directory and wire them directly into the module's resolver using a code-first approach.

What is the correct file structure for adding ObjectType and InputType definitions in NestJS?

The correct file structure for adding GraphQL definitions in NestJS places the corresponding <name>.object-type.ts, <name>.input.ts, or <name>.enum.ts files under the src/modules/<module>/types/ directory for easy maintenance.

How do I connect GraphQL types to queries, mutations, and subscriptions in NestJS?

You connect GraphQL types to queries, mutations, and subscriptions by applying the provided templates to generate the type files and then wiring those new types into the module's resolver patterns.

Does the Mercurius integration support generating GraphQL Enum and InputType definitions code-first?

Yes, the Mercurius integration supports generating GraphQL Enum and InputType definitions using a code-first approach, providing specific templates to ensure consistent type structures across the NestJS project.

What's the best way to organize GraphQL type files for consistent structure in NestJS?

The best way to organize GraphQL type files for consistent structure is to use templates for ObjectType, InputType, and Enum definitions, placing them under the module-specific types/ directory at src/modules/<module>/types/.