Package graphql.validation
Class AbstractRule
java.lang.Object
graphql.validation.AbstractRule
- Direct Known Subclasses:
ArgumentsOfCorrectType
,DeferDirectiveLabel
,DeferDirectiveOnRootLevel
,DeferDirectiveOnValidOperation
,ExecutableDefinitions
,FieldsOnCorrectType
,FragmentsOnCompositeType
,KnownArgumentNames
,KnownDirectives
,KnownFragmentNames
,KnownOperationTypes
,KnownTypeNames
,LoneAnonymousOperation
,NoFragmentCycles
,NoUndefinedVariables
,NoUnusedFragments
,NoUnusedVariables
,OverlappingFieldsCanBeMerged
,PossibleFragmentSpreads
,ProvidedNonNullArguments
,ScalarLeaves
,SubscriptionUniqueRootField
,UniqueArgumentNames
,UniqueDirectiveNamesPerLocation
,UniqueFragmentNames
,UniqueObjectFieldName
,UniqueOperationNames
,UniqueVariableNames
,VariableDefaultValuesOfCorrectType
,VariablesAreInputTypes
,VariableTypesMatch
-
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 argumentsprotected Boolean
Verifies if the experimental API key is enabledboolean
void
leaveOperationDefinition
(OperationDefinition operationDefinition) void
leaveSelectionSet
(SelectionSet selectionSet) void
setVisitFragmentSpreads
(boolean visitFragmentSpreads) toString()
-
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
-
isExperimentalApiKeyEnabled
Verifies if the experimental API key is enabled- Parameters:
key
- to be checked- Returns:
- if the experimental API key is enabled
-
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
-
checkDocument
-
checkArgument
-
checkTypeName
-
checkVariableDefinition
-
checkField
-
checkInlineFragment
-
checkDirective
-
checkFragmentSpread
-
checkFragmentDefinition
-
checkOperationDefinition
-
leaveOperationDefinition
-
checkSelectionSet
-
leaveSelectionSet
-
checkVariable
-
documentFinished
-
checkObjectValue
-
toString
-