MasoniteFramework / orm

Masonite ORM is a beautiful Python ORM. It's also a nearly drop in replacement of the Orator ORM
https://orm.masoniteproject.com
MIT License
160 stars 47 forks source link

Error trying to save Json in version 2.19.* #853

Closed arturo-villalpando closed 9 months ago

arturo-villalpando commented 12 months ago

Describe the bug

I used Fastapi + Masonite ORM + Strawberry

I'm trying to save a JSON in a JSON field of PostgreSQL, the problem is that when I trying im getting the next error:

Message:

masoniteorm.query.QueryBuilder.QueryBuilder.create() got multiple values for keyword argument 'id_key'

Captura de pantalla 2023-07-13 a la(s) 18 09 24

To Reproduce Steps to reproduce the behavior:

  1. Go to https://github.com/arturo-villalpando/FMS
  2. Clone the repo and install the requirements

pip3 install -r requirements.txt

  1. Run the repo and go to http://localhost:8000/graphql
  2. Try to execute the next query for add a fat category:

mutation MyMutation { addFaqCategory( data: {category: "[{\"category\":\"Basketball\"}]", deletedAt: null} ) { id category deletedAt } }

5.- Go to the requirements.txt file and change the version of masonite-orm to 2.19.* 6.- Run again the query an you will get the error

Expected behavior Save the json in database:

Captura de pantalla 2023-07-13 a la(s) 18 17 32

Screenshots or code snippets Screenshots help a lot. If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

What database are you using?

Additional context There is no problem trying to save the json in Masonite ORM version 2.18.6.

josephmancuso commented 9 months ago

this is fixed in v2.19.2