You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the hook is called like this: useGetAnalyticsSourcesQuery()
And parameters in the Open API specification look like this:
"parameters": [
{
"name": "sort",
"in": "query",
"description": "Available sorts are `display_name`. You can sort by multiple options by separating them with a comma. To sort in descending order, use `-` sign in front of the sort, for example: `-display_name`.",
"schema": {
"type": "string",
"default": "display_name"
}
},
{
"name": "fields",
"in": "query",
"description": "Available fields are `display_name`. You can include multiple options by separating them with a comma.",
"schema": {
"type": "string"
}
}
],
The generated output in the javascript client looks like this:
An error shows up in console like this: TypeError: Cannot read properties of undefined (reading 'sort').
If I call the hook like this: useGetAnalyticsSourcesQuery({'sort': '', 'filter': ''}) then the TypeError does not show up and it works.
It seems that every query parameter must be included with the hook but for endpoints with many query parameters this becomes burdensome. Is there a way to make all query parameters optional in the generated output?