Cannot return null for non-nullable field DropdownValueOption.label

Dear Monday.com team,

When using the dropdown column API request to fetch the data label for each dropdown, we intermittently get following internal Monday.com error:
Cannot return null for non-nullable field DropdownValueOption.label

This seems to be due to a validation done internally by Monday.com on the response against the GraphQL schema.

Is this is a known bug? How often do others experience this?

My query works fine but as soon as I add ... on DropdownValue { value values{label}} I start getting intermittent errors since I am pulling 200 rows each. It doesn’t say show any issues on the board itself and here response doesn’t indicate the field which is causing the issue as well. The following is the error response

"errors": [
        {
            "message": "Cannot return null for non-nullable field DropdownValueOption.label",
            "path": []
        }
    ]

Thanks in advance,

Bests,

Hi @haseeb1431 ,

This error, "Cannot return null for non-nullable field DropdownValueOption.label", typically occurs when Monday.com’s GraphQL API encounters a mismatch between the data and its schema validation. Specifically, it suggests that a dropdown option’s label is unexpectedly null, while the schema requires it to have a value.

Possible Causes:

  1. Null Data in Dropdown Values:
    The dropdown column might contain items where the label field has not been properly assigned or was inadvertently left blank.
  2. Batch Query Size:
    Pulling 200 rows at a time may amplify the likelihood of encountering an item with incomplete data.

Suggested Steps to Resolve:

  1. Validate Dropdown Data:
  • Check the board directly for any dropdown columns containing unselected or invalid values. Ensure all options in your dropdown fields have valid labels assigned.
  1. Adjust Your GraphQL Query:
  • To handle this issue programmatically, you can modify your query to check for the presence of label values before retrieving them. However, since the API enforces non-nullable fields, you cannot bypass the error directly unless the data is corrected.
  1. Implement Incremental Fetching:
  • Instead of pulling all 200 rows in one query, try splitting the request into smaller batches (e.g., 50 rows per query). This reduces the chances of encountering nulls in larger datasets.

Is This a Known Bug?

From the community perspective, this isn’t a frequent issue but is known to occur in edge cases where the dropdown data hasn’t been fully populated or managed. It’s good practice to ensure data integrity, especially when working with non-nullable fields in the GraphQL schema.

If you have any questions or need further assistance, feel free to reach out to me via email at mail@creativebits.us or Contact Creative Bits. We’d be happy to help!