gatsby和graphql:过滤特定的单个图像

我不太了解graphql或gatsby,但我相信通过将其放入我的gatsby-config.js中,可以将所有图像加载到graphql中

{
  resolve: `gatsby-source-filesystem`,
  options: {
    name: `images`,
    path: path.join(__dirname, `src/assets/images`),
  },
},

然后,我试图查询可以处理的特定图像

query MyQuery {
  allImageSharp(filter: {id: {eq: "7acfccd5-4aef-532b-8889-9d844ae2068b"}}) {
    edges {
      node {
        sizes {
          sizes
          srcSet
          src
          aspectRatio
        }
        id
      }
    }
  }
}

And this returns what I want, but the id that I have to enter for this query is 7acfccd5-4aef-532b-8889-9d844ae2068b. Is this id even going to stay the same if I put in my code? Is there a way to set the id to something more sensical?

我正在寻找查询单个图像的最佳方法。没有多张图片。 如果可以设置自己的ID,则可以查询这些ID。