commercetools / commercetools/test-data
[Idea] Opinionated (graphql) transformer
Open
enhancement
- Dominant language
- TypeScript
- Stars
- 16
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
At the moment 98% of our graphql transformers use the `addFields` to set the `__typename`.
**Describe the solution you'd like**
Maybe we should provide a preconfigured graphql transformer that always sets the `__typename`.
For example:
```js
Transformer.graphql('Author')
Transformer.graphql('Author', {
buildFields: ['books'],
})
```
**Describe alternatives you've considered**
Instead of `Transformer.graphql`, we can have a `GraphqlTransformer`.
Contributor guide
Assessment
This issue has not been assessed yet.