diff --git a/falcor-router/falcor-router-tests.ts b/falcor-router/falcor-router-tests.ts
index 5f5bdca0e4..7358ab2e02 100644
--- a/falcor-router/falcor-router-tests.ts
+++ b/falcor-router/falcor-router-tests.ts
@@ -2,6 +2,7 @@
import falcor = require('falcor');
import Router = require('falcor-router');
+import falcorJsonGraph = require('falcor-json-graph');
new Router([]);
new Router([], {});
@@ -100,3 +101,76 @@ new Router([{
}
}]);
+new Router([{
+ route: 'todos.new',
+ call(callpath, args) {
+ return {path: 'json.todosById.1234.name', value: 'Buy cheese'};
+ }
+}]);
+
+new Router([{
+ route: 'todos.new',
+ call(callpath, args) {
+ return falcorJsonGraph.pathInvalidation('json.todos.length');
+ }
+}]);
+
+new Router([{
+ route: 'todos.new',
+ call(callpath, args) {
+ return [
+ falcorJsonGraph.pathInvalidation('json.todos.length'),
+ {path: 'json.todosById.1234.name', value: 'Buy cheese'}
+ ]
+ }
+}]);
+
+new Router([{
+ route: 'todos.new',
+ call(callpath, args) {
+ return new Promise((resolve, reject): void => {
+ resolve([
+ falcorJsonGraph.pathInvalidation('json.todos.length'),
+ {path: 'json.todosById.1234.name', value: 'Buy cheese'}
+ ]);
+ });
+ }
+}]);
+
+new Router([{
+ route: 'todos.new',
+ call(callpath, args) {
+ return {
+ paths: [['json', 'todosById', '1234', 'name']],
+ jsonGraph: {
+ json: {
+ todosById: {
+ 1234: {
+ name: 'Buy cheese'
+ }
+ }
+ }
+ }
+ };
+ }
+}]);
+
+new Router([{
+ route: 'todos.new',
+ call(callpath, args) {
+ return new Promise((resolve, reject): void => {
+ resolve({
+ paths: [['json', 'todosById', '1234', 'name']],
+ jsonGraph: {
+ json: {
+ todosById: {
+ 1234: {
+ name: 'Buy cheese'
+ }
+ }
+ }
+ }
+ });
+ });
+ }
+}]);
diff --git a/falcor-router/index.d.ts b/falcor-router/index.d.ts
index 22c7d6b91f..ca58618053 100644
--- a/falcor-router/index.d.ts
+++ b/falcor-router/index.d.ts
@@ -1,6 +1,6 @@
// Type definitions for falcor-router 0.4.0
// Project: https://github.com/Netflix/falcor-router
-// Definitions by: Quramy
+// Definitions by: Quramy and cdhgee
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///