is in graphql a way to query for articles which start with a specific letter?
In sql I mean something like this:
WHERE title LIKE 'e%'
How can I do this with strapi in a graphql query?
Thanks for some help!
Hi @iparker, great question. Currently, you can’t do that natively in Strapi. I imagine the support for each and every possible database operation made available by DBMSs would create a rather bloated and impractical API. I would recommend, creating a custom controller that performs a custom query similar to what you need . This probably would need more modification as your use case evolves. For reference take a look at these three articles on the Strapi docs:
- Customizing the GraphQL schema - GraphQL - Strapi Developer Documentation
- Writing Custom Queries - Backend customization - Strapi Developer Documentation
- Creating Controllers - Backend customization - Strapi Developer Documentation
thanks for your answer and your feedback.
This kind of customizations seems like much effort for this “simply and tiny” requirement.
I’m looking to find another solution, maybe handle this on client side.