Commit Graph

115 Commits

Author SHA1 Message Date
Sunli
e4c3da6ae9 Clippy clean 2022-08-12 14:05:46 +08:00
Sunli
c129cf57d6 Fixes #943 2022-06-25 10:56:17 +08:00
Sunli
900167d300 Fixes #848 2022-06-06 12:08:59 +08:00
Sunli
144c773cd7 Fixes #941 2022-06-06 11:20:48 +08:00
Sunli
d0bb37f419 Add Schema::build_with_ignore_name_conflicts method to specifies a list to ignore type conflict detection. 2022-05-24 20:08:35 +08:00
Sunli
5ad9f497d8 Remove code and tests related oneof fields. #915 2022-05-07 16:16:01 +08:00
Sunli
96e423ff31 Fixes #911 2022-05-06 09:28:57 +08:00
Sunli
88ba75ec70 Rework connection types 2022-04-19 19:18:06 +08:00
Sunli
5dad855f8e Export @oneOf directive to SDL when Oneof type is defined. #766 2022-03-05 09:06:59 +08:00
Sunli
a4b840a984 Add support for oneof field on object. #766 2022-03-04 21:24:17 +08:00
Sunli
7dfebf99fd Fix possible stack overflow in validator. 2022-01-28 09:46:14 +08:00
SadiinsoSnowfall
61e80c869e Fixed formatting (missing comma) 2022-01-24 14:32:30 +01:00
SadiinsoSnowfall
892cf8169e Fixed formatting (hopefully for the last time) 2022-01-24 14:27:38 +01:00
SadiinsoSnowfall
09918299c1 Fixed formatting (2) 2022-01-24 14:24:33 +01:00
SadiinsoSnowfall
aab3edc459 Fixed formatting 2022-01-24 14:23:06 +01:00
SadiinsoSnowfall
962e1b1f80 Fixed variable type not checked when given a default value 2022-01-24 14:11:46 +01:00
Sunli
db83b9440c Update docs 2021-11-20 11:16:48 +08:00
Sunli
e2c6ead1a3 Add DirectivesUnique rule 2021-11-18 20:14:56 +08:00
Sunli
eb022a0cca Rework validators 2021-11-14 21:09:14 +08:00
Sunli
dbc0862894 Rework Failure 3 #671 2021-11-07 19:11:43 +08:00
Sunli
369f1459b7 Rework Failure #671 2021-11-04 19:37:22 +08:00
Sunli
e73c142ce8 Add Failure type. #671 2021-11-04 14:33:04 +08:00
Sunli
057d6aebfd Subscription typename - [GraphQL - October 2021] #681 2021-11-02 20:35:05 +08:00
Rodgers
53c4945fc4 Update AND, OR, and MapErr logic. Update logic for object input 2021-07-08 23:43:12 +07:00
Rodgers
aa1d4194b5 Add is_valid_with_extensions 2021-07-08 21:37:38 +07:00
Rodgers
c0d24be0c7 Add report_error_with_extensions 2021-07-08 20:02:49 +07:00
Sunli
2dce1ad35f Clippy clean 2021-06-18 10:43:34 +08:00
Sunli
f8021c0fb5 Add support for returning multiple resolver errors. #531 2021-06-07 14:03:36 +08:00
Sunli
824356d118 Rework Extension 2021-04-04 14:37:41 +08:00
Sunli
4c34494e52 Fix the problem that the validation does not work on some inline fragments. 2021-03-14 10:15:52 +08:00
Sunli
4f2ea5ed50 Moved Variables from async_graphql::context::Variables to
`async_graphql::Variables`.
2021-02-28 09:37:42 +08:00
Sunli
144ddb752c Clippy clean 2021-02-26 20:05:09 +08:00
Sunli
386b0b2876 Clippy clean 2021-02-13 09:55:53 +08:00
Sunli
5f2e0ae50d Clippy clean 2021-01-11 09:01:28 +08:00
Sunli
6043543df7 Add custom complexity for subscription. 2020-12-19 18:39:33 +08:00
Sunli
0d76987f40 Add Analyzer extension. 2020-12-18 23:58:03 +08:00
Sunli
bf9e3ec578 Improve depth and complex. 2020-12-18 18:56:28 +08:00
Olexiy Buyanskyy
9f442aa750 removed not needed namespaces 2020-10-23 13:51:09 +03:00
Olexiy Buyanskyy
3ac150bef9 removed not needed namespaces 2020-10-23 13:49:00 +03:00
Olexiy Buyanskyy
baf67f3344 Fixed redundant_closure_for_method_calls
https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
2020-10-23 11:10:00 +03:00
Koxiaet
12fe7445c7 Replace futures with futures_util 2020-10-16 07:49:22 +01:00
Koxiaet
ec8ec740be Avoid locking extensions mutex when possible 2020-10-16 06:52:52 +01:00
Koxiaet
1205d6e91e Remove itertools dependency 2020-10-16 06:37:48 +01:00
Koxiaet
93c886af07 Make imports consistent 2020-10-15 07:38:10 +01:00
Sunli
12f15f4815 2.0.2 2020-10-14 11:11:52 +08:00
Sunli
2d0c192df8 Fix a bug in the validator. 2020-10-14 10:54:46 +08:00
Sunli
e056edbaa0 Add parse_value and from_value funcntions. 2020-10-11 20:24:31 +08:00
Koxiaet
768b666acd Merge master 2020-09-30 18:24:24 +01: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
Sunli
e60864a18d Rework async-graphql-derive. #288 2020-09-29 16:06:10 +08:00