Trim comments to the non-obvious why
Drop narration, history and restated-code comments across the repo, keep short ones for security boundaries, upstream quirks and ordering constraints, and record the convention in CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,35 +1,10 @@
|
||||
# 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
|
||||
# go run github.com/99designs/gqlgen generate
|
||||
# from backend/ to regenerate graph/generated.go and 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.
|
||||
# Root types; each file extends Query and Mutation. Use # comments, not """
|
||||
# (descriptions show up in introspection).
|
||||
|
||||
scalar Time
|
||||
|
||||
# Authorisation. There is no middleware in front of /graphql, so a field is
|
||||
# PUBLIC unless it carries one of these. Each is implemented once, in
|
||||
# graph/directives.go, and runs before the field's resolver:
|
||||
#
|
||||
# @admin the request must carry an admin's access token
|
||||
# (error: "admin access required")
|
||||
# @signedIn any valid access token will do
|
||||
# (error: "authentication required")
|
||||
#
|
||||
# Every mutation needs one of them unless it is deliberately public (login,
|
||||
# logout, refreshToken); graph/directives_test.go fails otherwise, and pins
|
||||
# which queries are guarded. Rules that are not a plain gate stay in the
|
||||
# resolver: a post is only editable by its author, `me` answers for whoever is
|
||||
# signed in, and `messages` filters private rows rather than refusing.
|
||||
# A field is public unless it has @admin or @signedIn (graph/directives.go).
|
||||
# directives_test.go enforces this for mutations.
|
||||
directive @admin on FIELD_DEFINITION
|
||||
directive @signedIn on FIELD_DEFINITION
|
||||
|
||||
|
||||
Reference in New Issue
Block a user