Implement SDL Parsing/Printing Support
This PR implements basic support for parsing of GraphQL Schema Definition Language (support was already implemented for the Executable Definition Language of course ) as defined by the graphql-js reference implementation.
Support for parsing of SDL may be at odds with this library's goal of improved type-saftey (over the graphql-js implementation and other schema-driven GraphQL API implementation approaches) however I believe it is worth including support here as SDL parsing is a useful feature to have outside of building type-safe GraphQL API implementations. Both the EDL and SDL are tied very closely together so (I think) it makes sense to co-locate in a single package.
In any case, another option is to break this parser support out into a separate reason-graphql-parser package (seems like the Rust folks did this with graphql-rust/graphql-parser) - let me know what you think.
Great work on this library, I learned a lot about lexers, parsers, and ReasonML (haven't worked with any before, so feel free to wreck me on the review ;) ) 👍
@timkendall Wow! huge contribution! I will take a deep look later as I am traveling right now. What prompted you to contribute to SDL parsing?
Sweet, thanks!
I'm interested in SDL parsing with ReasonML as I am working on a project that generates full GraphQL API's from directive-decorated (using Apollo's Federation Spec) type definitions (like Prisma, AppSync, FaunaDB).
Currently we have this portion (the "compiler" portion) of the project written in TypeScript. Interested in using ReasonML instead however to achieve cleaner code (variants and patten matching lend themselves very nicely to compiler logic) and faster runtime (using ReasonML native compilation) as we are exposing this functionality via a Node-backed CLI interface who's startup time is egregious.
@timkendall Do you want me to review this asap or should I wait for the checklist to complete?
Ha I was going to message you. I think this PR is big enough on its own and was planning on submitting follow up PRs to address the checklist. I'll remove the checklist and you can review 👍