getUser
Retrieve the profile and settings for the currently authenticated user.
Parameters
This query does not accept parameters. It automatically returns data for the authenticated user based on the authorization token.
Response
The authenticated user’s profile
notificationChannels
Connection<UserNotificationChannel>
User’s configured notification channelsShow UserNotificationChannel fields
channelType
NotificationChannelType!
required
Type of notification channel:
none - No notifications
sms - SMS messages
email - Email notifications
webhook - HTTP webhooks
telegram - Telegram messages
push_notification - Push notifications
Whether this channel is active
Channel-specific configuration (phone number, webhook URL, etc.)
Examples
query GetCurrentUser {
user {
id
email
}
}
Authentication
This query requires authentication. Include your JWT token in the request headers:
Authorization: Bearer YOUR_JWT_TOKEN
Use Cases
Profile Display
Display user information in your application:
const { data } = useQuery(GET_USER);
return (
<div>
<h1>Welcome, {data?.user?.email}</h1>
<p>User ID: {data?.user?.id}</p>
</div>
);
Notification Settings
Show user’s active notification channels:
const activeChannels = user.notificationChannels.nodes.filter(
channel => channel.isEnabled
);
return (
<ul>
{activeChannels.map(channel => (
<li key={channel.id}>
{channel.channelType} - Enabled
</li>
))}
</ul>
);
Verify Notification Setup
Check if the user has configured notification channels before creating price rules:
const hasNotifications = user.notificationChannels.nodes.some(
channel => channel.isEnabled && channel.channelType !== 'none'
);
if (!hasNotifications) {
// Prompt user to set up notifications
showNotificationSetupDialog();
}
Integration with Price Rules
User notification preferences work seamlessly with price rules:
query GetUserWithRules {
user {
id
email
notificationChannels {
nodes {
channelType
isEnabled
}
}
}
priceRules {
nodes {
id
name
notificationChannel
instrument {
symbol
}
}
}
}
Notification Channel Types
No notifications will be sent
SMS text messages to configured phone number
Email notifications to user’s email address
HTTP POST requests to configured webhook URL
Messages via Telegram bot
Push notifications to mobile devices
Privacy & Security
- User data is scoped to the authenticated user only
- Other users’ information is never exposed
- Email addresses are private and not shared
- Notification channel configurations may contain sensitive data (phone numbers, webhook URLs)