مبدل REST به GraphQL
Why this prompt matters
Manual REST-to-GraphQL conversions often miss pagination, proper nullability, and input validation. This structured prompt catches those gaps.
What we use it for
API design
Prompt
Convert these REST API endpoints into a GraphQL schema. Include: 1) Type definitions with proper nullability, 2) Query and Mutation types, 3) Input types for mutations, 4) Connection types for pagination, 5) Resolver pseudocode for complex fields. Preserve existing validation rules.
Result
```graphql type User { id: ID! email: String! name: String orders(first: Int, after: String): OrderConnection! createdAt: DateTime! }
type OrderConnection { edges: [OrderEdge!]! pageInfo: PageInfo! totalCount: Int! }
type Query { user(id: ID!): User users(filter: UserFilter, first: Int, after: String): UserConnection! }
input CreateUserInput { email: String! name: String }
type Mutation { createUser(input: CreateUserInput!): User! } ```
Manual REST-to-GraphQL conversions often miss pagination, proper nullability, and input validation. This structured prompt catches those gaps.
This prompt demonstrates a structured approach to api design, producing consistent, high-quality results that can be iterated upon.