#gql #flutter Hi everyone, I am using graphQL with flutter and would like to pass boolean expression to my graphQL query. I am using the QueryOption object type of the graphQL flutter package to pass the query to graphql and to define my query parameters. The problem I have is that I don't know how to tell flutter that I am passing a boolean expression to the variable parameter of the QueryOption object. Is there a way to do that?
Future<QueryResult> FilteredQuery(
final GraphQLClient client,
final FilterModel filter,
final bool isAvailable,
) async {
final QueryOptions options = QueryOptions(
document: gql(queryCreationsFiltered),
variables: <String, dynamic>{
'condition1': isAvailable== false ? {false}:{is_available: {_eq: true}}
}
Usually to be able to match the right type of the query variable I pass the associated dart type in flutter! The idea behind that is to apply conditional filtering. Any help will be welcomed! Thanks :slight_smile: