moving event.gql to dataconnect new folder
This commit is contained in:
13
dataconnect/connector/dataconnect.yaml
Normal file
13
dataconnect/connector/dataconnect.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
specVersion: "v1"
|
||||||
|
serviceId: "krow-workforce"
|
||||||
|
location: "us-central1"
|
||||||
|
schema:
|
||||||
|
source: "./schema"
|
||||||
|
datasource:
|
||||||
|
postgresql:
|
||||||
|
database: "fdcdb"
|
||||||
|
cloudSql:
|
||||||
|
instanceId: "krow-workforce-fdc"
|
||||||
|
# schemaValidation: "STRICT" # STRICT mode makes Postgres schema match Data Connect exactly.
|
||||||
|
# schemaValidation: "COMPATIBLE" # COMPATIBLE mode makes Postgres schema compatible with Data Connect.
|
||||||
|
connectorDirs: ["./example"]
|
||||||
@@ -10,4 +10,4 @@ schema:
|
|||||||
instanceId: "krow-workforce-fdc"
|
instanceId: "krow-workforce-fdc"
|
||||||
# schemaValidation: "STRICT" # STRICT mode makes Postgres schema match Data Connect exactly.
|
# schemaValidation: "STRICT" # STRICT mode makes Postgres schema match Data Connect exactly.
|
||||||
# schemaValidation: "COMPATIBLE" # COMPATIBLE mode makes Postgres schema compatible with Data Connect.
|
# schemaValidation: "COMPATIBLE" # COMPATIBLE mode makes Postgres schema compatible with Data Connect.
|
||||||
connectorDirs: ["./example"]
|
connectorDirs: ["./connector"]
|
||||||
|
|||||||
74
dataconnect/schema/event.gql
Normal file
74
dataconnect/schema/event.gql
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
scalar UUID
|
||||||
|
scalar Timestamp
|
||||||
|
scalar JSON
|
||||||
|
|
||||||
|
enum EventStatus {
|
||||||
|
DRAFT
|
||||||
|
ACTIVE
|
||||||
|
PENDING
|
||||||
|
ASSIGNED
|
||||||
|
CONFIRMED
|
||||||
|
COMPLETED
|
||||||
|
CANCELED
|
||||||
|
}
|
||||||
|
|
||||||
|
enum RecurrenceType {
|
||||||
|
SINGLE
|
||||||
|
DATE_RANGE
|
||||||
|
SCATTER
|
||||||
|
}
|
||||||
|
|
||||||
|
type Event @table(name: "events") {
|
||||||
|
|
||||||
|
id: UUID! @default(expr: "uuidV4()")
|
||||||
|
eventName: String!
|
||||||
|
isRecurring: Boolean!
|
||||||
|
recurrenceType: RecurrenceType
|
||||||
|
businessId: UUID!
|
||||||
|
vendorId: UUID
|
||||||
|
status: EventStatus!
|
||||||
|
date: Timestamp!
|
||||||
|
shifts: JSON @col(dataType: "jsonb")
|
||||||
|
total: Float
|
||||||
|
requested: Int
|
||||||
|
assignedStaff: JSON @col(dataType: "jsonb")
|
||||||
|
createdDate: Timestamp @default(expr: "now()")
|
||||||
|
updatedDate: Timestamp @updatedAt
|
||||||
|
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