Closed Sebosek closed 3 years ago
It turns out, once I went through step no. 3 in Enable Relay support, you're no longer using integers as ID. The description of scalar type ID doesn't help, I would say, it makes more confusion than helping, but yeah... Just stop using numbers as ID, there is apparently some magic behind Hot Chocolate.
The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache.
The ID type appears in a JSON response as a String; however, it is not intended to be human-readable.
When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.
Hi @Sebosek Can you please more explain this problem and give some code how should look like that part.
thanks
At Step 3 when you create a speaker the Id is not encrypted. And that's why the query GetSpeakerById works only for step 3. At step 4 encryption is added - so you need to create the speakers again with mutation.
mutation AddSpeaker{ addSpeaker(input: { name:"Speaker Name" bio:"Speaker Bio" webSite:"https://speaker.com" }) { speaker{ id, name } } }
Then you will receive a result with an encrypted Id:
{ "data": { "addSpeaker": { "speaker": { "id": "U3BlYWtlcgppMTE=", "name": "Speaker Name" } } } }
In the end you need to query using the encrypted Id :
query GetSpeakerById { speaker1: speaker(id: "U3BlYWtlcgppMTE=") { name id } }
and you will get the expected result:
{ "data": { "speaker1": { "name": "Speaker Name", "id": "U3BlYWtlcgppMTE=" } } }
Hi,
I've just run into the problem at the end of part 4. I'm getting the following error:
My version of app is available here https://github.com/Sebosek/ConferencePlanner, probably I missing something.
The SpeakerQueries contains ID attribute with type int,
The SpeakerType contains
ImplementationNode
,And in ConfigureServices Relay is enabled
Any idea, what should I check?