{"id":15506941,"url":"https://github.com/simply007/gatsby-null-instead-of-array","last_synced_at":"2025-10-24T00:58:40.227Z","repository":{"id":94604899,"uuid":"224148761","full_name":"Simply007/gatsby-null-instead-of-array","owner":"Simply007","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-10T00:19:40.000Z","size":900,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T07:13:46.514Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Simply007.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-26T09:10:17.000Z","updated_at":"2019-12-16T13:25:38.000Z","dependencies_parsed_at":"2024-12-18T02:43:47.753Z","dependency_job_id":"fbd8f51e-f908-4c6d-b8b1-a02bbb825dfd","html_url":"https://github.com/Simply007/gatsby-null-instead-of-array","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simply007%2Fgatsby-null-instead-of-array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simply007%2Fgatsby-null-instead-of-array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simply007%2Fgatsby-null-instead-of-array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simply007%2Fgatsby-null-instead-of-array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Simply007","download_url":"https://codeload.github.com/Simply007/gatsby-null-instead-of-array/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247257225,"owners_count":20909430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T09:29:23.313Z","updated_at":"2025-10-24T00:58:39.095Z","avatar_url":"https://github.com/Simply007.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Problem\n\n## :bulb: Fixed\n\n\u003e SHOULD BEE FIXED IN GATSBY ^2.18.11 - https://github.com/gatsbyjs/gatsby/pull/20068\n\nBefore introduction of the type schema the empty `linked_items` returned empty array, after the schema definition introduction (implemented in ), there is a `null`. Customer is using js object destructing which fails when there is null instead of empty array, so i was wondering whether the default value could be changed.\n\nIn [plugins/@kentico/gatsby-source-kontent/src/typeNodesSchema.js#L30](plugins/@kentico/gatsby-source-kontent/src/typeNodesSchema.js#L30) - [commit](https://github.com/Simply007/gatsby-null-instead-of-array/commit/4281908c1952c3df2a6338243aabe4e88600d9c3) I have added a code for logging and proving, that the value passed to the element is really empty array`[]` not null, but on [index page](src/pages/index.js), I am getting null for `allKontentItemTestModel` query.\n\n## Reproduce\n\n```sh\n  npm install\n  npm run prepare\n  npm run develop\n```\n\nIn log you will see:\n\n```plain\n***\nPlacing [] to Linked \u0026 element field.\nPlacing [\"049be403-5ca5-5678-8c6d-92b64ceee550\",\"95ef13b6-74e4-5388-98f2-fd006ea5adeb\"] to Linked \u0026 element field.\nPlacing [\"049be403-5ca5-5678-8c6d-92b64ceee550\"] to Linked \u0026 element field.\nPlacing [] to Linked Items field.\n***\n```\n\n## Example of the data js destruction that breaks\n\n```js\nconst item = {\n  system: {\n    codename: \"test\"\n  },\n  elements: {\n    product_line: {\n      linked_items: [\n        {\n          system: {\n            codename: \"product_line\"\n          }\n        }\n      ]\n    }\n  }\n};\n\nconst [product_line] = item.elements.product_line.linked_items\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimply007%2Fgatsby-null-instead-of-array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimply007%2Fgatsby-null-instead-of-array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimply007%2Fgatsby-null-instead-of-array/lists"}