Selecting specific columns for CassandraRepository dynamically as per GrapqhQl query's return fields

30 Views Asked by At

For the following graphql request:

query{testInput(testQueryInput:{xyz:"test"}){
        list{
        field1
        field2
        .
        .
        }
    }
}

I am using CassandraRepository's findBy* methods. This internally forms a select * from tbl query.

Is there a way to form the select query with only the the fields that are being passed in the graphql query's return section, dynamically? (This is to improve the existing performance as the DB has around 300 columns) e.g: select field1, field2 from tbl...

I prefer not using the CqlSession object and executing the query string. Any suggestions customizing the CassandraRepository?

0

There are 0 best solutions below