Me

Current User Query

Audience: Programmer

Returns the user profile of the currently authenticated user, including tenant associations and role assignments.

Arguments

This query does not take any arguments.

Return Type

UserProfile! - The user profile of the currently authenticated user.

Usage Example

query {
  me {
    UserID
    Username
    Email
    FirstName
    LastName
    TenantID
    TenantName
    # Recommended: Use Tenants for multi-tenant access
    Tenants {
      ID
      Name
      Role
    }
    # Deprecated: Use Tenants instead
    AssignedRoles {
      Role
      TenantID
    }
  }
}

Response Example

Multi-Tenant Support

The me query now supports multi-tenant scenarios through the Tenants field:

  • Primary Tenant: The TenantID and TenantName fields represent the user's primary tenant

  • All Tenants: The Tenants array contains all accessible tenants with their respective roles

  • Role Isolation: Each tenant association has its own role assignment

Field Deprecation

The AssignedRoles field is deprecated. Use the Tenants field instead:

Common Use Cases

  • Session Initialization: Retrieve user profile on application startup

  • Tenant Selection: Display available tenants for user switching

  • Authorization: Check user roles for the active tenant

  • Profile Display: Show user information in the application header

  • Audit Context: Capture user details for logging

Security Notes

  • This query requires authentication

  • Returns only the profile of the authenticated user

  • Cannot be used to retrieve other users' profiles

  • Tenant data is filtered based on user permissions

Last updated

Was this helpful?