Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require-import-fragment quick fix is not compatible w/ Webpack loader + Jest transform #1837

Open
1 of 4 tasks
grxy opened this issue Aug 24, 2023 · 1 comment
Open
1 of 4 tasks

Comments

@grxy
Copy link

grxy commented Aug 24, 2023

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

  • 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox

Example

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

The quick fix for require-import-fragment creates an import that doesn't work w/ graphql-tag/loader or jest-transform-graphql out of the box.

To Reproduce Steps to reproduce the behavior:

  1. Reference a fragment in a .graphql file.
  2. Run the eslint quick fix on that .graphql file.

Expected behavior

The following import is added:

#import './0-file-with-fragment.graphql'
  1. No MyFragment import
  2. No space after the # character
  3. Path includes ./ when in same directory

Actual behavior

The following import is added:

# import MyFragment from '0-file-with-fragment.graphql'

Environment:

  • OS: macOS 13.5.1
  • @graphql-eslint/eslint-plugin: 3.20.1
  • Node.js: v18.12.1

Additional context

N/A

@frimmy
Copy link

frimmy commented Apr 9, 2024

++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants