@cloudpss/http-client
v0.6.21
Published
Http client for CloudPSS APIs, providing REST, GraphQL and WebSocket helpers on top of `@cloudpss/fetch`.
Downloads
546
Readme
@cloudpss/http-client
Http client for CloudPSS APIs, providing REST, GraphQL and WebSocket helpers on top of @cloudpss/fetch.
Example
import { HttpClient, GqlVariable } from '@cloudpss/http-client';
const client = new HttpClient({ token: 'xxx' });
const data = await client.gql.query`
model(rid: ${GqlVariable('model/cloudpss/example', 'ResourceID!')}) {
rid
name
description
jobs
configs
}`;
const model = data.data.model;
// Do something with model...