Trying to assign the result of a getMyModel operation directly to a
MyModel variables won't necessarily work, because normally-required related
models might not be part of the selection set.
This util simply makes related model properties optional recursively.
Accepts a code generated model type and returns a supertype that can accept return values from the relevant graphql operations.
For example:
Trying to assign the result of a
getMyModel
operation directly to aMyModel
variables won't necessarily work, because normally-required related models might not be part of the selection set.This util simply makes related model properties optional recursively.