type User {
id: ID!
name: String!
email: String!
isActive: Boolean!
createdAt: String!
posts: [Post!]!
}
type Post {
id: ID!
title: String!
content: String!
author: User!
publishedAt: String!
}
type Query {
user(id: ID!): User
users(page: Int = 1, pageSize: Int = 10): [User!]!
post(id: ID!): Post
posts(page: Int = 1, pageSize: Int = 10): [Post!]!
}
type Mutation {
createUser(name: String!, email: String!, isActive: Boolean = true): User!
updateUser(id: ID!, name: String, email: String, isActive: Boolean): User!
deleteUser(id: ID!): Boolean!
createPost(title: String!, content: String!, authorId: ID!): Post!
}
type Subscription {
userCreated: User!
postCreated: Post!
}
type User {
id: ID!
name: String!
email: String!
isActive: Boolean!
createdAt: String!
posts: [Post!]!
}
type Post {
id: ID!
title: String!
content: String!
author: User!
publishedAt: String!
}
type Query {
user(id: ID!): User
users(page: Int = 1, pageSize: Int = 10): [User!]!
post(id: ID!): Post
posts(page: Int = 1, pageSize: Int = 10): [Post!]!
}
type Mutation {
createUser(name: String!, email: String!, isActive: Boolean = true): User!
updateUser(id: ID!, name: String, email: String, isActive: Boolean): User!
deleteUser(id: ID!): Boolean!
createPost(title: String!, content: String!, authorId: ID!): Post!
}
type Subscription {
userCreated: User!
postCreated: Post!
}