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

Correct object handling in altair-static render function #1339

Merged

Conversation

codyfyi
Copy link

@codyfyi codyfyi commented Sep 3, 2020

Fixes #1338

This fixes an issue with how altair-static rendered stringified JSON objects. It was incorrectly rendering JSON objects by surrounding the stringified object with template string quotes (` ... `):

Expected: initialHeaders: {\\"X-GraphQL-Token\\":\\"asd7-237s-2bdk-nsdk4\\"},
Actual initialHeaders: `{\\"X-GraphQL-Token\\":\\"asd7-237s-2bdk-nsdk4\\"}`, (notice unwanted backticks)

In addition to the above fix, this PR also includes the initialSettings in the rendering which was previously missing.

Checks

  • Ran yarn test-build
  • Added initialHeaders and initialSettings options to test spec.
  • Tested altair-koa-middleware correctly rendered with initialHeaders and initialSettings.

Changes proposed in this pull request:

  • Fix altair-static JSON object rendering for injected script tag.
  • Add initialSettings option to init options in altair-static.

@welcome
Copy link

welcome bot commented Sep 3, 2020

👋🏾Thanks for opening this pull request! Please check out our contributing guidelines.👊🏾😁

@imolorhe
Copy link
Collaborator

imolorhe commented Sep 3, 2020

Hey @codeitcody, thanks for the PR. It's strange how this has gone under the radar for a while now. 😅

@imolorhe imolorhe merged commit 7121e3b into altair-graphql:staging Sep 3, 2020
@welcome
Copy link

welcome bot commented Sep 3, 2020

Congrats on merging your first pull request! 🙌🏾🎉🎊

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.

altair-static: initialSettings is not applied at init.
2 participants