salesrender/plugin-component-api-client

SalesRender 插件 API 客户端组件

0.6.9 2024-01-17 07:15 UTC

This package is auto-updated.

Last update: 2024-09-17 09:00:48 UTC


README

\SalesRender\Plugin\Components\ApiClient\ApiClient - 组件,接受 API 端点 URL 和 API 令牌,允许对 salesrender.com 的 GraphQL API 进行查询。此组件底层使用 softonic/graphql-client GraphQL 客户端库

用法

例如,在您的插件应用程序中,您可以创建国际化类如下

<?php
$client = new \SalesRender\Plugin\Components\ApiClient\ApiClient('https://cluster.salesrender.com/companies/1/CRM', 'token here');

/** @var \Softonic\GraphQL\Response $response */
$response = $client->query('query {name, company}');

print_r($response->getData());
print_r($response->getErrors());