Skip to content

Conversation

@alafon
Copy link
Contributor

@alafon alafon commented Jan 24, 2017

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Documented? no
Fixed tickets no
License MIT

This PR is a small improvement which will update the Symfony toolbar when using GraphiQL in dev mode.

body: JSON.stringify(params),
credentials: 'include',
}).then((res) => {
var xdebugToken = res.headers.get('X-Debug-Token')
Copy link
Contributor

@ooflorent ooflorent Jan 24, 2017

Choose a reason for hiding this comment

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

Cleaner approach:

if (typeof Sfjs !== 'undefined') {
  var xdebugToken = res.headers.get('X-Debug-Token')
  var toolbarElement = document.querySelector('sf-toolbar')
//                                 ^^^^
//                                 this
  Sfjs.load(toolbarElement.id, '/_wdt/' + xdebugToken)
}

@mcg-web
Copy link
Contributor

mcg-web commented Jan 24, 2017

Can you squash your commits please? Thank you for the contribution!

@alafon
Copy link
Contributor Author

alafon commented Jan 24, 2017

Squashed 😃

@mcg-web mcg-web merged commit eed88d8 into overblog:master Jan 24, 2017
@alafon alafon deleted the sf-toolbar branch January 24, 2017 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants