I have a graphql endpoint, I provide an object from the server like this { parentId : 42, parrent: {}}
for my update I only accept this { parentId : 42 }
How do I strip that extra parent property from being sent to the server for mutations?
I'm using a generated set of classes, they are as follows for a more complicated example.
So manually mapping every property works but makes maintenance a pain in the hiney.
export type Folder = {
id: Scalars["String"];
name?: Maybe<Scalars["String"]>;
parrentFolder?: Maybe<Folder>;
parrentFolderId?: Maybe<Scalars["String"]>;
};
export type FolderInput = {
name: Scalars["String"];
parrentFolderId?: Maybe<Scalars["String"]>;
id?: Maybe<Scalars["String"]>;
};
not removing the parrentFolder generates the following error: Unrecognized input fields 'parrentFolder'
I'd like to have a way to go from a Folder to a FolderInput, that is resilient to changes in either object. Errors for missing properties (present on FolderInput and not Folder) is neat but not required