Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hemulgm/graphql
GraphQL Query Constructor
https://github.com/hemulgm/graphql
delphi graphql
Last synced: 6 days ago
JSON representation
GraphQL Query Constructor
- Host: GitHub
- URL: https://github.com/hemulgm/graphql
- Owner: HemulGM
- License: mit
- Created: 2021-05-08T19:10:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-22T19:49:15.000Z (over 3 years ago)
- Last Synced: 2024-04-23T15:32:07.816Z (7 months ago)
- Topics: delphi, graphql
- Language: Pascal
- Homepage:
- Size: 16.6 KB
- Stars: 10
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GraphQL
GraphQL Query Constructor [only]```Pascal
GraphQL: TGraphQL;
Response: TJSONObject;
...
GraphQL := TGraphQL.Create(Self);
GraphQL.Client.BaseUrl := 'https:\\api.site.io';
if GraphQL.Call(Response, Query) = 200 then
...
``````Pascal
with TGraphQuery.Create('query', 'query_name') do
begin
AddMethod('bonuses',
//Args
TGraphArgList.Create
.AddPair('limit', 1)
.AddPair('offset', 0)
.AddPair('filter', TGraphArgObject.Create
.AddPair('branch_id', 1)
.AddPair('type', ''))
.AddPair('sort', TGraphArgObject.Create
.AddPair('field', 'name')
.AddPair('order', 'asc')),
//Fields
TGraphFields.Create
.AddField(TGraphField.Create('result'))
.AddField(TGraphField.Create('items')
.AddSub(TGraphField.Create('id'))
.AddSub(TGraphField.Create('date')))
.AddField(TGraphField.Create('totalCount')));
if GraphQL.Call(Response, Query) = 200 then
...
ShowMessage(Query.ToString);
Free;
end;
```