Developing for the AJAX GraphQL API is very similar to developing for other endpoints. See Developing GraphQL APIs for Totara and Implementing GraphQL services for more details.
For more information about JavaScript API usage see the Tui front-end framework documentation.