emailAddresses: [String]
emailAddresses is a array of string, but it being mocked as a single string:
"emailAddresses": "
cc @alunyov
Thanks for reporting this, @sibelius!
I specifically include this field in this example to illustrate the limitations of the MockPayloadGenerator for scalar fields.
Since we don't have any type information about scalar fields in the Normalization ASTs (https://github.com/facebook/relay/blob/8f10f55275c59740a703f0ff7b09fa0f43d143f9/packages/relay-compiler/codegen/__tests__/__snapshots__/compileRelayArtifacts-test.js.snap#L6276), whether the filed is plural, nullable, Integer or Float, etc - we don't know this. And for those cases, we're defaulting to String.
This can be solved by using @relay_test_operation: https://relay.dev/docs/en/testing-relay-components#relay_test_operation
Or providing a custom mock resolver for the String type or for concrete object type of the parent.
Most helpful comment
Thanks for reporting this, @sibelius!
I specifically include this field in this example to illustrate the limitations of the MockPayloadGenerator for scalar fields.
Since we don't have any type information about scalar fields in the Normalization ASTs (https://github.com/facebook/relay/blob/8f10f55275c59740a703f0ff7b09fa0f43d143f9/packages/relay-compiler/codegen/__tests__/__snapshots__/compileRelayArtifacts-test.js.snap#L6276), whether the filed is plural, nullable, Integer or Float, etc - we don't know this. And for those cases, we're defaulting to
String.This can be solved by using @relay_test_operation: https://relay.dev/docs/en/testing-relay-components#relay_test_operation
Or providing a custom mock resolver for the
Stringtype or for concrete object type of the parent.