Comments (1)
I did a deeper look into this because with the new loader functionalities on Tanstack Router, React Router or NextJS I could archive similar behaviour with a little bit more code:
{
exposeQueryKeys: true,
exposeFetcher: true,
addSuspenseQuery: true,
}
// in route config
loader: ({userId}) => queryClient.ensureQueryData({
queryKey: useUserQuery.getKey({ id: userId }),
queryFn: useUserQuery.fetcher({ id: userId })
})
// in my components
useSuspenseUserQuery({id: userId})
This is already great, it would be great if addSuspenseQuery
is not documented because that flag was missing inside the docs.
I think this plugin could greatly improve when queryOptions
would be introduced into the codegen and both queries, suspense queries and all other options would make use of the generated query options for each query (and mutation)
from graphql-code-generator-community.
Related Issues (20)
- Doc fix for an extra apostrophe in the code example for additionalDI (apollo-angular config.)
- [RTK-Query] Hook generator does not match InjectedAPI typings when typings are not in pascalCase HOT 1
- useFragment does not support variables or other base options HOT 1
- Flutter json_serializable use `JsonValue` as the json key of Enum
- GraphQL to FLutter Drift
- Codegen generates unused types from the schema
- Error on "typescript-react-apollo" plugin + vite: [vite] Named export 'gql' not found. The requested module '@apollo/client' is a CommonJS module, which may not support all module.exports as named exports
- Tooling modernization
- Support graphql-request v7 for @graphql-codegen/typescript-graphql-request HOT 3
- Repeated fragment spreading causes perf issues with near-operation-files + typescript-operations
- Update outdated packages in @graphql-codegen/near-operation-file-preset
- Add option to throw on duplicate operation name in named-operations-object HOT 2
- Add Kotlin Serialization Support
- Unexpected Result with Nullish Coalescing and Ternary Operators in React Query's infinite query key
- C# Plugin Should Respect namingConvention HOT 7
- C# Plugin Should Allow Generating Partial Classes HOT 1
- Incorrect imports when using union fragment with `dedupeOperationSuffix: true` and `inlineFragmentTypes: 'combine'`
- hasura-allow-list: wrong fragment order in document mode
- `react-query` imports a custom fetcher as a type with `useTypeImports` enabled
- typescript-react-query custom fetcher not using correct import with near-operation-file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-code-generator-community.