NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #2760 most downloaded on npm
Last release today
04 Oct 2026
Ships fairly regularly
a new release about every 1 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
8 years old
6633 releases · first in 2019
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
This is extending on ResolversUnionTypes implemented in https://github.com/dotansimha/graphql-code-generator/pull/9069
#9146
9f4d9c5a4
Thanks @eddeee888! - [typescript-resolvers] Add
resolversNonOptionalTypename config option.
This is extending on ResolversUnionTypes implemented in
https://github.com/dotansimha/graphql-code-generator/pull/9069
resolversNonOptionalTypename adds non-optional __typename to union members of
ResolversUnionTypes, without affecting the union members' base intefaces.
A common use case for non-optional __typename of union members is using it as the common field
to work out the final schema type. This makes implementing the union's __resolveType very simple
as we can use __typename to decide which union member the resolved object is. Without this, we
have to check the existence of field/s on the incoming object which could be verbose.
For example, consider this schema:
type Query {
book(id: ID!): BookPayload!
}
type Book {
id: ID!
isbn: String!
}
type BookResult {
node: Book
}
type PayloadError {
message: String!
}
union BookPayload = BookResult | PayloadError
With optional __typename: We need to check existence of certain fields to resolve type in the
union resolver:
// Query/book.ts
export const book = async () => {
try {
const book = await fetchBook()
// 1. No `__typename` in resolver results...
return {
node: book
}
} catch (e) {
return {
message: 'Failed to fetch book'
}
}
}
// BookPayload.ts
export const BookPayload = {
__resolveType: parent => {
// 2. ... means more checks in `__resolveType`
if ('message' in parent) {
return 'PayloadError'
}
return 'BookResult'
}
}
With non-optional __typename: Resolvers declare the type. This which gives us better
TypeScript support in resolvers and simplify __resolveType implementation:
// Query/book.ts
export const book = async () => {
try {
const book = await fetchBook()
// 1. `__typename` is declared in resolver results...
return {
__typename: 'BookResult', // 1a. this also types `node` for us 🎉
node: book
}
} catch (e) {
return {
__typename: 'PayloadError',
message: 'Failed to fetch book'
}
}
}
// BookPayload.ts
export const BookPayload = {
__resolveType: parent => parent.__typename // 2. ... means a very simple check in `__resolveType`
}
Using resolversNonOptionalTypename: add it into typescript-resolvers plugin config:
// codegen.ts
const config: CodegenConfig = {
schema: 'src/schema/**/*.graphql',
generates: {
'src/schema/types.ts': {
plugins: ['typescript', 'typescript-resolvers'],
config: {
resolversNonOptionalTypename: true // Or `resolversNonOptionalTypename: { unionMember: true }`
}
}
}
}
#9206
e56790104
Thanks @eddeee888! - Fix ResolversUnionTypes being used in
ResolversParentTypes
Previously, objects with mappable fields are converted to Omit format that references its own type
group or ResolversTypes or ResolversParentTypes e.g.
export type ResolversTypes = {
Book: ResolverTypeWrapper<BookMapper>
BookPayload: ResolversTypes['BookResult'] | ResolversTypes['StandardError']
// Note: `result` on the next line references `ResolversTypes["Book"]`
BookResult: ResolverTypeWrapper<
Omit<BookResult, 'result'> & { result?: Maybe<ResolversTypes['Book']> }
>
StandardError: ResolverTypeWrapper<StandardError>
}
export type ResolversParentTypes = {
Book: BookMapper
BookPayload: ResolversParentTypes['BookResult'] | ResolversParentTypes['StandardError']
// Note: `result` on the next line references `ResolversParentTypes["Book"]`
BookResult: Omit<BookResult, 'result'> & { result?: Maybe<ResolversParentTypes['Book']> }
StandardError: StandardError
}
In https://github.com/dotansimha/graphql-code-generator/pull/9069, we extracted resolver union types to its own group:
export type ResolversUnionTypes = {
// Note: `result` on the next line references `ResolversTypes["Book"]` which is only correct for the `ResolversTypes` case
BookPayload:
| (Omit<BookResult, 'result'> & { result?: Maybe<ResolversTypes['Book']> })
| StandardError
}
export type ResolversTypes = {
Book: ResolverTypeWrapper<BookMapper>
BookPayload: ResolverTypeWrapper<ResolversUnionTypes['BookPayload']>
BookResult: ResolverTypeWrapper<
Omit<BookResult, 'result'> & { result?: Maybe<ResolversTypes['Book']> }
>
StandardError: ResolverTypeWrapper<StandardError>
}
export type ResolversParentTypes = {
Book: BookMapper
BookPayload: ResolversUnionTypes['BookPayload']
BookResult: Omit<BookResult, 'result'> & { result?: Maybe<ResolversParentTypes['Book']> }
StandardError: StandardError
}
This change creates an extra ResolversUnionParentTypes that is referenced by
ResolversParentTypes to ensure backwards compatibility:
export type ResolversUnionTypes = {
BookPayload:
| (Omit<BookResult, 'result'> & { result?: Maybe<ResolversParentTypes['Book']> })
| StandardError
}
// ... and the reference is changed in ResolversParentTypes:
export type ResolversParentTypes = {
// ... other fields
BookPayload: ResolversUnionParentTypes['BookPayload']
}
#9194
acb647e4e
Thanks @dstaley! - Don't emit import statements for unused fragments
Updated dependencies
[b7dacb21f,
f104619ac]:
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →