-
Structure: A basic GraphQL query uses the syntax
query { ... }(ormutation { ... }for mutations). Inside, you list the fields you want to retrieve, and you can nest related fields. The response JSON will have the same shape as the fields you asked for. For example, to get a call’s name and start time, you might write:This query asks for thenameandstarted_atof the first call (more on theinterviewtype below). The result will contain those fields. -
Variables: Instead of hard-coding values in your queries (like IDs or filters), GraphQL variables let you write flexible queries. You define variables in the query signature, and provide their values separately in the request. For example, a query that fetches a specific call by ID using a variable:
In this query,
$callIdis a variable of typebigint!(an ID type used for calls). Thewherefilter uses_eq(equals) to match the call ID. When you send this query, you’d include a JSONvariablespayload such as:{ "callId": 12345 }. The API will substitute the variable and return the matching call. You can use variables for any dynamic value (IDs, search keywords, filters, etc.), which makes your queries reusable and safer. -
Filtering and Ordering: The API supports rich filtering on query fields. Inside a
whereclause, you can use operators like_eq(equals),_neq(not equals),_in,_ilike(case-insensitive pattern match), and many others. These correspond to SQL-like filters. For example, to filter documents by status you might usewhere: { status: { _eq: "completed" } }. You can also sort results using anorder_byargument on query fields. For example,order_by: { created_at: desc }will sort results by creation time in descending order. Pagination can be handled with limit/offset arguments – e.g.,limit: 10, offset: 0to get the first 10 results, then adjust offset for the next page. -
Schema Introspection: The GraphQL schema defines all available types, fields, and operations. You can introspect the schema (for example, using GraphiQL or Apollo Sandbox if provided, or by sending the special
__schemaintrospection query) to see the exact fields and types. Key types you’ll be interacting with includeinterview(calls),extraction(signals), anddocument. We’ll explain these in the Data Access section. Each of these types has fields and relationships you can query. For instance, theinterviewtype has relationships for participants, transcripts, etc., and thedocumenttype has relationships for its creator and any source calls.