Skip to content

Releases: obmarg/cynic

v2.2.5

16 Feb 17:36
Compare
Choose a tag to compare

Bug Fixes

  • The macro generated code now compiles under -D rust-2018-idioms

v2.2.4

18 Jan 21:42
Compare
Choose a tag to compare

Bug Fixes

  • Fix an issue where you'd get extremely weird compiler errors if your
    QueryFragment had fields named key or map.

v2.2.3

03 Jan 20:13
Compare
Choose a tag to compare

Bug Fixes

  • The generator and derive macros are now aware of the implicit __typename
    that every object & interface type gets.
  • Fixed support for support fields with one or more leading underscores in the
    derives. This would have been possible before but only by using a rename
    attribute.

v2.2.2

28 Dec 14:22
Compare
Choose a tag to compare

Bug Fixes

  • Fixed a compilation error when targeting wasm with the http-reqwest feature
    enabled.

v2.2.1

16 Nov 17:51
Compare
Choose a tag to compare

Bug Fixes

  • Exposed the StreamingOperation type which was accidentally not exported in
    the move to v2.0.

v2.2.0

14 Nov 11:23
Compare
Choose a tag to compare

Changes

  • The use_schema output has been re-organised to reduce the chances of
    clashes. This is technically a breaking change, but only if you're writing
    queries by hand rather than using the derives.

v2.1.0

09 Nov 13:05
Compare
Choose a tag to compare

New Features

  • InlineFragments derives for union types now allow a fallback that receives
    the __typename

Bug Fixes

  • schema_for_derives no longer ignores QueryVariables structs.
  • A slight improvement on the error spans if you refer to a missing variable
    in some QueryFragment arguments.

v2.0.1

08 Nov 16:59
Compare
Choose a tag to compare

Bug Fixes

  • Some of the derives weren't recasing GraphQL types/fields correctly, leading
    to weird errors.
  • Scalars defined using impl_scalar! couldn't be used as variables. Now they
    can.

v2.0.0

07 Nov 15:44
Compare
Choose a tag to compare

This release contains a lot of breaking changes.

See the upgrade guide for help

Breaking Changes

  • Cynic no longer supports providing variables via the arg.X syntax. Instead
    you should provide variables similar to how you would do in a GraphQL query:
    #[arguments(someArg: $my_variable)], where my_variable is a field on your
    QueryVariables struct.
  • Arguments should be provided with the casing of the GraphQL schema rather
    than snake_casing them.
  • Cynic now derives serde::Serialize and serde::Deserialize where
    appropriate so you can no longer do this yourself on structs you are using
    with cynic.
  • Decoding GraphQLResponses should now be done directly with serde using a
    decode_response function on the operation (unless you're using an http
    extension trait, which will deal with this for you).
  • Operation has changed:
    • It no longer has a lifetime.
    • It is now generic over the arguments type.
  • The http extension traits have had their signatures changed to accomodate
    the new signature of Operation. Their use should still be the same.
  • An Enum can no longer be shared between schemas. If you were doing this,
    you should define two Enums and provide conversion functions beteween the
    two of them.
  • InlineFragments now always require a fallback and no longer perform
    exhaustiveness checking.
  • QueryBuilder, MutationBuilder and SubscriptionBuilder no longer have a
    ResponseData associated type.
  • QueryBuilder::build, MutationBuilder::build and
    SubscriptionBuilder::build now take their argument by value not by
    reference.
  • The surf, reqwest & reqwest-blocking features have been renamed to
    http-surf, http-reqwest & http-reqwest-blocking respectively.
  • The http-reqwest feature no longer uses the native-tls feature. Users
    should enable one of the tls features of reqwest themselves.
  • The surf-h1-client, surf-curl-client, surf-wasm-client,
    surf-middleware-logger & surf-encoding features have been removed. If
    users want to enable these features in surf they should do it in their own
    Cargo.toml.
  • cynic no longer re-exports serde_json
  • The GraphQlError & GraphQlResponse structs no longer contain a
    serde_json::Value for extensions. They now have generic parameters that you
    should provide if you care about error extensions.
  • The output of the use_schema macro is no longer re-cased.
  • The deprecated query_module attribute for the various derive/attribute
    macros has been removed - if you're using it you should update to
    schema_module which behaves the same.

Deprecations

  • The FragmentArguments trait & derive has been renamed to QueryVariables
  • The argument_struct attribute for QueryFragment and InlineFragments has
    been deprecated in favour of variables

Bug Fixes

  • Fixed a case where the generator would output the incorrect casing for some
    occurrences of a custom scalar in the output (#346)
  • Cynic should now support schemas which have 2 similarly named but differently
    cased scalars.
  • Cynic should no longer fail to compile in the face of various non-breaking
    schema changes.
  • #[cynic(flatten)] no longer allows you to omit a list type on output fields.
    Previously this would compile but probably fail to deserialize.
  • Non-nullable arguments & input object fields with defaults are no longer
    considered required

Changes

  • Cynic now supports a new syntax for arguments:
    #[arguments(someArg: {"someField": 1})]
  • cynic no longer uses inflector to re-case things. Hopefully this won't
    cause any regressions, but if it does please raise an issue.
  • InlineFragments now take their expected typenames from the QueryFragment
    inside their variants, rather than from the name of the variants themselves.
  • Queries output by cynic may have more literals in the GraphQL query string
    than they had in previous versions of cynic. Though the end result should
    be the same.
  • use_schema output can now live in a separate crate from queries, which
    should help with large schema support. (The exception is impl_scalar
    invocations which must live in the same crate as the schema)
  • Cynic now allows fields to be Arc or Rc
  • The generator no longer outputs input types that are provided in argument
    literals, as these are no longer used in the generated code.

v1.0.0

09 Dec 22:48
Compare
Choose a tag to compare

Breaking Changes

  • The CynicReqwestError enum (behind the reqwest & reqwest-blocking
    feature flags) has a new variant to handle non 2XX responses from servers.
  • Removed the GraphQlResult & PossiblyParsedData types (which weren't being
    used)
  • Removed the following deprecated things: query_dsl!, the query_module
    module attribute, the GraphQLError, GraphQLResponse,
    GraphQLErrorLocation & GraphQlErrorPathSegment type aliases.

New Features

  • The InlineFragments derive now supports a rename attribute on variants

Changes

  • The QueryFragment derive now supports fields with types that take generic
    parameters directly, e.g. DateTime<Utc> from chrono. Previously this would
    have required a type alias to hide the generic parameters from cynic.

Bug Fixes

  • The various HTTP client integrations will now return HTTP error details and
    the full body on non 2XX responses that don't contain a valid GraphQL
    response. Previously they would have tried to decode the response as GraphQL
    and returned the error from that operation.