Skip to content

Developers · Users and Permissions

Accessing Authenticated User Data

Last updated 1 November 2026

This document guides you in accessing the information of authenticated users.

Prerequisites

To follow the steps in this tutorial, you must understand the required directory structure for your codebase and understand the concepts of pages, users, and GraphQL. In addition you must follow the previous tutorials in the Users section to have information regarding authenticated users stored and ready for access.

Steps

Accessing authenticated user data is a two-step process:

  • Step 1: Create a GraphQL query
  • Step 2: Fetch information from the GraphQL file

Step 1: Create a GraphQL query

app/graphql/current_user.graphql

query current_user {
  current_user {
    id
    slug
    first_name
    email
    profiles {
      profile_type
      id
    }
  }
}

returns a list with one entry for each profile the user has, for example developer or client. Read to tell them apart.

Step 2: Fetch information from the GraphQL file

On any given page (including the layout itself), you can add this liquid tag:

{% graphql g = 'current_user' %}

Be careful with adding queries to the layout.

This tag fetches information defined in the GraphQL file for the currently logged-in user and stores it in a variable named . The returned data is a standard hash so you can display it via .

Next steps

Congratulations! You know how to access the information of authenticated users. Now you can learn about sending an Email Notification to a newly signed-up user: Creating an Email Notification