Releases: obmarg/cynic
Releases · obmarg/cynic
v2.2.5
Bug Fixes
- The macro generated code now compiles under
-D rust-2018-idioms
v2.2.4
Bug Fixes
- Fix an issue where you'd get extremely weird compiler errors if your
QueryFragment
had fields namedkey
ormap
.
v2.2.3
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
v2.2.1
v2.2.0
v2.1.0
New Features
InlineFragments
derives for union types now allow a fallback that receives
the__typename
Bug Fixes
schema_for_derives
no longer ignoresQueryVariables
structs.- A slight improvement on the error spans if you refer to a missing variable
in some QueryFragment arguments.
v2.0.1
v2.0.0
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)]
, wheremy_variable
is a field on your
QueryVariables
struct. - Arguments should be provided with the casing of the GraphQL schema rather
thansnake_casing
them. - Cynic now derives
serde::Serialize
andserde::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 anhttp
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 ofOperation
. Their use should still be the same. - An
Enum
can no longer be shared between schemas. If you were doing this,
you should define twoEnum
s and provide conversion functions beteween the
two of them. InlineFragments
now always require a fallback and no longer perform
exhaustiveness checking.QueryBuilder
,MutationBuilder
andSubscriptionBuilder
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 thenative-tls
feature. Users
should enable one of thetls
features ofreqwest
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-exportsserde_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 toQueryVariables
- The
argument_struct
attribute forQueryFragment
andInlineFragments
has
been deprecated in favour ofvariables
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 usesinflector
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 theQueryFragment
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 isimpl_scalar
invocations which must live in the same crate as the schema)- Cynic now allows fields to be
Arc
orRc
- 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
Breaking Changes
- The
CynicReqwestError
enum (behind thereqwest
&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!
, thequery_module
module attribute, theGraphQLError
,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.