plugins/lisa-nestjs-agy/skills/nestjs-graphql/SKILL.md
Comprehensive guide for NestJS GraphQL development using Apollo and code-first approach. This skill should be used when writing GraphQL resolvers, mutations, queries, types, subscriptions, or implementing advanced features like field middleware, complexity limits, and custom scalars. Also covers project-specific patterns including zero-trust auth decorators and DataLoader integration.
npx skillsauth add codyswanngt/lisa nestjs-graphqlInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides comprehensive guidance for building GraphQL APIs with NestJS using Apollo Server and the code-first approach. It covers official NestJS GraphQL patterns plus project-specific implementations for authentication, authorization, and data loading.
| Decorator | Purpose | Import |
|-----------|---------|--------|
| @Resolver() | Define resolver class | @nestjs/graphql |
| @Query() | Define query operation | @nestjs/graphql |
| @Mutation() | Define mutation operation | @nestjs/graphql |
| @Args() | Extract arguments | @nestjs/graphql |
| @Context() | Access GraphQL context | @nestjs/graphql |
| @Parent() | Access parent in field resolver | @nestjs/graphql |
| @ResolveField() | Define field resolver | @nestjs/graphql |
| @ObjectType() | Define GraphQL object type | @nestjs/graphql |
| @InputType() | Define GraphQL input type | @nestjs/graphql |
| @Field() | Define field on type | @nestjs/graphql |
| @Extensions() | Attach metadata to fields | @nestjs/graphql |
| Decorator | GraphQL Type | TypeScript Type |
|-----------|-------------|-----------------|
| @Field(() => String) | "String!" | string |
| @Field(() => Int) | "Int!" | number |
| @Field(() => Float) | "Float!" | number |
| @Field(() => Boolean) | "Boolean!" | boolean |
| @Field(() => ID) | "ID!" | string |
| @Field(() => [String]) | "[String!]!" | string[] |
| @Field({ nullable: true }) | String | string \| null |
import { Args, Context, Mutation, Query, Resolver } from "@nestjs/graphql";
import { Public, Authed } from "../auth";
@Resolver(() => Entity)
export class EntityResolver {
constructor(private readonly entityService: EntityService) {}
@Query(() => Entity, { description: "Retrieve entity by ID" })
@Authed()
async entity(@Args("id", { type: () => ID }) id: string): Promise<Entity> {
return this.entityService.findById(id);
}
@Mutation(() => Entity, { description: "Create new entity" })
@Authed()
async createEntity(
@Args("input") input: CreateEntityInput,
@Context() { req }: GraphQLContext
): Promise<Entity> {
return this.entityService.create(input, req.user.id);
}
}
import { Field, ID, ObjectType } from "@nestjs/graphql";
@ObjectType({ description: "Represents a user in the system" })
export class User {
@Field(() => ID, { description: "Unique identifier" })
id: string;
@Field(() => String, { description: "User's email address" })
email: string;
@Field(() => String, { nullable: true, description: "Display name" })
displayName?: string;
@Field(() => Date, { description: "Account creation timestamp" })
createdAt: Date;
}
import { Field, InputType } from "@nestjs/graphql";
@InputType({ description: "Input for creating a new user" })
export class CreateUserInput {
@Field(() => String, { description: "User's email address" })
email: string;
@Field(() => String, { description: "User's password" })
password: string;
@Field(() => String, { nullable: true, description: "Optional display name" })
displayName?: string;
}
This skill includes detailed reference files for specific topics:
Setup and configuration for NestJS GraphQL with Apollo driver, module configuration, and code-first vs schema-first approaches.
Comprehensive guide to writing resolvers, queries, mutations, field resolvers, and using decorators like @Args, @Context, @Parent.
Creating object types, input types, enums, interfaces, unions, and custom scalars. Includes mapped types (PartialType, PickType, etc.).
Field middleware, query complexity, plugins, subscriptions, and extensions.
Project-specific patterns including zero-trust auth decorators (@Public, @Authed, @Owner, @Groups), DataLoader integration, and GraphQL documentation standards.
@Query() decorator@Public(), @Authed(), or @Groups())@Query(() => ReturnType)@Query(() => ReturnType, { description: "..." })@Args() for parameters with descriptions@Mutation() decorator@Authed())@Context() { req }: GraphQLContext@ResolveField(() => [Comment], { description: "Entity's comments" })
async comments(
@Parent() entity: Entity,
@Context() { loaders }: GraphQLContext
): Promise<Comment[]> {
return loaders.commentsLoader.load(entity.id);
}
getByIds(ids: string[]): Promise<Entity[]>IDataLoaders interfaceDataLoaderService.getLoaders()loaders.entityLoader.load(id)See references/project-patterns.md for detailed DataLoader patterns.
development
Prepare a machine — a fresh laptop or a throwaway container — to run coding agents, before any repository exists. Detects which of Lisa's supported agents (Claude Code, Codex, Cursor, OpenCode, Antigravity, Copilot) are already installed, asks which credential manager the machine uses (Bitwarden, 1Password, Doppler, Vault, AWS, or none), and installs only what is missing, each by its vendor's own preferred method. Idempotent, headless by default, and emits a Dockerfile for a spin-up/spin-down environment. Run it on a new machine, in a container, or before cloning anything.
tools
Provision and verify a remote execution environment for a host project — Codex Cloud today, other remote surfaces as they are added. Generates a repository-owned setup script that installs the declared toolchain, materializes secrets through lisa-secrets-access, and runs the project's own hook. Provisions by API where one exists, by driving the vendor console where one does not, and by emitting exact config otherwise — then proves the result with the same read-back regardless of which tier did the work. Use before dispatching any work with executionEnv.
tools
Bring a developer's machine in line with the toolchain the project declares. Reports every tool in remoteEnv.tools that is missing, outdated, or unpinned for this platform, and installs the missing ones into ~/.local/bin from the same pinned, checksummed entries the remote surfaces use — but only when asked. Same manifest, same pins, same installers as lisa-setup-remote-env; what differs is consent and that the pin is a floor rather than an equality. Run it on a fresh checkout, after a manifest change, or when a tool fails at the moment of use.
tools
Route one unit of work to a remote execution surface. Reads the executionEnv parameter (local by default, codex-cloud or claude-web today), verifies the environment is provisioned and bound to this repository, submits a thin skill invocation, records the task identifier to .lisa/remote-dispatch.json, and exits without polling. Routing only — the remote runs the identical skill from the identical repository. Composable and inline: other skills invoke it via the Skill tool rather than users calling it directly.