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)
- 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
- Enable fix float point 2 decimal place
- Support for response.body.extensions on successful response?
- unnecessary entity resolvers generated when having multiple keys even after setting resolvable: false
- Unable to pass double braced '{{....}}' text or through to resolvers
- graph/foo/foo.graphqls doesn't have trailing newline
- Custom type for a specific field
- omit_resolver_fields option does not respect `models.<model>.fields.<field>.resolver` option HOT 1
- gqlgen converting the special chars to unicode breaking the frontend
- failed to build "_examples/websocket-initfunc/server/server.go"
- How long till 1.0? HOT 1
- Sharing input and output type schemas
- Is returning the stacktrace an option to enable?
- `mutation` with duplicate fields does not throw validation error
- gqlgen generate failed when the Resolver contains multiple-line comments
- could not import github.com/99designs/gqlgen (cannot find package "github.com/99designs/gqlgen" in GOROOT or GOPATH)
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.