Skip to content

Commit

Permalink
Update CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sikanhe authored Dec 5, 2023
1 parent 528a0e5 commit e8f0021
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,48 @@
# next
# Next

- [Breaking] No longer need create a builder just to have user provide Context type
- [Breaking] No need for defaultArg vs arg, (leverage conditional types)
- [Breaking] Lowercase all types builders function names
# 0.9.3
- [Breaking] All type constructors are exported under "Gql" namespace for easy autocompletion and reduce import bloat.
```ts
const UserType = Gql.Object<User>({
name: 'User',
description: 'A User',
fields: () => [
Gql.Field({ name: 'id', type: Gql.NonNull(Gql.ID) }),
Gql.Field({ name: 'role', type: Gql.NonNull(RoleEnum) }),
Gql.Field({ name: 'name', type: Gql.NonNull(Gql.String) }),
],
});
```
- [Breaking] No longer need create a builder just to have user provide GqlContext type
```ts
declare module "gqtx" {
interface GqlContext {
viewerId: number;
users: User[];
}
}
```
- [Breaking] No need for DefaultArg vs Arg, (leverage conditional types)
```ts
Gql.Arg({ name: "name", type: Gql.String, default: "Joe" })
```
- [Breaking] Union/Interface resolveType now returns string, as expected by graphql-js v16
- [Improvement] Union's types array can be now defined as a function to support forward references
```ts
const GqlPostCommentUnion = Gql.Union({
name: "PostOrCommentUnion",
types: () => [GqlPost, GqlComment], // Can now be a function
resolveType: (value) => {
if (value.type === "Post") {
// old: return GqlPost
return GqlPost.name
} else {
// old: return GqlComment
return GqlComment.name
}
},
})
```

# 0.8.1

Expand Down

1 comment on commit e8f0021

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes have been published to npm.

yarn add -E gqtx@0.9.2-e8f00210.0

Please sign in to comment.