You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The shareable config can be customized in your [**eslint** configuration file](https://eslint.org/docs/user-guide/configuring).
28
+
## Processing
29
+
30
+
### Embedded GraphQL
23
31
24
-
Additionally don’t forget to have `.graphqlconfig` file:
32
+
The config includes a processor that validates GraphQL code embedded in JavaScript/TypeScript template literals. Tag your GraphQL with `gql` or `graphql` to enable processing:
25
33
26
-
```json
27
-
{
28
-
// ...
29
-
"schemaPath": "schema.json"
30
-
// ...
31
-
}
34
+
```js
35
+
// ✅ Valid - will be linted
36
+
constquery=gql`
37
+
queryGetUser($id: ID!) {
38
+
user(id: $id) {
39
+
id
40
+
name
41
+
}
42
+
}
43
+
`;
44
+
45
+
// ✅ Valid - graphql tag also works
46
+
constmutation= graphql`
47
+
mutation CreateUser($name: String!) {
48
+
createUser(name: $name) {
49
+
id
50
+
}
51
+
}
52
+
`;
32
53
```
33
54
55
+
### `.graphql` Files
56
+
57
+
The config also validates standalone `.graphql` schema and query files.
0 commit comments