igmarin/rails-agent-skills

implement-graphql

Use when building or reviewing a graphql-ruby schema, resolver, or mutation. Trigger words: GraphQL, graphql-ruby, resolver, mutation, dataloader, schema.

First seen Aug 14, 2026

Installation

$ npx skills add igmarin/rails-agent-skills --skill implement-graphql

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from igmarin/rails-agent-skills · top by installs.

npx skills add igmarin/rails-agent-skills

Browse all from igmarin/rails-agent-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 24
License LICENSE
Default branch main
Open issues 0
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.0.0
LicenseMIT
More metadata
version
1.0.0
user-invocable
true

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,652 B
  • docs SUMMARY.md 179 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 17 installs

SKILL.md

Implement GraphQL

Use this skill when designing, implementing, or reviewing GraphQL APIs in a Rails application with the graphql-ruby gem.

Core Process

DO NOT proceed to step 3 before step 1 is written and failing.

  1. SPEC: Write failing spec (happy path + auth + validation error case) — see [TESTING.md](./TESTING.md). Use AppSchema.execute in spec/graphql/. Never use HTTP controller dispatch for GraphQL specs.
  1. TYPE: Define arguments and return types. Use connection_type for pagination shapes. Do not leak internal model names.
  1. IMPLEMENT: Create resolver/mutation class delegating to a service object. Use dedicated classes instead of inline field blocks.
  1. N+1 CHECK: Use dataloader on every association load. For list resolvers, prime the dataloader with the records returned by the relation before fields resolve associated objects. Use bullet and db-query-matchers in specs.

``ruby # ✅ batches loads across all records def buyer dataloader.with(Sources::RecordById, Buyer).load(object.buyer_id) end ``

  1. AUTH CHECK: Apply field-level guards where data is sensitive using Pundit or custom context guards.

``ruby field :internalnotes, String, null: true do guard -> (obj, args, ctx) { ctx[:currentuser]&.admin? } end ``

  1. FINAL CHECK: Verify every item in the HARD-GATE checklist below. Ensure mutations return { result, errors } shapes on failure.

``ruby rescue ActiveRecord::RecordInvalid => e { order: nil, errors: e.record.errors.full_messages } ``

  1. RUN: Ensure the full test suite is green before PR.

HARD-GATE Checklist

Before shipping a resolver/mutation slice, ALL of the following must be confirmed:

  • Specs — covers happy path, unauthenticated, unauthorized, validation errors, N+1 counts, and schema limits.
  • N+1 Preventiondataloader.with(Source, Model).load(id) on every association; never object.association.
  • Dataloader Priming — collection resolvers prime records before association fields resolve.
  • Authorization — sensitive fields have field-level guards (not type-level alone).
  • Type Conventions — paginated collections use Types::*Type.connection_type, not plain arrays.
  • Schema Safeguards — introspection disabled in production; maxdepth and maxcomplexity set.
  • Error Handling — mutations return { result, errors } with rescue blocks; no unhandled exceptions.
  • Documentationdescription: on every field in every type.
  • Resolver Structure — dedicated resolver classes, not inline field blocks.

Extended Resources (Progressive Disclosure)

Load these files only when their specific content is needed:

  • [TESTING.md](./TESTING.md) — For the spec template, paths, and checklist.
  • [EXAMPLES.md](EXAMPLES.md) — For detailed code examples of dataloaders, mutations, and types.

Integration

Skill When to chain
define-domain-language Type and field naming must match business language
plan-tests Choose first failing spec (mutation vs query vs resolver unit)
write-tests Full TDD cycle for resolvers and mutations
security-check Auth, introspection disable, query depth/complexity limits