You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just got around to testing the new schema inspection #386 when upgrading to Spring Boot 3.1 RC1. I seem to be getting false positives for unmapped fields that have a java field.
I think it happens when the controller method is a CompletableFuture of a List of the object:
@Controller
public class ExampleQueryController {
@QueryMapping
public CompletableFuture<List<ExampleObject>> exampleObject(DataFetchingEnvironment env) {
return CompletableFuture.completedFuture(List.of(new ExampleObject(1, "name")));
}
}
GraphQL schema:
type ExampleObject {
name: String,
id: Int
}
type Query {
exampleObject: [ExampleObject]
}
Object class:
public class ExampleObject {
public String name;
public int id;
public ExampleObject(int id, String name) {
this.id = id;
this.name = name;
}
public Integer getId() {
return id;
}
public String getName() {
return name;
}
}
This results in the schema inspection giving a false positive that name and id aren't mapped for ExampleObject.
The text was updated successfully, but these errors were encountered:
Normally a multivalue Publisher is collected to a List, so we can treat
it as a match for a List field. For subscriptions, however, such a
Publisher is left as an infinite stream, and we should not treat as a
match for a List, but rather expect it to be a stream of List items.
Discovered while working on gh-674, which is closely related.
@JamesPeters98, this should now be fixed. Please, take another look and let us know if you have further feedback. Also, note that in the latest version of this, the inspection does not run automatically. You need to enable it in GraphQlSource.Builder. The reference docs have been updated.
I just got around to testing the new schema inspection #386 when upgrading to Spring Boot 3.1 RC1. I seem to be getting false positives for unmapped fields that have a java field.
I think it happens when the controller method is a CompletableFuture of a List of the object:
GraphQL schema:
Object class:
This results in the schema inspection giving a false positive that name and id aren't mapped for ExampleObject.
The text was updated successfully, but these errors were encountered: