I’m wondering if you might be able to do this out of the box by declaring artifacts and setting generateArtifacts to true in the GraphQL plugin config: Plugins configuration - Strapi Developer Docs
I haven’t been able to generate any input using this myself however 