Skip to content

Export flow types from index.js #554

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

Merged
merged 3 commits into from
Nov 3, 2016
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/error/GraphQLError.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

import { getLocation } from '../language';
import type { Node } from '../language/ast';
import type { ASTNode } from '../language/ast';
import type { Source } from '../language/source';

/**
Expand Down Expand Up @@ -50,7 +50,7 @@ declare class GraphQLError extends Error {
/**
* An array of GraphQL AST Nodes corresponding to this error.
*/
nodes: Array<Node> | void;
nodes: Array<ASTNode> | void;

/**
* The source GraphQL document corresponding to this error.
Expand Down
12 changes: 6 additions & 6 deletions src/error/__tests__/GraphQLError-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ describe('GraphQLError', () => {
field
}`);
const ast = parse(source);
const fieldAST = ast.definitions[0].selectionSet.selections[0];
const e = new GraphQLError('msg', [ fieldAST ]);
expect(e.nodes).to.deep.equal([ fieldAST ]);
const fieldNode = ast.definitions[0].selectionSet.selections[0];
const e = new GraphQLError('msg', [ fieldNode ]);
expect(e.nodes).to.deep.equal([ fieldNode ]);
expect(e.source).to.equal(source);
expect(e.positions).to.deep.equal([ 8 ]);
expect(e.locations).to.deep.equal([ { line: 2, column: 7 } ]);
Expand All @@ -77,9 +77,9 @@ describe('GraphQLError', () => {
field
}`);
const ast = parse(source);
const operationAST = ast.definitions[0];
const e = new GraphQLError('msg', [ operationAST ]);
expect(e.nodes).to.deep.equal([ operationAST ]);
const operationNode = ast.definitions[0];
const e = new GraphQLError('msg', [ operationNode ]);
expect(e.nodes).to.deep.equal([ operationNode ]);
expect(e.source).to.equal(source);
expect(e.positions).to.deep.equal([ 0 ]);
expect(e.locations).to.deep.equal([ { line: 1, column: 1 } ]);
Expand Down
5 changes: 5 additions & 0 deletions src/error/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ export { GraphQLError } from './GraphQLError';
export { syntaxError } from './syntaxError';
export { locatedError } from './locatedError';
export { formatError } from './formatError';

export type {
GraphQLFormattedError,
GraphQLErrorLocation
} from './formatError';
6 changes: 3 additions & 3 deletions src/execution/__tests__/executor-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ describe('Execute: Handles basic execution tasks', () => {

expect(Object.keys(info)).to.deep.equal([
'fieldName',
'fieldASTs',
'fieldNodes',
'returnType',
'parentType',
'path',
Expand All @@ -219,8 +219,8 @@ describe('Execute: Handles basic execution tasks', () => {
'variableValues',
]);
expect(info.fieldName).to.equal('test');
expect(info.fieldASTs).to.have.lengthOf(1);
expect(info.fieldASTs[0]).to.equal(
expect(info.fieldNodes).to.have.lengthOf(1);
expect(info.fieldNodes[0]).to.equal(
ast.definitions[0].selectionSet.selections[0]
);
expect(info.returnType).to.equal(GraphQLString);
Expand Down
Loading