icanhazdadjoke.com provides "dad jokes" structured as follows:
type Joke { id ID joke String permalink String }
You can request a joke and its id using curl:
curl -X POST -d '{"query": "query { joke {id joke } }"}' -H "Content-Type: application/json" https://icanhazdadjoke.com/graphql
The Altair tool provides a GUI Client to query GraphQL services.
https://icanhazdadjoke.com/graphql
and click Docs to retrieve the schema of the service.{ joke { id joke } }
Note: once you're satisfied with your request, you can copy it as a curl command using the bagage-case shapped icon on the left.
In case the Dad Joke service is not available, use the Countries service:
curl -X POST -d '{"query":"{\n country(code: \"FR\") {\n capital\n code\n currencies\n currency\n languages {\n code\n name\n native\n }\n }\n}\n","variables":{}}' -H "Content-Type: application/json" https://countries.trevorblades.com/graphql