While validating/sanitizing the emitSchema option, only the options === true case is handled. The case where options is an object however is not handled and thus doesn't get added to the sanitized version of emitSchema.
I'm not sure if this is intentional (as the docs of the plugin only show usage of the true case) and the types of the plugin options are simply not accurate/outdated, of if this is a bug in the options sanitation logic of the plugin.
First of all, thanks for this amazing plugin!
I noticed that either the types of this plugin's options are inaccurate/wrong in regards to emitSchema, or there is a bug in the plugin.
According to the plugin option types for emitSchema, I should be able to configure the plugin as follows
However, if I use this configuration, no schema file gets emmited. Only if I use:
then a schema file gets emitted.
I think the reason for this seems to be the logic here: https://github.com/cometkim/gatsby-plugin-typegen/blob/7ee59cd5040e311bb11378656169e1e6e6878000/plugin/src/plugin-utils.ts#L73-L84
While validating/sanitizing the emitSchema option, only the
options === true
case is handled. The case whereoptions
is an object however is not handled and thus doesn't get added to the sanitized version ofemitSchema
.I'm not sure if this is intentional (as the docs of the plugin only show usage of the
true
case) and the types of the plugin options are simply not accurate/outdated, of if this is a bug in the options sanitation logic of the plugin.