Commit Graph

51 Commits

Author SHA1 Message Date
Sunli
93763997af Rework connection types 2022-04-19 19:18:06 +08:00
Sunli
7d58bd814d Fix the problem that some integrations overwritten HTTP headers. #793 2022-01-24 14:14:07 +08:00
Follpvosten
5898f63dac actix-web: make cbor optional feature, add test 2022-01-17 16:09:16 +01:00
Follpvosten
ce36e73639 actix cbor/json error handling; add Content-Length header for cbor 2022-01-16 10:57:25 +01:00
Follpvosten
9f8720c5df add cbor response support for actix integration 2022-01-15 21:00:15 +01:00
Paco Dupont
3df3c3f86a fix: upgrade actix-http to beta.17 and remove deprecated PayloadStream 2021-12-28 16:54:17 +01:00
Sunli
d211b48a5b Bump actix-web from 4.0.0-beta.11 to 4.0.0-beta.14 2021-12-12 10:10:28 +08:00
Sunli
2e27f1bfbf Update async-graphql-rocket 2021-11-12 21:35:47 +08:00
Sunli
32ba455fb2 Update async-graphql-actix-web 2021-11-12 21:24:24 +08:00
Sunli
111923ac0f Update async-graphql-actix-web 2021-11-12 16:58:13 +08:00
Sunli
f872dcda8d
Merge branch 'actix-web-v4-beta' into upgrade-actix-web 2021-11-07 21:21:39 +08:00
Ricky Lam
895d8aab60 Fix compile error 2021-11-07 21:05:25 +08:00
Sunli
dc9b382f29 Bump actix-web to 3.0.0-beta.8 2021-11-07 21:05:25 +08:00
Sunli
4a2eee997d Update for actix-web-4.0.0-beta.6 2021-11-07 21:05:25 +08:00
Libor Vašíček
b8762953a4 Update tests for actix-web v4.0.0-beta.5 2021-11-07 21:05:25 +08:00
Sunli
816aeb635f Update for actix-web v4.0.0-beta.5 2021-11-07 21:05:25 +08:00
Sergey Sova
5b6c4ee614 upgrade actix to a v4.0 beta.10 2021-10-22 17:01:14 +03:00
Sunli
5eafa69626 Add Axum integration. 2021-08-03 08:56:24 +08:00
Sunli
c1f651254e Attach custom HTTP headers to the response when an error occurs. #572 2021-07-15 08:20:08 +08:00
Sunli
a5a18824e7 Clippy clean 2021-03-26 21:07:45 +08:00
Sunli
550ecd9660 Fixed GraphQL over WebSocket Protocol does not support ConnectionError events. #406 2021-02-06 11:02:41 +08:00
Sunli
43a8ad6859 Supports async websocket initializer. #393 2021-01-16 16:37:20 +08:00
Sunli
95e372e0d3 Add Send + Sync constraints for InputType, OutputType and SubscriptionType. 2021-01-14 12:41:59 +08:00
Sunli
1897859b91 Add Context::set_http_header method. #370 2021-01-10 08:06:48 +08:00
Patrick Fernie
a3a3ba38f0 support client specifying multiple protocols in Sec-WebSocket-Protocol negotiation 2020-12-04 12:16:14 -05:00
Sunli
6884b6e105 Add WSSubscription::start_with_initializer and update examples. 2020-12-04 12:35:35 +08:00
Sunli
c9790087c5 Add websocket subprotocol for actix-web. 2020-12-04 12:13:52 +08:00
Koxiaet
5c47f1ec57 Require POST for GraphQL requests 2020-10-15 18:42:09 +01:00
Koxiaet
1a9f90d83e Improve Tide integration 2020-10-15 11:52:15 +01:00
Koxiaet
0683b5a6be Support GET requests in actix-web integration 2020-10-15 10:33:38 +01:00
Sunli
e6108352b9 Merge branch 'master' into rework-errors 2020-10-01 09:07:19 +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
Koxiaet
38c9c718d6 Reduce code duplication in batches in actix web 2020-09-25 17:38:12 +01:00
Koxiaet
79869b5032 Small improvements to actix-web integration 2020-09-23 17:30:22 +01:00
Sunli
37e21c54fa Add BatchRequest support for actixweb and warp integrations. 2020-09-21 14:57:33 +08:00
Sunli
ebb7c90461 Remove all GQL prefix. #208 2020-09-20 13:44:20 +08:00
Koxiaet
5cf527aeef Merge branch 'master' of github.com-koxiaet:async-graphql/async-graphql into master 2020-09-17 19:23:15 +01:00
Koxiaet
88be6bca61 Improve websockets 2020-09-17 19:22:54 +01:00
Sunli
acc1a6f515 Add support for batch queries. 2020-09-17 19:54:12 +08:00
Sunli
509c92a11f Move http::websocket::create and http::websocket::create_with_initializer function to http::WebSocketStream. 2020-09-15 20:07:59 +08:00
Sunli
059128e9c5 http::websocket::create function now returns the WebSocketStream type. 2020-09-15 11:19:00 +08:00
Sunli
d67a511a07 2.0.0-alpha.5 2020-09-14 09:46:22 +08:00
Koxiaet
55753983a9 Move websockets to http module and fix doc tests 2020-09-13 07:40:34 +01:00
Koxiaet
8796c5e1a7 Replace http::GQLRequest with Request 2020-09-12 17:07:46 +01:00
Sunli
bbf784fe42 Remove async_graphql::http::StreamBody
l:
2020-09-12 21:44:34 +08:00
Koxiaet
1aa36819eb Create resolver_utils 2020-09-12 10:29:52 +01:00
Sunli
394f45252f async-graphql-actix-web 2.0 2020-09-11 17:52:06 +08:00
Sunli
7a90069cad Continue to refactor. 2020-09-10 16:39:43 +08:00
Sunli
9bc837da9e Initial attempt. 2020-09-10 12:49:08 +08:00