Fix GraphQL Playground DX/UX Issues
See original GitHub issueWhen we upgraded to Apollo Server 3, we went with the default switch to Apollo Sandbox replacing the old built-in GraphQL Playground.
This has led to a whole lot of DX/UX issues for people upgrading, for several reasons:
- You need to specifically set up CORS to allow the GraphQL server to respond to requests from the Apollo Sandbox domain (related issue: #6795)
- Apollo Sandbox does’t work in Safari
- You need to specifically configure cookie behaviour in Apollo Sandbox
- When you jump from signed-in in the Admin UI to Apollo Sandbox, you’re signed out, and need to sign in manually with the auth mutation
… and none of this is really intuitive, documented, or guided. It’s a real step backwards for Keystone, and the tradeoffs for the new Sandbox UX (once it’s all actually set up and working) really don’t seem worth it.
Spec below edited after conversation with @mitchellhamilton (below) where we made a call on the config spec
To fix this and roll it back to a better default experience, I propose we introduce a new config.graphql.playground: true | false | 'sandbox' = process.env.NODE_ENV === 'production'
config option where:
true
adds the old Playground config (instructions)false
disables the playground (i.e we pass no plugin config to ApolloServer)'apollo'
turns on the new Apollo Sandbox behaviour
Users can also set the playground
option to 'apollo'
and use config.graphql.apolloConfig
directly to control the behaviour themselves.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (6 by maintainers)
Top GitHub Comments
This is somewhat related to https://github.com/keystonejs/keystone/issues/6795
Reopening this because we missed the
request. credentials
setting: https://github.com/keystonejs/keystone/pull/6824#pullrequestreview-788842476