Extension Entry Points01
| Function | Description |
NewExtension(opts ...ConfigOption) forge.Extension | Create the GraphQL extension with functional options |
NewExtensionWithConfig(config Config) forge.Extension | Create the GraphQL extension with a complete config |
DefaultConfig() Config | Returns the default configuration |
GraphQL Interface -- Schema02
| Method | Description |
RegisterQuery(name, resolver, config) error | Register a query field resolver |
RegisterMutation(name, resolver, config) error | Register a mutation field resolver |
RegisterSubscription(name, resolver, config) error | Register a subscription resolver |
RegisterType(name, definition) error | Register a custom type definition |
GetSchema() *GraphQLSchema | Get the current schema |
GraphQL Interface -- Execution03
| Method | Description |
Execute(ctx, request) (*Response, error) | Execute a GraphQL request |
Use(middleware...) | Add executor middleware |
GraphQL Interface -- Lifecycle04
| Method | Description |
Start(ctx) error | Initialize the GraphQL server |
Stop(ctx) error | Shut down the server |
Health(ctx) error | Check server health |
GraphQL Interface -- Stats05
| Method | Description |
Stats() ServerStats | Get server statistics |
Key Types06
Request
| Field | Type | Purpose |
Query | string | GraphQL query string |
OperationName | string | Operation name for multi-operation documents |
Variables | map[string]any | Query variables |
Response
| Field | Type | Purpose |
Data | any | Query result data |
Errors | []Error | Execution errors |
Extensions | map[string]any | Response extensions (timing, tracing) |