Commit Graph

115 Commits

Author SHA1 Message Date
Sunli
37f18855e3 Clippy clean 2022-08-12 14:05:46 +08:00
Sunli
687f26bb79 Fixes #943 2022-06-25 10:56:17 +08:00
Sunli
dc50049020 Fixes #848 2022-06-06 12:08:59 +08:00
Sunli
0529f18cb9 Fixes #941 2022-06-06 11:20:48 +08:00
Sunli
92234d7a75 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
f2bac81a2f Remove code and tests related oneof fields. #915 2022-05-07 16:16:01 +08:00
Sunli
4e81285756 Fixes #911 2022-05-06 09:28:57 +08:00
Sunli
93763997af Rework connection types 2022-04-19 19:18:06 +08:00
Sunli
889fe723f2 Export @oneOf directive to SDL when Oneof type is defined. #766 2022-03-05 09:06:59 +08:00
Sunli
632529ee3e Add support for oneof field on object. #766 2022-03-04 21:24:17 +08:00
Sunli
e8f14f328f Fix possible stack overflow in validator. 2022-01-28 09:46:14 +08:00
SadiinsoSnowfall
a4654a79e6 Fixed formatting (missing comma) 2022-01-24 14:32:30 +01:00
SadiinsoSnowfall
6372f76e87 Fixed formatting (hopefully for the last time) 2022-01-24 14:27:38 +01:00
SadiinsoSnowfall
a0fed1aaf5 Fixed formatting (2) 2022-01-24 14:24:33 +01:00
SadiinsoSnowfall
12840d95e6 Fixed formatting 2022-01-24 14:23:06 +01:00
SadiinsoSnowfall
188caa2267 Fixed variable type not checked when given a default value 2022-01-24 14:11:46 +01:00
Sunli
10646216cc Update docs 2021-11-20 11:16:48 +08:00
Sunli
e0c557a1a6 Add DirectivesUnique rule 2021-11-18 20:14:56 +08:00
Sunli
8750d8d34b Rework validators 2021-11-14 21:09:14 +08:00
Sunli
a26cc65d59 Rework Failure 3 #671 2021-11-07 19:11:43 +08:00
Sunli
d62aca8052 Rework Failure #671 2021-11-04 19:37:22 +08:00
Sunli
e898998311 Add Failure type. #671 2021-11-04 14:33:04 +08:00
Sunli
3306f85a8a Subscription typename - [GraphQL - October 2021] #681 2021-11-02 20:35:05 +08:00
Rodgers
0417f4181a Update AND, OR, and MapErr logic. Update logic for object input 2021-07-08 23:43:12 +07:00
Rodgers
ab277494d7 Add is_valid_with_extensions 2021-07-08 21:37:38 +07:00
Rodgers
c0b5c22c64 Add report_error_with_extensions 2021-07-08 20:02:49 +07:00
Sunli
20ee79993c Clippy clean 2021-06-18 10:43:34 +08:00
Sunli
dfe8245894 Add support for returning multiple resolver errors. #531 2021-06-07 14:03:36 +08:00
Sunli
7000651b88 Rework Extension 2021-04-04 14:37:41 +08:00
Sunli
08c1ace4b6 Fix the problem that the validation does not work on some inline fragments. 2021-03-14 10:15:52 +08:00
Sunli
69341df41e Moved Variables from async_graphql::context::Variables to
`async_graphql::Variables`.
2021-02-28 09:37:42 +08:00
Sunli
1dd3c7589f Clippy clean 2021-02-26 20:05:09 +08:00
Sunli
f13a1b25ce Clippy clean 2021-02-13 09:55:53 +08:00
Sunli
4d6fd5b539 Clippy clean 2021-01-11 09:01:28 +08:00
Sunli
f10cda9e78 Add custom complexity for subscription. 2020-12-19 18:39:33 +08:00
Sunli
bbb7124616 Add Analyzer extension. 2020-12-18 23:58:03 +08:00
Sunli
ec82e64a39 Improve depth and complex. 2020-12-18 18:56:28 +08:00
Olexiy Buyanskyy
aff2751d36 removed not needed namespaces 2020-10-23 13:51:09 +03:00
Olexiy Buyanskyy
d0032c731f removed not needed namespaces 2020-10-23 13:49:00 +03:00
Olexiy Buyanskyy
1ea5958d87 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
db312a372d Replace futures with futures_util 2020-10-16 07:49:22 +01:00
Koxiaet
4e562a86a7 Avoid locking extensions mutex when possible 2020-10-16 06:52:52 +01:00
Koxiaet
a48953899c Remove itertools dependency 2020-10-16 06:37:48 +01:00
Koxiaet
d34ac0ba08 Make imports consistent 2020-10-15 07:38:10 +01:00
Sunli
b331681fe1 2.0.2 2020-10-14 11:11:52 +08:00
Sunli
53ef84c5e3 Fix a bug in the validator. 2020-10-14 10:54:46 +08:00
Sunli
2ca10e0ded Add parse_value and from_value funcntions. 2020-10-11 20:24:31 +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