2026-01-15 11:04:37 +00:00
|
|
|
post:
|
|
|
|
|
tags:
|
|
|
|
|
- Flow Services
|
2026-02-23 15:56:29 +00:00
|
|
|
summary: Rows query - GraphQL over structured data
|
2026-01-15 11:04:37 +00:00
|
|
|
description: |
|
2026-02-23 15:56:29 +00:00
|
|
|
Query structured data using GraphQL for row-oriented data access.
|
2026-01-15 11:04:37 +00:00
|
|
|
|
2026-02-23 15:56:29 +00:00
|
|
|
## Rows Query Overview
|
2026-01-15 11:04:37 +00:00
|
|
|
|
2026-02-23 15:56:29 +00:00
|
|
|
GraphQL interface to structured data:
|
2026-01-15 11:04:37 +00:00
|
|
|
- **Schema-driven**: Predefined types and relationships
|
|
|
|
|
- **Flexible queries**: Request exactly what you need
|
|
|
|
|
- **Nested data**: Traverse relationships in single query
|
|
|
|
|
- **Type-safe**: Strong typing with introspection
|
|
|
|
|
|
2026-02-23 15:56:29 +00:00
|
|
|
Abstracts structured rows into familiar object model.
|
2026-01-15 11:04:37 +00:00
|
|
|
|
|
|
|
|
## GraphQL Benefits
|
|
|
|
|
|
|
|
|
|
Compared to triples query:
|
|
|
|
|
- **Developer-friendly**: Objects instead of triples
|
|
|
|
|
- **Efficient**: Get related data in one query
|
|
|
|
|
- **Typed**: Schema defines available fields
|
|
|
|
|
- **Discoverable**: Introspection for tooling
|
|
|
|
|
|
|
|
|
|
## Query Structure
|
|
|
|
|
|
|
|
|
|
Standard GraphQL query format:
|
|
|
|
|
```graphql
|
|
|
|
|
query OperationName($var: Type!) {
|
|
|
|
|
fieldName(arg: $var) {
|
|
|
|
|
subField1
|
|
|
|
|
subField2
|
|
|
|
|
nestedObject {
|
|
|
|
|
nestedField
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Variables
|
|
|
|
|
|
|
|
|
|
Pass variables for parameterized queries:
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"query": "query GetPerson($id: ID!) { person(id: $id) { name } }",
|
|
|
|
|
"variables": {"id": "https://example.com/person/alice"}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Error Handling
|
|
|
|
|
|
|
|
|
|
GraphQL distinguishes:
|
|
|
|
|
- **Field errors**: Invalid query, missing fields (in `errors` array)
|
|
|
|
|
- **System errors**: Connection issues, timeouts (in `error` object)
|
|
|
|
|
|
|
|
|
|
Partial data may be returned with field errors.
|
|
|
|
|
|
|
|
|
|
## Schema Definition
|
|
|
|
|
|
|
|
|
|
Schema defines available types via config service.
|
|
|
|
|
Use introspection query to discover schema.
|
|
|
|
|
|
2026-02-23 15:56:29 +00:00
|
|
|
operationId: rowsQueryService
|
2026-01-15 11:04:37 +00:00
|
|
|
security:
|
|
|
|
|
- bearerAuth: []
|
|
|
|
|
parameters:
|
|
|
|
|
- name: flow
|
|
|
|
|
in: path
|
|
|
|
|
required: true
|
|
|
|
|
schema:
|
|
|
|
|
type: string
|
|
|
|
|
description: Flow instance ID
|
|
|
|
|
example: my-flow
|
|
|
|
|
requestBody:
|
|
|
|
|
required: true
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
2026-02-23 15:56:29 +00:00
|
|
|
$ref: '../../components/schemas/query/RowsQueryRequest.yaml'
|
2026-01-15 11:04:37 +00:00
|
|
|
examples:
|
|
|
|
|
simpleQuery:
|
|
|
|
|
summary: Simple query
|
|
|
|
|
value:
|
|
|
|
|
query: |
|
|
|
|
|
{
|
|
|
|
|
person(id: "https://example.com/person/alice") {
|
|
|
|
|
name
|
|
|
|
|
email
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
user: alice
|
|
|
|
|
collection: research
|
|
|
|
|
queryWithVariables:
|
|
|
|
|
summary: Query with variables
|
|
|
|
|
value:
|
|
|
|
|
query: |
|
|
|
|
|
query GetPerson($id: ID!) {
|
|
|
|
|
person(id: $id) {
|
|
|
|
|
name
|
|
|
|
|
email
|
|
|
|
|
knows {
|
|
|
|
|
name
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
variables:
|
|
|
|
|
id: "https://example.com/person/alice"
|
|
|
|
|
operation-name: GetPerson
|
|
|
|
|
nestedQuery:
|
|
|
|
|
summary: Nested relationship query
|
|
|
|
|
value:
|
|
|
|
|
query: |
|
|
|
|
|
{
|
|
|
|
|
person(id: "https://example.com/person/alice") {
|
|
|
|
|
name
|
|
|
|
|
knows {
|
|
|
|
|
name
|
|
|
|
|
worksFor {
|
|
|
|
|
name
|
|
|
|
|
location
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
responses:
|
|
|
|
|
'200':
|
|
|
|
|
description: Successful response
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
2026-02-23 15:56:29 +00:00
|
|
|
$ref: '../../components/schemas/query/RowsQueryResponse.yaml'
|
2026-01-15 11:04:37 +00:00
|
|
|
examples:
|
|
|
|
|
successfulQuery:
|
|
|
|
|
summary: Successful query
|
|
|
|
|
value:
|
|
|
|
|
data:
|
|
|
|
|
person:
|
|
|
|
|
name: Alice
|
|
|
|
|
email: alice@example.com
|
|
|
|
|
knows:
|
|
|
|
|
- name: Bob
|
|
|
|
|
- name: Carol
|
|
|
|
|
extensions:
|
|
|
|
|
execution_time_ms: "42"
|
|
|
|
|
queryWithFieldErrors:
|
|
|
|
|
summary: Query with field errors
|
|
|
|
|
value:
|
|
|
|
|
data:
|
|
|
|
|
person:
|
|
|
|
|
name: Alice
|
|
|
|
|
email: null
|
|
|
|
|
errors:
|
|
|
|
|
- message: Cannot query field 'nonexistent' on type 'Person'
|
|
|
|
|
path: ["person", "nonexistent"]
|
|
|
|
|
systemError:
|
|
|
|
|
summary: System error
|
|
|
|
|
value:
|
|
|
|
|
data: null
|
|
|
|
|
error:
|
|
|
|
|
type: TIMEOUT_ERROR
|
|
|
|
|
message: Query execution timeout after 30s
|
|
|
|
|
'401':
|
|
|
|
|
$ref: '../../components/responses/Unauthorized.yaml'
|
|
|
|
|
'500':
|
|
|
|
|
$ref: '../../components/responses/Error.yaml'
|