I need to build the search api for property manage...
# orm-help
t
I need to build the search api for property management system. The search query will be dynamic with lot of filter such as bedroom, price range and so on
k
Good place to start would perhaps be the overview of query filter capabilities of Prisma https://prismagraphql.com/docs/prisma-graphql-api/reference/queries-qwe1/#filtering
t
can I access to the graphql api directly or I need to wrap it with the rest api using prisma client
k
I believe the suggested path is to access the Prisma’s API in your own server code, add auth layer in there and only expose certain parts to the public, whether through a REST or GraphQL API.
t
do you know is there any example to expose the restapi that allow to accept the graphql query and pass it to the graphql api to get the result
does prisma had dot net or java client
m
Hi @Thomas Tran, I’m also building a filter heavy app using prisma at the moment. My approach is changing the ‘where’ argument of a prisma-client DB query depending on what the user types into the search box. Since you have a rest api, that would probably mean dynamically creating the ‘where’ argument object based on the filter value that you receive in the function that handles your POST request. Then make the prisma-client DB query based on that where object
My app is getting a bit too filter heavy so I’m thinking of using algolia.com for that soon. Maybe that’d be of interest to you too
t
@Thomas Tran @Max Ast I’ve just started using Prisma for my first React (NextJS) + Apollo project, which involves a text search that’ll also rely on filters — how did your implementation of Algolia go? I followed their React setup tutorial, but I’m unsure of how to share data stored in Prisma with Algolia and keep it current as my app adds and modifies content over GraphQL with Prisma’s API… does anyone have a good tutorial or example codebase I could check out? I find the theory here to be the most difficult to wrap my head around