@@ -128,15 +128,8 @@ export type EntityQueryResult = {
128128
129129type GraphSortDirection = 'ASC' | 'DESC' ;
130130
131- type ParsedEntity <
132- S extends Schema . Schema . AnyNoContext ,
133- IncludeSpaceIds extends boolean | undefined ,
134- > = Entity . WithSpaceIds < Entity . Entity < S > , IncludeSpaceIds > & {
135- __schema : S ;
136- } ;
137-
138131export type FindManyParseResult < S extends Schema . Schema . AnyNoContext , IncludeSpaceIds extends boolean | undefined > = {
139- data : ParsedEntity < S , IncludeSpaceIds > [ ] ;
132+ data : Entity . WithSpaceIds < Entity . Entity < S > , IncludeSpaceIds > [ ] ;
140133 invalidEntities : InvalidEntity [ ] ;
141134 invalidRelationEntities : InvalidRelationEntity [ ] ;
142135} ;
@@ -150,7 +143,7 @@ export const parseResult = <S extends Schema.Schema.AnyNoContext, IncludeSpaceId
150143 const includeSpaceIds = options ?. includeSpaceIds ?? false ;
151144 const schemaWithId = Utils . addIdSchemaField ( type ) ;
152145 const decode = Schema . decodeUnknownEither ( schemaWithId ) ;
153- const data : ParsedEntity < S , IncludeSpaceIds > [ ] = [ ] ;
146+ const data : Entity . WithSpaceIds < Entity . Entity < S > , IncludeSpaceIds > [ ] = [ ] ;
154147 const invalidEntities : InvalidEntity [ ] = [ ] ;
155148 const invalidRelationEntities : InvalidRelationEntity [ ] = [ ] ;
156149
@@ -200,19 +193,15 @@ export const parseResult = <S extends Schema.Schema.AnyNoContext, IncludeSpaceId
200193 } ) ;
201194
202195 if ( Either . isRight ( decodeResult ) ) {
203- const baseEntity = {
204- ...decodeResult . right ,
205- __schema : type ,
206- } ;
196+ const baseEntity = decodeResult . right ;
207197 const entityWithSpaceIds = (
208198 includeSpaceIds
209199 ? {
210200 ...baseEntity ,
211201 spaceIds : normalizeSpaceIds ( queryEntity . spaceIds ) ,
212202 }
213203 : baseEntity
214- ) as ParsedEntity < S , IncludeSpaceIds > ;
215- // injecting the schema to the entity to be able to access it in the preparePublish function
204+ ) as Entity . WithSpaceIds < Entity . Entity < S > , IncludeSpaceIds > ;
216205 data . push ( entityWithSpaceIds ) ;
217206 } else {
218207 const invalidRawEntity = includeSpaceIds
0 commit comments