Provide better support and documentation for how to use interfaces as query responses.
resolves #304
Description
Changes QueryValueObject from a type to an interface.
Add some instruction for how to use the QueryValueObject interface to the README.
Motivation and context
Sometimes, specifying interfaces for query responses is preferred over types. However, custom interfaces are currently not assignable to QueryValue and cannot be used where QueryValue is required (e.g. the Client.query() method).
See #304
How was the change tested?
I added tests to demonstrate how interfaces may be used.
Screenshots (if appropriate):
Change types
[ ] Bug fix (non-breaking change that fixes an issue)
[x] New feature (non-breaking change that adds functionality)
[ ] Breaking change (backwards-incompatible fix or feature)
Checklist:
[x] My code follows the code style of this project.
[x] My change requires a change to Fauna documentation.
[x] My change requires a change to the README, and I have updated it accordingly.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Provide better support and documentation for how to use interfaces as query responses.
resolves #304
Description
QueryValueObject
from atype
to aninterface
.QueryValueObject
interface to the README.Motivation and context
Sometimes, specifying interfaces for query responses is preferred over types. However, custom interfaces are currently not assignable to
QueryValue
and cannot be used whereQueryValue
is required (e.g. theClient.query()
method).See #304
How was the change tested?
I added tests to demonstrate how interfaces may be used.
Screenshots (if appropriate):
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.