Comments (8)
Feel free to contribute with a PR :) We'd love to support.
from graphql-code-generator-community.
+1 this would be very nice to have, especially for large sdks shared between client and server.
I'm guessing the api would need to look something like this from a consumer's point of view:
import { getItems } from '~/generated/sdk';
import { client } from '~/client';
// variables and other params omitted
const result = await getItems(client);
from graphql-code-generator-community.
@ardatan created the PR for the change. Happy to discuss any specifics
from graphql-code-generator-community.
@ardatan do you think we can apply some magic here? :D or it requires a whole change in the plugin output?
from graphql-code-generator-community.
@dotansimha Maybe we can export functions instead of an object factory and set the stuff as global variables but not sure if this is ideal?
Or we can use class instead of object factory.
from graphql-code-generator-community.
any updates?
from graphql-code-generator-community.
This is causing a huge initial impact on the loading of our app too. It would be really nice to be able to import functions as opposed to a huge object
from graphql-code-generator-community.
I also need this new feature for typescript-generic-sdk
!
from graphql-code-generator-community.
Related Issues (20)
- Feature Request: expose queryOptions of react-query v5
- Feature request: [java & kotlin] Generate types as interfaces
- Dotnet code gen does not work on the website HOT 1
- defaultBaseOptions value is not exported in generated file
- Allow toggling useSuspenseQuery generation HOT 2
- [java] generated enum arguments lack validation HOT 2
- [react-apollo] Add support for `useLoadableQuery`
- skipToken support for typescript-react-apollo HOT 3
- [Java] Reserved keyword "case" used in generated code
- Ability to use the core API in `typescript-react-apollo`
- Implement a graphql-codegen plugin that outputs a client SDK written in Effect
- Data should be null when an error occurs
- Cannot import typescript operation definition file with 'near-operation-plugin' and document: external
- I get Cannot redeclare block-scoped variable with client preset
- 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
- Flutter json_serializable use `JsonValue` as the json key of Enum
- GraphQL to FLutter Drift
- Codegen generates unused types from the schema
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.