Skip to content

TypesScript: Literal 'count' missing in type PrismaAction #4411

@jgo80

Description

@jgo80

Bug description

TypesScript: Literal count missing in type PrismaAction

How to reproduce

Look into type definition of Prisma Client:

  export type PrismaAction =
    | 'findUnique'
    | 'findMany'
    | 'findFirst'
    | 'create'
    | 'update'
    | 'updateMany'
    | 'upsert'
    | 'delete'
    | 'deleteMany'
    | 'executeRaw'
    | 'queryRaw'
    | 'aggregate'

Expected behavior

I'm writing a comprehensive Prisma Middleware including the action 'count', which throws me the TypeScript problem Type '"count"' is not assignable to type 'PrismaAction'.ts(2322)

Environment & setup

  • OS: Mac OS
  • Database: PostgreSQL
  • Node.js version: v15.2.0
  • Prisma version:
@prisma/cli          : 2.12.0
@prisma/client       : 2.12.0
Current platform     : darwin
Query Engine         : query-engine cf0680a1bfe8d5e743dc659cc7f08009f9587d58 (at ../../../../node_modules/@prisma/engines/query-engine-darwin)
Migration Engine     : migration-engine-cli cf0680a1bfe8d5e743dc659cc7f08009f9587d58 (at ../../../../node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core cf0680a1bfe8d5e743dc659cc7f08009f9587d58 (at ../../../../node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary        : prisma-fmt cf0680a1bfe8d5e743dc659cc7f08009f9587d58 (at ../../../../node_modules/@prisma/engines/prisma-fmt-darwin)
Studio               : 0.322.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug/2-confirmedBug has been reproduced and confirmed.kind/bugA reported bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions