File tree Expand file tree Collapse file tree 4 files changed +31
-20
lines changed Expand file tree Collapse file tree 4 files changed +31
-20
lines changed Original file line number Diff line number Diff line change 54
54
"abort-controller-x" : " ^0.4.3" ,
55
55
"graphql" : " ^16.9.0" ,
56
56
"graphql-request" : " ^6.1.0" ,
57
- "long" : " ^5.2.3 " ,
58
- "nice-grpc" : " ^2.1.10 " ,
59
- "nice-grpc-client-middleware-retry" : " ^3.1.9 " ,
57
+ "long" : " ^5.2.4 " ,
58
+ "nice-grpc" : " ^2.1.11 " ,
59
+ "nice-grpc-client-middleware-retry" : " ^3.1.10 " ,
60
60
"nice-grpc-common" : " ^2.0.2" ,
61
61
"uuid" : " ^9.0.1"
62
62
},
Original file line number Diff line number Diff line change @@ -69,9 +69,9 @@ export type UpdateObject<T> = {
69
69
/** The ID of the object to be updated */
70
70
id : string ;
71
71
/** The properties of the object to be updated */
72
- properties ?: NonReferenceInputs < T > ;
72
+ properties ?: Partial < NonReferenceInputs < T > > ;
73
73
/** The references of the object to be updated */
74
- references ?: ReferenceInputs < T > ;
74
+ references ?: Partial < ReferenceInputs < T > > ;
75
75
//* The vector(s) to update in the object */
76
76
vectors ?: number [ ] | Vectors ;
77
77
} ;
@@ -170,6 +170,13 @@ const addContext = <B extends IBuilder>(
170
170
return builder ;
171
171
} ;
172
172
173
+ type ParseObject < T > = {
174
+ id ?: string ;
175
+ properties ?: Partial < NonReferenceInputs < T > > ;
176
+ references ?: Partial < ReferenceInputs < T > > ;
177
+ vectors ?: number [ ] | Vectors ;
178
+ } ;
179
+
173
180
const data = < T > (
174
181
connection : Connection ,
175
182
name : string ,
@@ -180,7 +187,7 @@ const data = <T>(
180
187
const objectsPath = new ObjectsPath ( dbVersionSupport ) ;
181
188
const referencesPath = new ReferencesPath ( dbVersionSupport ) ;
182
189
183
- const parseObject = async ( object ?: InsertObject < any > ) : Promise < WeaviateObject < T > > => {
190
+ const parseObject = async ( object ?: ParseObject < any > ) : Promise < WeaviateObject < T > > => {
184
191
if ( ! object ) {
185
192
return { } as WeaviateObject < T > ;
186
193
}
Original file line number Diff line number Diff line change @@ -1626,8 +1626,8 @@ export class Serialize {
1626
1626
} ;
1627
1627
1628
1628
public static restProperties = (
1629
- properties : Record < string , WeaviateField > ,
1630
- references ?: Record < string , ReferenceInput < any > >
1629
+ properties : Record < string , WeaviateField | undefined > ,
1630
+ references ?: Record < string , ReferenceInput < any > | undefined >
1631
1631
) : Record < string , any > => {
1632
1632
const parsedProperties : any = { } ;
1633
1633
Object . keys ( properties ) . forEach ( ( key ) => {
@@ -1651,6 +1651,9 @@ export class Serialize {
1651
1651
} ) ;
1652
1652
if ( ! references ) return parsedProperties ;
1653
1653
for ( const [ key , value ] of Object . entries ( references ) ) {
1654
+ if ( value === undefined ) {
1655
+ continue ;
1656
+ }
1654
1657
if ( ReferenceGuards . isReferenceManager ( value ) ) {
1655
1658
parsedProperties [ key ] = value . toBeaconObjs ( ) ;
1656
1659
} else if ( ReferenceGuards . isUuid ( value ) ) {
You can’t perform that action at this time.
0 commit comments