bug(gatsby-source-strapi): updating a JSON fields gets lost
- Dominant language
- JavaScript
- Stars
- 57
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
## Describe the bug
In one of my models, I have a JSON field. When it changes content, the Node gets lost. It doesn't exist anymore in graphql..
## To Reproduce
Steps to reproduce the behavior:
1. create a model with a JSON field
2. fill it with something that will match the [isPlainObject](https://github.com/gatsby-uc/plugins/blob/f87a34e17df74fe0503a939f97a81a16a5c76941/packages/gatsby-source-strapi/src/normalize.js#LL18C11-L18C24)
3. start the project, change the data, make sure updatedAt (cloud) build runs.
4. The data is lost. The Node is lost.
## Expected behavior
I'm expecting the JSON Node to be alive with the new content.
## System Info
System:
OS: macOS 12.6.5
CPU: (8) arm64 Apple M2
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.16.0 - /var/folders/50/3fndm5d13gs_kr96nwxpxd9c0000gn/T/yarn--1684222462858-0.5198471121130634/node
Yarn: 1.22.19 - /var/folders/50/3fndm5d13gs_kr96nwxpxd9c0000gn/T/yarn--1684222462858-0.5198471121130634/yarn
npm: 9.5.1 - /usr/local/bin/npm
Languages:
Python: 3.10.9 - /usr/local/bin/python
Browsers:
Chrome: 113.0.5672.92
Safari: 16.4.1
Contributor guide
Research direction
Start in packages/gatsby-source-strapi/src/normalize.js, especially the isPlainObject handling linked in the report, and reproduce the update with a Strapi JSON field. Verify the fix by confirming the JSON Node remains available in GraphQL with its new content after the cloud build runs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, javascript
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100