Commit Graph

221 Commits

Author SHA1 Message Date
Sunli 87ba51fdd0 Some improvements. 2020-10-10 16:28:07 +08:00
Sunli e170d3b735 Update docs. 2020-10-07 13:40:03 +08:00
AurelienFT 53eab09f19 Rework guard (#296)
Rework guard #293
2020-10-06 17:16:51 +08:00
Roman Kudryashov 71fa94392a Fix custom scalars doc 2020-10-04 12:21:53 +03:00
Sunli 323dbf8a87 Update docs 2020-10-02 15:34:20 +08:00
Sunli ad08f1dce7 Update docs 2020-10-01 11:24:30 +08:00
Sunli dd537af508 Merge branch 'master' of https://github.com/async-graphql/async-graphql 2020-10-01 11:23:33 +08:00
Sunli 87d39318b5 Update docs. 2020-10-01 11:23:24 +08:00
Sunli 900392949e Merge pull request #291 from async-graphql/rework-errors
Rework errors
2020-10-01 11:18:23 +08:00
Chip Senkbeil 0a5a8f243d Add flatten union documentation 2020-09-30 21:44:47 -05: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
Sunli 97ffe25f9f Update book. 2020-09-28 14:43:12 +08:00
Sunli c914622ff0 Update docs 2020-09-28 09:31:19 +08:00
Chip Senkbeil 0bb9f53d79 Add remote enum documentation
Add book documentation about remote option for enums (#276)
2020-09-27 14:02:10 -05:00
Sunli 451f425813 Remove all GQL prefix. #208 2020-09-20 13:44:20 +08:00
Sunli e645e9d999 Remove the GQL prefix of all macros. #208 2020-09-18 09:10:24 +08:00
Sunli 8f163e9e32 Update book 2020-09-17 08:14:07 +08:00
Sunli 32927f9836 Update book 2020-09-15 11:56:05 +08:00
Sunli b68d4147bc Update Book 2020-09-13 12:12:32 +08:00
Sunli 3b372edfd7 Udate docs 2020-09-13 11:51:10 +08:00
Sunli 3c01c5ed28 Update book. 2020-09-11 23:38:18 +08:00
Sunli 4194d17902 Release 1.18.0 2020-09-09 15:27:45 +08:00
Koxiaet 1ef34f2c39 Improve book and fix serde dependency 2020-09-01 06:47:22 +01:00
Sunli ca5f91aee4 Update docs 2020-08-28 14:04:59 +08:00
Lee Benson 221163b3dd Merge pull request #1 from leebenson/patch-2
Update SUMMARY.md
2020-08-27 11:04:11 +01:00
Lee Benson ec43ab1884 Update SUMMARY.md 2020-08-27 11:02:28 +01:00
Lee Benson 83ffa59184 Update merging_objects.md
Add subscription merging
2020-08-27 11:01:39 +01:00
Sunli 28d2041824 Add GQLMergedObject to docs/zh_CN 2020-08-11 11:42:19 +08:00
D1plo1d 84b16f5e36 Add GQLMergedObject to docs 2020-08-10 23:21:15 -04:00
Sunli 5df519047e Update book 2020-08-10 13:01:49 +08:00
Alaa Zorkane 630768a751 fix(docs): missing comment hashtag 2020-08-10 03:54:22 +01:00
Quentin Perez e2aa14c1ad InputValueValidator: impl for MustBeZero 2020-08-03 14:43:15 +02:00
Sunli 503339f504 InputValueValidator::is_valid function now returns the Result type. #221 2020-07-30 09:43:51 +08:00
Sunli c0ad65aafc Update input_value_validators.md 2020-07-30 09:29:07 +08:00
Sunli 2dc61013be Replace Value::Int and Value::Float with Value::Number. 2020-07-29 09:42:52 +08:00
Sunli c73b51c255 Fix typo 2020-07-15 15:08:58 +08:00
Sunli 003e7bfb21 Update docs #205 2020-07-08 15:05:38 +08:00
Blaine Bublitz c48f126fcd Use FieldResult for data(), add data_unchecked() for panic 2020-07-06 17:39:53 -07:00
Sunli c24b10821b Update docs for federation #180 2020-06-19 13:03:17 +08:00
Atsuhiro Takahashi 336c98eddb Fix sample code in the book. 2020-06-18 21:59:45 +09:00
Atsuhiro Takahashi 3bb17e466c Fix sample code on Quickstart (#177)
Fix sample code on Quickstart #177
2020-06-15 21:07:38 +08:00
Sunli 665b337bf2 Remove all datasource-related code and update the documentation. 2020-06-15 14:17:19 +08:00
Sunli 2452a44484 Add connection::query function 2020-06-02 17:43:13 +08:00
Sunli 775c7be6b1 Update docs 2020-06-02 08:57:45 +08:00
Sunli 79dd60cab2 Merge pull request #134 from nm-infy/nm-infy-patch-2
Correct spelling in context.md
2020-06-01 19:16:26 +08:00
Nilesh Mali aaa547a9bd correct spelling 2020-06-01 16:40:01 +05:30
Nilesh Mali 562b96078e correct statement grammar and spelling 2020-06-01 16:39:06 +05:30
Nilesh Mali f6e2fbe232 correct spelling in context.md 2020-06-01 16:31:04 +05:30
Nilesh Mali 2fb24f2f04 correct spelling in apollo_federation.md 2020-06-01 15:55:19 +05:30
Sunli afac9f613d Update introduction.md 2020-06-01 10:49:43 +08:00
Sunli 6496509c77 Merge pull request #128 from phated/notes-from-120
Improve stability message based on #120 feedback
2020-06-01 09:39:20 +08:00
Blaine Bublitz 6bde74951a Improve stability message based on #120 feedback 2020-05-31 12:00:19 -07:00
sunli 943aac1d31 update some docs 2020-05-29 00:01:04 +08:00
Иван Плесских a7ee9e777f Added docs for `Interface` field `method` argument (#124)
* Added docs for `Interface` field `method` argument
2020-05-28 23:50:01 +08:00
sunli be97f4b805 Update introduction.md 2020-05-28 08:15:04 +08:00
Sunli f60b5fcded Merge pull request #120 from phated/stability-warning
Add stability warning to README & book (ref #117)
2020-05-28 08:02:59 +08:00
Sunli 76ff909ccd New data source (#105)
* New data source
2020-05-28 08:02:00 +08:00
Blaine Bublitz 464f0c86bb Add stability warning to README & book (ref #117) 2020-05-27 15:40:51 -07:00
sunli a6b469db18 Update docs 2020-05-26 23:27:50 +08:00
nicolaiunrein c0ee41c8be Fix typo in book 2020-05-21 18:45:24 +02:00
Samuel Hurel 1f4b732615 Fix tests & impl From<Stream> for StreamDataSource 2020-05-21 10:22:36 +02:00
Nicolai Unrein 260c03e55f add examples and benchmarks to introduction of book 2020-05-20 13:29:07 +02:00
Sunli d00e3e8c25 The scalar name and description attributes are placed on the process macro attributes. #97 2020-05-19 13:27:01 +08:00
sunli e35fcc6c00 Update error_extensions.md 2020-05-13 12:51:44 +08:00
sunli 151d75ab57 Update docs 2020-05-13 12:49:43 +08:00
Nicolai Unrein 0cfa20c559 add some fixes in error_extensions.md and error_handling.md 2020-05-12 11:13:35 +02:00
sunli 2d1eb41598 Merge branch 'upload-stream' 2020-05-11 21:47:58 +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
Nicolai Unrein 8d9bb7d810 Add documentation for error_extensions 2020-05-11 14:25:54 +02:00
Sunli a78809301d Update docs 2020-05-11 14:35:12 +08:00
Sunli 693ffda56a Merge pull request #75 from phated/interface-enums
Change interfaces & unions to require enums
2020-05-11 13:44:19 +08:00
Blaine Bublitz 475754d9d9 Update the books 2020-05-10 21:39:43 -07:00
Sunli 3fcf41470b fix typo 2020-05-11 10:39:08 +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 106622c9b9 Merge pull request #67 from DataCorrupted/master
slightly modified based on Sunli's reply.
2020-05-10 13:53:26 +08:00
Peter Rong 318be22c79 slightly modified based on Sunli's reply.
Signed-off-by: Peter Rong <PeterRong96@gmail.com>
2020-05-09 22:48:41 -07:00
sunli 2755f4f9a9 Use rustdoc comments as graphql desc. #62 2020-05-10 12:41:05 +08:00
sunli 72ec6cc3bc Update apollo_tracing.md 2020-05-10 09:03:21 +08:00
Sunli 9902b3c339 Merge pull request #64 from DataCorrupted/master
Translate type system almost done with some TODO.
2020-05-10 08:56:50 +08:00
Ethan Fast 015e7ff6b5 translate section 7 (advanced topics) 2020-05-09 15:37:31 -07:00
Peter Rong 7591ef81bc resolved typo.
Signed-off-by: Peter Rong <PeterRong96@gmail.com>
2020-05-09 15:01:25 -07:00
Ethan Fast ddceb05e69 translate section 6 (integrations) 2020-05-09 14:56:45 -07:00
Ethan Fast 5e7a7f0df1 translate section 5 (extensions) 2020-05-09 14:39:04 -07:00
Ethan Fast d0b4e4db87 translate section 4 (schema) 2020-05-09 13:56:15 -07:00
Peter Rong 4ce0dc23b9 Translate type system almost done with some TODO.
Signed-off-by: Peter Rong <PeterRong96@gmail.com>
2020-05-09 10:53:41 -07:00
sunli d5cce30883 Update cursor_connections.md 2020-05-07 10:08:44 +08:00
Blaine Bublitz aed8f33ee5 Update book 2020-05-06 17:04:59 -07:00
sunli 331e65a72b Add field guard 2020-05-02 07:57:34 +08:00
ansj 845496e004 Update custom_scalars.md (#40)
* Update custom_scalars.md
2020-04-29 16:38:11 +08:00
sunli 3f49ebce0e Move project to async-graphql 2020-04-28 15:41:31 +08:00
sunli 629c16b29c Update custom_scalars.md 2020-04-28 10:32:26 +08:00
sunli 4659da9c30 fix #33 2020-04-27 12:57:52 +08:00
sunli 3473c8e5ad Update quickstart.md 2020-04-22 11:20:41 +08:00
sunli 8b45e1ba07 Update quickstart.md 2020-04-22 11:19:56 +08:00
sunli 5ec62cdc21 Update introduction.md 2020-04-22 11:18:58 +08:00
sunli b18ba7ef91 Add some docs 2020-04-22 11:16:41 +08:00
sunli f4aa2668a8 Add some docs 2020-04-22 10:30:21 +08:00
sunli ba7cc30ab1 Update custom_extensions.md 2020-04-19 21:29:05 +08:00
sunli 52305155c5 Update custom_extensions.md 2020-04-19 21:26:41 +08:00
sunli 18b5ab1c49 Add some docs 2020-04-19 10:28:52 +08:00
sunli 0b9d5ee071 The int64 scalar serializes to a string 2020-04-19 10:17:47 +08:00
sunli 1a650f5051 Update input_value_validators.md 2020-04-18 12:25:05 +08:00
sunli d7f396419c Update integrations_to_actix_web.md 2020-04-17 19:38:43 +08:00
sunli 691cb09786 Update subscription.md 2020-04-17 19:35:14 +08:00
sunli d65fea88d8 Update docs 2020-04-17 19:33:28 +08:00
sunli 0a791080dd Update integrations 2020-04-17 18:23:48 +08:00
sunli f0a3af15ae Add some docs 2020-04-17 18:22:24 +08:00
sunli 4cf83e333b Add some docs
v1.9.2
2020-04-17 11:06:33 +08:00
sunli e1115b0a31 Add some docs 2020-04-16 17:51:10 +08:00
sunli 790060a611 Add some docs 2020-04-16 17:06:46 +08:00
sunli 408697cdb3 Add some docs 2020-04-16 15:09:09 +08:00
sunli 8d97806c88 Update define_enum 2020-04-16 11:51:23 +08:00
sunli 9ca3962571 Add some docs 2020-04-16 11:06:09 +08:00
sunli e79b4ca96b Add some docs 2020-04-16 10:22:57 +08:00
sunli c0a05536a9 Update book 2020-04-15 17:19:26 +08:00
sunli 1da79a92f7 Update book.yml 2020-04-15 12:32:48 +08:00
sunli a706c7f968 Update book.yml 2020-04-15 12:31:19 +08:00
sunli cdcd1ae0e3 Update book 2020-04-15 12:26:40 +08:00
sunli 2171c2c2fa Add docs 2020-04-15 11:15:30 +08:00