diff --git a/src/execution/index.js b/src/execution/index.js index cf568c1054..cef50db613 100644 --- a/src/execution/index.js +++ b/src/execution/index.js @@ -1,3 +1,4 @@ +/* @flow */ /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -10,4 +11,4 @@ export { execute, defaultFieldResolver, responsePathAsArray } from './execute'; export { getDirectiveValues } from './values'; -export type { ExecutionResult } from './execute'; +export type { ExecutionArgs, ExecutionResult } from './execute'; diff --git a/src/language/lexer.js b/src/language/lexer.js index 4f8118588c..094ab72bf2 100644 --- a/src/language/lexer.js +++ b/src/language/lexer.js @@ -1,4 +1,4 @@ -/* @flow / +/* @flow */ /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/src/subscription/asyncIteratorReject.js b/src/subscription/asyncIteratorReject.js index 4aac773fdd..f5c4664a1e 100644 --- a/src/subscription/asyncIteratorReject.js +++ b/src/subscription/asyncIteratorReject.js @@ -1,3 +1,4 @@ +/* @flow */ /** * Copyright (c) 2017, Facebook, Inc. * All rights reserved. @@ -5,8 +6,6 @@ * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. - * - * @flow */ import { $$asyncIterator } from 'iterall'; diff --git a/src/subscription/index.js b/src/subscription/index.js index 2d31f69503..6cddd4790a 100644 --- a/src/subscription/index.js +++ b/src/subscription/index.js @@ -1,3 +1,4 @@ +/* @flow */ /** * Copyright (c) 2017, Facebook, Inc. * All rights reserved. @@ -5,8 +6,6 @@ * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. - * - * @flow */ export { subscribe, createSourceEventStream } from './subscribe'; diff --git a/src/subscription/mapAsyncIterator.js b/src/subscription/mapAsyncIterator.js index c31d74c6cd..238150579c 100644 --- a/src/subscription/mapAsyncIterator.js +++ b/src/subscription/mapAsyncIterator.js @@ -1,3 +1,4 @@ +/* @flow */ /** * Copyright (c) 2017, Facebook, Inc. * All rights reserved. @@ -5,8 +6,6 @@ * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. - * - * @flow */ import { $$asyncIterator, getAsyncIterator } from 'iterall'; diff --git a/src/subscription/subscribe.js b/src/subscription/subscribe.js index f5367e8bd0..103138de12 100644 --- a/src/subscription/subscribe.js +++ b/src/subscription/subscribe.js @@ -1,3 +1,4 @@ +/* @flow */ /** * Copyright (c) 2017, Facebook, Inc. * All rights reserved. @@ -5,8 +6,6 @@ * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. - * - * @flow */ import { isAsyncIterable } from 'iterall'; diff --git a/src/validation/index.js b/src/validation/index.js index c2190f4bbd..e8b5ae1575 100644 --- a/src/validation/index.js +++ b/src/validation/index.js @@ -1,3 +1,4 @@ +/* @flow */ /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/src/validation/rules/KnownArgumentNames.js b/src/validation/rules/KnownArgumentNames.js index 9a2f99e4bd..dcf10e7faf 100644 --- a/src/validation/rules/KnownArgumentNames.js +++ b/src/validation/rules/KnownArgumentNames.js @@ -15,17 +15,16 @@ import invariant from '../../jsutils/invariant'; import suggestionList from '../../jsutils/suggestionList'; import quotedOrList from '../../jsutils/quotedOrList'; import * as Kind from '../../language/kinds'; -import type { GraphQLType } from '../../type/definition'; export function unknownArgMessage( argName: string, fieldName: string, - type: GraphQLType, + typeName: string, suggestedArgs: Array ): string { let message = `Unknown argument "${argName}" on field "${fieldName}" of ` + - `type "${String(type)}".`; + `type "${typeName}".`; if (suggestedArgs.length) { message += ` Did you mean ${quotedOrList(suggestedArgs)}?`; } diff --git a/src/validation/rules/PossibleFragmentSpreads.js b/src/validation/rules/PossibleFragmentSpreads.js index a0d66ac42b..b55df025e4 100644 --- a/src/validation/rules/PossibleFragmentSpreads.js +++ b/src/validation/rules/PossibleFragmentSpreads.js @@ -12,6 +12,7 @@ import type { ValidationContext } from '../index'; import { GraphQLError } from '../../error'; import { doTypesOverlap } from '../../utilities/typeComparators'; import { typeFromAST } from '../../utilities/typeFromAST'; +import { isCompositeType } from '../../type/definition'; import type { GraphQLType } from '../../type/definition'; @@ -44,8 +45,8 @@ export function PossibleFragmentSpreads(context: ValidationContext): any { InlineFragment(node) { const fragType = context.getType(); const parentType = context.getParentType(); - if (fragType && - parentType && + if (isCompositeType(fragType) && + isCompositeType(parentType) && !doTypesOverlap(context.getSchema(), fragType, parentType)) { context.reportError(new GraphQLError( typeIncompatibleAnonSpreadMessage(parentType, fragType),