https://github.com/rtorr/graphql-client
https://github.com/rtorr/graphql-client
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rtorr/graphql-client
- Owner: rtorr
- Created: 2017-02-08T02:46:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-09T22:14:28.000Z (over 8 years ago)
- Last Synced: 2025-03-25T02:44:06.601Z (4 months ago)
- Language: JavaScript
- Size: 178 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
);
```