-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Generated GraphQL classes not compatible with < .NET 6 #1143
Comments
Hey! I'm glad you asked, I forgot that detail myself and need to update the documentation. I believe it originally required .NET 6 or greater because it makes use of nullable primitives, which weren't supported in .NET Standard 2.0 or .NET Framework at the time. They are supported now though, so I believe (and apparently that AI believes) that requirement can be removed. I'll take a look and get a new version published! |
Hmm, looks like it's the use of the @clement911 Any thoughts on making the |
@nozzlegear I haven't had a chance to review the many changes that you have done recently. |
No worries @clement911! Good question about the required keyword – I thought those were the error messages I was seeing, but it's possible that I broke another part of the project when I was trying to make the generated classes work in .NET Framework. I'll take a closer look tomorrow and see what's actually going on. |
I remembered that the generator currently excludes .NET framework because the I guess it could potentially generate a Do we really have to keep on supporting .NET Framework though? |
@clement911 Ah that makes sense, thanks for looking into it! As much as I'd love to drop .NET Framework support, there are too many ShopifySharp users who are still using it; I want to maintain as much compatibility with them as I can (within reason) for as long as Microsoft decides to keep it supported. I think I see where the |
I had a try but unfortunately That being said, the generated classes are not needed to use the GraphService. |
@nozzlegear @clement911 Thank you both for looking into this. Regarding the need for keeping .NET Framework support, I am definitely an example of a user that is quite tied to it.. I dread the day that we are forced to migrate our application to a non-Framework version, as not only would it be a major change in itself, but there are also some functions that outright wouldn't work on non-Framework, which we would need to try to find workarounds for. 😓 Although I totally understand that it can be a pain to have to keep the legacy compatibility with the library, and lose out on all the newer language features as a result. I guess at some point it may make more sense to split off ShopifySharp into a separate fork for .NET Framework (which would then of course require the extra effort to maintain the fork). I am aware that defining your own classes to use with the GraphService is an option, and that is plan B in my case - however it does seem a shame to go that route and have to maintain all of the required classes separately, when they are already being included with ShopifySharp. Fingers crossed that it's possible to adapt the schema generator for backwards-compatibility without too much hassle... |
@nozzlegear @clement911 Are the generated classes going to be compatible with .NET Framework after all? We need to decide whether to wait for a new release or implement our own classes. Thank you for your time. |
@samnorr Thanks for the explaining! It's my understanding that a lot of devs on .NET Framework are in a similar situation, just based on the correspondences I've had over the years working on ShopifySharp. @chandrianos I'm going to take another whack at generating classes for .NET Framework. I might need to use a different schema generation tool, as the one we use right now is one that @clement911 built for a separate work project and refactoring it for .NET Framework may not be his goal or within scope (I'll let him chime in there). I do have some other changes I'm wanting to make to the pre-generated classes for .NET 8, including #1133 and #1135, so that's a consideration as well. |
I just tried to use the generated GraphQL classes in a .NET Framework project, but for some reason wasn't able to access them... I then realized that they are specifically targeting .NET 6 and greater. Just wondering what the reason is for this - is it a restriction with the tool used for generating these? I would have thought it would be possible to keep compatibility for those of us still on .NET Framework?
I know there are already some plans to refactor these classes, so maybe this is already on the roadmap.
Thanks!
The text was updated successfully, but these errors were encountered: