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

many to many relationship #76

Closed
ZobairQ opened this issue Mar 10, 2021 · 1 comment
Closed

many to many relationship #76

ZobairQ opened this issue Mar 10, 2021 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@ZobairQ
Copy link

ZobairQ commented Mar 10, 2021

Describe the Bug
If you have a many to many relationship where you have a table between two tables that only hold foreign_keys, prisma will create a model for that. Typegraphql will then try to create a mutation for that, but there won't be any input data. When trying to start the application you get an error stating that your mutationInput should atleast have a field.

To Reproduce
To reproduce this try to create three tables in your sql. T1, T2 and T3. T1 and T3 are ordinary tables and T2 contains only T1's pk and T3' pk.

Expected Behavior
It shouldn't create mutation for table T2 since it's just a table to keep track of the relations with two other tables.

Logs
If applicable, add some console logs to help explain your problem.
You can paste the errors with stack trace that were printed when the error occurred.

Environment (please complete the following information):

  • OS: [MAC OSX]
  • Node (e.g. 14.16.0)
  • typegraphql-prisma version [0.11.2]
  • Prisma 2 version [e.g. 2.18.0]
  • TypeScript version (e.g. 4.2.2)
@MichalLytek
Copy link
Owner

Duplicate of #19 🔒

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants