Skip to content

Should fieldNormalizer apply also to response keys? #201

@alfondotnet

Description

@alfondotnet

Currently, fieldNormalizer callback will be applied to the keys of object responses that are not part of the query, for example

query {
  @rest()...
  response(id: 1) {
    headers
  }
}

the endpoint response can be:

headers: {
  "Content-Type": "application/json"
}

but due to fieldNormalizer being applied to all keys, having a camelCase fn, for example, would mean that headers ends up becoming:

{
  contentType: "application/json"
}

Is this something that apollo-link-rest should handle?

For now the workaround that I have is override the client in the specific affected <Query>'s with one that doesn't make use of fieldNormalizer

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions