Apollo-server: GraphQL Playground settings do not get set

Created on 29 Sep 2018  路  6Comments  路  Source: apollographql/apollo-server

const server = new ApolloServer({
  playground: {
    settings: {
      'request.credentials': 'include',
    }
  },
  ...otherServerSettings
);

Go to your GraphQL Playground route, and notice that the settings are just default settings.

related to github.com/prisma/graphql-playground/issues/741

Adding this here as there appears to be a copy of graphql-playground-html under the @apollographql namespace, and will possibly need to be updated when they fix this.

has-reproduction

Most helpful comment

I have the same issue using the latest apollo-server-express 2.1.0

All 6 comments

I have the same issue using the latest apollo-server-express 2.1.0

I think they might have fixed this and related setting persistence issues in prisma/graphql-playground repo:
https://github.com/prisma/graphql-playground/pull/836

However, as @omgrief stated, there's a fork of playground under apollographql namespace (here?) that should pick up the new 1.8.0 release?

Hi - I made a PR for it here, hope someone in charge will merge it: https://github.com/apollographql/graphql-playground/pull/1

I'm still having this issue. I have created a reduced test case here: https://github.com/Binarytales/jubilant-octo-telegram

I originally posted this issue against graphql-playground directly here: https://github.com/prisma/graphql-playground/issues/791#issuecomment-455272999

I've done a bit more digging and with the help of @Huvik I think that this issue wasn't actually fixed in graphql-playground till this PR https://github.com/prisma/graphql-playground/pull/836 was released in version 1.8.0 (with 1.8.5 being that latest)

It looks like apollo-server is using 1.7.10: https://github.com/apollographql/apollo-server/blob/master/packages/apollo-server-core/src/playground.ts#L12

UPDATE: I'm still a bit confused about which versions of which packages have the needed fix and are or are not in use by various projects. However, for the benefit of future travellers stumbling across this thread I eventually discovered this post which was most illuminating: https://github.com/apollographql/apollo-server/pull/1855#issuecomment-432962624

I am still seeing this issue and have no workaround at the moment other than to wire up graphql-playground or graphiql manually. I am using [email protected] and @apollographql/[email protected]. Not being able to set 'request.credentials': 'include' means that this is unusable for my API which uses a session cookie for authentication.

Was this page helpful?
0 / 5 - 0 ratings