fauna / fauna-js

Javascript driver for Fauna v10 (current)
https://fauna.com
Other
37 stars 7 forks source link

Add backwards compatible type params for HTTPRequest and HTTPStreamRequest #289

Closed ecooper closed 1 month ago

ecooper commented 1 month ago

Data types for HTTPRequest and HTTPStreamRequest are hardcoded today. Because of #288, we need to support generics for data. They default to backwards compatible types.

Description

This PR makes the following backwards compatible changes:

Motivation and context

To take advantage of HTTPClient.request against endpoints other than /query/v1, we need to support payloads other than QueryRequest. While we don't have an immediate use case for extending HTTPStreamRequest, I would argue it makes sense to keep the approaches the same across our two primary request types (call/response and streaming).

How was the change tested?

No tests were added for this specific change. If all existing tests pass, this is a safe change. The underlying data types are never referred to or accessed directly within the client.

Screenshots (if appropriate):

N/A

Change types

Checklist:


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

ecooper commented 1 month ago

Closed in favor of #290.