use of io.smallrye.graphql.client.impl.typesafe.reflection.MethodResolver in project smallrye-graphql by smallrye.
the class HeaderBuilder method resolveHeaderMethod.
private HeaderDescriptor resolveHeaderMethod(Header header) {
TypeInfo declaringType = method.getDeclaringType();
MethodInvocation method = new MethodResolver(declaringType, header.method()).resolve();
if (!method.isStatic())
throw new RuntimeException("referenced header method '" + header.method() + "'" + " in " + declaringType.getTypeName() + " is not static");
String value = callMethod(method);
return new HeaderDescriptor(value, header.name(), toHeaderName(method));
}
Aggregations