CLI CONFIGURATION · UPDATED NOV 29, 2026

CLI Configuration (gqless.config.cjs)

The GQless CLI reads project settings from gqless.config.cjs (or .js) at the repository root. Keeping introspection endpoints, scalar mappings, and output paths in one declarative file guarantees deterministic builds across local workstations and CI runners.

Example Configuration

/** @type {import('@gqless/cli').GQlessConfig} */
module.exports = {
  introspection: {
    endpoint: process.env.GRAPHQL_ENDPOINT || 'https://api.example.com/graphql',
    headers: {
      Authorization: `Bearer ${process.env.INTROSPECTION_TOKEN || ''}`,
    },
  },
  destination: './src/gqless/index.ts',
  subscriptions: false,
  javascriptOutput: false,
  scalarsEnumsHash: {
    DateTime: 'string',
    JSON: 'Record<string, unknown>',
    UUID: 'string',
  },
};

Key Options Explained

After updating your config, re-run codegen and verify runtime error handling in the GQlessError reference.