Skip to content

Releases: microsoft/cppgraphqlgen

Update to C++17

07 May 17:42
Compare
Choose a tag to compare

Highlights from #52:

Adopting C++17

  • Move to PEGTL master/3.0.0 (not yet officially released)
  • Use std::variant for response::Value
  • Replace std::unique_ptr for nullable fields with std::optional

Schemagen improvements

  • Make NYI stub generation optional
  • Split the class definitions/declarations into separate files. May also help with making the NYI stubs optional (i.e. decide whether or not to compile and link them individually).
  • Improve error handling/reporting.
  • Add command line options for things like defining a target directory.
  • Change the names of the generated Mutation accessors to something like applyFieldName. Calling everything getFieldName feels strange when performing a mutation.

Miscellaneous

  • Introduce service::FieldResult which handles returning either by value of T or as a std::future<T>
  • Let the caller specify the std::launch policy for the Request::resolve top-level call.
  • Build a separate library target for the grammar/AST.
  • Replace std::string with std::string_view where appropriate.
  • Replace ast<std::string> with ast<std::vector<char>> to deal with small-string-optimization issues rather than reserving extra space when the string is too short.
  • Replace the facebook::graphql namespace with just graphql for the sake of brevity.

Implement default NYI stubs

05 Mar 19:53
2e14371
Compare
Choose a tag to compare

I was finding it difficult to get started with a new schema or to add types to an existing schema since all of the pure virtual methods would need to be defined on the subclass before it could even link. The new feature in this release is that schemagen will generate stub implementations which throw a std::runtime_error exception and bubble up a "not implemented" message to the field error if they are not overridden.

This release also includes the fix for Issue #44 handling schema extensions and PR #42 which cleans up some of the USE_RAPIDJSON handling in CMake.

Fix schema extension handling

05 Mar 19:46
Compare
Choose a tag to compare

Bug fix release with the fix for #44 in schemagen.

Fix empty list and object results

07 Feb 08:02
7e3acf9
Compare
Choose a tag to compare

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

Fix empty list and object results

07 Feb 08:01
Compare
Choose a tag to compare

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

Fix generated __typename resolver

06 Feb 18:54
25f98da
Compare
Choose a tag to compare

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.

Simplify the AST handling

06 Feb 05:28
12936c0
Compare
Choose a tag to compare

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.

Fix generated __typename resolver

06 Feb 18:53
Compare
Choose a tag to compare

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.

Backport error/exception handling improvements

06 Feb 05:21
Compare
Choose a tag to compare

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.

Added support for matching subscription arguments

27 Jan 05:05
ee264a6
Compare
Choose a tag to compare

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.