Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axum starwars example fails to run #70

Open
matthewboman opened this issue Apr 5, 2023 · 3 comments
Open

Axum starwars example fails to run #70

matthewboman opened this issue Apr 5, 2023 · 3 comments

Comments

@matthewboman
Copy link

When I try to run the starwars example for axum I get the following error:

error[E0277]: the trait bound `std::string::String: From<async_graphql::Request>` is not satisfied
   --> axum/starwars/src/main.rs:15:20
    |
15  |     schema.execute(req.into_inner()).await.into()
    |            ------- ^^^^^^^^^^^^^^^^ the trait `From<async_graphql::Request>` is not implemented for `std::string::String`
    |            |
    |            required by a bound introduced by this call
    |
    = help: the following other types implement trait `From<T>`:
              <std::string::String as From<&mut str>>
              <std::string::String as From<&std::string::String>>
              <std::string::String as From<&str>>
              <std::string::String as From<Box<str>>>
              <std::string::String as From<Cow<'a, str>>>
              <std::string::String as From<ID>>
              <std::string::String as From<async_graphql::types::id::ID>>
              <std::string::String as From<char>>
              <std::string::String as From<url::Url>>
    = note: required for `async_graphql::Request` to implement `Into<std::string::String>`
    = note: required for `async_graphql::request::Request` to implement `From<async_graphql::Request>`
    = note: 1 redundant requirement hidden
    = note: required for `async_graphql::Request` to implement `Into<async_graphql::request::Request>`
note: required by a bound in `async_graphql::schema::Schema::<Query, Mutation, Subscription>::execute`
   --> /Users/matthewboman/.cargo/registry/src/github.com-1ecc6299db9ec823/async-graphql-4.0.16/src/schema.rs:658:47
    |
658 |     pub async fn execute(&self, request: impl Into<Request>) -> Response {
    |                                               ^^^^^^^^^^^^^ required by this bound in `Schema::<Query, Mutation, Subscription>::execute`

error[E0277]: the trait bound `GraphQLResponse: From<async_graphql::response::Response>` is not satisfied
  --> axum/starwars/src/main.rs:15:44
   |
15 |     schema.execute(req.into_inner()).await.into()
   |                                            ^^^^ the trait `From<async_graphql::response::Response>` is not implemented for `GraphQLResponse`
   |
   = help: the following other types implement trait `From<T>`:
             <GraphQLResponse as From<BatchResponse>>
             <GraphQLResponse as From<async_graphql::Response>>
   = note: required for `async_graphql::response::Response` to implement `Into<GraphQLResponse>`

error[E0277]: the trait bound `QueryRoot: async_graphql::ObjectType` is not satisfied
   --> axum/starwars/src/main.rs:24:32
    |
24  |     let schema = Schema::build(QueryRoot, EmptyMutation, EmptySubscription)
    |                  ------------- ^^^^^^^^^ the trait `async_graphql::ObjectType` is not implemented for `QueryRoot`
    |                  |
    |                  required by a bound introduced by this call
    |
    = help: the following other types implement trait `async_graphql::ObjectType`:
              &T
              Arc<T>
              Box<T>
              Edge<Cursor, Node, EdgeFields, Name>
              EmptyFields
              EmptyMutation
              MergedObjectTail
              PageInfo
            and 8 others
note: required by a bound in `async_graphql::Schema::<Query, Mutation, Subscription>::build`
   --> /Users/matthewboman/.cargo/registry/src/github.com-1ecc6299db9ec823/async-graphql-5.0.7/src/schema.rs:310:12
    |
310 |     Query: ObjectType + 'static,
    |            ^^^^^^^^^^ required by this bound in `Schema::<Query, Mutation, Subscription>::build`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `axum-starwars` due to 3 previous errors

This happens using version "5.0.7" of both async-graphql and async-graphql-axum.

@jordcodes
Copy link

Run into the same issue. Did you find a solution?

@spencerbart
Copy link

spencerbart commented Jul 26, 2023

Ran into the same issue

@sunli829
Copy link
Collaborator

I can't reproduce it, can you provide a repository?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants