v1.3.0
-
Experimental Batch Executor (#273). For more info see the "Batch Executor" section of the documentation.
-
Allow
Violation
s andUserFacingError
s to be handled by custom exception handler (#252).Refactored exception handling mechanism:
- Now it is able to handle
Violation
s as well asUserFacingError
s. HandledException
is now able to capture multiple errors and additional AST node positions.- Since it is now a standalone class, it would be easier to expand on error handling in future.
Minor breaking change. It's just a small syntax change. Migration strategy:
// Before val exceptionHandler: Executor.ExceptionHandler = { case (m, ...) ⇒ ... }) // After val exceptionHandler = ExceptionHandler { case (m, ...) ⇒ ... }
ExceptionHandler
is now a standalone class that allows you to provide following handlers:onException
- all unexpected exceptions coming from theresolve
functions (behaves exactly like in earlier versions)onViolation
- handles violations (things like validation errors, argument/variable coercion, etc.)onUserFacingError
- handles standard sangria errors (errors like invalid operation name, max query depth, etc.)
For more info see the updated "Custom ExceptionHandler" section of the documentation.
- Now it is able to handle
-
Improved input document validation and deserialization (#272). For more info see "Input Document Validation" section of the documentation and updated "Query AST Marshalling" section. Improvements include:
- Added
InputDocument
which is used in validation, materialization, etc. - New macros
gqlInpDoc
/graphqlInputDoc
that produces anInputDocument
instead of justsangria.ast.Value
. - Added
RuleBasedQueryValidator.validateInputDocument
that validatesInputDocument
against the schema. InputDocument.to
provide a convenient way todeserialize
/materialize
an input document based on theFromInput
type-class.- Improved a lot of validation messages related to input value validations.
- Added
-
Add support for leading vertical bar in union types and directive definitions (#253) (spec change).
-
Fixed infinite loop on invalid queries in OverlappingFields (#266, #238).
-
Information about type extensions is now available in the field resolve function builder (#267). Minor breaking change. The signature of
DefaultAstSchemaBuilder.buildField
andDefaultAstSchemaBuilder.resolveField
has changed. You need to addextensions: Vector[ast.TypeExtensionDefinition]
as a second argument. -
Fixed directive definition rendering in query renderer (#274). Thanks to @alexeygolev for this contribution!
-
Built-in scalars will now only be added to the schema if they are used (#271, #270). Thanks to @jlawrienyt for this contribution!
-
Improve error message when an appropriate implementation of an abstract type cannot be found (#259).