Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Can't create record with Json #680

Closed
timsuchanek opened this issue May 6, 2020 · 2 comments
Closed

Can't create record with Json #680

timsuchanek opened this issue May 6, 2020 · 2 comments
Assignees
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug. tech/typescript Issue for tech TypeScript.
Milestone

Comments

@timsuchanek
Copy link
Contributor

Schema

model User {
  id      Int      @default(autoincrement()) @id
  email   String   @unique
  name    String?
  json    Json?
}

Client call

  const user = await client.user.create({
    data: {
      email: 'a@a.de',
      json: {
        hello: 'world',
      },
      name: 'Bob',
    },
  })

Error

Error parsing GraphQL query: query parse error: Parse error at 5:7
Unexpected `"hello"[StringValue]`
Expected `Name`, `:` or `}`
@timsuchanek timsuchanek added bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug. tech/typescript Issue for tech TypeScript. labels May 6, 2020
@timsuchanek timsuchanek added this to the Beta 5 milestone May 6, 2020
@timsuchanek timsuchanek self-assigned this May 6, 2020
@aguilera51284
Copy link

this issue has fixed?

@pantharshit00
Copy link
Contributor

@aguilera51284 Yes, you can try out the fix in the alpha release npm install @prisma/cli@alpha @prisma/client@alpha && npx @prisma/cli@alpha generate

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug. tech/typescript Issue for tech TypeScript.
Projects
None yet
Development

No branches or pull requests

3 participants