mst-gql icon indicating copy to clipboard operation
mst-gql copied to clipboard

Warning on undefined values on development

Open jvcmanke opened this issue 4 years ago • 0 comments

Just as stated in the README:

a field in mst-gql will be undefined when it has not been fetched from the server and, following graphql conventions, will be null if the field has been fetched but is in fact empty.

I tend to think that accessing these undefined values, while still possible, could raise a warning while in a dev environment asking the user if the field should have been queried.

Is there a way to do this without affecting performance at least in production, where this would be disabled, I imagine checking if the value is undefined every time something is accessed would be costly.

jvcmanke avatar Aug 12 '20 04:08 jvcmanke