I’ve used webpack-notes as my template and even when I’m using it vanilla I’m seeing this behaviour.
I’ve cloned it and when I try to npm install I get
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: webpack-notes-app@0.2.1
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR! react@"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.0" from @mui/styles@5.10.3
npm ERR! node_modules/@mui/styles
npm ERR! @mui/styles@"^5.10.2" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Since it’s just an UI stuff I just delete @mui/styles
from package.json.
I update ceramic and compose dependencies to:
"@ceramicnetwork/http-client": "^2.3.4",
"@composedb/client": "^0.2.2",
"@composedb/types": "^0.2.2",
"@ceramicnetwork/common": "^2.6.0",
"@composedb/devtools": "^0.2.2",
"@composedb/devtools-node": "^0.2.2",
And on the CLI if I do ceramic -v
I get 2.6.0
Then, if I run npm start
I get
Uncaught Error: Cannot use GraphQLScalarType "String" from another module or realm.
Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.
https://yarnpkg.com/en/docs/selective-version-resolutions
Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
at instanceOf (instanceOf.mjs:40:19)
at isScalarType (definition.mjs:110:77)
at isType (definition.mjs:88:5)
at isNullableType (definition.mjs:379:10)
at new GraphQLNonNull (definition.mjs:340:5)
at SchemaBuilder._buildScalarFieldType (schema.js:368:33)
at fields (schema.js:220:44)
at resolveObjMapThunk (definition.mjs:434:40)
at defineFieldMap (definition.mjs:689:20)
at GraphQLObjectType._fields (definition.mjs:616:26)
To solve this I need to delete graphql from node_modules and install it again.
Then I run the node with ceramic daemon --network testnet-clay
, I create the models with npm run composite:create
I add them to daemon.config.json and restart the node. This is what I see, the first 2 models are the new ones.
[2022-09-15T13:20:23.823Z] IMPORTANT: Initializing SQLite connection
[2022-09-15T13:20:23.987Z] IMPORTANT: Starting Ceramic Daemon at version 2.6.0 with config:
{
"anchor": {},
"http-api": {
"cors-allowed-origins": [
".*"
]
},
"ipfs": {
"mode": "bundled"
},
"logger": {
"log-level": 2,
"log-to-files": false
},
"metrics": {
"metrics-exporter-enabled": false,
"metrics-port": 9090
},
"network": {
"name": "testnet-clay"
},
"node": {},
"state-store": {
"mode": "fs",
"local-directory": "/home/julianperassi/.ceramic/statestore/"
},
"indexing": {
"db": "sqlite:///home/julianperassi/.ceramic/indexing.sqlite",
"allow-queries-before-historical-sync": true,
"models": [
"kjzl6hvfrbw6cb2yftu20wt9ii6o2zp0ztbq9ude4drvv141l2rbo3g48jud4o1",
"kjzl6hvfrbw6cap6rp7s4hmbw4x546fgcvtkamjlj3fk6ar19yejcz6ezk1awkr",
"kjzl6hvfrbw6c9165gygecqama77d0t4283s5uzsrcj6wtldhqd9w7e4gofts9e",
"kjzl6hvfrbw6c7ugfnougx0qh3mrs5whlecxiqnncrao4kc114emyc1m2wmkjhq",
"kjzl6hvfrbw6ca3xk14tygmgqu4q26216v8pl3reufwz0lmhcrug5nt5gte224q",
"kjzl6hvfrbw6catecxj62xgpcu80jk4uryfu3k25cmwh46pzmscs5upsix2nl9c",
"kjzl6hvfrbw6c6iz705zvkkcrf3mhvk3lc13z1vnxq18mwmkon8y6bidicggvbc"
]
}
}
[2022-09-15T13:20:24.049Z] IMPORTANT: Connecting to ceramic network 'testnet-clay' using pubsub topic '/ceramic/testnet-clay'
Then I compile them with npm run composite:compile
and npm run composite:serve
to graphiQL where I can create notes with:
mutation CreateNote($input: CreateNoteInput!) {
createNote(input: $input) {
document {
id
}
}
}
But if I try to fetch them with
query NotesList($cursor: String) {
viewer {
noteList(last: 5, before: $cursor) {
edges {
node {
id
title
}
}
pageInfo {
hasPreviousPage
startCursor
}
}
}
}
I get
{
"data": {
"viewer": {
"noteList": {
"edges": [],
"pageInfo": {
"hasPreviousPage": false,
"startCursor": null
}
}
}
}
}
But if I
query NotesList {
noteIndex(last: 10) {
edges {
node {
id
}
}
}
}
I’m getting the notes I’ve added.
Any guess what can be? Also, I’m not sure how $cursor works, but even if I take out the logic around it I’m getting
{
"data": {
"viewer": {
"noteList": {
"edges": []
}
}
}
}