Commit Graph

16 Commits

Author SHA1 Message Date
Sunli
db83b9440c Update docs 2021-11-20 11:16:48 +08:00
Sunli
4f47703118 Switch the async runtime used for testing to Tokio. 2021-03-12 12:47:24 +08:00
Sunli
c777150dcd Use value! instead of serde_json::json!. 2020-10-12 10:17:05 +08:00
Sunli
87ba51fdd0 Some improvements. 2020-10-10 16:28:07 +08:00
Sunli
20d240df47 Fix enum strings in query variables are not converted to proper enums. #270 2020-09-20 13:28:18 +08:00
Sunli
e645e9d999 Remove the GQL prefix of all macros. #208 2020-09-18 09:10:24 +08:00
Sunli
24b80d52d3 Remove all attribute macros that can be replaced by derive. 2020-09-13 11:41:15 +08:00
Koxiaet
dcc7d1be14 Replace http::GQLRequest with Request 2020-09-12 17:07:46 +01:00
Sunli
35f17a389c Remove unnecessary Result on Schema::execute_stream function. 2020-09-11 10:47:55 +08:00
Sunli
91c75ced2a Make all tests passed (async-graphql). 2020-09-10 19:35:48 +08:00
Koxiaet
04c898ef01 Rustfmt 2020-09-08 09:30:29 +01:00
Koxiaet
47259548c4 Support service parsing in async-graphql-parser
- Instead of adding a separate module `schema` like there was before,
since service parsing and executable parsing have a fair amount of
overlap I put them as two submodules `executable` and `service` in both
`parse` and `types`. Also, the grammar is unified under one `.pest`
file.
- Added const equivalents to `Value`, `Directive` etc
- Change the reexport `async_graphql::Value` from
`async_graphql_parser::types::Value` to
`async_graphql_parser::types::ConstValue` since in 99% of cases in this library
a const value is wanted instead of a value.
- Added consistent usage of executable/service instead of the ambiguous
query/schema.
- Some of the tests actually had invalid GraphQL so the new more correct
grammar made them fail, that was fixed.
- Added a `Name` newtype to refer to GraphQL names
(`[A-Za-z_][A-Za-z_0-9]*`) since they are used so frequently.
2020-09-08 09:21:27 +01:00
Bryan Burgers
e21f2e6316 Allow vars to be missing when def is nullable
Allow variables to be missing when the associated variable definition is
nullable (in which case we use `null` as the default).

This fixes queries like

```graphql
query Test($var: Int) {
    test(var: $var)
}
```

```json
{}
```

which appear to be allowed according to the GraphQL spec.
2020-06-11 10:00:47 -05:00
Sunli
267620d08e Fix incorrect variable substitution. #126 2020-05-31 11:54:07 +08:00
sunli
4659da9c30 fix #33 2020-04-27 12:57:52 +08:00
sunli
6da2e3a528 Add some tests 2020-04-22 21:31:44 +08:00