commercetools / commercetools/test-data

[Idea] Opinionated (graphql) transformer

Open
#34 3 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.