New user questions on FreePBX GraphQL features

Hello,

I’ve read (1] and the various links this blog post contains (specifically [2]). Unfortunately, my testings failed which certainly comes from me being very new to GraphQL in general.

In FreePBX GraphQL Explorer tab, I first entered “gql” in Scope field (a non-empty Scope is required). Then I clicked over Reload Explorer button then the Right Arrow button above the simple “{ allModules { modules { name version } } }” content (ignoring indentation).

After doing this, I can read an error message in the right hand side: "Cannot query “allModules” on type “Query”.

I’m planning to later use a Python script (using gql package) to query FreePBX data.

  1. What shall I change to get a first successful GraphQL query ?
  2. Is there a doc describing headers to include in requests built with gql ?

Best regards

[1] https://www.freepbx.org/freepbx-graphql-provisioning-tutorial/

[2] https://www.freepbx.org/graphql-support-in-freepbx-15/

Did you see the HTTP API with Frogman? Might be worth a look.

May I add that, when using GrapQL Explorer, after entering “gql” in Scope field and clicking over Reload Explorer button, I’ve got some messages in red in right-side pane (see attachment file).

Does it point to an installation issue or mis-configuration ?

Shall I re-install from scratch ?

I’m still trying to get my first successful GraphQL request.

I’m now using a Python script. My script complains I’m using plain HTTP instead of HTTPS. Is HTTPS required when using GraphQL ?

This doesn’t exactly reply to my previous question but after

  1. enabling HTTPS support in FreePBX with default autosigned cert
  2. disabling cert verification in my script

I could get some response to my first GraphQL requests.

What still troubles me is that the example Query you can find all over the Internet does not work on my system (beside that GraphQL Explorer also output error/warning messages).

My question is very simple. On your FreePBX 17 instance, do you have success using the bellow example ?

query {
allModules {
modules {
name
version
}
}

}

Hi. I can’t speak to most of your questions, but that exact query does not seem to fit the schema on one of my FreePBX 17 systems:

The issue is this exact example is the one shown when introducing FreePBX capability and given by ChatGPT

I’m sure this example worked at some point in the past. It should be great to clarify this officialy.

I would be careful expecting every output from ChatGPT to just work, especially on more obscure API surfaces. At the very least, look through the documentation:

Here’s a community article that may helpful too: