Skip to main content

gameModelInvoke

Invoke a studio-defined function against a 'self' container with JSON params. The server enforces the function's invoke policy (authority rule tree: owner_of_self / is_host / is_current_turn / is_participant / tier_feature / group_permission / grid_permission / condition), evaluates its expressions, atomically applies its declared property mutations, logs an event, and returns the result (return value + mutations applied, or success=false with an error message). Invoke-policy denials are gameplay verdicts, NOT exceptions: they return success=false with errorMessage and log a failure event (observable via gameModelEvents). Scope violations (calling a server-scope function as a non-admin, or an internal function directly) are misconfigurations and throw FORBIDDEN. THE POLICY APPLIES TO APP ADMINS TOO (since v1.89.0): a manage_apps holder is judged exactly like a player unless the input sets bypassPolicy=true, which is refused for anyone else, marks the result policyBypassed=true and is audit-logged. This is the primary, safe way for players to mutate game state. Requires a valid token; only player-scope functions are invocable here. RATE LIMITED per player per app, defaulting to 120 invocations per 10 seconds: over the limit the call is refused with extensions.code RATE_LIMITED, extensions.blame 'budget' (the caller's own budget — not a fault in the game's code and not a platform failure) and extensions.retryAfterMs. A client that awaits each response cannot reach the limit, because the per-call ceiling already bounds a serial caller well below it.

gameModelInvoke(
input: InvokeFunctionInput!
): GmInvokeResult!

Arguments

gameModelInvoke.input ● InvokeFunctionInput! non-null input

The app, the function name, the self container id, an optional session, and JSON-encoded params.

Type

GmInvokeResult object

The outcome of a gameModelInvoke call (return value, applied writes, and any error).