I am fetching data that contains a path to a users profile picture. Can I use gatsby-plugin-image to render this image or is that not possible using this plugin?
Specifically, after an api call I get data returned like this;
data:{
user:{
profilePicture: "https://mywebsite/img.jpg"
}
}
}
Following the documentation, it appears that using StaticImage is not appropriate since I would have to pass in src as a prop (see example below). However, using GatsbyImage (or getSrc or getImage) returns undefined and also does not appear to be how this plugin was intended to be used. Is there another pattern that I am missing or is this use case not a correct use of gatsby-plugin-image?
<StaticImage src={data.user.profilePicture} alt={data.user.fullname} />
returns: No data found for image "undefined"