Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console: update QueryAnalyzer to support subscriptions #4965

Merged
merged 9 commits into from
Jun 6, 2020
Merged

console: update QueryAnalyzer to support subscriptions #4965

merged 9 commits into from
Jun 6, 2020

Conversation

kolharsam
Copy link
Contributor

@kolharsam kolharsam commented Jun 2, 2020

this should resolve #2541

Description

Analyze button on GraphiQL will now display the analysis data for subscriptions too.

Changelog

  • CHANGELOG.md is updated with user-facing content relevant to this PR. If no changelog is required, then add the no-changelog-required label.

Affected components

  • Console

Related Issues

#2541

Solution and Design

The explain call for subscriptions returns an object unlike the same call for query. The solution is just to check whether an object, if so, then wrap the response in an array.

Breaking changes

  • No Breaking changes

@kolharsam kolharsam requested a review from beerose June 2, 2020 06:48
@kolharsam kolharsam requested review from a team as code owners June 2, 2020 06:48
@kolharsam kolharsam changed the title update QueryAnalyzer to support subscriptions console: update QueryAnalyzer to support subscriptions Jun 2, 2020
@netlify
Copy link

netlify bot commented Jun 2, 2020

Deploy preview for hasura-docs ready!

Built with commit 0976ac4

https://deploy-preview-4965--hasura-docs.netlify.app

@beerose beerose added the c/console Related to console label Jun 2, 2020
@hasura-bot
Copy link
Contributor

Review app for commit c7458fb deployed to Heroku: https://hge-ci-pull-4965.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4965-c7458fb9

@beerose beerose assigned kolharsam and unassigned beerose Jun 3, 2020
@hasura-bot
Copy link
Contributor

Review app for commit aa11a54 deployed to Heroku: https://hge-ci-pull-4965.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4965-aa11a546

Copy link
Member

@rikinsk rikinsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog + UX approved

@hasura-bot
Copy link
Contributor

Review app for commit 55eee20 deployed to Heroku: https://hge-ci-pull-4965.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4965-55eee20d

- renderAnalyzeText is now, a diff. component - AnalyzeText
- minor changes on QueryAnalyzer
@hasura-bot
Copy link
Contributor

Review app for commit c3afd20 deployed to Heroku: https://hge-ci-pull-4965.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4965-c3afd208

Copy link
Contributor

@beerose beerose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving some TypeScript related comments.


Let's add a type for explain data:

type ExplainPayload = {
  field: string;
  sql: string;
  plan: string[];
}

in console/src/components/Services/ApiExplorer/Analyzer/AnalyzeText.tsx and use it to type component's props:

type RootFieldsProps = { // I'm also changing the name of the component 
  data: ExplainPayload[];
  activeNode: number;
  onClick: React.MouseEvent<HTMLDivElement> // <- added generic argument here: HTMLDivElement
}

const RootFields: React.FC<RootFieldsProps> = {...} 

- fixed types on AnalyzeText
Copy link
Contributor

@beerose beerose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there!

@hasura-bot
Copy link
Contributor

Review app for commit ead51a0 deployed to Heroku: https://hge-ci-pull-4965.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4965-ead51a01

@hasura-bot
Copy link
Contributor

Review app for commit 935a65f deployed to Heroku: https://hge-ci-pull-4965.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4965-935a65f5

@hasura-bot
Copy link
Contributor

Review app for commit dba9886 deployed to Heroku: https://hge-ci-pull-4965.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4965-dba9886a

@hasura-bot
Copy link
Contributor

Review app for commit db92040 deployed to Heroku: https://hge-ci-pull-4965.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4965-db92040f

@rikinsk rikinsk merged commit d67757c into hasura:master Jun 6, 2020
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-4965.herokuapp.com is deleted

stevefan1999-personal pushed a commit to stevefan1999-personal/graphql-engine that referenced this pull request Sep 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/console Related to console
Projects
None yet
Development

Successfully merging this pull request may close these issues.

extend support for subscriptions in 'analyze'
4 participants