Releases: mizdra/graphql-codegen-typescript-fabbrica
Releases · mizdra/graphql-codegen-typescript-fabbrica
v0.6.1
What's Changed
Fixed
- Fix compile errors caused by
--composite
of TypeScript by @mizdra in #88- Thanks for contributing! @bmulholland
- Fix non-local schema not loading by @mizdra in #91, #94
- Thanks for contributing! @ElizabethWoodhouse @moh682
Others
- Run skipped browser tests by @mizdra in #89
- Refactoring E2E tests by @mizdra in #90
- Update project config by @mizdra in #92
- Chores by @mizdra in #93
Full Changelog: v0.6.0...v0.6.1
v0.6.0
v0.5.0
Breaking Changes
New way to define transient fields
The way to define transient fields has been changed. defineXxxFactoryInternal
is not exported now. Use defineXxxFactory.withTransientFields
to define Transient Fields.
Before
import {
defineAuthorFactoryInternal,
dynamic,
FieldsResolver,
Traits,
AuthorFactoryDefineOptions,
AuthorFactoryInterface,
} from '../__generated__/fabbrica';
import { Author } from '../__generated__/types';
// Prepare custom `defineAuthorFactory` with transient fields
type AuthorTransientFields = {
bookCount: number;
};
function defineAuthorFactoryWithTransientFields<
_DefaultFieldsResolver extends FieldsResolver<Author & AuthorTransientFields>,
_Traits extends Traits<Author, AuthorTransientFields>,
>(
options: AuthorFactoryDefineOptions<AuthorTransientFields, _DefaultFieldsResolver, _Traits>,
): AuthorFactoryInterface<AuthorTransientFields, _DefaultFieldsResolver, _Traits> {
return defineAuthorFactoryInternal(options);
}
// Use custom `defineAuthorFactory`
const AuthorFactory = defineAuthorFactoryWithTransientFields({
defaultFields: {
id: dynamic(({ seq }) => `Author-${seq}`),
name: 'Komata Mikami',
books: dynamic(async ({ get }) => {
const bookCount = (await get('bookCount')) ?? 0;
return BookFactory.buildList(bookCount);
}),
bookCount: 0,
},
});
After
import {
dynamic,
FieldsResolver,
Traits,
AuthorFactoryDefineOptions,
AuthorFactoryInterface,
} from '../__generated__/fabbrica';
import { Author } from '../__generated__/types';
const AuthorFactory = defineAuthorFactory.withTransientFields({
bookCount: 0,
})({
defaultFields: {
id: dynamic(({ seq }) => `Author-${seq}`),
name: 'Komata Mikami',
books: dynamic(async ({ get }) => {
const bookCount = (await get('bookCount')) ?? 0;
return BookFactory.buildList(bookCount);
}),
},
});
What's Changed
Added
Changed
Others
Full Changelog: v0.4.0...v0.5.0
v0.4.0
v0.3.2
v0.3.1
v0.3.0
What's Changed
Changed
- Rename
nonOptionalFields
tononOptionalDefaultFields
by @mizdra in #47 - Rename package name from
graphql-fabbrica
tographql-codegen-typescript-fabbrica
by @mizdra in #49
Others
- Add description of TS2307 by @mizdra in #48
nonOptionalTypename
is optional by @mizdra in #50- Refactoring by @mizdra in #51
Full Changelog: v0.2.0...v0.3.0
v0.2.0
This release brings input support, Relay support, and improved compatibility with GraphQL Code Generator. In addition, the field passed to defaultFields
can now be omitted, and several bugs have been fixed.
What's Changed
Added
- Support
namingConvention
option by @mizdra in #35 - Support
typesPrefix
option by @mizdra in #35 - Support
typesSuffix
option by @mizdra in #35 - Support input by @mizdra in #37
- Embed type and field descriptions as comments by @mizdra in #38
- Support
__is<AbstractType>
by @mizdra in #43 - Support
nonOptionalFields
option by @mizdra in #45 - Allow omitting fields to be passed to
defaultFields
by default by @mizdra in #45
Fixed
- Object-typed custom scalar should not optional by @mizdra in #35
- Fix problem with type name not changing by @mizdra in #36
- Fix invalid type of
__typename
and__isAbstractType
by @mizdra in #44 - Do not treat the arguments of
build
method as const type by @mizdra in #46
Others
- Refactoring by @mizdra in #31
- Add test cases for GraphQL features by @mizdra in #34
- Refactoring by @mizdra in #39
- Improve documentation by @mizdra in #41
- Refactoring by @mizdra in #42
Full Changelog: v0.1.0...v0.2.0
v0.1.0
What's Changed
Added
defineTypeFactory
,.build()
anddefaultFields
by @mizdra in #2- Allow non-functional value and sync function for field resolvers by @mizdra in #3
- Sequence by @mizdra in #4
- Use sequence for input field resolvers by @mizdra in #5
- Dependent Fields (
get
utility) by @mizdra in #9 - Transient Fields by @mizdra in #12
- Traits by @mizdra in #19
.buildList()
by @mizdra in #22- Generate code from GraphQL schema (GraphQL Code Generator Plugin) by @mizdra in #23
- Add
skipTypename
option by @mizdra in #27
Changed
- Use
Lazy
class instead of raw function by @mizdra in #10 - Improve transient field usability by @mizdra in #20
- Drop Node.js v16 by @mizdra in #25
- Rename
lazy
todynamic
by @mizdra in #29
Fixed
- Make the argument of build method optional by @mizdra in #6
- Fix array fields are correctly typed by @mizdra in #14
- Accept readonly array as field by @mizdra in #15
- Fix the return type of
get
by @mizdra in #18
Others
- Update deps by @mizdra in #7
- Refactoring test codes by @mizdra in #8
- Refactoring codes by @mizdra in #11
- Add integration test for circular dependent type by @mizdra in #13
- Refactoring & Add tests by @mizdra in #16
- Refactoring by @mizdra in #21
- Refactoring by @mizdra in #24
- Fix E2E test by @mizdra in #26
- Add usage by @mizdra in #28
- Prepare publishing by @mizdra in #30
New Contributors
Full Changelog: https://github.com/mizdra/graphql-fabbrica/commits/v0.1.0