Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Avendaosander/Plataforma-social/llms.txt

Use this file to discover all available pages before exploring further.

The Plataforma Social API exposes three read queries. getUsers and getUser are general-purpose queries for fetching user data; login is a specialized query used exclusively by the NextAuth credentials provider to verify credentials during sign-in. All queries are sent as POST requests to /graphql — see the API Overview for request formatting details.

getUsers

getUsers: [User]
Returns an array of all registered users in the database. The array will be empty ([]) when no users exist. No arguments are required. Return type: [User]
FieldTypeDescription
idStringUUID of the user
usernameStringUnique display name
emailStringEmail address
descriptionStringOptional profile bio
avatarStringURL of the profile image

Example

query {
  getUsers {
    id
    username
    email
    description
    avatar
  }
}
Response:
{
  "data": {
    "getUsers": [
      {
        "id": "uuid-here",
        "username": "johndoe",
        "email": "john@example.com",
        "description": "Frontend developer",
        "avatar": "https://example.com/avatar.jpg"
      }
    ]
  }
}

getUser

getUser(id: String!): User
Fetches a single user by their UUID. Use this query whenever you need the full profile of a specific user. Parameters:
id
String
required
The UUID of the user to retrieve. This value is the id field returned by getUsers, postUser, or any other operation that returns a User.
Return type: User Errors:
CodeMessageCondition
NOT_FOUND (404)"Not found"No user exists with the provided id

Example

query GetUser($id: String!) {
  getUser(id: $id) {
    id
    username
    email
    description
    avatar
  }
}
Variables:
{
  "id": "uuid-here"
}
Response:
{
  "data": {
    "getUser": {
      "id": "uuid-here",
      "username": "johndoe",
      "email": "john@example.com",
      "description": "Frontend developer",
      "avatar": "https://example.com/avatar.jpg"
    }
  }
}

login

login(email: String!): UserWithSettings
Looks up a user by email address and returns their full profile together with their associated Setting record. This query is designed to be called from the NextAuth credentials provider authorize callback. It deliberately returns the hashed password field so that NextAuth can verify the supplied plain-text password with bcrypt.
This query is intended for server-side use inside NextAuth’s authorize function only. Never request the password field from client-side components or expose it in a client-facing query.
Parameters:
email
String
required
The email address of the user attempting to sign in. Looked up with an exact, case-sensitive match.
Return type: UserWithSettings
FieldTypeDescription
idStringUUID of the user
usernameStringUnique display name
emailStringEmail address
passwordStringbcrypt-hashed password — for server-side verification only
descriptionStringOptional profile bio
avatarStringURL of the profile image
SettingSettingThe user’s notification and privacy settings
Setting fields:
FieldTypeDescription
idSettingsStringUUID of the settings record
idUserStringUUID of the owning user
privateBooleanWhether the profile is private
n_ratingsBooleanIn-app notifications for ratings
n_commentsBooleanIn-app notifications for comments
n_followersBooleanIn-app notifications for new followers
n_populatesBooleanIn-app notifications for populates
n_email_ratingsBooleanEmail notifications for ratings
n_email_commentsBooleanEmail notifications for comments
n_email_followersBooleanEmail notifications for new followers
Errors:
CodeMessageCondition
NOT_FOUND (404)"El usuario no fue encontrado"No user exists with the provided email

Example

query Login($email: String!) {
  login(email: $email) {
    id
    username
    email
    password
    description
    avatar
    Setting {
      idSettings
      private
      n_ratings
      n_comments
    }
  }
}
Variables:
{
  "email": "john@example.com"
}
Response:
{
  "data": {
    "login": {
      "id": "uuid-here",
      "username": "johndoe",
      "email": "john@example.com",
      "password": "$2b$10$hashedpasswordstring",
      "description": "Frontend developer",
      "avatar": "https://example.com/avatar.jpg",
      "Setting": {
        "idSettings": "settings-uuid",
        "private": false,
        "n_ratings": true,
        "n_comments": true
      }
    }
  }
}

Build docs developers (and LLMs) love