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

Prisma DMMF JsonFilter input has no fields #689

@MichalLytek

Description

@MichalLytek

Bug description

When I have really simple model:

model Post {
  uuid      String    @default(uuid()) @id
  title     String
  metadata  Json
}

For filter input types, for fields of type Json, it emits JsonFilter object type as field input type:

{
  "name": "PostScalarWhereInput",
  "fields": [
    {
      "name": "title",
      "inputType": [
        {
          "isList": false,
          "isRequired": false,
          "kind": "scalar",
          "type": "String"
        },
        {
          "type": "StringFilter",
          "isList": false,
          "isRequired": false,
          "kind": "object"
        }
      ],
      "isRelationFilter": false
    },
    {
      "name": "metadata",
      "inputType": [
        {
          "isList": false,
          "isRequired": false,
          "kind": "scalar",
          "type": "Json"
        },
        {
          "type": "JsonFilter",
          "isList": false,
          "isRequired": false,
          "kind": "object"
        }
      ],
      "isRelationFilter": false
    }
  ],
  "isWhereType": true,
  "atLeastOne": false
}

But the generated JsonFilter type has no fields which results in empty input type class generated by TypeGraphQL integration:

{
  "name": "JsonFilter",
  "fields": [],
  "atLeastOne": false
}

Environment & setup

  • OS: [e.g. Mac OS, Windows, Debian, CentOS, ...] Windows 10 x64
  • Database: [PostgreSQL, MySQL, MariaDB or SQLite] Postgres
  • Prisma version: [Run prisma -v to see your Prisma version] 2.0.0-beta.5
  • Node.js version: [Run node -v to see your Node.js version] 13.12
@prisma/cli          : 2.0.0-beta.5
Current platform     : windows
Query Engine         : query-engine 0c2ec197653b278b2978845ef958db88824cd82e (at D:\#Projekty\typegraphql-prisma\experiments\node_modules\@prisma\cli\query-engine-windows.exe)
Migration Engine     : migration-engine-cli 0c2ec197653b278b2978845ef958db88824cd82e (at D:\#Projekty\typegraphql-prisma\experiments\node_modules\@prisma\cli\migration-engine-windows.exe)
Introspection Engine : introspection-core 0c2ec197653b278b2978845ef958db88824cd82e (at D:\#Projekty\typegraphql-prisma\experiments\node_modules\@prisma\cli\introspection-engine-windows.exe)
Format Binary        : prisma-fmt 0c2ec197653b278b2978845ef958db88824cd82e (at D:\#Projekty\typegraphql-prisma\experiments\node_modules\@prisma\cli\prisma-fmt-windows.exe)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions