Skip to content

Commit

Permalink
standardize ExecutionResult
Browse files Browse the repository at this point in the history
to be from internal polyfill
this can probably be changed back to import from graphql after support for versions < 15.2 is dropped

See:
https://github.com/graphql/graphql-js/releases/tag/v15.2.0
graphql/graphql-js#2644
  • Loading branch information
yaacovCR committed Jul 5, 2020
1 parent ed567ad commit d572537
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 16 deletions.
3 changes: 1 addition & 2 deletions packages/delegate/src/delegateToSchema.ts
Expand Up @@ -3,7 +3,6 @@ import {
execute,
validate,
GraphQLSchema,
ExecutionResult,
isSchema,
FieldDefinitionNode,
getOperationAST,
Expand All @@ -14,7 +13,7 @@ import {
GraphQLObjectType,
} from 'graphql';

import { mapAsyncIterator, Transform } from '@graphql-tools/utils';
import { mapAsyncIterator, Transform, ExecutionResult } from '@graphql-tools/utils';

import { IDelegateToSchemaOptions, IDelegateRequestOptions, SubschemaConfig, ExecutionParams } from './types';

Expand Down
@@ -1,6 +1,6 @@
import { GraphQLResolveInfo, ExecutionResult, GraphQLOutputType, GraphQLSchema } from 'graphql';
import { GraphQLResolveInfo, GraphQLOutputType, GraphQLSchema } from 'graphql';

import { Transform, getResponseKeyFromInfo } from '@graphql-tools/utils';
import { Transform, getResponseKeyFromInfo, ExecutionResult } from '@graphql-tools/utils';
import { handleResult } from '../results/handleResult';
import { SubschemaConfig } from '../types';

Expand Down
4 changes: 3 additions & 1 deletion packages/mock/src/types.ts
@@ -1,4 +1,6 @@
import { GraphQLFieldResolver, GraphQLType, GraphQLSchema, ExecutionResult } from 'graphql';
import { GraphQLFieldResolver, GraphQLType, GraphQLSchema } from 'graphql';

import { ExecutionResult } from '@graphql-tools/utils';

/* XXX on mocks, args are optional, Not sure if a bug. */
export type IMockFn = GraphQLFieldResolver<any, any>;
Expand Down
3 changes: 2 additions & 1 deletion packages/schema/tests/resolution.test.ts
Expand Up @@ -3,13 +3,14 @@ import {
parse,
graphql,
subscribe,
ExecutionResult,
graphqlSync,
} from 'graphql';
import { PubSub } from 'graphql-subscriptions';

import { makeExecutableSchema, addSchemaLevelResolver } from '@graphql-tools/schema';

import { ExecutionResult } from '@graphql-tools/utils';

import { forAwaitEach } from './forAwaitEach';

describe('Resolve', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/schema/tests/schemaGenerator.test.ts
Expand Up @@ -13,7 +13,6 @@ import {
Kind,
IntValueNode,
parse,
ExecutionResult,
GraphQLError,
GraphQLEnumType,
execute,
Expand Down Expand Up @@ -42,7 +41,8 @@ import {
NextResolverFn,
VisitSchemaKind,
ITypeDefinitions,
visitSchema
visitSchema,
ExecutionResult
} from '@graphql-tools/utils';

import TypeA from './fixtures/circularSchemaA';
Expand Down
5 changes: 3 additions & 2 deletions packages/stitch/tests/alternateStitchSchemas.test.ts
@@ -1,7 +1,6 @@
import {
graphql,
GraphQLSchema,
ExecutionResult,
subscribe,
parse,
GraphQLScalarType,
Expand Down Expand Up @@ -40,7 +39,9 @@ import { makeExecutableSchema } from '@graphql-tools/schema';
import {
wrapFieldNode,
renameFieldNode,
hoistFieldNodes, filterSchema
hoistFieldNodes,
filterSchema,
ExecutionResult,
} from '@graphql-tools/utils';

import { stitchSchemas } from '../src/stitchSchemas';
Expand Down
2 changes: 1 addition & 1 deletion packages/stitch/tests/stitchSchemas.test.ts
Expand Up @@ -6,7 +6,6 @@ import {
GraphQLScalarType,
subscribe,
parse,
ExecutionResult,
defaultFieldResolver,
findDeprecatedUsages,
printSchema,
Expand All @@ -20,6 +19,7 @@ import {
getResolversFromSchema,
SchemaDirectiveVisitor,
IResolvers,
ExecutionResult,
} from '@graphql-tools/utils';
import { addMocksToSchema } from '@graphql-tools/mock';

Expand Down
4 changes: 3 additions & 1 deletion packages/stitch/tests/typeMerging.example.test.ts
@@ -1,10 +1,12 @@
// Conversion of Apollo Federation demo from https://github.com/apollographql/federation-demo.
// See: https://github.com/ardatan/graphql-tools/issues/1697

import { graphql, ExecutionResult } from 'graphql';
import { graphql } from 'graphql';

import { makeExecutableSchema } from '@graphql-tools/schema';

import { ExecutionResult } from '@graphql-tools/utils';

import { stitchSchemas } from '../src/stitchSchemas';

describe('merging using type merging', () => {
Expand Down
6 changes: 4 additions & 2 deletions packages/utils/tests/directives.test.ts
@@ -1,7 +1,6 @@
import { createHash } from 'crypto';

import {
ExecutionResult,
GraphQLArgument,
GraphQLEnumType,
GraphQLEnumValue,
Expand Down Expand Up @@ -29,9 +28,12 @@ import {
import formatDate from 'dateformat';

import { makeExecutableSchema } from '@graphql-tools/schema';
import { VisitableSchemaType, SchemaDirectiveVisitor,
import {
VisitableSchemaType,
SchemaDirectiveVisitor,
SchemaVisitor,
visitSchema,
ExecutionResult,
} from '@graphql-tools/utils';

const typeDefs = `
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/tests/schemaTransforms.test.ts
Expand Up @@ -7,7 +7,6 @@ import {
defaultFieldResolver,
graphql,
GraphQLString,
ExecutionResult,
GraphQLScalarType,
StringValueNode,
GraphQLInputFieldConfig,
Expand All @@ -31,6 +30,7 @@ import {
mapSchema,
MapperKind,
getDirectives,
ExecutionResult,
} from '@graphql-tools/utils';

const typeDefs = `
Expand Down
3 changes: 2 additions & 1 deletion packages/wrap/tests/fragmentsAreNotDuplicated.test.ts
@@ -1,8 +1,9 @@
import { ExecutionResult, graphql } from 'graphql';
import { graphql } from 'graphql';

import { wrapSchema } from '../src';
import { makeExecutableSchema } from '@graphql-tools/schema'
import { addMocksToSchema } from '@graphql-tools/mock';
import { ExecutionResult } from '@graphql-tools/utils';

describe('Merging schemas', () => {
test('should not throw `There can be only one fragment named "FieldName"` errors', async () => {
Expand Down

0 comments on commit d572537

Please sign in to comment.