whoamiW
Convex Community3y ago
5 replies
whoami

Usage in Python client

Is there any detailed example/demo on python client? How do I pass Id<Chat> in python client?

This is my function definition under convex/ask.ts
export const insert = mutationz(
  {
    chat: zconvex.id('chat'),
    content: z.string().nonempty().max(256),
  },
...


and I was trying to call it in Python via
convex_client.mutation('ask:insert', {'chat': {'tableName': 'chat', 'id': '...'}, 'content': '...'})

but got no luck

Uncaught ZodError: [
  {
    "code": "invalid_arguments",
    "argumentsError": {
      "issues": [
        {
          "code": "custom",
          "fatal": true,
          "path": [
            0,
            "chat"
          ],
          "message": "Invalid input"
        }
      ],
      "name": "ZodError"
    },
    "path": [],
    "message": "Invalid function arguments"
  }
]
Was this page helpful?