Giter Site home page Giter Site logo

Comments (4)

vektah avatar vektah commented on May 18, 2024

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.

andrewmunro avatar andrewmunro commented on May 18, 2024

@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.

vektah avatar vektah commented on May 18, 2024

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.

Sparx2 avatar Sparx2 commented on May 18, 2024

😶

from gqlgen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.