Open jarlef opened 9 months ago
This is causing us a huge headache anytime we need to update the schema. We have several queries and mutations that we call that share common fragments. Due to this, whenever we update the schema, there is a high likelihood that the randomly assigned type that Strawberry Shake uses to generate the classes which utilize fragments will change as well.
Are there any updates to this? Or workarounds in the meantime? This is a pretty major issue that results in some developers being able to compile our applications and some who cannot. It also results in our build pipeline "randomly" failing.
No, focus for version 14 is mainly Hot Chocolate with minor fixes to Strawberry Shake. For 15 we have some time budget for Strawberry Shake, so once 14 is shipped we will go over sb issues and reprioritize some for the 15 backlog.
@michaelstaib could we at least get a summary of why this is happening so the community can maybe figure out an interim way to solve it (or help?)
Product
Strawberry Shake
Is your feature request related to a problem?
A recent issue ive encounter is that the generated client in Strawberry Shake is not consistent when using fragments
E.g the following graphl queries agains a schema.
In this case it will generate two models for student.
GetStudentById_Student
andGetStudents_Students_Student
both inherting from their own dedicated interfaces that in turn inherits fromIMyStudent
. But deeply nested properties like theSchool
property onGetStudents_Students_Student
andGetStudentById_Student
gets randomly assigned a type that is eitherIGetStudents_Students_Student_School
orIGetStudentById_Student_School
.The solution you'd like
Since they are both implementing the fragment interface
IMyStudent
it clearly means the school property can only be of one type and IMO that should beIMySchool
which is the fragments interface. One could also argu that student and students properties should also use the interfaceIMyStudent
instead of their own interfaces since the fragment is an intent to express a named contract.Link to minimal reproduction from #7194: https://github.com/pm7y/StrawberryShakeBugRepro