seed houses

This commit is contained in:
Eric Hulburd
2016-01-27 20:15:09 -06:00
parent 220ddfed19
commit e4513282f9
17 changed files with 159 additions and 14634 deletions

View File

@@ -4,24 +4,23 @@
* The first method defines the way we resolve an ID to its object.
* The second defines the way we resolve an object to its GraphQL type.
*/
import {
nodeDefinitions,
} from 'graphql-relay';
var {nodeInterface, nodeField} = nodeDefinitions(
(globalId) => {
var {type, id} = fromGlobalId(globalId);
if (type === 'PowerDatum') {
return getUser(id);
} else if (type === 'Widget') {
return getWidget(id);
} else {
return null;
}
return null;
},
(obj) => {
if (obj instanceof User) {
return userType;
} else if (obj instanceof Widget) {
return widgetType;
if (obj instanceof Array) {
return Array;
} else {
return null;
}
}
);
export {nodeInterface, nodeField};