Graphql-playground: React Playground incompatbiel with react-redux v6+

Created on 3 Sep 2019  路  1Comment  路  Source: graphql/graphql-playground

This issue pertains to the following package(s):

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

When using React Playground v1.7.20 (also tried 22-test) with react-redux v6+, the following error is given

Uncaught Invariant Violation: Could not find "store" in either the context or props of "Connect(PlaygroundWrapper)". Either wrap the root component in a , or explicitly pass "store" as a prop to "Connect(PlaygroundWrapper)".

Playground is used as

import { Playground, store } from 'graphql-playground-react';
import React from 'react';
import { Provider } from 'react-redux';
import { graphQLUri, graphQLWsUri } from '../../GraphQL/endpoints';

export const GraphQLPlayground: React.FC = () => (
  <Provider store={store}>
    <Playground
      endpoint={graphQLUri}
      settings={{ 'request.credentials': 'same-origin' }}
      subscriptionEndpoint={graphQLWsUri}
    />
  </Provider>
);

Most helpful comment

Experiencing the same issue.

Currently works with [email protected], which resolves to version 5.1.2.

>All comments

Experiencing the same issue.

Currently works with [email protected], which resolves to version 5.1.2.

Was this page helpful?
0 / 5 - 0 ratings