how to call graphql api from javascript