fenos / graphql-thinky

GraphQL & Relay powered by thinky / RethinkDB. https://graphql-thinky.readme.io/
MIT License
75 stars 10 forks source link

Issue with using apollostack/graphql-server. #10

Closed deep-c closed 7 years ago

deep-c commented 7 years ago

Hi @fenos, i have switched to using apollo-stacks graphql server (https://github.com/apollostack/graphql-server) implementation and im having a problem (im using "graphql-thinky": "^0.4.0-beta-3",). While the query does execute and i do get results back, the console is logging the following stacktrace:

TypeError: The loader.load() function must be called with a value,but got: undefined.
    at DataLoader.load (C:\Users\Deep\Projects\chat\node_modules\dataloader\dist\index.js:83:15)
    at ModelLoader.loadById (C:\Users\Deep\Projects\chat\node_modules\graphql-thinky\lib\dataloader\modelLoad
er.js:60:53)
    at Node._callee4$ (C:\Users\Deep\Projects\chat\node_modules\graphql-thinky\lib\node.js:325:31)
    at tryCatch (C:\Users\Deep\Projects\chat\node_modules\regenerator-runtime\runtime.js:62:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Deep\Projects\chat\node_modules\regenerator-r
untime\runtime.js:336:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\Deep\Projects\chat\node_
modules\regenerator-runtime\runtime.js:95:21)
    at step (C:\Users\Deep\Projects\chat\node_modules\graphql-thinky\lib\node.js:31:191)
    at C:\Users\Deep\Projects\chat\node_modules\graphql-thinky\lib\node.js:31:451
    at new Promise (C:\Users\Deep\Projects\chat\node_modules\core-js\modules\es6.promise.js:191:7)
    at Node.<anonymous> (C:\Users\Deep\Projects\chat\node_modules\graphql-thinky\lib\node.js:31:99)
    at Node.resolveWithLoaders (C:\Users\Deep\Projects\chat\node_modules\graphql-thinky\lib\node.js:370:20)
    at Node._callee3$ (C:\Users\Deep\Projects\chat\node_modules\graphql-thinky\lib\node.js:261:29)
    at tryCatch (C:\Users\Deep\Projects\chat\node_modules\regenerator-runtime\runtime.js:62:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Deep\Projects\chat\node_modules\regenerator-r
untime\runtime.js:336:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\Deep\Projects\chat\node_
modules\regenerator-runtime\runtime.js:95:21)
    at step (C:\Users\Deep\Projects\chat\node_modules\graphql-thinky\lib\node.js:31:191)
    at C:\Users\Deep\Projects\chat\node_modules\graphql-thinky\lib\node.js:31:451
    at new Promise (C:\Users\Deep\Projects\chat\node_modules\core-js\modules\es6.promise.js:191:7)
    at Node.<anonymous> (C:\Users\Deep\Projects\chat\node_modules\graphql-thinky\lib\node.js:31:99)
    at Node.resolve (C:\Users\Deep\Projects\chat\node_modules\graphql-thinky\lib\node.js:278:20)
    at _callee3$ (C:\Users\Deep\Projects\chat\node_modules\graphql-thinky\lib\resolver.js:156:27)
    at tryCatch (C:\Users\Deep\Projects\chat\node_modules\regenerator-runtime\runtime.js:62:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Deep\Projects\chat\node_modules\regenerator-r
untime\runtime.js:336:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\Deep\Projects\chat\node_
modules\regenerator-runtime\runtime.js:95:21)
    at step (C:\Users\Deep\Projects\chat\node_modules\graphql-thinky\lib\resolver.js:27:191)
    at C:\Users\Deep\Projects\chat\node_modules\graphql-thinky\lib\resolver.js:27:368
    at run (C:\Users\Deep\Projects\chat\node_modules\core-js\modules\es6.promise.js:87:22)
    at C:\Users\Deep\Projects\chat\node_modules\core-js\modules\es6.promise.js:100:28

I have setup the server using the following:

publicRouter.get('/graphiql', graphiqlKoa({ 
    endpointURL: '/graphql' 
}))
publicRouter.post('/graphql', graphqlKoa({ 
    schema: GraphQLSchema,
    context: {
        loaders: GT.getModelLoaders(),
    }  
}))

While i know this isnt much help, maybe you know exactly what the problem is. In the meantime ill try and figure out what might be causing the issue.

Thanks!

deep-c commented 7 years ago

Will close this for now as i may have jumped the gun. I think there might a problem with a couple of my models. Will open again once i know for certain.