Apologies for posting here I cannot post in the DEV group.
Delphi 11.2
I am struggling to connect to FreePBX GraphQL with the following code
Syntax attempts for myQuery (all failed)
myQuery := '{"query": "{fetchInstalledModules {id }}"}';
myQuery := 'query:\fetchInstalledModules {id }';
myQuery := '{"query":"query{fetchInstalledModules{id}}","variables":{}}';
myQuery := '"query":"query{fetchInstalledModules{id}","variables":{}';
params.Add(myQuery) ;
memo1.Text := params.DelimitedText;
NetHTTPClient1.CustomHeaders['Content-Type'] := 'application/json';
NetHTTPClient1.CustomHeaders['Authorization'] := 'Bearer '+token;
memoLog.Lines.Text := NetHTTPClient1.Post('http://myDomain.com:83/admin/api/api/gql', params).ContentAsString;
{"errors":[{"message":"GraphQL Request must include at least one of those two parameters: \"query\" or \"queryId\"","status":false}]}
I have installed GraphQL for Delphi but the demo just shows loading from file. Can I call this from GraphQL for Delphi. If so what is the code please.
PS I am able to use query:\fetchInstalledModules {id } in Postman and get data returned so I know my token is working.