CSV Formatting
Normally, a graph query will be returned as a nested JSON-serialized object graph. This representation truthfully maps the data to the structure of the query. Sometimes however, it’s more useful to retrieve the data as a 2D CSV table.
How to Request CSV Result
There are two ways to tell the graph query API that you want the result as csv:
- Add a
?format=csv
query parameter to the/resources/graph
endpoint request - Add a
Accept: text/csv
header in the/resources/graph
endpoint request
Limitations
When returning CSV, it’s important to understand the limitations:
- Only a single query can be included in the request
- For any navigations, only the first “many” navgiation on the same level will be expanded. If there are more, only the first node will be returned.
- Total count is only available of the root node
Pagination
The total count, as well as the first/last cursors are returned as HTTP headers:
Total-Count
- The total number of available nodes (only available if queried with"count": true
)First-Cursor
- The cursor of the first nodeLast-Cursor
- The cursor of the last node
Query Overrides
To simplify pagination, the after
and before
properties of the root query can be overridden using query parameters. This allows you to paginate without having to update the root query.
For example: