moving event.gql to dataconnect new folder
This commit is contained in:
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
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
# Example schema for simple movie review app
|
||||
|
||||
# User table is keyed by Firebase Auth UID.
|
||||
type User @table {
|
||||
# `@default(expr: "auth.uid")` sets it to Firebase Auth UID during insert and upsert.
|
||||
id: String! @default(expr: "auth.uid")
|
||||
username: String! @col(dataType: "varchar(50)")
|
||||
# The `user: User!` field in the Review table generates the following one-to-many query field.
|
||||
# reviews_on_user: [Review!]!
|
||||
# The `Review` join table the following many-to-many query field.
|
||||
# movies_via_Review: [Movie!]!
|
||||
}
|
||||
|
||||
# Movie is keyed by a randomly generated UUID.
|
||||
type Movie @table {
|
||||
# If you do not pass a 'key' to `@table`, Data Connect automatically adds the following 'id' column.
|
||||
# Feel free to uncomment and customize it.
|
||||
# id: UUID! @default(expr: "uuidV4()")
|
||||
title: String!
|
||||
imageUrl: String!
|
||||
genre: String
|
||||
}
|
||||
|
||||
# MovieMetadata is a metadata attached to a Movie.
|
||||
# Movie <-> MovieMetadata is a one-to-one relationship
|
||||
type MovieMetadata @table {
|
||||
# @unique ensures each Movie can only one MovieMetadata.
|
||||
movie: Movie! @unique
|
||||
# The movie field adds the following foreign key field. Feel free to uncomment and customize it.
|
||||
# movieId: UUID!
|
||||
rating: Float
|
||||
releaseYear: Int
|
||||
description: String
|
||||
}
|
||||
|
||||
# Reviews is a join table between User and Movie.
|
||||
# It has a composite primary keys `userUid` and `movieId`.
|
||||
# A user can leave reviews for many movies. A movie can have reviews from many users.
|
||||
# User <-> Review is a one-to-many relationship
|
||||
# Movie <-> Review is a one-to-many relationship
|
||||
# Movie <-> User is a many-to-many relationship
|
||||
type Review @table(name: "Reviews", key: ["movie", "user"]) {
|
||||
user: User!
|
||||
# The user field adds the following foreign key field. Feel free to uncomment and customize it.
|
||||
# userUid: String!
|
||||
movie: Movie!
|
||||
# The movie field adds the following foreign key field. Feel free to uncomment and customize it.
|
||||
# movieId: UUID!
|
||||
rating: Int
|
||||
reviewText: String
|
||||
reviewDate: Date! @default(expr: "request.time")
|
||||
}
|
||||
Reference in New Issue
Block a user