d
Topic
Posts:
2
12 days ago

Get article author image through graphql api

I am trying to get the author's image through the graphql storefront API. How can this be done? The ArticleAuthor node does not have an image field. I find this odd since the author's image can be accessed in liquid using `article.user.image`.

i
Replies
Zameer Masjedee Shopify Employee
Posts:
89
12 days ago

Hey Pat,

Zameer here from the Shopify Developer Experience team.

Unfortunately, it's currently not possible to retrieve the author's image using the GraphQL API. You may only retrieve the image associated with the article itself.

Posts:
501
12 days ago

I think that object property is documented for Liquid, but doesn't actually work. Try it ;-)

I turn coffee in to code - since 1998
Posts:
501
12 days ago

btw Zameer Masjedee the Liquid object article.user.image still not working?

Just curious

I turn coffee in to code - since 1998
Posts:
2
Last edited 11 days ago

Karl Offenberger, I can confirm I was able to use article.user.image to pull the profile picture. This was on a shopify plus store if that makes any difference.

Posts:
501
11 days ago

Pat Rocchio thanks for the heads up - I couldn't retrieve the image, but that might be because it linked to my gravatar. Not sure now, but after uploading a aseparate image for the user profile, it's fine and working as you say. Great, learned something new again.

I turn coffee in to code - since 1998