Commit Graph

37 Commits

Author SHA1 Message Date
adeba459a2 Release 0.9.0.0 2020-07-24 21:34:31 +02:00
44d506d4b5 Draft the Validation API 2020-07-20 21:29:12 +02:00
b9d5b1fb1b Return a stream as well from graphql* functions 2020-07-19 07:36:06 +02:00
09135c581a Constrain base monad to MonadCatch
Let's try MonadThrow/MonadCatch. It looks nice at a first glance. The
monad transformer stack contains only the ReaderT, less lifts are
required. Exception subtyping is easier, the user can (and should)
define custom error types and throw them. And it is still possible to
use pure error handling, if someone doesn't like runtime exceptions or
need to run a query in a pure environment.

Fixes #42.
2020-07-17 07:05:03 +02:00
ae2210f659 Support subscriptions
This is experimental support.
The implementation is based on conduit and is boring. There is a new
resolver data constructor that should create a source event stream. The
executor receives the events, pipes them through the normal execution
and puts them into the response stream which is returned to the user.

- Tests are missing.
- The executor should check field value resolver on subscription types.
- The graphql function should probably return (Either
  ResponseEventStream Response), but I'm not sure about this. It will
  make the usage more complicated if no subscriptions are involved, but
  with the current API implementing subscriptions is more
  difficult than it should be.
2020-07-14 19:37:56 +02:00
b2d473de8d Export sum type for all GraphQL types 2020-07-06 19:10:34 +02:00
aef6030a8e Release 0.8.0.0 2020-06-20 05:48:25 +02:00
91bd2d0d81 Fix list input coercion 2020-06-19 10:53:41 +02:00
d12577ae71 Define resolvers on type fields
Returning resolvers from other resolvers isn't supported anymore. Since
we have a type system now, we define the resolvers in the object type
fields and pass an object with the previous result to them.
2020-05-29 13:53:51 +02:00
7cd4821718 Don't fail on invalid fragments and variables 2020-05-23 21:49:57 +02:00
c3ecfece03 Coerce variable values 2020-05-21 10:20:59 +02:00
9232e08eb9 Release 0.7.0.0 2020-05-11 12:34:48 +02:00
Dmitrii Skurikhin
2760bd8ee1 Don't encode controls as block strings
Fixes #39.

String containing control sequences should be encoded as simple strings
even if they contain newlines, since the block strings can contain only
SourceCharacters.
2020-04-10 11:19:36 +02:00
cb5270b197 Update copyright 2020-01-21 23:27:21 +01:00
6d951491be Replace Parser.manyNE with NonEmpty.some 2020-01-12 07:19:28 +01:00
bdf711d69f Release 0.6.1.0 2019-12-23 06:35:32 +01:00
b215e1a4a7 Pretify multi-line string arguments as block strings
Fixes #10.
2019-12-21 09:25:05 +01:00
0cbe69736b Move Execute.Directive to Type.Directive
Just to roughly follow the structure of the reference implementation.
2019-12-18 09:03:18 +01:00
4c0d226030 Move Transform to Language.GraphQL.Execute
Language.GraphQL.AST.Transform is an internal module. Even though it
works with the AST, it is a part of the execution process, it translates
the original parser tree into a simpler one, so the executor has less
work to do. Language.GraphQL.AST should contain only the parser and be
independent from other packages, so it can be used on its own.
2019-12-07 09:46:00 +01:00
3c1a5c800f Support directives (skip and include)
Fixes #24.
2019-12-06 22:52:24 +01:00
3497784984 Release 0.6.0.0 2019-11-27 08:26:51 +01:00
7b92e5bcfd Rewrite selections into a Sequence. Fix #21 2019-11-16 11:41:40 +01:00
73fc334bf8 Move related modules to Language.GraphQL.AST
Fixes #18.

- `Language.GraphQL.Encoder` moved to `Language.GraphQL.AST.Encoder`.
- `Language.GraphQL.Parser` moved to `Language.GraphQL.AST.Parser`.
- `Language.GraphQL.Lexer` moved to `Language.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.Transform` is now isn't exposed publically anymore.
2019-11-03 11:00:18 +01:00
75bc3b8509 Release 0.5.1.0 2019-10-22 07:07:54 +02:00
c7d5b02911 Handle top-level fragments
Fixes #17.
2019-10-19 10:00:25 +02:00
eb98c36258 Introduce hspec-megaparsec
Fixes #13.
2019-09-27 10:50:38 +02:00
721cbaee17 Release 0.5.0.1 2019-09-10 10:20:40 +02:00
f54e9451d2 Release 0.5.0.0 2019-08-14 08:49:07 +02:00
282946560e Add singleError utility function 2019-07-23 07:22:32 +02:00
74801b0483 Remove TODO
Issues should be created instead.
2019-07-17 07:06:35 +02:00
eb40810f25 Replace tasty and HUnit with Hspec 2019-07-10 05:57:35 +02:00
22d4a4e583 Change the main namespace to Language.GraphQL 2019-07-07 06:31:53 +02:00
1431db7e63 Add licence badge 2019-07-06 07:57:18 +02:00
f64e186c60 Move the source code into src/ 2019-06-30 06:07:32 +02:00
79c734fa62 Replace Alternative with MonadPlus 2019-06-28 11:12:28 +02:00
5e9bf9648d Parse queries with megaparsec 2019-06-21 10:44:58 +02:00
ce169ecef2 Add package.yaml, update stack snapshot to 13.25 2019-06-11 06:34:15 +02:00