File tree Expand file tree Collapse file tree 4 files changed +115
-17
lines changed Expand file tree Collapse file tree 4 files changed +115
-17
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @team-plain/typescript-sdk ' : minor
3+ ---
4+
5+ Add ability to get a user by email (userByEmail)
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ import {
4646 UpdateCustomerCardConfigDocument ,
4747 UpsertCustomerDocument ,
4848 type UpsertResult ,
49+ UserByEmailDocument ,
50+ type UserPartsFragment ,
4951 type WorkspacePartsFragment ,
5052} from './graphql/types' ;
5153import { request } from './request' ;
@@ -108,6 +110,20 @@ export class PlainClient {
108110 } ) ;
109111 }
110112
113+ /**
114+ * Get a paginated list of customers.
115+ */
116+ async userByEmail (
117+ variables : VariablesOf < typeof UserByEmailDocument >
118+ ) : SDKResult < UserPartsFragment | null > {
119+ const res = await request ( this . #ctx, {
120+ query : UserByEmailDocument ,
121+ variables,
122+ } ) ;
123+
124+ return unwrapData ( res , ( q ) => q . userByEmail || null ) ;
125+ }
126+
111127 /**
112128 * Get a paginated list of customers.
113129 */
Original file line number Diff line number Diff line change 1+ query userByEmail ($email : String ! ) {
2+ userByEmail (email : $email ) {
3+ ... UserParts
4+ }
5+ }
You can’t perform that action at this time.
0 commit comments