cynic-codegen
Procedural macro code generation for cynic - a code first GraphQL client for Rust
3.14.0
4.6M downloads/mo
#4689 most downloaded on crates.io
source
What this package is like to depend on
Last release 1 months ago
12 Jul 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 72 of 72 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
76 releases · first in 2020
4 releases in the last 12 months
see the full history below
Release timeline
76 releases · Feb 2020 to Jul 2026Releases
latest 60 of 76-
3.14.012 Jul 2026Release notes
Open source →New Features
- StreamingOperation now exposes its query, variables & operation_name
Changes
- The generator had a very large refactor in this release, so expect some minor changes to its output.
- In particular some things will be in a slightly different order and some calcaulated names may have changed.
- The names of fragments should now be preserved in generator output
- Vastly improved handling of fragments in generator (#1218)
- Correctly deal with interfaces in the generator (#1219)
Bug Fixes
Contributors
Thanks to the people who contributed to this release:
Release notes
Open source →New Features
- StreamingOperation now exposes its query, variables & operation_name
Changes
- The generator had a very large refactor in this release, so expect some minor changes to its output.
- In particular some things will be in a slightly different order and some calcaulated names may have changed.
- The names of fragments should now be preserved in generator output
- Vastly improved handling of fragments in generator (#1218)
- Correctly deal with interfaces in the generator (#1219)
Bug Fixes
-
3.13.211 Apr 2026Release notes
Open source →Bug Fixes
- Fixed a possible panic when reading schemas or queries with short block
strings.
Release notes
Open source →Bug Fixes
- Fixed a possible panic when reading schemas or queries with short block strings.
- Fixed a possible panic when reading schemas or queries with short block
-
3.13.128 Feb 2026Release notes
Open source →Bug Fixes
- QueryVariables derive will not show errors from missing_docs lint
(#1201)
Contributors
Thanks to the people who contributed to this release:
Release notes
Open source →Bug Fixes
- QueryVariables derive will not show errors from missing_docs lint (#1201)
- QueryVariables derive will not show errors from missing_docs lint
-
3.13.027 Feb 2026Release notes
Open source →New Features
- Feature flags are now supported on on arguments (#1181)
- An
InputObjecton aoneOftype will automatically skip serializing all of
it's null fields (#1179) InputObjectcan now be derived on enums for oneOf inputs (#1174)Operationis nowClone(#1170)- The reqwest integation now accepts
&Operationas well asOperation(#1169) - The
QueryFragmentderive now supports therename_allattribute (#1167) - add
@oneOfsupport to introspection (#1177) - oneOf input objects are now supported in the in the generator (#1175)
- cynic-introspection now supports additions from the 2025 spec (#1180)
cynic-querygennow has afield_overridesoption that can be used to
customize the type of individual scalar fields in generatedQueryFragments (#1184)
Bug Fixes
cynic_querygenhas a new interface based around theGeneratortype
(#1187)- Fixed an issue with lifetime detection on nested input objects in the
generator
Deprecations
- The old intrerface to cynic_querygen has been marked deprecated
Changes
Release notes
Open source →Note that this is the last release that will be pushed to github - development of cynic will continue over on codeberg.org/obmarg/cynic.
New Features
- Feature flags are now supported on on arguments (#1181)
- An
InputObjecton aoneOftype will automatically skip serializing all of it's null fields (#1179) InputObjectcan now be derived on enums for oneOf inputs (#1174)Operationis nowClone(#1170)- The reqwest integation now accepts
&Operationas well asOperation(#1169) - The
QueryFragmentderive now supports therename_allattribute (#1167) - add
@oneOfsupport to introspection (#1177) - oneOf input objects are now supported in the in the generator (#1175)
- cynic-introspection now supports additions from the 2025 spec (#1180)
cynic-querygennow has afield_overridesoption that can be used to customize the type of individual scalar fields in generatedQueryFragments (#1184)
Bug Fixes
cynic_querygenhas a new interface based around theGeneratortype (#1187)- Fixed an issue with lifetime detection on nested input objects in the generator
Deprecations
- The old intrerface to cynic_querygen has been marked deprecated
Changes
- Updated reqwest to 0.13 (#1190)
- MSRV is now 1.85 (#1172)
- Updated rkyv to 0.8.0 (#1110)
-
3.12.019 Aug 2025Release notes
Open source →New Features
- The
graphql_typeattribute on fields of variable structs can now specify
generic types instead of just single named types.
Bug Fixes
Release notes
Open source →New Features
- The
graphql_typeattribute on fields of variable structs can now specify generic types instead of just single named types.
Bug Fixes
- Fix using
&stron input fields of typeString(#1160) - Hide the
assert_type_eq_allandassert_implmacros from the docs - these were never public API and should always have been hidden (#1159)
- The
-
3.11.013 May 2025Release notes
Open source →New Features
- Optional fields on a
QueryFragmentcan now be marked with
#[cynic(default)]. If this directive is present the field does not have to
be wrapped inOptionand theDefaultimpl of the type will be used if the
field is null (#1144) - The generator now supports directives (#1139)
- Users can opt out of Deserialize for QueryFragment (#1147)
cynic-introspectionnow includes directives in its SDL (#1140)
Bug Fixes
Release notes
Open source →New Features
- Optional fields on a
QueryFragmentcan now be marked with#[cynic(default)]. If this directive is present the field does not have to be wrapped inOptionand theDefaultimpl of the type will be used if the field is null (#1144) - The generator now supports directives (#1139)
- Users can opt out of Deserialize for QueryFragment (#1147)
cynic-introspectionnow includes directives in its SDL (#1140)
Bug Fixes
- Fields can now have use types with generic parametesr (e.g.
DateTime<Utc>is now allowed) (#1131) - The generator now correctly applies lifetimes to recursive input fields when they are needed (#1151)
- Optional fields on a
-
3.10.010 Feb 2025Release notes
Open source →New Features
- Added initial suppport for directives:
@skip,@includeare supported, and
other field level directives can be used provided they don't require
specific client support (#900)
Bug Fixes
- Parsing will no longer fail if keywords like
mutationare used as enum
values. (#1128)
Changes
Changes
- Bumped the MSRV to 1.80
Release notes
Open source →New Features
- Added initial suppport for directives:
@skip,@includeare supported, and other field level directives can be provided provided they don't require specific client support (#900)
Bug Fixes
- Parsing will no longer fail if keywords like
mutationare used as enum values. (#1128)
Changes
- Querygen now parses schemas and queries with
cynic_parser(#1124, #1125)
Changes
- Bumped the MSRV to 1.80
- Added initial suppport for directives:
-
3.9.103 Dec 2024Release notes
Open source →Bug Fixes
- Fields named
strare now supported (#1108)
Changes
- Fixed all rust 1.83 clippy lints (#1106)
Contributors
Thanks to the people who contributed to this release:
Release notes
Open source →Bug Fixes
- Fields named
strare now supported (#1108)
Changes
- Fixed all rust 1.83 clippy lints (#1106)
- Fields named
-
3.9.012 Nov 2024Release notes
Open source →Changes
- Bumped
cynic-parserdependency - Removed dependency on
counter(#1027)
Changes
- MSRV is now 1.76
Contributors
Thanks to the people who contributed to this release:
Release notes
Open source →Changes
- Bumped
cynic-parserdependency - Removed dependency on
counter(#1027)
Changes
- MSRV is now 1.76
- Bumped
-
3.8.029 Aug 2024Release notes
Open source →New Features
- Added
OperationBuilder::build_with_variables_inlinedwhich can be used to
build a query string with variables inlined (#1012) - Added
QueryVariableLiterals, a trait & derive macro that can be used to
enable dynamic fetching of variables (#1009)
Bug Fixes
- The generator now consistently renames arguments that share names with rust
keywords (#1005) - The generator will no longer panic when using a fragment with an interface
as its type condition (#994)
Bug Fixes
- Tidied up the output of object & list literals in the clients GraphQl output.
Release notes
Open source →New Features
- Added
OperationBuilder::build_with_variables_inlinedwhich can be used to build a query string with variables inlined (#1012) - Added
QueryVariableLiterals, a trait & derive macro that can be used to enable dynamic fetching of variables (#1009)
Bug Fixes
- The generator now consistently renames arguments that share names with rust keywords (#1005)
- The generator will no longer panic when using a fragment with an interface as its type condition (#994)
Bug Fixes
- Tidied up the output of object & list literals in the clients GraphQl output.
- Added
-
3.7.304 Jun 2024Release notes
Open source →Changes
- update Cargo.toml dependencies
- update rust crate trycmd to 0.15 (#971)
Release notes
Open source →Changes
- update Cargo.toml dependencies
- update rust crate trycmd to 0.15 (#971)
-
3.7.222 May 2024Release notes
Open source →Changes
- Pulled in the latest cynic-parser, this should have no user facing impact.
Release notes
Open source →Changes
- Pulled in the latest cynic-parser, this should have no user facing impact.
-
3.7.114 May 2024Release notes
Open source →Bug Fixes
- Schema file should no longer cause clippy warnings if
clippy::nurseryis on.
(#951)
Release notes
Open source →Bug Fixes
- Schema file should no longer cause clippy warnings if
clippy::nurseryis on. (#951)
- Schema file should no longer cause clippy warnings if
-
3.7.028 Apr 2024Release notes
Open source →New Features
- Users of the
reqwestintegration can now control the type used for error
extensions (#928)
Changes
- MSRV is now officially 1.72 (although it was unofficially 1.72 before)
Release notes
Open source →New Features
- Users of the
reqwestintegration can now control the type used for error extensions (#928)
Changes
- MSRV is now officially 1.72 (although it was unofficially 1.72 before)
- Users of the
-
3.6.115 Apr 2024Release notes
Open source →Fixes
- Fixed a regresion in 3.6.0: schemas with directives on the
schema
definition will now parse
Release notes
Open source →Bug Fixes
- Fixed a regresion in 3.6.0: schemas with directives on the
schemadefinition will now parse
- Fixed a regresion in 3.6.0: schemas with directives on the
-
3.6.012 Apr 2024Release notes
Open source →Fixed
- Fixed an issue where
derive(Scalar)would fail on types with aserialize
function that was notserde::Serialize::serialize(#909)
Changed
Release notes
Open source →Bug Fixes
- Fixed an issue where
derive(Scalar)would fail on types with aserializefunction that was notserde::Serialize::serialize(#909)
Changes
- Fixed an issue where
-
3.5.104 Apr 2024 -
3.5.025 Mar 2024Release notes
Open source →Changes
- Updates reqwest to 0.12 - this is breaking for users of the
http-reqwestor
http-reqwest-blockingfeatures who will need to upgrade to reqwest 0.12. - Fixed some unused code warnings
Release notes
Open source →Changes
- Updates reqwest to 0.12 - this is breaking for users of the
http-reqwestorhttp-reqwest-blockingfeatures who will need to upgrade to reqwest 0.12. - Fixed some unused code warnings
- Updates reqwest to 0.12 - this is breaking for users of the
-
3.4.322 Jan 2024Release notes
Open source →Bug Fixes
- Handle disabled introspection better in
cynic-introspection&cynic-cli.
This is technically a breaking change, but it's small and fixes a bug so I'll
allow it.
Release notes
Open source →Bug Fixes
- Handle disabled introspection better in
cynic-introspection&cynic-cli. This is technically a breaking change, but it's small and fixes a bug so I'll allow it.
- Handle disabled introspection better in
-
3.4.222 Jan 2024Release notes
Open source →Changes
- If you accidentally write a recursive query without the
recurseattribute
you'll now get a panic suggesting to userecurse. This may cause false
positives if you're writing a particularly large query - users should raise
an issue if I've picked a number that's too low.
Bug Fixes
- The
recurseattribute now works if anInlineFragmentsderive is used in
the recursive path.
Release notes
Open source →Changes
- If you accidentally write a recursive query without the
recurseattribute you'll now get a panic suggesting to userecurse. This may cause false positives if you're writing a particularly large query - users should raise an issue if I've picked a number that's too low.
Bug Fixes
- The
recurseattribute now works if anInlineFragmentsderive is used in the recursive path.
- If you accidentally write a recursive query without the
-
3.4.122 Jan 2024 -
3.4.009 Jan 2024Release notes
Open source →New Features
Enums can now opt out of exhaustiveness checking with thenon_exhaustive
attribute
Release notes
Open source →New Features
Enums can now opt out of exhaustiveness checking with thenon_exhaustiveattribute
-
3.3.309 Jan 2024Release notes
Open source →Bug Fixes
cynic-introspectionnow omits the{}if a definition is empty.
Release notes
Open source →Bug Fixes
cynic-introspectionnow omits the{}if a definition is empty.
-
3.3.208 Jan 2024 -
3.3.105 Jan 2024Release notes
Open source →Bug Fixes
- Fixed an issue where
#[cynic(flatten)]would not work on scalar fields.
Release notes
Open source →Bug Fixes
- Fixed an issue where
#[cynic(flatten)]would not work on scalar fields.
- Fixed an issue where
-
3.3.014 Nov 2023Release notes
Open source →New Features
- The
QueryVariablesderive now supportsskip_serializing_if cynic-clihas a newquerygencommand as an alternative to the
web-based generator (Note: this is experimental and may be subject
to change)
Changes
- Operations generated by cynic will now omit un-used variables
- The
#[cynic(spread)]attribute now outputs an inline fragment in GraphQL
Fixes
- Using
#[cynic(spread)]more than once no longer results in rust compile
errors. - The generator won't output an incorrect comma in between attributes in
certain circumstances. - The generator now uses the same re-casing as codegen - leading to less bugs.
- The generator will now rename more QueryFragment fields that require it.
cynic-introspectionnow escapes deprecated strings that require it in SDL.
Release notes
Open source →New Features
- The
QueryVariablesderive now supportsskip_serializing_if cynic-clihas a newquerygencommand as an alternative to the web-based generator (Note: this is experimental and may be subject to change)
Changes
- Operations generated by cynic will now omit un-used variables
- The
#[cynic(spread)]attribute now outputs an inline fragment in GraphQL
Fixes
- Using
#[cynic(spread)]more than once no longer results in rust compile errors. - The generator won't output an incorrect comma in between attributes in certain circumstances.
- The generator now uses the same re-casing as codegen - leading to less bugs.
- The generator will now rename more QueryFragment fields that require it.
cynic-introspectionnow escapes deprecated strings that require it in SDL.
- The
-
3.2.226 Jun 2023Release notes
Open source →Bug Fixes
- Various SDL output fixes in
cynic-introspection:- It no longer prints
?where it means! - It omits the schema definition if all the root operation types are using
default names - Enum values no longer have empty lines between them
- We no longer erronously print the
Booleanscalar - Fields now have a hacky heuristic that decides when to wrap them
- Unions also have a wrapping heuristic
- Deprecation reasons will now correclty be wrapped in strings
- It no longer prints
Release notes
Open source →Bug Fixes
- Various SDL output fixes in
cynic-introspection:- It no longer prints
?where it means! - It omits the schema definition if all the root operation types are using default names
- Enum values no longer have empty lines between them
- We no longer erronously print the
Booleanscalar - Fields now have a hacky heuristic that decides when to wrap them
- Unions also have a wrapping heuristic
- Deprecation reasons will now correclty be wrapped in strings
- It no longer prints
- Various SDL output fixes in
-
3.2.126 Jun 2023 -
3.2.025 Jun 2023Release notes
Open source →New Features
- Added support for introspecting the
specifiedByUrlfield of scalars on
servers supporting GraphQL 2021 cynic-introspectioncan now output SDL- Added
CapabilitiesQuerytocynic-introspection, which can detect
which version of the GraphQL specification a server supports. QueryFragmentnow allows users to specify features for parts of the query,
allowing the same query to be used on servers with differing capabilities.- Added
cynic-cli, a CLI for cynic that can introspect remote servers.
Release notes
Open source →New Features
- Added support for introspecting the
specifiedByUrlfield of scalars on servers supporting GraphQL 2021 cynic-introspectioncan now output SDL- Added
CapabilitiesQuerytocynic-introspection, which can detect which version of the GraphQL specification a server supports. QueryFragmentnow allows users to specify features for parts of the query, allowing the same query to be used on servers with differing capabilities.- Added
cynic-cli, a CLI for cynic that can introspect remote servers.
- Added support for introspecting the
-
3.1.122 Jun 2023Release notes
Open source →Bug Fixes
- Fixed an issue where
InlineFragmentsfallbacks would fail to decode if the
data contained anything other than just the__typename. - Inline fragment variants containing smart pointers should now decode
correctly.
Release notes
Open source →Bug Fixes
- Fixed an issue where
InlineFragmentsfallbacks would fail to decode if the data contained anything other than just the__typename. - Inline fragment variants containing smart pointers should now decode correctly.
- Fixed an issue where
-
3.1.011 Jun 2023Release notes
Open source →New Features
- Added an
exhaustiveattribute forInlineFragmentson union types. If
present this attribute will cause compile errors if the enum is missing a
variant for any union member.
Bug Fixes
- The generator no longer outputs a broken
#[cynic::schema]module. impl_scalar!andderive(Scalar)can now be used on built in scalars.- GitHub schema registration is now slightly faster
- Fixed a bug where suggestions in errors were non-deterministic.
- Fixed the names of some features in docs.rs output.
- Added MSRV to
Cargo.toml
Release notes
Open source →New Features
- Added an
exhaustiveattribute forInlineFragmentson union types. If present this attribute will cause compile errors if the enum is missing a variant for any union member.
Bug Fixes
- The generator no longer outputs a broken
#[cynic::schema]module. impl_scalar!andderive(Scalar)can now be used on built in scalars.- GitHub schema registration is now slightly faster
- Fixed a bug where suggestions in errors were non-deterministic.
- Fixed the names of some features in docs.rs output.
- Added MSRV to
Cargo.toml
- Added an
-
3.0.207 Jun 2023Release notes
Open source →Bug Fixes
- Fix
Variabledefinition forVec<T>in#[cynic::schema]output.
Release notes
Open source →Bug Fixes
- Fix
Variabledefinition forVec<T>in#[cynic::schema]output.
- Fix
-
3.0.106 Jun 2023Release notes
Open source →Bug Fixes
- Fixed some more corner cases in string literal escaping
- Schema registration no longer parses schemas twice when rkyv is enabled.
- Fixed input type validation to better support skipping
Optionwrapping
Release notes
Open source →Bug Fixes
- Fixed some more corner cases in string literal escaping
- Schema registration no longer parses schemas twice when rkyv is enabled.
- Fixed input type validation to better support skipping
Optionwrapping
-
3.0.004 Jun 2023Release notes
Open source →See the upgrade guide in the book for help upgrading.
New Features
Breaking Changes
QueryBuilder,MutationBuidler&SubscriptionBuilderno longer have lifetimes.QueryFragmentno longer has a lifetime.QueryVariables::Fieldsmust now implement theQueryVariablesFieldstrait.- The workings of
derive(QueryVariables)has been changed quite
significantly, but shouldn't affect anyone who is using the macro. - The various cynic derives now expect the crate to be in scope under the name
cynic. This hopefully shouldn't affect most users but may do so if you
were doing something unusual.
New Features
- Added
cynic-introspectionfor running an introspection query against a
remote server. - Added
cynic-introspection::Schemawhich converts the introspection output
into a friendlier format for working with. - The derive macros now support structs that are generic on lifetimes and types.
- The derive macros now fields that are references.
- The derive macros now support fields that are references.
- Added
cynic_codegen::register_schema, a mechanism for pre-registering schemas
with cynic. - Added a
schemaattribute macro to declare the schema module for
pre-registered schemas. - Added the
rkyvfeature flag which optimises the pre-registered schemas with
therkyvlibrary. This makes cynic much more efficient when working with
large schemas. - The
Enumderive now supports fallback variants - Added
Operation::newto allowOperationto be used in tests.
Changes
- Cynic now uses operationName when one is provided by the top-level QueryFragment
- QueryFragments now provide the name of the struct to use as operationName
Bug Fixes
- Fixed an issue deserializing recursive fields that hit their recurse depth.
- Response deserialization will no longer work on random blobs of JSON that
aren't in GraphQLResponse format.
Deprecations
cynic_codegen::output_schema_moduleis now deprecated in favour ofregister_schema.
Removed
- Removed the deprecated
FragmentArgumentsderive. - Removed the deprecated
arugment_structattribute.
Release notes
Open source →See the upgrade guide in the book for help upgrading.
Breaking Changes
QueryBuilder,MutationBuidler&SubscriptionBuilderno longer have lifetimes.QueryFragmentno longer has a lifetime.QueryVariables::Fieldsmust now implement theQueryVariablesFieldstrait.- The workings of
derive(QueryVariables)has been changed quite significantly, but shouldn't affect anyone who is using the macro. - The various cynic derives now expect the crate to be in scope under the name
cynic. This hopefully shouldn't affect most users but may do so if you were doing something unusual.
New Features
- Added
cynic-introspectionfor running an introspection query against a remote server. - Added
cynic-introspection::Schemawhich converts the introspection output into a friendlier format for working with. - The derive macros now support structs that are generic on lifetimes and types.
- The derive macros now fields that are references.
- The derive macros now support fields that are references.
- Added
cynic_codegen::register_schema, a mechanism for pre-registering schemas with cynic. - Added a
schemaattribute macro to declare the schema module for pre-registered schemas. - Added the
rkyvfeature flag which optimises the pre-registered schemas with therkyvlibrary. This makes cynic much more efficient when working with large schemas. - The
Enumderive now supports fallback variants - Added
Operation::newto allowOperationto be used in tests.
Changes
- Cynic now uses operationName when one is provided by the top-level QueryFragment
- QueryFragments now provide the name of the struct to use as operationName
Bug Fixes
- Fixed an issue deserializing recursive fields that hit their recurse depth.
- Response deserialization will no longer work on random blobs of JSON that aren't in GraphQLResponse format.
Deprecations
cynic_codegen::output_schema_moduleis now deprecated in favour ofregister_schema.
Removed
- Removed the deprecated
FragmentArgumentsderive. - Removed the deprecated
arugment_structattribute.
-
3.0.0-beta.404 Jun 2023 pre-releaseRelease notes
Open source →New Features
- The
Enumderive now supports fallback variants - Added
Operation::newto allowOperationto be used in tests.
Removed
- Removed the deprecated
FragmentArgumentsderive. - Removed the deprecated
arugment_structattribute.
- The
-
3.0.0-beta.313 May 2023 pre-release -
3.0.0-beta.213 May 2023 pre-releaseRelease notes
Open source →Bug Fixes
- Schema file should no longer cause clippy warnings if
clippy::pedanticis on.
- Schema file should no longer cause clippy warnings if
-
3.0.0-beta.113 May 2023 pre-releaseRelease notes
Open source →Breaking Changes
QueryBuilder,MutationBuidler&SubscriptionBuilderno longer have lifetimes.QueryFragmentno longer has a lifetime.QueryVariables::Fieldsmust now implement theQueryVariablesFieldstrait.- The workings of
derive(QueryVariables)has been changed quite
significantly, but shouldn't affect anyone who is using the macro. - The various cynic derives now expect the crate to be in scope under the name
cynic. This hopefully shouldn't affect most users but may do so if you
were doing something unusual.
New Features
- Added
cynic-introspectionfor running an introspection query against a
remote server. - Added
cynic-introspection::Schemawhich converts the introspection output
into a friendlier format for working with. - The derive macros now support structs that are generic on lifetimes and types.
- The derive macros now support fields that are references.
- Added
cynic_codegen::register_schema, a mechanism for pre-registering schemas
with cynic. - Added a
schemaattribute macro to declare the schema module for
pre-registered schemas. - Added the
rkyvfeature flag which optimises the pre-registered schemas with
therkyvlibrary. This makes cynic much more efficient when working with
large schemas.
Changes
- Cynic now uses operationName when one is provided by the top-level QueryFragment
- QueryFragments now provide the name of the struct to use as operationName
Bug Fixes
- Fixed an issue deserializing recursive fields that hit their recurse depth.
- Response deserialization will no longer work on random blobs of JSON that
aren't in GraphQLResponse format.
Deprecations
cynic_codegen::output_schema_moduleis now deprecated in favour ofregister_schema.
-
2.2.803 Mar 2023Release notes
Open source →Bug Fixes
GraphQlErrorLocation&GraphQlErrorPathSegmentare no longer accidentally private.
Release notes
Open source →Bug Fixes
GraphQlErrorLocation&GraphQlErrorPathSegmentare no longer accidentally private.
-
2.2.727 Feb 2023Release notes
Open source →Bug Fixes
- You no longer have to specify the
Extensionsparameter onGraphQLErrorif
you don't have any extensions.
Release notes
Open source →Bug Fixes
- You no longer have to specify the
Extensionsparameter onGraphQLErrorif you don't have any extensions.
- You no longer have to specify the
-
2.2.617 Feb 2023Release notes
Open source →Bug Fixes
- A QueryFragment used inside an InlineFragment can now have a
__typename
field.
Release notes
Open source →Bug Fixes
- A QueryFragment used inside an InlineFragment can now have a
__typenamefield.
- A QueryFragment used inside an InlineFragment can now have a
-
2.2.516 Feb 2023Release notes
Open source →Bug Fixes
- The macro generated code now compiles under
-D rust-2018-idioms
Release notes
Open source →Bug Fixes
- The macro generated code now compiles under
-D rust-2018-idioms
- The macro generated code now compiles under
-
2.2.418 Jan 2023Release notes
Open source →Bug Fixes
- Fix an issue where you'd get extremely weird compiler errors if your
QueryFragmenthad fields namedkeyormap.
Release notes
Open source →Bug Fixes
- Fix an issue where you'd get extremely weird compiler errors if your
QueryFragmenthad fields namedkeyormap.
- Fix an issue where you'd get extremely weird compiler errors if your
-
2.2.303 Jan 2023Release notes
Open source →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.
Release notes
Open source →Bug Fixes
- The generator and derive macros are now aware of the implicit
__typenamethat 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.
- The generator and derive macros are now aware of the implicit
-
2.2.228 Dec 2022Release notes
Open source →Bug Fixes
- Fixed a compilation error when targeting wasm with the
http-reqwestfeature
enabled.
Release notes
Open source →Bug Fixes
- Fixed a compilation error when targeting wasm with the
http-reqwestfeature enabled.
- Fixed a compilation error when targeting wasm with the
-
2.2.116 Nov 2022Release notes
Open source →Bug Fixes
- Exposed the
StreamingOperationtype which was accidentally not exported in
the move tov2.0.
Release notes
Open source →Bug Fixes
- Exposed the
StreamingOperationtype which was accidentally not exported in the move tov2.0.
- Exposed the
-
2.2.014 Nov 2022Release notes
Open source →Changes
- The
use_schemaoutput 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.
Release notes
Open source →Changes
- The
use_schemaoutput 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.
- The
-
2.1.009 Nov 2022Release notes
Open source →New Features
InlineFragmentsderives for union types now allow a fallback that receives
the__typename
Bug Fixes
schema_for_derivesno longer ignoresQueryVariablesstructs.- A slight improvement on the error spans if you refer to a missing variable
in some QueryFragment arguments.
Release notes
Open source →New Features
InlineFragmentsderives for union types now allow a fallback that receives the__typename
Bug Fixes
schema_for_derivesno longer ignoresQueryVariablesstructs.- A slight improvement on the error spans if you refer to a missing variable in some QueryFragment arguments.
-
2.0.108 Nov 2022Release notes
Open source →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.
Release notes
Open source →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.
- Some of the derives weren't recasing GraphQL types/fields correctly, leading
-
2.0.007 Nov 2022Release notes
Open source →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.Xsyntax. Instead
you should provide variables similar to how you would do in a GraphQL query:
#[arguments(someArg: $my_variable)], wheremy_variableis a field on your
QueryVariablesstruct. - Arguments should be provided with the casing of the GraphQL schema rather
thansnake_casingthem. - Cynic now derives
serde::Serializeandserde::Deserializewhere
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_responsefunction on the operation (unless you're using anhttp
extension trait, which will deal with this for you). Operationhas changed:- It no longer has a lifetime.
- It is now generic over the arguments type.
- The
httpextension traits have had their signatures changed to accomodate
the new signature ofOperation. Their use should still be the same. - An
Enumcan no longer be shared between schemas. If you were doing this,
you should define twoEnums and provide conversion functions beteween the
two of them. InlineFragmentsnow always require a fallback and no longer perform
exhaustiveness checking.QueryBuilder,MutationBuilderandSubscriptionBuilderno longer have a
ResponseDataassociated type.QueryBuilder::build,MutationBuilder::buildand
SubscriptionBuilder::buildnow take their argument by value not by
reference.- The
surf,reqwest&reqwest-blockingfeatures have been renamed to
http-surf,http-reqwest&http-reqwest-blockingrespectively. - The
http-reqwestfeature no longer uses thenative-tlsfeature. Users
should enable one of thetlsfeatures ofreqwestthemselves. - The
surf-h1-client,surf-curl-client,surf-wasm-client,
surf-middleware-logger&surf-encodingfeatures have been removed. If
users want to enable these features in surf they should do it in their own
Cargo.toml. cynicno longer re-exportsserde_json- The
GraphQlError&GraphQlResponsestructs no longer contain a
serde_json::Valuefor extensions. They now have generic parameters that you
should provide if you care about error extensions. - The output of the
use_schemamacro is no longer re-cased. - The deprecated
query_moduleattribute for the various derive/attribute
macros has been removed - if you're using it you should update to
schema_modulewhich behaves the same.
Deprecations
- The
FragmentArgumentstrait & derive has been renamed toQueryVariables - The
argument_structattribute forQueryFragmentandInlineFragmentshas
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})] cynicno longer usesinflectorto re-case things. Hopefully this won't
cause any regressions, but if it does please raise an issue.InlineFragmentsnow 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_schemaoutput 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
ArcorRc - The generator no longer outputs input types that are provided in argument
literals, as these are no longer used in the generated code.
Release notes
Open source →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.Xsyntax. Instead you should provide variables similar to how you would do in a GraphQL query:#[arguments(someArg: $my_variable)], wheremy_variableis a field on yourQueryVariablesstruct. - Arguments should be provided with the casing of the GraphQL schema rather
than
snake_casingthem. - Cynic now derives
serde::Serializeandserde::Deserializewhere 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_responsefunction on the operation (unless you're using anhttpextension trait, which will deal with this for you). Operationhas changed:- It no longer has a lifetime.
- It is now generic over the arguments type.
- The
httpextension traits have had their signatures changed to accommodate the new signature ofOperation. Their use should still be the same. - An
Enumcan no longer be shared between schemas. If you were doing this, you should define twoEnums and provide conversion functions between the two of them. InlineFragmentsnow always require a fallback and no longer perform exhaustiveness checking.QueryBuilder,MutationBuilderandSubscriptionBuilderno longer have aResponseDataassociated type.QueryBuilder::build,MutationBuilder::buildandSubscriptionBuilder::buildnow take their argument by value not by reference.- The
surf,reqwest&reqwest-blockingfeatures have been renamed tohttp-surf,http-reqwest&http-reqwest-blockingrespectively. - The
http-reqwestfeature no longer uses thenative-tlsfeature. Users should enable one of thetlsfeatures ofreqwestthemselves. - The
surf-h1-client,surf-curl-client,surf-wasm-client,surf-middleware-logger&surf-encodingfeatures have been removed. If users want to enable these features in surf they should do it in their ownCargo.toml. cynicno longer re-exportsserde_json- The
GraphQlError&GraphQlResponsestructs no longer contain aserde_json::Valuefor extensions. They now have generic parameters that you should provide if you care about error extensions. - The output of the
use_schemamacro is no longer re-cased. - The deprecated
query_moduleattribute for the various derive/attribute macros has been removed - if you're using it you should update toschema_modulewhich behaves the same.
Deprecations
- The
FragmentArgumentstrait & derive has been renamed toQueryVariables - The
argument_structattribute forQueryFragmentandInlineFragmentshas 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})] cynicno longer usesinflectorto re-case things. Hopefully this won't cause any regressions, but if it does please raise an issue.InlineFragmentsnow take their expected typenames from theQueryFragmentinside 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_schemaoutput can now live in a separate crate from queries, which should help with large schema support. (The exception isimpl_scalarinvocations which must live in the same crate as the schema)- Cynic now allows fields to be
ArcorRc - The generator no longer outputs input types that are provided in argument literals, as these are no longer used in the generated code.
- Cynic no longer supports providing variables via the
-
1.0.009 Dec 2021Release notes
Open source →Breaking Changes
- The
CynicReqwestErrorenum (behind thereqwest&reqwest-blocking
feature flags) has a new variant to handle non 2XX responses from servers. - Removed the
GraphQlResult&PossiblyParsedDatatypes (which weren't being
used) - Removed the following deprecated things:
query_dsl!, thequery_module
module attribute, theGraphQLError,GraphQLResponse,
GraphQLErrorLocation&GraphQlErrorPathSegmenttype aliases.
New Features
- The
InlineFragmentsderive now supports a rename attribute on variants
Changes
- The
QueryFragmentderive 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.
Release notes
Open source →Breaking Changes
- The
CynicReqwestErrorenum (behind thereqwest&reqwest-blockingfeature flags) has a new variant to handle non 2XX responses from servers. - Removed the
GraphQlResult&PossiblyParsedDatatypes (which weren't being used) - Removed the following deprecated things:
query_dsl!, thequery_modulemodule attribute, theGraphQLError,GraphQLResponse,GraphQLErrorLocation&GraphQlErrorPathSegmenttype aliases.
New Features
- The
InlineFragmentsderive now supports a rename attribute on variants
Changes
- The
QueryFragmentderive 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.
- The
-
0.15.120 Oct 2021Release notes
Open source →New Features
New generator features, so I'm putting them out in a point release:
- Querygen now supports inline fragments on union types & interfaces.
- Querygen now supports subscriptions
Bug Fixes
- Querygen no longer duplicates variable names in generated
ArgumentStructs
when an argument is used twice in a query. - Fixed support for
Floatscalars in the generator. - Fixed support for fields named
self,superetc. which can't be made into
raw identifiers.
Release notes
Open source →New Features
New generator features, so I'm putting them out in a point release:
- Querygen now supports inline fragments on union types & interfaces.
- Querygen now supports subscriptions
Bug Fixes
- Querygen no longer duplicates variable names in generated
ArgumentStructs when an argument is used twice in a query. - Fixed support for
Floatscalars in the generator. - Fixed support for fields named
self,superetc. which can't be made into raw identifiers.
-
0.15.023 Sep 2021Release notes
Open source →Breaking Changes
- Removed the no longer used
chronofeature. It didn't enable any code so
downstreams shouldn't really be broken by this (other than a possible
Cargo.tomltweak)
New Features
- Cynic now supports GraphQL field aliases. These can be requested, but will
also automatically be added to queries if any QueryFragment requests the same
field twice. - The generator also now supports field aliases.
Bug Fixes
- Fixed a case where the generator would not generate
InputObjectsthat it
should have been generating, if thoseInputObjectswere arguments to a leaf
field.
Changes
- Disabled the heavyweight feature of inflector, which should make it (and
therefore cynic) a lighter dependency.
Release notes
Open source →Breaking Changes
- Removed the no longer used
chronofeature. It didn't enable any code so downstreams shouldn't really be broken by this (other than a possibleCargo.tomltweak)
New Features
- Cynic now supports GraphQL field aliases. These can be requested, but will also automatically be added to queries if any QueryFragment requests the same field twice.
- The generator also now supports field aliases.
Bug Fixes
- Fixed a case where the generator would not generate
InputObjectsthat it should have been generating, if thoseInputObjectswere arguments to a leaf field.
Changes
- Disabled the heavyweight feature of inflector, which should make it (and therefore cynic) a lighter dependency.
- Removed the no longer used
-
0.14.129 Jul 2021 -
0.14.006 Jun 2021Release notes
Open source →New Features
- You can now
spreadaQueryFragmentinto anotherQueryFragmentwith the
#[cynic(spread)]field attribute. - The
QueryFragmentderive now supports renaming fields.
Bug Fixes
- Underscore field names are now supported in schemas and for querying.
- Field names with leading underscores will no longer have those leading
underscores removed.
Release notes
Open source →New Features
- You can now
spreadaQueryFragmentinto anotherQueryFragmentwith the#[cynic(spread)]field attribute. - The
QueryFragmentderive now supports renaming fields.
Bug Fixes
- Underscore field names are now supported in schemas and for querying.
- Field names with leading underscores will no longer have those leading underscores removed.
- You can now
-
0.13.126 Apr 2021Release notes
Open source →Bug Fixes
- Fixes an issue where cynic would incorrectly case module certain names in the
use_schemaoutput
Release notes
Open source →Bug Fixes
- Fixes an issue where cynic would incorrectly case module certain names in the
use_schemaoutput
- Fixes an issue where cynic would incorrectly case module certain names in the
-
0.13.004 Apr 2021Release notes
Open source →Breaking Changes
There are a number of breaking changes here, though they shouldn't require too
much work for users to update. An example of an upgrade can be found
here.- The
cynic::Scalarderive has some new requirements:- You should now derive (or otherwise implement)
serde::Serializefor your
Scalar types. - The derive now requires a
schema_moduleparameter. The
schema_for_derivesmacro will automatically insert this (if you're using
it) but you may need to adduse super::schema;to ensure it's
in-scope. - The derive now has an optional
graphql_typeparameter. This is required
if the name of your type and the name of the scalar in the schema differ.
- You should now derive (or otherwise implement)
- Scalars have been revamped:
- The scalar trait now has a typelock. This means that a Scalar impl is now
directly tied to the scalar definition in a givenquery_dsl. - As a result, cynic can no longer define generic Scalar impls for 3rd party
types (such aschrono,url,uuidetc.). Theimpl_scalarmacro has
been provided to allow users to use these types (or any type that is
serde::Serialize) in their queries. - Cynic no longer requires you to define Scalar types you are not using.
selectfunctions generated for scalar fields inquery_dslnow take
a selection_set that decodes the scalar type. This gives some flexibility
around scalar types.query_dslnow defines markers for all the scalar types. As such you
should not import any custom scalars into your query_dsl module.
- The scalar trait now has a typelock. This means that a Scalar impl is now
- Required scalar arguments no longer have concrete types, so anything
that relied on type inference (i.e.arg = "hello".into()) will no longer
work. You should either call an explicit function, or rely on aInputType
impl to do the conversion. - The
uuid,chrono,bson, andurlfeatures have been retired. If you
were using these you should register them asScalarwith theimpl_scalar!
macro. SerializableArgumenthas been retired in favour of just using
serde::Serialize.- The return type of
cynic::Enum::selectnow includes theTypeLockof the
enum. This should only affect users that were implementingcynic::Enum
directly. Users of the derive should be unaffected. IntoArgumenthas been removed in favour of the newInputTypetrait.cynic::SerializeErrorno longer exists.
New Features
- Support for building and decoding subscription queries.
- Alpha quality support for subscriptions over websockets with
graphql-ws-client.
Deprecated
GraphQLError,GraphQLResponse, &GraphQLResulthave all been deprecated
in favour ofGraphQlError,GraphQlResponse, &GraphQlResult. The types are
otherwise the same, just with different names.query_dsl!has been deprecated in favour of a similar macro nameduse_schema!- It's now recommended that you name your
query_dslmoduleschemainstead. cynic_codegen::output_query_dslis now namedcynic_codegen::output_schema_module.- The
query_moduleattribute macro has been deprecated in favour of
schema_for_derives - The
query_moduleparameter to the derives has been deprecated in favour of
schema_module.
Bug Fixes
- Cynic will now fail to compile you when you use an incorrect enum type for a
field in a QueryFragment. - Field type mismatch errors in QueryFragments are now reported on the span of
the field type. - You no longer need to define Scalars you are not using
- If a server adds a new scalar it will no longer break cynic clients.
- Fixed a case where InputObject errors were being shown against the
query_moduleattr of the module they were defined in.
Changes
- The
graphql_typeparameter for most of the derives is now optional. It
defaults to the name of the struct/enum if not present. - Cynic will no longer generate invalid QueryFragments if fields are not
selected on a composite. - Cynic will now error if a QueryFragment selects no fields.
Release notes
Open source →Breaking Changes
There are a number of breaking changes here, though they shouldn't require too much work for users to update. An example of an upgrade can be found here.
- The
cynic::Scalarderive has some new requirements:- You should now derive (or otherwise implement)
serde::Serializefor your Scalar types. - The derive now requires a
schema_moduleparameter. Theschema_for_derivesmacro will automatically insert this (if you're using it) but you may need to adduse super::schema;to ensure it's in-scope. - The derive now has an optional
graphql_typeparameter. This is required if the name of your type and the name of the scalar in the schema differ.
- You should now derive (or otherwise implement)
- Scalars have been revamped:
- The scalar trait now has a typelock. This means that a Scalar impl is now
directly tied to the scalar definition in a given
query_dsl. - As a result, cynic can no longer define generic Scalar impls for 3rd party
types (such as
chrono,url,uuidetc.). Theimpl_scalarmacro has been provided to allow users to use these types (or any type that isserde::Serialize) in their queries. - Cynic no longer requires you to define Scalar types you are not using.
selectfunctions generated for scalar fields inquery_dslnow take a selection_set that decodes the scalar type. This gives some flexibility around scalar types.query_dslnow defines markers for all the scalar types. As such you should not import any custom scalars into your query_dsl module.
- The scalar trait now has a typelock. This means that a Scalar impl is now
directly tied to the scalar definition in a given
- Required scalar arguments no longer have concrete types, so anything
that relied on type inference (i.e.
arg = "hello".into()) will no longer work. You should either call an explicit function, or rely on aInputTypeimpl to do the conversion. - The
uuid,chrono,bson, andurlfeatures have been retired. If you were using these you should register them asScalarwith theimpl_scalar!macro. SerializableArgumenthas been retired in favour of just usingserde::Serialize.- The return type of
cynic::Enum::selectnow includes theTypeLockof the enum. This should only affect users that were implementingcynic::Enumdirectly. Users of the derive should be unaffected. IntoArgumenthas been removed in favour of the newInputTypetrait.cynic::SerializeErrorno longer exists.
New Features
- Support for building and decoding subscription queries.
- Alpha quality support for subscriptions over websockets with
graphql-ws-client.
Deprecated
GraphQLError,GraphQLResponse, &GraphQLResulthave all been deprecated in favour ofGraphQlError,GraphQlResponse, &GraphQlResult. The types are otherwise the same, just with different names.query_dsl!has been deprecated in favour of a similar macro nameduse_schema!- It's now recommended that you name your
query_dslmoduleschemainstead. cynic_codegen::output_query_dslis now namedcynic_codegen::output_schema_module.- The
query_moduleattribute macro has been deprecated in favour ofschema_for_derives - The
query_moduleparameter to the derives has been deprecated in favour ofschema_module.
Bug Fixes
- Cynic will now fail to compile you when you use an incorrect enum type for a field in a QueryFragment.
- Field type mismatch errors in QueryFragments are now reported on the span of the field type.
- You no longer need to define Scalars you are not using
- If a server adds a new scalar it will no longer break cynic clients.
- Fixed a case where InputObject errors were being shown against the
query_moduleattr of the module they were defined in.
Changes
- The
graphql_typeparameter for most of the derives is now optional. It defaults to the name of the struct/enum if not present. - Cynic will no longer generate invalid QueryFragments if fields are not selected on a composite.
- Cynic will now error if a QueryFragment selects no fields.
- The
-
0.12.301 Apr 2021Release notes
Open source →Bug Fixes
- The
cynic::Scalarderive output no longer contains a spurious?that
clippy warns about in Rust 1.51.
- The
-
0.12.222 Feb 2021 -
0.12.112 Feb 2021Release notes
Open source →Bug Fixes
chrono::NaiveTimenow supports times without seconds (e.g.10:30)- Failures to parse chrono types now provide error messages that mention
chrono: these were fairly hard to diagnose before.
Release notes
Open source →Bug Fixes
chrono::NaiveTimenow supports times without seconds (e.g.10:30)- Failures to parse chrono types now provide error messages that mention chrono: these were fairly hard to diagnose before.
- The generator no longer prints out an empty types module when there are no custom scalars.