# createProjectFavorite

```graphql
mutation CreateProjectFavorite($projectReference: ID!) {
  createProjectFavorite(projectReference: $projectReference) {
    id
    userId
    projectId
    createdAt
    project {
      id
      slug
      name
      description
      type
      systemManaged
      isClaimed
      features
      createdAt
      updatedAt
      publishedAt
      config
      disableMetaRobots
      providerId
      layoutId
      category
      isTemplate
      comingSoon
    }
  }
}
```

Adds the project to the caller's favorites and returns the favorite record; a repeat call returns the existing record. Requires project.read.

## Arguments

| Name               | Type | Required | Description                                                                       |
| ------------------ | ---- | -------- | --------------------------------------------------------------------------------- |
| `projectReference` | ID!  | Yes      | Project UUID, slug or domain. A repeat call returns the existing favorite record. |

## Variables

```json
{
  "projectReference": "string"
}
```

## Responses

| Status | Description                                         |
| ------ | --------------------------------------------------- |
| 200    | The ProjectFavorite! in data.createProjectFavorite. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation CreateProjectFavorite($projectReference: ID!) {\n  createProjectFavorite(projectReference: $projectReference) {\n    id\n    userId\n    projectId\n    createdAt\n    project {\n      id\n      slug\n      name\n      description\n      type\n      systemManaged\n      isClaimed\n      features\n      createdAt\n      updatedAt\n      publishedAt\n      config\n      disableMetaRobots\n      providerId\n      layoutId\n      category\n      isTemplate\n      comingSoon\n    }\n  }\n}",
  "variables": {
    "projectReference": "string"
  }
}'
```

## Example response

```json
{
  "data": {
    "createProjectFavorite": {
      "id": "string",
      "userId": "string",
      "projectId": "string",
      "createdAt": "2026-01-01T00:00:00Z",
      "project": {
        "id": "string",
        "slug": "string",
        "name": "string",
        "description": "string",
        "type": "string",
        "systemManaged": false,
        "isClaimed": false,
        "features": [
          "BASIC_SETTINGS"
        ],
        "createdAt": "2026-01-01T00:00:00Z",
        "updatedAt": "2026-01-01T00:00:00Z",
        "publishedAt": "2026-01-01T00:00:00Z",
        "config": {},
        "disableMetaRobots": false,
        "providerId": "string",
        "layoutId": "string",
        "category": "string",
        "isTemplate": false,
        "comingSoon": false
      }
    }
  }
}
```
