Skip to content

Commit

Permalink
Fix setting null value in query params with style "form"
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandr Dascal <[email protected]>
  • Loading branch information
adascal committed Nov 14, 2022
1 parent 8951518 commit bd9d2fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/openapi-to-graphql/src/resolver_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ export function extractRequestDataFromArgs<TSource, TContext, TArgs>(
// Query parameters
case 'query':
// setting param style as form assumes explode is true by default
if (param.style === 'form' && typeof args[saneParamName] === 'object') {
if (param.style === 'form' && typeof args[saneParamName] === 'object' && args[saneParamName] !== null) {
if (param.explode === false) {
qs[param.name] = Object.entries(args[saneParamName]).reduce((acc, val) => {
acc += val.join(',')
Expand Down

0 comments on commit bd9d2fe

Please sign in to comment.