sangria-graphql / sangria

Scala GraphQL implementation
https://sangria-graphql.github.io
Apache License 2.0
1.96k stars 226 forks source link

Provide query arguments alongside name projections #427

Open robconrad opened 5 years ago

robconrad commented 5 years ago

In this StackOverflow comment it is recommended to use built-in projection support to avoid the N+1 query problem when resolving nested objects. This works perfectly if the only requirement of the generated query is knowing which items to select since those are all available as ProjectedName vectors. However, if arguments can exist within the nested objects that are required to form predicates, sorts, or other non-shape parameters of the query it becomes necessary to dive into the ast to pull the arguments out.

Would it be possible to provide the args at the projected level of the ast the ProjectedName represents along with the name?

nickhudkins commented 3 years ago

563