best way to create schema with gql
This commit is contained in:
8
dataconnect/connector/connector.yaml
Normal file
8
dataconnect/connector/connector.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
connectorId: krow-connector
|
||||
generate:
|
||||
javascriptSdk:
|
||||
- outputDir: ../../frontend-web/src/dataconnect-generated
|
||||
package: "@dataconnect/generated"
|
||||
packageJsonDir: ../../frontend-web
|
||||
react: true
|
||||
angular: false
|
||||
@@ -1,13 +0,0 @@
|
||||
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"]
|
||||
29
dataconnect/connector/event/mutations.gql
Normal file
29
dataconnect/connector/event/mutations.gql
Normal file
@@ -0,0 +1,29 @@
|
||||
mutation CreateEvent(
|
||||
$eventName: String!,
|
||||
$isRecurring: Boolean!,
|
||||
$recurrenceType: RecurrenceType,
|
||||
$businessId: UUID!,
|
||||
$vendorId: UUID,
|
||||
$status: EventStatus!,
|
||||
$date: Timestamp!,
|
||||
$shifts: String,
|
||||
$total: Float,
|
||||
$requested: Int,
|
||||
$assignedStaff: String
|
||||
) @auth(level: USER) {
|
||||
event_insert(
|
||||
data: {
|
||||
eventName: $eventName
|
||||
isRecurring: $isRecurring
|
||||
recurrenceType: $recurrenceType
|
||||
businessId: $businessId
|
||||
vendorId: $vendorId
|
||||
status: $status
|
||||
date: $date
|
||||
shifts: $shifts
|
||||
total: $total
|
||||
requested: $requested
|
||||
assignedStaff: $assignedStaff
|
||||
}
|
||||
)
|
||||
}
|
||||
14
dataconnect/connector/event/queries.gql
Normal file
14
dataconnect/connector/event/queries.gql
Normal file
@@ -0,0 +1,14 @@
|
||||
query listEvents @auth(level: USER) {
|
||||
events {
|
||||
id
|
||||
eventName
|
||||
status
|
||||
date
|
||||
isRecurring
|
||||
recurrenceType
|
||||
businessId
|
||||
vendorId
|
||||
total
|
||||
requested
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user