GraphQL client in Chicken: next steps
Lassi Kortela 25 Jul 2019 17:00 UTC
- The GraphQL client is already working for basic tasks. Probably some
advanced features need to be added later. Query variables need to be
added ASAP.
- I have started writing a parser for GraphQL documents. (A document can
contain both schema and operation (query/mutation/subscription)
definitions, as well as any supporting stuff like fragments and
directives, so this is the whole GraphQL grammar.)
- The current fledgling parser is a hand-rolled recursive-descent
parser. This approach is doable but a bit unwieldy. There's a Scheme
"packrat" parsing library by Tony Garnock-Jones with ports for Chicken,
Racket and R6RS. I'll learn it and finish the parser using it. A packrat
parser is an optimized version of a Parsing Expression Grammar (PEG)
that runs in linear time at the cost of using more memory than a PEG.
PEGs are the default framework for writing most parsers these days.
- I have no idea how to best design the "engine" part of the GraphQL
server (I just took on the job because nobody else was doing it). Mark
and David have a lot of combined expertise in it, so they should direct
the effort.
- I've been designing a S-expression skin for GraphQL and have asked
John Cowan for comments now and then. The GraphQL grammar is not very
big so we can finish this soon. I'll post a semi-formal Schema ASAP. All
comments and suggestions are welcome.