meteor-graphql icon indicating copy to clipboard operation
meteor-graphql copied to clipboard

graphql file can't contain only import statements

Open macrozone opened this issue 7 years ago • 1 comments

if i have a file typeDefs.graphql which contains

#import "./Query.graphql"
#import "./Mutation.graphql"
#import "./User.graphql"

then i get this error:

imports/api/graphql/typeDefs.graphql:3:25: Syntax Error: Unexpected <EOF>

workaround is to add a dummy type at the end:

#import "./Query.graphql"
#import "./Mutation.graphql"
#import "./User.graphql"


type Test {
  test: Boolean
}

macrozone avatar Feb 20 '18 09:02 macrozone

@macrozone, thanks for reporting this. Appearantly this is how it's implemented in https://github.com/apollographql/graphql-tag. That's the package I'm using under the hood. If you would like to see this changes, please report it there and I'll make sure this package get's updated once it's implemented.

Cheers

jamiter avatar Feb 21 '18 12:02 jamiter