有人尝试在graphql-spqr中包含geojson类型吗?我试图包括但没有成功 找到了这个https://github.com/leangen/graphql-spqr/wiki/Errors#ambiguous-member-type并尝试为下面的geojson注册ObjectTypeMapper
public class GeoJsonMapper extends ObjectTypeMapper {
@Override
public GraphQLInputObjectType toGraphQLInputType(final String typeName, final AnnotatedType javaType, final OperationMapper operationMapper, final BuildContext buildContext) {
GraphQLInputObjectType.Builder typeBuilder = newInputObject()
.name(typeName)
.description(buildContext.typeInfoGenerator.generateInputTypeDescription(javaType, buildContext.messageBundle));
final Set<InputField> fields = new HashSet<>();
fields.add(new InputField("geo", "geo json point", new TypeToken<GeoJson<List<Double>>>(){}.getAnnotatedType(), new TypeToken<GeoJson<List<Double>>>(){}.getAnnotatedType(), null, null));
fields.forEach(field -> typeBuilder.field(operationMapper.toGraphQLInputField(field, buildContext)));
return typeBuilder.build();
}
@Override
public boolean supports(AnnotatedType type) {
return GeoJsonPoint.class.equals(type.getType());
}
}