Describe the bug
When creating a data model type without any scalar fields (ie. only relation fields), code generation breaks.
To Reproduce
Steps to reproduce the behavior:
type Foobar {
user: User
}
prisma generate$ yarn prisma generate
yarn run v1.10.1
$ /Users/sp/dev/temp/prisma-bug/node_modules/.bin/prisma generate
Generating schema 49ms
â–¸ Syntax Error: Expected Name, found }
Get in touch if you need help: https://www.prisma.io/forum/
To get more detailed output, run $ export DEBUG="*"
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Expected behavior
No error running the generate command.
Versions:
prisma CLI: prisma/1.20.1 (darwin-x64) node-v10.10.0Additional context
Seems like prisma generates an empty input type in this case:
input FoobarUpdateManyMutationInput {
}
and the graphql parser doesn't like that.
Had the same issue with 1.20.1. Rolled back to 1.19.3 because of this.
Previous Issues mentioning similar errors:
I'm having the same issue rolled back to 1.20.0 and it worked
Can confirm what @guatedude2 said, can't generate types without scalar fields with [email protected], works after rolling back to 1.20.0.
This is fixed in 1.20.5. Please let us know if that is not the case and we'll reopen it!
I have same issue with version 1.21.0. I thought that should work after fix in 1.20.5 @timsuchanek
yarn prisma generate with following datamodel works fine:
type FeatureSet implements Node {
id: ID! @unique
key: String!
featureList: [Feature!]!
}
type Feature implements Node{
id: ID! @unique
temp: String!
featureSetList: [FeatureSet!]!
}
While one where temp attribute is excluded have the same issue as describe above.
type FeatureSet implements Node {
id: ID! @unique
key: String!
featureList: [Feature!]!
}
type Feature implements Node{
id: ID! @unique
featureSetList: [FeatureSet!]!
}
Most helpful comment
Had the same issue with 1.20.1. Rolled back to 1.19.3 because of this.
Previous Issues mentioning similar errors: