T
Twentyβ€’6mo ago
Skyfox675

Error "cannot pass more than 100 arguments to a function" when calling create "insertIntodeal"

I have a custom object called "deal"/"deals" and I am attempting to create a new deal object via Rest API and am receving the below error. However it is working via the UI when providing only a name field. Thanks in advance! πŸ™‚
[
InternalServerErrorException: GraphQL errors on insertIntodeal: {"message":"cannot pass more than 100 arguments to a function"}
at computePgGraphQLError (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-query-runner/utils/compute-pg-graphql-error.util.js:30:12)
at WorkspaceQueryRunnerService.parseResult (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-query-runner/workspace-query-runner.service.js:279:80)
at WorkspaceQueryRunnerService.createMany (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-query-runner/workspace-query-runner.service.js:110:43)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async WorkspaceQueryRunnerService.createOne (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-query-runner/workspace-query-runner.service.js:127:25)
at async field.resolve (/app/node_modules/@envelop/on-resolve/cjs/index.js:36:42)
at async /app/node_modules/@envelop/core/cjs/orchestrator.js:383:27
at async YogaServer.getResultForParams (/app/node_modules/graphql-yoga/cjs/server.js:304:26)
at async YogaServer.handle (/app/node_modules/graphql-yoga/cjs/server.js:77:29) {
path: [ 'createDeal' ],
locations: [ [Object] ],
extensions: [Object: null prototype] {}
}
]
[
InternalServerErrorException: GraphQL errors on insertIntodeal: {"message":"cannot pass more than 100 arguments to a function"}
at computePgGraphQLError (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-query-runner/utils/compute-pg-graphql-error.util.js:30:12)
at WorkspaceQueryRunnerService.parseResult (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-query-runner/workspace-query-runner.service.js:279:80)
at WorkspaceQueryRunnerService.createMany (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-query-runner/workspace-query-runner.service.js:110:43)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async WorkspaceQueryRunnerService.createOne (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-query-runner/workspace-query-runner.service.js:127:25)
at async field.resolve (/app/node_modules/@envelop/on-resolve/cjs/index.js:36:42)
at async /app/node_modules/@envelop/core/cjs/orchestrator.js:383:27
at async YogaServer.getResultForParams (/app/node_modules/graphql-yoga/cjs/server.js:304:26)
at async YogaServer.handle (/app/node_modules/graphql-yoga/cjs/server.js:77:29) {
path: [ 'createDeal' ],
locations: [ [Object] ],
extensions: [Object: null prototype] {}
}
]
5 Replies
Skyfox675
Skyfox675OPβ€’6mo ago
Adding the query param of "depth=1" seems to have fixed this!
charles
charlesβ€’6mo ago
Yes! Under the hood, we are using postgres functions that cannot take more than 100 parameters by design. The graphql API enables you to be very specific about what you require, the REST API is querying a bit too much by design. Using depth parameter is the best way at the moment to avoid the issue Note that in the long term vision we won't have this restriction anymore (this is tied to the way postgres extension pg_graphql works)
Skyfox675
Skyfox675OPβ€’5mo ago
Sorry late to responding, thanks for confirming this! I actually just ran into it again tonight on the UI side after modifying the Company standard data model, so trying to think about how to move forward with metadata like properties on clients/customers
charles
charlesβ€’5mo ago
How many fields do you have on your company model?
Skyfox675
Skyfox675OPβ€’5mo ago
I'm going to say it was too many... It was overflowing the Data Model Edit list and needed to delete ~10 fields to see the last one again. I saw your advice in another thread of avoiding modifications to any Standard Objects since they can be changed by upgrades. So I think I have a plan to move forward and care an "Automations" object model that will hold metadata I need for queuing/triggering automations from changes within Twenty. πŸ™‚
Want results from more Discord servers?
Add your server