Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

standardize ExecutionResult #1727

Merged
merged 1 commit into from
Jul 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/delegate/src/delegateToSchema.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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