Commit graph

222 commits

Author SHA1 Message Date
Christoph Herzog
40c946c81c 0.9.2 release
* Changelogs
* Update versions and dependency versions
2018-01-13 10:34:30 +01:00
theduke
ca9d5c1c1a Bump to 0.9.1 and fix up Cargo.toml files 2017-12-03 18:48:38 +01:00
theduke
643875838d (codegen) improve derive for InputObject
* Implement hack to allow usage in juniper crate
* implement (default) attribute for Default::default()
* Improve tests
2017-12-02 15:43:41 +01:00
theduke
6ff3f1fba4 (codegen) Improve enum field name generation
Introduce a to_upper_snake_case() helper to properly convert enum names
to GraphQL compatible names.

Previously, "SomeEnum" would be converted to "SOMEENUM" and not
"SOME_ENUM".
2017-12-02 15:43:41 +01:00
theduke
f858f416b8 Remove graphql_enum! macro in favor of custom derive
* Extend derive for enums to allow deriving inside the juniper crate
  itself. Note: this is a rather ugly hack right now, FIXME is in the
  code
* Remove the graphql_enum! macro and replace all internal use with
  derive
* Refactor introspection tests to use derive
2017-12-02 15:43:22 +01:00
theduke
7b066ef1f9 (docs) Add short crate docs to codegen. 2017-12-02 02:35:08 +01:00
theduke
3750349e71 Bump version to 0.9.0 2017-12-02 02:31:56 +01:00
theduke
141292ad91 Export codegen from main juniper crate
Use a trick for re-exporting proc-macros to supply juniper_derive as a
dependency of juniper.

Users will now just have to depend on juniper directly.
2017-12-02 02:27:41 +01:00
theduke
0372de84d5 Rename ToInputValue::to to to_input_value() 2017-08-29 05:34:35 +02:00
theduke
164aa29fdc Rename FromInputValue::from() to from_input_value() 2017-08-29 05:34:35 +02:00
Sam Rijs
a0f2c3bbdd Implement support for dynamic schemas 2017-08-07 22:15:09 +02:00
theduke
a826b22ffb Update Readme and Cargo files for new repo url 2017-08-07 08:20:05 +02:00
theduke
0c7e39f14e Rust fmt the whole codebase 2017-08-06 21:15:08 +02:00
theduke
81ce7780fa Codegen: implement description for custom derives + improve tests
Description attribute was available, but not actually used for derive
Object, InputObject and enum and the fields on input object.

Description is now properly set in each of those cases.

Also, tests for all three derives now properly verify the meta
information (name and description) for the derived GraphQLType.
2017-08-06 19:30:26 +02:00
theduke
6c45fba9bd Fix some warnings in codegen + tests. 2017-08-06 19:30:26 +02:00
theduke
6c7dc0493d Rename custom derive modules for consistency.
codegen/enums -> codegen/derive_enum
codegen/input_objects -> codegen/derive_input_object
tests/enums -> tests/derive_enum
tests/input_objects -> tests/derive_input_object
2017-08-06 19:30:26 +02:00
theduke
e835a5e019 Codegen: Add custom derive for GraphQLObject
This adds a simple derive for objects that implements GraphQLType for
structs which do not require any manual resolvers.

This could be extended in the future to provide a custom resolver
function via an attribute.

Also adds an integration test.
2017-08-06 19:30:26 +02:00
theduke
c27d2c7a23 Make variant name for derived enums upper case by default 2017-07-12 21:51:24 +02:00
theduke
1312c6a026 Implement derive for input objects 2017-07-12 21:51:24 +02:00
theduke
e42228e2d5 Duplicating to_camel_case in codegen 2017-07-12 21:51:24 +02:00
theduke
2bcfc315ad Use more descriptive variant variable names for enum deriving 2017-07-12 21:51:24 +02:00
theduke
d33db983de Add juniper_codegen crate.
This crate will contain multiple custom_derive implementations.

For now, only enum is supported.
2017-07-12 21:51:24 +02:00