Support nested selection sets
kdawgwilk opened this issue · 3 comments
kdawgwilk commented
We need to make sure we support nested selection sets e.g. "id organization { id }"
_FieldSet docs https://www.apollographql.com/docs/federation/federation-spec/#scalar-_fieldset
kdawgwilk commented
Did a test of this and the string -> atom conversion on _FieldSet only happens at one layer unfortunately right now so there is some work to be done here e.g.
variables=%{"representations" => [%{"__typename" => "Product", "sku" => "federation", "variation" => %{"id" => "OSS"}}]}
query ($representations: [_Any!]!) {
_entities(representations: $representations) {
...on Product { id }
}
}
{
"representations": [
{
"__typename": "Product",
"sku": "federation",
"variation": {
"id": "OSS"
}
}
]}
Came through in the :_resolve_reference
resolver as:
defp resolve_product_reference(%{sku: sku, variation: %{"id" => variation_id}}, _ctx) do
notice the id
is a string not an atom
kdawgwilk commented
The code to improve this support is likely
andWhere it only converts the top-level keys and not nested keys