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. This is the primary, safe way for players to mutate game state. Requires a valid token; only player-scope functions are invocable here.

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).