bradleyboy / tuql

Automatically create a GraphQL server from a SQLite database or a SQL file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UnhandledPromiseRejectionWarning

mikeerickson opened this issue · comments

I am using Sqlite3 3.0.16 and am receiving this error on a very simple test database

> Reading schema from database.sqlite
(node:10397) UnhandledPromiseRejectionWarning: Error: Query fields must be an object with field names as keys or a function which returns such an object.
    at invariant (/Users/mikee/.config/yarn/global/node_modules/graphql/jsutils/invariant.js:18:11)
    at defineFieldMap (/Users/mikee/.config/yarn/global/node_modules/graphql/type/definition.js:353:54)
    at GraphQLObjectType.getFields (/Users/mikee/.config/yarn/global/node_modules/graphql/type/definition.js:310:44)
    at typeMapReducer (/Users/mikee/.config/yarn/global/node_modules/graphql/type/schema.js:208:25)
    at Array.reduce (<anonymous>)
    at new GraphQLSchema (/Users/mikee/.config/yarn/global/node_modules/graphql/type/schema.js:97:34)
    at Promise (/Users/mikee/.config/yarn/global/node_modules/tuql/dist/builders/schema.js:243:13)
    at <anonymous>
(node:10397) 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:10397) [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.

Please let me know if you still have issues with 1.7.0, and if so it'd be great if you could provide an example DB that fails.