graphql / graphql-spec

GraphQL is a query language and execution engine tied to any backend service.
https://spec.graphql.org
14.31k stars 1.12k forks source link

Deduplication? Cyclical references? #130

Open tlrobinson opened 8 years ago

tlrobinson commented 8 years ago

Are there any plans to handle cases where multiple instances of the same object are returned by a query, leading to duplicated content in the responses? How about cyclical references between objects?

I think both cases could be handled by an encoding format similar to Cognitect's Transit, Netflix/Falcor's JSON Graph, or JSON Schema.

It is called GraphQL, not TreeQL, after all :)

kevinSuttle commented 8 years ago

For reference: https://netflix.github.io/falcor/starter/how-does-falcor-work.html, though like @leebyron mentioned in #124, some of this is dependent on the client. There are also packages like this, which could be used as another model. https://www.npmjs.com/package/dataloader

tuukka commented 8 years ago

More recent discussion with some investigation results and ideas for future work here: https://github.com/facebook/relay/issues/806