Skip to content

Query works without but fails with graphql-jit throwing RangeError #175

@NexZhu

Description

@NexZhu

Hi, I have a GraphQL API auto generated from Prisma schema using typegraphql-prisma. The following query for example working as expected with Yoga as the GraphQL server:

query GetNodes($where: NodeWhereInput) {
    nodes(where: $where) {
        id
    }
}

Variables:

{
  "where": {
    "ownerId": {
      "equals": 1
    }
  }
}

Result:

{
  "data": {
    "nodes": [
      {
        "id": "6820393e-3117-460b-b22a-443dabd5a5d0"
      },
      {
        "id": "d5f7639b-5280-409d-9139-12813bc035f7"
      }
    ]
  }
}

But when I enable graphql-jit, I got this error from the same query:

{
  errors: [
    RangeError: Maximum call stack size exceeded
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/[email protected][email protected]/node_modules/graphql-jit/src/variables.ts:153:5)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/[email protected][email protected]/node_modules/graphql-jit/src/variables.ts:332:13)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/[email protected][email protected]/node_modules/graphql-jit/src/variables.ts:376:11)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/[email protected][email protected]/node_modules/graphql-jit/src/variables.ts:332:13)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/[email protected][email protected]/node_modules/graphql-jit/src/variables.ts:376:11)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/[email protected][email protected]/node_modules/graphql-jit/src/variables.ts:332:13)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/[email protected][email protected]/node_modules/graphql-jit/src/variables.ts:376:11)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/[email protected][email protected]/node_modules/graphql-jit/src/variables.ts:332:13)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/[email protected][email protected]/node_modules/graphql-jit/src/variables.ts:376:11)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/[email protected][email protected]/node_modules/graphql-jit/src/variables.ts:332:13)
  ]
}

It works fine in both cases without the query parameters though:

query GetNodes {
    nodes {
        region
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions