Hi oTangVinhDuong! If I'm not mistaken, I believe Jose-Xu's problem was trying to access localhost:3000/graphql in a browser.
Since GraphQL relies on sending POST requests only, you will need to use a tool like Insomnia, Postman, or graphiql to view the query results.
To double-check everything is working, I just used Insomnia to send a POST request to localhost:3000/graphql/ using a GraphQL body with the following query:
query {
allOrders {
id
description
total
successfulPayments {
id
amount
status
}
}
}
I also confirmed that the query_type.rb file I used just now matches what is above--this is the code I just ran:
Hi oTangVinhDuong! If I'm not mistaken, I believe Jose-Xu's problem was trying to access localhost:3000/graphql in a browser.
Since GraphQL relies on sending POST requests only, you will need to use a tool like Insomnia, Postman, or graphiql to view the query results.
To double-check everything is working, I just used Insomnia to send a POST request to localhost:3000/graphql/ using a GraphQL body with the following query:
I also confirmed that the
query_type.rb
file I used just now matches what is above--this is the code I just ran:Let me know if you're still having issues, and I'll try to help as best I can! :)