I am trying to get multiple products via their id using graphql Api.
My query is :
query MyQuery {
products(first: 20, query: "(id: gid://shopify/Product/8042415816983) OR (id: gid://shopify/Product/8105484845335)") {
edges {
node {
title
id
}
}
}
}
For example I need 5 products detail . I have their ids so I will use OR in filter.
By this way I am not getting those products.
Though By title search the filtering is working fine.
@Stephen2020 - Very elegant solution. Thank you so much. Never thought of using the Node interface this way. Opens up a lot of possibilities. (Ex: querying metafields on an online store’s page. Currently, there is no way to get this via GraphQL API).