Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whole response becomes NULL if a field in response have null value ? #454

Open
RageshAntony opened this issue Dec 18, 2022 · 1 comment
Open

Comments

@RageshAntony
Copy link

For some specific queries, I was getting NULL response

So I did some digging, finally found that, in the response if a field is null, then the entire response becomes null

For example ,

In this response,

{
    "data": {
        "cable_opr_by_pk": {
            "address": "124",
            "cable_name": "erty",
            "email": "rrr@yopp.com",
            "password": "qwer123",
            "phone_no": "9876543210",
            "user_id": 11,
            "isActive": false,
            "paid_month": null
        }
    }

The paid_month is null. So what happens is, the entire response becomes null, that is

final resp = await client.request(reqCust).firstWhere((response) => response.dataSource != DataSource.Optimistic);

In the above execution, resp.data?.cable_opr_by_pk in NULL .

But if I added some value for paid_month in the DB and retried, then I able to get result since paid_month is not NULL.

Why this is happening ? Please help me

@knaeckeKami
Copy link
Collaborator

You will probably find the reason by checking the additional fields of the response that are for error handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants