refactor(style): sort imports
This commit is contained in:
parent
9deb327dbe
commit
3156f9bc46
|
@ -1,7 +1,11 @@
|
|||
import {
|
||||
assertValidName,
|
||||
defaultFieldResolver,
|
||||
getNamedType,
|
||||
GraphQLBoolean,
|
||||
GraphQLEnumType,
|
||||
GraphQLEnumValueConfigMap,
|
||||
GraphQLField,
|
||||
GraphQLFieldConfig,
|
||||
GraphQLFieldConfigArgumentMap,
|
||||
GraphQLFieldConfigMap,
|
||||
|
@ -22,6 +26,7 @@ import {
|
|||
GraphQLScalarType,
|
||||
GraphQLSchema,
|
||||
GraphQLString,
|
||||
GraphQLType,
|
||||
GraphQLUnionType,
|
||||
isInputObjectType,
|
||||
isInterfaceType,
|
||||
|
@ -30,21 +35,16 @@ import {
|
|||
isObjectType,
|
||||
isOutputType,
|
||||
isScalarType,
|
||||
assertValidName,
|
||||
getNamedType,
|
||||
GraphQLField,
|
||||
defaultFieldResolver,
|
||||
isSchema,
|
||||
GraphQLType,
|
||||
isWrappingType,
|
||||
isUnionType,
|
||||
isWrappingType,
|
||||
printSchema,
|
||||
} from "graphql";
|
||||
import {
|
||||
arg,
|
||||
ArgsRecord,
|
||||
NexusArgConfig,
|
||||
NexusArgDef,
|
||||
ArgsRecord,
|
||||
arg,
|
||||
} from "./definitions/args";
|
||||
import {
|
||||
InputDefinitionBlock,
|
||||
|
@ -53,6 +53,10 @@ import {
|
|||
OutputDefinitionBlock,
|
||||
} from "./definitions/definitionBlocks";
|
||||
import { EnumTypeConfig } from "./definitions/enumType";
|
||||
import {
|
||||
NexusExtendInputTypeConfig,
|
||||
NexusExtendInputTypeDef,
|
||||
} from "./definitions/extendInputType";
|
||||
import {
|
||||
NexusExtendTypeConfig,
|
||||
NexusExtendTypeDef,
|
||||
|
@ -70,8 +74,8 @@ import {
|
|||
ObjectDefinitionBlock,
|
||||
} from "./definitions/objectType";
|
||||
import {
|
||||
NexusScalarTypeConfig,
|
||||
NexusScalarExtensions,
|
||||
NexusScalarTypeConfig,
|
||||
} from "./definitions/scalarType";
|
||||
import {
|
||||
NexusUnionTypeConfig,
|
||||
|
@ -81,75 +85,71 @@ import {
|
|||
import {
|
||||
AllNexusInputTypeDefs,
|
||||
AllNexusNamedTypeDefs,
|
||||
AllNexusOutputTypeDefs,
|
||||
isNexusArgDef,
|
||||
isNexusDynamicInputMethod,
|
||||
isNexusDynamicOutputMethod,
|
||||
isNexusDynamicOutputProperty,
|
||||
isNexusEnumTypeDef,
|
||||
isNexusExtendInputTypeDef,
|
||||
isNexusExtendTypeDef,
|
||||
isNexusInputObjectTypeDef,
|
||||
isNexusInterfaceTypeDef,
|
||||
isNexusNamedTypeDef,
|
||||
isNexusObjectTypeDef,
|
||||
isNexusPlugin,
|
||||
isNexusScalarTypeDef,
|
||||
isNexusUnionTypeDef,
|
||||
isNexusExtendInputTypeDef,
|
||||
AllNexusOutputTypeDefs,
|
||||
isNexusDynamicInputMethod,
|
||||
isNexusDynamicOutputMethod,
|
||||
isNexusArgDef,
|
||||
isNexusDynamicOutputProperty,
|
||||
isNexusPlugin,
|
||||
} from "./definitions/wrapping";
|
||||
import {
|
||||
GraphQLPossibleInputs,
|
||||
GraphQLPossibleOutputs,
|
||||
NonNullConfig,
|
||||
RootTypings,
|
||||
MissingType,
|
||||
NexusGraphQLFieldConfig,
|
||||
NexusGraphQLInputObjectTypeConfig,
|
||||
NexusGraphQLInterfaceTypeConfig,
|
||||
NexusGraphQLObjectTypeConfig,
|
||||
NexusGraphQLSchema,
|
||||
NexusGraphQLInputObjectTypeConfig,
|
||||
NonNullConfig,
|
||||
RootTypings,
|
||||
} from "./definitions/_types";
|
||||
import { DynamicInputMethodDef, DynamicOutputMethodDef } from "./dynamicMethod";
|
||||
import { DynamicOutputPropertyDef } from "./dynamicProperty";
|
||||
import {
|
||||
NexusFieldExtension,
|
||||
NexusInputObjectTypeExtension,
|
||||
NexusInterfaceTypeExtension,
|
||||
NexusObjectTypeExtension,
|
||||
NexusSchemaExtension,
|
||||
} from "./extensions";
|
||||
import {
|
||||
composeMiddlewareFns,
|
||||
CreateFieldResolverInfo,
|
||||
MiddlewareFn,
|
||||
NexusPlugin,
|
||||
PluginConfig,
|
||||
} from "./plugin";
|
||||
import { fieldAuthorizePlugin } from "./plugins/fieldAuthorizePlugin";
|
||||
import { TypegenAutoConfigOptions } from "./typegenAutoConfig";
|
||||
import { TypegenFormatFn } from "./typegenFormatPrettier";
|
||||
import { TypegenMetadata } from "./typegenMetadata";
|
||||
import {
|
||||
AbstractTypeResolver,
|
||||
GetGen,
|
||||
AllInputTypes,
|
||||
GetGen,
|
||||
} from "./typegenTypeHelpers";
|
||||
import {
|
||||
firstDefined,
|
||||
objValues,
|
||||
isObject,
|
||||
eachObj,
|
||||
resolveTypegenConfig,
|
||||
assertNoMissingTypes,
|
||||
consoleWarn,
|
||||
validateOnInstallHookResult,
|
||||
eachObj,
|
||||
firstDefined,
|
||||
isObject,
|
||||
mapValues,
|
||||
objValues,
|
||||
resolveTypegenConfig,
|
||||
UNKNOWN_TYPE_SCALAR,
|
||||
validateOnInstallHookResult,
|
||||
} from "./utils";
|
||||
import {
|
||||
NexusExtendInputTypeDef,
|
||||
NexusExtendInputTypeConfig,
|
||||
} from "./definitions/extendInputType";
|
||||
import { DynamicInputMethodDef, DynamicOutputMethodDef } from "./dynamicMethod";
|
||||
import { DynamicOutputPropertyDef } from "./dynamicProperty";
|
||||
import {
|
||||
NexusPlugin,
|
||||
composeMiddlewareFns,
|
||||
PluginConfig,
|
||||
CreateFieldResolverInfo,
|
||||
MiddlewareFn,
|
||||
} from "./plugin";
|
||||
import {
|
||||
NexusFieldExtension,
|
||||
NexusInterfaceTypeExtension,
|
||||
NexusSchemaExtension,
|
||||
NexusObjectTypeExtension,
|
||||
NexusInputObjectTypeExtension,
|
||||
} from "./extensions";
|
||||
import { fieldAuthorizePlugin } from "./plugins/fieldAuthorizePlugin";
|
||||
|
||||
type NexusShapedOutput = {
|
||||
name: string;
|
||||
|
|
22
src/core.ts
22
src/core.ts
|
@ -1,29 +1,29 @@
|
|||
// The "core" is used as a namespace to re-export everything,
|
||||
// For anyone who wants to use the internals
|
||||
export * from "./builder";
|
||||
export * from "./sdlConverter";
|
||||
export * from "./typegenPrinter";
|
||||
export * from "./typegenAutoConfig";
|
||||
export * from "./typegenFormatPrettier";
|
||||
export * from "./typegenMetadata";
|
||||
export * from "./typegenTypeHelpers";
|
||||
export * from "./utils";
|
||||
export * from "./definitions/_types";
|
||||
export * from "./definitions/args";
|
||||
export * from "./definitions/decorateType";
|
||||
export * from "./definitions/definitionBlocks";
|
||||
export * from "./definitions/enumType";
|
||||
export * from "./definitions/extendType";
|
||||
export * from "./definitions/extendInputType";
|
||||
export * from "./definitions/extendType";
|
||||
export * from "./definitions/inputObjectType";
|
||||
export * from "./definitions/interfaceType";
|
||||
export * from "./definitions/mutationField";
|
||||
export * from "./definitions/queryField";
|
||||
export * from "./definitions/subscriptionField";
|
||||
export * from "./definitions/objectType";
|
||||
export * from "./definitions/queryField";
|
||||
export * from "./definitions/scalarType";
|
||||
export * from "./definitions/subscriptionField";
|
||||
export * from "./definitions/unionType";
|
||||
export * from "./definitions/wrapping";
|
||||
export * from "./definitions/_types";
|
||||
export * from "./dynamicMethod";
|
||||
export * from "./plugin";
|
||||
export * from "./plugins";
|
||||
export * from "./sdlConverter";
|
||||
export * from "./typegenAutoConfig";
|
||||
export * from "./typegenFormatPrettier";
|
||||
export * from "./typegenMetadata";
|
||||
export * from "./typegenPrinter";
|
||||
export * from "./typegenTypeHelpers";
|
||||
export * from "./utils";
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
import {
|
||||
GraphQLLeafType,
|
||||
GraphQLCompositeType,
|
||||
GraphQLInputObjectType,
|
||||
GraphQLScalarType,
|
||||
GraphQLObjectType,
|
||||
GraphQLInterfaceType,
|
||||
GraphQLUnionType,
|
||||
GraphQLEnumType,
|
||||
GraphQLFieldConfig,
|
||||
GraphQLObjectTypeConfig,
|
||||
GraphQLInterfaceTypeConfig,
|
||||
GraphQLSchema,
|
||||
GraphQLInputObjectType,
|
||||
GraphQLInputObjectTypeConfig,
|
||||
GraphQLInterfaceType,
|
||||
GraphQLInterfaceTypeConfig,
|
||||
GraphQLLeafType,
|
||||
GraphQLObjectType,
|
||||
GraphQLObjectTypeConfig,
|
||||
GraphQLScalarType,
|
||||
GraphQLSchema,
|
||||
GraphQLUnionType,
|
||||
} from "graphql";
|
||||
import {
|
||||
NexusFieldExtension,
|
||||
NexusObjectTypeExtension,
|
||||
NexusInterfaceTypeExtension,
|
||||
NexusSchemaExtension,
|
||||
NexusInputObjectTypeExtension,
|
||||
NexusInterfaceTypeExtension,
|
||||
NexusObjectTypeExtension,
|
||||
NexusSchemaExtension,
|
||||
} from "../extensions";
|
||||
|
||||
export type Maybe<T> = T | null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { GetGen2, AllInputTypes } from "../typegenTypeHelpers";
|
||||
import { AllInputTypes, GetGen2 } from "../typegenTypeHelpers";
|
||||
import { AllNexusInputTypeDefs } from "./wrapping";
|
||||
import { NexusTypes, withNexusSymbol } from "./_types";
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { GraphQLFieldResolver } from "graphql";
|
||||
import {
|
||||
AbstractTypeResolver,
|
||||
AllInputTypes,
|
||||
FieldResolver,
|
||||
GetGen,
|
||||
GetGen3,
|
||||
HasGen3,
|
||||
NeedsResolver,
|
||||
GetGen3,
|
||||
AllInputTypes,
|
||||
} from "../typegenTypeHelpers";
|
||||
import { ArgsRecord } from "./args";
|
||||
import { AllNexusOutputTypeDefs, AllNexusInputTypeDefs } from "./wrapping";
|
||||
import { AllNexusInputTypeDefs, AllNexusOutputTypeDefs } from "./wrapping";
|
||||
import { BaseScalars } from "./_types";
|
||||
import { GraphQLFieldResolver } from "graphql";
|
||||
|
||||
export interface CommonFieldConfig {
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { NexusTypes, withNexusSymbol, RootTypingDef } from "./_types";
|
||||
import { assertValidName } from "graphql";
|
||||
import { NexusTypes, RootTypingDef, withNexusSymbol } from "./_types";
|
||||
|
||||
type TypeScriptEnumLike = {
|
||||
[key: number]: string;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { NexusTypes, withNexusSymbol } from "./_types";
|
||||
import { InputDefinitionBlock } from "./definitionBlocks";
|
||||
import { assertValidName } from "graphql";
|
||||
import { GetGen } from "../typegenTypeHelpers";
|
||||
import { InputDefinitionBlock } from "./definitionBlocks";
|
||||
import { NexusTypes, withNexusSymbol } from "./_types";
|
||||
|
||||
export interface NexusExtendInputTypeConfig<TypeName extends string> {
|
||||
type: TypeName;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { NexusTypes, withNexusSymbol } from "./_types";
|
||||
import { OutputDefinitionBlock } from "./definitionBlocks";
|
||||
import { assertValidName } from "graphql";
|
||||
import { AllOutputTypesPossible } from "../typegenTypeHelpers";
|
||||
import { OutputDefinitionBlock } from "./definitionBlocks";
|
||||
import { NexusTypes, withNexusSymbol } from "./_types";
|
||||
|
||||
export interface NexusExtendTypeConfig<TypeName extends string> {
|
||||
type: TypeName;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { NexusTypes, NonNullConfig, withNexusSymbol } from "./_types";
|
||||
import { InputDefinitionBlock } from "./definitionBlocks";
|
||||
import { assertValidName } from "graphql";
|
||||
import { arg, NexusArgDef, NexusAsArgConfig } from "./args";
|
||||
import { InputDefinitionBlock } from "./definitionBlocks";
|
||||
import { NexusTypes, NonNullConfig, withNexusSymbol } from "./_types";
|
||||
|
||||
export interface NexusInputObjectTypeConfig<TypeName extends string> {
|
||||
/**
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { assertValidName } from "graphql";
|
||||
import { AbstractTypeResolver } from "../typegenTypeHelpers";
|
||||
import {
|
||||
OutputDefinitionBlock,
|
||||
AbstractOutputDefinitionBuilder,
|
||||
OutputDefinitionBlock,
|
||||
} from "./definitionBlocks";
|
||||
import {
|
||||
NexusTypes,
|
||||
NonNullConfig,
|
||||
withNexusSymbol,
|
||||
RootTypingDef,
|
||||
withNexusSymbol,
|
||||
} from "./_types";
|
||||
import { assertValidName } from "graphql";
|
||||
import { AbstractTypeResolver } from "../typegenTypeHelpers";
|
||||
|
||||
export type NexusInterfaceTypeConfig<TypeName extends string> = {
|
||||
name: TypeName;
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import { assertValidName } from "graphql";
|
||||
import { FieldResolver, GetGen } from "../typegenTypeHelpers";
|
||||
import {
|
||||
OutputDefinitionBlock,
|
||||
OutputDefinitionBuilder,
|
||||
} from "./definitionBlocks";
|
||||
import { GetGen, FieldResolver } from "../typegenTypeHelpers";
|
||||
import { NexusInterfaceTypeDef } from "./interfaceType";
|
||||
import {
|
||||
NonNullConfig,
|
||||
NexusTypes,
|
||||
withNexusSymbol,
|
||||
NonNullConfig,
|
||||
Omit,
|
||||
RootTypingDef,
|
||||
withNexusSymbol,
|
||||
} from "./_types";
|
||||
import { assertValidName } from "graphql";
|
||||
import { NexusInterfaceTypeDef } from "./interfaceType";
|
||||
|
||||
export type Implemented = GetGen<"interfaceNames"> | NexusInterfaceTypeDef<any>;
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import {
|
||||
GraphQLScalarTypeConfig,
|
||||
assertValidName,
|
||||
GraphQLScalarType,
|
||||
GraphQLScalarTypeConfig,
|
||||
} from "graphql";
|
||||
import { NexusTypes, withNexusSymbol, RootTypingDef } from "./_types";
|
||||
import { decorateType } from "./decorateType";
|
||||
import { NexusTypes, RootTypingDef, withNexusSymbol } from "./_types";
|
||||
|
||||
export interface ScalarBase
|
||||
extends Pick<
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { extendType } from "./extendType";
|
||||
import { CommonOutputFieldConfig } from "./definitionBlocks";
|
||||
import { GraphQLResolveInfo } from "graphql";
|
||||
import {
|
||||
ResultValue,
|
||||
MaybePromiseDeep,
|
||||
ArgsValue,
|
||||
GetGen,
|
||||
MaybePromise,
|
||||
MaybePromiseDeep,
|
||||
ResultValue,
|
||||
} from "../typegenTypeHelpers";
|
||||
import { CommonOutputFieldConfig } from "./definitionBlocks";
|
||||
import { extendType } from "./extendType";
|
||||
import { AllNexusOutputTypeDefs } from "./wrapping";
|
||||
import { AsyncIterator } from "./_types";
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { GetGen, AbstractTypeResolver } from "../typegenTypeHelpers";
|
||||
import { NexusTypes, withNexusSymbol, RootTypingDef } from "./_types";
|
||||
import { assertValidName } from "graphql";
|
||||
import { AbstractTypeResolver, GetGen } from "../typegenTypeHelpers";
|
||||
import { NexusObjectTypeDef } from "./objectType";
|
||||
import { NexusTypes, RootTypingDef, withNexusSymbol } from "./_types";
|
||||
|
||||
export interface UnionDefinitionBuilder<TypeName extends string> {
|
||||
setResolveType(fn: AbstractTypeResolver<TypeName>): void;
|
||||
|
|
|
@ -1,5 +1,15 @@
|
|||
import { GraphQLNamedType } from "graphql";
|
||||
import {
|
||||
DynamicInputMethodDef,
|
||||
DynamicOutputMethodDef,
|
||||
} from "../dynamicMethod";
|
||||
import { DynamicOutputPropertyDef } from "../dynamicProperty";
|
||||
import { NexusPlugin } from "../plugin";
|
||||
import { AllInputTypes } from "../typegenTypeHelpers";
|
||||
import { PrintedGenTyping, PrintedGenTypingImport } from "../utils";
|
||||
import { NexusArgDef } from "./args";
|
||||
import { NexusEnumTypeDef } from "./enumType";
|
||||
import { NexusExtendInputTypeDef } from "./extendInputType";
|
||||
import { NexusExtendTypeDef } from "./extendType";
|
||||
import { NexusInputObjectTypeDef } from "./inputObjectType";
|
||||
import { NexusInterfaceTypeDef } from "./interfaceType";
|
||||
|
@ -7,16 +17,6 @@ import { NexusObjectTypeDef } from "./objectType";
|
|||
import { NexusScalarTypeDef } from "./scalarType";
|
||||
import { NexusUnionTypeDef } from "./unionType";
|
||||
import { NexusTypes, NexusWrappedSymbol } from "./_types";
|
||||
import { NexusExtendInputTypeDef } from "./extendInputType";
|
||||
import {
|
||||
DynamicOutputMethodDef,
|
||||
DynamicInputMethodDef,
|
||||
} from "../dynamicMethod";
|
||||
import { NexusArgDef } from "./args";
|
||||
import { DynamicOutputPropertyDef } from "../dynamicProperty";
|
||||
import { AllInputTypes } from "../typegenTypeHelpers";
|
||||
import { PrintedGenTyping, PrintedGenTypingImport } from "../utils";
|
||||
import { NexusPlugin } from "../plugin";
|
||||
|
||||
export type AllNexusInputTypeDefs<T extends string = any> =
|
||||
| NexusInputObjectTypeDef<T>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { PluginBuilderLens } from "./builder";
|
||||
import {
|
||||
InputDefinitionBlock,
|
||||
OutputDefinitionBlock,
|
||||
} from "./definitions/definitionBlocks";
|
||||
import { withNexusSymbol, NexusTypes } from "./definitions/_types";
|
||||
import { PluginBuilderLens } from "./builder";
|
||||
import { NexusTypes, withNexusSymbol } from "./definitions/_types";
|
||||
|
||||
export type OutputFactoryConfig<T> = {
|
||||
stage: "walk" | "build";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { dynamicOutputMethod } from "../dynamicMethod";
|
||||
import { NexusObjectTypeDef, objectType } from "../definitions/objectType";
|
||||
import { GraphQLFieldResolver } from "graphql";
|
||||
import { intArg } from "../definitions/args";
|
||||
import { NexusObjectTypeDef, objectType } from "../definitions/objectType";
|
||||
import { dynamicOutputMethod } from "../dynamicMethod";
|
||||
|
||||
const basicCollectionMap = new Map<string, NexusObjectTypeDef<string>>();
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { dynamicOutputMethod } from "../dynamicMethod";
|
||||
import { objectType, NexusObjectTypeDef } from "../definitions/objectType";
|
||||
import { GraphQLFieldResolver } from "graphql";
|
||||
import { intArg, stringArg } from "../definitions/args";
|
||||
import { NexusObjectTypeDef, objectType } from "../definitions/objectType";
|
||||
import { dynamicOutputMethod } from "../dynamicMethod";
|
||||
|
||||
const relayConnectionMap = new Map<string, NexusObjectTypeDef<string>>();
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { withNexusSymbol, NexusTypes } from "./definitions/_types";
|
||||
import { BaseExtensionConfig } from "./dynamicMethod";
|
||||
import { SchemaBuilder } from "./builder";
|
||||
import { OutputDefinitionBlock } from "./definitions/definitionBlocks";
|
||||
import { NexusTypes, withNexusSymbol } from "./definitions/_types";
|
||||
import { BaseExtensionConfig } from "./dynamicMethod";
|
||||
|
||||
export type OutputPropertyFactoryConfig<T> = {
|
||||
stage: "walk" | "build";
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { NexusOutputFieldConfig } from "./definitions/definitionBlocks";
|
||||
import { NexusObjectTypeConfig } from "./definitions/objectType";
|
||||
import { SchemaConfig, DynamicFieldDefs } from "./builder";
|
||||
import { NexusInterfaceTypeConfig } from "./definitions/interfaceType";
|
||||
import { RootTypings } from "./definitions/_types";
|
||||
import { NexusInputObjectTypeConfig } from "./definitions/inputObjectType";
|
||||
import { GraphQLNamedType } from "graphql";
|
||||
import { DynamicFieldDefs, SchemaConfig } from "./builder";
|
||||
import { NexusOutputFieldConfig } from "./definitions/definitionBlocks";
|
||||
import { NexusInputObjectTypeConfig } from "./definitions/inputObjectType";
|
||||
import { NexusInterfaceTypeConfig } from "./definitions/interfaceType";
|
||||
import { NexusObjectTypeConfig } from "./definitions/objectType";
|
||||
import { RootTypings } from "./definitions/_types";
|
||||
|
||||
export type NexusGraphQLNamedType = GraphQLNamedType & {
|
||||
extensions?: {
|
||||
|
|
36
src/index.ts
36
src/index.ts
|
@ -1,5 +1,4 @@
|
|||
// All of the Public API definitions
|
||||
export { createPlugin, PluginConfig, PluginBuilderLens } from "./plugin";
|
||||
export { makeSchema } from "./builder";
|
||||
export {
|
||||
arg,
|
||||
|
@ -9,31 +8,36 @@ export {
|
|||
intArg,
|
||||
stringArg,
|
||||
} from "./definitions/args";
|
||||
export { decorateType } from "./definitions/decorateType";
|
||||
export { enumType } from "./definitions/enumType";
|
||||
export { extendType } from "./definitions/extendType";
|
||||
export { extendInputType } from "./definitions/extendInputType";
|
||||
export { extendType } from "./definitions/extendType";
|
||||
export { inputObjectType } from "./definitions/inputObjectType";
|
||||
export { interfaceType } from "./definitions/interfaceType";
|
||||
export { objectType, queryType, mutationType } from "./definitions/objectType";
|
||||
export { mutationField } from "./definitions/mutationField";
|
||||
export { mutationType, objectType, queryType } from "./definitions/objectType";
|
||||
export { queryField } from "./definitions/queryField";
|
||||
export { asNexusMethod, scalarType } from "./definitions/scalarType";
|
||||
export { subscriptionField } from "./definitions/subscriptionField";
|
||||
export { scalarType, asNexusMethod } from "./definitions/scalarType";
|
||||
export { decorateType } from "./definitions/decorateType";
|
||||
export { unionType } from "./definitions/unionType";
|
||||
export { convertSDL } from "./sdlConverter";
|
||||
export { groupTypes } from "./utils";
|
||||
export {
|
||||
FieldResolver,
|
||||
AllInputTypes,
|
||||
AllOutputTypes,
|
||||
FieldType,
|
||||
} from "./typegenTypeHelpers";
|
||||
export { dynamicInputMethod, dynamicOutputMethod } from "./dynamicMethod";
|
||||
export { dynamicOutputProperty } from "./dynamicProperty";
|
||||
export { core, blocks, ext };
|
||||
export { plugin } from "./plugin";
|
||||
export {
|
||||
createPlugin,
|
||||
plugin,
|
||||
PluginBuilderLens,
|
||||
PluginConfig,
|
||||
} from "./plugin";
|
||||
export * from "./plugins";
|
||||
import * as core from "./core";
|
||||
export { convertSDL } from "./sdlConverter";
|
||||
export {
|
||||
AllInputTypes,
|
||||
AllOutputTypes,
|
||||
FieldResolver,
|
||||
FieldType,
|
||||
} from "./typegenTypeHelpers";
|
||||
export { groupTypes } from "./utils";
|
||||
export { core, blocks, ext };
|
||||
import * as blocks from "./blocks";
|
||||
import * as core from "./core";
|
||||
import * as ext from "./dynamicMethods";
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
import {
|
||||
SchemaConfig,
|
||||
PluginBuilderLens,
|
||||
NexusAcceptedTypeDef,
|
||||
} from "./builder";
|
||||
import {
|
||||
GraphQLSchema,
|
||||
GraphQLResolveInfo,
|
||||
GraphQLFieldResolver,
|
||||
GraphQLResolveInfo,
|
||||
GraphQLSchema,
|
||||
} from "graphql";
|
||||
import {
|
||||
withNexusSymbol,
|
||||
NexusAcceptedTypeDef,
|
||||
PluginBuilderLens,
|
||||
SchemaConfig,
|
||||
} from "./builder";
|
||||
import {
|
||||
Maybe,
|
||||
NexusGraphQLFieldConfig,
|
||||
NexusGraphQLInterfaceTypeConfig,
|
||||
NexusGraphQLObjectTypeConfig,
|
||||
NexusTypes,
|
||||
Omit,
|
||||
NexusGraphQLFieldConfig,
|
||||
NexusGraphQLObjectTypeConfig,
|
||||
NexusGraphQLInterfaceTypeConfig,
|
||||
Maybe,
|
||||
withNexusSymbol,
|
||||
} from "./definitions/_types";
|
||||
import { NexusSchemaExtension } from "./extensions";
|
||||
import {
|
||||
isPromiseLike,
|
||||
PrintedGenTyping,
|
||||
venn,
|
||||
PrintedGenTypingImport,
|
||||
venn,
|
||||
} from "./utils";
|
||||
import { NexusSchemaExtension } from "./extensions";
|
||||
|
||||
export { PluginBuilderLens };
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
export * from "./nullabilityGuardPlugin";
|
||||
export * from "./fieldAuthorizePlugin";
|
||||
export * from "./queryComplexityPlugin";
|
||||
import * as connectionPluginCore from "./connectionPlugin";
|
||||
export { connectionPluginCore };
|
||||
export { connectionPlugin } from "./connectionPlugin";
|
||||
export * from "./fieldAuthorizePlugin";
|
||||
export * from "./nullabilityGuardPlugin";
|
||||
export * from "./queryComplexityPlugin";
|
||||
export { connectionPluginCore };
|
||||
import * as connectionPluginCore from "./connectionPlugin";
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
import {
|
||||
GraphQLNullableType,
|
||||
GraphQLOutputType,
|
||||
GraphQLResolveInfo,
|
||||
isEnumType,
|
||||
isInterfaceType,
|
||||
isListType,
|
||||
isNonNullType,
|
||||
isObjectType,
|
||||
isScalarType,
|
||||
GraphQLOutputType,
|
||||
GraphQLResolveInfo,
|
||||
isWrappingType,
|
||||
isUnionType,
|
||||
isInterfaceType,
|
||||
GraphQLNullableType,
|
||||
isWrappingType,
|
||||
} from "graphql";
|
||||
import { forEach } from "iterall";
|
||||
import { plugin, CreateFieldResolverInfo } from "../plugin";
|
||||
import { GetGen, GetGen2, AllOutputTypes } from "../typegenTypeHelpers";
|
||||
import { printedGenTyping, isPromiseLike } from "../utils";
|
||||
import { GraphQLPossibleOutputs } from "../definitions/_types";
|
||||
import { NexusGraphQLNamedType } from "../extensions";
|
||||
import { CreateFieldResolverInfo, plugin } from "../plugin";
|
||||
import { AllOutputTypes, GetGen, GetGen2 } from "../typegenTypeHelpers";
|
||||
import { isPromiseLike, printedGenTyping } from "../utils";
|
||||
|
||||
export interface NullabilityPluginFallbackFn {
|
||||
ctx: GetGen<"context">;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { GraphQLSchema, isOutputType, GraphQLNamedType } from "graphql";
|
||||
import { GraphQLNamedType, GraphQLSchema, isOutputType } from "graphql";
|
||||
import path from "path";
|
||||
import { TypegenInfo } from "./builder";
|
||||
import { TYPEGEN_HEADER } from "./lang";
|
||||
import { log, objValues, relativePathTo } from "./utils";
|
||||
import { TypegenInfo } from "./builder";
|
||||
|
||||
/**
|
||||
* Any common types / constants that would otherwise be circular-imported
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { GraphQLSchema, lexicographicSortSchema, printSchema } from "graphql";
|
||||
import path from "path";
|
||||
import { TypegenPrinter } from "./typegenPrinter";
|
||||
import { BuilderConfig, TypegenInfo } from "./builder";
|
||||
import { NexusGraphQLSchema } from "./definitions/_types";
|
||||
import { SDL_HEADER, TYPEGEN_HEADER } from "./lang";
|
||||
import { typegenAutoConfig } from "./typegenAutoConfig";
|
||||
import {
|
||||
typegenFormatPrettier,
|
||||
TypegenFormatFn,
|
||||
typegenFormatPrettier,
|
||||
} from "./typegenFormatPrettier";
|
||||
import { TypegenInfo, BuilderConfig } from "./builder";
|
||||
import { NexusGraphQLSchema } from "./definitions/_types";
|
||||
import { TypegenPrinter } from "./typegenPrinter";
|
||||
|
||||
export interface TypegenMetadataConfig
|
||||
extends Omit<BuilderConfig, "outputs" | "shouldGenerateArtifacts"> {
|
||||
|
|
|
@ -171,8 +171,8 @@ export class TypegenPrinter {
|
|||
? relativePathTo(val.path, outputPath)
|
||||
: val.path
|
||||
)
|
||||
.replace(/(\.d)?\.ts/, "")
|
||||
.replace(/\\+/g, "/");
|
||||
.replace(/(\.d)?\.ts/, "")
|
||||
.replace(/\\+/g, "/");
|
||||
importMap[importPath] = importMap[importPath] || new Set();
|
||||
importMap[importPath].add(
|
||||
val.alias ? `${val.name} as ${val.alias}` : val.name
|
||||
|
|
34
src/utils.ts
34
src/utils.ts
|
@ -1,32 +1,32 @@
|
|||
import {
|
||||
GraphQLObjectType,
|
||||
GraphQLInterfaceType,
|
||||
GraphQLSchema,
|
||||
GraphQLInputObjectType,
|
||||
GraphQLUnionType,
|
||||
GraphQLEnumType,
|
||||
GraphQLInputObjectType,
|
||||
GraphQLInterfaceType,
|
||||
GraphQLNamedType,
|
||||
GraphQLObjectType,
|
||||
GraphQLResolveInfo,
|
||||
GraphQLScalarType,
|
||||
isObjectType,
|
||||
GraphQLSchema,
|
||||
GraphQLType,
|
||||
GraphQLUnionType,
|
||||
isEnumType,
|
||||
isInputObjectType,
|
||||
isInterfaceType,
|
||||
isListType,
|
||||
isNonNullType,
|
||||
isObjectType,
|
||||
isScalarType,
|
||||
isSpecifiedScalarType,
|
||||
isUnionType,
|
||||
isInterfaceType,
|
||||
isEnumType,
|
||||
specifiedScalarTypes,
|
||||
GraphQLNamedType,
|
||||
GraphQLType,
|
||||
isWrappingType,
|
||||
isListType,
|
||||
isNonNullType,
|
||||
GraphQLResolveInfo,
|
||||
specifiedScalarTypes,
|
||||
} from "graphql";
|
||||
import path from "path";
|
||||
import { BuilderConfig } from "./builder";
|
||||
import { TypegenMetadataConfig } from "./typegenMetadata";
|
||||
import { MissingType, withNexusSymbol, NexusTypes } from "./definitions/_types";
|
||||
import { PluginConfig } from "./plugin";
|
||||
import { decorateType } from "./definitions/decorateType";
|
||||
import { MissingType, NexusTypes, withNexusSymbol } from "./definitions/_types";
|
||||
import { PluginConfig } from "./plugin";
|
||||
import { TypegenMetadataConfig } from "./typegenMetadata";
|
||||
|
||||
export const isInterfaceField = (
|
||||
type: GraphQLObjectType,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { objectType, inputObjectType } from "../src";
|
||||
import { inputObjectType, objectType } from "../src";
|
||||
|
||||
/**
|
||||
* Used in testing, creates a generic "User" object
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { graphql } from "graphql";
|
||||
import {
|
||||
makeSchema,
|
||||
queryField,
|
||||
arg,
|
||||
booleanArg,
|
||||
floatArg,
|
||||
idArg,
|
||||
stringArg,
|
||||
intArg,
|
||||
makeSchema,
|
||||
objectType,
|
||||
arg,
|
||||
queryField,
|
||||
stringArg,
|
||||
} from "../src/core";
|
||||
|
||||
describe("interfaceType", () => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as path from "path";
|
||||
import { core, makeSchema, queryType, enumType } from "..";
|
||||
import { core, enumType, makeSchema, queryType } from "..";
|
||||
import { A, B } from "./_types";
|
||||
|
||||
const { TypegenPrinter, TypegenMetadata } = core;
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
/// <reference types="jest" />
|
||||
import { GraphQLEnumType, GraphQLObjectType, printType } from "graphql";
|
||||
import {
|
||||
idArg,
|
||||
enumType,
|
||||
extendType,
|
||||
objectType,
|
||||
inputObjectType,
|
||||
extendInputType,
|
||||
makeSchema,
|
||||
} from "../src";
|
||||
import { UserObject, PostObject } from "./_helpers";
|
||||
import { TypeMap } from "graphql/type/schema";
|
||||
import {
|
||||
enumType,
|
||||
extendInputType,
|
||||
extendType,
|
||||
idArg,
|
||||
inputObjectType,
|
||||
makeSchema,
|
||||
objectType,
|
||||
} from "../src";
|
||||
import { PostObject, UserObject } from "./_helpers";
|
||||
|
||||
enum NativeColors {
|
||||
RED = "RED",
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import path from "path";
|
||||
import { graphql } from "graphql";
|
||||
import { GraphQLDateTime } from "graphql-iso-date";
|
||||
import path from "path";
|
||||
import {
|
||||
decorateType,
|
||||
dynamicInputMethod,
|
||||
ext,
|
||||
inputObjectType,
|
||||
makeSchema,
|
||||
objectType,
|
||||
queryType,
|
||||
inputObjectType,
|
||||
dynamicInputMethod,
|
||||
decorateType,
|
||||
ext,
|
||||
} from "../src";
|
||||
import { graphql } from "graphql";
|
||||
import { CatListFixture } from "./_fixtures";
|
||||
import { dynamicOutputProperty } from "../src/dynamicProperty";
|
||||
import { CatListFixture } from "./_fixtures";
|
||||
|
||||
let spy: jest.SpyInstance;
|
||||
beforeEach(() => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { interfaceType, objectType, makeSchema } from "../../src";
|
||||
import { GraphQLSchema } from "graphql";
|
||||
import { interfaceType, makeSchema, objectType } from "../../src";
|
||||
|
||||
describe("GH #361, interfaceType & implements", () => {
|
||||
test("should pass", () => {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { graphql } from "graphql";
|
||||
import {
|
||||
inputObjectType,
|
||||
makeSchema,
|
||||
objectType,
|
||||
queryField,
|
||||
inputObjectType,
|
||||
} from "../src/core";
|
||||
|
||||
describe("inputObject", () => {
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import "./_app.typegen";
|
||||
import {
|
||||
objectType,
|
||||
idArg,
|
||||
queryType,
|
||||
mutationType,
|
||||
stringArg,
|
||||
inputObjectType,
|
||||
extendType,
|
||||
dynamicOutputMethod,
|
||||
dynamicInputMethod,
|
||||
dynamicOutputMethod,
|
||||
dynamicOutputProperty,
|
||||
extendType,
|
||||
idArg,
|
||||
inputObjectType,
|
||||
mutationType,
|
||||
objectType,
|
||||
queryType,
|
||||
stringArg,
|
||||
} from "../../src";
|
||||
import "./_app.typegen";
|
||||
|
||||
export const query = queryType({
|
||||
definition(t) {
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
* Do not make changes to this file directly
|
||||
*/
|
||||
|
||||
import { core } from "../..";
|
||||
declare global {
|
||||
interface NexusGenCustomInputMethods<TypeName extends string> {
|
||||
title(...args: any): void;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import path from "path";
|
||||
import os from "os";
|
||||
import { queryField } from "../src/definitions/queryField";
|
||||
import { makeSchema, makeSchemaInternal, generateSchema } from "../src/builder";
|
||||
import { printSchema } from "graphql";
|
||||
import os from "os";
|
||||
import path from "path";
|
||||
import { generateSchema, makeSchema } from "../src/builder";
|
||||
import { queryField } from "../src/definitions/queryField";
|
||||
|
||||
describe("makeSchema", () => {
|
||||
describe("shouldExitAfterGenerateArtifacts", () => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { makeSchema, queryType, intArg, core } from "../src";
|
||||
import { printSchema } from "graphql";
|
||||
import { core, intArg, makeSchema, queryType } from "../src";
|
||||
|
||||
describe("nonNullDefaults", () => {
|
||||
test("true/true on schema", () => {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { buildSchema, graphql, GraphQLSchema, printSchema } from "graphql";
|
||||
import {
|
||||
makeSchema,
|
||||
MiddlewareFn,
|
||||
objectType,
|
||||
plugin,
|
||||
queryField,
|
||||
MiddlewareFn,
|
||||
} from "../src/core";
|
||||
import { buildSchema, GraphQLSchema, graphql, printSchema } from "graphql";
|
||||
import { EXAMPLE_SDL } from "./_sdl";
|
||||
import { nullabilityGuardPlugin } from "../src/plugins";
|
||||
import { EXAMPLE_SDL } from "./_sdl";
|
||||
|
||||
const nullGuardPlugin = nullabilityGuardPlugin({
|
||||
shouldGuard: true,
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { printSchema } from "graphql";
|
||||
import {
|
||||
createPlugin,
|
||||
makeSchema,
|
||||
objectType,
|
||||
PluginConfig,
|
||||
queryType,
|
||||
objectType,
|
||||
} from "../src";
|
||||
import { printSchema } from "graphql";
|
||||
import { NexusAcceptedTypeDef, inputObjectType, extendType } from "../src/core";
|
||||
import { extendType, inputObjectType, NexusAcceptedTypeDef } from "../src/core";
|
||||
|
||||
const fooObject = objectType({
|
||||
name: "foo",
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import {
|
||||
printType,
|
||||
execute,
|
||||
parse,
|
||||
GraphQLFieldResolver,
|
||||
GraphQLError,
|
||||
ExecutionArgs,
|
||||
GraphQLError,
|
||||
GraphQLFieldResolver,
|
||||
parse,
|
||||
printSchema,
|
||||
printType,
|
||||
} from "graphql";
|
||||
import { connectionFromArray } from "graphql-relay";
|
||||
import { connectionPlugin, makeSchema, objectType, arg } from "../../src";
|
||||
import { arg, connectionPlugin, makeSchema, objectType } from "../../src";
|
||||
import {
|
||||
ConnectionPluginConfig,
|
||||
ConnectionFieldConfig,
|
||||
ConnectionPluginConfig,
|
||||
} from "../../src/plugins/connectionPlugin";
|
||||
|
||||
const userNodes: { id: string; name: string }[] = [];
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { graphql } from "graphql";
|
||||
import path from "path";
|
||||
import {
|
||||
objectType,
|
||||
makeSchema,
|
||||
queryField,
|
||||
fieldAuthorizePlugin,
|
||||
makeSchema,
|
||||
objectType,
|
||||
queryField,
|
||||
} from "../../src";
|
||||
import { graphql } from "graphql";
|
||||
import { generateSchema } from "../../src/core";
|
||||
|
||||
describe("fieldAuthorizePlugin", () => {
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
import { GraphQLObjectType, GraphQLNonNull, GraphQLID, graphql } from "graphql";
|
||||
import { graphql, GraphQLID, GraphQLNonNull, GraphQLObjectType } from "graphql";
|
||||
import {
|
||||
objectType,
|
||||
queryField,
|
||||
nullabilityGuardPlugin,
|
||||
enumType,
|
||||
interfaceType,
|
||||
makeSchema,
|
||||
NullabilityGuardConfig,
|
||||
nullabilityGuardPlugin,
|
||||
objectType,
|
||||
queryField,
|
||||
unionType,
|
||||
interfaceType,
|
||||
enumType,
|
||||
} from "../../src";
|
||||
import { NexusGraphQLSchema } from "../../src/core";
|
||||
|
||||
const NODE_ENV = process.env.NODE_ENV;
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { GraphQLObjectType } from "graphql";
|
||||
import path from "path";
|
||||
import {
|
||||
objectType,
|
||||
makeSchema,
|
||||
queryField,
|
||||
objectType,
|
||||
queryComplexityPlugin,
|
||||
queryField,
|
||||
} from "../../src";
|
||||
import { GraphQLObjectType } from "graphql";
|
||||
import { generateSchema } from "../../src/core";
|
||||
|
||||
describe("queryComplexityPlugin", () => {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { graphql } from "graphql";
|
||||
import { GraphQLDate, GraphQLDateTime } from "graphql-iso-date";
|
||||
import {
|
||||
asNexusMethod,
|
||||
inputObjectType,
|
||||
makeSchema,
|
||||
objectType,
|
||||
queryField,
|
||||
asNexusMethod,
|
||||
inputObjectType,
|
||||
} from "../src/core";
|
||||
import { graphql } from "graphql";
|
||||
import { GraphQLDateTime, GraphQLDate } from "graphql-iso-date";
|
||||
|
||||
describe("scalarType", () => {
|
||||
it("asNexusMethod: should wrap a scalar and make it available on the builder", async () => {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import {
|
||||
buildSchema,
|
||||
GraphQLField,
|
||||
GraphQLObjectType,
|
||||
GraphQLInterfaceType,
|
||||
GraphQLObjectType,
|
||||
} from "graphql";
|
||||
import * as path from "path";
|
||||
import { core } from "../src";
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { Kind } from "graphql";
|
||||
import {
|
||||
objectType,
|
||||
makeSchemaInternal,
|
||||
makeSchema,
|
||||
makeSchemaInternal,
|
||||
objectType,
|
||||
UNKNOWN_TYPE_SCALAR,
|
||||
} from "../src/core";
|
||||
import { Kind } from "graphql";
|
||||
|
||||
describe("unknownType", () => {
|
||||
const Query = objectType({
|
||||
|
|
Loading…
Reference in New Issue