Skip to content
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

Validate GraphQL pagination input params before API proceeds further #222

Open
sophie-cluml opened this issue May 13, 2024 · 0 comments
Open

Comments

@sophie-cluml
Copy link
Contributor

Background

#217 (comment)

Running validations for GraphQL request input parameters before our code calls data-loading(or data-fetching) functions, saves resources and separates responsibilities. One example I think that will benefit from this change is nodeStatusList API. Currently,validate_and_process_pagination_params is called in the middle of graphql::node::status::load, so if validation fails, the API will return error in the middle. But after change, input params will be validated before graphql::node::status::load, so server resource will be saved, and we are sure that input params are cleaned before we load something from our server.

Related Parts

Currently, validate_and_process_pagination_params is called inside graphql::load_nodes, graphql::load_edges, graphql::outlier::load, and graphql::outlier::load_ranked_outliers_with_filter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant