Skip to main content

API Configuration

Environment variables that control generated API behavior.

Type Visibility

Control which type variants are generated:

VariableDefaultDescription
ENDPOINT_GRAPHQL_SHOW_NODE_TYPEtrueGenerate Node types (with metadata)
ENDPOINT_GRAPHQL_SHOW_FLAT_TYPEtrueGenerate Flat types (data only)

Set to false to hide a type variant from the generated schema. Useful for public APIs where you only want Flat types.

Naming

VariableDefaultDescription
ENDPOINT_GRAPHQL_ADD_PROJECT_PREFIXtruePrefix type names with project name

When true, types are named {Project}{Table} (e.g., BlogPost). When false, types use only the table name (e.g., Post). Disable the prefix when each endpoint serves a single project and you want cleaner type names.

Federation

VariableDefaultDescription
ENDPOINT_GRAPHQL_FEDERATIONfalseEnable Apollo Federation support

When enabled, generated schemas include Federation directives for use in a federated gateway.

Performance

VariableDefaultDescription
ENDPOINT_MAX_QUERY_DEPTH10Maximum GraphQL query depth
ENDPOINT_MAX_QUERY_COMPLEXITY1000Maximum query complexity score

Example Configurations

Public API (simplified types)

ENDPOINT_GRAPHQL_SHOW_NODE_TYPE=false
ENDPOINT_GRAPHQL_SHOW_FLAT_TYPE=true
ENDPOINT_GRAPHQL_ADD_PROJECT_PREFIX=false

Result: clean types like Post, PostFlat, Product without project prefix or Node types.

Admin Interface (full types)

ENDPOINT_GRAPHQL_SHOW_NODE_TYPE=true
ENDPOINT_GRAPHQL_SHOW_FLAT_TYPE=true
ENDPOINT_GRAPHQL_ADD_PROJECT_PREFIX=true

Result: full type variants with project prefix for disambiguation.

Microservice (federated)

ENDPOINT_GRAPHQL_FEDERATION=true
ENDPOINT_GRAPHQL_ADD_PROJECT_PREFIX=true

Result: Federation-ready schema that can be composed with other services in an Apollo Gateway.