Skip to content

GraphQL Playground CDN URL is not valid #2676

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

Closed
creekdrops opened this issue May 16, 2019 · 10 comments
Closed

GraphQL Playground CDN URL is not valid #2676

creekdrops opened this issue May 16, 2019 · 10 comments
Assignees
Labels

Comments

@creekdrops
Copy link

When starting a new project, and navigating to the endpoint, the following error is thrown in the console:

GET https://cdn.jsdelivr.net/npm/@apollographql/[email protected]/build/static/js/middleware.js net::ERR_ABORTED 404

GET https://cdn.jsdelivr.net/npm/@apollographql/[email protected]/build/static/css/index.css net::ERR_ABORTED 404

graphql:537 Uncaught ReferenceError: GraphQLPlayground is not definedat graphql:537

It appears that the url for the cdn is no longer valid, and needs to be updated to to

https://cdn.jsdelivr.net/npm/@apollographql/[email protected]/build/static/js/middleware.js
@creekdrops
Copy link
Author

For anyone else struggling with this, I learned that you can override the version of graphql-playground-react in your ApolloServer configuration like so.

const server = new ApolloServer({
  typeDefs,
  resolvers,
  playground: { version: '1.7.25' }
});

I'm not sure why 1.7.10 is no longer available in the CDN.

@tripndots
Copy link

I got this too. Changing the playground confirmed to fix it for me as well.

@Tahir500
Copy link

i am also getting same issue when i was update the apollo-server from 2.1.0 to 2.5.0

@jesse-holden
Copy link

same issue, took me a while to find this thread with the fix

@abernix
Copy link
Member

abernix commented May 16, 2019

Taking a look at this now, thank you for reporting it. I think I can have this fixed in a backwards compatible way pretty soon.

@abernix
Copy link
Member

abernix commented May 16, 2019

We (@trevor-scheer and I) believe we've resolved this problem for anyone affected by publishing @apollographql/[email protected] and letting the jsDelivr CDN pick it up naturally.

Anyone who had applied the fix above should be able to remove the playground: { version: '1.7.25' } workaround (thank you @gridviewdesign for sharing that!). I expect to release the new version of Playground (which also brings in all the recent changes from the official GraphQL Playground plus some additional tweaks we're experimenting with ourselves ✨) in Apollo Server 2.6.0 (tracked in #2669).

As to what happened, for anyone interested...

We previously hadn't published that specific version of @apollographql/graphql-playground-react, instead only publishing a version of @apollographql/graphql-playground-html (previously @1.6.6) which still leveraged the upstream [email protected].

New changes, which were necessary to make to the graphql-playground-react sub-package which were previously not necessary, required that we publish the first version of @apollographql/graphql-playground-react (in our own scope) with @apollographql/graphql-playground-html depending on that.

That would have been okay, however, apollo-server itself depended on a caret range semver-version (e.g. ^1.5.5) of @apollographql/graphql-playground-html, thus causing new installs (and updates, or those without package-lock.json files) to pick up the latest version. That's an oversight on our part, partly in due to a desire to maintain parity between official versions of graphql-playground-* packages and our fork with our changes.

To mitigate against this happening again, we'll be pinning the exact version in future apollo-server releases.

@abernix abernix closed this as completed May 16, 2019
@Siyfion
Copy link
Contributor

Siyfion commented May 17, 2019

@abernix I believe that this is still an issue in the currently available https://github.com/apollographql/fullstack-tutorial/ project.

As it's requesting: https://cdn.jsdelivr.net/npm/@apollographql/[email protected]/build/static/css/index.css

See here for discussion: https://spectrum.chat/apollo/apollo-server/graphql-playground-does-not-work-on-localhost-4000~fd431b61-5051-42f8-8bf9-c12a3ac64e10

@ramtob
Copy link

ramtob commented May 23, 2019

For anyone else struggling with this, I learned that you can override the version of graphql-playground-react in your ApolloServer configuration like so.

const server = new ApolloServer({
  typeDefs,
  resolvers,
  playground: { version: '1.7.25' }
});

I'm not sure why 1.7.10 is no longer available in the CDN.

This workaround did eliminate the error. However I am now getting a clipped schema view:

image

Any Ideas? Thanks.

@abernix
Copy link
Member

abernix commented May 27, 2019

Some folks have continued to 👍 this even after we thought we resolved it, but I think I have an idea of why so I've gone ahead and back-published an @apollographql/[email protected].

I'd recommend anyone running into this — including those using the fullstack-tutorial — update their apollo-server to 2.6.0-alpha.6. If it still happens after that, please open a new issue so we can continue to track this. Unfortunately, it's hard to track whether emotions are still coming in on an issue that's already been "resolved". 😄

(And I'll probably lock this issue in a couple days to get an accurate read on this!)

Thanks for those who have continued to report problems! (And @ramtob, please open a new issue?)

@ramtob
Copy link

ramtob commented May 28, 2019

@abernix It would seem too awkward to open a new issue for a problem in a workaround for another problem..

@apollographql apollographql locked and limited conversation to collaborators May 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants