소스 검색

List type;

bjorn 9 년 전
부모
커밋
ce29323be1
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 9 0
      types.lua

+ 9 - 0
types.lua

@@ -9,6 +9,15 @@ function types.nonNull(kind)
   }
 end
 
+function types.list(kind)
+  assert(kind, 'Must provide a type')
+
+  return {
+    __type = 'List',
+    ofType = kind
+  }
+end
+
 function types.scalar(config)
   assert(type(config.name) == 'string', 'type name must be provided as a string')
   assert(type(config.serialize) == 'function', 'serialize must be a function')