scalar JSON # ─── Users ────────────────────────────────────────────────────────────────── type User { id: ID! name: String! email: String! role: String age: Int created_at: String updated_at: String } input CreateUserInput { name: String! email: String! role: String age: Int } input UpdateUserInput { name: String email: String role: String age: Int } # ─── Products ──────────────────────────────────────────────────────────────── type Product { id: ID! name: String! price: Float! description: String stock: Int category: String created_at: String updated_at: String } input CreateProductInput { name: String! price: Float! description: String stock: Int category: String } input UpdateProductInput { name: String price: Float description: String stock: Int category: String } # ─── Orders ────────────────────────────────────────────────────────────────── type Order { id: ID! user_id: String product_id: String quantity: Int status: String notes: String created_at: String updated_at: String user: User # resolved from user_id — null if user not found product: Product # resolved from product_id — null if product not found } input CreateOrderInput { user_id: String product_id: String quantity: Int status: String notes: String } input UpdateOrderInput { status: String quantity: Int notes: String } # ─── Pagination ─────────────────────────────────────────────────────────────── type PageInfo { total: Int! page: Int! limit: Int! pages: Int! hasNext: Boolean! hasPrev: Boolean! } type UserPage { items: [User]! pageInfo: PageInfo! } type ProductPage { items: [Product]! pageInfo: PageInfo! } type OrderPage { items: [Order]! pageInfo: PageInfo! } # ─── Queries ────────────────────────────────────────────────────────────────── type Query { users(page: Int, limit: Int, sort: String, order: String): UserPage! user(id: ID!): User products(page: Int, limit: Int, sort: String, order: String): ProductPage! product(id: ID!): Product orders(page: Int, limit: Int, sort: String, order: String): OrderPage! order(id: ID!): Order sessionInfo: JSON! } # ─── Mutations ─────────────────────────────────────────────────────────────── type Mutation { createUser(input: CreateUserInput!): User! updateUser(id: ID!, input: UpdateUserInput!): User deleteUser(id: ID!): Boolean! createProduct(input: CreateProductInput!): Product! updateProduct(id: ID!, input: UpdateProductInput!): Product deleteProduct(id: ID!): Boolean! createOrder(input: CreateOrderInput!): Order! updateOrder(id: ID!, input: UpdateOrderInput!): Order deleteOrder(id: ID!): Boolean! }