Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide cardinality annotations #700

Open
ramnivas opened this issue Apr 6, 2023 · 0 comments
Open

Provide cardinality annotations #700

ramnivas opened this issue Apr 6, 2023 · 0 comments
Labels
Milestone

Comments

@ramnivas
Copy link
Contributor

ramnivas commented Apr 6, 2023

Currently, both side of a relationship need to refer to the other side. However, this can be an issue when using (for example) an independently developed exo model. We can offer an annotation such as @manyToOne, @oneToMany, @oneToOne.

An additional semantics we can deduce is that unless a field is explicitly specified, we won't offer it in the return value. For example, in the code below, there will be no GraphQL field named concerts in the Venue type.

@postgres
service ConcertService {
  type Concert {
    ...
    @column("venueid") @manyToOne venue: Venue
  }

  type Venue {
    ...
    // NOT NEEDED @column("venueid") concerts: Set<Concert>?
  }
}
@ramnivas ramnivas added the P2 label May 18, 2023
@ramnivas ramnivas added this to the M2 milestone Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant