Skip to content

Instantly share code, notes, and snippets.

@mogelbrod
Last active November 1, 2021 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mogelbrod/9c1659e5108db6ca3678f0286d2b327e to your computer and use it in GitHub Desktop.
Save mogelbrod/9c1659e5108db6ca3678f0286d2b327e to your computer and use it in GitHub Desktop.
[@graphql-eslint] Specifying schema via HTTP + local graphql file
module.exports = {
root: true,
overrides: [
{
files: ['*.graphql'],
plugins: ['@graphql-eslint'],
parser: '@graphql-eslint/eslint-plugin',
parserOptions: {
operations: './query.graphql',
},
extends: 'plugin:@graphql-eslint/recommended',
}
]
}
schema:
- "https://rickandmortyapi.com/graphql"
# - schema.graphql
- schema-extensions.graphql
documents: "query.graphql"
{
"name": "temp",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@graphql-eslint/eslint-plugin": "^2.3.2",
"eslint": "^8.1.0",
"graphql": "^15.7.2"
}
}
query Basic {
clientOnly @client
characters(page: 0) {
info { count }
}
}
directive @client on FIELD
extend type Query {
clientOnly: ID
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment