Skip to content

Commit dfafb84

Browse files
committed
Added apolloVersion option, and updated deps
1 parent e7aad0c commit dfafb84

File tree

17 files changed

+592
-4374
lines changed

17 files changed

+592
-4374
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626

2727
Refer to the full [documentation](https://sgts.netlify.com) !
2828

29-
## New in 0.7.0
29+
## New in 0.10.12
3030

31-
Fragments are now auto-generated by default for `codegen-functions`, but can still be added manually with `$fragments`
31+
Added `apolloVersion` option.
3232

3333
## **Installation**
3434

@@ -66,6 +66,7 @@ sgts -h
6666
| --codegen-vue-hooks | | boolean | [See doc](https://sgts.netlify.com/options/codegen-vue-hooks.html) |
6767
| --gen-fragments | | boolean | [See doc](https://sgts.netlify.com/options/gen-fragments.html) |
6868
| --codegen-templates | | boolean | [See doc](https://sgts.netlify.com/options/withGqlQueries.html) |
69+
| --apolloVersion | | number <br> _default_ `3` | [See doc](https://sgts.netlify.com/options/apolloVersion.html) |
6970
| --customScalars `<scalars>` | | {"myScalar": "MyType"} | [See doc](https://sgts.netlify.com/options/customScalars.html) |
7071
| --prefix `<prefix>` | -p | string <br> _default_ `null` | [See doc](https://sgts.netlify.com/options/prefix.html) |
7172
| --suffix `<suffix>` | -s | string <br> _default_ `null` | [See doc](https://sgts.netlify.com/options/suffix.html) |

__tests__/global/__snapshots__/all.spec.ts.snap

Lines changed: 74 additions & 715 deletions
Large diffs are not rendered by default.

__tests__/global/__snapshots__/apollo.spec.ts.snap

Lines changed: 67 additions & 708 deletions
Large diffs are not rendered by default.

__tests__/global/__snapshots__/react-hooks.spec.ts.snap

Lines changed: 64 additions & 707 deletions
Large diffs are not rendered by default.

__tests__/global/__snapshots__/templates.spec.ts.snap

Lines changed: 64 additions & 707 deletions
Large diffs are not rendered by default.

__tests__/global/__snapshots__/types.spec.ts.snap

Lines changed: 62 additions & 705 deletions
Large diffs are not rendered by default.

__tests__/global/__snapshots__/vue-hooks.spec.ts.snap

Lines changed: 65 additions & 708 deletions
Large diffs are not rendered by default.

docs/options/apolloVersion.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# apolloVersion
2+
3+
### Type: `2 | 3`
4+
5+
## Default: 3
6+
7+
Specify the apollo version you use.
8+
It will affects the imports of the generated file.
9+
10+
Exemple:
11+
12+
```bash
13+
sgts --apolloVersion 2
14+
```

docs/options/codegen-functions.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,14 @@ You just need to pass yout apolloClient instance to the root constructor of sgts
4646
`apiProvider` is generated by sgts on the same files as your models with the option `--codegen-functions`
4747
:::
4848

49+
::: tip
50+
You can specify the apollo version you use (2 or 3) with the option `--apolloVersion`;
51+
It will default to 3.
52+
:::
53+
4954
```ts
5055
import { apiProvider } from '~/generated.ts';
51-
import ApolloClient from 'apollo-client';
56+
import ApolloClient from '@apollo/client/core';
5257

5358
const apolloClient = new ApolloClient({
5459
...

docs/options/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
| --codegen-react-hooks | | boolean | [See doc](/options/codegen-react-hooks) |
1010
| --codegen-vue-hooks | | boolean | [See doc](/options/codegen-vue-hooks) |
1111
| --codegen-templates | | boolean | [See doc](/options/withGqlQueries) |
12+
| --apolloVersion | | number | [See doc](/options/apolloVersion) |
13+
| --gen-fragments | | boolean | [See doc](/options/gen-fragments) |
1214
| --customScalars `<scalars>` | | {"myScalar": "MyType"} | [See doc](/options/customScalars) |
1315
| --prefix `<prefix>` | -p | string <br> _default_ `null` | [See doc](/options/prefix) |
1416
| --suffix `<suffix>` | -s | string <br> _default_ `null` | [See doc](/options/suffix) |

0 commit comments

Comments
 (0)