Last active
November 1, 2021 12:52
-
-
Save mogelbrod/9c1659e5108db6ca3678f0286d2b327e to your computer and use it in GitHub Desktop.
[@graphql-eslint] Specifying schema via HTTP + local graphql file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
root: true, | |
overrides: [ | |
{ | |
files: ['*.graphql'], | |
plugins: ['@graphql-eslint'], | |
parser: '@graphql-eslint/eslint-plugin', | |
parserOptions: { | |
operations: './query.graphql', | |
}, | |
extends: 'plugin:@graphql-eslint/recommended', | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schema: | |
- "https://rickandmortyapi.com/graphql" | |
# - schema.graphql | |
- schema-extensions.graphql | |
documents: "query.graphql" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query Basic { | |
clientOnly @client | |
characters(page: 0) { | |
info { count } | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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