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

Missing documentation on insertGraph #121

Closed
vasilevich opened this issue Oct 8, 2020 · 1 comment
Closed

Missing documentation on insertGraph #121

vasilevich opened this issue Oct 8, 2020 · 1 comment

Comments

@vasilevich
Copy link

Hello, Thank you for this great library,

can you please provide an example of how to push something like this which tested and works:

Products.query().insertGraph({
  example1:{
},
example2:{}
})

into feathers create service?

I just fail to understand the documentation, what I tried so far:

  create(data, params) {
    return super.create({
      ...data,
      $eager: "[example1,example2]"
    }, params);
  }

I apologize if I did total nonsense, its just difficult to understand how to translate between the two.

Thanks!

@vasilevich
Copy link
Author

I managed to get it to work.
The documentation was fine I apologize for saying otherwise
Here is what I had to do to get it to work:

  1. make sure in service options upon creation you put the following:
 new Products(
{
  allowedInsert: '[example1,example2]',
}
, app)

after that, the create will work as expected out of the box and support objects that have sub-objects with example1, and example2.

I apologize for opening this unnecessary ticket, the documentation is fine.

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

No branches or pull requests

1 participant