Commit Graph

1154 Commits

Author SHA1 Message Date
Sunli
299a40bc4e Update docs. 2020-10-07 13:40:03 +08:00
AurelienFT
e7b4ad8f2f
Rework guard (#296)
Rework guard #293
2020-10-06 17:16:51 +08:00
Aurelien Foucault
c9da98246a Add docs 2020-10-06 10:49:36 +02:00
Aurelien Foucault
35a21d1994 Fmt, clippy and remove post guard 2020-10-06 00:17:29 +02:00
Aurelien Foucault
a935b867c7 Add chain and race operator 2020-10-06 00:10:15 +02:00
Sunli
8c17374bab Update CI 2020-10-05 07:05:32 +08:00
Sunli
0fe5faf724
Merge pull request #298 from rkudryashov/fix_doc
Fix custom scalars doc
2020-10-04 20:12:40 +08:00
Roman Kudryashov
a02050b7e2 Fix custom scalars doc 2020-10-04 12:21:53 +03:00
Sunli
e47360d1a2 Fix typo. #297 2020-10-04 07:49:56 +08:00
Aurelien Foucault
a252b76950 Clippy 2020-10-03 23:52:23 +02:00
Aurelien Foucault
85b4366911 Fmt 2020-10-03 23:03:40 +02:00
Aurelien Foucault
bca3489776 Add or operator 2020-10-03 23:00:34 +02:00
Aurelien Foucault
49811a47cc Implement the new and operator 2020-10-03 21:34:29 +02:00
Aurelien Foucault
ec82196c06 Support guard simple rule with the rework (recursivity) 2020-10-03 15:16:18 +02:00
Sunli
8d8e8946ad
Merge pull request #294 from qwtsc/test_dev
Add actix-web test
2020-10-02 22:28:38 +08:00
qwtsc
67489400c4 Add actix-web test 2020-10-02 21:17:47 +08:00
Sunli
6ed1cd1b47 Update docs 2020-10-02 15:34:20 +08:00
Sunli
87bcf055ac 2.0.0-alpha.23 2020-10-02 15:00:59 +08:00
Sunli
e263c755e2 Restore the original error extension implementation. 2020-10-02 14:56:10 +08:00
sunli
8aa406575b Remove useless code. 2020-10-01 18:48:11 +08:00
Sunli
ee90130b2c 2.0.0-alpha.22 2020-10-01 11:26:58 +08:00
Sunli
fd6a4a1946 Update docs 2020-10-01 11:24:30 +08:00
Sunli
33c2dcd4cf Merge branch 'master' of https://github.com/async-graphql/async-graphql 2020-10-01 11:23:33 +08:00
Sunli
3d7512ec58 Update docs. 2020-10-01 11:23:24 +08:00
Sunli
80d47a9fc7
Merge pull request #291 from async-graphql/rework-errors
Rework errors
2020-10-01 11:18:23 +08:00
Sunli
12e5e39a09
Merge pull request #292 from chipsenkbeil/master
Add flatten union documentation
2020-10-01 11:12:41 +08:00
Chip Senkbeil
2556c2fd7a
Add flatten union documentation 2020-09-30 21:44:47 -05:00
Sunli
f33ab0af01 Inline ContainerType, EnumType, ScalarType to docs. 2020-10-01 10:05:16 +08:00
Sunli
19f05597e0 Merge master 2020-10-01 09:40:04 +08:00
Sunli
1e30712726 Merge branch 'master' into rework-errors 2020-10-01 09:39:47 +08:00
Sunli
e6108352b9 Merge branch 'master' into rework-errors 2020-10-01 09:07:19 +08:00
Koxiaet
b61088089b Fix compilation and tests 2020-09-30 19:40:17 +01:00
Koxiaet
ab82460b81 Merge master 2020-09-30 18:24:24 +01:00
Sunli
c35a9f7245 Only delete the graphql attribute on the field parameter. 2020-09-30 16:18:49 +08:00
Sunli
28cd37115f Update docs. 2020-09-30 11:55:56 +08:00
Sunli
fd4c2b193b Added Apollo persisted queries extension. #280 2020-09-30 11:37:12 +08:00
Sunli
79d0c80d8b Update Cargo.toml 2020-09-30 08:00:48 +08:00
Sunli
6492629e71 Improve trait for GraphQL types. 2020-09-30 07:45:48 +08:00
Koxiaet
2ddaaaa07f 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
af2e480b70 Added context for Extension. 2020-09-29 20:47:37 +08:00
Sunli
c0ddf55132 Keep pin-project-lite dependent on async-graphql-tide at v0.1.8. 2020-09-29 17:04:27 +08:00
Sunli
f23942d798 2.0.0-alpha.21 2020-09-29 16:40:35 +08:00
Sunli
8c5d8f0324 Rework async-graphql-derive. #288 2020-09-29 16:06:10 +08:00
Sunli
e42f5a4477 Update book. 2020-09-28 14:43:12 +08:00
Sunli
fb026588ad 2.0.0-alpha.20 2020-09-28 11:33:58 +08:00
Sunli
884bf77087 Update docs 2020-09-28 11:15:37 +08:00
Sunli
c460431715 Add feature to flatten nested GraphQL unions. #286 2020-09-28 11:13:46 +08:00
Sunli
254502e7e2 Remove useless code. 2020-09-28 09:56:15 +08:00
Sunli
a0905de86f Update docs 2020-09-28 09:31:19 +08:00
Sunli
3a4f1aee15
Merge pull request #285 from chipsenkbeil/patch-1
Add remote enum documentation
2020-09-28 09:17:59 +08:00