Replies: 7 comments 5 replies
-
I see that this "happens" when I use |
Beta Was this translation helpful? Give feedback.
-
I guess you have This way you only need to know the id to refetch the data over the |
Beta Was this translation helpful? Give feedback.
-
I think (@PascalSenn correct me if I'm wrong) the conversion is automatically be done by HotChcocolate between Base64 and the original id value + meta information if you enable |
Beta Was this translation helpful? Give feedback.
-
Sey, what I meant is if you pass the Base64 encoded ID back to HC and it is declared as an ID type, it should automatically reconvert it to the original GUID. But yeah, if you don't need the Base64 encoded version, if you just not declare/annotate the type as ID, you should get the plain GUID on the client. In my Scenario I'm using two properties because I get the original GUID from another service. And in my service I have my own type the in addition exposes an Id property that is declared as (Relay) ID. For convenience I'm just forwarding the ID => MyGuidId and let HC do the encoding/decoding work. Can't you just remove this line in your case: I also think that instead of passing GUIDs as a parameter |
Beta Was this translation helpful? Give feedback.
-
Since Relay doesn't care about the format It could make sense to make the behavior configurable and tell HC to just pass thru the original value. Maby someone knows if this is already possible? |
Beta Was this translation helpful? Give feedback.
-
Or use the
|
Beta Was this translation helpful? Give feedback.
-
There seems to have been a recent change I've missed. Properties attributed with ID do not automatically Base64 encode the value if nothing else is configured. |
Beta Was this translation helpful? Give feedback.
-
Sorry if this is something way to basic but I´m new to GraphQL and am going through the workshop demo (and applying it to my own code/entities) and I just am not getting this base64 stuff.
My entities have Guid's for ids and I can query by id and there I pass in a Guid, but the resulting Id is base64 so I wouldn´t even be able to use that back into my query that got that result.
So my first question is basically how can I turn Guid conversion to base64 off?
And the second one is how would you use that base64 at all?
Beta Was this translation helpful? Give feedback.
All reactions