Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Class 'Prisma' incorrectly extends base class 'Prisma'. #2002

Closed
iamclaytonray opened this issue Mar 1, 2018 · 7 comments
Closed

Class 'Prisma' incorrectly extends base class 'Prisma'. #2002

iamclaytonray opened this issue Mar 1, 2018 · 7 comments
Labels
bug/0-needs-info More information is needed for reproduction.

Comments

@iamclaytonray
Copy link
Contributor

iamclaytonray commented Mar 1, 2018

Bug Report

Current behavior
After trying to compile typescript, I get the following error:

src/generated/prisma.ts(6790,14): error TS2415: Class 'Prisma' incorrectly extends base class 'Prisma'.
  Types of property 'query' are incompatible.
    Type 'Query' is not assignable to type 'QueryMap'.
      Index signature is missing in type 'Query'.

Reproduction

If your problem can be reproduced with a certain service definition, please create a new GitHub repository with the reproduction instructions.

You can reproduce this issue by deploying a Prisma API and visiting generated/prisma.ts. The issue is found near the bottom. IE:

// Error here
public query: Query = {
  // etc, not relevant
}

When hovering over query, due to red underline, this is the error notice:

Property 'query' in type 'Prisma' is not assignable to the same property in base type 'Prisma'.
  Type 'Query' is not assignable to type 'QueryMap'.
    Index signature is missing in type 'Query'.

More on repro later

Expected behavior?
Types should play nicely again. We're all friends. Let's all just be friendly.

@marktani
Copy link
Contributor

marktani commented Mar 2, 2018

How can I reproduce this?

@marktani marktani added the bug/0-needs-info More information is needed for reproduction. label Mar 2, 2018
@iamclaytonray
Copy link
Contributor Author

Sorry man. I'll try to have an isolated repro today

@marktani
Copy link
Contributor

marktani commented Mar 2, 2018

Thanks! 😄

@marktani marktani changed the title Bug: Class 'Prisma' incorrectly extends base class 'Prisma'. Class 'Prisma' incorrectly extends base class 'Prisma'. Mar 3, 2018
@SpaceK33z
Copy link
Contributor

I got the same error and made an example repository: SpaceK33z/prisma-typescript-error.

A workaround for now is to disable strictFunctionTypes in your tsconfig.json.

@kbrandwijk
Copy link
Contributor

kbrandwijk commented Mar 9, 2018

This seems to have something to do with a change in prisma-binding or graphql-binding not properly propagated into the static binding generators. Either way, this should be moved to https://github.com/graphql-binding/graphql-static-binding.

@marktani
Copy link
Contributor

marktani commented Mar 9, 2018

Thank you all, I reported the issue here: graphql-binding/graphql-static-binding#69.

@marktani marktani closed this as completed Mar 9, 2018
@tbrannam
Copy link

tbrannam commented May 2, 2018

odd, strictFunctionTypes: false doesn't seem to mask this issue for me.

@pantharshit00 pantharshit00 added the bug/0-needs-info More information is needed for reproduction. label Jan 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/0-needs-info More information is needed for reproduction.
Projects
None yet
Development

No branches or pull requests

6 participants