-
Notifications
You must be signed in to change notification settings - Fork 466
Closed
Labels
needs: discussionRequires a discussion to proceedRequires a discussion to proceedneeds: reviewer responseThis needs the attention of a codeowner or maintainerThis needs the attention of a codeowner or maintainertype: enhancementImprovements to existing functionalityImprovements to existing functionality
Description
Description
When a query is made exceeding the max query amount, no error is thrown to indicate that the value of first exceeds the amount. Instead, the query succeeds, but returns only the max query amount.
We expected some type of error, since the max query amount is not visible for a user of the API.
Steps to reproduce
Reproducible in repl:
{
posts(first:10000000){
nodes {
id
}
}
}
{
"data": {
"posts": {
"nodes": [
{
"id": "cG9zdDox"
}
]
}
},
"extensions": {
"debug": [
{
"type": "DEBUG_LOGS_INACTIVE",
"message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."
}
]
}
}
Additional context
This could be part of a larger conversation around query costs, which is how Shopify handles this issue with their GraphQL API.
{
"errors": [
{
"message": "Query cost is 2002, which exceeds the single query max cost limit (1000).\n\nSee https://shopify.dev/concepts/about-apis/rate-limits for more information on how the\ncost of a query is calculated.\n\nTo query larger amounts of data with fewer limits, bulk operations should be used instead.\nSee https://shopify.dev/api/usage/bulk-operations/queries for usage details.\n",
"extensions": {
"code": "MAX_COST_EXCEEDED",
"cost": 2002,
"maxCost": 1000,
"documentation": "https://shopify.dev/api/usage/rate-limits"
}
}
]
}
WPGraphQL Version
1.19.0
WordPress Version
N/A
PHP Version
N/A
Additional environment details
No response
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have disabled ALL plugins except for WPGraphQL.
- Yes
- My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
Metadata
Metadata
Assignees
Labels
needs: discussionRequires a discussion to proceedRequires a discussion to proceedneeds: reviewer responseThis needs the attention of a codeowner or maintainerThis needs the attention of a codeowner or maintainertype: enhancementImprovements to existing functionalityImprovements to existing functionality
Type
Projects
Status
✅ Done