Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@graphql-inspector/validate-command

Package Overview
Dependencies
Maintainers
1
Versions
535
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-inspector/validate-command - npm Package Compare versions

Comparing version 0.0.0-canary.57e2caa to 0.0.0-canary.9cf9b2c

19

index.cjs.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc