Skip to content

Commit 5036d33

Browse files
committed
Release 0.10.0
1 parent abbfa22 commit 5036d33

22 files changed

+10140
-2553
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
## [0.10.0] - 2020-10-25
8+
9+
- Breaking change: Sgts is now using `@apollo/client` v3 for function generation
10+
711
## [0.9.7] - 2020-10-25
812

913
- Fix edge case where Connection didn't have the `node` property

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

Lines changed: 2626 additions & 795 deletions
Large diffs are not rendered by default.

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

Lines changed: 2380 additions & 591 deletions
Large diffs are not rendered by default.

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

Lines changed: 1218 additions & 231 deletions
Large diffs are not rendered by default.

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

Lines changed: 1217 additions & 231 deletions
Large diffs are not rendered by default.

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

Lines changed: 1142 additions & 168 deletions
Large diffs are not rendered by default.

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

Lines changed: 1219 additions & 231 deletions
Large diffs are not rendered by default.

docs/options/codegen-functions.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ You just need to pass yout apolloClient instance to the root constructor of sgts
2525
return {
2626
$fragment: (fragment: string | DocumentNode) => {
2727
const { isString, isFragment, fragmentName } = guessFragmentType(fragment);
28-
const query = sgtsQL`
28+
const query = gql`
2929
query posts ($userId: Int) {
3030
posts(userId: $userId) {
3131
${isString ? fragment : '...' + fragmentName}
@@ -92,26 +92,43 @@ Sgts handle the fragment generation,
9292
_Exemple from generated project in production_
9393

9494
```typescript
95-
export const ReportConnectionFragment = sgtsQL`
95+
export const ReportConnectionFragment = gql`
9696
fragment ReportConnectionFragment on ReportConnection {
97-
edges { node { uuid category status } cursor } aggregate { count } pageInfo { hasNextPage hasPreviousPage startCursor endCursor }
97+
edges {
98+
node {
99+
uuid
100+
category
101+
status
102+
}
103+
cursor
104+
}
105+
aggregate {
106+
count
107+
}
108+
pageInfo {
109+
hasNextPage
110+
hasPreviousPage
111+
startCursor
112+
endCursor
113+
}
98114
}
99115
`;
100116

101117
return {
102118
/** Get list of reports */
103119
reports(): FragmentableQueryWithArgs<ReportConnection, reportsArgs> {
104-
const defaultQuery = sgtsQL`
105-
query reports ($where: ReportWhereInput!,$first: Int,$after: ID) {
106-
reports(where: $where,first: $first,after: $after) {
107-
...ReportConnectionFragment
108-
}
109-
} ${ReportConnectionFragment}
110-
`;
120+
const defaultQuery = gql`
121+
query reports($where: ReportWhereInput!, $first: Int, $after: ID) {
122+
reports(where: $where, first: $first, after: $after) {
123+
...ReportConnectionFragment
124+
}
125+
}
126+
${ReportConnectionFragment}
127+
`;
111128
return {
112129
$fragment: (fragment: string | DocumentNode) => {
113130
const { isString, isFragment, fragmentName } = guessFragmentType(fragment);
114-
const query = sgtsQL`
131+
const query = gql`
115132
query reports ($where: ReportWhereInput!,$first: Int,$after: ID) {
116133
reports(where: $where,first: $first,after: $after) {
117134
edges { node {${

docs/options/codegen-react-hooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const usePosts = (
2020
options?: QueryHookOptions<{ posts: Post[] }, postsArgs>
2121
) => {
2222
const { isString, isFragment, fragmentName } = guessFragmentType(fragment);
23-
const query = sgtsQL`
23+
const query = gql`
2424
query posts ($userId: Int) {
2525
posts(userId: $userId) {
2626
${isString ? fragment : '...' + fragmentName}

docs/options/codegen-templates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ sgts -e https://json-placeholder-graphql.herokuapp.com/graphql --codegen-templat
1919
```ts
2020
export const usersGQLNode = (fragment: string | DocumentNode) => {
2121
const { isString, isFragment, fragmentName } = guessFragmentType(fragment);
22-
return sgtsQL`
22+
return gql`
2323
query users {
2424
users {
2525
${isString ? fragment : '...' + fragmentName}

0 commit comments

Comments
 (0)