Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apollo-server returning GET query missing when playground is disabled

When I emulate production (aka, playground is disabled) and I go to my root, http://localhost:9000/ I receive the following response:

400 Bad Request

GET query missing

Is there a way to prevent this or a workaround to render other page?

I'm new with apollo. I'm using just apollo-server (no express). I will appreciate any help.

like image 663
Peter Avatar asked Apr 24 '26 02:04

Peter


1 Answers

With the default configuration for apollo-server-xxx, you need to send a POST request to the /graphql endpoint, with the request body a graphql string.

I had the same problem because I sent a GET request instead of POST.

like image 200
Sean Avatar answered May 03 '26 16:05

Sean



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!