Prisma1: Go client doesn't generate queries for @scalarList(strategy: RELATION)

Created on 27 Apr 2019  路  10Comments  路  Source: prisma/prisma1

Describe the bug

Using an enum array with the directive @scalarList(strategy: RELATION) doesn't provide a way to query based on the content of the array.

To Reproduce
Steps to reproduce the behavior:

  1. Generate a go client using the following schema
type Example {
  id: UUID! @id
  createdAt: DateTime! @createdAt
  updatedAt: DateTime! @updatedAt
  enumList: [Platform!] @scalarList(strategy: RELATION)
}

enum Platform {
  IOS
  ANDROID
  WEB
}

  1. Try to get all the Examples back with IOS as a platform.
    > It should probably be something like this:
    > go > client.Example( > &prisma.ExampleParams{ > Where: &prisma.ExampleWhereInput{ > # No enumList option here > }, > }).Exec(ctx) >

Expected behavior
To have a way to execute a where statement with a list of the enum values.

Versions (please complete the following information):

  • Connector: Postgres
  • Prisma Server: 1.31
  • prisma CLI: prisma/1.31.1 (darwin-x64) node-v10.15.2
  • OS: OS X High Sierra
  • other dependencies: go-prisma-client
bu0-needs-info statustale arecliengo kinbug

Most helpful comment

This is true for javascript as well, The Yoga schema has the queries, but prisma does not, this creates an explosion of relation tables being created. Please fix this!

All 10 comments

Relate to my issue: https://github.com/prisma/prisma/issues/4454.
I really need this feature.
To fix this issue temporarily, I think I have to create a new type that contains all enum values

type EnumValues {
id: ID! @id
value: Platform! @unique
}

type Example {
  id: UUID! @id
  createdAt: DateTime! @createdAt
  updatedAt: DateTime! @updatedAt
  enumList: [EnumValues!] @relation(link: TABLE, name: "enum-list")
}

Just my idea, not sure it will work or not.

It looks indeed related to your issue. This is a possible workaround but you lose the benefit of having an enum

This is true for javascript as well, The Yoga schema has the queries, but prisma does not, this creates an explosion of relation tables being created. Please fix this!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

This is still an issue that affects the golang client (and apparently the js client, according to https://github.com/prisma/prisma/issues/4463#issuecomment-490141152 ) so I don't think it should be closed

Ran into the same issue today, not seeing the queries in the generated/prisma.graphql file.

I've just come across this issue too using Prisma 1.34.1 and the Typescript client.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

Echoing @alexdor: This is still an issue that affects the golang client (and apparently the js client, according to #4463 (comment) ) so I don't think it should be closed

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MitkoTschimev picture MitkoTschimev  路  3Comments

marktani picture marktani  路  3Comments

ragnorc picture ragnorc  路  3Comments

tbrannam picture tbrannam  路  3Comments

schickling picture schickling  路  3Comments