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

Fixed GraphQL Playground with custom configuration in production. #1495

Merged
merged 7 commits into from Aug 14, 2018

Conversation

nderscore
Copy link
Contributor

@nderscore nderscore commented Aug 6, 2018

This fixes issue #1386. Many thanks to @thinkjson for investigating and raising this issue, as well as the proposed solution.

This is an alternative to PR #1417. While that PR seeked to solve the issue by altering the playground configuration object to add a new option for enabling/disabling playground, this solution is more aligned with the existing configuration and (my) expectations about how it should behave.


Fixed support for GraphQL Playground with custom configuration in production environments.

  • Updated logic in createPlaygroundOptions to cast the playground option to a boolean
    if it is defined. Fall back to isDev logic only if undefined.
  • Updated unit test for partial graphql playground options to emulate a 'production'
    environment, mimicking the scenario that was broken before.

TODO:

  • Update CHANGELOG.md with your change (include reference to issue & this PR)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass

@ghost ghost added the 🪲 bug label Aug 6, 2018
@apollo-cla
Copy link

@nderscore: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@ghost ghost added the 🪲 bug label Aug 6, 2018
nderscore added a commit to nderscore/apollo-server that referenced this pull request Aug 6, 2018
@ghost ghost added the 🪲 bug label Aug 6, 2018
@nderscore
Copy link
Contributor Author

nderscore commented Aug 6, 2018

CircleCI tests are currently failing due to issues unrelated to this PR. Will rebase this branch once it's fixed on master.

Edit: Tests seem to be passing now.

…duction environments.

* Updated logic in `createPlaygroundOptions` to cast the `playground` option to a boolean
  if it is defined. Fall back to `isDev` logic only if undefined.
* Updated unit test for partial graphql playground options to emulate a 'production'
  environment, mimicking the scenario that was broken before.
@evans evans merged commit 412be20 into apollographql:master Aug 14, 2018
@evans
Copy link
Contributor

evans commented Aug 14, 2018

@nderscore Thank you so much! We'll get this out asap

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants