docs: function getReferencedTypenames(query_typename) {
          return getSchemaFromTypename(query_typename).then(function (load_file_result) {
              var validation = validateSchema(load_file_result.schema);
              var do_register = (validation.valid && (validation.errors.length == 0));
              var registered = false;
              if (do_register) {
                  registerSchema(load_file_result.schema);
                  registered = true;
              }
              var referencedTypenames_set = {};
              var lines = JSON.stringify(load_file_result.schema, null, 4).split("\n");
              for (var i in lines) {
                  var line = lines[i];
                  var m = line.match(exports.SCHEMA_ID_REF_REGEXP);
                  if (m != null) {
                      var typename = m[1];
                      referencedTypenames_set[typename] = true;
                  }
              }
              var referencedTypenames = Object.keys(referencedTypenames_set);
              var result = { typename: query_typename, referencedTypenames: referencedTypenames, validation: validation, registered: registered };
              return result;
          });
      }