Package graphql.validation
Class AbstractRule
java.lang.Object
graphql.validation.AbstractRule
- Direct Known Subclasses:
ArgumentsOfCorrectType
,ExecutableDefinitions
,FieldsOnCorrectType
,FragmentsOnCompositeType
,KnownArgumentNames
,KnownDirectives
,KnownFragmentNames
,KnownTypeNames
,LoneAnonymousOperation
,NoFragmentCycles
,NoUndefinedVariables
,NoUnusedFragments
,NoUnusedVariables
,OverlappingFieldsCanBeMerged
,PossibleFragmentSpreads
,ProvidedNonNullArguments
,ScalarLeaves
,SubscriptionUniqueRootField
,UniqueArgumentNames
,UniqueDirectiveNamesPerLocation
,UniqueFragmentNames
,UniqueObjectFieldName
,UniqueOperationNames
,UniqueVariableNames
,VariableDefaultValuesOfCorrectType
,VariablesAreInputTypes
,VariableTypesMatch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ValidationContext
private final ValidationErrorCollector
private final ValidationUtil
private boolean
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractRule
(ValidationContext validationContext, ValidationErrorCollector validationErrorCollector) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addError
(ValidationError.Builder validationError) void
addError
(ValidationErrorType validationErrorType, SourceLocation location, String description) void
addError
(ValidationErrorType validationErrorType, Collection<? extends Node<?>> locations, String description) void
checkArgument
(Argument argument) void
checkDirective
(Directive directive, List<Node> ancestors) void
checkDocument
(Document document) void
checkField
(Field field) void
checkFragmentDefinition
(FragmentDefinition fragmentDefinition) void
checkFragmentSpread
(FragmentSpread fragmentSpread) void
checkInlineFragment
(InlineFragment inlineFragment) void
checkObjectValue
(ObjectValue objectValue) void
checkOperationDefinition
(OperationDefinition operationDefinition) void
checkSelectionSet
(SelectionSet selectionSet) void
checkTypeName
(TypeName typeName) void
checkVariable
(VariableReference variableReference) void
checkVariableDefinition
(VariableDefinition variableDefinition) void
documentFinished
(Document document) i18n
(ValidationErrorType validationErrorType, I18nMsg i18nMsg) Creates an I18n message using theI18nMsg
i18n
(ValidationErrorType validationErrorType, String msgKey, Object... msgArgs) Creates an I18N message using the key and argumentsboolean
void
leaveOperationDefinition
(OperationDefinition operationDefinition) void
leaveSelectionSet
(SelectionSet selectionSet) private String
mkTypeAndPath
(ValidationErrorType validationErrorType) void
setVisitFragmentSpreads
(boolean visitFragmentSpreads) toString()
-
Field Details
-
validationContext
-
validationErrorCollector
-
validationUtil
-
visitFragmentSpreads
private boolean visitFragmentSpreads
-
-
Constructor Details
-
AbstractRule
public AbstractRule(ValidationContext validationContext, ValidationErrorCollector validationErrorCollector)
-
-
Method Details
-
isVisitFragmentSpreads
public boolean isVisitFragmentSpreads() -
setVisitFragmentSpreads
public void setVisitFragmentSpreads(boolean visitFragmentSpreads) -
getValidationUtil
-
addError
public void addError(ValidationErrorType validationErrorType, Collection<? extends Node<?>> locations, String description) -
addError
public void addError(ValidationErrorType validationErrorType, SourceLocation location, String description) -
addError
-
getErrors
-
getValidationContext
-
getValidationErrorCollector
-
getQueryPath
-
i18n
Creates an I18n message using theI18nMsg
- Parameters:
validationErrorType
- the type of validation failurei18nMsg
- the i18n message object- Returns:
- the formatted I18n message
-
i18n
Creates an I18N message using the key and arguments- Parameters:
validationErrorType
- the type of validation failuremsgKey
- the key in the underlying message bundlemsgArgs
- the message arguments- Returns:
- the formatted I18N message
-
mkTypeAndPath
-
checkDocument
-
checkArgument
-
checkTypeName
-
checkVariableDefinition
-
checkField
-
checkInlineFragment
-
checkDirective
-
checkFragmentSpread
-
checkFragmentDefinition
-
checkOperationDefinition
-
leaveOperationDefinition
-
checkSelectionSet
-
leaveSelectionSet
-
checkVariable
-
documentFinished
-
checkObjectValue
-
toString
-