Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/graphql / src / deps / networkCache.ts
Size: Mime:

/**
 * @todo @fixme - may  be some issue with this somehow :o
 */

export function nocache(req) {
  if (isObj(req.query) && isTrue(req.query.nocache)) {
    return true
  } else {
    return false
  }
}

export function clearCache(req) {
  /**
   * @todo - this should clear the cache in api for the version
   *         used when updating from studio
   */
}

export function cacheResponse(res, body) {
  const hash = fromRequestToHash(res, '/apiproxy/')

  // require('fliplog').bold('caching ').data(hash).echo()
  // require('fliplog').bold('==================').data({ body }).echo()

  if (isErrorLikeResponse(body)) {
    console.error('response was error, not caching', body)
    return
  }
  // oneStorage.set(hash, body)
}