Package graphql.validation.rules
Class PossibleFragmentSpreads
- java.lang.Object
-
- graphql.validation.AbstractRule
-
- graphql.validation.rules.PossibleFragmentSpreads
-
public class PossibleFragmentSpreads extends AbstractRule
-
-
Constructor Summary
Constructors Constructor Description PossibleFragmentSpreads(ValidationContext validationContext, ValidationErrorCollector validationErrorCollector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckFragmentSpread(FragmentSpread fragmentSpread)voidcheckInlineFragment(InlineFragment inlineFragment)private booleandoTypesOverlap(GraphQLType type, GraphQLCompositeType parent)private java.util.List<? extends GraphQLType>getPossibleType(GraphQLType type)private booleanisValidTargetCompositeType(GraphQLType type)Per spec: The target type of fragment (type condition) must have kind UNION, INTERFACE, or OBJECT.-
Methods inherited from class graphql.validation.AbstractRule
addError, addError, addError, checkArgument, checkDirective, checkDocument, checkField, checkFragmentDefinition, checkObjectValue, checkOperationDefinition, checkSelectionSet, checkTypeName, checkVariable, checkVariableDefinition, documentFinished, getErrors, getQueryPath, getValidationContext, getValidationErrorCollector, getValidationUtil, i18n, i18n, isVisitFragmentSpreads, leaveOperationDefinition, leaveSelectionSet, setVisitFragmentSpreads, toString
-
-
-
-
Constructor Detail
-
PossibleFragmentSpreads
public PossibleFragmentSpreads(ValidationContext validationContext, ValidationErrorCollector validationErrorCollector)
-
-
Method Detail
-
checkInlineFragment
public void checkInlineFragment(InlineFragment inlineFragment)
- Overrides:
checkInlineFragmentin classAbstractRule
-
checkFragmentSpread
public void checkFragmentSpread(FragmentSpread fragmentSpread)
- Overrides:
checkFragmentSpreadin classAbstractRule
-
doTypesOverlap
private boolean doTypesOverlap(GraphQLType type, GraphQLCompositeType parent)
-
getPossibleType
private java.util.List<? extends GraphQLType> getPossibleType(GraphQLType type)
-
isValidTargetCompositeType
private boolean isValidTargetCompositeType(GraphQLType type)
Per spec: The target type of fragment (type condition) must have kind UNION, INTERFACE, or OBJECT.- Parameters:
type- GraphQLType- Returns:
- true if it is a union, interface, or object.
-
-