question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React - Is not possible to set custom settings in Playground component

See original GitHub issue

I’m trying to use this:

<Playground
          headers={headers}
          endpoint="/graphql"
          height="100%"
          settings={{
            'schema.polling.enable': false
          }}
        />

But the Playground still displaying ‘schema.polling.enable’ as true.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:8

github_iconTop GitHub Comments

4reactions
tizmagikcommented, Nov 27, 2019

Here’s a programmatic workaround that works for me. It’s unfortunate we have to do it this way, but it works:

  import {
    getSettings,
    setSettingsString,
    store,
  } from "graphql-playground-react";

  // grab the redux store
  const state = store.getState();

  // get the current settings
  const settings = getSettings(state);

  // override defaults
  settings["request.credentials"] = "include";

  // dispatch settings string
  store.dispatch(setSettingsString(JSON.stringify(settings, null, 2)));
1reaction
yoshiakiscommented, Jul 12, 2019

@douglasmuraoka I can’t think of any work around to do that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React - Is not possible to set custom settings in Playground ...
I'm trying to use this: But the Playground still displaying 'schema.polling.enable' as true.
Read more >
SyntaxError: unknown: Namespace tags are not supported by ...
React's JSX doesn't support namespace tags. You can turn on the 'throwIfNamespace' flag to bypass this warning. import React from "react" ...
Read more >
Synchronizing with Effects - React Docs
Some components need to synchronize with external systems. For example, you might want to control a non-React component based on the React state,...
Read more >
Style React Components: 7 Ways Compared - SitePoint
There are a number of ways to style React components. Choosing the right method for styling components isn't a perfect absolute.
Read more >
CSS Variables for React Devs - Josh W Comeau
This tutorial shows how we can use them with React to create dynamic ... You can do things with CSS variables that are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found