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

Bug with `import` when using default export and there is a space before `import` and after `#`

Open dimaMachina opened this issue 3 years ago • 0 comments

Describe the bug

When using default export import comment like this #import "./ProfileForm.graphql" works perfectly fine, but when we add a space before import and after # there is an error:

Error: 
    Import statement is not valid:
    >  import "./ProfileForm.graphql"
    If you want to have comments starting with '# import', please use ''' instead!
    You can only have 'import' statements in the following pattern;
    # import [Type].[Field] from [File]

To Reproduce Steps to reproduce the behavior:

Related to https://github.com/dotansimha/graphql-eslint/issues/472#issuecomment-894253913

  • Clone the repo and modify file src/UserProfileScreen.graphql change line #import "./ProfileForm.graphql" to # import "./ProfileForm.graphql"
  • Use @graphql-eslint/[email protected] that uses latest version of @graphql-tools/import package
  • yarn
  • yarn lint

Environment:

  • @graphql-tools/import: 6.6.1

dimaMachina avatar Nov 07 '21 13:11 dimaMachina