Package graphql
Class ParseAndValidateResult
- java.lang.Object
-
- graphql.ParseAndValidateResult
-
@PublicApi public class ParseAndValidateResult extends java.lang.Object
A result object used inParseAndValidate
helper that indicates the outcomes of a parse and validate operation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ParseAndValidateResult.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Document
getDocument()
DocumentAndVariables
getDocumentAndVariables()
java.util.List<GraphQLError>
getErrors()
A list of all the errors (parse and validate) that have occurredInvalidSyntaxException
getSyntaxException()
java.util.List<ValidationError>
getValidationErrors()
java.util.Map<java.lang.String,java.lang.Object>
getVariables()
boolean
isFailure()
static ParseAndValidateResult.Builder
newResult()
ParseAndValidateResult
transform(java.util.function.Consumer<ParseAndValidateResult.Builder> builderConsumer)
-
-
-
Method Detail
-
isFailure
public boolean isFailure()
- Returns:
- true if there was a parse exception or the validation failed
-
getDocument
public Document getDocument()
- Returns:
- the parsed document or null if it's syntactically invalid.
-
getVariables
public java.util.Map<java.lang.String,java.lang.Object> getVariables()
- Returns:
- the document variables or null if it's syntactically invalid.
-
getDocumentAndVariables
public DocumentAndVariables getDocumentAndVariables()
- Returns:
- the parsed document and variables or null if it's syntactically invalid.
-
getSyntaxException
public InvalidSyntaxException getSyntaxException()
- Returns:
- the syntax exception or null if it's syntactically valid.
-
getValidationErrors
public java.util.List<ValidationError> getValidationErrors()
- Returns:
- a list of validation errors, which might be empty if it's syntactically invalid.
-
getErrors
public java.util.List<GraphQLError> getErrors()
A list of all the errors (parse and validate) that have occurred- Returns:
- the errors that have occurred or empty list if there are none
-
transform
public ParseAndValidateResult transform(java.util.function.Consumer<ParseAndValidateResult.Builder> builderConsumer)
-
newResult
public static ParseAndValidateResult.Builder newResult()
-
-