• v0.8.0.0 aef6030a8e

    0.8.0.0 Stable

    belka released this 2020-06-20 05:48:25 +02:00 | 196 commits to master since this release

    Fixed

    • The parser rejects variables when parsing defaultValue (DefaultValue). The
      specification defines default values as Value with const parameter and
      constants cannot be variables. AST.Document.ConstValue was added,
      AST.Document.ObjectField was modified.
    • AST transformation should never fail.
      • Arguments and fields with a missing variable as value should be left out.
      • Invalid (recusrive or non-existing) fragments should be skipped.
    • Argument value coercion.
    • Variable value coercion.
    • Result coercion.
    • The executor should skip the fields missing in the object type and not fail.
    • Merging subselections.

    Changed

    • Schema.Resolver was moved to Type.Out, it is a field and resolver function
      pair.
    • AST.Core.Value was moved into Type.Definition. These values are used only
      in the execution and type system, it is not a part of the parsing tree.
    • Type module is superseded by Type.Out. This module contains now only
      exports from other module that complete Type.In and Type.Out exports.
    • Error.CollectErrsT contains the new Resolution data structure.
      Resolution represents the state used by the executor. It contains all types
      defined in the schema and collects the thrown errors.

    Added

    • Type.Definition contains base type system definition, e.g. Enums and
      Scalars.
    • Type.Schema describes a schema. Both public functions that execute queries
      accept a Schema now instead of a HashMap. The execution fails if the root
      operation doesn't match the root Query type in the schema.
    • Type.In and Type.Out contain definitions for input and output types.
    • Execute.Coerce defines a typeclass responsible for input, variable value
      coercion. It decouples us a bit from JSON since any format can be used to pass
      query variables. Execution functions accept (HashMap Name a) instead of
      Subs, where a is an instance of VariableValue.

    Removed

    • Schema.scalar, Schema.wrappedScalar. They accepted everything can be
      converted to JSON and JSON is not suitable as an internal representation for
      GraphQL. E.g. GraphQL distinguishes between Floats and Integers.
    • Schema.wrappedObject, Schema.object, Schema.resolversToMap. There is no
      need in special functions to construct field resolvers anymore, resolvers are
      normal functions attached to the fields in the schema representation.
    • Schema.resolve is superseded by Execute.Execution.
    • Error.runAppendErrs isn't used anywhere.
    • AST.Core: Document, Directive, Field, Fragment, Selection, Alias
      TypeCondition were modified, moved into Execute.Transform.Document and
      made private. These types describe intermediate representation used by the
      executor internally. Moving was required to avoid cyclic dependencies between
      the executor and type system.
    • AST.Core doesn't reexports anything.
    Downloads