# GitLab Emulator (service host) Create an instance: curl -s -X POST https://gitlab.emulators.dev/_emulate/instances # Hosted deployments create instances lazily when the returned URL is first used. The instance URL is a capability: anyone who has it can read and modify the instance, so save the returned URLs. Never store real secrets in an emulator. # The server generates an unguessable name. An optional {"instance":""} body adds a readable prefix. Then use the returned providerBaseUrl / controlBaseUrl. Example below uses a sample instance. # GitLab Emulator Stateful GitLab GraphQL API emulator carrying GitLab's full, real schema. Introspection and validation behave exactly like gitlab.com/api/graphql; a curated set of root fields return data. Provider base URL: https://gitlab.your-instance.emulators.dev Control base URL: https://gitlab.your-instance.emulators.dev/_emulate Supported surfaces: - GitLab GraphQL API: partial at /api/graphql Control endpoints: - https://gitlab.your-instance.emulators.dev/_emulate/manifest - https://gitlab.your-instance.emulators.dev/_emulate/coverage - https://gitlab.your-instance.emulators.dev/_emulate/connections - https://gitlab.your-instance.emulators.dev/_emulate/state - https://gitlab.your-instance.emulators.dev/_emulate/ledger - https://gitlab.your-instance.emulators.dev/_emulate/faults - POST https://gitlab.your-instance.emulators.dev/_emulate/credentials - POST https://gitlab.your-instance.emulators.dev/_emulate/seed - POST https://gitlab.your-instance.emulators.dev/_emulate/reset Fault injection: Arm a one-shot provider failure with a glob pathPattern, then inspect /ledger for faulted: true. curl -s -X POST https://gitlab.your-instance.emulators.dev/_emulate/faults \ -H "content-type: application/json" \ -d '{"match":{"method":"GET","pathPattern":"/v1/*"},"response":{"status":503,"body":{"error":"temporary"}}}' Connect: ## curl (metadata query) curl -s -X POST https://gitlab.your-instance.emulators.dev/api/graphql \ -H "content-type: application/json" \ -d '{"query":"{ metadata { version revision enterprise } }"}' ## GitLab GraphQL URL (env) GITLAB_GRAPHQL_URL=https://gitlab.your-instance.emulators.dev/api/graphql ## graphql-request (TypeScript) import { GraphQLClient, gql } from "graphql-request"; const client = new GraphQLClient("https://gitlab.your-instance.emulators.dev/api/graphql"); const data = await client.request(gql` query { metadata { version enterprise } } `); ## Base URL (env) GITLAB_BASE_URL=https://gitlab.your-instance.emulators.dev ## Create a credential curl -s -X POST https://gitlab.your-instance.emulators.dev/_emulate/credentials \ -H "content-type: application/json" \ -d '{"type":"bearer-token"}' ## Inspect requests curl -s https://gitlab.your-instance.emulators.dev/_emulate/ledger