input CreateOrderInput { userId: ID! items: [OrderItemInput!]! } input CreateUserInput { name: String! email: String! role: UserRole } type CreatedOrder { id: ID! userId: ID! items: [CreatedOrderItem!]! status: OrderStatus! total: Float! createdAt: String! } type CreatedOrderItem { productId: ID! quantity: Int! unitPrice: Float! } type CreatedUser { id: ID! name: String! email: String! role: UserRole! createdAt: String! } type MutationRoot { createUser(input: CreateUserInput!): CreatedUser! updateUser(id: ID!, input: UpdateUserInput!): CreatedUser createOrder(input: CreateOrderInput!): CreatedOrder! } type Order { id: ID! user: User items: [OrderItem!]! status: OrderStatus! total: Float! createdAt: String! } type OrderItem { product: Product quantity: Int! unitPrice: Float! } input OrderItemInput { productId: ID! quantity: Int! } enum OrderStatus { PENDING PROCESSING SHIPPED DELIVERED CANCELLED } type OrderUpdate { orderId: ID! sequence: Int! status: OrderStatus! timestamp: String! } type Product { id: ID! name: String! description: String! price: Float! category: String! inStock: Boolean! reviews: [Review!]! } type QueryRoot { user(id: ID!): User users(limit: Int! = 10, offset: Int! = 0): [User!]! product(id: ID!): Product products(category: String, limit: Int! = 10): [Product!]! order(id: ID!): Order orders(userId: ID, status: OrderStatus, limit: Int! = 10): [Order!]! } type Review { id: ID! author: User rating: Int! comment: String! createdAt: String! } type SubscriptionRoot { """ Emit `count` ticks (1-100, default 5), one every `intervalMs` (50-10000, default 1000), then complete. """ ticker(count: Int! = 5, intervalMs: Int! = 1000): Tick! """ Status changes of an order (PENDING, PROCESSING, SHIPPED, DELIVERED), one every `intervalMs` (50-10000, default 500), then complete. """ orderUpdates(orderId: ID!, intervalMs: Int! = 500): OrderUpdate! } type Tick { sequence: Int! timestamp: String! } input UpdateUserInput { name: String email: String role: UserRole } type User { id: ID! name: String! email: String! role: UserRole! createdAt: String! orders: [Order!]! } enum UserRole { ADMIN USER GUEST } """ Directs the executor to include this field or fragment only when the `if` argument is true. """ directive @include(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT """ Directs the executor to skip this field or fragment when the `if` argument is true. """ directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT schema { query: QueryRoot mutation: MutationRoot subscription: SubscriptionRoot }