Skip to content

Commit 813c4a0

Browse files
author
Lionel Schiepers
committed
fix: check if there is a payload by checking the http method
fix: check if there is a payload by checking the http method instead of payloadRequired because that field is not always correctly initialized during unit test
1 parent c9cbb40 commit 813c4a0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/openapi-to-graphql/src/resolver_builder.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,12 @@ export function getResolver({
446446
*
447447
* NOTE: This may cause the user to encounter unexpected changes
448448
*/
449-
if (operation.payloadRequired)
449+
if (operation.method !== 'get')
450450
{
451+
/**
452+
* the check is done on the 'get' operation to determine if there is a payload because
453+
* operation.payloadRequired is not always correctly initialized (at least during the unit test)
454+
*/
451455
headers['content-type'] =
452456
typeof operation.payloadContentType !== 'undefined'
453457
? operation.payloadContentType

0 commit comments

Comments
 (0)