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

Resovers throw exception while reference are null #51

Closed
nirzaf opened this issue Sep 29, 2022 · 1 comment
Closed

Resovers throw exception while reference are null #51

nirzaf opened this issue Sep 29, 2022 · 1 comment

Comments

@nirzaf
Copy link
Contributor

nirzaf commented Sep 29, 2022

I am working on resolvers now, I am getting into an issue that when we try to fetch any related resource for a resource reference [with 1:1 cardinality ratio] which does not have any related resource (null) for any particular object, it is throwing an "object set to null reference" exception. I cannot return an empty object as well cos related resource's primary key required a value to be assigned. otherwise, it is throwing an error as "cannot assign a null value for a non-nullable type", any suggestions?

@nirzaf
Copy link
Contributor Author

nirzaf commented Sep 29, 2022

I am working on resolvers now, I am getting into an issue that when we try to fetch any related resource for a resource reference [with 1:1 cardinality ratio] which does not have any related resource (null) for any particular object, it is throwing an "object set to null reference" exception. I cannot return an empty object as well cos related resource's primary key required a value to be assigned. otherwise, it is throwing an error as "cannot assign a null value for a non-nullable type", any suggestions?

I changed NonNullableType Primary key to Normal Field, now I could return the empty Object if no referenced resource found

@nirzaf nirzaf closed this as completed Sep 29, 2022
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

1 participant