getUserByUsernameOrEmail
getUserByUsernameOrEmail(variables, init)
getUserByUsernameOrEmail(
variables
,init
?):Promise
<TypedResponse
<Response
>>
Get KAID by username or email.
Parameters
• variables: Variables
• init?: RequestInit
Returns
Promise
<TypedResponse
<Response
>>
Link
Examples
Simple usage without error handling:
const response = await queries.getUserByUsernameOrEmail({
username: 'sal'
})
const json = await response.json()
const kaid = json.data.user?.kaid
Similarly, get KAID by email:
const response = await queries.getUserByUsernameOrEmail({
email: '[email protected]'
})
const json = await response.json()
const kaid = json.data.user?.kaid
Source
src/queries/getUserByUsernameOrEmail.ts:54
getUserByUsernameOrEmail(username, init)
getUserByUsernameOrEmail(
username
,init
?):Promise
<TypedResponse
<Response
>>
Parameters
• username: string
• init?: RequestInit
Returns
Promise
<TypedResponse
<Response
>>
Example
Alternative usage by username:
const response = await queries.getUserByUsernameOrEmail('sal')
const json = await response.json()
const kaid = json.data.user?.kaid
Source
src/queries/getUserByUsernameOrEmail.ts:67
getUserByUsernameOrEmail(email, init)
getUserByUsernameOrEmail(
init
?):Promise
<TypedResponse
<Response
>>
Parameters
• email: `${string}@${string}.${string}`
• init?: RequestInit
Returns
Promise
<TypedResponse
<Response
>>
Example
Similarly, by email:
const response = await queries.getUserByUsernameOrEmail('[email protected]')
const json = await response.json()
const kaid = json.data.user?.kaid