Go client doesn't generate queries for @scalarList(strategy: RELATION)
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:
- 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
}
- Try to get all the Examples back with IOS as a platform.
It should probably be something like this:
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
prismaCLI: prisma/1.31.1 (darwin-x64) node-v10.15.2- OS: OS X High Sierra
- other dependencies: go-prisma-client
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.