Error : "message": "Cannot return null for non-nullable field" while fetching data from Strapi

Hi all, I am getting the above error in network tab while fetching data from Strapi through GraphQL in my React Frontend.

I need to keep my description field as mandatory in Strapi.

Currently If there is a content in that field, the page in frontend is visible. If not I am getting above error with blank page.

Requirement is, it needs to show the page if there is a content. If not it needs to skip that field content and show the page as usual.

I tried to change in query by using “skip” and “include” directives also like below ( description @skip(if: false) , description @include(if: true) and modified the type of the field from “text” to “string” also but nothing works.

Any suggestion would be helpful. Thank you

[details=“System Information”]

  • Strapi Version: 4.15.5
  • Operating System: MAC
  • Database:
  • Node Version: 18.14.0
  • NPM Version: 9.3.1

Hi @Srinivas,

Did you manage to resolve this? I am experiencing exactly the same issue