title: Falcor: How to define a function in falcor's JSON Graph?
body: <p>I'm very interested in this Modal Layer Library --- Falcor. And I read the official document of Falcor, and in <a href="http://netflix.github.io/falcor/documentation/jsongraph.html" rel="nofollow">JSON Graph section</a>, a topic of <strong>The Abstract JSON Graph Operations</strong>, and when it is talking about <code>call</code> operation, I'm totally confused. Here is my code according the official example:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var jsonGraphObject = {
      todosById: {
          "44": {
              name: "get milk from corner store",
              addedAt: 29689724399,
              done: false,
              prerequisites: [{ $type: "ref", value: ["todosById", 54] }]
          },
          "54": {
              name: "withdraw money from ATM",
              addedAt: 15687384689,
              done: false,
              prerequisites: []
          }
      },
      todos: [
          { $type: "ref", value: ["todosById", 44] },
          { $type: "ref", value: ["todosById", 54] }
      ]
  };
  var model = new falcor.Model({
    cache: jsonGraphObject
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>Then the document showed me about how to use <code>call</code>:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>model.call(
      // callPath
      ["todos", "add"],
      // arguments
      ["pick up car from the shop"], 
      // refPaths
      [
          ["addedAt"]
      ],
      // thisPaths
      [
          ["length"]
      ])
      .then(console.log.bind(console))</code></pre>
  </div>
  </div>
  </p>
  
  <p>And the document just show me the result, but my code did not work, I totally do not know where is this <code>add</code> function, and I don't know how to define a function in Falcor's JSON Graph.</p>
  
  <p>I googled about it, but haven't get my answer.So is there any example or boilerplate project there? Thanks.</p>