leadvertex / plugin-component-api-client
此包已被弃用且不再维护。未建议替代包。
LeadVertex插件API客户端组件
0.6.6
2022-10-24 13:21 UTC
Requires
- php: >=7.4.0
- adbario/php-dot-notation: ^2.2
- leadvertex/plugin-component-guzzle: ^0.3
- softonic/graphql-client: ^1.2
- xakepehok/array-graphql: ^0.0.1
Requires (Dev)
- mockery/mockery: ^1.4
- phpunit/phpunit: 9
README
\Leadvertex\Plugin\Components\ApiClient\ApiClient
- 组件,该组件接受API端点URL和API令牌,允许向leadvertex.com的GraphQL API进行查询。此组件底层使用softonic/graphql-client GraphQL客户端库
用法
例如,在您的插件应用程序中,您可以创建国际化类如下
<?php $client = new \Leadvertex\Plugin\Components\ApiClient\ApiClient('https://cluster.leadvertex.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());