Skip to content

Tutorial book-details is not working #3

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
StephanPraetsch opened this issue May 3, 2019 · 6 comments
Closed

Tutorial book-details is not working #3

StephanPraetsch opened this issue May 3, 2019 · 6 comments

Comments

@StephanPraetsch
Copy link

Hi there,

I'm playing with https://github.com/graphql-java/tutorials/tree/master/book-details but there's something broken:
It starts but does not provide the schema on http://localhost:8080/graphql instead it answers

There was an unexpected error (type=Bad Request, status=400).
Required String parameter 'query' is not present

Might you fix this? Or am I doing something wrong? I only cloned and started.

Kind regards
Stephan

@StephanPraetsch StephanPraetsch changed the title Tutorial is not working Tutorial book-details is not working May 3, 2019
@mlrgoh
Copy link

mlrgoh commented May 4, 2019

Hi Stephan,

Like you I was playing with the book-details tutoriaal and encountered similar issue too.

At first I thought the http:/localhost:8080/graphql endpoint comes with the GraphiQL UI, it doesn't seem like that is the case. That endpoint is purely a GraphQL API. So, you'll need to download GraphQL Playground and enter the http:/localhost:8080/graphql endpoint when asked. It works a treat!

The tutorial does provide the information. For some reasons, I missed it.

Hope this helps.

Cheers
Richard Goh

@StephanPraetsch
Copy link
Author

Gosh, thanks. I was pretty sure I tried this out. Obviously I didn't ...

But where does the schema and doc come from that GraphQL Playground is able to display?

@mlrgoh
Copy link

mlrgoh commented May 5, 2019

I'm new to GraphQL too. Good question. So, I did a bit of digging too.

Thanks to the benefit of GraphQL's Type System. We can actually ask the GraphQL schema for information about the queries it supports via introspection query. See https://graphql.org/learn/introspection/ for further details.

I tried the introspect query and it does work. Here is the example introspect query string:
curl localhost:8080/graphql?query=%7B__schema%20%7B%20types%20%7Bname%7D%20%7D%7D

@StephanPraetsch
Copy link
Author

Ah thanks a lot. I completely misinterprete the tutorial with that /graphql endpoint. Maybe someone should add some more detail how to get the schema. At least I was pretty confused.

@atulaa1
Copy link

atulaa1 commented Dec 25, 2020

Ah thanks a lot. I completely misinterprete the tutorial with that /graphql endpoint. Maybe someone should add some more detail how to get the schema. At least I was pretty confused.

I was confused too.
I recommend you use Altair client for grapql query from client. It support many platforms.
https://altair.sirmuel.design/
I used chrome extension for test my localhost grapql

@anamikabivera
Copy link

Postman has GrapghQL now.
After providing the query in GraphQl tab give a POST request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants