WebAPIError and APIQueryUtilsMixin for GraphQL API endpoint
Review Request #12228 — Created April 8, 2022 and updated
Add a new
APIQueryUtilsMixinfor 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.GETobject, and GraphQL does not support hyphens in its SDL. The existing
APIQueryUtilsMixinmethod for filtering
intfields does not support GraphQL requests. Additionally, it will be helpful for users to be returned a
WebAPIErrorspecific to the GraphQL endpoint when an error in their request occurs.
This change introduces a new
APIQueryUtilsMixinthat allows callers to filter results through a
query_paramsvariable defined in the GRaphQL request. It also creates a new
WebAPIErrorthat will be returned by the GraphQL endpoint when a query fails validation.
Added unit tests for the new
Ran all other tests in
Ran and manually tested locally that the GraphQL Validation error is returned.