Skip to content

User Management Examples

Explore operations for creating, updating, and managing user accounts.

1. Register a New User

Create a new student account. This is the primary entrypoint for the registration funnel.

graphql
mutation RegisterUser($input: CreateUserInput!) {
  auth {
    createUser(input: $input) {
      success
      token
      expiresAt
      user {
        id
        email
        firstName
      }
      profileProgress {
        completionPercentage
      }
      eligibleScholarshipsCount
    }
  }
}

Variables:

json
{
  "input": {
    "email": "new.student@example.com",
    "password": "secure-password",
    "firstName": "John",
    "lastName": "Doe",
    "dateOfBirth": "2000-01-01T00:00:00Z"
  }
}

2. Update User Profile

Update the currently authenticated user's profile and account settings.

graphql
mutation UpdateProfile($input: UpdateUserInput!) {
  viewer {
    updateUser(input: $input) {
      success
      user {
        phone
        gender
      }
      updatedFields
    }
  }
}

Variables:

json
{
  "input": {
    "phone": "+1234567890",
    "gender": "male"
  }
}

3. Upload a Document

Upload a document (like a resume or transcript) to the user's profile. Note: File uploads in GraphQL use the Upload scalar and typically require a multipart/form-data request.

graphql
mutation UploadUserDocument($type: String!, $file: Upload!) {
  auth {
    uploadDocument(type: $type, file: $file) {
      id
      name
      url
      mimeType
    }
  }
}

4. Password Management

Request Password Reset

Triggers a password reset email.

graphql
mutation RequestPasswordReset($input: PasswordResetInput!) {
  auth {
    requestPasswordReset(input: $input)
  }
}

Change Password

Change the password for the currently authenticated user.

graphql
mutation ChangePassword($input: PasswordChangeInput!) {
  auth {
    changePassword(input: $input)
  }
}

5. Social Accounts

Link a social media account to the current user's profile.

graphql
mutation ConnectSocial($input: ConnectSocialAccountInput!) {
  auth {
    connectSocialAccount(input: $input) {
      user {
        socialAccounts {
          provider
        }
      }
    }
  }
}

OwlFlow Developer Portal