This is a really dirty workaround: you can user something like that :
const fs = require("fs");
const content = "module.exports = ({ nexus }) => {}";
const rootPath = require("path").resolve("./");
fs.writeFileSync(
rootPath +
"/node_modules/@strapi/plugin-users-permissions/server/graphql/queries/index.js",
content,
{ encoding: "utf8", flag: "w" }
);
it’s not asynchronous, it’s heavy in terms of performances since you open a file then rewrite it and it is one of the dirtiest way to do it but it does the job.
still looking for a better solution