Vincit / objection-graphql

GraphQL schema generator for objection.js
MIT License
307 stars 34 forks source link

Basic problem with standard Objection express-es6 example and objection-graphql #74

Closed AaronNGray closed 5 years ago

AaronNGray commented 5 years ago

Hi, I am new to objection.js and objection-graphql and have tried creating a basic test for objection-graphql based on the standard objection.js es6 example. I played with this before and went through quite a few errors which manifest as Node.js stack dump errors some more obvious than others but have come unstuck at this one. I have made a repo with it in :-

https://github.com/AaronNGray/objection-express-es6-graphql-test

I am getting the following error :-

C:\Users\aaron\Tests\objection-tests\express-es6>node objection-graphql.js
test
(node:27828) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'movies' of undefined
    at graphql.then.result (C:\Users\aaron\Tests\objection-tests\express-es6\objection-graphql.js:29:25)
    at internalTickCallback (internal/process/next_tick.js:77:7)
    at process._tickCallback (internal/process/next_tick.js:47:5)
    at Function.Module.runMain (internal/modules/cjs/loader.js:777:11)
    at executeUserCode (internal/bootstrap/node.js:342:17)
    at startExecution (internal/bootstrap/node.js:276:5)
    at startup (internal/bootstrap/node.js:227:5)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
(node:27828) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:27828) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Hopefully there is something stupid I have not seen.

AaronNGray commented 5 years ago

my mistake, but it would be nice to have standard examples that play nice for beginners !