federation icon indicating copy to clipboard operation
federation copied to clipboard

Parent values are not parsed as custom scalars when contributing fields to entity

Open brianmorin-ef opened this issue 2 years ago • 0 comments

Issue Description

When contributing a field to an entity, we're finding that the representation of the parent is not being parsed through our custom scalars. This is causing generated/expected types to not be present at runtime. We are seeing JSON representations of our parent values instead of the backend representations which is unexpected.

Is there a way for us to have representations pass through the scalars' parsers? Or does the nature of representations being _Any prevent that and all representations for federation when reaching resolvers will always be plain JSON?

Link to Reproduction

https://codesandbox.io/p/sandbox/frosty-ramanujan-63mlzk?file=%2Ftsconfig.json%3A1%2C1

Reproduction Steps

Run the following query in the code sand sandbox. You can see some logging about date being a number at runtime, but type Date in the schema.

query ExampleQuery {
  products {
    reviews {
      __typename
    }
  }
}

brianmorin-ef avatar Aug 15 '23 18:08 brianmorin-ef