Skip to content

Commit

Permalink
Fix issues uncovered by enabling Flow
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Sep 7, 2017
1 parent 3c74e0b commit 7086160
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/validation/rules/KnownArgumentNames.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>
): string {
let message = `Unknown argument "${argName}" on field "${fieldName}" of ` +
`type "${String(type)}".`;
`type "${typeName}".`;
if (suggestedArgs.length) {
message += ` Did you mean ${quotedOrList(suggestedArgs)}?`;
}
Expand Down
5 changes: 3 additions & 2 deletions src/validation/rules/PossibleFragmentSpreads.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';


Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 7086160

Please sign in to comment.