Issue with group containing relationships

Good day I am having an issue with queuing against a group that contains a relationship.

I have tried the following:

  const collections = await api.getAllByType('collection', {
    graphQuery: ` {
      collection {
        products {
          products_product {

Also tried using

await api.getAllByType('collection', {
    fetchLinks: ['product.product_image', 'product.title']

Both of these queries compile and work but in the end the data inside the relationship returns undefined.

[0] TypeError: /Users/johngrange/Projects/portfolio/views/pages/collections.pug:13
[0]     11|           each collection in collections
[0]     12|             each product in
[0]   > 13|               h1=

[0] Cannot read property 'title' of undefined

It also fails in code if I try the following:

  collections[0].data.products.forEach(product => {
[0]   products_product: {
[0]     id: 'Y7uIehEAACEAJtPO',
[0]     type: 'product',
[0]     tags: [],
[0]     lang: 'en-us',
[0]     slug: 'silver-necklace',
[0]     first_publication_date: '2023-01-09T03:22:41+0000',
[0]     last_publication_date: '2023-01-15T04:47:13+0000',
[0]     uid: 'silver_necklace',
[0]     data: {
[0]       uid: 'silver_necklace',
[0]       title: 'Silver Necklace',
[0]       product_image: [Object],
[0]       modal_image: [Object]
[0]     },
[0]     link_type: 'Document',
[0]     isBroken: false
[0]   }
[0] }
[0] undefined // This should be the title, and even though it shows above clearly it is not accessiable

I have also tried:

[0] (node:63478) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'title' of undefined
[0]     at /Users/johngrange/Projects/portfolio/app.js:123:30
[0]     at Array.forEach (<anonymous>)
[0]     at /Users/johngrange/Projects/portfolio/app.js:121:32
[0]     at processTicksAndRejections (internal/process/task_queues.js:95:5)

In addition , it seems my GraphQL explorer does not work, when I try to query I only get back "", and the documentation tab is empty.

Actually I was able to get this to work in the html :slight_smile:

            each product in

So I guess the only issue remaining is how can I get the GraphQL explorer working?

Hello @john

Thanks for reaching out to us. To debug the query, I need either of anything:

  1. Paste the Custom Type JSON structure or
  2. Repo URL and name of the custom Type where you add the Content relationship field in the Group.


The url is :

As you can see in the screenshot, I get an empty response, no error and no documentation on right hand side.

Hello @john

I can reproduce the issue, and it seems the server is not fulfilling the request. I asked my dedicated team to further investigation. I will come back to you as I hear back from them.


Great thank you! looking forward to going forward :smiley:

Yup I am aware, was exploring the GraphQL to try and get a better understand on how the data was represented. I did eventually figure out my problem but it would still be helpful to get the GraphQL working so I can explore as I continue development.

Thank you,

Of course. We'll keep you updated. As soon as there's an available fix, we'll let you know.