Releases: sangria-graphql/sangria
Releases · sangria-graphql/sangria
v1.2.0
- Provide convenient functions for IDL-based schema materialization and validation (#240). . For more info see the "Query Validation" section of documentation. Improvements include:
- Introduced
Schema.buildStubFromAst
that builds a schema with a stub Query type - Introduced
Schema.buildDefinitions
that builds a list of definitions based on IDL AST (without a schema) - Introduced
Document.emptyStub
as a most basic, but valid document stub - Introduced alias
query1
+query2
for document merge
- Introduced
- Add
Fetcher.deferSeqOptExplicit
or similar to explicitly getSeq[Option[T]]
in the result (#230) - Fixed scalar aliases when they are used with variables or schema is extended (#237)
- Preserve IDL directives at schema materialization time and use them in schema comparator (#236). This also adds
Vector[ast.Directive]
to all relevant schema definitions which may be extremely useful for future features and schema analysis - Improve syntax error reporting for
graphql
macro (#235) - Improve
Int
,BigInt
andLong
scalar value handling (#234) - Propagate updated value through middleware's
afterField
(#233). For more info see the "Middleware" section of documentation. - Forbid 'true', 'false' and 'null' as names for Enum value (#239)
v1.1.0
- Added scalar type alias support (#225, #210). For more info see the "Scalar Type Alias" section of documentation.
- Greatly improved
AstVisitor
(#214). It now includes helper methods to traverse and transform an AST with type info and state. Sangria now integrates with macro-visit which was specifically written to traverse and transform ASTs which are similar to sangria's. For more info see the "AstVisitor" section of documentation. - Added
DocumentAnalyzer
andSchemaBasedDocumentAnalyzer
that contain a lot of helper methods to analyze query. This includes newly introduceddeprecatedUsages
andintrospectionUsages
(#211, #207, #212). For more info see brand new "Query And Schema Analysis" section of documentation. - Added
QueryReducer.hasIntrospection
andQueryReducer.rejectIntrospection
that rejects queries which contain introspection fields (#211). This may be useful for production environments where introspection can potentially be abused. - Added
Context.isIntrospection
andsangria.introspection.isIntrospection
helper methods to easily distinguish between introspection types and fields in middleware and query reducers. - Added
QueryReducer.measureDepth
andQueryReducer.rejectMaxDepth
rejects queries that are deeper than provided threshold (In contrast toExecutor.execute(maxQueryDepth = ...)
, query reducer does it at query analysis time before actual execution). - Added
derive*
macro settings (TransformFieldNames
andTransformInputFieldNames
) to transform field names. (#215) Big thanks to @ostronom for this contribution. - Added ability to represent complex relations in Fetch API (#220).
ExecutionScheme.Extended
now returns updated user context for mutations (#209).- Improved handling of tailing comments when rendering query AST (#219).
- Added aliases for
graphql
/graphqlInput
macros:gql
/gqlInp
- Using
Vector
instead ofList
for all AST nodes now. This is a minor breaking change.
v1.0.0
- Added
Action.sequence
combinator to compose a list ofLeafAction
s in a singleLeadAction
that can be returned from aresolve
function (#206) - Support of
Option[Id]
inFetcher.deferOpt
(#205) - Implicit conversion from
Future[Deferred[A]]
toAction
does not work (#201) - Disallow creation of object types with empty list of fields (#200)
- SimpleFetcherCache does not cache Relation (#194)
- Fetching Relation Typing (#193)
- Helper method
sangroia.schema.action
is replaced withAction.apply
andLeafAction.apply
v1.0.0-RC5
- Uphold spec for non-validation names not beginning with
__
(spec-change) (#189) - Field cache does not consider output object polymorphism (#190)
- Added
QueryReducer.measureDepth
andQueryReducer.rejectMaxDepth
query reducers (#191).maxQueryDepth
argument was available for a long time onExecutor
, but in contrast to new query reducers, it measures depth along side of the execution. With query reducers it happens before query execution, thus allow to reject the query execution entirely. - FetcherDeferredOpt does not extends DeferredOpt (#188)
- Invalid operation name now be considered a client-side error and now implements
QueryAnalysisError
(#186, #187). Big thanks to @mattfenwick for working on this one!
v1.0.0-RC4
Sangria v1.0.0-RC4 is fully compliant with "October 2016" version of the GraphQL specification.
- In presence of explicit
null
value, the default will not be used (#185) (spec change). Breaking change! Arguments with default values are no longer treated as non-optional arguments. ThoughArgs
still preserves existing semantics (default is still applied, even in presence of explicitnull
). The same is true for input objects and optional input object fields with default values. - Added
Args.withArgs
andArgs.argDefinedInQuery
convenience methods. - Validation rule for unique directives per location (#179).
- Enforces input coercion rules (#177).
MiddlewareQueryContext
andExecutionResult
now contain information about validation and query reducers' execution time (validationTiming
,queryReducerTiming
)Middleware.fieldError
was not called in all possible exceptional situations (#184).- New
QueryParser.parseInputWithVariables
provides a way to parse input values with variables. - Various bugfixes in error handing of deferred values and null/undefined value handling.
v1.0.0-RC3
- Cross compile to scala 2.12 and scala 2.11 (#182, #183)
- Schema comparator (#169, #165). It helps to compare different schemas or different versions of the same schema. It also provides an information whether particular change is a breaking change. This is a great example of GraphQL type system potential. For more info see the "Schema Comparator" section of documentation.
- Improved handling of
NaN
andinfinity
values (#167, #168)
v1.0.0-RC2
- Capture original exceptions only if necessary (based on the
ExecutionScheme
) - Fixed issue with duplicate errors appearing during sequential query execution (mutations)
v1.0.0-RC1
Towards 1.0!
- Stream-based subscriptions (#98, #166). For more info see the "Stream-based Subscriptions" section of documentation.
- High-level Fetch API for deferred value resolution (#164). For more info see the "High-level Fetch API" section of documentation.
- Huge improvements in deferred value resolution (#161). Here is just an example of how batching algorithm is improved in comparison to previous version. For more info see the "Deferred Value Resolution" section of documentation. It got a lot of new content.
- Introduced
ExecutionScheme
. It allows to change the result type of an exaction. So now you can get some meta-information about a query execution itself, and not only theFuture
of marshaled result. For more info see the "Alternative Execution Scheme" section of documentation. - Minor breaking changes:
-
DeferredResolver
andDeferred
are moved tosangria.execution.deferred
package. -
DeferredResolver.resolve
method signature is changes a bit (2 new arguments were added). Here is the new signature:def resolve(deferred: Vector[Deferred[Any]], ctx: Ctx, queryState: Any)(implicit ec: ExecutionContext): Vector[Future[Any]]
-
v0.7.3
- Description formatting/parsing is updated based in the changes in the reference implementation (#155). More places of the query now preserve the comments. For instance all trailing comments within a section set and at the end of the document are preserved and rendered.
- Ensure that the result of deferred value resolution has the same size as the deferred list (#154).
- During macro-based derivation, default value should never be a
null
for an optional arguments (#153). - Executor now properly handles undefined values (like
null
andNone
) even if GraphQL type is not null (#152)
v0.7.2
- Transitive types are now collected for all types provided via
additionalTypes
to a schema definition (#149). ObjectType.withInstanceCheck
provides an easier way to customize an instance check onObjectType
(#148).Enumeration
derivation macro should now only collects instances ofEnumeration#Value
(#151).- Ensure that all unreferenced types are collected during the schema extension.
sangria.ast.Type.namedType
helper method.