Skip to content

Commit

Permalink
feat: update GQL schema used for codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-anderson committed Dec 15, 2022
1 parent 315d21d commit d888ab2
Showing 1 changed file with 96 additions and 76 deletions.
172 changes: 96 additions & 76 deletions fixit@current.graphql
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
schema {
query: Query
mutation: Mutation
}
"Custom DateTime scalar; pass a string or js date instance obj"
scalar DateTime
"Custom Email scalar; validates using regex"
scalar Email
type Query {
_root: Boolean
contact(contactID: ID!): Contact!
Expand All @@ -20,6 +12,7 @@ type Query {
myWorkOrders: MyWorkOrdersQueryReturnType!
searchUsers(rawPhoneContacts: [RawPhoneContactInput!]!): [PhoneContact]
}

type Mutation {
_root: Boolean
createContact(contactEmail: Email!): Contact!
Expand All @@ -34,17 +27,33 @@ type Mutation {
cancelWorkOrder(workOrderID: ID!): CancelWorkOrderResponse!
setWorkOrderStatusComplete(workOrderID: ID!): WorkOrder!
}

"""Custom DateTime scalar; pass a string or js date instance obj"""
scalar DateTime

"""Custom Email scalar; validates using regex"""
scalar Email

type DeleteMutationResponse {
id: ID!
wasDeleted: Boolean!
}

interface FixitUser {
id: ID!
email: Email!
phone: String!
profile: Profile
}

type Contact implements FixitUser {
id: ID!
email: Email!
phone: String!
profile: Profile!
createdAt: DateTime!
}

type Invoice {
id: ID!
createdBy: FixitUser!
Expand All @@ -55,34 +64,57 @@ type Invoice {
workOrder: WorkOrder
createdAt: DateTime!
}

enum InvoiceStatus {
OPEN
CLOSED
DISPUTED
}

type MyInvoicesQueryReturnType {
createdByUser: [Invoice!]!
assignedToUser: [Invoice!]!
}

input InvoiceInput {
assignedToUserID: ID!
amount: Int!
workOrderID: ID
}

type Profile {
id: ID!
displayName: String
givenName: String
familyName: String
businessName: String
photoUrl: String
}
type StripeConnectAccount {

input ProfileInput {
givenName: String
familyName: String
businessName: String
photoUrl: String
}

type UserStripeConnectAccount {
id: ID!
detailsSubmitted: Boolean!
chargesEnabled: Boolean!
payoutsEnabled: Boolean!
}

type User implements FixitUser {
id: ID!
email: Email!
phone: String!
profile: Profile!
stripeCustomerID: String!
subscription: UserSubscription
stripeConnectAccount: StripeConnectAccount
stripeConnectAccount: UserStripeConnectAccount
createdAt: DateTime!
}

type UserSubscription {
id: ID!
currentPeriodEnd: DateTime!
Expand All @@ -91,6 +123,17 @@ type UserSubscription {
status: SubscriptionStatus!
createdAt: DateTime!
}

enum SubscriptionStatus {
active
incomplete
incomplete_expired
trialing
past_due
canceled
unpaid
}

type WorkOrder {
id: ID!
createdBy: FixitUser!
Expand All @@ -107,68 +150,21 @@ type WorkOrder {
scheduledDateTime: DateTime
contractorNotes: String
createdAt: DateTime!
invoice: Invoice
}
type ChecklistItem {
id: ID!
description: String!
isCompleted: Boolean!
}
type MyWorkOrdersQueryReturnType {
createdByUser: [WorkOrder!]!
assignedToUser: [WorkOrder!]!
}
type PhoneContact {
isUser: Boolean!
id: String!
name: String
phone: String
email: Email
givenName: String
familyName: String
businessName: String
photoUrl: String
}
interface FixitUser {
id: ID!
email: Email!
phone: String!
profile: Profile!
createdAt: DateTime!
}
interface WorkOrderLocation {
country: String
region: String
city: String
streetLine1: String
streetLine2: String
}
union CancelWorkOrderResponse = WorkOrder | DeleteMutationResponse
enum InvoiceStatus {
OPEN
CLOSED
DISPUTED
}
enum SubscriptionStatus {
active
incomplete
incomplete_expired
trialing
past_due
canceled
unpaid
}

enum WorkOrderStatus {
UNASSIGNED
ASSIGNED
CANCELLED
COMPLETE
}

enum WorkOrderPriority {
LOW
NORMAL
HIGH
}

enum WorkOrderCategory {
DRYWALL
ELECTRICAL
Expand All @@ -186,17 +182,26 @@ enum WorkOrderCategory {
TURNOVER
WINDOWS
}
input InvoiceInput {
assignedToUserID: ID!
amount: Int!
workOrderID: ID

type WorkOrderLocation {
country: String
region: String!
city: String!
streetLine1: String!
streetLine2: String
}
input ProfileInput {
givenName: String
familyName: String
businessName: String
photoUrl: String

type ChecklistItem {
id: ID!
description: String!
isCompleted: Boolean!
}

type MyWorkOrdersQueryReturnType {
createdByUser: [WorkOrder!]!
assignedToUser: [WorkOrder!]!
}

input CreateWorkOrderInput {
assignedToUserID: ID
priority: WorkOrderPriority
Expand All @@ -209,16 +214,19 @@ input CreateWorkOrderInput {
entryContactPhone: String
scheduledDateTime: DateTime
}

input CreateWorkOrderLocationInput {
country: String
region: String!
city: String!
streetLine1: String!
streetLine2: String
}

input CreateChecklistItemInput {
description: String!
}

input UpdateWorkOrderInput {
assignedToUserID: ID
priority: WorkOrderPriority
Expand All @@ -231,27 +239,39 @@ input UpdateWorkOrderInput {
entryContactPhone: String
scheduledDateTime: DateTime
}

input UpdateWorkOrderLocationInput {
country: String
region: String
city: String
streetLine1: String
streetLine2: String
}

input UpdateChecklistItemInput {
id: ID
description: String!
isCompleted: Boolean
}

union CancelWorkOrderResponse = WorkOrder | DeleteMutationResponse

type PhoneContact {
isUser: Boolean!
id: String!
name: String
phone: String
email: Email
givenName: String
familyName: String
businessName: String
photoUrl: String
}

input RawPhoneContactInput {
id: String!
name: String
phone: String
email: String
photoUrl: String
}
"Exposes a URL that specifies the behavior of this scalar."
directive @specifiedBy(
"The URL that specifies the behavior of this scalar."
url: String!
) on SCALAR
}

0 comments on commit d888ab2

Please sign in to comment.