Deterministic genesis commits [..] must not have content

I’m following the ComposeDB docs and trying to make a mutation to the SimpleProfile used in the example. However, I get the following error:

Error: Deterministic genesis commits for ModelInstanceDocuments must not have content

When trying to run the following query:

mutation CreateSimpleProfile($input: CreateSimpleProfileInput!) {
  createSimpleProfile(input: $input) {
    document {
      id
      displayName
    }
  }
}

With the following input:

{ content: { displayName: "My name" } }

I tried removing the content but it’s required by the schema. So my question would be how can I create a simple profile without content? Or what am I doing wrong here?

Hi!

Can you please paste your code for creating without content?

Hey! :slight_smile:

I have managed to get past this issue – I think it was by upgrading the composedb packages from 0.2.0 to 0.2.1. I see some things in this pull request maybe it was that.

However, I now have a new issue. When I run the following graphQL query:

const CREATE_PROFILE = gql`
  mutation CreateSimpleProfile($input: CreateSimpleProfileInput!) {
    createSimpleProfile(input: $input) {
      clientMutationId
      document {
        id
        displayName
        version
      }
    }
  }
`;

Using the compose execute method:

let data = await compose.execute(CREATE_PROFILE, {
  input: {
    content: {
      displayName: "Max",
    },
  },
});

I get the following response:

{
    "errors": [
        {
            "message": "Cannot read properties of undefined (reading 'replace')",
            "path": [
                "createSimpleProfile"
            ]
        }
    ],
    "data": {
        "createSimpleProfile": null
    }
}

This is the original error:

"TypeError: Cannot read properties of undefined (reading 'replace')
    at fromStringNoThrow (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-KNZDKGVQ.js?v=b5c7dc6a:221:30)
    at StreamID.fromString (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-KNZDKGVQ.js?v=b5c7dc6a:214:18)
    at DocumentLoader.create (http://127.0.0.1:5173/node_modules/.vite/deps/@composedb_client.js?v=b5c7dc6a:7720:59)
    at Context.createDoc (http://127.0.0.1:5173/node_modules/.vite/deps/@composedb_client.js?v=b5c7dc6a:7848:56)
    at mutateAndGetPayload (http://127.0.0.1:5173/node_modules/.vite/deps/@composedb_client.js?v=b5c7dc6a:10851:142)
    at resolve (http://127.0.0.1:5173/node_modules/.vite/deps/@composedb_client.js?v=b5c7dc6a:2863:27)
    at executeField (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-BFCDMZKB.js?v=b5c7dc6a:9419:20)
    at http://127.0.0.1:5173/node_modules/.vite/deps/chunk-BFCDMZKB.js?v=b5c7dc6a:9351:22
    at promiseReduce (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-BFCDMZKB.js?v=b5c7dc6a:9137:106)
    at executeFieldsSerially (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-BFCDMZKB.js?v=b5c7dc6a:9347:10)"

Any ideas what this could mean?

Hi, the ComposeDB developer preview is not officially released yet, please wait for the official release announcement and make sure you use the latest releases of packages at the time of the announcement to avoid such issues.
You will also need to re-create and compile any composite you may have created prior to these releases.