Documentation
¶
Overview ¶
Package gqltypes holds hand-authored Go types that the generated genqlient client binds to (see genqlient.yaml `bindings`). They live outside the `gen` package so `gen` can import them without a cycle.
NodeWhereInput / NodePropertySort are bound rather than generated on purpose: NodeWhereInput is recursive (and/or/not reference it), and genqlient's per-field `omitempty` resolution across the two operations that use it (FindNodes, SearchNodes) is non-deterministic for a self-referential type — the `,omitempty` tag flips between codegen runs, which both breaks the wire contract and reds CI's codegen-freshness gate. Binding to these explicit structs pins the json tags, so every unset field is reliably OMITTED, never serialized as null. That omit-vs-null contract is load-bearing here: the server's leaf validation (#719) counts any operator key that is not `undefined` — an explicit null included — so a null would trip "a leaf must carry exactly one operator".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentTaskStallScheduleInput ¶ added in v0.23.0
type AgentTaskStallScheduleInput struct {
AssignmentMinutes json.RawMessage `json:"assignmentMinutes,omitempty"`
HostLapseCheckIns json.RawMessage `json:"hostLapseCheckIns,omitempty"`
HostReportTimeoutMinutes json.RawMessage `json:"hostReportTimeoutMinutes,omitempty"`
NoProgressMinutes json.RawMessage `json:"noProgressMinutes,omitempty"`
NotStartedMinutes json.RawMessage `json:"notStartedMinutes,omitempty"`
OwnerReactionMinutes json.RawMessage `json:"ownerReactionMinutes,omitempty"`
SessionEndGraceMinutes json.RawMessage `json:"sessionEndGraceMinutes,omitempty"`
}
AgentTaskStallScheduleInput is bound rather than generated (#864) because its wire contract has THREE states per field and genqlient's optional pointer has two: the server reads an OMITTED field as "keep the current value" and an explicit null as "return it to the platform default" (hadron-server #1706/#1863). Each field is a non-pointer json.RawMessage with omitempty: a nil (len 0) value is dropped from the wire, the 4-byte `null` survives as null, and a number is sent as itself — the same reasoning as NodeWhereInput's operands.
type AiServiceConfigTestOverride ¶ added in v0.35.0
type AiServiceConfigTestOverride struct {
Provider json.RawMessage `json:"provider,omitempty"`
Model json.RawMessage `json:"model,omitempty"`
APIKey json.RawMessage `json:"apiKey,omitempty"`
Endpoint json.RawMessage `json:"endpoint,omitempty"`
APIStyle json.RawMessage `json:"apiStyle,omitempty"`
Params json.RawMessage `json:"params,omitempty"`
}
AiServiceConfigTestOverride preserves omitted, explicit null and supplied values from an override document. Null restores defaults for style/endpoint/ params; omission uses the saved value. The server validates provider policy.
type CreateAgentTasksItemInput ¶ added in v0.35.0
type CreateAgentTasksItemInput struct {
// BlockedByPositions are the 1-based positions of other tasks in the same
// call that block this one. A nil pointer is omitted; an explicit empty list
// the file wrote is sent as [] (what the file said is what the server reads).
BlockedByPositions *[]int `json:"blockedByPositions,omitempty"`
Task json.RawMessage `json:"task"`
}
CreateAgentTasksItemInput is one task of a createAgentTasks call (server#2653, cor:agt:050:06, cli#1565).
Task is the item's CreateAgentTaskInput exactly as the batch file spelled it. It stays raw on purpose: the generated CreateAgentTaskInput marshals an absent optional field (description, source, startBy, status, tags, …) as an explicit null, and a batch item must keep an omitted key omitted — null reads "clear", absent reads "default". The command validates every key and value against the generated type before sending, so only a well-formed object reaches the wire. The json tags are the GraphQL field names, which is what the coverage matrix reads to count the fields as reached.
type NodePropertySort ¶
type NodePropertySort struct {
Path []string `json:"path"`
Field *NodeWhereColumn `json:"field,omitempty"`
As *NodeWhereCast `json:"as,omitempty"`
Direction *SortDirection `json:"direction,omitempty"`
}
NodePropertySort orders findNodes by the value at a properties/data JSON path (#719). path is required; the rest are optional and omitempty.
type NodeTypeList ¶ added in v0.38.0
type NodeTypeList = *[]string
NodeTypeList preserves omission versus an explicitly empty list. A nil pointer is omitted; a pointer to [] sends [], leaving validation to the server. genqlient's default []string with omitempty drops both (cli#1528).
type NodeWhereCast ¶
type NodeWhereCast string
NodeWhereCast is how a NodeWhere leaf's extracted value is typed before comparison (#719). Default text.
const ( NodeWhereCastText NodeWhereCast = "text" NodeWhereCastNumber NodeWhereCast = "number" NodeWhereCastDatetime NodeWhereCast = "datetime" NodeWhereCastBoolean NodeWhereCast = "boolean" )
type NodeWhereColumn ¶
type NodeWhereColumn string
NodeWhereColumn is the JSONB column a NodeWhere leaf reads (#719). Default properties.
const ( NodeWhereColumnProperties NodeWhereColumn = "properties" NodeWhereColumnData NodeWhereColumn = "data" )
type NodeWhereInput ¶
type NodeWhereInput struct {
And []*NodeWhereInput `json:"and,omitempty"`
Or []*NodeWhereInput `json:"or,omitempty"`
Not *NodeWhereInput `json:"not,omitempty"`
Field *NodeWhereColumn `json:"field,omitempty"`
Path []string `json:"path,omitempty"`
As *NodeWhereCast `json:"as,omitempty"`
Eq json.RawMessage `json:"eq,omitempty"`
Ne json.RawMessage `json:"ne,omitempty"`
In []json.RawMessage `json:"in,omitempty"`
Lt json.RawMessage `json:"lt,omitempty"`
Lte json.RawMessage `json:"lte,omitempty"`
Gt json.RawMessage `json:"gt,omitempty"`
Gte json.RawMessage `json:"gte,omitempty"`
Between []json.RawMessage `json:"between,omitempty"`
Exists *bool `json:"exists,omitempty"`
Contains json.RawMessage `json:"contains,omitempty"`
}
NodeWhereInput is a recursive structured predicate over a node's properties/data JSONB (#719). A node is EITHER a branch (exactly one of and/or/not) OR a leaf (a path plus exactly one operator). Every field is optional and carries `omitempty`, so an unset field is omitted from the wire rather than sent as null — see the package doc for why that matters.
The scalar operands are non-pointer json.RawMessage on purpose: an absent operand is a nil (len 0) RawMessage that omitempty drops, but an EXPLICIT JSON null operand (e.g. `--where '{"path":["archivedAt"],"eq":null}'`) unmarshals to the 4-byte `null` — non-empty, so it survives to the wire. A `*json.RawMessage` would collapse both to nil and silently drop a schema-legal `eq: null`, breaking the documented raw-JSON grammar parity.
type RegisterDefaultsInput ¶ added in v0.35.0
type RegisterDefaultsInput struct {
// MentionOnly is sent as {"mentionOnly": v} when Clear is false.
MentionOnly *bool `json:"mentionOnly,omitempty"`
// Clear sends an explicit null (reset to the platform defaults).
Clear bool `json:"-"`
}
RegisterDefaultsInput is bound rather than generated (cli#58 slice 2) because updateAgent's registerDefaults has THREE wire states and genqlient's optional pointer has two: omitted PRESERVES the Agent's register defaults, an object sets mentionOnly, and an explicit null CLEARS them to the platform defaults (hadron-server resolvers.mutation.agent.ts:873-875).
The variable is a *RegisterDefaultsInput with omitempty: a nil pointer is dropped from the wire (preserve); a non-nil pointer is always sent, and this type decides WHAT: Clear marshals as the 4-byte `null`, anything else as {"mentionOnly": <bool>} (mentionOnly omitted when nil, which the CLI never produces: --register-mention-only always carries a value). Ordinary nil+omitempty alone cannot express null, so omission can never turn into a clear and a clear can never be dropped.
func (RegisterDefaultsInput) MarshalJSON ¶ added in v0.35.0
func (r RegisterDefaultsInput) MarshalJSON() ([]byte, error)
MarshalJSON implements the three-state wire form described above.
type SortDirection ¶
type SortDirection string
SortDirection is the direction for a findNodes property-path sort (#719). Default asc.
const ( SortDirectionAsc SortDirection = "asc" SortDirectionDesc SortDirection = "desc" )