Skip to content

Commit 11d4ccf

Browse files
committed
fix: Collection adders (push/unshift) should *not* be Queryable
1 parent 20eb933 commit 11d4ccf

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.changeset/many-queens-care.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@data-client/endpoint': patch
3+
'@data-client/graphql': patch
4+
'@data-client/rest': patch
5+
---
6+
7+
Fix: Collection adders (push/unshift) should _not_ be Queryable

packages/endpoint/src/schemas/Collection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ function CreateAdder<C extends CollectionSchema<any, any>, P extends any[]>(
287287
const properties: PropertyDescriptorMap = {
288288
merge: { value: merge },
289289
normalize: { value: normalizeCreate },
290-
infer: { value: inferCreate },
290+
queryKey: { value: queryKeyCreate },
291291
};
292292
if (collection.schema instanceof ArraySchema) {
293293
properties.createIfValid = { value: createIfValid };
@@ -299,7 +299,7 @@ function CreateAdder<C extends CollectionSchema<any, any>, P extends any[]>(
299299
return Object.create(collection, properties);
300300
}
301301

302-
function inferCreate() {}
302+
function queryKeyCreate() {}
303303

304304
function normalizeCreate(
305305
this: CollectionSchema<any, any>,

0 commit comments

Comments
 (0)