Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
chore(lint): pin eslint-plugin-import to 2.22.0
Browse files Browse the repository at this point in the history
To avoid windows import/order error,

see: import-js/eslint-plugin-import#1643
  • Loading branch information
yaacovCR committed Feb 13, 2020
1 parent 39a5a33 commit bc59617
Show file tree
Hide file tree
Showing 81 changed files with 430 additions and 434 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"dataloader": "^2.0.0",
"dateformat": "^3.0.3",
"eslint": "^6.8.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-import": "2.20.0",
"eslint-watch": "^6.0.1",
"express": "^4.17.1",
"express-graphql": "^0.9.0",
Expand Down
7 changes: 3 additions & 4 deletions src/Interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import { SchemaDirectiveVisitor } from './utils/SchemaDirectiveVisitor';
import { SchemaVisitor } from './utils/SchemaVisitor';

import {
GraphQLSchema,
GraphQLField,
Expand Down Expand Up @@ -29,9 +26,11 @@ import {
} from 'graphql';

import { TypeMap } from 'graphql/type/schema';

import { ApolloLink } from 'apollo-link';

import { SchemaVisitor } from './utils/SchemaVisitor';
import { SchemaDirectiveVisitor } from './utils/SchemaDirectiveVisitor';

/* TODO: Add documentation */

export type UnitOrList<Type> = Type | Array<Type>;
Expand Down
23 changes: 11 additions & 12 deletions src/generate/addResolversToSchema.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import {
GraphQLField,
GraphQLEnumType,
GraphQLScalarType,
GraphQLSchema,
GraphQLObjectType,
GraphQLInterfaceType,
isSpecifiedScalarType,
GraphQLUnionType,
} from 'graphql';

import {
IResolvers,
IResolverValidationOptions,
IAddResolversToSchemaOptions,
} from '../Interfaces';

import {
parseInputValue,
serializeInputValue,
Expand All @@ -16,17 +26,6 @@ import SchemaError from './SchemaError';
import checkForResolveTypeResolver from './checkForResolveTypeResolver';
import extendResolversFromInterfaces from './extendResolversFromInterfaces';

import {
GraphQLField,
GraphQLEnumType,
GraphQLScalarType,
GraphQLSchema,
GraphQLObjectType,
GraphQLInterfaceType,
isSpecifiedScalarType,
GraphQLUnionType,
} from 'graphql';

function addResolversToSchema(
schemaOrOptions: GraphQLSchema | IAddResolversToSchemaOptions,
legacyInputResolvers?: IResolvers,
Expand Down
10 changes: 5 additions & 5 deletions src/generate/assertResolversPresent.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { IResolverValidationOptions } from '../Interfaces';
import { forEachField } from '../utils';

import SchemaError from './SchemaError';

import {
GraphQLSchema,
GraphQLField,
getNamedType,
GraphQLScalarType,
} from 'graphql';

import { IResolverValidationOptions } from '../Interfaces';
import { forEachField } from '../utils';

import SchemaError from './SchemaError';

function assertResolversPresent(
schema: GraphQLSchema,
resolverValidationOptions: IResolverValidationOptions = {},
Expand Down
6 changes: 3 additions & 3 deletions src/generate/attachConnectorsToContext.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { deprecated } from 'deprecated-decorator';
import { GraphQLSchema, GraphQLFieldResolver } from 'graphql';

import { IConnectors, IConnector, IConnectorCls } from '../Interfaces';

import addSchemaLevelResolver from './addSchemaLevelResolver';

import { deprecated } from 'deprecated-decorator';
import { GraphQLSchema, GraphQLFieldResolver } from 'graphql';

// takes a GraphQL-JS schema and an object of connectors, then attaches
// the connectors to the context by wrapping each query or mutation resolve
// function with a function that attaches connectors if they don't exist.
Expand Down
4 changes: 2 additions & 2 deletions src/generate/attachDirectiveResolvers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { GraphQLSchema, GraphQLField, defaultFieldResolver } from 'graphql';

import { IDirectiveResolvers } from '../Interfaces';
import { SchemaDirectiveVisitor } from '../utils/SchemaDirectiveVisitor';

import { GraphQLSchema, GraphQLField, defaultFieldResolver } from 'graphql';

function attachDirectiveResolvers(
schema: GraphQLSchema,
directiveResolvers: IDirectiveResolvers,
Expand Down
12 changes: 6 additions & 6 deletions src/generate/buildSchemaFromTypeDefinitions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
import { ITypeDefinitions, GraphQLParseOptions } from '../Interfaces';

import extractExtensionDefinitions from './extractExtensionDefinitions';
import concatenateTypeDefs from './concatenateTypeDefs';
import SchemaError from './SchemaError';

import {
parse,
extendSchema,
Expand All @@ -13,6 +7,12 @@ import {
ASTNode,
} from 'graphql';

import { ITypeDefinitions, GraphQLParseOptions } from '../Interfaces';

import extractExtensionDefinitions from './extractExtensionDefinitions';
import concatenateTypeDefs from './concatenateTypeDefs';
import SchemaError from './SchemaError';

function buildSchemaFromTypeDefinitions(
typeDefinitions: ITypeDefinitions,
parseOptions?: GraphQLParseOptions,
Expand Down
4 changes: 2 additions & 2 deletions src/generate/checkForResolveTypeResolver.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SchemaError from './SchemaError';

import { GraphQLInterfaceType, GraphQLUnionType, GraphQLSchema } from 'graphql';

import SchemaError from './SchemaError';

// If we have any union or interface types throw if no there is no resolveType or isTypeOf resolvers
function checkForResolveTypeResolver(
schema: GraphQLSchema,
Expand Down
4 changes: 2 additions & 2 deletions src/generate/concatenateTypeDefs.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { print, ASTNode } from 'graphql';

import { ITypedef } from '../Interfaces';

import SchemaError from './SchemaError';

import { print, ASTNode } from 'graphql';

function concatenateTypeDefs(
typeDefinitionsAry: Array<ITypedef>,
calledFunctionRefs = [] as any,
Expand Down
4 changes: 2 additions & 2 deletions src/generate/decorateWithLogger.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ILogger } from '../Interfaces';

import { defaultFieldResolver, GraphQLFieldResolver } from 'graphql';

import { ILogger } from '../Interfaces';

/*
* fn: The function to decorate with the logger
* logger: an object instance of type Logger
Expand Down
4 changes: 2 additions & 2 deletions src/generate/extendResolversFromInterfaces.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IResolvers } from '../Interfaces';

import { GraphQLObjectType, GraphQLSchema } from 'graphql';

import { IResolvers } from '../Interfaces';

function extendResolversFromInterfaces(
schema: GraphQLSchema,
resolvers: IResolvers,
Expand Down
13 changes: 6 additions & 7 deletions src/makeExecutableSchema.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { IExecutableSchemaDefinition, ILogger } from './Interfaces';
import {
defaultFieldResolver,
GraphQLSchema,
GraphQLFieldResolver,
} from 'graphql';

import { IExecutableSchemaDefinition, ILogger } from './Interfaces';
import {
SchemaDirectiveVisitor,
forEachField,
mergeDeep
} from './utils';

import {
attachDirectiveResolvers,
assertResolversPresent,
Expand All @@ -17,11 +21,6 @@ import {
SchemaError
} from './generate';

import {
defaultFieldResolver,
GraphQLSchema,
GraphQLFieldResolver,
} from 'graphql';

export function makeExecutableSchema<TContext = any>({
typeDefs,
Expand Down
24 changes: 12 additions & 12 deletions src/mock.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
import { buildSchemaFromTypeDefinitions } from './makeExecutableSchema';
import { forEachField } from './utils';

import {
IMocks,
IMockServer,
IMockOptions,
IMockFn,
IMockTypeFn,
ITypeDefinitions,
} from './Interfaces';

import {
graphql,
GraphQLSchema,
Expand All @@ -29,6 +17,18 @@ import {
} from 'graphql';
import { v4 as uuid } from 'uuid';

import { buildSchemaFromTypeDefinitions } from './makeExecutableSchema';
import { forEachField } from './utils';

import {
IMocks,
IMockServer,
IMockOptions,
IMockFn,
IMockTypeFn,
ITypeDefinitions,
} from './Interfaces';

// This function wraps addMocksToSchema for more convenience
function mockServer(
schema: GraphQLSchema | ITypeDefinitions,
Expand Down
35 changes: 18 additions & 17 deletions src/stitching/checkResultAndHandleErrors.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
import {
SubschemaConfig,
IGraphQLToolsResolveInfo,
isSubschemaConfig,
MergedTypeInfo,
} from '../Interfaces';

import {
relocatedError,
combineErrors,
getErrorsByPathSegment,
} from './errors';
import { getResponseKeyFromInfo } from './getResponseKeyFromInfo';
import resolveFromParentTypename from './resolveFromParentTypename';
import { setErrors, setObjectSubschema } from './proxiedResult';
import { mergeFields } from './mergeFields';

import {
GraphQLResolveInfo,
responsePathAsArray,
Expand All @@ -35,6 +18,24 @@ import {
} from 'graphql';
import { collectFields, ExecutionContext } from 'graphql/execution/execute';

import {
SubschemaConfig,
IGraphQLToolsResolveInfo,
isSubschemaConfig,
MergedTypeInfo,
} from '../Interfaces';

import {
relocatedError,
combineErrors,
getErrorsByPathSegment,
} from './errors';
import { getResponseKeyFromInfo } from './getResponseKeyFromInfo';
import resolveFromParentTypename from './resolveFromParentTypename';
import { setErrors, setObjectSubschema } from './proxiedResult';
import { mergeFields } from './mergeFields';


export function checkResultAndHandleErrors(
result: ExecutionResult,
context: Record<string, any>,
Expand Down
18 changes: 9 additions & 9 deletions src/stitching/createRequest.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
import {
ICreateRequestFromInfo,
Operation,
Request,
SubschemaConfig,
isSubschemaConfig,
} from '../Interfaces';
import { serializeInputValue } from '../utils';

import {
ArgumentNode,
FieldNode,
Expand All @@ -30,6 +21,15 @@ import {
SelectionSetNode,
} from 'graphql';

import {
ICreateRequestFromInfo,
Operation,
Request,
SubschemaConfig,
isSubschemaConfig,
} from '../Interfaces';
import { serializeInputValue } from '../utils';

export function getDelegatingOperation(
parentType: GraphQLObjectType,
schema: GraphQLSchema
Expand Down
4 changes: 2 additions & 2 deletions src/stitching/defaultMergedResolver.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { defaultFieldResolver } from 'graphql';

import { IGraphQLToolsResolveInfo } from '../Interfaces';

import { getErrors, getSubschema } from './proxiedResult';
import { handleResult } from './checkResultAndHandleErrors';
import { getResponseKeyFromInfo } from './getResponseKeyFromInfo';

import { defaultFieldResolver } from 'graphql';

// Resolver that knows how to:
// a) handle aliases for proxied schemas
// b) handle errors from proxied schemas
Expand Down
22 changes: 11 additions & 11 deletions src/stitching/delegateToSchema.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
import { isAsyncIterable } from 'iterall';
import { ApolloLink, execute as executeLink } from 'apollo-link';
import {
subscribe,
execute,
validate,
GraphQLSchema,
ExecutionResult,
GraphQLOutputType,
} from 'graphql';

import {
IDelegateToSchemaOptions,
IDelegateRequestOptions,
Expand Down Expand Up @@ -29,17 +40,6 @@ import { observableToAsyncIterable } from './observableToAsyncIterable';
import mapAsyncIterator from './mapAsyncIterator';
import { combineErrors } from './errors';

import { isAsyncIterable } from 'iterall';
import { ApolloLink, execute as executeLink } from 'apollo-link';
import {
subscribe,
execute,
validate,
GraphQLSchema,
ExecutionResult,
GraphQLOutputType,
} from 'graphql';

export default function delegateToSchema(
options: IDelegateToSchemaOptions | GraphQLSchema,
): any {
Expand Down
11 changes: 5 additions & 6 deletions src/stitching/introspectSchema.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import { Fetcher } from '../Interfaces';

import { combineErrors } from './errors';
import linkToFetcher from './linkToFetcher';

import { ApolloLink } from 'apollo-link';

import {
GraphQLSchema,
DocumentNode,
Expand All @@ -13,6 +7,11 @@ import {
parse,
} from 'graphql';

import { Fetcher } from '../Interfaces';

import { combineErrors } from './errors';
import linkToFetcher from './linkToFetcher';

const parsedIntrospectionQuery: DocumentNode = parse(introspectionQuery);

export default function introspectSchema(
Expand Down
Loading

0 comments on commit bc59617

Please sign in to comment.