Graphql query batching / dependant calls

freepbx
freepbx-15
development
Tags: #<Tag:0x00007ff2e985a848> #<Tag:0x00007ff2e985a708> #<Tag:0x00007ff2e985a5c8>

(Sholinaty) #1

Has anyone played around with Query batching / nesting dependant calls in a single Graphql API POST?

my goal here is:

  1. create an extension, via the addExtension API
  2. then update voicemail options with the enableVoiceMail call

the extension has to exist before I can run enableVoiceMail… but i’d much rather have a single API call (two calls, one post).

anyone done this before?

as a second question - anyone know if you can trigger an “Apply config” via graphql?


(Sholinaty) #2

looks like the reload might be triggerable via:

      doreload (input: {}) {
        message
        status
        transaction_id
      }
    }

(Sholinaty) #3

tested it out!
it successfully does ordered tasks!

for those of you playing along from home:

addExtension(
input: {
extensionId: "5998"
 name: "twoGraphq test"
 tech: "pjsip"
 outboundCid: ""
 email: "[email protected]"
 umEnable: false
 vmPassword: "5998"
 vmEnable: true
 maxContacts: "4"
 }
) {status message}
enableVoiceMail(
input:{ 
extensionId: "5998" 
password: "5998" 
email: "[email protected]" 
pager: "" 
saycid: false
envelope: false
attach: true 
delete: true 
})
{status message}
doreload (input: {})
{message status transaction_id}
} 

the above will:

  • create a pjsip extension, with max_contacts=4
  • update voicemail options, because why the heck not
  • trigger an Apply Config / reload so that your user is available and Live.

(system) closed #4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.