exposeAs returns the GraphQL field name to surface this operation under. Precedence: per-operation override > default convention. The default is " _ " to avoid collisions when multiple specs declare similarly-named operations.
(specKey, operationID string, override OperationOverride)
| 396 | // The default is "<spec_key>_<operationId_snake>" to avoid collisions |
| 397 | // when multiple specs declare similarly-named operations. |
| 398 | func exposeAs(specKey, operationID string, override OperationOverride) string { |
| 399 | if override.ExposeAs != "" { |
| 400 | return override.ExposeAs |
| 401 | } |
| 402 | return specKey + "_" + toSnakeCase(operationID) |
| 403 | } |
| 404 | |
| 405 | // toSnakeCase converts camelCase / PascalCase identifiers to snake_case. |
| 406 | // It's intentionally conservative: only inserts an underscore at a |
no test coverage detected