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

graphql-codegen-plugin-helpers

Package Overview
Dependencies
Maintainers
1
Versions
1198
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-codegen-plugin-helpers - npm Package Compare versions

Comparing version 0.19.0-alpha.59cd429f to 0.19.0-alpha.5c685b27

3

dist/commonjs/index.d.ts
export { resolveExternalModuleAndFn } from './resolve-external-module-and-fn';
export { toPascalCase } from './to-pascal-case';
export * from './types';
export * from './yml-config-types';
export { debugLog, printLogs, resetLogs } from './debugging';
export { getLogger, setLogger, setSilentLogger, useWinstonLogger } from './logger';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
var resolve_external_module_and_fn_1 = require("./resolve-external-module-and-fn");

@@ -8,12 +7,2 @@ exports.resolveExternalModuleAndFn = resolve_external_module_and_fn_1.resolveExternalModuleAndFn;

exports.toPascalCase = to_pascal_case_1.toPascalCase;
tslib_1.__exportStar(require("./types"), exports);
var debugging_1 = require("./debugging");
exports.debugLog = debugging_1.debugLog;
exports.printLogs = debugging_1.printLogs;
exports.resetLogs = debugging_1.resetLogs;
var logger_1 = require("./logger");
exports.getLogger = logger_1.getLogger;
exports.setLogger = logger_1.setLogger;
exports.setSilentLogger = logger_1.setSilentLogger;
exports.useWinstonLogger = logger_1.useWinstonLogger;
//# sourceMappingURL=index.js.map

322

dist/commonjs/types.d.ts

@@ -1,241 +0,85 @@

import { DocumentNode, GraphQLSchema } from 'graphql';
export interface AstNode {
directives: DirectiveUseMap;
usesDirectives: boolean;
import { GraphQLSchema, DocumentNode } from 'graphql';
export declare namespace Types {
type FileOutput = {
filename: string;
content: string;
};
type DocumentFile = {
filePath: string;
content: DocumentNode;
};
type InstanceOrArray<T> = T | T[];
type SchemaWithLoader = {
[schemaString: string]: {
loader: string;
};
};
type UrlSchema = string | {
[url: string]: {
headers?: {
[headerName: string]: string;
};
};
};
type LocalSchemaPath = string;
type SchemaGlobPath = string;
type Schema = UrlSchema | LocalSchemaPath | SchemaGlobPath | SchemaWithLoader;
type OperationDocumentGlobPath = string;
type CustomDocumentLoader = {
[path: string]: {
loader: string;
};
};
type OperationDocument = OperationDocumentGlobPath | CustomDocumentLoader;
type PluginConfig = InstanceOrArray<string> | {
[key: string]: any;
};
type ConfiguredPlugin = {
[name: string]: PluginConfig;
};
type NamedPlugin = string;
type OutputConfig = InstanceOrArray<NamedPlugin | ConfiguredPlugin>;
type ConfiguredOutput = {
overwrite?: boolean;
documents?: InstanceOrArray<OperationDocument>;
schema?: InstanceOrArray<Schema>;
plugins: OutputConfig;
config?: {
[key: string]: any;
};
};
type RequireExtension = InstanceOrArray<string>;
type PluginLoaderFn = (pluginName: string) => CodegenPlugin | Promise<CodegenPlugin>;
interface Config {
schema?: InstanceOrArray<Schema>;
require?: RequireExtension;
documents?: InstanceOrArray<OperationDocument>;
config?: {
[key: string]: any;
};
generates: {
[filename: string]: OutputConfig | ConfiguredOutput;
};
overwrite?: boolean;
watch?: boolean | string | string[];
silent?: boolean;
pluginLoader?: PluginLoaderFn;
pluckConfig?: {
modules?: Array<{
name: string;
identifier?: string;
}>;
magicComment?: string;
globalIdentifier?: string;
};
}
}
export declare type FieldType = 'Interface' | 'InputType' | 'Type' | 'Query' | 'Mutation' | 'Subscription' | 'Enum' | 'Scalar' | 'Union';
export interface Argument extends AstNode {
raw: string;
name: string;
description: string;
type: string;
isRequired: boolean;
isArray: boolean;
dimensionOfArray: number;
isNullableArray: boolean;
isType: boolean;
isScalar: boolean;
isInterface: boolean;
isUnion: boolean;
isInputType: boolean;
isEnum: boolean;
hasDefaultValue: boolean;
defaultValue: boolean;
export declare type PluginFunction<T = any> = (schema: GraphQLSchema, documents: Types.DocumentFile[], config: T, info?: {
outputFile: string;
}) => Promise<string> | string;
export declare type PluginValidateFn<T = any> = (schema: GraphQLSchema, documents: Types.DocumentFile[], config: T, outputFile: string, allPlugins: Types.ConfiguredPlugin[]) => Promise<void> | void;
export interface CodegenPlugin<T = any> {
plugin: PluginFunction<T>;
addToSchema?: string | DocumentNode;
validate?: PluginValidateFn;
}
export interface Field extends AstNode {
name: string;
description: string;
arguments: Argument[];
type: string;
fieldType: FieldType;
raw: string;
isArray: boolean;
dimensionOfArray: number;
isRequired: boolean;
isNullableArray: boolean;
hasArguments: boolean;
hasDefaultValue: boolean;
defaultValue: boolean;
isType: boolean;
isScalar: boolean;
isInterface: boolean;
isUnion: boolean;
isInputType: boolean;
isEnum: boolean;
}
export interface Type extends AstNode {
fields: Field[];
description: string;
name: string;
isInputType: boolean;
interfaces: string[];
hasFields: boolean;
hasInterfaces: boolean;
}
export interface Scalar extends AstNode {
name: string;
description: string;
}
export interface Enum extends AstNode {
name: string;
description: string;
values: EnumValue[];
}
export interface EnumValue extends AstNode {
name: string;
value: string;
description: string;
}
export interface Union extends AstNode {
name: string;
description: string;
possibleTypes: string[];
}
export interface Interface extends AstNode {
name: string;
description: string;
fields: Field[];
hasFields: boolean;
implementingTypes: string[];
hasImplementingTypes: boolean;
}
export interface SchemaTemplateContext extends AstNode {
types: Type[];
inputTypes: Type[];
enums: Enum[];
unions: Union[];
interfaces: Interface[];
scalars: Scalar[];
definedDirectives: Directive[];
hasTypes: boolean;
hasInputTypes: boolean;
hasEnums: boolean;
hasUnions: boolean;
hasScalars: boolean;
hasInterfaces: boolean;
hasDefinedDirectives: boolean;
rawSchema: GraphQLSchema;
}
export interface SelectionSetItem extends AstNode {
isFragmentSpread: boolean;
isInlineFragment: boolean;
isField: boolean;
isLeaf: boolean;
}
export interface SelectionSetInlineFragment extends SelectionSetItem {
selectionSet: SelectionSetItem[];
onType: string;
name: string;
fields: SelectionSetFieldNode[];
fragmentsSpread: SelectionSetFragmentSpread[];
inlineFragments: SelectionSetInlineFragment[];
hasFragmentsSpread: boolean;
hasInlineFragments: boolean;
hasFields: boolean;
hasTypename: boolean;
}
export interface SelectionSetFragmentSpread extends SelectionSetItem {
fragmentName: string;
}
export interface SelectionSetFieldNode extends SelectionSetItem {
selectionSet: SelectionSetItem[];
name: string;
isAliased: boolean;
schemaFieldName: string;
type: string;
isRequired: boolean;
isArray: boolean;
dimensionOfArray: number;
isNullableArray: boolean;
raw: string;
fields: SelectionSetFieldNode[];
fragmentsSpread: SelectionSetFragmentSpread[];
inlineFragments: SelectionSetInlineFragment[];
hasFragmentsSpread: boolean;
hasInlineFragments: boolean;
hasFields: boolean;
hasTypename: boolean;
isType: boolean;
isScalar: boolean;
isInterface: boolean;
isUnion: boolean;
isInputType: boolean;
isEnum: boolean;
}
export declare function isFieldNode(node: any): node is SelectionSetFieldNode;
export declare function isFragmentSpreadNode(node: any): node is SelectionSetFragmentSpread;
export declare function isInlineFragmentNode(node: any): node is SelectionSetInlineFragment;
export interface Fragment extends AstNode {
name: string;
selectionSet: SelectionSetItem[];
onType: string;
document: string;
fields: SelectionSetFieldNode[];
fragmentsSpread: SelectionSetFragmentSpread[];
inlineFragments: SelectionSetInlineFragment[];
hasFragmentsSpread: boolean;
hasInlineFragments: boolean;
hasFields: boolean;
originalFile?: string;
}
export interface Operation extends AstNode {
name: string;
selectionSet: SelectionSetItem[];
operationType: string;
variables: Variable[];
hasVariables: boolean;
isQuery: boolean;
isMutation: boolean;
isSubscription: boolean;
document: string;
fields: SelectionSetFieldNode[];
fragmentsSpread: SelectionSetFragmentSpread[];
inlineFragments: SelectionSetInlineFragment[];
hasFragmentsSpread: boolean;
hasInlineFragments: boolean;
hasFields: boolean;
originalFile?: string;
}
export interface Variable {
name: string;
type: string;
isRequired: boolean;
isArray: boolean;
isNullableArray: boolean;
dimensionOfArray: number;
raw: string;
isType: boolean;
isScalar: boolean;
isInterface: boolean;
isUnion: boolean;
isInputType: boolean;
isEnum: boolean;
}
export interface Document {
fragments: Fragment[];
operations: Operation[];
hasFragments: boolean;
hasOperations: boolean;
}
export declare type DirectiveUseMap = {
[key: string]: any;
};
export interface Directive {
name: string;
description: string;
locations: string[];
arguments: Argument[];
hasArguments: boolean;
onFragmentSpread: boolean;
onInlineFragment: boolean;
onQuery: boolean;
onMutation: boolean;
onSubscription: boolean;
onFragment: boolean;
onField: boolean;
onSchema: boolean;
onScalar: boolean;
onFieldDefinition: boolean;
onEnum: boolean;
onEnumValue: boolean;
onObject: boolean;
onInputObject: boolean;
onInputField: boolean;
onArgument: boolean;
onInterface: boolean;
onUnion: boolean;
}
export interface FileOutput {
filename: string;
content: string;
}
export interface Settings {
generateSchema?: boolean;
generateDocuments?: boolean;
verbose?: boolean;
}
export declare type CustomProcessingFunction = (templateContext: SchemaTemplateContext, mergedDocuments: Document, settings: any) => FileOutput[] | Promise<FileOutput[]>;
export interface DocumentFile {
filePath: string;
content: DocumentNode;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function isFieldNode(node) {
return node.name !== undefined && node.selectionSet !== undefined && node.type !== undefined;
}
exports.isFieldNode = isFieldNode;
function isFragmentSpreadNode(node) {
return node.fragmentName !== undefined;
}
exports.isFragmentSpreadNode = isFragmentSpreadNode;
function isInlineFragmentNode(node) {
return node.selectionSet !== undefined && node.onType !== undefined;
}
exports.isInlineFragmentNode = isInlineFragmentNode;
//# sourceMappingURL=types.js.map
export { resolveExternalModuleAndFn } from './resolve-external-module-and-fn';
export { toPascalCase } from './to-pascal-case';
export * from './types';
export * from './yml-config-types';
export { debugLog, printLogs, resetLogs } from './debugging';
export { getLogger, setLogger, setSilentLogger, useWinstonLogger } from './logger';
export { resolveExternalModuleAndFn } from './resolve-external-module-and-fn';
export { toPascalCase } from './to-pascal-case';
export * from './types';
export { debugLog, printLogs, resetLogs } from './debugging';
export { getLogger, setLogger, setSilentLogger, useWinstonLogger } from './logger';
//# sourceMappingURL=index.js.map

@@ -1,241 +0,85 @@

import { DocumentNode, GraphQLSchema } from 'graphql';
export interface AstNode {
directives: DirectiveUseMap;
usesDirectives: boolean;
import { GraphQLSchema, DocumentNode } from 'graphql';
export declare namespace Types {
type FileOutput = {
filename: string;
content: string;
};
type DocumentFile = {
filePath: string;
content: DocumentNode;
};
type InstanceOrArray<T> = T | T[];
type SchemaWithLoader = {
[schemaString: string]: {
loader: string;
};
};
type UrlSchema = string | {
[url: string]: {
headers?: {
[headerName: string]: string;
};
};
};
type LocalSchemaPath = string;
type SchemaGlobPath = string;
type Schema = UrlSchema | LocalSchemaPath | SchemaGlobPath | SchemaWithLoader;
type OperationDocumentGlobPath = string;
type CustomDocumentLoader = {
[path: string]: {
loader: string;
};
};
type OperationDocument = OperationDocumentGlobPath | CustomDocumentLoader;
type PluginConfig = InstanceOrArray<string> | {
[key: string]: any;
};
type ConfiguredPlugin = {
[name: string]: PluginConfig;
};
type NamedPlugin = string;
type OutputConfig = InstanceOrArray<NamedPlugin | ConfiguredPlugin>;
type ConfiguredOutput = {
overwrite?: boolean;
documents?: InstanceOrArray<OperationDocument>;
schema?: InstanceOrArray<Schema>;
plugins: OutputConfig;
config?: {
[key: string]: any;
};
};
type RequireExtension = InstanceOrArray<string>;
type PluginLoaderFn = (pluginName: string) => CodegenPlugin | Promise<CodegenPlugin>;
interface Config {
schema?: InstanceOrArray<Schema>;
require?: RequireExtension;
documents?: InstanceOrArray<OperationDocument>;
config?: {
[key: string]: any;
};
generates: {
[filename: string]: OutputConfig | ConfiguredOutput;
};
overwrite?: boolean;
watch?: boolean | string | string[];
silent?: boolean;
pluginLoader?: PluginLoaderFn;
pluckConfig?: {
modules?: Array<{
name: string;
identifier?: string;
}>;
magicComment?: string;
globalIdentifier?: string;
};
}
}
export declare type FieldType = 'Interface' | 'InputType' | 'Type' | 'Query' | 'Mutation' | 'Subscription' | 'Enum' | 'Scalar' | 'Union';
export interface Argument extends AstNode {
raw: string;
name: string;
description: string;
type: string;
isRequired: boolean;
isArray: boolean;
dimensionOfArray: number;
isNullableArray: boolean;
isType: boolean;
isScalar: boolean;
isInterface: boolean;
isUnion: boolean;
isInputType: boolean;
isEnum: boolean;
hasDefaultValue: boolean;
defaultValue: boolean;
export declare type PluginFunction<T = any> = (schema: GraphQLSchema, documents: Types.DocumentFile[], config: T, info?: {
outputFile: string;
}) => Promise<string> | string;
export declare type PluginValidateFn<T = any> = (schema: GraphQLSchema, documents: Types.DocumentFile[], config: T, outputFile: string, allPlugins: Types.ConfiguredPlugin[]) => Promise<void> | void;
export interface CodegenPlugin<T = any> {
plugin: PluginFunction<T>;
addToSchema?: string | DocumentNode;
validate?: PluginValidateFn;
}
export interface Field extends AstNode {
name: string;
description: string;
arguments: Argument[];
type: string;
fieldType: FieldType;
raw: string;
isArray: boolean;
dimensionOfArray: number;
isRequired: boolean;
isNullableArray: boolean;
hasArguments: boolean;
hasDefaultValue: boolean;
defaultValue: boolean;
isType: boolean;
isScalar: boolean;
isInterface: boolean;
isUnion: boolean;
isInputType: boolean;
isEnum: boolean;
}
export interface Type extends AstNode {
fields: Field[];
description: string;
name: string;
isInputType: boolean;
interfaces: string[];
hasFields: boolean;
hasInterfaces: boolean;
}
export interface Scalar extends AstNode {
name: string;
description: string;
}
export interface Enum extends AstNode {
name: string;
description: string;
values: EnumValue[];
}
export interface EnumValue extends AstNode {
name: string;
value: string;
description: string;
}
export interface Union extends AstNode {
name: string;
description: string;
possibleTypes: string[];
}
export interface Interface extends AstNode {
name: string;
description: string;
fields: Field[];
hasFields: boolean;
implementingTypes: string[];
hasImplementingTypes: boolean;
}
export interface SchemaTemplateContext extends AstNode {
types: Type[];
inputTypes: Type[];
enums: Enum[];
unions: Union[];
interfaces: Interface[];
scalars: Scalar[];
definedDirectives: Directive[];
hasTypes: boolean;
hasInputTypes: boolean;
hasEnums: boolean;
hasUnions: boolean;
hasScalars: boolean;
hasInterfaces: boolean;
hasDefinedDirectives: boolean;
rawSchema: GraphQLSchema;
}
export interface SelectionSetItem extends AstNode {
isFragmentSpread: boolean;
isInlineFragment: boolean;
isField: boolean;
isLeaf: boolean;
}
export interface SelectionSetInlineFragment extends SelectionSetItem {
selectionSet: SelectionSetItem[];
onType: string;
name: string;
fields: SelectionSetFieldNode[];
fragmentsSpread: SelectionSetFragmentSpread[];
inlineFragments: SelectionSetInlineFragment[];
hasFragmentsSpread: boolean;
hasInlineFragments: boolean;
hasFields: boolean;
hasTypename: boolean;
}
export interface SelectionSetFragmentSpread extends SelectionSetItem {
fragmentName: string;
}
export interface SelectionSetFieldNode extends SelectionSetItem {
selectionSet: SelectionSetItem[];
name: string;
isAliased: boolean;
schemaFieldName: string;
type: string;
isRequired: boolean;
isArray: boolean;
dimensionOfArray: number;
isNullableArray: boolean;
raw: string;
fields: SelectionSetFieldNode[];
fragmentsSpread: SelectionSetFragmentSpread[];
inlineFragments: SelectionSetInlineFragment[];
hasFragmentsSpread: boolean;
hasInlineFragments: boolean;
hasFields: boolean;
hasTypename: boolean;
isType: boolean;
isScalar: boolean;
isInterface: boolean;
isUnion: boolean;
isInputType: boolean;
isEnum: boolean;
}
export declare function isFieldNode(node: any): node is SelectionSetFieldNode;
export declare function isFragmentSpreadNode(node: any): node is SelectionSetFragmentSpread;
export declare function isInlineFragmentNode(node: any): node is SelectionSetInlineFragment;
export interface Fragment extends AstNode {
name: string;
selectionSet: SelectionSetItem[];
onType: string;
document: string;
fields: SelectionSetFieldNode[];
fragmentsSpread: SelectionSetFragmentSpread[];
inlineFragments: SelectionSetInlineFragment[];
hasFragmentsSpread: boolean;
hasInlineFragments: boolean;
hasFields: boolean;
originalFile?: string;
}
export interface Operation extends AstNode {
name: string;
selectionSet: SelectionSetItem[];
operationType: string;
variables: Variable[];
hasVariables: boolean;
isQuery: boolean;
isMutation: boolean;
isSubscription: boolean;
document: string;
fields: SelectionSetFieldNode[];
fragmentsSpread: SelectionSetFragmentSpread[];
inlineFragments: SelectionSetInlineFragment[];
hasFragmentsSpread: boolean;
hasInlineFragments: boolean;
hasFields: boolean;
originalFile?: string;
}
export interface Variable {
name: string;
type: string;
isRequired: boolean;
isArray: boolean;
isNullableArray: boolean;
dimensionOfArray: number;
raw: string;
isType: boolean;
isScalar: boolean;
isInterface: boolean;
isUnion: boolean;
isInputType: boolean;
isEnum: boolean;
}
export interface Document {
fragments: Fragment[];
operations: Operation[];
hasFragments: boolean;
hasOperations: boolean;
}
export declare type DirectiveUseMap = {
[key: string]: any;
};
export interface Directive {
name: string;
description: string;
locations: string[];
arguments: Argument[];
hasArguments: boolean;
onFragmentSpread: boolean;
onInlineFragment: boolean;
onQuery: boolean;
onMutation: boolean;
onSubscription: boolean;
onFragment: boolean;
onField: boolean;
onSchema: boolean;
onScalar: boolean;
onFieldDefinition: boolean;
onEnum: boolean;
onEnumValue: boolean;
onObject: boolean;
onInputObject: boolean;
onInputField: boolean;
onArgument: boolean;
onInterface: boolean;
onUnion: boolean;
}
export interface FileOutput {
filename: string;
content: string;
}
export interface Settings {
generateSchema?: boolean;
generateDocuments?: boolean;
verbose?: boolean;
}
export declare type CustomProcessingFunction = (templateContext: SchemaTemplateContext, mergedDocuments: Document, settings: any) => FileOutput[] | Promise<FileOutput[]>;
export interface DocumentFile {
filePath: string;
content: DocumentNode;
}

@@ -1,10 +0,1 @@

export function isFieldNode(node) {
return node.name !== undefined && node.selectionSet !== undefined && node.type !== undefined;
}
export function isFragmentSpreadNode(node) {
return node.fragmentName !== undefined;
}
export function isInlineFragmentNode(node) {
return node.selectionSet !== undefined && node.onType !== undefined;
}
//# sourceMappingURL=types.js.map
{
"name": "graphql-codegen-plugin-helpers",
"version": "0.19.0-alpha.59cd429f",
"version": "0.19.0-alpha.5c685b27",
"description": "graphql-codegen-cli template for TypeScript typings for both client side and server side",

@@ -17,3 +17,2 @@ "repository": "git@github.com:dotansimha/graphql-code-generator.git",

"import-from": "2.1.0",
"ts-log": "2.1.4",
"tslib": "1.9.3"

@@ -20,0 +19,0 @@ },

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

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