Skip to content

Commit

Permalink
fix(internal): Fix parseConfig not handling schema.headers
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Apr 16, 2024
1 parent 6e39a4e commit eae97ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/cyan-brooms-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@gql.tada/internal": patch
---

Fix config parser not being able to handle `schema.headers` object
2 changes: 1 addition & 1 deletion packages/internal/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const parseConfig = (input: Record<string, unknown>) => {
throw new TadaError('Configuration contains a `schema` object, but no `url` property');
}

if ('headers' in schema && schema.headers && typeof schema.headers !== 'object') {
if ('headers' in schema && schema.headers && typeof schema.headers === 'object') {
for (const key in schema.headers) {
if (schema.headers[key] && typeof schema.headers[key] !== 'string') {
throw new TadaError(
Expand Down

0 comments on commit eae97ce

Please sign in to comment.