2

Using org.springframework.boot:spring-boot-starter-graphql and WebMvc, I would like to handle, in the @Controller, nested fields with arguments. E.g.:

query myQuery {
  field1(param1: "value1") {
    field2(param2: "value2") {
      field3
    }
  }
}

The @Controller handles the first field with:

@QueryMapping
public Field1 field1(@Argument param1) {...}

But how to handle the second level field with argument?

  • How to handle 3rd level assuming object is. query myQuery { field1(param1: "value1") { field2(param2: "value2") { field3 { abc, xyz } } } } – SURAJ Jan 30 '23 at 19:15

1 Answers1

1

I solved it using @SchemaMapping:

@QueryMapping
public Field1 field1(@Argument param1) {...}

@SchemaMapping
public Field2 field2(Field1 field1, @Argument param2) {...}