gqlify icon indicating copy to clipboard operation
gqlify copied to clipboard

Datamodel types without scalar fields break GQLify generation

Open alexandrethsilva opened this issue 6 years ago • 0 comments

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:

  1. Create a data model type without scalar fields, eg:
type Foo {
  bar: Bar
}
  1. Run generator
  2. See error
return new _GraphQLError.GraphQLError(
       ^
Syntax Error: Expected Name, found }

GraphQL request (1:37)
1: input UserSubscriptionsCreateInput {}

Expected behavior No error when running the generation.

Desktop

  • OS: OS X
  • OS version: 10.14.3 Beta (18D32a)
  • GQLify package versions: @gqlify/firestore: 3.1.0, @gqlify/server: 3.1.2,

Additional context This is exactly the same issue that is happening with Prisma on this issue, so I'm kinda copy/pasting it here.

alexandrethsilva avatar Mar 09 '19 17:03 alexandrethsilva