Skip to content

Commit 9597b5b

Browse files
eddeee888claude
andauthored
[add] fix: return empty string for content under strict mode (#4683) (#10986)
* [add] fix: return empty string for content under strict mode (#4683) `content: null` doesn't satisfy `ComplexPluginOutput.content: string` once `strictNullChecks` is on. Core already treats null and '' the same (`result.content || ''`), so the generated output doesn't change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PjJDfAYR1JPdgiQRvvZZy eddeee888:oss:issue-fix * [add] chore: describe output change in changeset (#4683) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PjJDfAYR1JPdgiQRvvZZy --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent bec802b commit 9597b5b

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎.changeset/quiet-pens-return.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-codegen/add': patch
3+
---
4+
5+
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.

‎packages/plugins/other/add/src/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const plugin: PluginFunction<AddPluginConfig> = async (
2525
}
2626

2727
return {
28-
content: null,
28+
content: '',
2929
[placement]: Array.isArray(content) ? content : [content],
3030
};
3131
};

0 commit comments

Comments
 (0)