Skip to content

Unable replace existing product Retriever Filter Attributes key #975

@swativ0755

Description

@swativ0755

Expected Behaviour

I am trying to update product Retriever Filter Attributes but it is replace the value instead of key. And my requirement is to update/replace the existing attribute key not to set the custom attribute.

Actual Behaviour

After changing the code it is replacing the value of attribute , instead of key.

Expected Query
{products(filter:{my-attribute:{eq:"my-value"},custom-sku:{eq:"123"}})

Generated Query:

{products(filter:{my-attribute:{eq:"my-value"},sku:{eq:"custom-sku"}})

Reproduce Scenario (including but not limited to)

  1. Extend custom productdetails model and after retrieving the productRetriever I am extending the query to replace the key in grapghql query schema but it is replacing the value instead of key,

Steps to Reproduce

  1. Extend custom productdetails model and after retrieving the productRetriever I am extending the query to replace the key in grapghql query schema but it is replacing the value instead of key,

Platform and Version

AEM 6.5.12 , CIF core: 2.11.0

Sample Code that illustrates the problem

@PostConstruct
public void initModel() {
productRetriever = product.getProductRetriever();

	 if (productRetriever != null) {
		 productRetriever.extendProductFilterWith(f -> new ProductAttributeFilterInput()
				      
			          .setSku(new FilterEqualTypeInput()
			              .setEq("custom-sku"))
			          .setCustomFilter("my-attribute", new FilterEqualTypeInput()
			              .setEq("my-value")));
        }
	
}

Logs taken while reproducing problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions