plugin-graphql icon indicating copy to clipboard operation
plugin-graphql copied to clipboard

Roadmap to 1.0.0

Open phortx opened this issue 6 years ago • 8 comments

  • [x] Adapter Pattern to adapt for different schemas
  • [x] Eager Saving: #94
  • [x] Support for non-integer IDs: #62
  • [ ] Cleanup interfaces/types
  • [ ] Support for pagination: #31
  • [ ] Unmocking in test-utils: #61
  • [ ] Allow schemas without mutations: #98
  • [ ] Access to errors in simpleMutation / queries: #83
  • [x] Split up plugin.spec.ts
  • [x] Finally decide a naming of the persistence methods with @kiaking and @KaniRobinson
  • All open bugs in the 1.0.0 Milestone

phortx avatar May 15 '19 06:05 phortx

regarding pagination you can maybe get around this by simply setting a model with an attribute which identifies it as a Paginator Model.

Then simply ORM create instead of ORM insert.

So you could do BlogPostPaginator.fetch()

this was a relatively easy solution for me and allowed me to maintain state of pagination of each model.

Regarding eager loading I found that there were a lot of problems automatically loading certain relations especially if certain relations are expensive by default.

Laravel's Eloquent ORM is really quite nice.

post->with(['comments.likes','comments.images'])->fetch()

We should be able to temporarily set eager relations using a with method - this would really be handy.

Pivoting is also very important and quite lacking.

I am solving some of these issues, I'll let u know if i come to any findings with my work.

tonipepperoni avatar Jun 02 '19 17:06 tonipepperoni

A few other things.

  • should have a flag which simply does vuex orm .create() instead of a .insert() (would solve pagination)
  • should change schema so inputs are named more specifically e.g.: CreatePostInput UpdatePostInput

can be quite a problem when it's not separated out I feel. or maybe allow you to specify the input names for the above 2 crud operations.

tonipepperoni avatar Jun 02 '19 18:06 tonipepperoni

Thank you very much for your input @tonipepperoni ! :)

Regarding eager loading I found that there were a lot of problems automatically loading certain relations especially if certain relations are expensive by default.

Good point, maybe we should add a skipEagerLoading or something to make sure that stuff that is normally eagerly loaded (hasOne, belongsTo) are not loaded automatically. For expensive records this would help I think.

Laravel's Eloquent ORM is really quite nice. post->with(['comments.likes','comments.images'])->fetch() We should be able to temporarily set eager relations using a with method - this would really be handy.

a with (and without) option was one of the early ideas. We should revive this: #104

Pivoting is also very important and quite lacking.

What's the issue here? I mean what do you actually need, what doesn't work?

should have a flag which simply does vuex orm .create() instead of a .insert() (would solve pagination)

Using create() instead of insert() can cause issues. I currently don't remember what kind of issues, but I think it has something to do with IDs. I will investigate on this: #105

should change schema so inputs are named more specifically e.g.: CreatePostInput UpdatePostInput

You can do this via adapters.

phortx avatar Jun 03 '19 07:06 phortx

Maybe the ideal option is in your is to have a connection setting which eagerloads such relations by default.

This issue with create and insert is probably because create only makes 1 vuex orm record, which is good for pagination, auth-user etc (singletons). but bad for multiple records.

I think having two separate actions is appropriate and worked well for me.

tonipepperoni avatar Jun 03 '19 10:06 tonipepperoni

I like the philosophy of hiding such complexity from the user. .fetch() should just work and one should not think about which kind of operation on the store is used.

I will check this when I have some time :) Thanks for your help.

phortx avatar Jun 03 '19 11:06 phortx

for pivots -> refers to store models where the primary key is a combination of 2 foreign keys (usually)

tonipepperoni avatar Jun 06 '19 12:06 tonipepperoni

@phortx maybe if you want it to be really simple then you could have a flag in the vuex-orm model itself like createOnly = true;

but I think the problem is that in certain cases you would want it to create and other times you'd want it to insert.

tonipepperoni avatar Jun 08 '19 18:06 tonipepperoni

Subscriptions are not on the list so I guess they won't make it into 1.0.0? I can't find any infos regarding PRs related to subscriptions either?

Stefano1990 avatar Jan 13 '20 16:01 Stefano1990