Appsync/GraphQL Query Params Design Approach
We have a Java Application and we are invoking Appsync/GraphQL for search Service. Appsync searches different systems based on the search criteria passed, consolidate the results(for matching records) and sends it back to our application. The response is a common JSON schema but fields varies based on the system the Search criteria has matched. There is a query parameter which specifically says which system to search and I know which fields I need to query and get back in the response.
I need suggestions on what is the best design pattern I can use in my java application to build fields dynamically that needs to be in the schema(as I know the target system and fields available at the system). I am planning to use a properties file and hold placeholders for each system and its corresponding fields(that I want in response) and pass this while building the query.