File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
wundergraph/src/query_builder/selection Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ use crate::juniper_ext::FromLookAheadValue;
6
6
use crate :: query_builder:: selection:: { BoxedQuery , LoadingHandler } ;
7
7
use crate :: scalar:: WundergraphScalarValue ;
8
8
use diesel:: backend:: Backend ;
9
- #[ cfg( feature = "sqlite" ) ]
9
+ #[ cfg( any ( feature = "sqlite" , feature = "mysql" ) ) ]
10
10
use diesel:: query_dsl:: methods:: LimitDsl ;
11
11
#[ cfg( any( feature = "postgres" , feature = "sqlite" , feature = "mysql" ) ) ]
12
12
use diesel:: query_dsl:: methods:: OffsetDsl ;
@@ -85,13 +85,18 @@ impl ApplyOffset for diesel::mysql::Mysql {
85
85
{
86
86
use juniper:: LookAheadMethods ;
87
87
if let Some ( offset) = select. argument ( "offset" ) {
88
- Ok ( <_ as OffsetDsl >:: offset (
88
+ let q = <_ as OffsetDsl >:: offset (
89
89
query,
90
90
i64:: from_look_ahead ( offset. value ( ) )
91
91
. ok_or ( WundergraphError :: CouldNotBuildFilterArgument ) ?,
92
- ) )
92
+ ) ;
93
+ if select. argument ( "limit" ) . is_some ( ) {
94
+ Ok ( q)
95
+ } else {
96
+ Ok ( <_ as LimitDsl >:: limit ( q, std:: i64:: MAX ) )
97
+ }
93
98
} else {
94
99
Ok ( query)
95
100
}
96
101
}
97
- }
102
+ }
You can’t perform that action at this time.
0 commit comments