Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a New Project Settings #100

Open
idkjs opened this issue Jun 20, 2017 · 5 comments
Open

Creating a New Project Settings #100

idkjs opened this issue Jun 20, 2017 · 5 comments
Assignees
Labels

Comments

@idkjs
Copy link

idkjs commented Jun 20, 2017

Im wondering what node version, or whatever else I need to have set up to get a new project to run right. Also are we running create-graphql generate -tmlc Business in the root of the newly created project or from the directory we ran create-graphql init from? I assume new root but asking anyway.

Current Behavior

<!--- If describing a bug, tell us what happens instead of the expected behavior.
      Provide a screenshot when possible and full code sample -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
 …/yelpql-demo/yelpql  ⬢ 6.9.2  create-graphql generate -tmlc Business --schema Business

   create src/connection/BusinessConnection.js
🔥 Connection created!
events.js:160
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'forEach' of undefined
    at /Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:171:27
    at Array.forEach (native)
    at getSchemaFieldsFromAst (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:162:19)
    at Context.visitExpression (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:213:18)
    at Context.invokeVisitorMethod (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:344:49)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:196:32)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:246:25)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:204:20)
    at NodePath.each (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path.js:101:26)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:219:18)
events.js:160
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'forEach' of undefined
    at /Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:171:27
    at Array.forEach (native)
    at getSchemaFieldsFromAst (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:162:19)
    at Context.visitExpression (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:213:18)
    at Context.invokeVisitorMethod (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:344:49)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:196:32)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:246:25)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:204:20)
    at NodePath.each (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path.js:101:26)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:219:18)
events.js:160
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'forEach' of undefined
    at /Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:171:27
    at Array.forEach (native)
    at getSchemaFieldsFromAst (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:162:19)
    at Context.visitExpression (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:213:18)
    at Context.invokeVisitorMethod (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:344:49)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:196:32)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:246:25)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:204:20)
    at NodePath.each (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path.js:101:26)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:219:18)
(node:24310) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with status 1
(node:24310) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Exited with status 1
(node:24310) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Exited with status 1
 …/yelpql-demo/yelpql  ⬢ 6.9.2  cd
### Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->

Your Environment

software version
create-graphql 1.1.17
node 8.1.0
npm or yarn used npm.
macOS Sierra

I just ran a fresh project to document. Note in the screenshot that I ran create-graphql init on node 8.1.2 but then when you switch into the created directory, the node v changes to 6.9.2. Maybe this is the issue? Do we need to create from the same 6.9.2? If so, there should be an error there.
screen shot 2017-06-20 at 16 53 23

@JCMais
Copy link
Contributor

JCMais commented Jun 20, 2017

Can you post a Schema file that we can use to reproduce this issue?

@idkjs
Copy link
Author

idkjs commented Jun 20, 2017

I posted the file to this repo.

So I then added a Business and Review mongoose model to the models folder and ran create-graphql generate -tmlc Business --schema Business. It looks like its creating the connection first then dies. This is the output:

 …/tester/tester-gql  ⬢ 6.9.2  create-graphql generate -tmlc Business --schema Business
   create src/connection/BusinessConnection.js
🔥 Connection created!
events.js:160
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'forEach' of undefined
    at /Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:171:27
    at Array.forEach (native)
    at getSchemaFieldsFromAst (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:162:19)
    at Context.visitExpression (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:213:18)
    at Context.invokeVisitorMethod (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:344:49)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:196:32)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:246:25)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:204:20)
    at NodePath.each (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path.js:101:26)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:219:18)
events.js:160
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'forEach' of undefined
    at /Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:171:27
    at Array.forEach (native)
    at getSchemaFieldsFromAst (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:162:19)
    at Context.visitExpression (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:213:18)
    at Context.invokeVisitorMethod (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:344:49)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:196:32)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:246:25)
   events.js:160
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'forEach' of undefined
    at /Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:171:27
    at Array.forEach (native)
    at getSchemaFieldsFromAst (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:162:19)
    at Context.visitExpression (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:213:18)
    at Context.invokeVisitorMethod (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:344:49)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:196:32)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:246:25)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:204:20)
    at NodePath.each (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path.js:101:26)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:219:18)
 at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:204:20)
    at NodePath.each (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path.js:101:26)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:219:18)
(node:31999) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with status 1
(node:31999) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Exited with status 1
(node:31999) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Exited with status 1

@idkjs
Copy link
Author

idkjs commented Jun 20, 2017

Then I tried just creating the type from the mongoose model. Didnt works. Incidentally, this same schema runs in another project.

 …/tester/tester-gql  ⬢ 6.9.2  c3c3ab0a master  create-graphql generate -t Business --schema Business
events.js:160
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'forEach' of undefined
    at /Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:171:27
    at Array.forEach (native)
    at getSchemaFieldsFromAst (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:162:19)
    at Context.visitExpression (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:213:18)
    at Context.invokeVisitorMethod (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:344:49)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:196:32)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:246:25)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:204:20)
    at NodePath.each (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path.js:101:26)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:219:18)
(node:32529) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with status 1

@idkjs
Copy link
Author

idkjs commented Jun 20, 2017

I reran the process only now i switch nvm to 6.9.2. Same result.

 …/tester/tester-gql  ⬢ 6.9.2  c3c3ab0a master  cd ..           ✓  5357  17:09:36
 …/CODE/tester  ⬢ 8.1.2  nvm use 6.9.2                            ✓  5358  17:10:04
Now using node v6.9.2 (npm v3.10.9)
 …/CODE/tester  ⬢ 6.9.2  nvm install 6.9.2                        ✓  5359  17:10:27
v6.9.2 is already installed.
Now using node v6.9.2 (npm v3.10.9)
 …/CODE/tester  ⬢ 6.9.2  create-graphql init tester692            ✓  5360  17:10:52


                          `-/+o+/-
                         `+ooooooo/
                       `-+ooooooooo/-`
                   `.:+++::oo+++o+:/++/-.
         ...`   `-/++/-` -o+.   :o+. .:/++:.`  `...`
      `:++oo++:+++:.`   :o+.     -o+.   `-/++//++oo++-
      /oooooooo+.`     /o/`       .++-     `.ooooooooo-
      .+oooooo/`    `+o:            `+o:     .+oooooo/`
       `.:oo:.     .+o:              `/o/`    `./o+-`
         .oo`     .++-                `:o/`     -o+
         .oo`    -++.                   :o+.    -o+
         .oo`   :o+.                     -++.   -o+
         .oo`  :o/`                       -++-  -o+
         .oo``/o/`                         .+o- -o+
         .oo./o:                            `+o:-o+
       .:+oo+o/                              `+o+oo/-`
      +oooooooo++++++++++++++++++++++++++++++ooooooooo:
      -oooooooo+/-.```````````````````````.-/oooooooo+.
       .:++++:.:/++:-`                 `-/++:.-/+++/:`
                 `-/++/-`   `..``   `-/+/-.
                     .:+++:/oooo+::++/-`
                        `/ooooooooo.
                          /oooooo+-
                           `-:::-`


✓ GraphQL project tester692 created.
✓ Dependencies installed! 😎
✓ Your new project with GraphQL has been created! 🔥
 …/CODE/tester  ⬢ 6.9.2  cd tester                                ✓  5361  17:14:31
cd: no such file or directory: tester
 …/CODE/tester  ⬢ 6.9.2  ls                                     1 ↵  5362  17:14:44
tester-gql tester692
 …/CODE/tester  ⬢ 6.9.2  cd tester692                             ✓  5363  17:14:50
 …/tester/tester692  ⬢ 6.9.2  create-graphql generate -tmlc Business --schema Business
   create src/connection/BusinessConnection.js
🔥 Connection created!
events.js:160
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'forEach' of undefined
    at /Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:171:27
    at Array.forEach (native)
    at getSchemaFieldsFromAst (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:162:19)
    at Context.visitExpression (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:213:18)
    at Context.invokeVisitorMethod (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:344:49)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:196:32)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:246:25)
    at Visitor.events.js:160
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'forEach' of undefined
    at /Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:171:27
    at Array.forEach (native)
    at getSchemaFieldsFromAst (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:162:19)
    at Context.visitExpression (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:213:18)
    at Context.invokeVisitorMethod (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:344:49)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:196:32)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:246:25)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:204:20)
    at NodePath.each (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path.js:101:26)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:219:18)
events.js:160
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'forEach' of undefined
    at /Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:171:27
    at Array.forEach (native)
    at getSchemaFieldsFromAst (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:162:19)
    at Context.visitExpression (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/generators/utils.js:213:18)
    at Context.invokeVisitorMethod (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:344:49)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:196:32)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:246:25)
    at Visitor.PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:204:20)
    at NodePath.each (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path.js:101:26)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:219:18)
PVp.visitWithoutReset (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:204:20)
    at NodePath.each (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path.js:101:26)
    at visitChildren (/Users/devworx/.nvm/versions/node/v6.9.2/lib/node_modules/generator-graphql/node_modules/ast-types/lib/path-visitor.js:219:18)
(node:35321) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with status 1
(node:35321) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Exited with status 1
(node:35321) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Exited with status 1
 …/tester/tester692  ⬢ 6.9.2 

@sibelius
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants