CeramicStreamID?

Hey, I’m making a chat app and when sending a message, I need to provide a CeramicStreamID as a profileId field… tried to provide the userProfile id, but got the error that’s it’s a model ID and not the stream one…

here’s my message model

type MyBasicProfile @loadModel(id: "kjzl6hvfrbw6c6ieqa2ux93xs3oehvmumgg1x95s6tyionswg1cpyh777x8pmol") {
	id: ID!
}

type Message @createModel(accountRelation: LIST, description: "A message") {
	Message: String! @string(minLength: 1, maxLength: 400)
	edited: DateTime
	sent: DateTime!
	profileID: StreamID! @documentReference(model: "MyBasicProfile")
	profile: MyBasicProfile! @relationDocument(property: "profileID")
}

and here’s the mutation I’m trying to make

const mutation = await composeClient.executeQuery(`
				mutation {
				createMessage(input: {
					content: {
						Message: "${message}"
						sent: "${new Date().toISOString()}"
						profileID: "CeramicStreamID NEEDED"
					}
				})
				{
					document {
						Message
						sent
						profileID
					}
				}
			}
				`);

Could you please give a hint on how to do it properly? Thanks

Hello @0x69A !

I figured it might be easier to answer your question by putting together a very rough code sample on my end: GitHub - mzkrasner/rough-example

If you look in /pages/index.tsx, you’ll see that I saved the result of the stream ID after creating a profile instance as ‘profStream’ which I then use when creating a message instance. You might also find it useful to check out how I compile basicProfile and message within /scripts/composites.mjs

Please let me know if this helps answer your question!