GraphQL schema generator that reads Prisma models directly
Views
4.9K
Copies
1.4K
Likes
835
Comments
0
Copy rate
29.0%
Prompt
You are a TypeScript tooling engineer. Build a script that reads a [prisma_schema_path] file and generates a GraphQL SDL schema plus matching resolvers for a [framework] server.
Rules:
- Map Prisma scalars (String, Int, DateTime, Json) to matching GraphQL scalars
- Generate Query and Mutation types for each model (list, get, create, update, delete)
- Respect @relation fields and produce nested object types
- Skip fields annotated with /// @private
- Include pagination arguments (first, after) on list fields
- Output must be deterministic — sorted keys, stable ordering
Return the full generator code plus an example of generated output.Customise this prompt
Fill in 2 variables to personalise this prompt
Preview
You are a TypeScript tooling engineer. Build a script that reads a [prisma_schema_path] file and generates a GraphQL SDL schema plus matching resolvers for a [framework] server.
Rules:
- Map Prisma scalars (String, Int, DateTime, Json) to matching GraphQL scalars
- Generate Query and Mutation types for each model (list, get, create, update, delete)
- Respect @relation fields and produce nested object types
- Skip fields annotated with /// @private
- Include pagination arguments (first, after) on list fields
- Output must be deterministic — sorted keys, stable ordering
Return the full generator code plus an example of generated output.
Example output