Prettier throws error for graphql files with only imports/comments #6145
Labels
lang:graphql
Issues affecting GraphQL
status:needs discussion
Issues needing discussion and a decision to be made before action can be taken
Prettier 1.17.1
Playground link
Input:
Output:
Expected behavior:
I use imports in graphql files for my index.graphql files to import all my named type definiton files. This is valid syntax.
Actual behavior:
If the file only has imports and no defined queries or type definitions like below:
Prettier throws an error:
SyntaxError: Syntax Error: Unexpected <EOF>
I just added all my index.graphql files to my prettier ignore to allow my app to run (it was breaking my CI/CD) but it's sad that I lose all the formatting benefits for those files.
The text was updated successfully, but these errors were encountered: