-
0.8.0.0 Stable
released this
2020-06-20 05:48:25 +02:00 | 196 commits to master since this releaseFixed
- The parser rejects variables when parsing defaultValue (DefaultValue). The
specification defines default values asValue
withconst
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 toType.Out
, it is a field and resolver function
pair.AST.Core.Value
was moved intoType.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 byType.Out
. This module contains now only
exports from other module that completeType.In
andType.Out
exports.Error.CollectErrsT
contains the newResolution
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 aSchema
now instead of aHashMap
. The execution fails if the root
operation doesn't match the root Query type in the schema.Type.In
andType.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 ofVariableValue
.
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 byExecute.Execution
.Error.runAppendErrs
isn't used anywhere.AST.Core
:Document
,Directive
,Field
,Fragment
,Selection
,Alias
TypeCondition
were modified, moved intoExecute.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
- The parser rejects variables when parsing defaultValue (DefaultValue). The
-
0.7.0.0 Stable
released this
2020-05-11 12:34:48 +02:00 | 214 commits to master since this releaseFixed
- Result of null encoding
- Block strings encoding
- Result of tab and newline encoding
Added
- AST for the GraphQL schema.
- Type system definition parser.
Trans.argument
.- Schema extension parser.
- Contributing guidelines.
Schema.resolversToMap
(intended to be used internally).
Changed
- Rename
AST.Definition
intoAST.Document.ExecutableDefinition
.
AST.Document.TypeSystemDefinition
andAST.Document.TypeSystemExtension
can also be definitions. - Move all AST data to
AST.Document
and reexport them. - Rename
AST.OperationSelectionSet
toAST.Document.SelectionSet
. - Make
Schema.Subs
aData.HashMap.Strict
(was a function
key -> Maybe value
before). - Make
AST.Lexer.at
a text (symbol) parser. It was a char before and is
symbol "@"
now. - Replace
MonadIO
with a plainMonad
. Since the tests don't use IO,
set the inner monad toIdentity
. NonEmpty (Resolver m)
is nowHashMap Text (NonEmpty (Resolver m))
. Root
operation type can be any type, therefore a hashmap is needed. Since types
cannot be empty, we save the list of resolvers in the type as a non-empty
list. Currently only "Query" and "Mutation" are supported as types. For more
schema support is required. The executor checks now if the type in the query
matches the type of the provided root resolvers.
Removed
AST.Field
,AST.InlineFragment
andAST.FragmentSpread
.
These types are only used inAST.Selection
andAST.Selection
contains now
3 corresponding data constructors,Field
,InlineFragment
and
FragmentSpread
, instead of separate types. It simplifies pattern matching
and doesn't make the code less typesafe.Schema.scalarA
.Schema.wrappedScalarA
.Schema.wrappedObjectA
.Schema.objectA
.AST.Argument
. Replaced withAST.Arguments
which holds all arguments as a
key/value map.
Downloads
-
0.6.1.0 Stable
released this
2019-12-23 06:35:32 +01:00 | 243 commits to master since this releaseFixed
- Parsing multiple string arguments, such as
login(username: "username", password: "password")
would fail on the comma
due to strings not having a space consumer. - Fragment spread is evaluated based on the
__typename
resolver. If the
resolver is missing, it is assumed that the type condition is satisfied (all
fragments are included). - Escaping characters during encoding.
Added
- Directive support (@skip and @include).
- Pretifying multi-line string arguments as block strings.
Downloads
- Parsing multiple string arguments, such as
-
0.6.0.0 Stable
released this
2019-11-27 08:26:51 +01:00 | 252 commits to master since this releaseChanged
Language.GraphQL.Encoder
moved toLanguage.GraphQL.AST.Encoder
.Language.GraphQL.Parser
moved toLanguage.GraphQL.AST.Parser
.Language.GraphQL.Lexer
moved toLanguage.GraphQL.AST.Lexer
.- All
Language.GraphQL.AST.Value
data constructor prefixes were removed. The
module should be imported qualified. - All
Language.GraphQL.AST.Core.Value
data constructor prefixes were removed.
The module should be imported qualified. Language.GraphQL.AST.Core.Object
is now just a HashMap.Language.GraphQL.AST.Transform
is isn't exposed publically anymore.Language.GraphQL.Schema.resolve
accepts a selectionSeq
(Data.Sequence
)
instead of a list. Selections are stored as sequences internally as well.- Add a reader instance to the resolver's monad stack. The Reader contains
a Name/Value hashmap, which will contain resolver arguments.
Added
- Nested fragment support.
Fixed
- Consume ignored tokens after
$
and!
. I mistakenly assumed that
$variable
is a single token, same asType!
is a single token. This is not
the case, for exampleVariable
is defined as$ Name
, so these are two
tokens, therefore whitespaces and commas after$
and!
should be
consumed.
Improved
Language.GraphQL.AST.Parser.type_
: Try type parsers in a variable
definition in a different order to avoid usingbut
.
Removed
Language.GraphQL.AST.Arguments
. Use[Language.GraphQL.AST.Argument]
instead.Language.GraphQL.AST.Directives
. Use[Language.GraphQL.AST.Directives]
instead.Language.GraphQL.AST.VariableDefinitions
. Use
[Language.GraphQL.AST.VariableDefinition]
instead.Language.GraphQL.AST.FragmentName
. UseLanguage.GraphQL.AST.Name
instead.Language.GraphQL.Execute.Schema
- It was a resolver list, not a schema.Language.GraphQL.Schema
:enum
,enumA
,wrappedEnum
andwrappedEnumA
.
Usescalar
,scalarA
,wrappedScalar
andwrappedScalarA
instead.
Downloads
-
0.5.1.0 Stable
released this
2019-10-22 07:07:54 +02:00 | 265 commits to master since this releaseDeprecated
Language.GraphQL.AST.Arguments
. Use[Language.GraphQL.AST.Argument]
instead.Language.GraphQL.AST.Directives
. Use[Language.GraphQL.AST.Directives]
instead.Language.GraphQL.AST.VariableDefinitions
. Use
[Language.GraphQL.AST.VariableDefinition]
instead.
Added
- Module documentation.
- Inline fragment support.
Fixed
- Top-level fragments.
- Fragment for execution is chosen based on the type.
Downloads
-
0.5.0.1 Stable
released this
2019-09-10 10:20:40 +02:00 | 276 commits to master since this releaseAdded
- Minimal documentation for all public symbols.
Deprecated
Language.GraphQL.AST.FragmentName
. Replaced with Language.GraphQL.AST.Name.Language.GraphQL.Execute.Schema
- It is not a schema (at least not a
complete one), but a resolver list, and the resolvers should be provided by
the user separately, because the schema can originate from a GraphQL
document.Schema
name should be free to provide a data type for the real
schema later.Language.GraphQL.Schema
:enum
,enumA
,wrappedEnum
andwrappedEnumA
.
There are actually only two generic types in GraphQL: Scalars and objects.
Enum is a scalar value.
Fixed
- Parsing block string values.
Downloads
-
0.5.0.0 Stable
released this
2019-08-14 08:49:07 +02:00 | 282 commits to master since this releaseAdded
executeWithName
executes an operation with the given name.- Export
Language.GraphQL.Encoder.definition
,
Language.GraphQL.Encoder.type'
andLanguage.GraphQL.Encoder.directive
. - Export
Language.GraphQL.Encoder.value
. Escapes \ and " in strings now.
Changed
Operation
includes now possible operation name which allows to support
documents with multiple operations.Language.GraphQL.Encoder.document
and other encoding functions take a
Formatter
as argument to distinguish between minified and pretty printing.- All encoder functions return
Data.Text.Lazy
.
Downloads
-
0.4.0.0 Stable
released this
2019-07-23 07:22:32 +02:00 | 292 commits to master since this releaseAdded
- Support for mutations.
- Error handling (with monad transformers).
- Nullable types.
- Arbitrary nested lists support.
- Potential BOM header parsing.
Changed
- attoparsec is replaced with megaparsec.
- The library is now under
Language.GraphQL
(instead ofData.GraphQL
). - HUnit and tasty are replaced with Hspec.
Alternative
/MonadPlus
resolver constraints are replaced withMonadIO
.
Downloads
-
0.3 Stable
released this
2015-09-22 14:28:53 +02:00 | 387 commits to master since this releaseChanged
- Exact match numeric types to spec.
- Names follow now the spec.
- AST slightly different for better readability or easier parsing.
- Replace golden test for test to validate parsing/encoding.
Added
- Parsing errors in all cases where
Alternative
is used. - GraphQL encoder.
Downloads
-
0.2.1 Stable
released this
2015-09-16 11:17:41 +02:00 | 402 commits to master since this releaseFixed
- Include data files for golden tests in Cabal package.
- Support for ghc-7.8.
Downloads