diff --git a/.changeset/tender-suits-melt.md b/.changeset/tender-suits-melt.md new file mode 100644 index 00000000..4479c205 --- /dev/null +++ b/.changeset/tender-suits-melt.md @@ -0,0 +1,5 @@ +--- +'@gql.tada/cli-utils': patch +--- + +Fix generate-schema not forwarding single header diff --git a/packages/cli-utils/src/index.ts b/packages/cli-utils/src/index.ts index a2678aa7..176fa050 100644 --- a/packages/cli-utils/src/index.ts +++ b/packages/cli-utils/src/index.ts @@ -39,8 +39,10 @@ async function main() { let introspection: IntrospectionQuery; if (url) { - const headers = (Array.isArray(options.header) ? options.header : []).reduce( + const headers = (Array.isArray(options.header) ? options.header : [options.header]).reduce( (acc, item) => { + if (!item) return acc; + const parts = item.split(':'); return { ...acc,