Commit Graph

53 Commits

Author SHA1 Message Date
Sunli
053c1178c2 Add support for parse request from query string #1085 2022-09-25 12:10:52 +08:00
Sunli
744ca71aca on_connection_init takes FnOnce instead of Fn #1022 2022-08-15 12:12:25 +08:00
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
Follpvosten
086a50edd1 actix-web: make cbor optional feature, add test 2022-01-17 16:09:16 +01:00
Follpvosten
ab99dd0e94 actix cbor/json error handling; add Content-Length header for cbor 2022-01-16 10:57:25 +01:00
Follpvosten
cb66de126c add cbor response support for actix integration 2022-01-15 21:00:15 +01:00
Paco Dupont
aebea700c0 fix: upgrade actix-http to beta.17 and remove deprecated PayloadStream 2021-12-28 16:54:17 +01: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
97464b0572 Update async-graphql-rocket 2021-11-12 21:35:47 +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
Sunli
737cce27e0 Update for actix-web-4.0.0-beta.6 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
7771d4e08f Attach custom HTTP headers to the response when an error occurs. #572 2021-07-15 08:20:08 +08:00
Sunli
5d641a79bd Clippy clean 2021-03-26 21:07:45 +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
Sunli
1e449f9da6 Add Context::set_http_header method. #370 2021-01-10 08:06:48 +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
4caab70113 Require POST for GraphQL requests 2020-10-15 18:42:09 +01:00
Koxiaet
f764edc7d1 Improve Tide integration 2020-10-15 11:52:15 +01: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
aae4c29dd0 Reduce code duplication in batches in actix web 2020-09-25 17:38:12 +01:00
Koxiaet
4f732bfe3c Small improvements to actix-web integration 2020-09-23 17:30:22 +01:00
Sunli
e12ae8b236 Add BatchRequest support for actixweb and warp integrations. 2020-09-21 14:57:33 +08:00
Sunli
451f425813 Remove all GQL prefix. #208 2020-09-20 13:44:20 +08:00
Koxiaet
d52268523f Merge branch 'master' of github.com-koxiaet:async-graphql/async-graphql into master 2020-09-17 19:23:15 +01:00
Koxiaet
890b282dd9 Improve websockets 2020-09-17 19:22:54 +01:00
Sunli
76257403e2 Add support for batch queries. 2020-09-17 19:54:12 +08: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
dcc7d1be14 Replace http::GQLRequest with Request 2020-09-12 17:07:46 +01:00
Sunli
adcd36a0bf Remove async_graphql::http::StreamBody
l:
2020-09-12 21:44:34 +08: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