Skip to main content

Push data to a dataset

Important

The GraphQL Insights API is currently in Early Availability status for customers on the AWS-US cluster. For more information, see GraphQL API policy.

Once you have created a dataset, you can push data to it to populate its attributes.

You can push data before creating a metric, as the one does not depend on the other. Each use of the pushToVisualizationDataset API adds a single row of data to the dataset.

The shape, or schema, of the data you push must match the schema of the dataset. The field key of each item must match the original name of an attribute (that is, before the prefix and suffix were added—for example, region rather than data_region_string), and the value must be of the appropriate datatype.

Mutation

mutation pushToVisualizationDataset($in: PushToVisualizationDatasetInput!) {
pushToVisualizationDataset(input: $in) {
success
userErrors {
message
path
}
}
}

Variables

{
"in": {
"datasetId": "996e42eb-97b4-4d80-8201-6f377c31e745",
"revisionId": 1,
"productId": "12345a6b-c7d8-90e1-2f3g-45678h90i123",
"fields": [
{
"key": "my_product_dimension_a",
"value": "SOMETHING"
},
{
"key": "my_product_measure_b",
"value": "999"
}
]
}
}

Response

{
"data": {
"pushToVisualizationDataset": {
"success": true,
"userErrors": []
}
}
}

Was this page helpful?