summaryrefslogtreecommitdiff
path: root/Data/GraphQL/Parser.hs
AgeCommit message (Collapse)Author
2017-01-28Split AST in 2Danny Navarro
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-26Remove Type Definition supportDanny Navarro
2016-12-18Tokenize number parserDanny Navarro
The essential change hidden behind the code golfing is using the `tok` combinator. This was making fail the Kitchen Sink test.
2016-12-09Parse number as scientific and interpret meaning separately.Tom Hunger
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-11-27Drop support for GHC-7.8.4Danny Navarro
2016-03-15Merge branch 'all-improvements'Danny Navarro
This adds general API documentation, a tutorial and error handling.
2016-03-14Added documentation of functions and modules and included tutorial.lhs.solrun
2016-02-22Remove `StringValue` typeDanny Navarro
2015-09-22Fixes for ghc-7.8Danny Navarro
2015-09-22Add kitchen sink parse/encode unit testDanny Navarro
This also includes the fixes to make it work. Golden tests have been removed.
2015-09-22Parser fixes:Danny Navarro
- Braces instead of parens for `inputValueDefinitions`. - Rename `bool` -> `booleanValue`. - Some code rearrangements.
2015-09-21Introduce `Node` data type to simplify `OperationDefinition`Danny Navarro
Thanks to @swolchok for the suggestion.
2015-09-21Add errors for all parser `Alternative`sDanny Navarro
2015-09-18Handle escaped quotes for GraphQL String ValuesDanny Navarro
This also includes a new type for Value String. The tests fail now, although it parses successfully. I'll use a pretty printer in next commit so that it's easier to spot the differences. Onces this is working I'll add the rest of the escaped characters.
2015-09-18GolfDanny Navarro
2015-09-18Parse secure namesDanny Navarro
2015-09-18Refine numeric typesDanny Navarro
2015-09-18GardenDanny Navarro
2015-09-16Support ghc-7.8Danny Navarro
2015-09-14Enable warnings and take care of extra importsDanny Navarro
2015-09-14Handle comments in whitespaceDanny Navarro
2015-09-14Fix `value` parsingDanny Navarro
- Add missing variable parsing. - Reuse `name` in value string. This parses successfully the `kitchen-sink.graphql` sample from `graphql-js`.
2015-09-14Replace `take...` functions with `many...`Danny Navarro
They are less efficient but they are giving me issues because they don't fail. Once this is working I'll look into optimizing. Also disable skipping comments until I figure out how to skip both comments and space at the same time.
2015-09-14Several improvements to the parserDanny Navarro
- Add token combinator to simplify whitespace handling. - Simplify whiteSpace parsers. - Add `optempty` to handle pure mempty cases. `empty /= pure mempty`. - Use `between` combinators for brackets, braces and parens. This also includes small adjustments to the AST.
2015-09-13Add missing `=` required default values and unionsDanny Navarro
2015-09-13Take care of commentsDanny Navarro
2015-09-13Add GraphQL parserDanny Navarro
WIP: This parser just type checks, it hasn't even been tested manually. Check new tasks in the TODO file and the TODO comments in the code for more gotchas.