@graphql-toolkit/schema-merging
Advanced tools
Comparing version 0.10.4-alpha-6a4c019.0 to 0.10.4-alpha-9553873.1
@@ -0,0 +0,0 @@ import { GraphQLSchema, GraphQLField, GraphQLInputField, GraphQLObjectType, GraphQLInputObjectType, GraphQLUnionType, GraphQLScalarType, GraphQLArgument, GraphQLEnumType, GraphQLEnumValue, GraphQLInterfaceType } from 'graphql'; |
@@ -96,3 +96,3 @@ 'use strict'; | ||
case 'EnumTypeDefinition': | ||
node.values.forEach(value => { | ||
node.values.forEach((value) => { | ||
pushComment(value, entityName, value.name.value); | ||
@@ -108,3 +108,3 @@ }); | ||
if (isFieldDefinitionNode(field) && field.arguments) { | ||
field.arguments.forEach(arg => { | ||
field.arguments.forEach((arg) => { | ||
pushComment(arg, entityName, field.name.value, arg.name.value); | ||
@@ -155,3 +155,3 @@ }); | ||
function join(maybeArray, separator) { | ||
return maybeArray ? maybeArray.filter(x => x).join(separator || '') : ''; | ||
return maybeArray ? maybeArray.filter((x) => x).join(separator || '') : ''; | ||
} | ||
@@ -210,10 +210,10 @@ function addDescription(cb) { | ||
leave: { | ||
Name: node => node.value, | ||
Variable: node => `$${node.name}`, | ||
Name: (node) => node.value, | ||
Variable: (node) => `$${node.name}`, | ||
// Document | ||
Document: node => `${node.definitions | ||
.map(defNode => `${defNode}\n${defNode[0] === '#' ? '' : '\n'}`) | ||
Document: (node) => `${node.definitions | ||
.map((defNode) => `${defNode}\n${defNode[0] === '#' ? '' : '\n'}`) | ||
.join('') | ||
.trim()}\n`, | ||
OperationTypeDefinition: node => `${node.operation}: ${node.type}`, | ||
OperationTypeDefinition: (node) => `${node.operation}: ${node.type}`, | ||
VariableDefinition: ({ variable, type, defaultValue }) => `${variable}: ${type}${wrap(' = ', defaultValue)}`, | ||
@@ -734,3 +734,3 @@ SelectionSet: ({ selections }) => block(selections), | ||
const allNodes = types | ||
.map(type => { | ||
.map((type) => { | ||
if (graphql.isSchema(type)) { | ||
@@ -744,3 +744,3 @@ return graphql.parse(common.printSchemaWithDirectives(type)); | ||
}) | ||
.map(ast => ast.definitions) | ||
.map((ast) => ast.definitions) | ||
.reduce((defs, newDef = []) => [...defs, ...newDef], []); | ||
@@ -750,4 +750,4 @@ // XXX: right now we don't handle multiple schema definitions | ||
node.operationTypes | ||
.filter(op => op.type.name.value) | ||
.forEach(op => { | ||
.filter((op) => op.type.name.value) | ||
.forEach((op) => { | ||
def[op.operation] = op.type.name.value; | ||
@@ -767,5 +767,7 @@ }); | ||
if (config && config.useSchemaDefinition) { | ||
const queryType = schemaDef.query ? schemaDef.query : allTypes.find(t => t === 'Query'); | ||
const mutationType = schemaDef.mutation ? schemaDef.mutation : allTypes.find(t => t === 'Mutation'); | ||
const subscriptionType = schemaDef.subscription ? schemaDef.subscription : allTypes.find(t => t === 'Subscription'); | ||
const queryType = schemaDef.query ? schemaDef.query : allTypes.find((t) => t === 'Query'); | ||
const mutationType = schemaDef.mutation ? schemaDef.mutation : allTypes.find((t) => t === 'Mutation'); | ||
const subscriptionType = schemaDef.subscription | ||
? schemaDef.subscription | ||
: allTypes.find((t) => t === 'Subscription'); | ||
schemaDef = { | ||
@@ -1011,1 +1013,2 @@ query: queryType, | ||
exports.travelSchemaPossibleExtensions = travelSchemaPossibleExtensions; | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -0,0 +0,0 @@ export * from './merge-resolvers'; |
@@ -92,3 +92,3 @@ import { all } from 'deepmerge'; | ||
case 'EnumTypeDefinition': | ||
node.values.forEach(value => { | ||
node.values.forEach((value) => { | ||
pushComment(value, entityName, value.name.value); | ||
@@ -104,3 +104,3 @@ }); | ||
if (isFieldDefinitionNode(field) && field.arguments) { | ||
field.arguments.forEach(arg => { | ||
field.arguments.forEach((arg) => { | ||
pushComment(arg, entityName, field.name.value, arg.name.value); | ||
@@ -151,3 +151,3 @@ }); | ||
function join(maybeArray, separator) { | ||
return maybeArray ? maybeArray.filter(x => x).join(separator || '') : ''; | ||
return maybeArray ? maybeArray.filter((x) => x).join(separator || '') : ''; | ||
} | ||
@@ -206,10 +206,10 @@ function addDescription(cb) { | ||
leave: { | ||
Name: node => node.value, | ||
Variable: node => `$${node.name}`, | ||
Name: (node) => node.value, | ||
Variable: (node) => `$${node.name}`, | ||
// Document | ||
Document: node => `${node.definitions | ||
.map(defNode => `${defNode}\n${defNode[0] === '#' ? '' : '\n'}`) | ||
Document: (node) => `${node.definitions | ||
.map((defNode) => `${defNode}\n${defNode[0] === '#' ? '' : '\n'}`) | ||
.join('') | ||
.trim()}\n`, | ||
OperationTypeDefinition: node => `${node.operation}: ${node.type}`, | ||
OperationTypeDefinition: (node) => `${node.operation}: ${node.type}`, | ||
VariableDefinition: ({ variable, type, defaultValue }) => `${variable}: ${type}${wrap(' = ', defaultValue)}`, | ||
@@ -730,3 +730,3 @@ SelectionSet: ({ selections }) => block(selections), | ||
const allNodes = types | ||
.map(type => { | ||
.map((type) => { | ||
if (isSchema(type)) { | ||
@@ -740,3 +740,3 @@ return parse(printSchemaWithDirectives(type)); | ||
}) | ||
.map(ast => ast.definitions) | ||
.map((ast) => ast.definitions) | ||
.reduce((defs, newDef = []) => [...defs, ...newDef], []); | ||
@@ -746,4 +746,4 @@ // XXX: right now we don't handle multiple schema definitions | ||
node.operationTypes | ||
.filter(op => op.type.name.value) | ||
.forEach(op => { | ||
.filter((op) => op.type.name.value) | ||
.forEach((op) => { | ||
def[op.operation] = op.type.name.value; | ||
@@ -763,5 +763,7 @@ }); | ||
if (config && config.useSchemaDefinition) { | ||
const queryType = schemaDef.query ? schemaDef.query : allTypes.find(t => t === 'Query'); | ||
const mutationType = schemaDef.mutation ? schemaDef.mutation : allTypes.find(t => t === 'Mutation'); | ||
const subscriptionType = schemaDef.subscription ? schemaDef.subscription : allTypes.find(t => t === 'Subscription'); | ||
const queryType = schemaDef.query ? schemaDef.query : allTypes.find((t) => t === 'Query'); | ||
const mutationType = schemaDef.mutation ? schemaDef.mutation : allTypes.find((t) => t === 'Mutation'); | ||
const subscriptionType = schemaDef.subscription | ||
? schemaDef.subscription | ||
: allTypes.find((t) => t === 'Subscription'); | ||
schemaDef = { | ||
@@ -960,1 +962,2 @@ query: queryType, | ||
export { applyExtensions, collectComment, extractExtensionsFromSchema, extractType, isGraphQLDirective, isGraphQLEnum, isGraphQLEnumExtension, isGraphQLInputType, isGraphQLInputTypeExtension, isGraphQLInterface, isGraphQLInterfaceExtension, isGraphQLScalar, isGraphQLScalarExtension, isGraphQLType, isGraphQLTypeExtension, isGraphQLUnion, isGraphQLUnionExtension, isListTypeNode, isNonNullTypeNode, isSchemaDefinition, isSourceTypes, isStringTypes, isWrappingTypeNode, mergeArguments, mergeDirective, mergeDirectives, mergeEnum, mergeEnumValues, mergeExtensions, mergeFields, mergeGraphQLNodes, mergeGraphQLSchemas, mergeGraphQLTypes, mergeInputType, mergeInterface, mergeNamedTypeArray, mergeResolvers, mergeSchemas, mergeSchemasAsync, mergeType, mergeTypeDefs, mergeUnion, printComment, printTypeNode, printWithComments, pushComment, resetComments, travelSchemaPossibleExtensions }; | ||
//# sourceMappingURL=index.esm.js.map |
@@ -0,0 +0,0 @@ import { IResolvers } from 'graphql-tools-fork'; |
@@ -0,0 +0,0 @@ import { GraphQLSchema, DocumentNode, BuildSchemaOptions } from 'graphql'; |
{ | ||
"name": "@graphql-toolkit/schema-merging", | ||
"version": "0.10.4-alpha-6a4c019.0+6a4c019", | ||
"version": "0.10.4-alpha-9553873.1+9553873", | ||
"description": "A set of utils for faster development of GraphQL tools", | ||
@@ -18,3 +18,3 @@ "peerDependencies": { | ||
"dependencies": { | ||
"@graphql-toolkit/common": "0.10.4-alpha-6a4c019.0+6a4c019", | ||
"@graphql-toolkit/common": "0.10.4-alpha-9553873.1+9553873", | ||
"deepmerge": "4.2.2", | ||
@@ -21,0 +21,0 @@ "graphql-tools-fork": "9.0.1", |
import { InputValueDefinitionNode } from 'graphql'; | ||
import { Config } from '.'; | ||
export declare function mergeArguments(args1: InputValueDefinitionNode[], args2: InputValueDefinitionNode[], config: Config): InputValueDefinitionNode[]; |
@@ -0,0 +0,0 @@ import { StringValueNode, TypeDefinitionNode, ASTNode } from 'graphql'; |
@@ -0,0 +0,0 @@ import { DirectiveNode } from 'graphql/language/ast'; |
import { EnumValueDefinitionNode } from 'graphql/language/ast'; | ||
import { Config } from './merge-typedefs'; | ||
export declare function mergeEnumValues(first: ReadonlyArray<EnumValueDefinitionNode>, second: ReadonlyArray<EnumValueDefinitionNode>, config: Config): EnumValueDefinitionNode[]; |
import { EnumTypeDefinitionNode, EnumTypeExtensionNode } from 'graphql'; | ||
import { Config } from './merge-typedefs'; | ||
export declare function mergeEnum(e1: EnumTypeDefinitionNode | EnumTypeExtensionNode, e2: EnumTypeDefinitionNode | EnumTypeExtensionNode, config?: Config): EnumTypeDefinitionNode | EnumTypeExtensionNode; |
@@ -0,0 +0,0 @@ import { Config } from './merge-typedefs'; |
@@ -0,0 +0,0 @@ export * from './arguments'; |
@@ -0,0 +0,0 @@ import { Config } from './merge-typedefs'; |
import { Config } from './merge-typedefs'; | ||
import { InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode } from 'graphql'; | ||
export declare function mergeInterface(node: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode, existingNode: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode, config: Config): InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode; |
import { NamedTypeNode } from 'graphql/language/ast'; | ||
import { Config } from '.'; | ||
export declare function mergeNamedTypeArray(first: ReadonlyArray<NamedTypeNode>, second: ReadonlyArray<NamedTypeNode>, config: Config): NamedTypeNode[]; |
@@ -0,0 +0,0 @@ import { Config } from './merge-typedefs'; |
@@ -0,0 +0,0 @@ import { DefinitionNode, DocumentNode, GraphQLSchema, Source } from 'graphql'; |
import { Config } from './merge-typedefs'; | ||
import { ObjectTypeDefinitionNode, ObjectTypeExtensionNode } from 'graphql'; | ||
export declare function mergeType(node: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, existingNode: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, config?: Config): ObjectTypeDefinitionNode | ObjectTypeExtensionNode; |
import { UnionTypeDefinitionNode, UnionTypeExtensionNode } from 'graphql'; | ||
import { Config } from './merge-typedefs'; | ||
export declare function mergeUnion(first: UnionTypeDefinitionNode | UnionTypeExtensionNode, second: UnionTypeDefinitionNode | UnionTypeExtensionNode, config?: Config): UnionTypeDefinitionNode | UnionTypeExtensionNode; |
@@ -0,0 +0,0 @@ import { TypeNode, DefinitionNode, EnumTypeDefinitionNode, NamedTypeNode, ListTypeNode, NonNullTypeNode, ObjectTypeDefinitionNode, Source, UnionTypeDefinitionNode, ScalarTypeDefinitionNode, InputObjectTypeDefinitionNode, InterfaceTypeDefinitionNode, DirectiveDefinitionNode, SchemaDefinitionNode, ObjectTypeExtensionNode, InputObjectTypeExtensionNode, EnumTypeExtensionNode, UnionTypeExtensionNode, ScalarTypeExtensionNode, InterfaceTypeExtensionNode } from 'graphql'; |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
269155
25
2161