birkir / prime

✨Open Source GraphQL CMS
https://docs.primecms.app
MIT License
1.73k stars 112 forks source link

Bug: Deleting used fields in a model breaks Documents view #198

Open intellix opened 5 years ago

intellix commented 5 years ago

I've been playing with Prime; trying out a variation of things.

Created and populated a model with a couple of field types:

After deleting and adding some new fields to the model without deleting the previously used Document I'm now unable to view the Documents page:

Error! GraphQL error: could not determine data type of parameter $1

Also I seem unable to delete that Model I guess due to: #180

The only workaround right now is going directly to the database and deleting the previous documents related to the model.

One thing worth noting is that I am able to query and find the old document from playground:

Screenshot 2019-05-16 18 14 21

But am unable to delete the document using the mutation:

Screenshot 2019-05-16 18 16 15

Actually my co-worker continuously killed the documents view somehow and I ended up nuking all documents/models in the DB directly. Do you have a plan for altering a model with data already in use?

intellix commented 5 years ago

Alright I don't think this happens on master after cloning and playing with it locally. The above was deployed onto Heroku using the one-clicker.

One thing I did notice though is that if you delete a Document referenced then somewhere else (Slice in this case) it gets swapped with the ID and I'm not sure I can remove it?

Screenshot 2019-05-17 00 14 18
pippinthegreat commented 5 years ago

I've run into this error as well (could not determine data type of parameter $1). I tracked it down to a bug with TypeORM, and submitted a PR to fix it - typeorm/typeorm/pull/4157

154 is currently preventing this repo's dependency version of TypeORM from being updated. Once these two are merged and the dependancies are updated, it should fix this issue

birkir commented 5 years ago

I think heroku may be lagging behind!