WebAPIError and APIQueryUtilsMixin for GraphQL API endpoint
Review Request #12228 — Created April 8, 2022 and discarded
Add a new
WebAPIError
andAPIQueryUtilsMixin
for use by the GraphQL API endpoint.There are some differences in how query parameters get passed in a request between the RESTful and GraphQL API endpoints. Namely, the query parameters don't exist in the
request.GET
object, and GraphQL does not support hyphens in its SDL. The existingAPIQueryUtilsMixin
method for filteringint
fields does not support GraphQL requests. Additionally, it will be helpful for users to be returned aWebAPIError
specific to the GraphQL endpoint when an error in their request occurs.This change introduces a new
APIQueryUtilsMixin
that allows callers to filter results through aquery_params
variable defined in the GRaphQL request. It also creates a newWebAPIError
that will be returned by the GraphQL endpoint when a query fails validation.
Added unit tests for the new
build_graphql_queries_for_int_field
mixin.
Ran all other tests intest_apiqueryutilsmixin.py
.
Ran and manually tested locally that the GraphQL Validation error is returned.
Summary | ID |
---|---|
55a832c39e0b04a58ec156d6c0a3b87a557944dd | |
fe4b6d3f71cecec2cf3be5f1213c8f4aa2c77d40 | |
16fea59b87cdad73e9123633758d819367904954 |