مبدل REST به GraphQL

لماذا تهم هذه المطالبة
Manual REST-to-GraphQL conversions often miss pagination, proper nullability, and input validation. This structured prompt catches those gaps.
فيم نستخدمها
API design
المطالبة
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.
النتيجة
```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.