Member-only story

GraphQL Multiple Search Filters and Case Insensitive Search in SwiftUI

Learn how to get around GraphQL limitations with case-insensitive search and adding multiple search filters to the query when using SwiftUI

ML Musings
3 min readJan 6, 2023
Photo by Christina @ wocintechchat.com on Unsplash

I am pretty new to GraphQL. While I love it, I figured it is still young and there are limitations to it. In this article (exercise), we will hack our way into implementing Multiple Search Filters and Case Insensitive Search.

There are two problems we are trying to solve:

Problem 1: Multiple Where Clauses in Filters Not Allowed

Currently, you cannot filter GraphQL results with more than two “where” clause. Wouldn’t it be awesome if you could execute and manipulate result with conditional filters as below:

Select * from table-name where item1 = <item_1> and item2= <item_2>

Sadly, it is not currently possible

I researched and encountered a lot of open asks where people are trying to implement similar functionality,

  1. https://stackoverflow.com/questions/48731361/graphql-how-to-perform-where-clause
  2. https://stackoverflow.com/questions/52347310/graphql-conditional-que

--

--

ML Musings
ML Musings

Written by ML Musings

✨ I enjoy pushing the boundaries of JS, Python, SwiftUI and AI. You can support my work through coffee - www.buymeacoffee.com/MLMusings

No responses yet