Comparing version 0.2.1 to 0.2.2
@@ -187,6 +187,8 @@ "use strict"; | ||
var info = ast_1.getOperationInfo(operation); | ||
var fieldType = queryType.getFields()[fieldName].type; | ||
var field = queryType.getFields()[fieldName]; | ||
var fieldType = field.type; | ||
var isSingle = graphql_1.isObjectType(fieldType) || | ||
(graphql_1.isNonNullType(fieldType) && graphql_1.isObjectType(fieldType.ofType)); | ||
var path = getPath(fieldName, isSingle); | ||
var hasIdArgument = field.args.some(function (arg) { return arg.name === 'id'; }); | ||
var path = getPath(fieldName, isSingle && hasIdArgument); | ||
router.get(path, useHandler({ info: info, fieldName: fieldName, sofa: sofa, operation: operation })); | ||
@@ -193,0 +195,0 @@ logger_1.logger.debug("[Router] " + fieldName + " query available at " + path); |
{ | ||
"name": "sofa-api", | ||
"description": "Create REST APIs with GraphQL", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "typings": "dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
104879
1703