v3.1.0
New Features
🎉 ts-graphql-plugin gets compat graphql-codegen
🎉
- The new
enabledGlobalFragments
option allows to analyze operation and fragments defined in different templates without interpolation(e.g.${postFragment}
). - Function call expression is available as GraphQL document via
tag
option .
In combination these, ts-graplql-plugin works with graphql-codegen
compatible code such as:
import { graphql } from "./gql";
const postFragment = graphql(`
fragment PostFragment on Post {
title
author {
name
}
}
`);
const query = graphql(`
query AppQuery {
popularPosts {
id
...PostFragment
}
}
`);
See example If you want more details,
What's Changed
- chore: Modify Codecov configuration by @Quramy in #1204
- chore: Modify jest instrumentation by @Quramy in #1205
- chore: Allow findAllNodes callback to return generic AST nodes by @Quramy in #1220
- Global fragment registry by @Quramy in #1209
- chore: Organize package.json by @Quramy in #1225
- feat: Add
tag
customize pattern by @Quramy in #1226 - chore: Update example report md by @Quramy in #1227
- modify prettier config by @Quramy in #1228
- docs: Add example using graphql-codegen by @Quramy in #1229
- docs: Write about
enabledGlobalFragments
by @Quramy in #1232 - fix: Transformer should uses getFragmentDependenciesForAST by @Quramy in #1233
- feat: Resolve interpolation referring call expression by @Quramy in #1234
- fix: Allow to transform CallExpression by @Quramy in #1235
- chore: Fix module name typo by @Quramy in #1237
- fix: TypedDocument addon import specifier by @Quramy in #1236