Hello <@UESADRKMY> <@UAP2CSJQG> I added `previewFe...
# orm-help
j
Hello @Ryan @Ahmed I added
previewFeatures = ["orderByRelation"]
to support sorting with the relation model. And it is working fine with prisma client. But in my project I used nexus and pal js with prisma and created graphql endpoint. So how can I implement
orderByRelation
with nexus graphql. Is there any docs?
a
@Jemin Kothari all you need to run
pal g
after adding the preview feature and pal will regenerate your inputs to accept relation in the order by field
j
Okay. Trying and let you know
@Ahmed I updated schema.prisma
Copy code
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["selectRelationCount", "filterJson", "referentialActions", "orderByRelation"]
}
And run
yarn pal g
Here is my pal.js file
Copy code
module.exports = {
 backend: {
    generator: 'nexus',
    output: 'apps/bridge-api/src/generated/types',
 }
}
Still it is not working
I didn't get the relation model suggestion in orderBy
@Ahmed?
a
I will check it again now and back to you
j
Okay
a
it’s working perfect for me what you need now stop your server run
yarn generate
if you using any paljs templates or run
prisma generate
then start your server and refresh your graphql page
j
Okay
Let me try
Are you using
nexus
generator
?
a
Wait it’s working on types not in queries
I will work to add also in queries
j
Okay. And let me know
a
working when try to order be the relations but not in the main query will add and send new release
j
It will take how many days for the new release ?
a
maybe late today or tomorrow
Please use last version 3.7.0 and don’t forget to delete old generated files by pal.js
apps/bridge-api/src/generated/types
j
@Ahmed You means "@paljs/nexus": 3.7.0 ?
Thank you. It is working fine
a
I mean paljs cli package