Graphql query batching / dependant calls

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?

looks like the reload might be triggerable via:

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

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.
2 Likes

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