cppgraphqlgen

C++ GraphQL schema service generator

MIT License

Stars
323
Committers
16
cppgraphqlgen - Fix empty list and object results

Published by wravery over 5 years ago

Results for empty lists or types with no members should be included in the results. See issue #39 for more details.

cppgraphqlgen - Fix empty list and object results

Published by wravery over 5 years ago

Results for empty lists or types with no members should be included in the results. See issue #39 for more details.

cppgraphqlgen - Fix generated __typename resolver

Published by wravery over 5 years ago

I found bug #37 testing the last release against Relay. I added some asserts to one of the unit tests to protect this field in the future.

cppgraphqlgen - Fix generated __typename resolver

Published by wravery over 5 years ago

I found bug #37 testing the last release against Relay. I added some asserts to one of the unit tests to protect this field in the future.

cppgraphqlgen - Simplify the AST handling

Published by wravery over 5 years ago

The change which breaks compatibility with v1.x in this release is an update to the peg::ast definition and parsing functions. It's much simpler now, with less std::unique_ptr juggling and pointer dereferencing.

Other than that, this release should be identical to v1.2.0. It brings the following changes from v1.1.0:

  • GraphQL parse errors should be much easier to read now.
  • Exceptions in a single field should no longer fail the entire request, instead it'll accumulate multiple errors and return them along with whatever partial results it was able to retrieve in the data member.
  • Refactored the operation definition visitors to share more code and expose a public method findOperationDefinition to figure out the operation type.
cppgraphqlgen - Backport error/exception handling improvements

Published by wravery over 5 years ago

Cherry-picking compatible fixes and features from the master branch for v1.2.0:

  • GraphQL parse errors should be much easier to read now.
  • Exceptions in a single field should no longer fail the entire request, instead it'll accumulate multiple errors and return them along with whatever partial results it was able to retrieve in the data member.
  • Refactored the operation definition visitors to share more code and expose a public method findOperationDefinition to figure out the operation type.
cppgraphqlgen - Added support for matching subscription arguments

Published by wravery over 5 years ago

I need to make a couple of breaking API changes to fix the next set of bugs, so I'm separating the latest changes in a v1.1.x branch. The next release should be v2.0.0, unless I need to make any bug fixes in v1.x.x before then.

The new feature that bumped this up from the v1.0.x series is support for subscription arguments and filters based on those arguments. I also fixed a couple of bugs in response::Value which didn't require breaking changes to the API.

cppgraphqlgen - Bug fixes for enum values, interfaces, and JSON parsing

Published by wravery almost 6 years ago

I found and fixed several bugs with a private schema I started working on that includes enum values as resolver parameters, types with multiple interface implementations, and nested JSON objects in some of the test data.

cppgraphqlgen - Bug fix in schemagen list value default value parsing

Published by wravery almost 6 years ago

The same bug I fixed in v1.0.1 also exists in the schemagen list value visitor in DefaultValueVisitor.

cppgraphqlgen - Bug fix in list value parsing

Published by wravery almost 6 years ago

There was a bug in the GraphQL list value parser which expected an intermediate node in the parse tree between the list and the items in the list. Passing list values as variables works around the bug, but if you build a list in the GraphQL query (including inserting a variable value into a list) it would dereference an out of bounds vector element on an empty vector.

cppgraphqlgen - 1.0.0 Release

Published by wravery almost 6 years ago

All planned features and testing are done, so let's call it complete. 💯

I built it into an Electron app with a Node native module and I got GraphiQL working against that, which uncovered some gaps in the Introspection support. I plan on publishing the native module and the GraphiQL app which consumes it as samples under my own account rather than trying to integrate them as complete projects into this one. Relevant code snippets might make their way into the documentation.

I also added runtime @directive support. You can declare custom directives in the schema and they will be included in the Introspection. If you include directives in your queries at runtime, they will be passed to each of the getField interface accessors in a response::Value 2-level map.

To support passing directives and adding future parameters, I defined a parameter block struct service::FieldParams. The signature of the generated interfaces should not need to change again just to support passing new contextual or environmental parameters into them, which will make it easier to perform non-breaking minor-version updates in the future.

cppgraphqlgen - Many new features!

Published by wravery almost 6 years ago

This release incorporates several large refactors since v0.6. It's much closer to a v1.0 release than before, but there are still a couple of Issues to work through before jumping to v1.0.

Highlights include:

  • Better CMake configuration for inclusion in other projects
  • Async support using std::future<> and service::RequestState
  • JSON-agnostic GraphQL responses. It's still using RapidJSON for JSON serialization by default, but now it's isolated in a single file which you can replace if you want to link with something else.
  • GraphQL subscription support (subscribe/unsubscribe/deliver)

The downside is that if you have a lot of custom code in your interface implementations or callers, the signatures of most of these methods changed quite a bit, particularly for the async support. I don't anticipate needing to break the interface again between now and v1.0.

cppgraphqlgen - User Defined Literals and performance improvements

Published by wravery almost 6 years ago

  • I added a C++ string UDL so you can parse a hard-coded GraphQL query or schema with "..."_graphql, much like the graphql function in Relay which instructs the relay-compiler to preprocess queries embedded in JS/JSX (or TS/TSX for TypeScript).
  • I made some improvements to the tests to cache more between tests in the test class/fixture so there's less work in the per-test Setup/Teardown.
  • The RapidJSON calls are optimized to avoid excessive memory copies between separate documents at runtime in the service. Pretty much all of the rapidjson::Value objects included in the results document should be constructed in place using the target document's own allocator.
cppgraphqlgen - CMake cleanup

Published by wravery almost 6 years ago

Making the build compatible with package managers such as vcpkg without requiring additional patches.

cppgraphqlgen - Replacing cpprestsdk with RapidJSON

Published by wravery almost 6 years ago

This release doesn't have any runtime dependencies on building other projects. All of the dependencies are header-only libraries now.

cppgraphqlgen - Replacing the libgraphqlparser dependency with tao::pegtl

Published by wravery almost 6 years ago

cppgraphqlgen - Updating to production ready

Published by wravery about 6 years ago

While there's still more to do and it's not ready for v1.0, I think this is ready for use in another project now. So I'm dropping the pre-release flag from this release.

This version updates the documentation and samples, plus some tweaks to the CMake configuration to make it easier to create a vcpkg port from this release.

cppgraphqlgen - Initial public release

Published by wravery about 6 years ago

See the README file for instructions on getting started on Linux or Windows.

Package Rankings
Top 8.17% on Proxy.golang.org
Related Projects