panter / ra-data-prisma

Packages to connect react-admin with prisma version 2
MIT License
85 stars 28 forks source link

sort order #137

Closed punjasin closed 1 year ago

punjasin commented 1 year ago

it return sort order must be object how do I fix this

query need to be

  "orderBy": [
    {
      "createdAt": {
        "sort": "desc"
      }
    }
  ],

instead of

  "orderBy": [
    {
      "createdAt": "desc"
    }
  ],

how do I customize this :(

macrozone commented 1 year ago

how is the backend generated that uses that dialect?

punjasin commented 1 year ago

I am using prisma typegraphql generator it was working fine before since yesterday it after i add more model

knapeto commented 1 year ago

what version of ra-data-prisma and typegraphql are you using?

sounds to me that you forget to setup properly configuration..

can you share it?

const options: Options = {
    ....
    queryDialect: 'typegraphql',
  };
punjasin commented 1 year ago

it was "typegraphql-prisma": "^0.26.0","typegraphql-prisma": "^0.26.0",

and on react admin i am using lasted one

queryDialect: "typegraphql", mutationOperationNames: { typegraphql: { [CREATE]: (resource) =>createOne${resource.name}, [UPDATE]: (resource) =>updateOne${resource.name}, [DELETE]: (resource) =>deleteOne${resource.name}, }, },

punjasin commented 1 year ago

after i revert my yarn lock issue is resolve seem like sub version of type graphql has some breaking change broke this i ll close the ticket