GraphQL schema generator prompt from requirements
Describe your entities and operations and get a full GraphQL schema with types, queries, mutations, and field descriptions.
بواسطة Ahmed Eid0 نسخة
متى تستخدم هذا البرومبت
- When starting a new GraphQL API from scratch.
- When adding a new entity to an existing schema.
- When converting a REST API design into GraphQL types.
نص البرومبت
Design a GraphQL schema (types, queries, mutations) for: {{focus}}. Use {{language}} conventions and include field-level descriptions.
{{CLIPBOARD}}
{{focus}}{{language}}{{CLIPBOARD}}الكتلة {{CLIPBOARD}} تُستبدل تلقائياً بما نسخته قبل الضغط على «نسخ».
املأ المتغيرات ثم انسخ
Design a GraphQL schema (types, queries, mutations) for: {{focus}}. Use {{language}} conventions and include field-level descriptions.
كيف تستخدمه
- انسخ البرومبت بالزر أو املأ المتغيرات أولاً.
- الصقه في ChatGPT أو Claude أو Gemini.
- عدّل النتيجة أو أعد الطلب بتغيير المتغيرات.
مثال على النتيجة
type Book {
id: ID!
title: String!
isbn: String
author: Author!
}
type Query {
book(id: ID!): Book
books(authorId: ID): [Book!]!
}
type Mutation {
addBook(title: String!, authorId: ID!): Book!
}نصائح للاستخدام
- Describe relationships between entities explicitly (a book has one author, an author has many books).
- Mention pagination needs upfront if lists could grow large.
- Ask for resolver stub code separately once the schema itself is approved.
أسئلة شائعة
- Can it also generate the resolver functions?
- Ask for them separately, specifying your server library (Apollo, GraphQL Yoga), for accurate resolver code.
- Does it handle authentication/authorization directives?
- Yes if you describe the access rules in the focus field; otherwise it will generate the schema without auth directives.