Skip to content

Throws error when using useGraphQlJit() plugin and request header Accept is not application/graphql-response+json, application/json, multipart/mixed #2967

@MrFoxPro

Description

@MrFoxPro

Describe the bug

Result with application/graphql-response+json, application/json, multipart/mixed header

{
  errors: [
    {
      message: 'Variable "$otp" got invalid value "1234"; Expected type Int; Int cannot represent non-integer value: "1234"'
    }
  ]
}

Without:

ERR TypeError: Cannot read properties of undefined (reading 'originalError')
    at file:///project/sandbox/node_modules/graphql-yoga/esm/plugins/result-processor/regular.js:22:60
    at Array.some (<anonymous>)
    at processRegularResult (file:///project/sandbox/node_modules/graphql-yoga/esm/plugins/result-processor/regular.js:22:32)
    at processResult (file:///project/sandbox/node_modules/graphql-yoga/esm/process-request.js:31:12)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
ERR TypeError: Cannot read properties of undefined (reading 'originalError')
    at file:///project/sandbox/node_modules/graphql-yoga/esm/plugins/result-processor/regular.js:22:60
    at Array.some (<anonymous>)
    at processRegularResult (file:///project/sandbox/node_modules/graphql-yoga/esm/plugins/result-processor/regular.js:22:32)
    at processResult (file:///project/sandbox/node_modules/graphql-yoga/esm/process-request.js:31:12)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
{ errors: [ { message: 'Unexpected error.', extensions: {} } ] }

Your Example Website or App

https://codesandbox.io/p/sandbox/reverent-cdn-hx5fy7?file=%2Fsrc%2Fmain.ts%3A11%2C28

Steps to Reproduce the Bug or Issue

Just run codesandbox

Expected behavior

I'm not sure btw. But it shouldn't be different from usage without useGraphqlJit()

Screenshots or Videos

No response

Platform

  • OS:Linux
  • NodeJS: from 16 to 20
  • @graphql-yoga/* version(s): 4.0.4

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions