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

Support of common type crates behind feature flags #44

Closed
billy1624 opened this issue Sep 1, 2022 · 0 comments · Fixed by #51
Closed

Support of common type crates behind feature flags #44

billy1624 opened this issue Sep 1, 2022 · 0 comments · Fixed by #51

Comments

@billy1624
Copy link
Member

async-graphql support an array of common types guarded by feature flags. Ex. chrono, time, uuid, decimal ...etc.

In seaography, we should respect these feature flags as well. Because we need these type crates to implement our internal types. While we can't assumed all feature flag are enabled.

  • seaography/src/lib.rs

    Lines 39 to 59 in f5a91c7

    #[graphql(concrete(name = "DateFilter", params(sea_orm::prelude::Date)))]
    #[graphql(concrete(name = "DateTimeFilter", params(sea_orm::prelude::DateTime)))]
    #[graphql(concrete(name = "DateTimeUtcFilter", params(sea_orm::prelude::DateTimeUtc)))]
    // TODO #[graphql(concrete(name = "TimestampFilter", params()))]
    // TODO #[graphql(concrete(name = "TimestampWithTimeZoneFilter", params()))]
    #[graphql(concrete(name = "DecimalFilter", params(sea_orm::prelude::Decimal)))]
    // TODO #[graphql(concrete(name = "UuidFilter", params(uuid::Uuid)))]
    #[graphql(concrete(name = "BinaryFilter", params(BinaryVector)))]
    #[graphql(concrete(name = "BooleanFilter", params(bool)))]
    // TODO #[graphql(concrete(name = "EnumFilter", params()))]
    pub struct TypeFilter<T: async_graphql::InputType> {
    pub eq: Option<T>,
    pub ne: Option<T>,
    pub gt: Option<T>,
    pub gte: Option<T>,
    pub lt: Option<T>,
    pub lte: Option<T>,
    pub is_in: Option<Vec<T>>,
    pub is_not_in: Option<Vec<T>>,
    pub is_null: Option<bool>,
    }

So, we can "pass on" the feature flag we received in seaography to async-graphql. Just like what we did below in SeaORM. Where we "pass on" the with-* feature flag to sea-query and sqlx.

@billy1624 billy1624 changed the title Support of common type crates Support of common type crates behind feature flags Sep 1, 2022
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

Successfully merging a pull request may close this issue.

1 participant