Files
job-tracker/internal/graph/schema/job_application.graphql
T
adamf 1147bc5697
Test and publish / test (push) Successful in 2m33s
Test and publish / publish (push) Successful in 11m9s
Add application workflow and lead analytics
2026-10-23 20:45:48 +01:00

169 lines
4.3 KiB
GraphQL

# Job application tracker. Rows come from these mutations, from the browser
# capture userscript (internal/handlers/handle_job_capture.go), or from
# promoting a lead (job_lead.graphql). These are private data, so the queries
# here are @admin as well as the mutations.
#
# description is the captured posting text. It can run to tens of kilobytes,
# so the tracker's list query leaves it out and asks for it per row.
# The lifecycle of an application, in the order the capture endpoint is
# allowed to advance it. The values are lowercase on purpose: they are exactly
# the strings stored in the status column and ranked in services.statusOrder
# (internal/services/job_status.go), and a test there
# fails if this list and that map ever differ. Adding a status means adding
# it in both places, and to the tracker page and the capture userscript.
#
# It is bound to a custom marshaller (services/job_status.go, via gqlgen.yml)
# rather than a generated Go type: input is strict, so a mutation carrying a
# status outside this list is refused, while output passes a legacy stored
# value through so one old row cannot fail the whole jobApplications query.
#
# On the wire it is still a JSON string ("applied"), as it was when the field
# was a String, both in variables and in responses.
enum JobStatus {
saved
applied
screening
assessment
interviewing
offer
rejected
withdrawn
}
type JobApplication {
id: ID!
createdAt: Time!
updatedAt: Time!
jobTitle: String!
company: String!
location: String
url: String
status: JobStatus!
notes: String
appliedAt: Time
description: String
nextAction: String
nextActionAt: Time
contactName: String
contactEmail: String
contactRole: String
salaryRange: String
workArrangement: String
applicationSource: String
resumeVersion: String
requisitionId: String
lastContactedAt: Time
events: [JobApplicationEvent!]!
}
type JobApplicationEvent {
id: ID!
createdAt: Time!
jobApplicationId: ID!
kind: String!
occurredAt: Time!
note: String
source: String!
contactName: String
contactEmail: String
contactRole: String
}
type AnalyticsStatusCount {
status: String!
count: Int!
}
type AnalyticsTransition {
from: String!
to: String!
count: Int!
}
type Analytics {
totalApplications: Int!
statusCounts: [AnalyticsStatusCount!]!
transitions: [AnalyticsTransition!]!
responseCount: Int!
interviewCount: Int!
offerCount: Int!
responseRate: Float!
interviewRate: Float!
offerRate: Float!
averageDaysToResponse: Float
averageDaysToInterview: Float
averageDaysToOffer: Float
}
input CreateJobApplicationInput {
jobTitle: String!
company: String!
location: String
url: String
status: JobStatus!
notes: String
appliedAt: Time
description: String
nextAction: String
nextActionAt: Time
contactName: String
contactEmail: String
contactRole: String
salaryRange: String
workArrangement: String
applicationSource: String
resumeVersion: String
requisitionId: String
lastContactedAt: Time
}
input UpdateJobApplicationInput {
jobTitle: String
company: String
location: String
url: String
status: JobStatus
notes: String
appliedAt: Time
description: String
nextAction: String
nextActionAt: Time
clearNextActionAt: Boolean
contactName: String
contactEmail: String
contactRole: String
salaryRange: String
workArrangement: String
applicationSource: String
resumeVersion: String
requisitionId: String
lastContactedAt: Time
}
extend type Query {
jobApplications: [JobApplication!]! @admin
jobApplication(id: ID!): JobApplication @admin
jobApplicationEvents(applicationId: ID!): [JobApplicationEvent!]! @admin
analytics: Analytics! @admin
}
extend type Mutation {
createJobApplication(input: CreateJobApplicationInput!): JobApplication! @admin
updateJobApplication(id: ID!, input: UpdateJobApplicationInput!): JobApplication! @admin
# Errors on an id that does not exist, like the other deletes; the Boolean
# is only ever true.
deleteJobApplication(id: ID!): Boolean! @admin
addJobApplicationEvent(applicationId: ID!, input: AddJobApplicationEventInput!): JobApplicationEvent! @admin
}
input AddJobApplicationEventInput {
kind: String!
occurredAt: Time
note: String
source: String
contactName: String
contactEmail: String
contactRole: String
}