graphql-mesh: snakeCase does not properly handle "k8sClusterInstance"
Describe the bug
The snakeCase transformation converts k8s
to k8_s
To Reproduce Steps to reproduce the behavior:
sources:
- name: api
handler:
postgraphile:
schemaName:
- public
options:
dynamicJson: true
enhanceGraphiql: true
allowExplain: true
defaultPaginationCap: 10
appendPlugins:
- "postgraphile-federation-plugin"
- "postgraphile-plugin-connection-filter"
- "@graphile/pg-aggregates"
transforms:
- namingConvention:
fieldNames: snakeCase
Expected behavior
The snakeCase transformation should special-case ^[a-zA-Z][0-9]{,2}s
Environment:
- OS: macOS BigSur
@graphql-mesh/cli
:^0.45.0
,@graphql-mesh/postgraphile
:^0.17.8
,@graphql-mesh/transform-filter-schema
:^0.14.6
,@graphql-mesh/transform-naming-convention
:^0.8.6
,@graphql-mesh/transform-prefix
:^0.9.6
,- NodeJS: v12.22.2
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19
This bug has been fixed in
@graphql-mesh/transform-rename@0.11.9
@nicerobot You found a new bug - on the
rename
transformer this time, I did a PR to fix it: https://github.com/Urigo/graphql-mesh/pull/3480 Iāll keep you updated!@nicerobot
I am actually onboarding on The Guild team and especially on GraphQL Mesh project. I already used a lot GraphQL Mesh in a side project and read most of the docs, so I got a big picture of how it works. Following this ābig pictureā, I started by checking at the
naming-convention
transformer, by doing a failing unit test, which concluded that the issue was not from the transformer. After your feedback that the issue was still here, I started to look at other sources of the bug, always trying to look at narrowed parts of the code-base. Here, I felt that the issue could be from the Postgraphile source, so I started to look at Postgraphile logic around GraphQL fields inflectors. This is where I realized that the āissueā was not an issue but a normal behavior from Postgraphile through lodash helper (camelCase). So, in short, I isolated part of the codebase, one by one, in order to narrow down the bug.I guess you could define and publish your own plugin as explained in both GraphQL Mesh and PostGraphile docs: https://www.graphql-mesh.com/docs/handlers/postgraphile#external-plugins-eg-federationplugin-pgmanytomanyplugin-postgisplugin
However, I am not fluent in Postgraphileā¦
Is that an issue related to GraphQL Mesh? Apollo Server/Federation is owned and maintained by https://www.apollographql.com, not by The Guild š