Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NexZhu opened this issue Jul 8, 2022 · 1 comment
Open

Comments

@NexZhu
Copy link

NexZhu commented Jul 8, 2022

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/graphql-jit@0.7.4_graphql@15.8.0/node_modules/graphql-jit/src/variables.ts:153:5)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/graphql-jit@0.7.4_graphql@15.8.0/node_modules/graphql-jit/src/variables.ts:332:13)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/graphql-jit@0.7.4_graphql@15.8.0/node_modules/graphql-jit/src/variables.ts:376:11)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/graphql-jit@0.7.4_graphql@15.8.0/node_modules/graphql-jit/src/variables.ts:332:13)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/graphql-jit@0.7.4_graphql@15.8.0/node_modules/graphql-jit/src/variables.ts:376:11)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/graphql-jit@0.7.4_graphql@15.8.0/node_modules/graphql-jit/src/variables.ts:332:13)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/graphql-jit@0.7.4_graphql@15.8.0/node_modules/graphql-jit/src/variables.ts:376:11)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/graphql-jit@0.7.4_graphql@15.8.0/node_modules/graphql-jit/src/variables.ts:332:13)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/graphql-jit@0.7.4_graphql@15.8.0/node_modules/graphql-jit/src/variables.ts:376:11)
        at generateInput (/root/dev/baas/web/backend/node_modules/.pnpm/graphql-jit@0.7.4_graphql@15.8.0/node_modules/graphql-jit/src/variables.ts:332:13)
  ]
}

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

query GetNodes {
    nodes {
        region
    }
}
@boopathi
Copy link
Member

It is probably because of circular references in the Input type definitions. Related to #81 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants