Directives Overview

GQLForge uses GraphQL schema directives to declaratively configure data fetching, transformation, and access control. Below is a summary of every available directive.

Data Source Directives

DirectiveDescription
@httpResolve a field by calling a REST/HTTP endpoint.
@grpcResolve a field by calling a gRPC service method.
@graphQLResolve a field by proxying to another GraphQL server.
@callCompose multiple resolver steps into a single field resolution.
@exprReturn a static value or a computed expression.
@jsResolve a field using a custom JavaScript function.
@postgresResolve a field by querying a PostgreSQL table.
@s3Resolve a field using Amazon S3 or S3-compatible storage.

Schema Transformation Directives

DirectiveDescription
@addFieldAdd a derived field to a type.
@modifyRename a field or mark it as omitted in the public schema.
@omitExclude a field from the public-facing schema entirely.
@discriminateSet the discriminator field for union type resolution.

Performance and Security Directives

DirectiveDescription
@cacheCache a field’s resolved value for a specified duration.
@protectedRestrict field access to authenticated users.

Endpoint Directives

DirectiveDescription
@restExpose a GraphQL query as a REST endpoint.