Hello!
I used the ComposeDBExample (GitHub - ceramicstudio/ComposeDbExampleApp) and adapted it to implement discussion on dao proposals in my application. I created a new model proposals needed for my application:
"type BasicProfile @loadModel(id: “$PROFILE_ID”) {
id: ID!
}
type Proposals @createModel(accountRelation: LIST, description: “A Dbrains proposal”)
@createIndex(fields: [{ path: “aragonProposalID” }]) {
title: String! @string(minLength: 1, maxLength: 100)
summary: String! @string(minLength: 1, maxLength: 100)
description: String! @string(minLength: 1, maxLength: 100)
aragonProposalID: String! @string(minLength: 1, maxLength: 200)
created: DateTime!
edited: DateTime!
profileId: StreamID! @documentReference(model:“BasicProfile”)
profile: BasicProfile! @relationDocument(property: “profileId”)
}"
I updated the composites.mjs script accordingly to deploy the new model in relation to the others from composeDbExample:
"export const writeComposite = async (spinner) => {
await authenticate();
const profileComposite = await createComposite(
ceramic,
“./composites/00-basicProfile.graphql”
);
console.log(“profileComposite.modelIDs:”, profileComposite.modelIDs);
const proposalsSchema = readFileSync(“./composites/00-proposals.graphql”, {
encoding: “utf-8”,
}).replace(“$PROFILE_ID”, profileComposite.modelIDs[0]);
const proposalsComposite = await Composite.create({
ceramic,
schema: proposalsSchema,
});
console.log(“proposalsComposite.modelIDs:”, proposalsComposite.modelIDs);
const postsSchema = readFileSync(“./composites/01-posts.graphql”, {
encoding: “utf-8”,
})
.replace(“$PROFILE_ID”, profileComposite.modelIDs[0])
.replace(“$PROPOSAL_ID”, proposalsComposite.modelIDs[1]);
const postsComposite = await Composite.create({
ceramic,
schema: postsSchema,
});
const followingSchema = readFileSync(“./composites/02-following.graphql”, {
encoding: “utf-8”,
}).replace(“$PROFILE_ID”, profileComposite.modelIDs[0]);
const followingComposite = await Composite.create({
ceramic,
schema: followingSchema,
});
const postProfileSchema = readFileSync(
“./composites/03-postsProfile.graphql”,
{
encoding: “utf-8”,
}
)
.replace(“$POSTS_ID”, postsComposite.modelIDs[2])
.replace(“$PROFILE_ID”, profileComposite.modelIDs[0]);
console.log(“postsComposite.modelIDs:”, postsComposite.modelIDs);
console.log(“profileComposite.modelIDs:”, profileComposite.modelIDs);
const postsProfileComposite = await Composite.create({
ceramic,
schema: postProfileSchema,
});
const commentsSchema = readFileSync(“./composites/04-comments.graphql”, {
encoding: “utf-8”,
})
.replace(“$POSTS_ID”, postsComposite.modelIDs[2])
.replace(“$PROFILE_ID”, profileComposite.modelIDs[0]);
const commentsComposite = await Composite.create({
ceramic,
schema: commentsSchema,
});
console.log(“commentsComposite.modelIDs:”, commentsComposite.modelIDs);
const commentsPostsSchema = readFileSync(
“./composites/05-commentsPosts.graphql”,
{
encoding: “utf-8”,
}
)
.replace(“$COMMENTS_ID”, commentsComposite.modelIDs[2])
.replace(“$POSTS_ID”, postsComposite.modelIDs[1]);
const commentsPostsComposite = await Composite.create({
ceramic,
schema: commentsPostsSchema,
});
const composite = Composite.from([
profileComposite,
proposalsComposite,
postsComposite,
followingComposite,
postsProfileComposite,
commentsComposite,
commentsPostsComposite,
]);
await writeEncodedComposite(composite, “./src/generated/definition.json”);
spinner.info(“creating composite for runtime usage”);
await writeEncodedCompositeRuntime(
ceramic,
“./src/generated/definition.json”,
“./src/generated/definition.js”
);
spinner.info(“deploying composite”);
const deployComposite = await readEncodedComposite(
ceramic,
“./src/generated/definition.json”
);
await deployComposite.startIndexingOn(ceramic);
spinner.succeed(“composite deployed & ready for use”);
};"
It was working fine until I updated ceramic libraries in order to implement the session login using web3modal and walletConnect as described in the latest example of MarkZK (GitHub - ceramicstudio/walletconnect-tutorial: A demo application that coincides with a separate tutorial that shows how WalletConnect's Web3Modal can be used with Ceramic to create authenticated user sessions.).
I updated libraries from:
“”@ceramicnetwork/blockchain-utils-linking": “2.11.0”,
“@ceramicnetwork/cli”: “2.38.0”,
“@ceramicnetwork/common”: “2.33.0”,
“@ceramicnetwork/http-client”: “2.30.0”,
“@composedb/cli”: “0.5.0”,
“@composedb/client”: “0.5.0”,
“@composedb/devtools”: “0.5.0”,
“@composedb/devtools-node”: “0.5.0”,
“@didtools/cacao”: “2.0.0”,
“@didtools/pkh-ethereum”: “0.1.0”,
“did-session”: “^1.0.0”,
“dids”: “^3.2.0”,"
to:
“@ceramicnetwork/blockchain-utils-linking”: “3.2.0”,
“@ceramicnetwork/cli”: “^3.2.0”,
“@ceramicnetwork/common”: “^3.2.0”,
“@ceramicnetwork/http-client”: “^3.2.0”,
“@composedb/cli”: “^0.6.0”,
“@composedb/client”: “^0.6.0”,
“@composedb/devtools”: “^0.6.0”,
“@composedb/devtools-node”: “^0.6.0”,
“@didtools/cacao”: “2.0.0”,
“@didtools/pkh-ethereum”: “^0.4.1”,
“did-session”: “^3.0.2”,
“dids”: “^3.2.0”,".
After the update, I got the error:" Unhandled Runtime Error
Error: Model not found for relation with ID kjzl6hvfrbw6c9dlyxlrdr14p9heu6fb6blss50d4mjftjz01iegqfgnjquotqf on field proposals"
and the proposals model is not showing up in models in definition.js.
Any idea where it can come from and how to fix it?
Thanks