diff --git a/.changeset/quiet-pens-return.md b/.changeset/quiet-pens-return.md new file mode 100644 index 00000000000..a938ccaecca --- /dev/null +++ b/.changeset/quiet-pens-return.md @@ -0,0 +1,5 @@ +--- +'@graphql-codegen/add': patch +--- + +The plugin output's `content` is now an empty string (`''`) instead of `null` when `placement` is `prepend` or `append`. This matches the `ComplexPluginOutput` type (`content: string`). Code that calls the plugin directly and checks `content === null` should check for an empty string instead. Generated files are unchanged. diff --git a/packages/plugins/other/add/src/index.ts b/packages/plugins/other/add/src/index.ts index 3f842b47ad5..375f9c0e9bf 100644 --- a/packages/plugins/other/add/src/index.ts +++ b/packages/plugins/other/add/src/index.ts @@ -25,7 +25,7 @@ export const plugin: PluginFunction = async ( } return { - content: null, + content: '', [placement]: Array.isArray(content) ? content : [content], }; };