0

I want to generate GraphQL schema files from Java model, specifically for input operator filters for each field similar to https://www.mongodb.com/docs/atlas/app-services/graphql/types-and-resolvers/#std-label-graphql-input-types where it generates filters with the format [field-name]_[operator].

And then on query, how can i de-serialize the input/filter as there are no Java objects defined to match the filter or its properties?

For example, if i had a POJO class as follows: `

public class Person{
    private String firstname;
    private String lastname;
    private int age;
}
`

it would auto generate schema file with input filters with operators for each field, like so: `

type input PersonFilter {
    firstname_contains
    firstname_startsWith
    ... (no lte (>=) or lt (>) - is string, not a num)
    lastname_contains
    lastname_startsWith
    ... (no lte (>=) or lt (>) - is string, not a num)
    age_lte
    age_lt
    ... (no startsWith or contains as is num, not a string)
}

`

i see SPQR, java-annotations, ... that can be used for Code-first, schema generation, but none go into details of how to work with inputs or operators based input filters.

Stupify
  • 1
  • 2

0 Answers0