Prisma1: prisma playground command fails in combination with generate definitions

Created on 29 Sep 2018  Â·  10Comments  Â·  Source: prisma/prisma1

Describe the bug
prisma playground command fails if you use a .graphqlconfig.yml file in combination with the generate property in the prisma.yml file.

$ prisma playground
 â–¸    Cannot read property 'getProjects' of null

To Reproduce
Steps to reproduce the behavior:

  1. Create a complete new prisma project (prisma init > local docker)
  2. Create a GraphQL Config (graphql init)
  3. Optional: Move the files in the folder structure of the following screenshot
  4. Modify the file content of prisma.yml and .graphqlconfig.yml like below
  5. Execute prisma deploy
  6. Execute prisma playground
  7. See error
  8. If you remove the generate property from the prisma.yml and execute prisma playground again, it works but now you don't have generated files anymore

Screenshots
prisma-bug

Versions (please complete the following information):

  • OS: macOS Mojave
  • Prisma: 1.17.1

prisma.yml

endpoint: http://localhost:4466
datamodel: datamodel.prisma

generate:
  - generator: typescript-client
    output: ../src/generated/prisma
  - generator: graphql-schema
    output: ../src/generated/prisma

hooks:
  post-deploy:
    - prisma generate

.graphqlconfig.yml

projects:
  database:
    schemaPath: ./src/generated/prisma.graphql
    extensions:
      prisma: ./database/prisma.yml
bu2-confirmed

Most helpful comment

Update: for me, the problem was solved by running prisma playground from within /prisma and not from within the root directory.

All 10 comments

Until this is fixed, I make prisma deploy, then comment the generate part, then prisma playground, and do it again when I need to deploy.

I can confirm this bug.

@jide thanks for the workaround. Even the obvious ones may not seem obvious for some people.

@marktani is there an update on the issue?

Hi,

I can't reproduce this in the latest version of prisma cli: https://www.youtube.com/watch?v=wRSSwz8eWuA

Here is the code that I used: https://github.com/pantharshit00/prisma-issue-3215

cc @divyenduz

Thanks for the reproduction Harshit. I can confirm that even using the Prisma CLI version mentioned in the issue with Harshit's reproduction does not reproduce this issue.

divyendusingh [prisma-issue-3215]$ npx [email protected] generate
Generating schema 28ms
Saving Prisma Client (TypeScript) at /Users/divyendusingh/Documents/projects/graphcool/triage/prisma-issue-3215/generated/prisma

I will close this one for now. If the problem persists, please open a new issue with a reproduction. Thanks.

I'm not using a .graphqlconfig.yml file yet I still get this issue.

_prisma.yml_

endpoint: http://localhost:4466
datamodel: datamodel.prisma
secret: ***

generate:
  - generator: typescript-client
    output: ../src/generated/prisma-client/

hooks:
  post-deploy:
    - prisma generate

Folder structure

screenshot 2019-02-11 at 10 52 58

Edit: I'll create a new issue.

Update: for me, the problem was solved by running prisma playground from within /prisma and not from within the root directory.

Update: for me, the problem was solved by running prisma playground from within /prisma and not from within the root directory.

That solved my issue as well. thanks 😀

Update: for me, the problem was solved by running prisma playground from within /prisma and not from within the root directory.

Thanks! That solved it for me too

Thanks! Although it should be fixed properly. The problem is still happening. Just tested with the latest version 1.34.10.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thomaswright picture thomaswright  Â·  3Comments

akoenig picture akoenig  Â·  3Comments

sorenbs picture sorenbs  Â·  3Comments

marktani picture marktani  Â·  3Comments

notrab picture notrab  Â·  3Comments