ForetagInc/alchemy

Bug: Filter available on unique relationships

KennethGomez opened this issue · 1 comments

Preliminary checklist

  • I understand that all communication must be in English
  • I read the Documentation
  • I read the Contributing guide
  • I agree to follow the Code of Conduct
  • I searched the issues and discussions but couldn't find anything (or linked relevant results below)

Version

dev

Environment

N/A

Background

Whenever you create a relationship between two entities on which one of the arms of the relationship is a One, for example: ManyToOne, OneToMany, OneToOne, the Schema generated should create on the One arm a single-entity returning type without any filter as it doesn't make sense to filter something that is always one.

Current behavior

Right now the Schema generated adds filtering for both arms.

Steps To Reproduce

  1. Create one entity, example: Account
  2. Create another entity, example: Role
  3. Create a relationship between these entities with a relationship property on both of them: AccountRole

Screenshot or Screencast

image

Logs and traces

No response

Solution

Disable filtering for single-entity returning fields

Debugging

No response

Contribution

Yes, I will work on a PR

Keywords

graphql, relationships

Bug confirmed