Commit Graph

16 Commits

Author SHA1 Message Date
2220f0ca56
Remove unused OverloadedStrings pragmas 2021-04-14 07:09:21 +02:00
7c0b0ace4d Collect types once the schema is created 2020-10-07 05:24:51 +02:00
6e644c5b4b Move path to the execution error
Since it isn't possible to get a path during validation, without
executing the query.
2020-09-16 09:12:49 +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
c9e265f72c Return parser error location in a list
An error can have multiple locations which are returned in a listt with
key "locations".
2020-07-08 08:17:55 +02:00
b2d473de8d Export sum type for all GraphQL types 2020-07-06 19:10:34 +02:00
a6f9cec413 Handle errors using custom types
Fixes #32.
2020-07-05 14:36:00 +02:00
93a0403288 Resolve abstract types
Objects that can be a part of an union or interface should return
__typename as string.
2020-06-03 07:20:38 +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
613e929d91 Update to Stack 15.x 2020-02-20 05:16:14 +01:00
2b5c719ab0 Fix haddoc warnings
Fix #14.
2019-09-20 08:47:14 +02:00
282946560e Add singleError utility function 2019-07-23 07:22:32 +02:00
5cf10b38ec Report parse errors with line and column numbers 2019-07-19 06:38:54 +02:00
f3b8d9b74c Make all exports explicit 2019-07-14 05:58:05 +02:00
22d4a4e583 Change the main namespace to Language.GraphQL 2019-07-07 06:31:53 +02:00