Skip to content

Braga has been retired. The next public testnet is coming in September 2026. Read the announcement →

toRpcSelect(selection?): RpcSelect

Defined in: src/query/selection.ts:97

Converts a SelectArg into the RPC select object.

Every field is opt-in — anything not explicitly selected is sent as false, including the key. Sending the full object rather than omitting the falses keeps what the SDK asked for legible in a request log, and pins the answer even if a node’s defaults change.

undefined or "*" selects everything.

"*" | Required<Pick<SelectionFields, "key">> & Partial<Omit<SelectionFields, "key">> | Required<Pick<SelectionFields, "payload">> & Partial<Omit<SelectionFields, "payload">> | Required<Pick<SelectionFields, "contentType">> & Partial<Omit<SelectionFields, "contentType">> | Required<Pick<SelectionFields, "attributes">> & Partial<Omit<SelectionFields, "attributes">> | Required<Pick<SelectionFields, "attributeSchema">> & Partial<Omit<SelectionFields, "attributeSchema">> | Required<Pick<SelectionFields, "creationFlags">> & Partial<Omit<SelectionFields, "creationFlags">> | Required<Pick<SelectionFields, "owner">> & Partial<Omit<SelectionFields, "owner">> | Required<Pick<SelectionFields, "creator">> & Partial<Omit<SelectionFields, "creator">> | Required<Pick<SelectionFields, "createdAt">> & Partial<Omit<SelectionFields, "createdAt">> | Required<Pick<SelectionFields, "updatedAt">> & Partial<Omit<SelectionFields, "updatedAt">> | Required<Pick<SelectionFields, "expiresAt">> & Partial<Omit<SelectionFields, "expiresAt">>

RpcSelect

If the selection asks for nothing.

toRpcSelect() // everything
toRpcSelect({ key: true }) // only the key
toRpcSelect({ attributes: { projectId: true } }) // one named attribute