Closed jaridmargolin closed 3 years ago
Latest commit: 3cc478c698dfed210f1b6d8f95d05223ce82c0bc
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Thanks for the PR. Looks great. Could you add a change set? This will help CD.
Hi @jun-sheaf. Thanks for the quick response.
I was attempting to follow the documentation posted by the @changeset-bot but I ran into a few issues.
npx changeset
which points to a completely different project (I believe the correct command would be npx @changesets/cli
.npx @changesets/cli
I receive the error: 🦋 error There is no .changeset folder.
.changeset
folder and executing npx @changesets/cli
I receive the error: Error: ENOENT: no such file or directory, open '[PATH_TO_REPO]/.changeset/config.json'
Do you mind me asking, have you configured and used changeset
on this particular project? If so, do you have any accompanying documentation? I browsed the contributing doc and didn't see anything referenced.
It seems I did not set up changesets (I thought I did, perhaps I forgot to commit). I'll just merge and set it up.
By the way, you have to init
the changeset, not just create a .changeset
folder.
Wanted to drop a quick thank you... for merging the PR so quickly AND for cutting a release. Rare to see a turnaround that quick!
Description
Update to allow
null
for empty to-one relationships as defined in the JSON:API spec: https://jsonapi.org/format/#document-resource-object-related-resource-linksDetails
In order to support this, changes needed to be applied to two modules:
models/relationship.model
- Where the Relationship class was checking for truthiness of data where it should have been checking if the data was defined.utils/serializer.utils
- Where therecurseRelators
method assumed that related data could always be converted into a Resource.Notes
One thing I find interesting, is that the
fetch
method used inRelator
was typed to support resolving withnull
, which meant that this error was getting thrown at runtime rather than at compile time. This leads me to believe that the intent was fornull
to be supported and that the behavior encountered when actually returningnull
is a bug.Anyways, happy to make any requested changes.