Skip to content

Commit

Permalink
These typings are getting too smart for their own good
Browse files Browse the repository at this point in the history
  • Loading branch information
Sashko Stubailo committed May 29, 2017
1 parent a3f617c commit 417d284
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/test/testSchemaGenerator.ts
Expand Up @@ -9,6 +9,7 @@ import {
Kind,
IntValueNode,
parse,
ExecutionResult,
} from 'graphql';
// import { printSchema } from 'graphql';
const GraphQLJSON = require('graphql-type-json');
Expand Down Expand Up @@ -246,7 +247,7 @@ describe('generating schema from shorthand', () => {
const jsSchema = makeExecutableSchema({ typeDefs: shorthand, resolvers: resolve });
const resultPromise = graphql(jsSchema, introspectionQuery);
return resultPromise.then(result =>
assert.deepEqual(result, solution)
assert.deepEqual(result, solution as ExecutionResult)
);
});

Expand Down Expand Up @@ -422,7 +423,7 @@ describe('generating schema from shorthand', () => {
};
const jsSchema = makeExecutableSchema({ typeDefs: shorthand, resolvers: resolveFunctions });
const resultPromise = graphql(jsSchema, testQuery);
return resultPromise.then(result => assert.deepEqual(result, solution));
return resultPromise.then(result => assert.deepEqual(result, solution as ExecutionResult));
});

it('can generate a schema with extensions that can use resolvers', () => {
Expand Down Expand Up @@ -478,7 +479,7 @@ describe('generating schema from shorthand', () => {
};
const jsSchema = makeExecutableSchema({ typeDefs: shorthand, resolvers: resolveFunctions });
const resultPromise = graphql(jsSchema, testQuery);
return resultPromise.then(result => assert.deepEqual(result, solution));
return resultPromise.then(result => assert.deepEqual(result, solution as ExecutionResult));
});

it('supports resolveType for unions', () => {
Expand Down Expand Up @@ -558,7 +559,7 @@ describe('generating schema from shorthand', () => {

const jsSchema = makeExecutableSchema({ typeDefs: shorthand, resolvers: resolveFunctions });
const resultPromise = graphql(jsSchema, testQuery);
return resultPromise.then(result => assert.deepEqual(result, solution));
return resultPromise.then(result => assert.deepEqual(result, solution as ExecutionResult));
});

it('supports passing a GraphQLScalarType in resolveFunctions', () => {
Expand Down Expand Up @@ -821,7 +822,7 @@ describe('generating schema from shorthand', () => {

const jsSchema = makeExecutableSchema({ typeDefs: shorthand, resolvers: resolveFunctions });
const resultPromise = graphql(jsSchema, testQuery);
return resultPromise.then(result => assert.deepEqual(result, solution));
return resultPromise.then(result => assert.deepEqual(result, solution as ExecutionResult));
});

it('shows a warning if a field has arguments but no resolve func', () => {
Expand Down

0 comments on commit 417d284

Please sign in to comment.