Skip to content
Permalink
Browse files

Merge pull request #2121 from rafaqat/master

Relay 2.0.0 support
  • Loading branch information...
rmosolgo committed Mar 15, 2019
2 parents f9e3e7f + 7c3e222 commit 97b44156b4c4b01f3f486a859fd03ffeb1775ff6
Showing with 10 additions and 2 deletions.
  1. +10 −2 javascript_client/sync/prepareRelay.js
@@ -19,8 +19,16 @@ function prepareRelay(filenames) {
// Require the file to get values from the JavaScript code
var absoluteFilename = path.resolve(currentDirectory, filename)
var operation = require(absoluteFilename)
var operationBody = operation.text
var operationName = operation.name
var operationBody, operationName
// Support Relay version ^2.0.0
if (operation.params) {
operationBody = operation.params.text
operationName = operation.params.name
} else {
// Support Relay versions < 2.0.0
operationBody = operation.text
operationName = operation.name
}

// Search the file for the relayHash
var textContent = fs.readFileSync(filename, "utf8")

0 comments on commit 97b4415

Please sign in to comment.
You can’t perform that action at this time.