@graphql-inspector/validate-command
Advanced tools
Comparing version 0.0.0-canary.57e2caa to 0.0.0-canary.9cf9b2c
@@ -11,3 +11,3 @@ 'use strict'; | ||
return { | ||
command: 'validate [documents] [schema]', | ||
command: 'validate <documents> <schema>', | ||
describe: 'Validate Fragments and Operations', | ||
@@ -19,2 +19,3 @@ builder(yargs) { | ||
type: 'string', | ||
demandOption: true, | ||
}) | ||
@@ -24,2 +25,3 @@ .positional('documents', { | ||
type: 'string', | ||
demandOption: true, | ||
}) | ||
@@ -33,7 +35,2 @@ .options({ | ||
}, | ||
c: { | ||
alias: 'config', | ||
describe: 'Use GraphQL Config to find schema and documents', | ||
type: 'boolean', | ||
}, | ||
noStrictFragments: { | ||
@@ -62,13 +59,9 @@ describe: 'Do not fail on duplicated fragment names', | ||
return tslib.__awaiter(this, void 0, void 0, function* () { | ||
const { loaders, pickPointers } = api; | ||
const { loaders } = api; | ||
const { headers, token } = commands.parseGlobalArgs(args); | ||
const pointer = yield pickPointers(args, { | ||
schema: true, | ||
documents: true, | ||
}); | ||
const schema = yield loaders.loadSchema(pointer.schema, { | ||
const schema = yield loaders.loadSchema(args.schema, { | ||
headers, | ||
token, | ||
}); | ||
const documents = yield loaders.loadDocuments(pointer.documents); | ||
const documents = yield loaders.loadDocuments(args.documents); | ||
const invalidDocuments = core.validate(schema, documents.map((doc) => new graphql.Source(graphql.print(doc.document), doc.location)), { | ||
@@ -75,0 +68,0 @@ strictFragments: !args.noStrictFragments, |
import { GlobalArgs } from '@graphql-inspector/commands'; | ||
declare const _default: import("../../commands/src").CommandFactory<{}, { | ||
schema?: string | undefined; | ||
documents?: string | undefined; | ||
schema: string; | ||
documents: string; | ||
deprecated?: boolean | undefined; | ||
@@ -6,0 +6,0 @@ noStrictFragments: boolean; |
@@ -9,3 +9,3 @@ import { __awaiter } from 'tslib'; | ||
return { | ||
command: 'validate [documents] [schema]', | ||
command: 'validate <documents> <schema>', | ||
describe: 'Validate Fragments and Operations', | ||
@@ -17,2 +17,3 @@ builder(yargs) { | ||
type: 'string', | ||
demandOption: true, | ||
}) | ||
@@ -22,2 +23,3 @@ .positional('documents', { | ||
type: 'string', | ||
demandOption: true, | ||
}) | ||
@@ -31,7 +33,2 @@ .options({ | ||
}, | ||
c: { | ||
alias: 'config', | ||
describe: 'Use GraphQL Config to find schema and documents', | ||
type: 'boolean', | ||
}, | ||
noStrictFragments: { | ||
@@ -60,13 +57,9 @@ describe: 'Do not fail on duplicated fragment names', | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { loaders, pickPointers } = api; | ||
const { loaders } = api; | ||
const { headers, token } = parseGlobalArgs(args); | ||
const pointer = yield pickPointers(args, { | ||
schema: true, | ||
documents: true, | ||
}); | ||
const schema = yield loaders.loadSchema(pointer.schema, { | ||
const schema = yield loaders.loadSchema(args.schema, { | ||
headers, | ||
token, | ||
}); | ||
const documents = yield loaders.loadDocuments(pointer.documents); | ||
const documents = yield loaders.loadDocuments(args.documents); | ||
const invalidDocuments = validate(schema, documents.map((doc) => new Source(print(doc.document), doc.location)), { | ||
@@ -73,0 +66,0 @@ strictFragments: !args.noStrictFragments, |
{ | ||
"name": "@graphql-inspector/validate-command", | ||
"version": "0.0.0-canary.57e2caa", | ||
"version": "0.0.0-canary.9cf9b2c", | ||
"description": "Validate Documents in GraphQL Inspector", | ||
"sideEffects": false, | ||
"peerDependencies": { | ||
@@ -9,6 +10,6 @@ "graphql": "^0.13.0 || ^14.0.0 || ^15.0.0" | ||
"dependencies": { | ||
"@graphql-inspector/commands": "0.0.0-canary.57e2caa", | ||
"@graphql-inspector/core": "0.0.0-canary.57e2caa", | ||
"@graphql-inspector/logger": "0.0.0-canary.57e2caa", | ||
"tslib": "^1.11.1" | ||
"@graphql-inspector/commands": "0.0.0-canary.9cf9b2c", | ||
"@graphql-inspector/core": "0.0.0-canary.9cf9b2c", | ||
"@graphql-inspector/logger": "0.0.0-canary.9cf9b2c", | ||
"tslib": "^2.0.0" | ||
}, | ||
@@ -15,0 +16,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
33454
111520
288
+ Added@ardatan/aggregate-error@0.0.6(transitive)
+ Added@graphql-inspector/commands@0.0.0-canary.9cf9b2c(transitive)
+ Added@graphql-inspector/config@0.0.0-canary.9cf9b2c(transitive)
+ Added@graphql-inspector/core@0.0.0-canary.9cf9b2c(transitive)
+ Added@graphql-inspector/loaders@0.0.0-canary.9cf9b2c(transitive)
+ Added@graphql-inspector/logger@0.0.0-canary.9cf9b2c(transitive)
+ Added@graphql-tools/load@6.2.8(transitive)
+ Added@graphql-tools/merge@6.2.178.3.1(transitive)
+ Added@graphql-tools/schema@8.5.1(transitive)
+ Added@graphql-tools/utils@6.2.47.10.08.0.28.9.0(transitive)
+ Addedcamel-case@4.1.2(transitive)
+ Addedglobby@11.0.3(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedtslib@2.0.32.2.02.3.1(transitive)
+ Addedvalue-or-promise@1.0.11(transitive)
+ Addedyocto-queue@0.1.0(transitive)
- Removed@babel/runtime@7.26.0(transitive)
- Removed@graphql-inspector/commands@0.0.0-canary.57e2caa(transitive)
- Removed@graphql-inspector/config@0.0.0-canary.57e2caa(transitive)
- Removed@graphql-inspector/core@0.0.0-canary.57e2caa(transitive)
- Removed@graphql-inspector/loaders@0.0.0-canary.57e2caa(transitive)
- Removed@graphql-inspector/logger@0.0.0-canary.57e2caa(transitive)
- Removed@graphql-toolkit/common@0.10.7(transitive)
- Removed@graphql-toolkit/core@0.10.7(transitive)
- Removed@graphql-toolkit/schema-merging@0.10.7(transitive)
- Removed@wry/equality@0.1.11(transitive)
- Removedaggregate-error@3.0.1(transitive)
- Removedapollo-link@1.2.14(transitive)
- Removedapollo-link-http-common@0.2.16(transitive)
- Removedapollo-upload-client@13.0.0(transitive)
- Removedapollo-utilities@1.3.4(transitive)
- Removedargparse@1.0.10(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedclean-stack@2.2.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removeddeepmerge@4.2.2(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removeddeprecated-decorator@0.1.6(transitive)
- Removedextract-files@8.1.0(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedform-data@3.0.2(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedglobby@11.0.0(transitive)
- Removedgraphql-tools@5.0.0(transitive)
- Removedindent-string@4.0.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removediterall@1.3.0(transitive)
- Removedlodash@4.17.15(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedminimatch@3.1.2(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removedtr46@0.0.3(transitive)
- Removedts-invariant@0.4.4(transitive)
- Removedtslib@1.11.2(transitive)
- Removeduuid@7.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedyamljs@0.3.0(transitive)
- Removedzen-observable@0.8.15(transitive)
- Removedzen-observable-ts@0.8.21(transitive)
Updatedtslib@^2.0.0