Closed alecrobertson1 closed 2 months ago
Hello @alecrobertson1 π
Not now, but this can be implemented fairly easily π
The config would look something like this:
'src/schemas': defineConfig({
resolverGeneration: {
query: true,
mutation: true,
subscription: true,
scalar: true,
object: false, // This disables object type generation.
union: false,
interface: false,
}
}),
I will add comments here when it's ready. Thanks for raising the question!
Hi @alecrobertson1, could you please try out this alpha version?
yarn add -D @eddeee888/gcg-typescript-resolver-files@pr240-run411-1
And the new definteConfig
for your use case may look like this:
defineConfig({
resolverGeneration: {
query: '*',
mutation: '*',
subscription: '*',
scalar: '*',
object: '', // Empty string disables all resolver generation in every module.
union: '',
interface: '',
},
})
Here's the WIP PR: https://github.com/eddeee888/graphql-code-generator-plugins/pull/240 I'll follow up with more documentation, examples and use cases soon
Hi @alecrobertson1, could you please try out this alpha version?
yarn add -D @eddeee888/gcg-typescript-resolver-files@pr240-run411-1
And the new
definteConfig
for your use case may look like this:defineConfig({ resolverGeneration: { query: '*', mutation: '*', subscription: '*', scalar: '*', object: '', // Empty string disables all resolver generation in every module. union: '', interface: '', }, })
Here's the WIP PR: #240 I'll follow up with more documentation, examples and use cases soon
Hi @eddeee888 is this available in v0.7.5?
It shows me this error when trying:
ERROR: Validation - presetConfig.resolverGeneration must be "disabled", "recommended" or "all" (default is "reβ¦
EDIT: I looked into the package history and saw it's not there yet.
Hi @hcentelles π
This will be in v0.8 soon: https://github.com/eddeee888/graphql-code-generator-plugins/pull/250
I'm just doing some final cleanups before releasing this version this week.
Hi @hcentelles ,
This is now available in v0.8. Please let me know if it doesn't solve your issue! Thank you!
Hi @hcentelles ,
This is now available in v0.8. Please let me know if it doesn't solve your issue! Thank you!
It works, thanks.
Apologies for the late reply, this is brilliant. Thanks!
When I run codegen, I get resolvers generated for all my types even if I don't use them. I don't require them to be implemented as I return all the information in the top-level query resolver, so is there a way to disable the generation of these resolvers?