@takeshape/graphql-validate
Advanced tools
Comparing version 0.2.0 to 1.0.0
@@ -9,25 +9,43 @@ #!/usr/bin/env node | ||
Usage | ||
$ next-auth-all-access generate-keys <flags> | ||
$ graphql-validate <flags> | ||
Options | ||
--jwks-path The path to write your jwks.json file to, defaults to './keys/jwks.json' | ||
--help Show this help | ||
--version Show the version | ||
-c, --config Path to GraphQL codegen YAML config file, | ||
defaults to a valid graphql-config file | ||
--schema Point to a schema | ||
--documents Point to documents | ||
-d, --deprecated Fail on deprecated usage | ||
--no-strict-fragments Do not fail on duplicated fragment names | ||
-m, --max-depth Fail on deep operations | ||
--apollo Support Apollo directives | ||
--keep-client-fields Keeps the fields with @client, but removes | ||
@client directive from them | ||
-f, --filter Show results only from a list of files (or file) | ||
-i, --ignore Ignore and do not load these files (supports glob) | ||
--only-errors Show only errors | ||
--realtive-paths Show relative paths | ||
-s, --silent Do not print results | ||
-o, --output Output JSON file | ||
`, | ||
{ | ||
allowUnknownFlags: false, | ||
importMeta: import.meta, | ||
input: [ | ||
'generate-keys', | ||
], | ||
inferType: true, | ||
flags: { | ||
config: { | ||
type: 'string', | ||
alias: 'c', | ||
}, | ||
schema: { | ||
describe: 'Point to a schema', | ||
type: 'string', | ||
alias: 's', | ||
}, | ||
documents: { | ||
describe: 'Point to documents', | ||
type: 'string', | ||
alias: 'd', | ||
}, | ||
deprecated: { | ||
alias: 'd', | ||
describe: 'Fail on deprecated usage', | ||
type: 'boolean', | ||
@@ -37,3 +55,2 @@ default: false, | ||
noStrictFragments: { | ||
describe: 'Do not fail on duplicated fragment names', | ||
type: 'boolean', | ||
@@ -43,7 +60,6 @@ default: false, | ||
maxDepth: { | ||
describe: 'Fail on deep operations', | ||
type: 'number', | ||
alias: 'm', | ||
}, | ||
apollo: { | ||
describe: 'Support Apollo directives', | ||
type: 'boolean', | ||
@@ -53,3 +69,2 @@ default: false, | ||
keepClientFields: { | ||
describe: 'Keeps the fields with @client, but removes @client directive from them', | ||
type: 'boolean', | ||
@@ -59,13 +74,10 @@ default: false, | ||
filter: { | ||
describe: 'Show results only from a list of files (or file)', | ||
array: true, | ||
type: 'string', | ||
alias: 'f', | ||
}, | ||
ignore: { | ||
describe: 'Ignore and do not load these files (supports glob)', | ||
array: true, | ||
type: 'string', | ||
alias: 'i', | ||
}, | ||
onlyErrors: { | ||
describe: 'Show only errors', | ||
type: 'boolean', | ||
@@ -75,3 +87,2 @@ default: false, | ||
relativePaths: { | ||
describe: 'Show relative paths', | ||
type: 'boolean', | ||
@@ -81,9 +92,9 @@ default: false, | ||
silent: { | ||
describe: 'Do not print results', | ||
type: 'boolean', | ||
default: false, | ||
alias: 's', | ||
}, | ||
output: { | ||
describe: 'Output JSON file', | ||
type: 'string', | ||
alias: 'o', | ||
}, | ||
@@ -90,0 +101,0 @@ }, |
@@ -19,2 +19,3 @@ import { Source as DocumentSource } from '@graphql-tools/utils'; | ||
declare type Args = { | ||
config?: string; | ||
schema?: string; | ||
@@ -21,0 +22,0 @@ documents?: string; |
import { writeFileSync } from 'fs'; | ||
import { print, Source } from 'graphql'; | ||
import { loadConfig } from 'graphql-config'; | ||
import { relative } from 'path'; | ||
import path, { relative } from 'path'; | ||
import { parseGlobalArgs } from './commands.js'; | ||
@@ -77,3 +77,5 @@ import { validate as validateDocuments } from './core.js'; | ||
export default async function validate(args) { | ||
const filepath = args.config && path.resolve(args.config); | ||
const config = await loadConfig({ | ||
filepath, | ||
rootDir: process.cwd(), | ||
@@ -80,0 +82,0 @@ throwOnEmpty: true, |
{ | ||
"name": "@takeshape/graphql-validate", | ||
"version": "0.2.0", | ||
"version": "1.0.0", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "graphql", |
@@ -15,3 +15,3 @@ # graphql-validate | ||
``` | ||
$ npm add @takeshape/graphql-validate | ||
$ npm add @takeshape/graphql-validate -D | ||
``` | ||
@@ -41,4 +41,6 @@ | ||
This supports all the `graphql-cli` options. You can review the code | ||
[here](./bin/graphql-validate.js). | ||
``` | ||
$ graphql-validate --help | ||
``` | ||
> This supports all the `graphql-cli` options. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
34087
859
1
45