graphql
graphql copied to clipboard
Would it be possilbe to get the requested fields on a model?
.. so that I don't need to "select * from heroes" when only the name of example is requested?
It is possible, you need to implement a custom Hero type with just the fields you want and then implement the various traits so that it plugs in nicely. You should be able to read the context to find the rest of the query and thus whether you need all the fields or just some. I don't think that is implemented yet, but it might be in a sub-optimal way.
For completeness:
- [ ] docs on writing custom type implementations
- [ ] query in context in easy-to-use form