2
0
bjorn 9 жил өмнө
parent
commit
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')