Commit Graph

1058 Commits

Author SHA1 Message Date
Sunli
87ba51fdd0 Some improvements. 2020-10-10 16:28:07 +08:00
Sunli
7fe59d9f90 Merge pull request #304 from AurelienFT/eq_error
Derive Error with Eq
2020-10-09 09:35:20 +08:00
Aurelien Foucault
17a85c451a Add eq for errors 2020-10-08 15:32:37 +02:00
Aurelien Foucault
f6e05d47a1 Merge master 2020-10-08 15:28:07 +02:00
Sunli
e170d3b735 Update docs. 2020-10-07 13:40:03 +08:00
AurelienFT
53eab09f19 Rework guard (#296)
Rework guard #293
2020-10-06 17:16:51 +08:00
Aurelien Foucault
b00f70a09e Add docs 2020-10-06 10:49:36 +02:00
Aurelien Foucault
42dc36f9f4 Fmt, clippy and remove post guard 2020-10-06 00:17:29 +02:00
Aurelien Foucault
ec5a466bcb Add chain and race operator 2020-10-06 00:10:15 +02:00
Sunli
5f2b7580f4 Update CI 2020-10-05 07:05:32 +08:00
Sunli
0d17dc7629 Merge pull request #298 from rkudryashov/fix_doc
Fix custom scalars doc
2020-10-04 20:12:40 +08:00
Roman Kudryashov
71fa94392a Fix custom scalars doc 2020-10-04 12:21:53 +03:00
Sunli
22f7e09537 Fix typo. #297 2020-10-04 07:49:56 +08:00
Aurelien Foucault
92716a2186 Clippy 2020-10-03 23:52:23 +02:00
Aurelien Foucault
549aa7cc72 Fmt 2020-10-03 23:03:40 +02:00
Aurelien Foucault
5b03bce2e8 Add or operator 2020-10-03 23:00:34 +02:00
Aurelien Foucault
beb4b2238a Implement the new and operator 2020-10-03 21:34:29 +02:00
Aurelien Foucault
216b363ce7 Support guard simple rule with the rework (recursivity) 2020-10-03 15:16:18 +02:00
Sunli
3581008e71 Merge pull request #294 from qwtsc/test_dev
Add actix-web test
2020-10-02 22:28:38 +08:00
qwtsc
9d87df3aed Add actix-web test 2020-10-02 21:17:47 +08:00
Sunli
323dbf8a87 Update docs 2020-10-02 15:34:20 +08:00
Sunli
150de7bfdd 2.0.0-alpha.23 2020-10-02 15:00:59 +08:00
Sunli
be2b39e486 Restore the original error extension implementation. 2020-10-02 14:56:10 +08:00
sunli
cb2139afcd Remove useless code. 2020-10-01 18:48:11 +08:00
Sunli
9d0b0fcf00 2.0.0-alpha.22 2020-10-01 11:26:58 +08:00
Sunli
ad08f1dce7 Update docs 2020-10-01 11:24:30 +08:00
Sunli
dd537af508 Merge branch 'master' of https://github.com/async-graphql/async-graphql 2020-10-01 11:23:33 +08:00
Sunli
87d39318b5 Update docs. 2020-10-01 11:23:24 +08:00
Sunli
900392949e Merge pull request #291 from async-graphql/rework-errors
Rework errors
2020-10-01 11:18:23 +08:00
Sunli
883063d9e7 Merge pull request #292 from chipsenkbeil/master
Add flatten union documentation
2020-10-01 11:12:41 +08:00
Chip Senkbeil
0a5a8f243d Add flatten union documentation 2020-09-30 21:44:47 -05:00
Sunli
20d5dd9095 Inline ContainerType, EnumType, ScalarType to docs. 2020-10-01 10:05:16 +08:00
Sunli
03deffe607 Merge master 2020-10-01 09:40:04 +08:00
Sunli
6afac75ccf Merge branch 'master' into rework-errors 2020-10-01 09:39:47 +08:00
Sunli
97f0b0d419 Merge branch 'master' into rework-errors 2020-10-01 09:07:19 +08:00
Koxiaet
4b20a21783 Fix compilation and tests 2020-09-30 19:40:17 +01:00
Koxiaet
768b666acd Merge master 2020-09-30 18:24:24 +01:00
Sunli
97dae8cf82 Only delete the graphql attribute on the field parameter. 2020-09-30 16:18:49 +08:00
Sunli
7bccbd1277 Update docs. 2020-09-30 11:55:56 +08:00
Sunli
a95a532857 Added Apollo persisted queries extension. #280 2020-09-30 11:37:12 +08:00
Sunli
7ca82d9a9f Update Cargo.toml 2020-09-30 08:00:48 +08:00
Sunli
35f886a7f8 Improve trait for GraphQL types. 2020-09-30 07:45:48 +08:00
Koxiaet
50009b66ce Rework errors
This completely overhauls the error system used in async-graphql.
- `Error` has been renamed to `ServerError` and `FieldError` has been
renamed to just `Error`. This is because `FieldError` is by far the most
common error that users will have to use so it makes sense to use the
most obvious error name. Also, the current name didn't make sense as it
was used for things other than field errors, such as the data callback
for websockets.
- `ServerError` has been made completely opaque. Before it was an enum
of all the possible errors, but now it just contains an error message,
the locations, the path and extensions. It is a shame that we lose
information, it makes more sense as _conceptually_ GraphQL does not
provide that information. It also frees us to change the internals of
async-graphql a lot more.
- The path of errors is no longer an opaque JSON value but a regular
type, `Vec<PathSegment>`. The type duplication of `PathSegment` and
`QueryPathSegment` is unfortunate, I plan to work on this in the future.
- Now that `ServerError` is opaque, `RuleError` has been removed from
the public API, making it simpler.
- Additionally `QueryError` has been completely removed. Instead the
error messages are constructed ad-hoc; I took care to never repeat an
error message.
- Instead of constructing field-not-found errors inside the
implementations of field resolvers they now return `Option`s, where a
`None` value is representative of the field not being found.
- As an unfortunate consequence of the last change, self-referential
types based on the output of a subscription resolver can no longer be
created. This does not mean anything for users, but causes lifetime
issues in the implementation of merged objects. I fixed it with a bit of
a hack, but this'll have to be looked into further.
- `InputValueError` now has a generic parameter - it's kind of weird but
it's necessary for ergonomics. It also improves error messages.
- The `ErrorExtensions` trait has been removed. I didn't think the
`extend` method was necessary since `From` impls exist. But the
ergonomics are still there with a new trait `ExtendError`, which
is implemented for both errors and results.
- `Response` now supports serializing multiple errors. This allows for
nice things like having multiple validation errors not be awkwardly
shoved into a single error.
- When an error occurs in execution, data is sent as `null`. This is
slightly more compliant with the spec but the algorithm described in
<https://spec.graphql.org/June2018/#sec-Errors-and-Non-Nullability> has
yet to be implemented.
2020-09-29 20:06:44 +01:00
Sunli
4e7bb1a59c Added context for Extension. 2020-09-29 20:47:37 +08:00
Sunli
c3d24f5a8f Keep pin-project-lite dependent on async-graphql-tide at v0.1.8. 2020-09-29 17:04:27 +08:00
Sunli
9c5f53e79a 2.0.0-alpha.21 2020-09-29 16:40:35 +08:00
Sunli
e60864a18d Rework async-graphql-derive. #288 2020-09-29 16:06:10 +08:00
Sunli
97ffe25f9f Update book. 2020-09-28 14:43:12 +08:00
Sunli
37a803c3d9 2.0.0-alpha.20 2020-09-28 11:33:58 +08:00
Sunli
ded45bcf6b Update docs 2020-09-28 11:15:37 +08:00