hasura/graphql-engine · error

version check: %w

Error message

version check: %w

What it means

A value used inside a boolean expression failed type checking against the field's expected type. This wraps the underlying typecheck::TypecheckError, so the actual mismatch details (expected vs provided type) are in the inner error.

Source

Thrown at cli/cli.go:720

		ec.Logger.Error("connecting to graphql-engine server failed")
		ec.Logger.Info("possible reasons:")
		ec.Logger.Info(
			"1) Provided root endpoint of graphql-engine server is wrong. Verify endpoint key in config.yaml or/and value of --endpoint flag",
		)
		ec.Logger.Info(
			"2) Endpoint should NOT be your GraphQL API, ie endpoint is NOT https://hasura-cloud-app.io/v1/graphql it should be: https://hasura-cloud-app.io",
		)
		ec.Logger.Info("3) Server might be unhealthy and is not running/accepting API requests")
		ec.Logger.Info("4) Admin secret is not correct/set")
		ec.Logger.Infoln()

		return errors.E(op, err)
	}

	// get version from the server and match with the cli version
	err = ec.checkServerVersion()
	if err != nil {
		return errors.E(op, fmt.Errorf("version check: %w", err))
	}

	// get the server feature flags
	err = ec.Version.GetServerFeatureFlags()
	if err != nil {
		return errors.E(op, fmt.Errorf("error in getting server feature flags %w", err))
	}

	ec.AddRequestHeaders(
		map[string]string{GetAdminSecretHeaderName(ec.Version): ec.Config.GetAdminSecret()},
	)

	ec.Config.HTTPClient.SetHeaders(ec.requestHeaders)

	// this populates the ec.Config.ServerConfig.HasuraServerInternalConfig
	err = ec.Config.GetHasuraInternalServerConfig(httpClient)
	if err != nil {
		// If config API is not enabled log it and don't fail

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Inspect the inner TypecheckError for expected vs actual type
  2. Coerce the literal to the field's declared type (and its format) before sending
  3. Validate filter payloads against the boolean expression schema before executing
  4. Check custom scalar formats (e.g. 'ISO8601') and serialize values accordingly

Example fix

# before
where: { published_at: { _gt: 1700000000 } }
# after
where: { published_at: { _gt: "2023-11-14T22:13:20Z" } }
Defensive patterns

Strategy: validation

Validate before calling

// Validate literal shape against the field type before sending
const ok = checkLiteral(fieldType, where[fieldName][op]);
if (!ok) throw new Error(`Invalid literal for ${fieldType.name}`);

Type guard

function isValidLiteral(type, v) { switch (type) { case 'Int': return Number.isInteger(v); case 'String': return typeof v === 'string'; default: return true; } }

Try / catch

try { execute(); } catch (e) { if (e?.code === 'ValueTypecheckError') coerceAndRetry(e.inner.expected, e.inner.actual); else throw e; }

Prevention

When it happens

Trigger: Passing a literal of the wrong shape/type in a filter value — e.g. a string where an Int is expected, a malformed UUID/datetime literal, or a JSON value not matching the comparison expression schema for the field's type.

Common situations: Client-generated filter literals with wrong JSON types; datetime/UUID formats not matching the configured format; enum values passed as raw strings when the expression type expects a specific representation.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/cf02eef8ce0012a0. Report an issue: GitHub.