Example Queries

Below are example GraphQL queries for each major data type (calls, signals, and documents). These examples demonstrate how to retrieve data along with related fields like participants or metadata. You can run these queries against the GraphQL endpoint (replacing variables or IDs with real values) to test and get a feel for the responses. Each query is annotated with what it’s fetching:

Example 1: Fetching Recent Calls with Participants

The following query retrieves a list of recent calls in your organization, including each call’s basic info and its participants. It limits to 5 calls and orders them by start time (most recent first). It also fetches the call type and the names of attendees.

query GetRecentCalls {
  interview(limit: 5, order_by: { started_at: desc }) {
    id
    name
    started_at
    type {
      name   # Call type/category name
    }
    attendees {
      person {
        first_name
        last_name
      }
    }
  }
}
  • Explanation: This query uses the interview field to list calls. We request id, name, and started_at for each call. The nested type selection fetches the call’s type name (if types are used in your setup). The attendees.person nested selection fetches each participant’s first and last name. The result will be an array of up to 5 calls, each with a list of attendees. If you need more calls, adjust the limit or use pagination.

Example 2: Fetching Signals for a Call (with Context and Topics)

This query fetches all signals (extractions) for a specific call, given its ID. It retrieves details about each signal, including the summary, context snippet, timestamps, and associated type and topics. It also includes the speaker who said it (participant name).

query GetSignalsForCall($callId: bigint!) {
  extraction(where: { interview_id: { _eq: $callId } }, order_by: { start_sec: asc }) {
    id
    summary            # Short summary of the signal
    context            # Transcript context around the signal
    start_sec
    end_sec
    types {
      type {
        name           # Name of the signal type (e.g., "Pain Point")
      }
    }
    topics {
      topic {
        text           # Topic text (e.g., "Pricing")
      }
    }
    attendee {
      person {
        first_name
        last_name
      }
    }
  }
}
  • Explanation: We use a variable $callId to filter extraction records for a specific call. The query returns signals sorted by their occurrence time in the call. For each signal, we get the summary and context text. We also get start_sec and end_sec which indicate when in the call the signal happens. The types array gives the category of the signal, and topics gives any tagged topics. Finally, attendee.person provides the name of the participant who spoke that signal’s content. This query is useful to display a timeline of important points in a call along with who said them and what they are about.

Note: Replace $callId with the actual call ID you want to inspect. If running via a GraphQL client, provide callId in the query variables. Only signals from calls you have access to will be returned (others are filtered out by the server’s permissions).

Example 3: Fetching a Document with Source Calls

This query retrieves a specific document by ID, including its content, status, creator, and any source calls that were used to generate it. This is useful for getting an AI-generated summary and knowing which calls it covers.

query GetDocumentDetails($docId: bigint!) {
  document_by_pk(id: $docId) {
    id
    name
    status
    content            # Full text content of the document (e.g., summary text)
    created_at
    creator {
      person {
        first_name
        last_name
      }
    }
    input_data {
      call {
        id
        name
        started_at
      }
    }
  }
}
  • Explanation: We use the document_by_pk field to fetch a single document by its primary key (ID). For that document, we request its name, status, and content. We also get the created_at timestamp and the creator (with the creator’s name). The input_data array is included to list any calls that contributed to this document. For each related call, we fetch its id, name, and started_at. If the document was created from multiple calls, you will see multiple entries in input_data. If it was from a folder, the call field would be null and a folder field might appear (not requested above for brevity).

To use this query, provide the document ID as the variable docId. The response will give you the document’s content and relevant metadata. For example, you can display the document’s title, status (e.g., Completed or Processing), who created it, and list the calls that were summarized to create it.

These examples can be modified as needed – you can request additional fields or fewer fields depending on what you need for your application. Remember that GraphQL will only return the fields you ask for, so omitting fields can reduce payload size.