Setting up *.js
files containing gql
template strings
#986
-
The configuration seems pretty straightforward for this, but I'm getting errors when running Here's my {
"parser": "@babel/eslint-parser",
"plugins": ["class-property", "import"],
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module",
"ecmaFeatures": {
"experimentalObjectRestSpread": true
},
"operations": "./src/**/*.js"
},
"overrides": [
{
"files": ["*.js"],
"processor": "@graphql-eslint/graphql"
},
{
"files": ["*.graphql"],
"extends": "plugin:@graphql-eslint/schema-recommended"
}
],
...
} I also tried without the recommended rule set as shown in the README: {
"files": ["*.graphql"],
"parser": "@graphql-eslint/eslint-plugin",
"plugins": ["@graphql-eslint"],
"rules": {
"@graphql-eslint/known-type-names": "error"
}
} All GraphQL is defined in
It finds all the correct files, but it cannot find any types within.
Each file has the same error. Here's an example import { gql } from 'apollo-server-express'
export default gql`
type Company {
id: ID!
name: String!
...
}
...
} I would greatly appreciate any help or pointers. I assume I'm missing something basic. I've tried adding Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, could you create a reproduction repo? |
Beta Was this translation helpful? Give feedback.
Hi, could you create a reproduction repo?