Skip to content

Failed to compile with uuid #237

Closed
Closed
@jaidTw

Description

@jaidTw

Not sure am I doing wrong, but I got an error when I was trying to use uuid::Uuid in my schema.

use uuid::Uuid;

#[derive(GraphQLObject)]
struct User {
    ...
    photo: Option<Uuid>
}
error[E0277]: the trait bound `uuid::Uuid: juniper::GraphQLType` is not satisfied
  --> src/qlschema.rs:10:10
   |
10 | #[derive(GraphQLObject)]
   |          ^^^^^^^^^^^^^ the trait `juniper::GraphQLType` is not implemented for `uuid::Uuid`
   |
   = note: required because of the requirements on the impl of `juniper::GraphQLType` for `std::option::Option<uuid::Uuid>`

I've read the source, and as the guide mentioned, there's no any explicity configuration needed, right?
The installed version of juniper is 0.9.2, with uuid 0.6.5, have tried both nightly and stable toolchain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions