Skip to content
New issue

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

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

Already on GitHub? # to your account

Non existent query in .graphql file imported in JS goes through compilation without any error #94

Open
ajayjindal opened this issue Aug 26, 2022 · 0 comments

Comments

@ajayjindal
Copy link

Hello all,
I am in need of help as we are facing discrepancy with graphql usage in reactJS, which slipped through without any compilation error and caused a runtime production issue.

scenario:

abc.graphql

query getItems(
  $uniqueId: ID!
) {
  ...
}

in my ReactJS app:
xyz.js

import {
  getFewItems,
} from './abc.graphql';

The Problem

The issue is getFewItems query does not exist in my graphql file and i am using it in my JS files, there is no error while compiling or in vscode editor, issue will occur only on runtime.

ideally we would want a behaviour of linting this missing-export in graphql file imports itself while developing and in ci compilation.
we are using the babel plugin correctly as mentioned in docs along with webpack( graphql-tag/loader ) one as well , but they doesn’t throw any error.

Would be grateful for any help on how we can achieve this behaviour.
Thanks, Ajay

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

No branches or pull requests

1 participant