Skip to content

Commit

Permalink
fix: Collection adders (push/unshift) should *not* be Queryable
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Sep 9, 2024
1 parent 20eb933 commit 11d4ccf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/many-queens-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@data-client/endpoint': patch
'@data-client/graphql': patch
'@data-client/rest': patch
---

Fix: Collection adders (push/unshift) should _not_ be Queryable
4 changes: 2 additions & 2 deletions packages/endpoint/src/schemas/Collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ function CreateAdder<C extends CollectionSchema<any, any>, P extends any[]>(
const properties: PropertyDescriptorMap = {
merge: { value: merge },
normalize: { value: normalizeCreate },
infer: { value: inferCreate },
queryKey: { value: queryKeyCreate },
};
if (collection.schema instanceof ArraySchema) {
properties.createIfValid = { value: createIfValid };
Expand All @@ -299,7 +299,7 @@ function CreateAdder<C extends CollectionSchema<any, any>, P extends any[]>(
return Object.create(collection, properties);
}

function inferCreate() {}
function queryKeyCreate() {}

function normalizeCreate(
this: CollectionSchema<any, any>,
Expand Down

0 comments on commit 11d4ccf

Please sign in to comment.