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

Graph Inserts and Upserts #27

Closed
NotAmaan opened this issue Aug 24, 2018 · 1 comment
Closed

Graph Inserts and Upserts #27

NotAmaan opened this issue Aug 24, 2018 · 1 comment

Comments

@NotAmaan
Copy link
Collaborator

Since graph upsert and insert is a major and rather useful feature of objection.js, I think this module should also offer support for it.

I have it partially implemented in a privately maintained fork. I'll migrate the basic functionality over soon.

@Aerlin
Copy link

Aerlin commented Aug 28, 2018

The error message when not setting allowedInsert properly isn't very informative.

error: BadRequest: Error
    at new BadRequest (/project_path/node_modules/@feathersjs/errors/lib/index.js:86:17)
    at errorHandler (/project_path/node_modules/feathers-objection/lib/error-handler.js:48:25)
    at tryCatcher (/project_path/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/project_path/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/project_path/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/project_path/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/project_path/node_modules/bluebird/js/release/promise.js:689:18)
    at Async._drainQueue (/project_path/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/project_path/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/project_path/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)

Took me a moment to realize I hadn't updated allowedInsert when adding additional relationships to a model.

Anyway great work on the pull request. :)

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

No branches or pull requests

2 participants