Authorisation: @admin and @signedIn schema directives replace the 25 hand-copied resolver checks. A test fails if a mutation has neither and is not on the public allow-list, so a new mutation cannot ship unguarded. IDs: uint model IDs bind through graphql.UintID, removing the ten int(obj.ID) resolvers. Job status is a GraphQL enum, tied to services.statusOrder by a test. Input is strict, so the mutations no longer coerce an unknown status to "applied"; output is lenient so one legacy row cannot fail the list. deleteJobApplication and deleteJobAppReference now error on a missing id like the other deletes. The rowing reader, the job extractor and now the email classifier reach the Python service through one services.CallPython helper. The email pipeline's prompt and fence stripping moved to Python, and anthropic-sdk-go is gone from go.mod. Fix the auth test fixture, whose 11-byte secret had been panicking the services test package since InitAuth began requiring 32 bytes. Add a test that keeps the python service's compose environment list in step with the env registry. Co-Authored-By: Claude Opus 5.5 <[email protected]>
50 lines
991 B
GraphQL
50 lines
991 B
GraphQL
# Places to go. Unlike most mutations these require only a signed-in user
|
|
# (@signedIn), not an admin, and there is no per-user ownership: the list is
|
|
# shared. The query is guarded too — the list is not public.
|
|
|
|
type Place {
|
|
id: ID!
|
|
createdAt: Time!
|
|
updatedAt: Time!
|
|
title: String!
|
|
location: String
|
|
notes: String
|
|
imageUrl: String
|
|
category: String
|
|
cost: String
|
|
priority: Int!
|
|
done: Boolean!
|
|
}
|
|
|
|
input CreatePlaceInput {
|
|
title: String!
|
|
location: String
|
|
notes: String
|
|
imageUrl: String
|
|
category: String
|
|
cost: String
|
|
priority: Int
|
|
done: Boolean
|
|
}
|
|
|
|
input UpdatePlaceInput {
|
|
title: String
|
|
location: String
|
|
notes: String
|
|
imageUrl: String
|
|
category: String
|
|
cost: String
|
|
priority: Int
|
|
done: Boolean
|
|
}
|
|
|
|
extend type Query {
|
|
places: [Place!]! @signedIn
|
|
}
|
|
|
|
extend type Mutation {
|
|
createPlace(input: CreatePlaceInput!): Place! @signedIn
|
|
updatePlace(id: ID!, input: UpdatePlaceInput!): Place! @signedIn
|
|
deletePlace(id: ID!): Place! @signedIn
|
|
}
|