Files
Bryan Frimin 383ea5a2d4 Retrict some query and mutation to only session
Signed-off-by: Bryan Frimin <bryan@probo.com>
2026-06-02 17:43:21 -07:00

19 lines
727 B
GraphQL

# sessionOnly directive for GraphQL APIs
# Include this schema in your gqlgen configuration to restrict a field to
# session authentication.
#
# It is meant to be combined with @authentication(required: PRESENT):
# @authentication enforces that the caller is authenticated, while @sessionOnly
# additionally rejects API key authentication (which carries an identity but no
# session). Use it for sensitive identity self-management (e.g. managing
# personal API keys).
#
# Usage in your schema.graphql:
# type Mutation {
# createPersonalAPIKey(input: CreatePersonalAPIKeyInput!): CreatePersonalAPIKeyPayload
# @authentication(required: PRESENT)
# @sessionOnly
# }
directive @sessionOnly on FIELD_DEFINITION