An open API service indexing awesome lists of open source software.

https://github.com/rtorr/graphql-client


https://github.com/rtorr/graphql-client

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

        

# gql-lite

I had some simpe needs to request a graphql serer, so i made a simple libray.

## API (WIP)

```javascript
import { Gql, reducer } from 'gql-lite/reducer';

const graphql = new Gql({ url: 'http://localhost:4000/graphql' });

graphql.store.subscribe(_ => {
console.log(graphql.store.getState().gclient.toJS());
});

graphql.query(`
{
test_one: locale(lang: "en-us") {
foo
}
test_two: locale(lang: "en-us") {
bar
}
}
`);

setInterval(
function() {
graphql.run();
},
1000
);
```