# Root of the GraphQL schema. # # Query and Mutation are declared here with no fields; every other file in this # directory adds to them with `extend type Query` / `extend type Mutation`. # That is what lets the schema be split one file per domain, matching the # one-file-per-domain resolver layout (gqlgen.yml uses layout: follow-schema). # # Time is mapped to Go's time.Time by gqlgen's default scalar handling and is # serialised as RFC 3339. # # These files are the source of truth: after editing one, run `make generate` # to regenerate internal/graph/generated.go and internal/graph/model/models_gen.go. # Note that `#` comments like this one are invisible to clients; a `"""` block # would become a schema description and show up in introspection. scalar Time # Authorisation. There is no middleware in front of /graphql that refuses a # request, so a field is PUBLIC unless it carries this. It is implemented in # internal/graph/directives.go and runs before the field's resolver: # # @admin the request must come from the site's admin, as decided by # internal/auth (error: "admin access required") # # Every query and mutation in this app is admin-only, and # internal/graph/directives_test.go fails if one is not. directive @admin on FIELD_DEFINITION type Query type Mutation