Cool. CoolQLCool

CoolQLCool (CQC) is an open source Graph QL server that allows you to turn websites into a Graph QL api. It's pretty tubular (I'm incredibly biased tho).

You can play around with it in graphiql. Or take a gander at the source on Github.

Example

Features

In order of how radical I think they are.

Possible Features

Some possible features that I'd like to see CQC have some day

Examples

Curl
curl -X GET -H "Content-Type: application/json" -d '{"query": "{   site(url: \"https://news.ycombinator.com\") {     titles: select(elem: \"tr.athing\") {       id: attr(name: \"id\")       numberOfLinks: count(elem: \".storylink\")       link: select(elem: \".storylink\") {         text         href         class         classList       }     }   } }"}' https://coolql.cool/graphql
Javascript
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.open('POST', 'https://coolql.cool/graphql');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.setRequestHeader('Accept', 'application/json');
xhr.onload = function () {
  console.log('data returned:', xhr.response);
}
xhr.send(JSON.stringify({ query: `{
  site(url: "https://news.ycombinator.com") {
    titles: select(elem: "tr.athing") {
      id: attr(name: "id")
      numberOfLinks: count(elem: ".storylink")
      link: select(elem: ".storylink") {
        text
        href
        class
        classList
      }
    }
  }
}` }));
Ruby
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("https://coolql.cool/graphql")

header = {'Content-Type': 'application/json'}
query = { query: '{
  site(url: "https://news.ycombinator.com") {
    titles: select(elem: "tr.athing") {
      id: attr(name: "id")
      numberOfLinks: count(elem: ".storylink")
      link: select(elem: ".storylink") {
        text
        href
        class
        classList
      }
    }
  }
}' }

http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, header)
request.body = query.to_json

response = http.request(request)
Made by Gavin, deployed on Now