You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow a.query().arguments and .returns() to both accept arrays. This will allow custom query arguments mapped to Lambda handlers to allow the Lambda to process multiple requests in a single invocation, reducing network calls and cold starts.
In my specific case the user's identity is used to fetch an external API key and instantiate an external API client. Batching requests from the same user will make this much more efficient.
Currently the example below produces the error Property 'array' does not exist on type 'CustomType<{ fields: { action: ModelField<string, "required", undefined>; parameters: ModelField<string | number | boolean | object | any[], "required", undefined>; paginate: ModelField<...>; }; }>'
Notice how the return value may be an array, and does not produce an error, but the arguments cannot be an array.
Describe the feature you'd like to request
Allow
a.query().arguments
and.returns()
to both accept arrays. This will allow custom query arguments mapped to Lambda handlers to allow the Lambda to process multiple requests in a single invocation, reducing network calls and cold starts.In my specific case the user's identity is used to fetch an external API key and instantiate an external API client. Batching requests from the same user will make this much more efficient.
Currently the example below produces the error
Property 'array' does not exist on type 'CustomType<{ fields: { action: ModelField<string, "required", undefined>; parameters: ModelField<string | number | boolean | object | any[], "required", undefined>; paginate: ModelField<...>; }; }>'
Notice how the return value may be an array, and does not produce an error, but the arguments cannot be an array.
Describe the solution you'd like
Support for custom query functions to accept an array of arguments modeled with
customType
Describe alternatives you've considered
I have explored sending arguments as JSON or a string which gets parsed in the Lambda but in both cases validation and strict typing are lost.
Additional context
No response
Is this something that you'd be interested in working on?
Would this feature include a breaking change?
The text was updated successfully, but these errors were encountered: