@@ -50,7 +50,7 @@ const buildEntitiesQuery = (
5050 : undefined ,
5151 '$typeIds: [UUID!]!' ,
5252 useOrderBy ? '$propertyId: UUID!' : undefined ,
53- useOrderBy ? '$dataType: String! ' : undefined ,
53+ useOrderBy ? '$dataType: String' : undefined ,
5454 useOrderBy ? '$sortDirection: SortOrder!' : undefined ,
5555 '$first: Int' ,
5656 '$filter: EntityFilter!' ,
@@ -307,9 +307,6 @@ export const findManyPublic = async <
307307 }
308308
309309 orderByDataType = Utils . getOrderByDataType ( propertyType ) ;
310- if ( ! orderByDataType ) {
311- throw new Error ( `Property "${ String ( orderBy . property ) } " cannot be used in orderBy` ) ;
312- }
313310
314311 orderByPropertyId = propertyIdAnnotation . value ;
315312 sortDirection = orderBy . direction === 'asc' ? 'ASC' : 'DESC' ;
@@ -336,9 +333,11 @@ export const findManyPublic = async <
336333 queryVariables . spaceIds = spaceSelection . spaceIds ;
337334 }
338335
339- if ( orderByPropertyId && orderByDataType && sortDirection ) {
336+ if ( orderByPropertyId && sortDirection ) {
340337 queryVariables . propertyId = orderByPropertyId ;
341- queryVariables . dataType = orderByDataType ;
338+ if ( orderByDataType ) {
339+ queryVariables . dataType = orderByDataType ;
340+ }
342341 queryVariables . sortDirection = sortDirection ;
343342 }
344343
0 commit comments