Commit Graph

30 Commits

Author SHA1 Message Date
Sunli
88ba75ec70 Rework connection types 2022-04-19 19:18:06 +08:00
Sunli
c2feefdf09 Fix the problem that some integrations overwritten HTTP headers. #793 2022-01-24 14:14:07 +08:00
Sunli
23fd49a70b Bump actix-web from 4.0.0-beta.11 to 4.0.0-beta.14 2021-12-12 10:10:28 +08:00
Sunli
81307ecf59 Update async-graphql-actix-web 2021-11-12 21:24:24 +08:00
Sunli
f869c58ea6 Update async-graphql-actix-web 2021-11-12 16:58:13 +08:00
Sunli
cc38b56e80 Merge branch 'actix-web-v4-beta' into upgrade-actix-web 2021-11-07 21:21:39 +08:00
Ricky Lam
e613084bd1 Fix compile error 2021-11-07 21:05:25 +08:00
Sunli
cac24dc5f3 Bump actix-web to 3.0.0-beta.8 2021-11-07 21:05:25 +08:00
Libor Vašíček
80406ddab2 Update tests for actix-web v4.0.0-beta.5 2021-11-07 21:05:25 +08:00
Sunli
c97b634303 Update for actix-web v4.0.0-beta.5 2021-11-07 21:05:25 +08:00
Sergey Sova
4dd0b21c78 upgrade actix to a v4.0 beta.10 2021-10-22 17:01:14 +03:00
Sunli
1d7742779e Add Axum integration. 2021-08-03 08:56:24 +08:00
Sunli
2d7627cd39 Fixed GraphQL over WebSocket Protocol does not support ConnectionError events. #406 2021-02-06 11:02:41 +08:00
Sunli
b98e35995d Supports async websocket initializer. #393 2021-01-16 16:37:20 +08:00
Sunli
b054fc0704 Add Send + Sync constraints for InputType, OutputType and SubscriptionType. 2021-01-14 12:41:59 +08:00
Patrick Fernie
6f3e861e27 support client specifying multiple protocols in Sec-WebSocket-Protocol negotiation 2020-12-04 12:16:14 -05:00
Sunli
06bd349dde Add WSSubscription::start_with_initializer and update examples. 2020-12-04 12:35:35 +08:00
Sunli
4b00f9393a Add websocket subprotocol for actix-web. 2020-12-04 12:13:52 +08:00
Koxiaet
fff84a3170 Support GET requests in actix-web integration 2020-10-15 10:33:38 +01:00
Sunli
97f0b0d419 Merge branch 'master' into rework-errors 2020-10-01 09:07:19 +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
Koxiaet
890b282dd9 Improve websockets 2020-09-17 19:22:54 +01:00
Sunli
492bba1cdd Move http::websocket::create and http::websocket::create_with_initializer function to http::WebSocketStream. 2020-09-15 20:07:59 +08:00
Sunli
86a6a34aac http::websocket::create function now returns the WebSocketStream type. 2020-09-15 11:19:00 +08:00
Sunli
5bb705bdf3 2.0.0-alpha.5 2020-09-14 09:46:22 +08:00
Koxiaet
9796364348 Move websockets to http module and fix doc tests 2020-09-13 07:40:34 +01:00
Koxiaet
35e74a4e17 Create resolver_utils 2020-09-12 10:29:52 +01:00
Sunli
4da65fc8e3 async-graphql-actix-web 2.0 2020-09-11 17:52:06 +08:00
Sunli
668b1fea94 Remove prefixes and add integrations subdirectory #259 2020-09-09 10:08:17 +08:00