AEM 6.5 Cloud Version and CIF Addon Installed go in exception when NULL is found in the response | Community
Skip to main content
April 9, 2025
Solved

AEM 6.5 Cloud Version and CIF Addon Installed go in exception when NULL is found in the response

  • April 9, 2025
  • 1 reply
  • 397 views

Hi,

 

I am experiencing a problem using CIF, I am using CategoryRetriever from ProductList to query the list of attributes I need to display on a page.

 

When in the getCategory query I receive even a single attribute to null in response, the MagentoGraphqlClient class throws an exception when executing the call.

 

this is the exception:

com.shopify.graphql.support.SchemaViolationError: Invalid value null for field CategoryTree.application_for

 

Is there any way to handle calls with nullable attributes?

maybe some CIF configuration.

 

thanks in advance.

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ButhpurKiran

Hi,

There's a patch(fix-error-returning-null-attribute-values.patch) available for download, once downloaded, apply the patch through command line as below 

patch -p1 < fix-error-returning-null-attribute-values.patch

 In your GraphQL, change the "application_for" field to nullable

Then handle null checks in frontend

if (category.application_for !== null) { // Proceed with using category.application_for }

With above you can handle for null case.

 

Thanks,

 

Kind regards,

Kiran Buthpur

1 reply

ButhpurKiran
ButhpurKiranAccepted solution
Level 4
June 26, 2025

Hi,

There's a patch(fix-error-returning-null-attribute-values.patch) available for download, once downloaded, apply the patch through command line as below 

patch -p1 < fix-error-returning-null-attribute-values.patch

 In your GraphQL, change the "application_for" field to nullable

Then handle null checks in frontend

if (category.application_for !== null) { // Proceed with using category.application_for }

With above you can handle for null case.

 

Thanks,

 

Kind regards,

Kiran Buthpur