Comments (4)
This should still work the way you describe. Model generation only happens if you don't add the model to types.json.
eg, the starwars example is still using it for the friends connection
Whats probably happening is types.json
isnt being searched for by default any more, you need to add a -typemap types.json
if you want to map to your own types.
from gqlgen.
@vektah No it is searching fine, we now receive an error:
unable to bind Car.new to anything, path/to/model.Car has no suitable fields or methods
If you add a New
field to the Car
model it fixes it.
Generating with the following:
//go:generate gorunpkg github.com/vektah/gqlgen -package schema -schema schema.graphql -typemap types.json -out generated.go
It works for custom type connections (hence the star wars example still working), but not scalar values, e.g string
from gqlgen.
that was just a warning, but I've removed it to avoid future confusion.
Scalars has an example:
https://github.com/vektah/gqlgen/blob/master/example/scalars/resolvers.go#L49-L55
from gqlgen.
😶
from gqlgen.
Related Issues (20)
- Allow graphql resolvers to return data even when fields are missing from schema HOT 1
- [Proposal] Allow passing a custom json marshal/unmarshal implementation
- Support Apollo Router HTTP subscriptions HOT 2
- Option to use json.Number when unmarshalling dynamically typed scalars
- generate cannot resolve custom slice type HOT 1
- Is it possible to disable/redirect gqlgen's log output (e.g. while running unit tests)?
- Allow infrastructural input validation
- How do I pass values from Directive to Resolver through context? HOT 3
- ResolverImplementer has a break change that the implementor can't know a field status. HOT 3
- [Proposal] Resolve the schema location from where the config file live instead of the current working dir
- [Proposal] Add defer for field resolvers HOT 1
- Unrecognized import path for sourcegraph/appdash-data HOT 7
- What is the best way to pass variables between query and response object field resolver ?
- unrecognized import path "sourcegraph.com/sourcegraph/appdash-data": reading https://sourcegraph.com/sourcegraph/appdash-data?go-get=***: 404 Not Found HOT 9
- Mutation resolver code generation
- Code generation broken for federated multi-key, multi-entity types HOT 1
- [Bug] Altair introspect query error
- gqlgen v0.17.42 breaks / incompatible with gqlgenc vv0.16.0 HOT 17
- Use go.work and workspaces
- Pass error code in Websocket InitFunc
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.