Commit Graph

121 Commits

Author SHA1 Message Date
Eugen Wissner d7b6fd0329 Allow resolvers to return arbitrary nested lists 2019-07-05 20:05:04 +02:00
Eugen Wissner 2fa50d4f62 Update CI settings 2019-07-04 06:32:04 +02:00
Eugen Wissner 6238b2fbfa Add nullable types 2019-07-03 17:54:50 +02:00
Eugen Wissner 91679650b5 Introduce monad transformer for resolvers
Now the errors in the resolvers can be handled and 3 tests throwing
errors pass now. Another test fail but it requires distinguisching
nullable and non-nullable values.
2019-07-02 20:07:26 +02:00
Eugen Wissner 1017b728d9 Pass root field names together with resolvers 2019-07-01 07:05:10 +02:00
Eugen Wissner f64e186c60 Move the source code into src/ 2019-06-30 06:07:32 +02:00
Eugen Wissner 28aaa6a70b Remove GHCI config 2019-06-29 04:46:45 +02:00
Eugen Wissner 79c734fa62 Replace Alternative with MonadPlus 2019-06-28 11:12:28 +02:00
Eugen Wissner ae4038eb47 Restore error handling 2019-06-27 08:00:59 +02:00
Eugen Wissner 3cc38343db Fix ambigious Int resolution in the lexer tests 2019-06-26 15:41:30 +02:00
Eugen Wissner 2172de3729 Enable mutations 2019-06-23 05:38:45 +02:00
Eugen Wissner 5e9bf9648d Parse queries with megaparsec 2019-06-21 10:44:58 +02:00
Eugen Wissner ce169ecef2 Add package.yaml, update stack snapshot to 13.25 2019-06-11 06:34:15 +02:00
Danny Navarro 40f9024b51 Merge pull request #22 from Lupino/master
update docs
2017-03-07 20:03:12 -03:00
Lupino 8d21972c42 update docs 2017-03-05 11:01:07 +08:00
Danny Navarro 2b5648efda
When argument is not found return null
The relevant test was restored too.
2017-03-03 17:02:19 -03:00
Danny Navarro fb071210cf
Fix wrong scientific exponent when parsing 2017-03-03 15:23:43 -03:00
Danny Navarro 285ccb0af9
Implement type instrospection tests
The main intention with this commit is to show a poor's man way to support type
instrospection.
2017-03-01 17:04:13 -03:00
Danny Navarro 6a10e28ba8
Garden 2017-03-01 16:05:49 -03:00
Danny Navarro 5954962de1
Make alternate Schema functions work with AST.Core 2017-03-01 16:04:35 -03:00
Danny Navarro 1327bcf7f7
Merge pull request #20 from Lupino/master 2017-03-01 15:13:20 -03:00
Danny Navarro e521d92c7f
Use builtin scientific `toBoundInteger` to check for Int32 bounds 2017-02-28 17:22:06 -03:00
Danny Navarro 1b8fca3658
Merge branch 'core'
This introduces a distinction between a Full and a Core AST. Fragments and
variables are replaced when transforming from Full to Core.
2017-02-28 16:07:00 -03:00
Danny Navarro bada28ce24
Simplify fragment substitution 2017-02-24 16:46:51 -03:00
Danny Navarro d2c138f8d1
Add basic Fragment Support
Only field names are supported for now.
2017-02-23 15:29:58 -03:00
Lupino 3be86bf69e Enable Monad for array and object resolver
When I use facebook/haxl, I can not find any way to the sub resolver.
so I add Monad resolver to support it.
2017-02-23 11:08:47 +08:00
Danny Navarro 39731ff233
Fix parsing of Named Types 2017-02-13 15:31:56 -03:00
Danny Navarro b7a72591fd
Support variables in AST transformation 2017-02-13 15:19:13 -03:00
Danny Navarro e716bc57e7
Wrap executed result in "data" object 2017-02-10 17:10:09 -03:00
Danny Navarro 4ab4660d36
Initial implementation of AST.Full -> AST.Core
This focused mainly on fragments.
2017-02-10 15:00:22 -03:00
Danny Navarro 8b09c8aa76
Make operation name optional 2017-02-03 12:57:21 -03:00
Danny Navarro 693b7d18dc
Introduce Tranform module
In the Transform module the Full AST will converted to Core AST.

This commit also includes a partial implementation of Fragment replacement.
2017-02-02 12:44:03 -03:00
Danny Navarro f35e1f949a
Define Schema using Core AST
Also, temporarily remove error reporting to simplify execution. This should be
restored once the new execution model is nailed.
2017-01-30 15:20:17 -03:00
Danny Navarro 337b620717
Update .gitignore 2017-01-29 11:11:30 -03:00
Danny Navarro 642eab312f Merge pull request #19 from jasonzoladz/master
Fix Int32 bounds checking in Value parser.
2017-01-28 14:36:44 -03:00
Danny Navarro 5390c4ca1e
Split AST in 2
One AST is meant to be a target parser and tries to adhere as much as possible
to the spec. The other is a simplified version of that AST meant for execution.

Also newtypes have been replaced by type synonyms and NonEmpty lists are being
used where it makes sense.
2017-01-28 14:15:14 -03:00
jasonzoladz 140c7df6fb Fix Int32 bounds checking in Value parser. 2017-01-28 12:06:28 -05:00
Danny Navarro 3e991adf4e
Add Graphql Core AST 2017-01-26 12:52:07 -03:00
Danny Navarro 10fdf05aa7
Remove Type Definition support 2017-01-26 11:56:22 -03:00
Danny Navarro 933cfd2852
Tokenize number parser
The essential change hidden behind the code golfing is using the `tok`
combinator. This was making fail the Kitchen Sink test.
2016-12-18 12:19:59 -03:00
Danny Navarro aa66236081
Add homePlanet to test schema 2016-12-18 11:43:45 -03:00
Danny Navarro afb2fc4eb9
Include GHC-8.0.1 in travis build 2016-12-18 10:59:02 -03:00
Danny Navarro 5dc9222025 Merge pull request #16 from teh/master
Parse number as scientific and interpret meaning separately.
2016-12-12 16:42:18 -03:00
Tom Hunger 87c92e9d6e Parse number as scientific and interpret meaning separately.
The current parser will fail parsing floats because it parses an int,
and then stumbles on the dot.

To fix I interpret the value with the scientific library which already
is a dependency through attoparsec, so we're not introducing any extra
downloads or compiling.

I think this is still subtly wrong because "10.0" will be parsed as
ValueInt, but because input argument ints are allowed to be coerced
into doubles (according to the spec) this is probably acceptable.
2016-12-09 00:03:20 +00:00
Danny Navarro 61f0a06096
Drop support for GHC-7.8.4 2016-11-27 12:56:44 -03:00
Danny Navarro 2cc6b00051 Merge pull request #11 from pweaver/starwars_tests
Remaining Starwars Tests
2016-07-11 19:33:48 -04:00
Pweaver (Paul Weaver) c396a4b545 add pweaver to contributors 2016-07-09 10:55:16 -04:00
Pweaver (Paul Weaver) a6c0d63049 add tests for errors in queries for queries in starwars tests 2016-07-08 18:10:14 -04:00
Pweaver (Paul Weaver) 624efbbb35 adds __typename tests to starwars testfile 2016-07-08 16:51:54 -04:00
Pweaver (Paul Weaver) cb73e9d53c adds the starwars tests for fragments
Also refactors some deplicate objects into a where clause
2016-07-08 16:11:03 -04:00