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

<ModelName>CreateManySchema, data expects object and not array. #50

Closed
feelixe opened this issue Dec 1, 2022 · 0 comments · Fixed by #60
Closed

<ModelName>CreateManySchema, data expects object and not array. #50

feelixe opened this issue Dec 1, 2022 · 0 comments · Fixed by #60
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@feelixe
Copy link
Contributor

feelixe commented Dec 1, 2022

Bug description

When creating schemas for a model ("MyModel") the MyModelCreateManySchema schema will have a data property that points to the schema MyModelCreateManyInputObjectSchema.

MyModelCreateManyInputObjectSchema is defined to be an object with the model fields and not an array of objects.

As the name implies I'm expecting this to be the input that corresponds to the prisma model.createMany input. But they do not match since the zod-schema does not accept array of objects.

How to reproduce

  1. Create any Prisma model.
  2. Generate schemas.
  3. Look in generated/schemas/createMany<modelname>.schema.ts and generated/schemas/objects/<modelname>CreateManyInput.schema

Expected behavior

<modelname>CreateManyInputObjectSchema should be a schema for an array of objects of type

Prisma information

Not specific for my schema will be same for any.

Environment & setup

  • OS: Windows
  • Database: Postgres
  • Node.js version: 18.12.1

Prisma Version

4.7.0
@omar-dulaimi omar-dulaimi added bug Something isn't working good first issue Good for newcomers labels Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants