README.md

## Debugging

### Step1: Start functions in debug mode

```
npm run debug
```

This starts functions in debug mode and exposes a websocket to attach the debugger:

> Debugger listening on ws://localhost:9229/658c753c-2e78-489d-9e43-2bb5aa0b364d

### Step2: Add the breakpoints in the file

NOTE: Breakpoints needs to be placed in dist folder files, not in the ts files within src.

### Step3: Attach to the debug

Now attach the vscode debugger to the function.

## GraphQL

### Online

On https://lucasconstantino.github.io/graphiql-online/ run the following:

### Local

Endpoint: http://localhost:8585/coco-india/asia-south1/api/private/graphiql

location: http://localhost:8585/coco-india/asia-south1/api/private/graphiql

### Getting recommendations

curl --location --request GET 'http://localhost:8585/coco-india/asia-south1/api/use/recommendations/'

or

```
{
  recommendations {
    popular {
      videoId
      weight
    }
    trending {
      videoId
      weight
    }
    latest {
      videoId
      weight
    }
    marvelous {
      videoId
      weight
    }
    lengthy {
      videoId
      weight
    }
    multistarrer {
      videoId
      weight
    }
  }
}
```

#### Getting comedians

```
{
  comedians {
    id
    name
    photoURL
  }
}
```

#### Getting comedian

```
query getComedian($comedianId: String!) {
  comedian(comedianId: $comedianId) {
    id
    name
    photoURL
  }
}
```

Query variable:

```
{
  "comedianId": "abhishek-upmanyu"
}
```

#### Setting active db

```
mutation UpdateActiveDb($id: Int!) {
  setActiveDb(id: $id) {
    id
  }
}
```

Query variable:

```
{
  "id": 1
}
```

## Issues

### Typescript build failure

https://github.com/DefinitelyTyped/DefinitelyTyped/issues/49595