Skip to content

fix/docs(gateway/demandControl) - use the correct name for operationTypeCost #6914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const gatewayConfig = defineConfig({
* Cost based on the operation type.
* By default, mutations have a cost of 10, queries and subscriptions have a cost of 0.
*/
operationCost: operationType => (operationType === 'mutation' ? 10 : 0),
operationTypeCost: operationType => (operationType === 'mutation' ? 10 : 0),
/**
* Cost based on the field.
* It is called for each field in the operation, and overrides the `@cost` directive.
Expand All @@ -62,7 +62,7 @@ export const gatewayConfig = defineConfig({

When a query is planned by the gateway,

- For each operation, the `operationCost` function is called with the operation type. (By default
- For each operation, the `operationTypeCost` function is called with the operation type. (By default
only mutations have a cost `10`)
- For each field in the operation, the `fieldCost` function is called with the field node. (By
default fields have a cost of `0`)
Expand Down
Loading