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

Add types for Client.queryWithMetrics #628

Merged
merged 2 commits into from
Mar 29, 2022
Merged

Conversation

ptpaterson
Copy link
Contributor

#625 did not add types for the Client class.

src/types/Client.d.ts Outdated Show resolved Hide resolved
src/types/Client.d.ts Outdated Show resolved Hide resolved
@cleve-fauna cleve-fauna dismissed their stale review March 29, 2022 17:30

made better

@ptpaterson ptpaterson merged commit 270b8d0 into v4 Mar 29, 2022
@ptpaterson ptpaterson deleted the typesForQueryWithStats branch March 29, 2022 17:36
export default class Client {
constructor(opts?: ClientConfig)
query<T = object>(expr: ExprArg, options?: QueryOptions): Promise<T>
query<T = object>(expr: ExprArg, options?: QueryOptions): Promise<T> | Promise<MetricsResponse<T>>
Copy link

@Akryum Akryum Mar 29, 2022

Choose a reason for hiding this comment

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

This is a breaking change for TypeScript projects :(

Copy link

Choose a reason for hiding this comment

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

Example:

image

error TS2322: Type 'boolean | MetricsResponse<boolean>' is not assignable to type 'boolean'.

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.

3 participants