Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.example.compose
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ APP_COMMAND="npm run start"
PORT=8080
LOG_LEVEL="info"
CORS_ORIGIN="*"
# GraphQL query-cost limits (optional; conservative defaults shown)
GRAPHQL_MAX_DEPTH=10
GRAPHQL_MAX_ALIASES=15
GRAPHQL_MAX_TOKENS=1000
GRAPHQL_MAX_COST=5000
ENABLE_GRAPHIQL="true"
ENABLE_INTROSPECTION="true"
ENABLE_LOGGING="true"
Expand Down
4 changes: 4 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ The server reads config from environment variables. `PG_CONN` is the only requir
| `PORT` | `8080` | Port the GraphQL server listens on |
| `LOG_LEVEL` | `info` | `debug` \| `info` \| `warn` \| `error` |
| `CORS_ORIGIN` | `*` | CORS allowed origin |
| `GRAPHQL_MAX_DEPTH` | `10` | Max query selection-set nesting depth |
| `GRAPHQL_MAX_ALIASES` | `15` | Max aliases allowed in a single operation |
| `GRAPHQL_MAX_TOKENS` | `1000` | Max lexical tokens allowed in a query document |
| `GRAPHQL_MAX_COST` | `5000` | Max estimated query cost (depth/field heuristic) |
| `ENABLE_GRAPHIQL` | `false` | If `true`, serves the GraphiQL playground at `/` |
| `ENABLE_INTROSPECTION` | `false` | If `true`, allows GraphQL schema introspection |
| `ENABLE_LOGGING` | `false` | Enable request logging |
Expand Down
255 changes: 250 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
"@envelop/disable-introspection": "^5.0.0",
"@envelop/graphql-jit": "^6.0.1",
"@envelop/opentelemetry": "^5.0.0",
"@escape.tech/graphql-armor-block-field-suggestions": "^3.0.1",
"@escape.tech/graphql-armor-cost-limit": "^2.4.3",
"@escape.tech/graphql-armor-max-aliases": "^2.6.2",
"@escape.tech/graphql-armor-max-depth": "^2.4.2",
"@escape.tech/graphql-armor-max-tokens": "^2.5.1",
"@graphql-tools/executor-http": "^3.0.4",
"@graphql-tools/graphql-file-loader": "^8.1.2",
"@graphql-tools/load": "^8.1.2",
Expand Down
4 changes: 4 additions & 0 deletions src/envionment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ declare global {
PORT?: string;
PG_CONN: string;
CORS_ORIGIN?: string;
GRAPHQL_MAX_DEPTH?: string;
GRAPHQL_MAX_ALIASES?: string;
GRAPHQL_MAX_TOKENS?: string;
GRAPHQL_MAX_COST?: string;
ENABLE_LOGGING?: bool;
ENABLE_INTROSPECTION?: bool;
ENABLE_GRAPHIQL?: bool;
Expand Down
Loading
Loading