til

Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Using curl with GraphQL server

I have just started playing around with GraphQL and I just wanted to find out how you could use curl for testing GraphQL APIs.

curl 'https://countries.trevorblades.com/' \
  -X POST \
  -H 'content-type: application/json' \
  --data '{ "query": "{ continents { code name } }" }'

Resources and References

  1. Blog post by Max Ivanov
  2. GitHub example
  3. Example GraphQL APIs