> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dropkit.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Drop Queries

> Query drops, get drop statistics, and retrieve drop details

## Drop Queries

Query drops and their related data using GraphQL.

## Basic Drop Queries

### Get Single Drop

Retrieve a specific drop by ID or shortcode.

```graphql theme={null}
query GetDrop($id: ID, $shortcode: String) {
  drop(id: $id, shortcode: $shortcode) {
    id
    title
    description
    claimedAmount
    maxAmount
    claimRate
    remainingBalance
    tokenBalance
    isActive
    status
    type
    claimType
    shortcode
    imageUrl
    createdAt
    updatedAt
    creator {
      id
      username
      displayName
    }
    token {
      id
      name
      symbol
      totalSupply
      address
    }
  }
}
```

**Variables:**

```json theme={null}
{
  "id": "drop_abc123"
}
```

**Response:**

```json theme={null}
{
  "data": {
    "drop": {
      "id": "drop_abc123",
      "title": "Community Token Drop",
      "description": "A drop for early supporters",
      "claimedAmount": "25000",
      "maxAmount": "100000",
      "claimRate": 25.0,
      "remainingBalance": "75000",
      "tokenBalance": "75000",
      "isActive": true,
      "status": "ACTIVE",
      "type": "TOKEN",
      "claimType": "REGULAR",
      "shortcode": "community-drop",
      "imageUrl": "https://example.com/drop-image.png",
      "createdAt": "2024-01-15T10:30:00Z",
      "updatedAt": "2024-01-15T10:30:00Z",
      "creator": {
        "id": "user_xyz789",
        "username": "creator123",
        "displayName": "Creator Name"
      },
      "token": {
        "id": "token_def456",
        "name": "Community Token",
        "symbol": "COMM",
        "totalSupply": "1000000",
        "address": "0x123abc..."
      }
    }
  }
}
```

### List Drops

Get multiple drops with filtering and pagination.

```graphql theme={null}
query GetDrops($creatorId: ID, $limit: Int, $offset: Int, $active: Boolean) {
  drops(
    creatorId: $creatorId
    limit: $limit
    offset: $offset
    active: $active
  ) {
    id
    title
    status
    type
    claimedAmount
    maxAmount
    claimRate
    claimCount
    isActive
    createdAt
    creator {
      username
      displayName
    }
    token {
      name
      symbol
    }
  }
}
```

**Variables:**

```json theme={null}
{
  "active": true,
  "limit": 10,
  "offset": 0
}
```

### Get My Drops

Retrieve all drops created by the authenticated user.

```graphql theme={null}
query GetMyDrops {
  myDrops {
    id
    title
    description
    status
    type
    claimedAmount
    maxAmount
    claimRate
    claimCount
    remainingBalance
    isActive
    shortcode
    imageUrl
    createdAt
    token {
      name
      symbol
      totalSupply
    }
    claims {
      id
      amount
      claimedAt
      user {
        username
        displayName
      }
    }
  }
}
```

### Get Recent Drops

Get the most recently created drops by the authenticated user.

```graphql theme={null}
query GetRecentDrops($limit: Int) {
  recentDrops(limit: $limit) {
    id
    title
    status
    type
    claimedAmount
    maxAmount
    claimRate
    estimatedValueUsd
    claimCount
    createdAt
    token {
      name
      symbol
    }
  }
}
```

## Drop Analytics

### Drop Dashboard Stats

Get comprehensive statistics for a specific drop.

```graphql theme={null}
query GetDropDashboardStats($dropId: ID!) {
  dropDashboardStats(id: $dropId) {
    totalClaims
    recentClaims
    claimRate
    totalAmount
    claimedAmount
    recentActivity {
      id
      type
      description
      timestamp
      metadata
    }
  }
}
```

**Variables:**

```json theme={null}
{
  "dropId": "drop_abc123"
}
```

**Response:**

```json theme={null}
{
  "data": {
    "dropDashboardStats": {
      "totalClaims": 250,
      "recentClaims": 15,
      "claimRate": 25.0,
      "totalAmount": "100000",
      "claimedAmount": "25000",
      "recentActivity": [
        {
          "id": "activity_1",
          "type": "claim",
          "description": "Alice claimed 100 tokens",
          "timestamp": "2024-01-15T15:30:00Z",
          "metadata": "{\"amount\": \"100\", \"txHash\": \"0x123...\"}"
        }
      ]
    }
  }
}
```

## Advanced Drop Queries

### Drop with Complete Relations

Get a drop with all its related data.

```graphql theme={null}
query GetDropWithRelations($id: ID!) {
  drop(id: $id) {
    id
    title
    description
    claimedAmount
    maxAmount
    claimRate
    remainingBalance
    tokenBalance
    isActive
    status
    type
    claimType
    shortcode
    imageUrl
    price
    supply
    estimatedValueUsd
    claimDeadline

    # Blockchain data
    dropObjectId
    adminCapId
    deploymentTxHash
    contractPackageId
    coinType

    # Relations
    creator {
      id
      username
      displayName
      bio
      avatar
    }

    token {
      id
      name
      symbol
      decimals
      totalSupply
      address
      description
      imageUrl
      status
      creator {
        username
        displayName
      }
    }

    claims(limit: 20) {
      id
      amount
      claimedAt
      txHash
      user {
        id
        username
        displayName
        avatar
      }
    }

    gatingConfig {
      id
      isActive
      rules {
        id
        key
        operator
        value
        description
      }
    }
  }
}
```

### Multiple Drops with Filters

Get drops with different filtering criteria.

```graphql theme={null}
query GetFilteredDrops {
  activeDrops: drops(active: true, limit: 10) {
    id
    title
    claimRate
    isActive
  }

  draftDrops: drops(active: false, limit: 5) {
    id
    title
    status
  }

  recentDrops: recentDrops(limit: 5) {
    id
    title
    createdAt
  }
}
```

## Error Handling

### Drop Not Found

```graphql theme={null}
query GetNonExistentDrop {
  drop(id: "nonexistent") {
    id
    title
  }
}
```

**Response:**

```json theme={null}
{
  "data": {
    "drop": null
  }
}
```

### Invalid Parameters

```graphql theme={null}
query GetDropsWithInvalidLimit {
  drops(limit: -1) {
    id
    title
  }
}
```

**Response:**

```json theme={null}
{
  "errors": [
    {
      "message": "Limit must be a positive integer",
      "locations": [{ "line": 2, "column": 3 }],
      "path": ["drops"]
    }
  ],
  "data": {
    "drops": null
  }
}
```

## Best Practices

### 1. Request Only Needed Fields

```graphql theme={null}
# Good: Request only what you need
query GetDropTitles {
  drops {
    id
    title
    status
  }
}

# Avoid: Requesting all fields when not needed
query GetAllDropData {
  drops {
    id
    title
    description
    claimedAmount
    maxAmount
    # ... many other fields
  }
}
```

### 2. Use Pagination

```graphql theme={null}
query GetDropsPaginated($limit: Int, $offset: Int) {
  drops(limit: $limit, offset: $offset) {
    id
    title
    createdAt
  }
}
```

### 3. Handle Null Values

```graphql theme={null}
query GetDropSafely($id: ID!) {
  drop(id: $id) {
    id
    title
    description
    token {
      name
      symbol
    }
  }
}
```

## Common Use Cases

### Dashboard Overview

```graphql theme={null}
query DashboardOverview {
  myDrops {
    id
    title
    status
    claimRate
    claimCount
    estimatedValueUsd
  }

  recentDrops(limit: 5) {
    id
    title
    createdAt
  }
}
```

### Drop Management

```graphql theme={null}
query DropManagement($dropId: ID!) {
  drop(id: $dropId) {
    id
    title
    status
    isActive
    claimedAmount
    maxAmount
    remainingBalance
    claimCount

    claims(limit: 10) {
      id
      amount
      claimedAt
      user {
        username
        displayName
      }
    }
  }
}
```

### Public Drop Display

```graphql theme={null}
query PublicDropDisplay($shortcode: String!) {
  drop(shortcode: $shortcode) {
    id
    title
    description
    imageUrl
    claimedAmount
    maxAmount
    claimRate
    isActive
    tokenAmount
    claimType

    token {
      name
      symbol
      decimals
    }

    creator {
      username
      displayName
      avatar
    }
  }
}
```
