[client-preset] Opt out of graphql function? #9901
Unanswered
aaronadamsCA
asked this question in
Ideas
Replies: 1 comment 1 reply
-
@aaronadamsCA can you show an example config? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We migrated to the client preset, but the way we're using it feels much simpler and more performant than what the docs suggest.
.graphql
files only.graphql.config.ts
reads.graphql
files only.graphql.ts
file.This works really well, with far fewer tradeoffs than the standard setup.
At the very least, I think this should be officially supported. It's probably too late to make the
graphql
function opt-in, but could it at least be opt-out? We don't need all that extra code generated; we're never going to use it.I think a truly ideal future state would have the client preset always generate exactly one file, with the user able to
presetConfig
its exports. You could choose from among operation types, document nodes, fragment masking, and agraphql()
function, and the generated file would contain only the necessary code to provide the exports you requested.I think this would continue to align well with the intentions of the client preset, while providing the opportunity to greatly improve performance in larger projects.
Beta Was this translation helpful? Give feedback.
All reactions