Comments (5)
@pandada8 dont direct use graphql layer object for database layer . its really not a good idea. trust me.
from gqlgen.
What's the use case?
All of this data and more is already in the schema object, you can fetch it off the generated executable schema es.Schema()
.
Perhaps mappings need to go from the go struct back to the schema object?
from gqlgen.
one possible use case is that the generated model may be used directly with mgo or other database lib, without redefine or edit the struct again.
from gqlgen.
I'm going to close this out until there is a good concrete use case.
I don't think gqlgen should be generating your database models, it should be binding to them.
from gqlgen.
@pandada8 dont direct use graphql layer object for database layer . its really not a good idea. trust me.
sorry for necro, but how should this be handled, without running into
- having to write a lot of boilerplate
- "desynchronization" of types (say you add a field, you'd now have to add it in 3 places - domain type, db type, gql type)
from gqlgen.
Related Issues (20)
- Fail to upload file HOT 4
- How to transfer cookies from the generated handler
- How to skip gqlgen to generate resolver for specific field
- Response is not match embedded struct already have json tag
- Test client error while deserializing Time scalar HOT 1
- panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x642ede] HOT 2
- interface conversion: interface {} is []interface {}, not map[string]interface {} HOT 3
- field resolver on input types
- introspection includeDeprecated on INPUT_FIELDs
- How to use custom resolver implementation
- High Memory Usage During Generation HOT 3
- Improve support for @requires Federation directives
- Use errors.Join instead of multierror.Append
- Error generating resolvers for federated schema with interface fields in @key
- GraphQL SSE via playground.AltairHandler does not work
- unused parameter: ctx warnings in generated.go
- Subscription error: Error: Socket closed with event 1002 RSV1 set, bad opcode 7, bad MASK at Object.error
- @defer directive cancel load
- Codegen creates extra code on INPUT_OBJECT directive when using nested input fields? HOT 1
- Support for UUID type in ID scalars 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 gqlgen.