@PublicApi public class ParseAndValidate extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INTERNAL_VALIDATION_PREDICATE_HINT
This
GraphQLContext hint can be used to supply a Predicate to the Validator so that certain rules can be skipped. |
Constructor and Description |
---|
ParseAndValidate() |
Modifier and Type | Method and Description |
---|---|
static ParseAndValidateResult |
parse(ExecutionInput executionInput)
This can be called to parse (but not validate) a graphql query.
|
static ParseAndValidateResult |
parseAndValidate(GraphQLSchema graphQLSchema,
ExecutionInput executionInput)
This can be called to parse and validate a graphql query against a schema, which is useful if you want to know if it would be acceptable
for execution.
|
static java.util.List<ValidationError> |
validate(GraphQLSchema graphQLSchema,
Document parsedDocument)
This can be called to validate a parsed graphql query.
|
static java.util.List<ValidationError> |
validate(GraphQLSchema graphQLSchema,
Document parsedDocument,
java.util.function.Predicate<java.lang.Class<?>> rulePredicate)
This can be called to validate a parsed graphql query.
|
public static final java.lang.String INTERNAL_VALIDATION_PREDICATE_HINT
GraphQLContext
hint can be used to supply a Predicate to the Validator so that certain rules can be skipped.
This is an internal capability that you should use at your own risk. While we intend for this to be present for some time, the validation
rule class names may change, as may this mechanism.public static ParseAndValidateResult parseAndValidate(GraphQLSchema graphQLSchema, ExecutionInput executionInput)
graphQLSchema
- the schema to validate againstexecutionInput
- the execution input containing the querypublic static ParseAndValidateResult parse(ExecutionInput executionInput)
executionInput
- the input containing the querypublic static java.util.List<ValidationError> validate(GraphQLSchema graphQLSchema, Document parsedDocument)
graphQLSchema
- the graphql schema to validate againstparsedDocument
- the previously parsed documentpublic static java.util.List<ValidationError> validate(GraphQLSchema graphQLSchema, Document parsedDocument, java.util.function.Predicate<java.lang.Class<?>> rulePredicate)
graphQLSchema
- the graphql schema to validate againstparsedDocument
- the previously parsed documentrulePredicate
- this predicate is used to decide what validation rules will be applied