Skip to content

Update fieldnamerize spec helper

What does this MR do and why?

While working on testing part of the issue #344257 (closed)
I noticed that it'd be great if we could also use #graphql_dig_at helper spec method with _links field in order to check its content.

Currently an underlying method GraphqlHelpers.fieldnamerize of #graphql_dig_at is used for the field transformation like:
merge_request to mergeRequest.

In case when a field is named with a leading underscore the result produced by the method would be:
_links to Links

And we won't be able to use Links afterwards in order to retrieve the field's content.

This MR changes the GraphqlHelpers.fieldnamerize to skip a transformation for fields with a leading underscore.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading