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]>
98 lines
2.4 KiB
YAML
98 lines
2.4 KiB
YAML
schema:
|
|
- graph/schema/*.graphql
|
|
|
|
exec:
|
|
filename: graph/generated.go
|
|
package: graph
|
|
|
|
model:
|
|
filename: graph/model/models_gen.go
|
|
package: model
|
|
|
|
resolver:
|
|
layout: follow-schema
|
|
dir: graph
|
|
package: graph
|
|
filename_template: "{name}.resolvers.go"
|
|
|
|
models:
|
|
# Two bindings, tried in order. IntID comes first, so it is what gqlgen
|
|
# picks where it has a free choice — resolver arguments stay `id int`.
|
|
# UintID is there so a model's `ID uint` field binds to `id: ID!` directly,
|
|
# with no hand-written resolver converting it. Both write an id as a quoted
|
|
# decimal string ("12") and read a string or a number, so which one a field
|
|
# uses is invisible on the wire.
|
|
ID:
|
|
model:
|
|
- github.com/99designs/gqlgen/graphql.IntID
|
|
- github.com/99designs/gqlgen/graphql.UintID
|
|
# Bound to MarshalJobStatus / UnmarshalJobStatus in services, so the Go
|
|
# type stays `string` (models.JobApplication.Status binds as it is) and the
|
|
# marshaller, not a generated enum type, decides what is accepted and what
|
|
# is emitted. See services/job_status.go for why.
|
|
JobStatus:
|
|
model:
|
|
- adam-french.co.uk/backend/services.JobStatus
|
|
User:
|
|
model:
|
|
- adam-french.co.uk/backend/models.User
|
|
fields:
|
|
password:
|
|
resolver: false
|
|
deletedAt:
|
|
resolver: false
|
|
Post:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Post
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Activity:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Activity
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Favorite:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Favorite
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Rowing:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Rowing
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Message:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Message
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Bookmark:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Bookmark
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
JobApplication:
|
|
model:
|
|
- adam-french.co.uk/backend/models.JobApplication
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
JobAppReference:
|
|
model:
|
|
- adam-french.co.uk/backend/models.JobAppReference
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Place:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Place
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|