diff --git a/src/types.ts b/src/types.ts index 569866bb..51d58a70 100644 --- a/src/types.ts +++ b/src/types.ts @@ -114,7 +114,7 @@ export type CheckMatchingArrayTypes = Result, NewResult, { - Error: 'Type mismatch: Cannot cast array result to a single object. Use .returns> for array results or .single() to convert the result to a single object' + Error: 'Type mismatch: Cannot cast array result to a single object. Use .overrideTypes> or .returns> (deprecated) for array results or .single() to convert the result to a single object' }, { Error: 'Type mismatch: Cannot cast single object to array type. Remove Array wrapper from return type or make sure you are not using .single() up in the calling chain' diff --git a/test/override-types.test-d.ts b/test/override-types.test-d.ts index 56164389..41be1c19 100644 --- a/test/override-types.test-d.ts +++ b/test/override-types.test-d.ts @@ -20,7 +20,7 @@ const postgrest = new PostgrestClient(REST_URL) TypeEqual< typeof result, { - Error: 'Type mismatch: Cannot cast array result to a single object. Use .returns> for array results or .single() to convert the result to a single object' + Error: 'Type mismatch: Cannot cast array result to a single object. Use .overrideTypes> or .returns> (deprecated) for array results or .single() to convert the result to a single object' } > >(true) diff --git a/test/returns.test-d.ts b/test/returns.test-d.ts index 551a0e22..040d3569 100644 --- a/test/returns.test-d.ts +++ b/test/returns.test-d.ts @@ -41,7 +41,7 @@ const postgrest = new PostgrestClient(REST_URL) } let resultType: typeof invalidCastArray.data let resultExpected: { - Error: 'Type mismatch: Cannot cast array result to a single object. Use .returns> for array results or .single() to convert the result to a single object' + Error: 'Type mismatch: Cannot cast array result to a single object. Use .overrideTypes> or .returns> (deprecated) for array results or .single() to convert the result to a single object' } expectType>(true)