Graphin
Isomorphic JavaScript GraphQL client
; const graphin = 'https://my.graphql.endpoint.com'; // Simple GraphQL querygraphin ; // List of users cached for a minutegraphin ; // Simple GraphQL mutationgraphin;
API
Graphin
new Graphin(endpoint, options, fetcher) ⇒ Param | Type | Description |
---|---|---|
endpoint | string |
GraphQL endpoint URL |
options | ``object | undefined`` |
options.cache | number |
Cache TTL in ms |
options.fetch | object |
Fetch options |
options.verbose | boolean |
Verbose mode. Default false |
fetcher | ``function | undefined`` |
Promise
graphin.query(url, options) ⇒ Makes GraphQL Query
Param | Type | Description |
---|---|---|
url | string |
GraphQL Query |
requestOptions | ``object | undefined`` |
requestOptions.cache | number |
Cache TTL in ms |
requestOptions.fetch | object |
Fetch options |
requestOptions.verbose | boolean |
Verbose mode. Default false |
string
graphin.getQueryURL(query) ⇒ Converts GraphQL query to URL
Param | Type | Description |
---|---|---|
query | string |
GraphQL Query |