-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Make all limits of the of the complexity to be configurable via the CLI #2318
Comments
Input from grooming: Just adding all of these as CLI args with the given defaults seems like a good starting point. |
Started having a look at this. It does not look like we can easily change the #[graphql(complexity = "QUERY_COSTS.query_name")] field to use values computed at runtime.
In particular, A better approach seems to be using async_graphql extensions. In particular, it looks that the analyzer extension can be tweaked to limit query complexity with values specified at runtime. Note that extensions are run against all graphQL requests, not only queries. Pinging @xgreenx to validate the approach. |
Actually the complexity expression is evaluated at runtime so if we can do
Where the function could have access to some lazy static value that we initialize once the system starts up. Though extensions may be a better way to go about it. |
If we do write an extension here, we need to be careful not to hit the same race condition as in #2330 (comment). We could probably use the same solution, but perhaps it's simpler to just use a |
## Linked Issues/PRs - Closes #2318 ## Description This PR adds CLI options to configure graphql query costs dynamically. ## Checklist - [x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests ### Before requesting review - [x] I have reviewed the code myself ### After merging, notify other teams [Add or remove entries as needed] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) --------- Co-authored-by: acerone85 <andrea.cerone@gmail.com> Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
The text was updated successfully, but these errors were encountered: