A C++11 GraphQL query parser with C and C++ APIs for building language bindings.
libgraphqlparser is a GraphQL query parser implemented in C++11 that provides C and C++ APIs. It parses GraphQL queries into an Abstract Syntax Tree (AST) and serves as a foundation for building GraphQL extensions in other programming languages. The project solves the problem of needing to write a GraphQL parser from scratch when adding GraphQL support to a new language or system.
Developers building GraphQL language bindings, extensions, or tools in C/C++ ecosystems, or those needing a performant parser core for custom GraphQL implementations.
Developers choose libgraphqlparser because it offers a battle-tested, reusable parser with dual C/C++ APIs, reducing the effort required to add GraphQL support to new environments. Its AST generation framework and focus on being a foundation for bindings make it uniquely suited for language integration projects.
A GraphQL query parser in C++ with C and C++ APIs
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides both C and C++ interfaces, enabling integration into diverse codebases and simplifying language binding creation, as evidenced by the pure C API in the 'c' subdirectory.
Includes a code generation framework in the 'ast/' subdirectory that automatically builds AST classes and visitors, reducing manual boilerplate for developers extending the parser.
Uses CMake and can leverage Flex and Bison if available, or fall back on checked-in parser files, offering flexibility in different development environments.
Designed specifically as a foundation for creating GraphQL extensions in other programming languages, with examples like Python bindings in the 'python' subdirectory.
Officially only supports Mac OS X and Linux, excluding Windows and other systems, which restricts its use in cross-platform applications.
Running tests requires manual download and setup of googletest in the 'test' subdirectory, as described in the README, adding overhead for verification.
Relies on Flex and Bison for parser generation, which the README admits have 'idiosyncratic interfaces,' potentially complicating maintenance and modern integration.
Focuses on low-level parsing details with minimal examples beyond basic AST dumping, lacking guidance for common use cases like server implementations.