Hi! For the apollo federation `@requires`/`@extern...
# graphql-kotlin
a
Hi! For the apollo federation `@requires`/`@external` fields, we have to populate those fields ourselves in the entity reference resolver, right? For example, in the docs: https://opensource.expediagroup.com/graphql-kotlin/docs/7.x.x/schema-generator/federation/federated-directives#requires-directive we have
Copy code
@KeyDirective(FieldSet("id"))
class Product(val id: String) {
  @ExternalDirective
  var weight: Double by Delegates.notNull()

  @RequiresDirective(FieldSet("weight"))
  fun shippingCost(): String { ... }
}
in the reference resolver for
Product
, we would have to set the
weight
var there by checking for the
weight
value in the
representation
?
d
yes
entity map representation will include those extra fields on the request -> it is up to you to instantiate the entity with all the required info
a
okay cool makes sense, thank you!