-
Notifications
You must be signed in to change notification settings - Fork 0
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
non-guid cursors #6
Comments
For my purposes, I just changed the method used with |
Currently I'm thinking several possible solutions:
Number one does not have my preference as it would be quite confusing when reading code which uses the |
See https://github.com/corstian/Boerman.GraphQL.Contrib/blob/exp-1/Boerman.GraphQL.Contrib/Query.Extensions.cs#L109 for an implementation of the first option. |
I've also thrown together a proof of concept for the 2nd option, which I will try to move forward with later. Note that this is untested code as of now: https://github.com/corstian/Boerman.GraphQL.Contrib/blob/exp-2/Boerman.GraphQL.Contrib/Query.Extensions.cs#L110 |
I agree that the 2nd option is better. It is cleaner when viewed from outside the library and avoids another overload. Is |
More or less. See the implementation here: https://github.com/corstian/Boerman.GraphQL.Contrib/blob/exp-2/Boerman.GraphQL.Contrib/Type.Extensions.cs |
Ahh ok. Yeah, I like that. Keep the branching logic in its own place. Neat and tidy. :-D |
It appears that the overloads for ToCursor work correctly. I can choose my id field and have it converted to a base64 string. However, within the
ToConnection
method, the from methods are set to use the extensions that return Guids, which I do not use. There is no way to indicate that I want to go from cursor to int.I am not sure how to solve this. Any ideas? I am trying to avoid writing another overload of ToConnection. I also want to avoid a parameter if-check. I am mostly a functional programmer so I prefer my functions to do one thing if I can.
Sidenote: as a functional programmer, C# really kills me. :-D
The text was updated successfully, but these errors were encountered: