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

RenderPageOptions.settings is ignored #741

Closed
5 tasks
kbajalc opened this issue Jun 18, 2018 · 5 comments
Closed
5 tasks

RenderPageOptions.settings is ignored #741

kbajalc opened this issue Jun 18, 2018 · 5 comments

Comments

@kbajalc
Copy link

kbajalc commented Jun 18, 2018

This issue pertains to the following package(s):

  • GraphQL Playground - Electron App
  • [*] GraphQL Playground HTML
  • [*] GraphQL Playground
  • GraphQL Playground Express Middleware
  • GraphQL Playground Hapi Middleware
  • GraphQL Playground Koa Middleware
  • GraphQL Playground Lambda Middleware

What OS and OS version are you experiencing the issue(s) on?

OSX

What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?

1.7.0

What is the expected behavior?

When providing RenderPageOptions.settings the page should open with those effective, instead of the default values.

    const options: RenderPageOptions = {
      endpoint: url,
      settings: {
        'general.betaUpdates': false,
        'editor.fontSize': 12,
        'editor.fontFamily': "'Menlo', 'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace'",
        'editor.theme': 'light',
        'editor.reuseHeaders': true,
        'request.credentials': 'omit',
        'tracing.hideTracingResponse': true,
      },
      version: playgroundVersion,
    };
    return renderPlaygroundPage(options);

What is the actual behavior?

The "settings" are ignored, the page always renders with the default settings, the served HTML actually contains the settings given in code. Tested with Chrome incognito window, not a browser caching issue. Once the page opens it is possible to changes the settings in browser.

What steps may we take to reproduce the behavior?

Just try to provide any settings to the renderPlaygroundPage or any of the middleware packages.

Please provide a gif or image of the issue for a quicker response/fix.

@mastercactapus
Copy link

I'm seeing this as well, trying the minimal page with 1.7.0

GraphQLPlayground.init(root, {
  endpoint: location.protocol + '//' + path,
  settings: {
    'request.credentials': 'same-origin'
  }
})

Settings seem to be ignored both with empty localStorage and after first load -- but can still be changed manually from the interface.

@danlannz
Copy link

danlannz commented Jul 2, 2018

it looks to be writing the settings to the DOM prior to client initialisation but is failing to hydrate the redux store settings from props

https://github.com/prismagraphql/graphql-playground/blob/62ecfdb658935a11391701835d15c66a06be68ad/packages/graphql-playground-react/src/components/GraphQLBinApp.tsx#L42-L51

@Type1J
Copy link

Type1J commented Sep 19, 2018

Any progress here?

@omgrief
Copy link

omgrief commented Sep 29, 2018

seeing this issue as well when configuring through apollo 2, would like to see this fixed

@huv1k
Copy link
Collaborator

huv1k commented Oct 28, 2018

It should be fixed, if its still problem please reopen.

@huv1k huv1k closed this as completed Oct 28, 2018
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

No branches or pull requests

6 participants