Aquamarine
Aquamarine

Reputation: 3

Output Data validation with graphql java

Is there a way to validate the data [ apply some filters/rules on the resultset ] extracted in the repository layer by using grahpql? For example, if the resultset is a List and for each Object, the validation to be applied are:

  1. Object.field1 is in the date range of 1 year prior to current date and current date
  2. Object.field2 is in the date range of 1 year prior to current date and current date (or) future date (or) null/blank

I have checked example of writing a DataFetcher by using some argument in the graphql schema. This DataFetcher class is containing the logic to validate the output data. Taken from the url: https://www.graphql-java.com/documentation/data-fetching

Upvotes: 0

Views: 10

Answers (0)

Related Questions