Closed YiNNx closed 10 months ago
Hi, I solved it adding the following to Cargo.toml:
actix-http = { version = "3.4.0", default-features = true, features = ["http2"] }
Hi, I solved it adding the following to Cargo.toml:
actix-http = { version = "3.4.0", default-features = true, features = ["http2"] }
I really appreciate it! It works for cli 0.3.0.
But for seaography-cli 1.0.0-rc2, there is still compile problem:
Compiling postgres-example v0.3.0 (/home/yinn/F/Repos/seaography/examples/postgres)
error[E0053]: method `get_relation` has an incompatible type for trait
--> src/entities/actor.rs:38:40
|
38 | #[derive(Copy, Clone, Debug, EnumIter, DeriveRelatedEntity)]
| ^^^^^^^^^^^^^^^^^^^
| |
| expected `async_graphql::dynamic::field::Field`, found `async_graphql::dynamic::Field`
| help: change the output type to match the trait: `async_graphql::dynamic::field::Field`
|
= note: expected signature `fn(&entities::actor::RelatedEntity, &'static BuilderContext) -> async_graphql::dynamic::field::Field`
found signature `fn(&entities::actor::RelatedEntity, &'static BuilderContext) -> async_graphql::dynamic::Field`
= note: this error originates in the derive macro `DeriveRelatedEntity` (in Nightly builds, run with -Z macro-backtrace for more info)
...
...
error[E0308]: mismatched types
--> src/query_root.rs:46:5
|
12 | ) -> Result<Schema, SchemaError> {
| --------------------------- expected `Result<async_graphql::dynamic::Schema, async_graphql::dynamic::SchemaError>` because of return type
...
46 | schema.data(database).finish()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `async_graphql::dynamic::Schema`, found `async_graphql::dynamic::schema::Schema`
|
= note: `async_graphql::dynamic::schema::Schema` and `async_graphql::dynamic::Schema` have similar names, but are actually distinct types
note: `async_graphql::dynamic::schema::Schema` is defined in crate `async_graphql`
--> /home/yinn/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/async-graphql-5.0.10/src/dynamic/schema.rs:199:1
|
199 | pub struct Schema(pub(crate) Arc<SchemaInner>);
| ^^^^^^^^^^^^^^^^^
note: `async_graphql::dynamic::Schema` is defined in crate `async_graphql`
--> /home/yinn/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/async-graphql-6.0.10/src/dynamic/schema.rs:221:1
|
221 | pub struct Schema(pub(crate) Arc<SchemaInner>);
| ^^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `async_graphql` are being used?
Some errors have detailed explanations: E0053, E0061, E0308.
For more information about an error, try `rustc --explain E0053`.
error: could not compile `postgres-example` (lib) due to 31 previous errors
But for seaography-cli 1.0.0-rc2, there is still compile problem:
I think I've found the solution ... replace the version of async-graphql
& async-graphql-actix-web
with 5.0.10
, and adding actix-http
as @OnekO suggested.
Description
I am attempting to compile the code generated by seaography-cli with
-f actix
. However, during the compilation process, I encountered "could not compileasync-graphql-actix-web
" problem. The error messages are as follows:Upon inspecting the generated Cargo configuration, I replaced different versions of
async-graphql-actix-web
, but the issue persisted.However, the code compiles and runs correctly after being regenerated with the default poem framework.
And the
async-graphql-actix-web
crate compiles normally in my other projects.Upon discovering the compilation error, I tried using the example from this repository and found that when switching to the Actix framework, the code still couldn't compile, showing the same errors as mentioned above.
Steps to Reproduce
examples/postgres
directory, set up the Sakila database.src
directory and regenerate the code using the following commands:cargo run
.Expected Behavior
The code should compile and run correctly.
Actual Behavior
Reproduces How Often
Always
Versions
SeaORM (seems determined by seaography-cli):
Database: PostgreSQL 14 running in Docker
OS: Arch Linux 6.6.1-arch1-1
sea-orm-cli 0.12.6
seaography-cli 0.3.0
Additional Information
When I submitted this issue, I was using seaography-cli version 0.3.0. Despite switching to 1.0.0-rc.2 and regenerating, the compilation issue persists.