gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.28k stars 10.31k forks source link

childLocalImage vs. childrenLocalImage #5814

Closed nicib83 closed 6 years ago

nicib83 commented 6 years ago

I am following #2902 to download remote assets and link them as child nodes; specifically in the context of gatsby-source-airtable by fetching an image gallery from a column.

the number of images per gallery column can be bigger than 1 but also just 1 for any column returned.

in this case I can't fetch the images with

allAirtable {
      edges {
        node {
          childrenLocalImage {
            localImageFile {
                ...
            }
          }
        }
      }
    }

but have to use:

allAirtable {
      edges {
        node {
          childLocalImage {
            localImageFile {
                ...
            }
          }
        }
      }
    }

I have trouble understanding why the query syntax changes with the number of child nodes mapped via createParentChildLink and

  const localImageNode = {
    id: `${parent} >>> LocalImage ${id}`,
    url,
    // expires: screenshotResponse.data.expires,
    parent,
    children: [],
    internal: {
      type: `LocalImage`,
    },
    localImageFile___NODE: fileNode.id,
  }
KyleAMathews commented 6 years ago

Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help!