hasura-sdk

0.1.3 • Public • Published

Hasura SDK

const sdk = require('hasura-sdk');
 
sdk.init({
    endpoint: 'http://localhost:8080',
    adminSecret: 'your-secret',
});
 
/**
 * BASIC CALLS
 */
 
// Run plain SQL:
await sdk.query('SELECT NOW()');
 
// Run SQL with variable substitution:
await sdk.query({
    sql: 'SELECT * FROM table_name WHERE field_name = $value',
    binds: {
        value: 'foo',
    },
});
 
// Call any API method:
await sdk.call({
    type: 'xxx',
    args: { ... },
});
 
 
/**
 * CUSTOM CALLS
 * (full list in `lib/api.js`)
 */
 
// Track a table
await sdk.trackTable({
    schema: 'public',
    name: 'my_table',
});

Readme

Keywords

Package Sidebar

Install

npm i hasura-sdk

Weekly Downloads

0

Version

0.1.3

License

MIT

Unpacked Size

7.91 kB

Total Files

7

Last publish

Collaborators

  • marcopeg