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
| Directive | Description |
| @http | Resolve a field by calling a REST/HTTP endpoint. |
| @grpc | Resolve a field by calling a gRPC service method. |
| @graphQL | Resolve a field by proxying to another GraphQL server. |
| @call | Compose multiple resolver steps into a single field resolution. |
| @expr | Return a static value or a computed expression. |
| @js | Resolve a field using a custom JavaScript function. |
| @postgres | Resolve a field by querying a PostgreSQL table. |
| @s3 | Resolve a field using Amazon S3 or S3-compatible storage. |
| Directive | Description |
| @addField | Add a derived field to a type. |
| @modify | Rename a field or mark it as omitted in the public schema. |
| @omit | Exclude a field from the public-facing schema entirely. |
| @discriminate | Set the discriminator field for union type resolution. |
| Directive | Description |
| @cache | Cache a field’s resolved value for a specified duration. |
| @protected | Restrict field access to authenticated users. |
Endpoint Directives
| Directive | Description |
| @rest | Expose a GraphQL query as a REST endpoint. |