Skip to content

Commit 1a5010e

Browse files
authored
Docs/Gateway: Demand Control (#6567)
1 parent cbc79a4 commit 1a5010e

4 files changed

Lines changed: 381 additions & 65 deletions

File tree

packages/web/docs/src/content/gateway/logging-and-error-handling.mdx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,19 @@ class CustomLogger implements Logger {
177177
To help with debugging and improve error understanding for consumers, Hive Gateway uses error codes
178178
for the following specific types of errors:
179179

180-
| Code | Description |
181-
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
182-
| `GRAPHQL_PARSE_FAILED` | Sent GraphQL Operation cannot be parsed |
183-
| `GRAPHQL_VALIDATION_FAILED` | Sent GraphQL Operation is not validated against the schema |
184-
| `BAD_USER_INPUT` | Variable or argument values are not valid in the GraphQL parameters |
185-
| `TIMEOUT_ERROR` | Indicates a timeout in the subgraph execution. Keep in mind that this timeout is not always an HTTP timeout or a timeout specified by you. It might be the subgraph server that timed out. Learn more about upstream reliability to configure timeout based on your needs. |
186-
| `SCHEMA_RELOAD` | When Hive Gateway updates the schema by polling or any other way, all ongoing requests are terminated, including subscriptions and long-running defer/stream operations. In this case, this error is sent to the client to indicate a schema change. Usually, a retry is expected in this case. |
187-
| `SHUTTING_DOWN` | When Hive Gateway is shutting down or restarting, like `SCHEMA_RELOAD`, it aborts all requests and notifies the client with this error code. After a certain amount of time, a retry can be sent. |
188-
| `UNAUTHENTICATED` | The given auth credentials are not valid. Check the logs and documentation of the used auth plugin to learn more. |
189-
| `PERSISTED_QUERY_NOT_FOUND` | Indicates that persisted operation information is not found in the store. Check the related persisted operation plugin docs to learn more about this error. |
190-
| `INTERNAL_SERVER_ERROR` | Indicates that the error is unexpected or unspecified and masked by the gateway. It is probably caused by an unexpected network, connection, or other runtime error. You can see the details of this error in the logs. |
191-
| `DOWNSTREAM_SERVICE_ERROR` | Indicates the error is subgraph-related, and generated by the subgraph, not the gateway |
180+
| Code | Description |
181+
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
182+
| `GRAPHQL_PARSE_FAILED` | Sent GraphQL Operation cannot be parsed |
183+
| `GRAPHQL_VALIDATION_FAILED` | Sent GraphQL Operation is not validated against the schema |
184+
| `BAD_USER_INPUT` | Variable or argument values are not valid in the GraphQL parameters |
185+
| `TIMEOUT_ERROR` | Indicates a timeout in the subgraph execution. Keep in mind that this timeout is not always an HTTP timeout or a timeout specified by you. It might be the subgraph server that timed out. Learn more about upstream reliability to configure timeout based on your needs. |
186+
| `SCHEMA_RELOAD` | When Hive Gateway updates the schema by polling or any other way, all ongoing requests are terminated, including subscriptions and long-running defer/stream operations. In this case, this error is sent to the client to indicate a schema change. Usually, a retry is expected in this case. |
187+
| `SHUTTING_DOWN` | When Hive Gateway is shutting down or restarting, like `SCHEMA_RELOAD`, it aborts all requests and notifies the client with this error code. After a certain amount of time, a retry can be sent. |
188+
| `UNAUTHENTICATED` | The given auth credentials are not valid. Check the logs and documentation of the used auth plugin to learn more. |
189+
| `PERSISTED_QUERY_NOT_FOUND` | Indicates that persisted operation information is not found in the store. Check the related persisted operation plugin docs to learn more about this error. |
190+
| `INTERNAL_SERVER_ERROR` | Indicates that the error is unexpected or unspecified and masked by the gateway. It is probably caused by an unexpected network, connection, or other runtime error. You can see the details of this error in the logs. |
191+
| `DOWNSTREAM_SERVICE_ERROR` | Indicates the error is subgraph-related, and generated by the subgraph, not the gateway |
192+
| `COST_ESTIMATED_TOO_EXPENSIVE` | Indicates that the cost of the operation is too expensive and exceeds the configured limit. [See more about cost limiting (demand control)](/docs/gateway/other-features/security/demand-control) |
192193

193194
### Error Masking
194195

packages/web/docs/src/content/gateway/other-features/security/_meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ export default {
33
cors: 'CORS',
44
'csrf-prevention': 'CSRF Prevention',
55
'rate-limiting': 'Rate Limiting',
6+
'demand-control': 'Demand Control',
67
'disable-introspection': 'Introspection',
78
https: 'HTTPS',
89
'hmac-signature': 'HMAC Signature',
910
'aws-sigv4': 'AWS Signature V4',
1011
'audit-documents': 'Audit Documents',
1112
'block-field-suggestions': 'Block Field Suggestions',
1213
'character-limit': 'Character Limit',
13-
'cost-limit': 'Cost Limit',
1414
'max-aliases': 'Max Aliases',
1515
'max-depth': 'Max Depth',
1616
'max-directives': 'Max Directives',

packages/web/docs/src/content/gateway/other-features/security/cost-limit.mdx

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)