Skip to content

Commit 112e6cf

Browse files
authored
rename method (#91)
1 parent bc02a30 commit 112e6cf

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.changeset/brown-hairs-smell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@team-plain/typescript-sdk': minor
3+
---
4+
5+
Rename `userByEmail` to `getUserByEmail` and deprecate old method.

src/client.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export class PlainClient {
112112

113113
/**
114114
* Get a paginated list of customers.
115+
* @deprecated "use `getUserByEmail" instead
115116
*/
116117
async userByEmail(
117118
variables: VariablesOf<typeof UserByEmailDocument>
@@ -124,6 +125,20 @@ export class PlainClient {
124125
return unwrapData(res, (q) => q.userByEmail || null);
125126
}
126127

128+
/**
129+
* Get a paginated list of customers.
130+
*/
131+
async getUserByEmail(
132+
variables: VariablesOf<typeof UserByEmailDocument>
133+
): SDKResult<UserPartsFragment | null> {
134+
const res = await request(this.#ctx, {
135+
query: UserByEmailDocument,
136+
variables,
137+
});
138+
139+
return unwrapData(res, (q) => q.userByEmail || null);
140+
}
141+
127142
/**
128143
* Get a paginated list of customers.
129144
*/

0 commit comments

Comments
 (0)