GraphQL Implementation

GraphQL Implementation

Teaches an AI agent to design and implement GraphQL APIs: schemas, resolvers, queries, mutations, subscriptions and REST migration.

Skill files8 files

references/

scripts/

templates/

SKILL.md99 lines
1
---
2
name: graphql-implementation
3
description: >
4
Design and implement GraphQL APIs with schema design, resolvers, queries,
5
mutations, subscriptions, and best practices. Use when building GraphQL
6
servers, designing schemas, or migrating from REST to GraphQL.
7
---
8
9
# GraphQL Implementation
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
Implement GraphQL APIs with proper schema design, resolver patterns, error handling, and performance optimization for flexible client-server communication.
22
23
## When to Use
24
25
- Designing new GraphQL APIs
26
- Creating GraphQL schemas and types
27
- Implementing resolvers and mutations
28
- Adding subscriptions for real-time data
29
- Migrating from REST to GraphQL
30
- Optimizing GraphQL performance
31
32
## Quick Start
33
34
Minimal working example:
35
36
```graphql
37
type User {
38
id: ID!
39
email: String!
40
firstName: String!
41
lastName: String!
42
role: UserRole!
43
posts: [Post!]!
44
createdAt: DateTime!
45
updatedAt: DateTime!
46
}
47
48
enum UserRole {
49
ADMIN
50
USER
51
MODERATOR
52
}
53
54
type Post {
55
id: ID!
56
title: String!
57
content: String!
58
author: User!
59
comments: [Comment!]!
60
publishedAt: DateTime
61
createdAt: DateTime!
62
// ... (see reference guides for full implementation)
63
```
64
65
## Reference Guides
66
67
Detailed implementations in the `references/` directory:
68
69
| Guide | Contents |
70
|---|---|
71
| [GraphQL Schema Design](references/graphql-schema-design.md) | GraphQL Schema Design |
72
| [Node.js Apollo Server Implementation](references/nodejs-apollo-server-implementation.md) | Node.js Apollo Server Implementation |
73
| [Python GraphQL Implementation (Graphene)](references/python-graphql-implementation-graphene.md) | Python GraphQL Implementation (Graphene) |
74
| [Query Examples](references/query-examples.md) | Query Examples |
75
| [Error Handling](references/error-handling.md) | Error Handling |
76
77
## Best Practices
78
79
### ✅ DO
80
81
- Use clear, descriptive field names
82
- Design schemas around client needs
83
- Implement proper error handling
84
- Use input types for mutations
85
- Add subscriptions for real-time data
86
- Cache resolvers efficiently
87
- Validate input data
88
- Use federation for scalability
89
90
### ❌ DON'T
91
92
- Over-nest queries deeply
93
- Expose internal database IDs
94
- Return sensitive data without authorization
95
- Create overly complex schemas
96
- Forget to handle null values
97
- Ignore N+1 query problems
98
- Skip error messages
99

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…