Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for interfaces as query responses #305

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

ptpaterson
Copy link
Contributor

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):

image

Change types

    • Bug fix (non-breaking change that fixes an issue)
    • New feature (non-breaking change that adds functionality)
    • Breaking change (backwards-incompatible fix or feature)

Checklist:

    • My code follows the code style of this project.
    • My change requires a change to Fauna documentation.
    • 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.

@ptpaterson ptpaterson requested review from jrodewig and a team November 13, 2024 16:55
Copy link
Contributor

@jrodewig jrodewig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Narrow + 1 on README. Thanks!

Copy link
Contributor

@cleve-fauna cleve-fauna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change. h/t @panoply

@ptpaterson ptpaterson merged commit 3de4b6d into main Nov 13, 2024
7 checks passed
@ptpaterson ptpaterson deleted the better-interface-support branch November 13, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify Typings
3 participants