best way to create schema with gql
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
scalar UUID
|
||||
scalar Timestamp
|
||||
scalar JSON
|
||||
|
||||
enum EventStatus {
|
||||
DRAFT
|
||||
@@ -28,47 +25,14 @@ type Event @table(name: "events") {
|
||||
vendorId: UUID
|
||||
status: EventStatus!
|
||||
date: Timestamp!
|
||||
shifts: JSON @col(dataType: "jsonb")
|
||||
shifts: String @col(dataType: "jsonb")
|
||||
total: Float
|
||||
requested: Int
|
||||
assignedStaff: JSON @col(dataType: "jsonb")
|
||||
createdDate: Timestamp @default(expr: "now()")
|
||||
updatedDate: Timestamp @updatedAt
|
||||
assignedStaff: String @col(dataType: "jsonb")
|
||||
createdDate: Timestamp @default(expr: "request.time")
|
||||
updatedDate: Timestamp @default(expr: "request.time")
|
||||
createdBy: String
|
||||
|
||||
}
|
||||
|
||||
input CreateEventInput {
|
||||
eventName: String!
|
||||
isRecurring: Boolean!
|
||||
recurrenceType: RecurrenceType
|
||||
businessId: UUID!
|
||||
vendorId: UUID
|
||||
status: EventStatus!
|
||||
date: Timestamp!
|
||||
shifts: JSON
|
||||
total: Float
|
||||
requested: Int
|
||||
assignedStaff: JSON
|
||||
}
|
||||
|
||||
query listEvents @auth(level: USER) {
|
||||
events {
|
||||
id
|
||||
eventName
|
||||
status
|
||||
date
|
||||
isRecurring
|
||||
recurrenceType
|
||||
businessId
|
||||
vendorId
|
||||
total
|
||||
requested
|
||||
}
|
||||
}
|
||||
|
||||
mutation createEvent($input: CreateEventInput!) @auth(level: USER) {
|
||||
event_insert(data: $input) {
|
||||
id
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user