Can we do @requires with a parameterized _FieldSet?

Hello Apollo Community,

I’d like to provide arguments to the FieldSet of a @requires directive. For example with a schema like this:

type Cart @key(fields: "id") {
  id: String!
  lineItems: [LineItem!]!
  """this would - of course - not be a string in a real example"""
  subTotal: String! @requires(fields: "lineItems { quantity product { price(help!!) } }")
}

type LineItem @key(fields: "id") {
  id: String!
  quantity: Int!
  product: Product!
}

extend type Product {
  sku: String! @external
  """this would - of course - not be a string in a real example"""
  price(quantity: Int!): String! @external
}

How would I go about passing the quantity from my Cart/LineItem to the external product-subgraph? Is that possible at all or is it (if anything) a feature request?

Hello, have you found a solution to your problem ? I’m facing the same situation

Hello :wave:

This is currently not supported. Support for referencing fields with nullable/optional arguments is tracked under @requires - field cannot be included as it has arguments

Thanks,
Derek