Commit Graph

130 Commits

Author SHA1 Message Date
Sunli
256ba11e58 Update define_simple_object.md 2020-10-13 10:52:04 +08:00
Sunli
13e51531d5 Update book 2020-10-13 10:36:57 +08:00
Sunli
9f1de91b8a Update book. 2020-10-13 07:35:30 +08:00
Sunli
10cd868f4c Some improvements. 2020-10-10 16:28:07 +08:00
Sunli
299a40bc4e Update docs. 2020-10-07 13:40:03 +08:00
Roman Kudryashov
a02050b7e2 Fix custom scalars doc 2020-10-04 12:21:53 +03:00
Sunli
6ed1cd1b47 Update docs 2020-10-02 15:34:20 +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
Koxiaet
ab82460b81 Merge master 2020-09-30 18:24:24 +01: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
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
a0905de86f Update docs 2020-09-28 09:31:19 +08:00
Sunli
ebb7c90461 Remove all GQL prefix. #208 2020-09-20 13:44:20 +08:00
Sunli
322e296a24 Remove the GQL prefix of all macros. #208 2020-09-18 09:10:24 +08:00
Sunli
fab82f15f3 Update book 2020-09-17 08:14:07 +08:00
Sunli
646c6155cd Update book 2020-09-15 11:56:05 +08:00
Sunli
7aa9cb2ed7 Update Book 2020-09-13 12:12:32 +08:00
Sunli
13f7126a13 Udate docs 2020-09-13 11:51:10 +08:00
Sunli
8d3ae2d465 Update book. 2020-09-11 23:38:18 +08:00
Sunli
035e7c27c9 Release 1.18.0 2020-09-09 15:27:45 +08:00
Sunli
3a0ccd43a0 Update docs 2020-08-28 14:04:59 +08:00
Sunli
702869a1f2 Add GQLMergedObject to docs/zh_CN 2020-08-11 11:42:19 +08:00
Sunli
b0bce9ec32 Update book 2020-08-10 13:01:49 +08:00
Sunli
c22ff21b96 InputValueValidator::is_valid function now returns the Result type. #221 2020-07-30 09:43:51 +08:00
Sunli
993b2499d7 Update input_value_validators.md 2020-07-30 09:29:07 +08:00
Sunli
3395c00603 Replace Value::Int and Value::Float with Value::Number. 2020-07-29 09:42:52 +08:00
Sunli
3eb3e1441f Fix typo 2020-07-15 15:08:58 +08:00
Sunli
741ec4d90a Update docs #205 2020-07-08 15:05:38 +08:00
Blaine Bublitz
6ed3909a9a Use FieldResult for data(), add data_unchecked() for panic 2020-07-06 17:39:53 -07:00
Sunli
c6803c4b35 Update docs for federation #180 2020-06-19 13:03:17 +08:00
Atsuhiro Takahashi
9f8197e317 Fix sample code in the book. 2020-06-18 21:59:45 +09:00
Atsuhiro Takahashi
3fd22ae3a2
Fix sample code on Quickstart (#177)
Fix sample code on Quickstart #177
2020-06-15 21:07:38 +08:00
Sunli
cda4498979 Remove all datasource-related code and update the documentation. 2020-06-15 14:17:19 +08:00
Sunli
27b622e8bc Add connection::query function 2020-06-02 17:43:13 +08:00
Sunli
928ecba19c Update introduction.md 2020-06-01 10:49:43 +08:00
sunli
3c97c76c60 update some docs 2020-05-29 00:01:04 +08:00
sunli
1a7ae5a26d Update introduction.md 2020-05-28 08:15:04 +08:00
Sunli
ada2597130
New data source (#105)
* New data source
2020-05-28 08:02:00 +08:00
sunli
c79e9f1b58 Update docs 2020-05-26 23:27:50 +08:00
Samuel Hurel
36c05dc5a7 Fix tests & impl From<Stream> for StreamDataSource 2020-05-21 10:22:36 +02:00
Sunli
89bfaac0eb The scalar name and description attributes are placed on the process macro attributes. #97 2020-05-19 13:27:01 +08:00
sunli
0717d6685b Update error_extensions.md 2020-05-13 12:51:44 +08:00
sunli
0824b6cc23 Update docs 2020-05-13 12:49:43 +08:00
sunli
83579077d9 Support Upload Stream #15
I think the previous implementation is not elegant enough, the `QueryBuilder::set_files_holder` function looks disgusting, so I refactored it.
By the way, the performance of parsing InputValue has been optimized, and unnecessary clones have been removed.
2020-05-11 21:47:24 +08:00
Sunli
1499b67a78 Update docs 2020-05-11 14:35:12 +08:00
Blaine Bublitz
d19ab4c559 Update the books 2020-05-10 21:39:43 -07:00
sunli
6d7d64866b The error reason can be returned when the input value is parsed incorrectly. #70 2020-05-10 18:27:46 +08:00
Sunli
93dedf1198
Merge pull request #67 from DataCorrupted/master
slightly modified based on Sunli's reply.
2020-05-10 13:53:26 +08:00
Peter Rong
17bd315727 slightly modified based on Sunli's reply.
Signed-off-by: Peter Rong <PeterRong96@gmail.com>
2020-05-09 22:48:41 -07:00
sunli
85156b69a8 Use rustdoc comments as graphql desc. #62 2020-05-10 12:41:05 +08:00
sunli
04a3b73c72 Update cursor_connections.md 2020-05-07 10:08:44 +08:00
Blaine Bublitz
aedb02fe63 Update book 2020-05-06 17:04:59 -07:00
sunli
98864c6879 Add field guard 2020-05-02 07:57:34 +08:00
ansj
3867f9d638
Update custom_scalars.md (#40)
* Update custom_scalars.md
2020-04-29 16:38:11 +08:00
sunli
aefe448ede Move project to async-graphql 2020-04-28 15:41:31 +08:00
sunli
c4b9b33f5f Update custom_scalars.md 2020-04-28 10:32:26 +08:00
sunli
1bc97de889 fix #33 2020-04-27 12:57:52 +08:00
sunli
8b210ab0d2 Add some docs 2020-04-22 11:16:41 +08:00
sunli
59098a770b Add some docs 2020-04-22 10:30:21 +08:00
sunli
16438b9d32 Update custom_extensions.md 2020-04-19 21:29:05 +08:00
sunli
2bf3d72b0a Update custom_extensions.md 2020-04-19 21:26:41 +08:00
sunli
776719743c Add some docs 2020-04-19 10:28:52 +08:00
sunli
c233192545 The int64 scalar serializes to a string 2020-04-19 10:17:47 +08:00
sunli
b023d5c939 Update input_value_validators.md 2020-04-18 12:25:05 +08:00
sunli
bcfa066838 Update integrations_to_actix_web.md 2020-04-17 19:38:43 +08:00
sunli
67c0b908a0 Update subscription.md 2020-04-17 19:35:14 +08:00
sunli
1fa3691a3a Update docs 2020-04-17 19:33:28 +08:00
sunli
92e1fc1a5b Update integrations 2020-04-17 18:23:48 +08:00
sunli
f438678fbf Add some docs 2020-04-17 18:22:24 +08:00
sunli
2c664bb7d7 Add some docs
v1.9.2
2020-04-17 11:06:33 +08:00
sunli
20c132406c Add some docs 2020-04-16 17:51:10 +08:00
sunli
51ea8696ac Add some docs 2020-04-16 17:06:46 +08:00
sunli
11000b42d3 Add some docs 2020-04-16 15:09:09 +08:00
sunli
62f4b069d5 Update define_enum 2020-04-16 11:51:23 +08:00
sunli
d7ff639fa3 Add some docs 2020-04-16 11:06:09 +08:00
sunli
a358088d74 Add some docs 2020-04-16 10:22:57 +08:00
sunli
d1fedd75da Update book 2020-04-15 17:19:26 +08:00
sunli
643f1d4906 Add docs 2020-04-15 11:15:30 +08:00