# Scorecard Rule: No GraphQL-Gateway

A Lambda that evaluates if services are still calling graphql-gateway.

We need every service to be switched over to use graphql-router.

## Overview

This Lambda:

1. Fetches all services from the Datadog Software Catalog.
1. Fetches the apollographql-client-name records calling graphql-gateway in the last month: https://sonymusic-pde.datadoghq.com/logs?saved-view-id=4216241
1. If there's a match between List 1 and List 2, updates the corresponding Datadog Scorecard Rule with `FAIL`.

## Configuration

*   **`DD_SCORECARD_RULE_ID`**: Env var
*   **`DD_API_KEY`**: Secret (qa, prod) or env var (dev)
*   **`DD_APP_KEY`**: Secret (qa, prod) or env var (dev)

## Development

Uses `uv` for dependency management and `ruff` for linting.

```bash
# Update uv.lock file
make lockfile

# Format
make fmt

# Build and Test
make lint_and_test

# Run Locally
make up

# Invoke the function
curl --request POST \
    --url http://localhost:9000/2015-03-31/functions/function/invocations \
    --header 'Content-Type: application/json' \
    --data @tests/sample_event.json
```
