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 TypeMethodDescriptionvoidaddError(ValidationError.Builder validationError) voidaddError(ValidationErrorType validationErrorType, SourceLocation location, String description) voidaddError(ValidationErrorType validationErrorType, Collection<? extends Node<?>> locations, String description) voidcheckArgument(Argument argument) voidcheckDirective(Directive directive, List<Node> ancestors) voidcheckDocument(Document document) voidcheckField(Field field) voidcheckFragmentDefinition(FragmentDefinition fragmentDefinition) voidcheckFragmentSpread(FragmentSpread fragmentSpread) voidcheckInlineFragment(InlineFragment inlineFragment) voidcheckObjectValue(ObjectValue objectValue) voidcheckOperationDefinition(OperationDefinition operationDefinition) voidcheckSelectionSet(SelectionSet selectionSet) voidcheckTypeName(TypeName typeName) voidcheckVariable(VariableReference variableReference) voidcheckVariableDefinition(VariableDefinition variableDefinition) voiddocumentFinished(Document document) i18n(ValidationErrorType validationErrorType, I18nMsg i18nMsg) Creates an I18n message using theI18nMsgi18n(ValidationErrorType validationErrorType, String msgKey, Object... msgArgs) Creates an I18N message using the key and argumentsprotected BooleanVerifies if the experimental API key is enabledbooleanvoidleaveOperationDefinition(OperationDefinition operationDefinition) voidleaveSelectionSet(SelectionSet selectionSet) voidsetVisitFragmentSpreads(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
-