`fieldPath` is always empty string on `relay_field_payload.error`
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
I was playing around with the `relayFieldLogger` to customize the errors being thrown for certain events when I noticed that the `fieldPath` on the `relay_field_payload.error` event seems to always be an empty string.
This is the query I executed:
```typescript
const data = useLazyLoadQuery(
graphql`
query AppQuery @throwOnFieldError {
company {
name
}
}
`,
{}
);
```
This is the response returned by the network:
```json
{
"errors": [
{
"message": "Something happened",
"path": ["company", "name"],
"extensions": { "code": "E1" }
}
],
"data": { "company": { "name": null } }
}
```
This is the event passed to the `relayFieldLogger`:
```json
{
"kind": "relay_field_payload.error",
"owner": "AppQuery",
"fieldPath": "",
"error": {
"message": "Something happened",
"extensions": {
"code": "E1"
}
},
"shouldThrow": true,
"handled": false
}
```
My expectation would've been for the `fieldPath` to be `'company.name'`. Is the current behavior expected or a bug?
Contributor guide
Assessment
This issue has not been assessed yet.