-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Properly vary cache when nested pk is a number (#2961)
- Loading branch information
Showing
26 changed files
with
307 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@data-client/normalizr": patch | ||
--- | ||
|
||
fix: Missing nested entities should appear once they are present (When nesting pk was a number type) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
"@data-client/normalizr": patch | ||
'@data-client/endpoint': patch | ||
--- | ||
|
||
Always normalize pk to string type | ||
|
||
Warning: This will affect contents of the store state (some numbers will appear as strings) | ||
|
||
Before: | ||
|
||
```json | ||
{ | ||
"Article": { | ||
"123": { | ||
"author": 8472, | ||
"id": 123, | ||
"title": "A Great Article", | ||
}, | ||
}, | ||
"User": { | ||
"8472": { | ||
"id": 8472, | ||
"name": "Paul", | ||
}, | ||
}, | ||
} | ||
``` | ||
|
||
After: | ||
|
||
```json | ||
{ | ||
"Article": { | ||
"123": { | ||
"author": "8472", | ||
"id": 123, | ||
"title": "A Great Article", | ||
}, | ||
}, | ||
"User": { | ||
"8472": { | ||
"id": 8472, | ||
"name": "Paul", | ||
}, | ||
}, | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
'@data-client/endpoint': patch | ||
'@data-client/graphql': patch | ||
'@data-client/rest': patch | ||
--- | ||
|
||
Allow pk() to return numbers | ||
|
||
Before: | ||
|
||
```ts | ||
class MyEntity extends Entity { | ||
id = 0; | ||
pk() { | ||
return `${this.id}`; | ||
} | ||
} | ||
``` | ||
|
||
After: | ||
|
||
```ts | ||
class MyEntity extends Entity { | ||
id = 0; | ||
pk() { | ||
return this.id; | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.