ToolJet/ToolJet · warning · Error

Select one operation

Error message

Select one operation

What it means

Thrown by the Supabase plugin's run() method when queryOptions.operation is falsy. The method dispatches on operation to pick one of get_rows/create_row/update_row/delete_row/count_rows, so an empty operation leaves nothing to execute. It is a pre-execution user-input guard, not a Supabase API failure.

Source

Thrown at marketplace/plugins/supabase/lib/index.ts:23

  QueryOptions,
  Column,
  Filter,
  Sort,
  SupabaseClientType,
  SupabaseQueryError,
  SupabaseQueryResult,
  Response,
} from './types';
import { PostgrestFilterBuilder } from '@supabase/postgrest-js';

export default class Supabase implements QueryService {
  async run(sourceOptions: SourceOptions, queryOptions: QueryOptions, dataSourceId: string): Promise<QueryResult> {
    const supabaseClient = await this.getConnection(sourceOptions);
    const operation: string = queryOptions.operation;
    let result: SupabaseQueryResult;
    let error: SupabaseQueryError;
    try {
      if (!operation) throw new Error('Select one operation');
      const { get_table_name, create_table_name, update_table_name, delete_table_name, count_table_name } =
        queryOptions;
      const tableNameValues = {
        get_rows: get_table_name,
        create_row: create_table_name,
        update_row: update_table_name,
        delete_row: delete_table_name,
        count_rows: count_table_name,
      };
      if (!tableNameValues[operation]) throw new Error('Table name is required');
      let res: Response;
      switch (operation) {
        case 'get_rows':
          res = await this.getRows(queryOptions, supabaseClient);
          error = res.error;
          result = res.data;
          break;
        case 'create_row':

View on GitHub (pinned to 20602a8e10)

Solutions

  1. In the query editor, choose one of get_rows, create_row, update_row, delete_row, count_rows from the Operation dropdown.
  2. If operation is bound to a control, give that control a non-empty default value or guard it before run.
  3. When calling run() programmatically, always set queryOptions.operation to one of the five supported values before invoking.

Example fix

// before
const queryOptions = { get_table_name: 'users' };
await svc.run(sourceOptions, queryOptions, id); // throws 'Select one operation'

// after
const queryOptions = { operation: 'get_rows', get_table_name: 'users' };
await svc.run(sourceOptions, queryOptions, id);
Defensive patterns

Strategy: validation

Validate before calling

const SUPABASE_OPS = ['get_rows','create_row','update_row','delete_row','count_rows'];
function normalizeOp(qo) {
  const op = qo && qo.operation;
  if (!SUPABASE_OPS.includes(op)) throw new Error(`Select one operation: ${SUPABASE_OPS.join(', ')}`);
  return op;
}
// call before svc.run()
normalizeOp(queryOptions);

Type guard

function isSupabaseOperation(op): op is 'get_rows'|'create_row'|'update_row'|'delete_row'|'count_rows' {
  return ['get_rows','create_row','update_row','delete_row','count_rows'].includes(op);
}

Try / catch

try { await svc.run(src, qo, id); } catch (e) { if (/Select one operation/.test(e.message)) { /* prompt user to pick operation */ } else throw e; }

Prevention

When it happens

Trigger: A Supabase query is invoked where the operation dropdown was never set, or queryOptions.operation resolved to undefined/empty string (e.g. bound to a control whose value is blank). The guard `if (!operation) throw new Error('Select one operation')` fires before the table-name check and before any Supabase call.

Common situations: Newly created query in the editor before the user picks an operation; operation bound to a dropdown/checkbox that has no default; a programmatic/curl call that omits the operation key; a copied query template where the operation field was cleared.

Related errors


AI-assisted analysis of ToolJet/ToolJet@20602a8e10 (2026-08-13). Data as JSON: /api/errors/2923101b9afbcbbb. Report an issue: GitHub.