-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Internal GraphQL schema marks JsonFilter types as DateTime #9117
Comments
Can you share a simple Prisma schema @RobertCraigie please we can use to reproduce this? Thanks. |
@janpio here's the schema I used to test it. datasource db {
provider = "postgres"
url = env("POSTGRES_URL")
}
generator db {
provider = "prisma-client-py"
previewFeatures = ["filterJson"]
}
model User {
id String @id @default(cuid())
created_at DateTime @default(now())
updated_at DateTime @updatedAt
name String
meta Json
} However, it will fail to generate as Prisma Client Python doesn't support |
I thought you were talking about the generated types of Prisma Client JS, but those looks just right to me: export type JsonFilter =
| PatchUndefined<
Either<Required<JsonFilterBase>, Exclude<keyof Required<JsonFilterBase>, 'path'>>,
Required<JsonFilterBase>
>
| OptionalFlat<Omit<Required<JsonFilterBase>, 'path'>>
export type JsonFilterBase = {
equals?: InputJsonValue
not?: InputJsonValue
}
[...]
export type JsonWithAggregatesFilterBase = {
equals?: InputJsonValue
not?: InputJsonValue
_count?: NestedIntFilter
/**
* @deprecated since 2.23 because Aggregation keywords got unified to use underscore as prefix to prevent field clashes.
*
**/
count?: NestedIntFilter
_min?: NestedJsonFilter
/**
* @deprecated since 2.23 because Aggregation keywords got unified to use underscore as prefix to prevent field clashes.
*
**/
min?: NestedJsonFilter
_max?: NestedJsonFilter
/**
* @deprecated since 2.23 because Aggregation keywords got unified to use underscore as prefix to prevent field clashes.
*
**/
max?: NestedJsonFilter
} (This is from a recent Can you clarify where I should look for this? |
Oh no sorry, I meant the query engine API, I didn't test whether or not it actually works, just that the generated API schema has the types as DateTime instead of JSON or String. I found it in the GraphQL playground. |
Ah ok, one level deeper then. We usually treat this as an internal implementation detail - if there is something weird, we will of course still look at it. |
prisma/prisma-engines#2152 got merged that should fix it 👍 |
Discussed in #9116
Originally posted by RobertCraigie September 3, 2021
While looking into adding support for
Json
types to https://github.com/RobertCraigie/prisma-client-py I looked through the generated GraphQL schema and noticed that theJsonFilter
type takes values ofDateTime
type, I would've expected to see eitherJson
orString
. Should be noted that this happens with and without the preview feature enabled.Just curious as to whether or not this is intentional.
The text was updated successfully, but these errors were encountered: