GraphQL is well suited for Drupal since Drupal has a data schema that can be mapped to a schema for GraphQL. The GraphQL Drupal contributed project provides this mapping yet it is rapidly changing and has no documentation. Tutorials are quickly out of date. Some of the more recent changes are covered in this article. It expands on the Decoupled Drupal, GraphQL and React article.
drupal_add_js(drupal_get_path('module', 'mymodule') . '/mymodule.js');