Skip to content

Commit

Permalink
- add unwrapSingleFieldTypes in cli doc
Browse files Browse the repository at this point in the history
  • Loading branch information
laststylebender14 committed Aug 12, 2024
1 parent 2425136 commit 2bfea0d
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ To generate a TailCall GraphQL configuration, provide a configuration file to th
},
"preset": {
"mergeType": 1,
"consolidateURL": 0.5
"treeShake": true
"consolidateURL": 0.5,
"treeShake": true,
"unwrapSingleFieldTypes": true
}
}
```
Expand Down Expand Up @@ -171,6 +172,7 @@ preset:
mergeType: 1
consolidateURL: 0.5
treeShake: true
unwrapSingleFieldTypes: true
```
</TabItem>
Expand Down Expand Up @@ -274,6 +276,7 @@ The config generator provides a set of tuning parameters that can make the gener
"mergeType": 1,
"consolidateURL": 0.5,
"treeShake": true,
"unwrapSingleFieldTypes": true,
},
}
```
Expand All @@ -286,6 +289,7 @@ preset:
mergeType: 1
consolidateURL: 0.5
treeShake: true
unwrapSingleFieldTypes: true
```
</TabItem>
</Tabs>
Expand Down Expand Up @@ -409,3 +413,29 @@ preset:
a: Int
}
```

4. **unwrapSingleFieldTypes:** This setting instructs Tailcall to flatten out types with single field.

```graphql showLineNumbers title="Before applying the setting"
type Query {
foo: Foo
}
# Type with only one field
type Foo {
bar: Bar
}
# Type with only one field
type Bar {
a: Int
}
```

```graphql showLineNumbers title="After applying setting"
type Query {
foo: Int
}
```

This helps in flattening out types into single field.

0 comments on commit 2bfea0d

Please sign in to comment.