graphprotocol / research

Research, proposals, papers, and specs
48 stars 9 forks source link

Add Schema section to GraphQL API #57

Closed Zerim closed 6 years ago

Zerim commented 6 years ago

Should be merged after: https://github.com/graphprotocol/the-graph-research/pull/47 (base branch set to that PR's branch for a more clear diff). Do not merge.

@Jannis I think I deviated a little bit on the derivedFrom API then what we had in the prototypes. I think the rationale makes sense, but let me know what you think.

Zerim commented 6 years ago

@Jannis One question just occurred to me. Do we want to enforce uniqueness for 1:1 reverse lookups? Or should we just say that all reverse lookups are by definition 1:*?

Doing the former might put us in a position to dynamically return an error from mapping scripts where two entities try and create a relationship to a single entity with only a 1:1 reverse lookup defined on its entity type.

Zerim commented 6 years ago

Might be good to start with the more restrictive/limited API and only add 1:1 reverse lookups if we get requests from developers for the use case.

Zerim commented 6 years ago

Aside from the @entity change, other changes made. I'm going to leave this PR as WIP until I fill out the Value Object and Built-in Types sections

Zerim commented 6 years ago

@Jannis Added sections for Built-in Types and Value Object as well as the recently designed @unique directive. Ready for another look.

Zerim commented 6 years ago

Okay, changes made @Jannis, ready for another look.

Zerim commented 6 years ago

Closed in favor of https://github.com/graphprotocol/research/pull/64