16 points · by Elof · 7y ago · 3 comments
curl 'https://api.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400&date=today'
I can deploy a bunch of code and then run curl -X POST -H "Content-Type: application/json" --data '{ "query": "{ hello, sun(lat: 36.7201600, long: -4.4203400, date: \"today\") { sunrise, sunset } }" }' <script-url>
Can someone explain why this is useful?Which in turn is an example of how GraphQL can serve to turn what can be many requests in a REST situation into one call.