Open Jannis opened 5 years ago
@Jannis Have we considered the possibility of having the tuple type be an entity, and generating the scaffolding code to handle it as such?
Inline objects are a possibility, but it introduces a special case in query execution, in the runtime and in the general mental model. This sounds like something we'll want eventually, possibly due to different performance characteristics, but for now having those be entities could be the simplest way to support tuple arrays in scaffolding.
Motivation / Rationale
We currently don't support inline objects: GraphQL types that are not entities and that be embedded in parent objects instead of referencing them via their IDs.
This feature is necessary to better support Ethereum tuples and arrays of Ethereum tuples in the GraphQL schema and particularly in
graph init --from-contract
scaffolding.Imagine a contract has an event like the following
We currently can't represent
Receiver[]
in the GraphQL schema and we representDetails
by unrolling the fields into a flat list of fields:What we really want is this: