Commit Graph

48 Commits

Author SHA1 Message Date
Nicolas Moutschen
15afe01f7a feat: add @tag support 2022-08-22 11:44:02 +02:00
Nicolas Moutschen
06973ee09b feat: @inaccessible support 2022-08-18 11:40:04 +02:00
Sunli
88ba75ec70 Rework connection types 2022-04-19 19:18:06 +08:00
Sunli
a62eb6f699 Panics when the same Rust type has the same name. #880 2022-03-30 20:54:49 +08:00
Sunli
db83b9440c Update docs 2021-11-20 11:16:48 +08:00
Sunli
559bbedd3e Allowed use validators on wrapper types, for example: Option<T>, MaybeUnefined<T>.
Remove `OutputJson` because `Json` can replace it.
2021-11-18 15:43:12 +08:00
Sunli
0e9e087691 Move the methods of the Type trait to InputType and OutputType. 2021-11-12 07:23:05 +08:00
Sunli
b3dbbc097c Add specified_by_url for Upload 2021-11-02 20:35:43 +08:00
Sunli
c6d26884a9 Specified By - [GraphQL - October 2021] #677 2021-11-02 20:35:05 +08:00
Sunli
279899559a Update docs 2021-03-22 13:27:24 +08:00
Sunli
1c32a8afcb Now all features are not activated by default. 2021-03-22 10:39:17 +08:00
Sunli
ba23761cb4 Add visible attributes on types, fields, and parameters, allowing some content to be hidden based on conditions. 2020-12-12 16:23:53 +08:00
Sunli
5c39d0197d Rename InputValueType to InputType and OutputValueType to OutputType. 2020-12-11 15:37:50 +08:00
Sunli
6cdd7e44a3 Update upload.rs 2020-11-30 13:47:00 +08:00
Koxiaet
79ad5540a1 Make macros hygienic 2020-10-16 11:37:59 +01:00
Koxiaet
12fe7445c7 Replace futures with futures_util 2020-10-16 07:49:22 +01:00
Koxiaet
93c886af07 Make imports consistent 2020-10-15 07:38:10 +01:00
Sunli
87ba51fdd0 Some improvements. 2020-10-10 16:28:07 +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
Sunli
73333035bd Fix compiling without features 2020-09-18 15:14:40 +08:00
Sunli
45dc3d6d09 Add Upload::into_async_read with blocking 2020-09-18 14:32:00 +08:00
Sunli
e645e9d999 Remove the GQL prefix of all macros. #208 2020-09-18 09:10:24 +08:00
Sunli
34eaa1d686 Some improvements. 2020-09-17 11:22:09 +08:00
Sunli
24b80d52d3 Remove all attribute macros that can be replaced by derive. 2020-09-13 11:41:15 +08:00
Koxiaet
2f80e484d1 Fix Tide tests 2020-09-08 11:07:32 +01:00
Koxiaet
c055736101 Rustfmt 2020-09-06 07:16:36 +01:00
Koxiaet
81d85c2535 Rewrite async-graphql-parser 2020-09-06 06:38:31 +01:00
William Myers
422337fd1e Add docs about into_read being blocking
Addresses #151
2020-06-07 20:44:01 -06:00
Sunli
43c8daa132 Add MaybeUndefined type (#123)
* Add MaybeUndefined type
2020-05-28 15:00:55 +08:00
Sunli
a9d3ac9cf8 Implement a type-safe default value definition for InputValue. #111 2020-05-26 20:43:53 +08:00
Sunli
f74652e61a Modify some type names (internal types) 2020-05-15 10:08:37 +08:00
sunli
8e9aff105e Support Upload Stream #15
I think the previous implementation is not elegant enough, the `QueryBuilder::set_files_holder` function looks disgusting, so I refactored it.
By the way, the performance of parsing InputValue has been optimized, and unnecessary clones have been removed.
2020-05-11 21:47:24 +08:00
Sunli
0e371afb3c It not finished yet. 2020-05-11 17:13:50 +08:00
sunli
728989209f The error reason can be returned when the input value is parsed incorrectly. #70 2020-05-10 18:27:46 +08:00
sunli
3f49ebce0e Move project to async-graphql 2020-04-28 15:41:31 +08:00
sunli
4659da9c30 fix #33 2020-04-27 12:57:52 +08:00
nicolaiunrein
248e29c40b Fix url linking from Upload to example. 2020-04-20 07:59:10 +02:00
sunli
a53e61abf9 v1.8.1 2020-04-11 17:40:29 +08:00
sunli
0b6bfd4c33 Add GQLHttpRequest and IntoQueryBuilder trait 2020-04-11 17:36:05 +08:00
sunli
c60e4a51ab Fixed panic when uploading binary file 2020-04-03 09:27:22 +08:00
nicolaiunrein
3a3dfcc67e Update upload.rs 2020-03-30 16:47:17 +02:00
nicolaiunrein
4ec15b0749 Update upload.rs 2020-03-30 16:36:27 +02:00
nicolaiunrein
cea92039c5 Update upload.rs 2020-03-30 16:31:38 +02:00
Nicolai Unrein
441d163e93 add documentation to upload 2020-03-30 16:25:35 +02:00
sunli
99f4184f83 Clippy cleanup 2020-03-21 09:32:13 +08:00
sunli
62b4908ffe v1.3.2 2020-03-20 11:56:08 +08:00
sunli
724cb21258 add GraphQL Cursor Connections 2020-03-19 17:20:12 +08:00
sunli
abfe861749 Add support for multipart request 2020-03-14 11:46:20 +08:00