fikaproductions / fika-gatsby-source-cockpit

This is a Gatsby version 2.\*.\* source plugin that feeds the GraphQL tree with Cockpit Headless CMS collections and singletons data. Actually, it supports querying raw texts (and any trivial field types), Markdown, images, galleries, assets, sets, repeaters, layout(-grid)s (currently only without nested images/assets), objects, linked collections and internationalization.
GNU General Public License v3.0
23 stars 22 forks source link

Error when using nested collection entries #42

Closed eXaminator closed 5 years ago

eXaminator commented 5 years ago

There seems to be a bug when having a collection with nested entries.

Cannot read property '_id' of null

I will create a PR for this bug in a moment.

eXaminator commented 5 years ago

After opening the PR and testing it a bit more there still seems to be a problem as I can't seem to be able to query any children (they are always empty) but I only get the children as "root" entry (with a level of 2).

I'll check it out too, but I'm unsure why that is because I'm not too familiar with gatsby plugins yet.

eXaminator commented 5 years ago

After some more research it seems that children are handled differently then other foreign keys and you should link them using the action "createParentChildLink" instead of just setting children___NODE. I'm playing around with it but it might take a while for me to get this fixed. Once I have it up and running I'll add it to the PR. But it might take a few days.

WhippetsAintDogs commented 5 years ago

Hi @eXaminator, did you had the time to fix the linking part ? I'll wait for that being added in the PR before submitting any review if that is OK with you. 😄 If you have any trouble let me know. I'll fix it on my side if it's the case.

eXaminator commented 5 years ago

@WhippetsAintDogs I did some quick fixes but didn't commit them yet due to time constraints. I'll see if I can get to it this weekend!