@graphql-tools/webpack-loader
Advanced tools
Comparing version 6.2.4 to 6.3.0-alpha-46c2b3fb.0
@@ -8,2 +8,3 @@ 'use strict'; | ||
const webpackLoaderRuntime = require('@graphql-tools/webpack-loader-runtime/es5'); | ||
const optimize = require('@graphql-tools/optimize/es5'); | ||
@@ -77,24 +78,2 @@ /** | ||
} | ||
function removeDescriptions(doc) { | ||
function transformNode(node) { | ||
if (node.description) { | ||
node.description = undefined; | ||
} | ||
return node; | ||
} | ||
if (isSDL(doc)) { | ||
return graphql.visit(doc, { | ||
ScalarTypeDefinition: transformNode, | ||
ObjectTypeDefinition: transformNode, | ||
InterfaceTypeDefinition: transformNode, | ||
UnionTypeDefinition: transformNode, | ||
EnumTypeDefinition: transformNode, | ||
EnumValueDefinition: transformNode, | ||
InputObjectTypeDefinition: transformNode, | ||
InputValueDefinition: transformNode, | ||
FieldDefinition: transformNode, | ||
}); | ||
} | ||
return doc; | ||
} | ||
function expandImports(source, options) { | ||
@@ -120,6 +99,12 @@ var lines = source.split(/\r\n|\r|\n/); | ||
var doc = parseDocument(source); | ||
// Removes descriptions from Nodes | ||
var optimizers = []; | ||
if (options.noDescription) { | ||
doc = removeDescriptions(doc); | ||
optimizers.push(optimize.removeDescriptions); | ||
} | ||
if (options.noEmptyNodes) { | ||
optimizers.push(optimize.removeEmptyNodes); | ||
} | ||
if (optimizers.length > 0 && isSDL(doc)) { | ||
doc = optimize.optimizeDocumentNode(doc, optimizers); | ||
} | ||
var headerCode = "\n var doc = " + JSON.stringify(doc) + ";\n "; | ||
@@ -126,0 +111,0 @@ var outputCode = ''; |
import os from 'os'; | ||
import { parse, Kind, print, isExecutableDefinitionNode, visit } from 'graphql'; | ||
import { parse, Kind, print, isExecutableDefinitionNode } from 'graphql'; | ||
import { uniqueCode } from '@graphql-tools/webpack-loader-runtime/es5'; | ||
import { optimizeDocumentNode, removeDescriptions, removeEmptyNodes } from '@graphql-tools/optimize/es5'; | ||
@@ -72,24 +73,2 @@ /** | ||
} | ||
function removeDescriptions(doc) { | ||
function transformNode(node) { | ||
if (node.description) { | ||
node.description = undefined; | ||
} | ||
return node; | ||
} | ||
if (isSDL(doc)) { | ||
return visit(doc, { | ||
ScalarTypeDefinition: transformNode, | ||
ObjectTypeDefinition: transformNode, | ||
InterfaceTypeDefinition: transformNode, | ||
UnionTypeDefinition: transformNode, | ||
EnumTypeDefinition: transformNode, | ||
EnumValueDefinition: transformNode, | ||
InputObjectTypeDefinition: transformNode, | ||
InputValueDefinition: transformNode, | ||
FieldDefinition: transformNode, | ||
}); | ||
} | ||
return doc; | ||
} | ||
function expandImports(source, options) { | ||
@@ -115,6 +94,12 @@ var lines = source.split(/\r\n|\r|\n/); | ||
var doc = parseDocument(source); | ||
// Removes descriptions from Nodes | ||
var optimizers = []; | ||
if (options.noDescription) { | ||
doc = removeDescriptions(doc); | ||
optimizers.push(removeDescriptions); | ||
} | ||
if (options.noEmptyNodes) { | ||
optimizers.push(removeEmptyNodes); | ||
} | ||
if (optimizers.length > 0 && isSDL(doc)) { | ||
doc = optimizeDocumentNode(doc, optimizers); | ||
} | ||
var headerCode = "\n var doc = " + JSON.stringify(doc) + ";\n "; | ||
@@ -121,0 +106,0 @@ var outputCode = ''; |
{ | ||
"name": "@graphql-tools/webpack-loader/es5", | ||
"version": "6.2.4", | ||
"version": "6.3.0-alpha-46c2b3fb.0", | ||
"description": "A set of utils for faster development of GraphQL tools", | ||
@@ -10,2 +10,3 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@graphql-tools/optimize": "1.0.0-alpha-46c2b3fb.0", | ||
"@graphql-tools/webpack-loader-runtime": "^6.2.4", | ||
@@ -12,0 +13,0 @@ "tslib": "~2.0.1" |
@@ -8,2 +8,3 @@ 'use strict'; | ||
const webpackLoaderRuntime = require('@graphql-tools/webpack-loader-runtime'); | ||
const optimize = require('@graphql-tools/optimize'); | ||
@@ -77,24 +78,2 @@ /** | ||
} | ||
function removeDescriptions(doc) { | ||
function transformNode(node) { | ||
if (node.description) { | ||
node.description = undefined; | ||
} | ||
return node; | ||
} | ||
if (isSDL(doc)) { | ||
return graphql.visit(doc, { | ||
ScalarTypeDefinition: transformNode, | ||
ObjectTypeDefinition: transformNode, | ||
InterfaceTypeDefinition: transformNode, | ||
UnionTypeDefinition: transformNode, | ||
EnumTypeDefinition: transformNode, | ||
EnumValueDefinition: transformNode, | ||
InputObjectTypeDefinition: transformNode, | ||
InputValueDefinition: transformNode, | ||
FieldDefinition: transformNode, | ||
}); | ||
} | ||
return doc; | ||
} | ||
function expandImports(source, options) { | ||
@@ -125,6 +104,12 @@ const lines = source.split(/\r\n|\r|\n/); | ||
let doc = parseDocument(source); | ||
// Removes descriptions from Nodes | ||
const optimizers = []; | ||
if (options.noDescription) { | ||
doc = removeDescriptions(doc); | ||
optimizers.push(optimize.removeDescriptions); | ||
} | ||
if (options.noEmptyNodes) { | ||
optimizers.push(optimize.removeEmptyNodes); | ||
} | ||
if (optimizers.length > 0 && isSDL(doc)) { | ||
doc = optimize.optimizeDocumentNode(doc, optimizers); | ||
} | ||
const headerCode = ` | ||
@@ -131,0 +116,0 @@ var doc = ${JSON.stringify(doc)}; |
import os from 'os'; | ||
import { parse, Kind, print, isExecutableDefinitionNode, visit } from 'graphql'; | ||
import { parse, Kind, print, isExecutableDefinitionNode } from 'graphql'; | ||
import { uniqueCode } from '@graphql-tools/webpack-loader-runtime'; | ||
import { optimizeDocumentNode, removeDescriptions, removeEmptyNodes } from '@graphql-tools/optimize'; | ||
@@ -72,24 +73,2 @@ /** | ||
} | ||
function removeDescriptions(doc) { | ||
function transformNode(node) { | ||
if (node.description) { | ||
node.description = undefined; | ||
} | ||
return node; | ||
} | ||
if (isSDL(doc)) { | ||
return visit(doc, { | ||
ScalarTypeDefinition: transformNode, | ||
ObjectTypeDefinition: transformNode, | ||
InterfaceTypeDefinition: transformNode, | ||
UnionTypeDefinition: transformNode, | ||
EnumTypeDefinition: transformNode, | ||
EnumValueDefinition: transformNode, | ||
InputObjectTypeDefinition: transformNode, | ||
InputValueDefinition: transformNode, | ||
FieldDefinition: transformNode, | ||
}); | ||
} | ||
return doc; | ||
} | ||
function expandImports(source, options) { | ||
@@ -120,6 +99,12 @@ const lines = source.split(/\r\n|\r|\n/); | ||
let doc = parseDocument(source); | ||
// Removes descriptions from Nodes | ||
const optimizers = []; | ||
if (options.noDescription) { | ||
doc = removeDescriptions(doc); | ||
optimizers.push(removeDescriptions); | ||
} | ||
if (options.noEmptyNodes) { | ||
optimizers.push(removeEmptyNodes); | ||
} | ||
if (optimizers.length > 0 && isSDL(doc)) { | ||
doc = optimizeDocumentNode(doc, optimizers); | ||
} | ||
const headerCode = ` | ||
@@ -126,0 +111,0 @@ var doc = ${JSON.stringify(doc)}; |
{ | ||
"name": "@graphql-tools/webpack-loader", | ||
"version": "6.2.4", | ||
"version": "6.3.0-alpha-46c2b3fb.0", | ||
"description": "A set of utils for faster development of GraphQL tools", | ||
@@ -10,2 +10,3 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@graphql-tools/optimize": "1.0.0-alpha-46c2b3fb.0", | ||
"@graphql-tools/webpack-loader-runtime": "^6.2.4", | ||
@@ -12,0 +13,0 @@ "tslib": "~2.0.1" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
65678
4
536
2
+ Added@graphql-tools/optimize@1.0.0-alpha-46c2b3fb.0(transitive)