// Package graph is the GraphQL layer: the single POST /jobs/api/graphql // endpoint behind every page of the tracker. // // How the pieces fit: // // - schema/*.graphql is the source of truth. `make generate` regenerates // generated.go and model/models_gen.go, and adds stubs for any new field // to the matching *.resolvers.go. Never edit those two generated files. // - gqlgen.yml maps the GraphQL object types straight onto the GORM structs // in internal/models, so model/ holds only input types. A model's // `ID uint` binds to `id: ID!` directly through graphql.UintID. // - The JobStatus enum is bound to a custom marshaller in // services/job_status.go rather than a generated type; see that file. // - Resolvers reach the database and the lead fetcher through // Resolver.Store, the same handlers.Store the REST endpoints use. // // Authorisation: the endpoint has auth.Annotate in front of it, which asks the // site backend whether the caller is the admin and records the answer without // refusing anything. What refuses is the @admin directive on each field // (directives.go). Every field in this schema is admin-only, and // directives_test.go fails if one is added without the directive. // // Resolver commentary lives inside function bodies, because gqlgen relocates // or strips anything above the signature when regenerating. package graph