Open mizdra opened 7 months ago
Am I understanding this incorrectly? Is it correct behavior that export default
is not available?
Another workaround:
const plugin: CodegenPlugin = {
plugin(schema, documents, config) { ... },
};
export = plugin;
But I too would prefer to have default export available.(or named export like plugin
)
Is your feature request related to a problem? Please describe.
I want to write a plugin as ESM. But graphql-code-generator cannot load ESM plugin.
Describe the solution you'd like
Allow graphql-code-generator to load ESM plugin like CJS plugin.
Describe alternatives you've considered
No response
Is your feature request related to a problem? Please describe.
No response
Workaround
It seems to work if I export the plugin function with named export. However, I think it is better to use the default export.