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

Loading spinner when running editor queries and fetching the schema #61

Merged
merged 1 commit into from
Nov 30, 2015

Conversation

asiandrummer
Copy link
Contributor

A CSS-driven loading spinner when running editor queries and fetching the schema, in case they take a while. Shown in a result window and documentation explorer (since it needs a schema to be rendered).

@@ -199,6 +200,10 @@ export class GraphiQL extends React.Component {

componentDidMount() {
if (!this.state.schema) {
this.setState({
showSpinner: true
Copy link
Contributor

Choose a reason for hiding this comment

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

We should only show a spinner when there is an user-produced query to the server underway, not for the automated fetching of the schema. GraphiQL is still usable without a schema, just typeahead and linters are not yet enabled, that's fine.

This implementation also has a race condition where we could issue a query before the schema returns. The schema would return and turn off the spinner, but the query itself hasn't returned yet.

@leebyron
Copy link
Contributor

You should also squash your commits together. You can do that with rebase -i, and then push -f to update the PR

@asiandrummer asiandrummer force-pushed the spinner branch 2 times, most recently from 41540ec to 91cacea Compare November 30, 2015 19:07
@asiandrummer
Copy link
Contributor Author

screen shot 2015-11-25 at 3 01 34 pm

height: 36px;
width: 36px;
left: 50%;
transform: translate(-50%,-50%);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: space after the comma

asiandrummer added a commit that referenced this pull request Nov 30, 2015
Loading spinner when running editor queries and fetching the schema
@asiandrummer asiandrummer merged commit 4eb20af into master Nov 30, 2015
@asiandrummer asiandrummer deleted the spinner branch March 9, 2016 23:51
acao pushed a commit to acao/graphiql that referenced this pull request Jun 1, 2019
…babel-4.0.0

Update eslint-plugin-babel to the latest version 🚀
acao pushed a commit to acao/graphiql that referenced this pull request Jun 5, 2019
Remove unused test files from main package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants