@@ -188,20 +188,21 @@ pub struct QueryEntitiesRequest<'q, 's, 'p> {
188188}
189189
190190impl < ' q , ' p > QueryEntitiesRequest < ' q , ' _ , ' p > {
191- /// # Errors
191+ /// Convert this request into [`QueryEntitiesParams`] with the given [`ApiConfig`] and resolved
192+ /// limit.
192193 ///
193- /// Returns [`LimitExceededError`] if the requested limit exceeds the configured maximum in
194- /// [`ApiConfig::query_entity_limit`].
195- pub fn into_params (
194+ /// Does not validate that the resolved limit does not exceed [`ApiConfig::query_entity_limit`].
195+ pub fn into_params_unchecked (
196196 self ,
197197 config : ApiConfig ,
198- ) -> Result < QueryEntitiesParams < ' q > , Report < LimitExceededError > >
198+ limit : Option < usize > ,
199+ ) -> QueryEntitiesParams < ' q >
199200 where
200201 ' p : ' q ,
201202 {
202- let limit = resolve_limit ( self . limit , config. query_entity_limit ) ? ;
203+ let limit = limit . or ( self . limit ) . unwrap_or ( config. query_entity_limit ) ;
203204
204- Ok ( QueryEntitiesParams {
205+ QueryEntitiesParams {
205206 filter : self . filter ,
206207 sorting : EntityQuerySorting {
207208 paths : generate_sorting_paths ( self . sorting_paths , & self . temporal_axes ) ,
@@ -219,7 +220,26 @@ impl<'q, 'p> QueryEntitiesRequest<'q, '_, 'p> {
219220 include_type_ids : self . include_type_ids ,
220221 include_type_titles : self . include_type_titles ,
221222 include_permissions : self . include_permissions ,
222- } )
223+ }
224+ }
225+
226+ /// Convert this request into [`QueryEntitiesParams`] with the given [`ApiConfig`] and resolved
227+ /// limit.
228+ ///
229+ /// # Errors
230+ ///
231+ /// Returns [`LimitExceededError`] if the requested limit exceeds the configured maximum in
232+ /// [`ApiConfig::query_entity_limit`].
233+ pub fn into_params (
234+ self ,
235+ config : ApiConfig ,
236+ ) -> Result < QueryEntitiesParams < ' q > , Report < LimitExceededError > >
237+ where
238+ ' p : ' q ,
239+ {
240+ let limit = resolve_limit ( self . limit , config. query_entity_limit ) ?;
241+
242+ Ok ( self . into_params_unchecked ( config, Some ( limit) ) )
223243 }
224244}
225245
@@ -286,6 +306,35 @@ impl<'q, 's, 'p> QueryEntitySubgraphRequest<'q, 's, 'p> {
286306 }
287307 }
288308
309+ /// Convert the request into traversal parameters. Skipping validation.
310+ #[ must_use]
311+ pub fn into_traversal_params_unchecked ( self , config : ApiConfig ) -> QueryEntitySubgraphParams < ' q >
312+ where
313+ ' p : ' q ,
314+ {
315+ let ( request, params) = self . into_parts ( ) ;
316+ let request = request. into_params_unchecked ( config, None ) ;
317+
318+ match params {
319+ SubgraphTraversalParams :: Paths { traversal_paths } => {
320+ QueryEntitySubgraphParams :: Paths {
321+ traversal_paths,
322+ request,
323+ }
324+ }
325+ SubgraphTraversalParams :: ResolveDepths {
326+ traversal_paths,
327+ graph_resolve_depths,
328+ } => QueryEntitySubgraphParams :: ResolveDepths {
329+ traversal_paths,
330+ graph_resolve_depths,
331+ request,
332+ } ,
333+ }
334+ }
335+
336+ /// Convert the request into traversal parameters.
337+ ///
289338 /// # Errors
290339 ///
291340 /// Returns [`QueryEntitySubgraphError`] if:
0 commit comments