graphql icon indicating copy to clipboard operation
graphql copied to clipboard

Would it be possilbe to get the requested fields on a model?

Open triptec opened this issue 7 years ago • 1 comments

.. so that I don't need to "select * from heroes" when only the name of example is requested?

triptec avatar Jan 17 '18 16:01 triptec

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

nrc avatar Jan 17 '18 21:01 nrc