Validate visualizations and provide errors via GraphQL
requested to merge 420684-validate-dashboard-visualizations-and-return-on-graphql-response into master
What does this MR do and why?
Adds backend validation of custom product analytics visualizations
How to set up and validate locally
- Setup the product analytics devkit according to the instructions
- Setup product analytics for your project according to the devkit instructions
- Setup a custom visualization for the project, and make it invalid according to the schema
- Setup a dashboard to use this custom visualization (one of the panels should have the invalid visualization you just created, i.e.
visualization: example_invalid_custom_visualization
) - Query GraphQL for any errors associated with the visualization, you should see your schema validation errors under the
errors
property
Invalid Visualization example
---
version: 1
type: DoesNotExistType
data:
type: cube_analytics
query:
measures:
- SnowplowTrackedEvents.uniqueUsersCount
limit: 100
timezone: UTC
filters: []
dimensions: []
timeDimensions: []
options: {}
Example GraphQL Query
query {
project(fullPath: "PROJECT_FULL_PATH") {
productAnalyticsDashboards {
nodes {
panels {
nodes {
visualization {
errors
}
}
}
}
}
}
}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #420684 (closed)
Edited by Allen Cook