@@ -15,7 +15,7 @@ use crate::scalar::WundergraphScalarValue;
1515use crate :: { ApplyOffset , LoadingHandler } ;
1616use diesel:: associations:: HasTable ;
1717use diesel:: backend:: Backend ;
18- use diesel:: expression:: NonAggregate ;
18+ use diesel:: expression:: { NonAggregate , SelectableExpression } ;
1919use diesel:: query_builder:: QueryFragment ;
2020use diesel:: sql_types:: Bool ;
2121use diesel:: Expression ;
@@ -104,21 +104,18 @@ pub trait AsNonColumnFilter<L, DB, Ctx> {
104104 type Filter ;
105105}
106106
107- impl < L , O , DB , Ctx > AsNonColumnFilter < L , DB , Ctx > for HasMany < O >
107+ impl < L , O , DB , Ctx , FK > AsNonColumnFilter < L , DB , Ctx > for HasMany < O , FK >
108108where
109109 L : HasTable ,
110- O : WundergraphBelongsTo < L :: Table , DB , Ctx > ,
110+ FK : Default + NonAggregate + QueryFragment < DB > + SelectableExpression < O :: Table > ,
111+ O : WundergraphBelongsTo < L :: Table , DB , Ctx , FK > ,
111112 O :: Table : ' static ,
112113 DB : Backend + ApplyOffset + ' static ,
113114 <O :: Table as QuerySource >:: FromClause : QueryFragment < DB > ,
114115 DB :: QueryBuilder : Default ,
115116{
116- type Filter = ReferenceFilter <
117- <L :: Table as Table >:: PrimaryKey ,
118- Filter < O :: Filter , O :: Table > ,
119- O :: ForeignKeyColumn ,
120- ( ) ,
121- > ;
117+ type Filter =
118+ ReferenceFilter < <L :: Table as Table >:: PrimaryKey , Filter < O :: Filter , O :: Table > , FK , ( ) > ;
122119}
123120
124121impl < C , DB , Ctx > AsColumnFilter < C , DB , Ctx > for i16 {
@@ -161,7 +158,17 @@ where
161158}
162159
163160#[ cfg( feature = "chrono" ) ]
164- impl < C , DB , Ctx > AsColumnFilter < C , DB , Ctx > for chrono:: NaiveDateTime {
161+ impl < C , DB , Ctx > AsColumnFilter < C , DB , Ctx > for chrono_internal:: NaiveDateTime {
162+ type Filter = FilterOption < Self , C > ;
163+ }
164+
165+ #[ cfg( feature = "chrono" ) ]
166+ impl < C , DB , Ctx > AsColumnFilter < C , DB , Ctx > for chrono_internal:: DateTime < chrono_internal:: Utc > {
167+ type Filter = FilterOption < Self , C > ;
168+ }
169+
170+ #[ cfg( feature = "uuid" ) ]
171+ impl < C , DB , Ctx > AsColumnFilter < C , DB , Ctx > for uuid_internal:: Uuid {
165172 type Filter = FilterOption < Self , C > ;
166173}
167174
0 commit comments