All Versions
Latest Version
Avg Release Cycle
78 days
Latest Release
142 days ago

Changelog History
Page 2

  • v2.0.0-M1 Changes

    April 28, 2020

    ๐Ÿš€ From

    ๐Ÿš€ This is the first milestone release of the 2.x series and the first Sangria release to support Scala 2.13.

    Many of Sangria's modules (for marshalling and streaming integrations, etc.) are also now available for 2.13:

    ๐Ÿš€ This 2.0.0-M1 release includes several changes:

    ๐Ÿš€ This milestone release is intended primarily to unblock adopters who are migrating to Scala 2.13, and is not guaranteed to be binary compatible with the eventual 2.x series. While these changes are well-tested, this is a pre-release milestone; please use with care and report any issues you come across.

  • v1.4.2 Changes

    August 13, 2018
    • Removed InterfaceMustHaveImplementationValidationRule validation rule (spec change) (#379). Since its introduction in previous release, it caused some issues (to sangria users as well users of other implementations). So it was removed from the GraphQL spec and sangria for now.
    • ๐Ÿ”ฆ Exposed more contextual information to a fetcher, including fetcher cache (#377). Fetcher now can be created with a set of new helper methods *WithContext which provide FetcherContext as an argument to fetch functions.
    • AstSchemaMaterializer now re-creates existing field argument types (thus able to use newly created input types)
    • โž• Added visitor helpers in AstNode (they just delegate all functionality to AstVisitor)
    • ๐Ÿ‘ More minor improvements for better compatibility with GraalVM native-image.
    • โœ… Continued work on GraphQL CATs (Compatibility Acceptance Tests). Most recent changes and validation scenarios were added. Some Violations now implement SpecViolation which provides CATs-compliant error code and arguments.
  • v1.4.1 Changes

    May 12, 2018

    Added support for extend schema in SDL (spec change) (#362). It adds following syntax in the SDL:

    extend schema @extraDirective { mutation: MutationType}

    Ambiguity with null variable values and default values (spec change) (#359).

    Add optional 'extensions' entry to errors (spec change) (#358).

    CAUTION: breaking change. All additional error object fields that were provided via HandledException are now added to the extensions field

    Before v1.4.1:

    { "data": { "books": null }, "errors": [{ "message": "Can't access the database :'(", "path": ["books"], "locations": [{"line": 3, "column": 11}], "errorCode": "DATABASE\_DOWN", "mitigationStrategy": "Panic!" }] }

    After v1.4.1:

    { "data": { "books": null }, "errors": [{ "message": "Can't access the database :'(", "path": ["books"], "locations": [{"line": 3, "column": 11}], "extensions": { "errorCode": "DATABASE\_DOWN", "mitigationStrategy": "Panic!" } }] }

    0๏ธโƒฃ For backward-compatibility, HandledException now provides 2 additional fields: addFieldsInExtensions (by default true) and addFieldsInError (by default false). You can also set both flags to true in order to provide a migration path for the client applications.

    Ensure interface has at least 1 concrete type (spec change) (#360). It is potentially a minor breaking change. If you have non-implemented interfaces in your schema, you can temporary remove InterfaceMustHaveImplementationValidationRule schema validation rule.

    โž• Added a small Cache abstraction and replaced TrieMap-based cache implementation with ConcurrentHashMap. This change introduces potential minor performance improvements and compatibility with GraalVM native-image.

    โž• Added toAst helper for different schema elements, like fields, enum values and types (#367)

    โž• Added macro setting to transform enum values' names with a macro setting (#350). Big thanks to @fehu for this contribution! The UppercaseValues macro setting is now deprecated in favour of more flexible TransformValueNames.

    ๐Ÿ›  Fixed typo in BeforeFieldResult field name (#363). Big thanks to @Codier for this contribution!

    Adjusted KnownTypeNames validation to not validate SDL definitions because they are validated in the schema materializer (#354).

    โž• Added option to disable parsing of AST locations and comments (#357)

    Don't allow ObjectTypes derived from case classes to overwrite each other (#345) Big thanks to @simonsaffer for this contribution!

    ๐Ÿ‘Œ Improved query parsing performance by optimizing the AST location tracking (#351). Big thanks to @guymers for this contribution!

    ๐Ÿ›  Fixed new line tracking when parsing block-strings

    ๐Ÿ— Ast schema builder now considers additionalTypes when it validates the type extensions

    โšก๏ธ Updated sangria-marshalling-api to version 1.0.3 (should be backwards compatible with v1.0.0).

  • v1.4.0 Changes

    February 20, 2018

    The v1.4.0 has a lot of improvements and minor changes, in particular around SDL parsing and materialization. Although some of these changes are minor breaking changes , they can be divided in following 2 categories:

    • ๐Ÿ”จ Simple routine refactorings with updated method signatures. For example, most of the method signatures in AstSchemaBuilder are updated and now include more information (type extensions in particular). In all of these cases, issues will manifest themselves as compilation errors and can be fixed by simple signature updates.
    • โšก๏ธ GraphQL query and SDL syntax updates. Based on the feedback from #308 and other sources, extra attention was put in ensuring that syntax is either backward compatible or an option is available to enable support for a legacy GraphQL syntax. These options can be enabled through new ParserConfig which can be provided to QueryParser.

    If you are facing unexpected issues with migration to the new Sangria version, please let us know by creating a new GH issue.

    ๐Ÿ”„ Changes:

    ๐Ÿ†• New "implements" syntax (old syntax can be enabled via ParserConfig.legacyImplementsInterface) (#337) (spec change). Example:

    # old syntax type User implements Node, Profile { id: ID!}# new syntaxtype User implements Node & Profile { id: ID!}

    ๐Ÿ‘ All of the SDL types now support type extensions (#337) (spec change). Previously only object types supported this feature. Some examples:

    extend type Foo implements ExtraInterface1 & ExtraInterface2 { extraField: Int}extend interface Bar @extraDirective { extraField: Int}extend input Baz { extraField: Int = 123 }extend enum Color { "the best color" MAGENTA}extend union Test @extraDirective = More | Typesextend scalar Date @extraDirective

    All SDL type definitions are now allowed to have empty field/value/member lists (#337) (spec change). Examples of now valid syntax:

    type User union Pet enum Color

    All of the appropriate checks are now implemented as a SchemaValidationRule (instead of being part of the syntax).

    ๐Ÿ—„ Moreover, old syntax for this is now deprecated and can be enabled with ParserConfig.legacyEmptyFields. Example of the old syntax:

    # don't do it! it is now deprecatedtype User {} 

    โž• Add experimental support for parsing variable definitions in fragments (#313). A primary goal of it is to enable the experimentation. The support for this syntax needs to be explicitly enabled via ParserConfig. Here is how new syntax looks like:

    query q () { ...a}fragment a on t ($size: Int = 0) { f(size: $size) }

    ๐Ÿ‘Œ Improved AST location handling and support for multi-source AST Documents (#343). These improvements might be quite helpful for recently discussed "import" functionality where the schema SDL is defined in multiple files. Improvements include:

    • Different schema elements retain the information about SDL AstNodes that were used to create them (in addition to the directives). This might be quite helpful in multiple scenarios. It was already used to greatly improve the quality of the error messages.
    • AstLocation now replaces the Position and holds additional field: sourceId.

    - Introduced AggregateSourceMapper and improved Document merge. It is now possible to show proper error messages and source locations even for AST that was parsed from different sources (files, URLs, etc.).

    A lot of improvement to the schema validation (#312, #315). All of the validations are now implemented as SchemaValidationRule (no in-place runtime checks anymore). This can be quite helpful if you, for instance, need to customize the validation rules or disable the validations altogether.

    ๐Ÿ—„ Validate literals in a single rule with finer precision (#314). This generalizes the "arguments of correct type" and "default values of correct type" to a single rule "values of correct type" which has been re-written to rely on a traversal rather than the utility function isValidLiteralValue. isValidLiteralValue is now deprecated.

    ๐Ÿ‘ AstSchemaMaterializer now fully supports all of the new type extensions (#309) .

    SchemaComparator is improved and now includes information about "dangerous" changes (#335).

    Simplify Unknown Args Validation (#316).

    โž• Added new validation rule SingleFieldSubscriptions (#254) (spec change).

    Resolve type info for fragment spreads (#278). Big thanks to @jonas for this contribution!

    ๐Ÿ‘ Allow to rename, describe and set default arguments using DeriveObjectSettings (#339). Big thanks to @fehu for this contribution!

    ๐Ÿ‘ป Replaced Exception with Throwable to match all possible results of Future.failed (#329, #327). Big thanks to @lgmyrek for this contribution!

    ๐ŸŽ‰ Initialize symbols before checking their annotations (#317). This will improve derive* macros in same edge-cases. Big thanks to @dragos for this contribution!

    โž• Added support for rendering SDL with legacy comment-based descriptions (#334). You can use it with SchemaFilter.default.withLegacyCommentDescriptions.

    ๐Ÿ‘Œ Improved ResolverBasedAstSchemaBuilder and introduced InputTypeResolver/OutputTypeResolver.

    โšก๏ธ Updated sangria-marshalling-api to version 1.0.1 (should be backwards compatible with v1.0.0)

    Other minor improvements coming from the reference implementation (#336, #311).

    โœ‚ Removed previously deprecated methods:

    • SchemaRenderer.renderIntrospectionSchema
    • AstVisitor.visitAst
  • v1.3.3 Changes

    December 03, 2017
    • ๐Ÿ’ฅ Added support for string-based descriptions in SDL and implement most recent SDL-related changes (#303, #304, #305) (spec change). Breaking change for all SDL users. The type, field and enum value descriptions are now handled differently in the SDL.

    Old format (comment-based):

      # This is a description
      # of the `Foo` type.
      type Foo implements Bar {
        # another description
        one: Type

    New format (string-based):

      This is a description
      of the `Foo` type.
      type Foo implements Bar {
        "another description"
        one: Type

    Migration path: by default (and after the update) only new description format is used. The old (comment-based) format is still will be supported for several version. In order to enable description handling in the old format, please override DefaultAstSchemaBuilder.useLegacyCommentDescriptions or use AstSchemaBuilder.defaultWithLegacyCommentDescriptions.

    • โž• Added block string support (#260, #301) (spec change). Here is an example of the new multi-line string syntax:
      mutation {
        sendEmail(message: """
    • โž• Added relOnly and relOnlyCaching methods to Fetcher. Thanks to @kuppuswamy for this contribution!
    • ๐Ÿ›  Fixed a validation of nested InputObjectType with same property names (#292).
    • ๐Ÿ‘Œ Improved performance of Document.hashCode which had a big influence on performance of the AST-based schema builder.
  • v1.3.2 Changes

    November 01, 2017
    • Fix regression where variables aren't passed to query reducers (#291). Thanks to @msolomon for a quick fix!
  • v1.3.1 Changes

    October 29, 2017

    As a part of this feature, new functionality was introduced in AstSchemaBuilder which provides even more flexibility for schema materialization.

    Minor breaking change: most of the methods in AstSchemaBuilder got new argument origin: MatOrigin. In order to migrate, you need to adjust the signatures of affected methods and add origin: MatOrigin argument.

    • Prepared queries without known variables (#281, #277). Huge thanks to @msolomon for making this contribution! This feature adds QueryReducerExecutor.reduceQueryWithoutVariables. In its signature it is similar to Executor.prepare, but it does not require variables and designed to validate and execute query reducers for queries that are being analyzed ahead of time (e.g. in the context of persistent queries).
    • Ability to provide a partial error for deferred values (#290). DeferredValue and DeferredFutureValue now has a method mapWithErrors. This works similar to the PartialValue, so you can still have a successful result and at the same time indicate errors that happened during deferred value resolution.
    • Ability to provide additional values from Middleware (#289). beforeField now returns BeforeFieldResult (instead of just a tuple) which allows you to add a MiddlewareAttachment. This attachment then can be used in resolve function via Context.attachment/Context.attachments.
  • v1.3.0 Changes

    August 19, 2017

    Refactored exception handling mechanism:

    • Now it is able to handle Violations as well as UserFacingErrors.
    • 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 the resolve 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.

    • ๐Ÿ‘Œ 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 an InputDocument instead of just sangria.ast.Value.
      • Added RuleBasedQueryValidator.validateInputDocument that validates InputDocument against the schema.
      • provide a convenient way to deserialize/materialize an input document based on the FromInput type-class.
      • Improved a lot of validation messages related to input value validations.
    • โž• 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 and DefaultAstSchemaBuilder.resolveField has changed. You need to add extensions: 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).