prisma / prisma1

💾 Database Tools incl. ORM, Migrations and Admin UI (Postgres, MySQL & MongoDB) [deprecated]
https://v1.prisma.io/docs/
Apache License 2.0
16.55k stars 863 forks source link

Recently introduced @module directive breaks latest stable CLI version #865

Closed kbrandwijk closed 6 years ago

kbrandwijk commented 6 years ago

What is the current behavior? You can't create a project anymore using the latest stable CLI version (1.3.7). Error:

The schema is invalid:
  The model `User` is missing the @model directive. Please add it.

Because of the error, the local files are not saved, so it's not possible to work around this by changing the schema locally.

Please share the relevant part of your project (GraphQL schema, functions, permissions, ...) for easier reproduction In an empty folder, run graphcool init.

What is the expected behavior? You should still be able to create a new project using the latest stable CLI version, so the server should still be able to deal with schemas containing implements Node. The @module change cannot be breaking, until the current CLI beta goes stable.

alassiter commented 6 years ago

A workaround I used tonight, is to create a something.graphql file and give it a basic schema with the @model directive.

In my case, I'm going through the tutorial so my .graphql file looked like this:

type Link @model {
  id: ID! @isUnique
  createdAt: DateTime!
  updatedAt: DateTime!
  url: String!
  description: String!
}

Then I ran graphcool init --schema something.graphql --name Hackernews and it was able to create the project.graphcool file so that I could continue with the tutorial.

kbrandwijk commented 6 years ago

As far as I know, the Framework is no longer in preview, and 1.3.7 is no longer the latest stable version, so this issue is probably outdated now.

alassiter commented 6 years ago

@kbrandwijk I just tried graphcool init in a new directory. While it doesn't create the error, the resulting project.graphcool file doesn't contain the @model next to the Type. If I pull, it replaces my project.graphcool with a correct version.

That may be by design, just following up on this issue. Thanks!

kbrandwijk commented 6 years ago

@alassiter Which graphcool version are you using?

alassiter commented 6 years ago

it says 1.3.7 when i run graphcool version

kbrandwijk commented 6 years ago

Outdated, because the latest version of the CLI now also works with @model only.