You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/09/01 22:38:20 UTC

[GitHub] [superset] AAfghahi opened a new pull request #16558: feat: Arash/dashboardql

AAfghahi opened a new pull request #16558:
URL: https://github.com/apache/superset/pull/16558


   ### SUMMARY
   This adds Dashboards as an object that you can query. 
   
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   ![Screen Shot 2021-09-01 at 4 36 32 PM](https://user-images.githubusercontent.com/48933336/131754475-7b96e251-1967-46b6-8d27-6b3acc929f2f.png)
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] hughhhh merged pull request #16558: feat: Arash/dashboardql

Posted by GitBox <gi...@apache.org>.
hughhhh merged pull request #16558:
URL: https://github.com/apache/superset/pull/16558


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] hughhhh commented on a change in pull request #16558: feat: Arash/dashboardql

Posted by GitBox <gi...@apache.org>.
hughhhh commented on a change in pull request #16558:
URL: https://github.com/apache/superset/pull/16558#discussion_r701278602



##########
File path: superset/views/schema.graphql
##########
@@ -16,7 +32,30 @@ type DatabaseResult {
     database: Database
 }
 
+type Slice {
+    slice_id: ID!
+    slice_name: String
+    datasource: String
+    description: String
+    owners: [Float]
+}
+
+type DashboardInfo {
+    id: ID!
+    dashboard_title: String
+    owners: [Float]
+    slices: [Slice]
+    published: Boolean
+}
+type DashboardInfoResult {
+    success: Boolean!
+    errors: [String]
+    dashboard: DashboardInfo
+}
+
+
 type Query {
     databases: DatabaseResult!
     database(databaseId: ID!): DatabaseResult!
+    dashboardInfo(dashboard_id: ID!): DashboardInfoResult!

Review comment:
       ```suggestion
    dashboard(dashboardId: ID!): DashboardInfoResult!
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] hughhhh commented on a change in pull request #16558: feat: Arash/dashboardql

Posted by GitBox <gi...@apache.org>.
hughhhh commented on a change in pull request #16558:
URL: https://github.com/apache/superset/pull/16558#discussion_r701280920



##########
File path: superset/views/graphql.py
##########
@@ -27,10 +44,25 @@ def resolve_database(obj, info, database_id):
     return payload
 
 
+def resolve_dashboardInfo(obj, info, dashboard_id):

Review comment:
       `dashboard`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] hughhhh commented on a change in pull request #16558: feat: Arash/dashboardql

Posted by GitBox <gi...@apache.org>.
hughhhh commented on a change in pull request #16558:
URL: https://github.com/apache/superset/pull/16558#discussion_r701279897



##########
File path: superset/views/graphql.py
##########
@@ -27,10 +44,25 @@ def resolve_database(obj, info, database_id):
     return payload
 
 
+def resolve_dashboardInfo(obj, info, dashboard_id):
+    dashboard = db.session.query(Dashboard).filter_by(id=dashboard_id).one()
+    try:
+        payload = {
+            "success": True,
+            "dashboard": dashboard.data,
+        }
+
+    except Exception as error:
+        payload = {"success": False, "errors": [str(error)]}
+    return payload
+
+
 query = ObjectType("Query")
 
 query.set_field("database", resolve_database)
 
+query.set_field("dashboardInfo", resolve_dashboardInfo)

Review comment:
       make this `dashboard`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] hughhhh commented on a change in pull request #16558: feat: Arash/dashboardql

Posted by GitBox <gi...@apache.org>.
hughhhh commented on a change in pull request #16558:
URL: https://github.com/apache/superset/pull/16558#discussion_r701278979



##########
File path: superset/views/schema.graphql
##########
@@ -16,7 +32,30 @@ type DatabaseResult {
     database: Database
 }
 
+type Slice {
+    slice_id: ID!
+    slice_name: String
+    datasource: String
+    description: String
+    owners: [Float]
+}
+
+type DashboardInfo {

Review comment:
       ```suggestion
   type Dashboard {
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org