async-graphql / examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Subscription example fails to compile

nicolaiunrein opened this issue · comments

I tried to update my code and had an issue with subscriptions. I then tried to run the example and it seems to give me the same error:

error[E0599]: no method named `clone` found for struct `async_graphql_parser::pos::Positioned<async_graphql_parser::query::SelectionSet>` in the current scope
   --> models/books/src/lib.rs:97:1
    |
97  | #[async_graphql::Subscription]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `async_graphql_parser::pos::Positioned<async_graphql_parser::query::SelectionSet>`
    | 
   ::: /home/nicolai/.cargo/registry/src/github.com-1ecc6299db9ec823/async-graphql-parser-0.5.0/src/query.rs:195:1
    |
195 | pub struct SelectionSet {
    | ----------------------- doesn't satisfy `_: std::clone::Clone`
    | 
   ::: /home/nicolai/.cargo/registry/src/github.com-1ecc6299db9ec823/async-graphql-parser-0.5.0/src/pos.rs:32:1
    |
32  | pub struct Positioned<T: ?Sized> {
    | -------------------------------- doesn't satisfy `_: std::clone::Clone`
    |
    = note: the method `clone` exists but the following trait bounds were not satisfied:
            `async_graphql_parser::query::SelectionSet: std::clone::Clone`
            which is required by `async_graphql_parser::pos::Positioned<async_graphql_parser::query::SelectionSet>: std::clone::Clone`
    = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no method named `as_ref` found for struct `std::sync::Arc<_>` in the current scope
  --> models/books/src/lib.rs:97:1
   |
97 | #[async_graphql::Subscription]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `std::sync::Arc<_>`
   |
   = note: `#[async_graphql::Subscription]` is a function, perhaps you wish to call it
   = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors

commented

I forgot to update the parser version. 😂

commented

There is no easy-to-use tool to batch update the version number.

commented

I updated the version number, and after cargo update it was compiled. 😁