Skip to content

Adding separate query for products by id in GraphQL different from search #28578

Closed
@magento-engcom-team

Description

@magento-engcom-team

In order to load a Template, one must make a query to the urlResolver to obtain the id, uid and type of the content.

i.e.

urlResolver(url: "/breathe-easy-tank") {
  id
  uid
  type
}
{code}


{code}
{
  "data": {
    "urlResolver": {
      "id": 1
      "uid": "fhdjksfhdsf8dsf89sdf"
      "type": "PRODUCT"
    }
  }
}
{code}

Then using that information, one could load a template using the type. In this case, PRODUCT where and run a second GraphQL Query requesting the product id. However, ***id*** doesn't seem to be in the filter criteria. 

{code}
  productsByID(uids: < "uid1", "uid2"], id: [1,2,3> ) {
    items {
      id
      name
    }
  }

Note: This is the flow for loading the other two types: CMS_PAGE and CATEGORY.

AC:
New query must be added this scenario is not going to use Search API.
Query must support tagging a caching
Multiple IDs can be passed to the filter to obey some scenarios in which we need to display multiple products like: product compare, or multiple specific products, etc

Check the attached PR as a solution and add additional changes

Metadata

Metadata

Assignees

Labels

Issue: Format is not validGate 1 Failed. Automatic verification of issue format is failedIssue: needs updateAdditional information is require, waiting for responsePriority: P3May be fixed according to the position in the backlog.Progress: doneProject: GraphQLReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions