@abtnode/client 中文文档教程

发布于 3年前 浏览 15 项目主页 更新于 3年前

ABT Node Client

将 webapp 连接到 Abt Node Daemon

Table of Contents

Development

升级代码的客户端库:你需要两个 shell

  1. start demo server
cd ../gql
node demo.js
  1. upgrade code
npm run upgrade

Install

npm i @abtnode/client -S
# OR
yarn add @abtnode/client

Usage

const AbtNodeClient = require('@abtnode/client');

const client = new AbtNodeClient('http://localhost:3030/api/gql');
console.log({
  queries: client.getQueries(),
  subscriptions: client.getSubscriptions(),
  mutations: client.getMutations(),
});

client.listBlocklets().then(console.log);

Debugging

  • If you are in Node.js: DEBUG=@abtnode/client node script.js
  • If you are in Browser: localStorage.setItem('DEBUG', '@abtnode/client')

Documentation

可以找到查询参数和响应结构:QUERIES.md

ABT Node Client

Client library to connect webapp to Abt Node Daemon

Table of Contents

Development

upgrade code: you need two shells

  1. start demo server
cd ../gql
node demo.js
  1. upgrade code
npm run upgrade

Install

npm i @abtnode/client -S
# OR
yarn add @abtnode/client

Usage

const AbtNodeClient = require('@abtnode/client');

const client = new AbtNodeClient('http://localhost:3030/api/gql');
console.log({
  queries: client.getQueries(),
  subscriptions: client.getSubscriptions(),
  mutations: client.getMutations(),
});

client.listBlocklets().then(console.log);

Debugging

  • If you are in Node.js: DEBUG=@abtnode/client node script.js
  • If you are in Browser: localStorage.setItem('DEBUG', '@abtnode/client')

Documentation

Query arguments and response structure can be found: QUERIES.md

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文