From 8c49783c122dc352e5bd14736cc3d85682343608 Mon Sep 17 00:00:00 2001
From: Alexander Rose <alex.rose@rcsb.org>
Date: Thu, 17 Jan 2019 16:19:07 -0800
Subject: [PATCH] wip, graphql schema gen (currently broken)

---
 data/rcsb-graphql/codegen.js   | 17 +++++++++++------
 data/rcsb-graphql/codegen.json |  4 +---
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/data/rcsb-graphql/codegen.js b/data/rcsb-graphql/codegen.js
index 65adefbd3..8982097ff 100644
--- a/data/rcsb-graphql/codegen.js
+++ b/data/rcsb-graphql/codegen.js
@@ -4,15 +4,20 @@ const path = require('path')
 const basePath = path.join(__dirname, '..', '..', 'src', 'mol-model-props', 'rcsb', 'graphql')
 
 generate({
-    args: [
+    schema: 'http://rest-dev.rcsb.org/graphql',
+    documents: [
         path.join(basePath, 'symmetry.gql.ts')
     ],
-    schema: 'http://rest-experimental.rcsb.org/graphql',
-    template: 'graphql-codegen-typescript-template',
-    out: path.join(basePath),
-    skipSchema: true,
+    generates: {
+        [path.join(basePath, 'types.ts')]: {
+            plugins: ['time', 'typescript-common', 'typescript-client']
+        }
+    },
+    // template: 'graphql-codegen-typescript-template',
+    // out: path.join(basePath),
+    // skipSchema: true,
     overwrite: true,
     config: path.join(__dirname, 'codegen.json')
 }, true).then(
-    console.log('done')
+    () => console.log('done')
 ).catch(e => console.error(e))
\ No newline at end of file
diff --git a/data/rcsb-graphql/codegen.json b/data/rcsb-graphql/codegen.json
index 3046d2483..999ad7af7 100644
--- a/data/rcsb-graphql/codegen.json
+++ b/data/rcsb-graphql/codegen.json
@@ -1,8 +1,6 @@
 {
     "flattenTypes": true,
     "generatorConfig": {
-        "printTime": true,
-        "immutableTypes": true,
-        "resolvers": false
+        "immutableTypes": true
     }
 }
\ No newline at end of file
-- 
GitLab