Commit graph

60 commits

Author SHA1 Message Date
Michael Macias
e3500dff50 Add type alias for query variables 2017-01-15 13:37:30 -06:00
Magnus Hallin
80a2aceb85 Merge pull request #16 from zaeleus/graphiql-body
Fix graphQLFetcher body serialization
2017-01-15 11:49:37 +01:00
Michael Macias
fe96029e3a Fix graphQLFetcher body serialization
`params.variables` is already an object when passed to the fetcher and
does not need to be parsed.
2017-01-14 15:10:18 -06:00
Michael Macias
b78aef715d Make rustc-serialize optional
This extracts rustc-serialize JSON serialization into its own module,
decoupling all core structures from its use.

rustc-serialize can now be completely disabled, removing it as a
dependency if serde (or none) is used instead. It is, however, still the
default serializer. In Cargo, the `default-features` field must be set
to `false` to disable it, e.g.,

    [dependencies.juniper]
    version = "0.6"
    default-features = false
    features = ["serde"]

The Iron handlers still require rustc-serialize.

The default values for attributes changed from being formatted as JSON
to how it is defined in [the reference implementation][printer.js].

[printer.js]: https://github.com/graphql/graphql-js/blob/v0.8.2/src/language/printer.js
2017-01-06 21:34:44 -06:00
Magnus Hallin
1af950401c Add support for declaring input objects as public structs
Fixes #5.
2017-01-06 13:08:39 +01:00
Magnus Hallin
fce45ece3f Merge pull request #8 from zaeleus/serde
Add optional Serde serialization support
2017-01-06 12:48:12 +01:00
Magnus Hallin
0e65a20c77 Merge pull request #9 from zaeleus/to_camel_case
Rename erroneously named to_snake_case
2017-01-06 12:43:28 +01:00
Magnus Hallin
ccf6b8399a Merge pull request #10 from zaeleus/graphqlerror-to-json
Remove JSON wrapper object from GraphQLError::to_json
2017-01-06 12:43:19 +01:00
Michael Macias
4fce6062f0 Update to graphiql 0.8.1 2017-01-04 22:05:37 -06:00
Michael Macias
bd00e6c23d Remove JSON wrapper object from GraphQLError::to_json
This should be the responsibility of the caller and makes it consistent
with how the successful case is handled.
2017-01-04 21:40:15 -06:00
Michael Macias
b0c43341e4 Rename erroneously named to_snake_case
This function is transforming snake_case to camelCase.
2017-01-04 21:07:01 -06:00
Michael Macias
aa056dd562 Add optional Serde serialization support
This adds the Serde serialization trait to the following:

  * `ExecutionError`
  * `GraphQLError`
  * `InputValue` (+ deserialization)
  * `RuleError`
  * `SourcePosition`
  * `Spanning<ParseError>`
  * `Value`

Serde support is enabled via the "serde" feature flag.
2017-01-04 20:50:12 -06:00
Magnus Hallin
853c92a0b7 Use borrowed string references in all AST nodes 2016-12-28 19:09:19 +01:00
Magnus Hallin
f066fca1f4 Use borrowed names when constructing Type instances 2016-12-28 19:09:19 +01:00
Magnus Hallin
1f62b628f9 Don't clone directive lists during execution 2016-12-28 12:03:23 +01:00
Magnus Hallin
5ce330a0e8 Don't clone argument names when building final argument hashmap 2016-12-28 11:59:50 +01:00
Magnus Hallin
d7e98d955a Don't clone field names when recursing down in selection sets 2016-12-28 11:51:37 +01:00
Magnus Hallin
13903d7628 Don't clone selection sets during execution 2016-12-28 11:28:48 +01:00
Magnus Hallin
6a4b883b97 Don't clone fragment names in executor 2016-12-28 11:13:45 +01:00
Magnus Hallin
96c1ad0ef9 Use bencher crate to run benchmarks on stable rust 2016-12-26 12:16:19 +01:00
Magnus Hallin
ebda74ba91 Refactor IntoResolvable (previously IntoFieldResult)
It now supports a blanket implementation for all GraphQLTypes, and
resolving into new context types.
2016-12-23 13:12:12 +01:00
Magnus Hallin
6b8f4c9562 Move context type parameter to associated type of GraphQLType 2016-12-22 16:25:44 +01:00
Magnus Hallin
b61ca14f53 Pass the executor immutably through resolution
The executor is now using internal mutability through RwLock to make
it thread-safe.
2016-12-11 20:09:52 +01:00
Magnus Hallin
f3e0acc742 Add helper traits/macros to produce FieldResults 2016-12-05 22:18:42 +01:00
Magnus Hallin
3b71755521 Expose RuleError from crate root 2016-12-05 22:18:31 +01:00
Magnus Hallin
46764de1a6 Add support for return statements in field resolver functions 2016-11-30 21:49:50 +01:00
Magnus Hallin
ca3832c6c2 Ignore InnerT when implementing Send/Sync for RootNode (unsafe) 2016-11-30 20:57:18 +01:00
Magnus Hallin
e5167e1aae Relax Iron handler context trait requirements 2016-11-30 20:50:08 +01:00
Magnus Hallin
0ea61fa493 Add interface and union tests 2016-11-12 22:52:34 +01:00
Magnus Hallin
c555241978 Add executor tests, fix a bunch of bugs 2016-11-12 17:49:04 +01:00
Magnus Hallin
251f957a7f Add directive tests, fix some bugs 2016-11-12 11:03:42 +01:00
Magnus Hallin
478c7b7819 Add enum input value tests and improve validation 2016-11-12 10:24:23 +01:00
Magnus Hallin
b3a750ffa5 Add input variable tests, fix a bunch of related bugs 2016-11-09 21:48:21 +01:00
Magnus Hallin
ba7839f321 Use object shorthand in tests and documentation 2016-10-20 20:56:23 +02:00
Magnus Hallin
f4887badeb Add documentation for the union helper macro 2016-10-20 20:43:47 +02:00
Magnus Hallin
8a51c33cb1 Improve type safety for instance resolvers 2016-10-20 20:26:52 +02:00
Magnus Hallin
612a3af001 Update syntax of interface instance resolvers 2016-10-19 21:43:11 +02:00
Magnus Hallin
93deefb0ca Add union helper macro and tests 2016-10-19 20:58:36 +02:00
Magnus Hallin
59e5381a56 Add dependency note to crate doc 2016-10-16 22:21:44 +02:00
Magnus Hallin
8647d06e2e Fix interface macro syntax issues, add tests 2016-10-16 22:04:50 +02:00
Magnus Hallin
5caea1f908 Make FieldResults in field resolvers optional :D 2016-10-16 16:02:58 +02:00
Magnus Hallin
f3469dd270 Add object macro tests, fix minor issues 2016-10-16 14:15:03 +02:00
Magnus Hallin
1295e42c58 Add field deprecation support and tests 2016-10-16 12:34:29 +02:00
Magnus Hallin
6cc124d075 Add tests for the general args macro 2016-10-16 11:33:51 +02:00
Magnus Hallin
9f5294ad3e Add input object helper macro 2016-10-09 21:44:40 +02:00
Magnus Hallin
42e4070e4b Extend scalar macro, add more tests 2016-10-09 15:37:51 +02:00
Magnus Hallin
ca6c637aa4 Update graphql_enum! documentation 2016-10-09 14:53:49 +02:00
Magnus Hallin
ac01b8e406 Extend enum macro, improve test coverage
This adds description and deprecation support to the graphql_enum!
macro, as well as extensive tests for all syntactical cases.
2016-10-09 14:30:29 +02:00
Magnus Hallin
ac51f09873 Bugfix argument description handling 2016-09-22 21:50:19 +02:00
Magnus Hallin
14ea90b790 Add object introspection tests 2016-09-22 20:16:26 +02:00