110 lines
1.5 KiB
GraphQL
110 lines
1.5 KiB
GraphQL
type Query {
|
|
info: String!
|
|
feed(
|
|
filter: String
|
|
skip: Int
|
|
take: Int
|
|
orderBy: AppointmentOrderByInput
|
|
): Feed!
|
|
allProducts: [Product]
|
|
allAppointments: [Appointment]
|
|
users: [User!]!
|
|
}
|
|
|
|
type Feed {
|
|
id: ID!
|
|
appointments: [Appointment!]!
|
|
count: Int!
|
|
}
|
|
|
|
type Mutation {
|
|
createAppointment(
|
|
title: String!,
|
|
description: String!,
|
|
timeStart: DateTime!,
|
|
timeEnd: DateTime!,
|
|
): Appointment!
|
|
createProduct(
|
|
input: ProductInput
|
|
) : Product
|
|
updateProduct(
|
|
_id: ID!,
|
|
input: ProductInput
|
|
): Product
|
|
deleteProduct(
|
|
_id: ID!
|
|
) : Product
|
|
signup(
|
|
email: String!
|
|
password: String!
|
|
name: String!
|
|
): AuthPayload
|
|
login(
|
|
email: String!,
|
|
password: String!
|
|
): AuthPayload
|
|
follow(
|
|
appointmentId: ID!
|
|
): Follow
|
|
}
|
|
|
|
type Subscription {
|
|
newAppointment: Appointment
|
|
newFollow: Follow
|
|
}
|
|
|
|
type AuthPayload {
|
|
token: String
|
|
user: User
|
|
}
|
|
|
|
type User {
|
|
_id: ID!
|
|
name: String!
|
|
email: String!
|
|
appointments: [Appointment!]!
|
|
}
|
|
|
|
type Appointment {
|
|
_id: ID!
|
|
title: String!
|
|
description: String!
|
|
timeStart: DateTime!
|
|
timeEnd: DateTime!
|
|
deleted: Boolean
|
|
# createdBy: User
|
|
# follows: [Follow!]!
|
|
# createdAt: DateTime!
|
|
}
|
|
|
|
type Product {
|
|
_id: ID!
|
|
title: String!
|
|
qty: Int
|
|
}
|
|
|
|
type Follow {
|
|
_id: ID!
|
|
appointment: Appointment!
|
|
user: User!
|
|
}
|
|
|
|
input ProductInput {
|
|
title: String!
|
|
qty: Int
|
|
}
|
|
|
|
|
|
input AppointmentOrderByInput {
|
|
description: Sort
|
|
url: Sort
|
|
createdAt: Sort
|
|
}
|
|
|
|
enum Sort {
|
|
asc
|
|
desc
|
|
}
|
|
|
|
scalar DateTime
|