diff --git a/packages/runtime/test/__snapshots__/runtime.test.ts.snap b/packages/runtime/test/__snapshots__/runtime.test.ts.snap index 4332d50b..2ed3af16 100644 --- a/packages/runtime/test/__snapshots__/runtime.test.ts.snap +++ b/packages/runtime/test/__snapshots__/runtime.test.ts.snap @@ -291,6 +291,7 @@ type Favorite implements Node { tag: String! note: String docID: CeramicStreamID! + extra: String doc: Node } @@ -453,6 +454,7 @@ input FavoriteInput { tag: String! note: String docID: CeramicStreamID! + extra: String } input SetOptionsInput { @@ -1649,6 +1651,7 @@ type Post implements Node & TestInterface { date: DateTime text: String! title: String! + testList: [String] testField: String """Account controlling the document""" @@ -1759,6 +1762,7 @@ input PostInput { date: DateTime text: String! title: String! + testList: [String] testField: String } @@ -1806,6 +1810,7 @@ scalar CeramicCommitID @specifiedBy(url: "https://cips.ceramic.network/CIPs/cip- input PartialPostInput { date: DateTime text: String + testList: [String] } type EnableIndexingPostPayload { diff --git a/packages/runtime/test/runtime.test.ts b/packages/runtime/test/runtime.test.ts index 00b41430..6e7beb15 100644 --- a/packages/runtime/test/runtime.test.ts +++ b/packages/runtime/test/runtime.test.ts @@ -989,12 +989,14 @@ describe('runtime', () => { title: String! @string(minLength: 10, maxLength: 100) @immutable text: String! @string(maxLength: 2000) testField: String @string(maxLength: 50) + testList: [String] @string(maxLength: 5) @list(maxLength: 5) @immutable } ` const originalTitle = 'An Original Post' const date = '2024-01-01T10:15:30Z' const text = 'First post content' const testField = 'A test field' + const testList = ['a', 'b', 'c'] const composite = await Composite.create({ ceramic, schema: postWithImmutableFieldSchema }) const definition = composite.toRuntime() @@ -1022,6 +1024,7 @@ describe('runtime', () => { text, date, testField, + testList, }, }, }, @@ -1042,13 +1045,16 @@ describe('runtime', () => { }` const res2 = await runtime.executeQuery(updatePost, { - i: { id: docID, content: { title: 'A different title' } }, + i: { id: docID, content: { title: 'A different title' }, testList: ['d', 'e'] }, }) - - expect(res2.errors).toBeDefined() + + expect(res2.errors?.length).toBe(2) expect(res2.errors![0].message).toEqual( `Variable "$i" got invalid value { title: "A different title" } at "i.content"; Field "title" is not defined by type "PartialPostInput". Did you mean "date"?`, ) + expect(res2.errors![1].message).toContain( + `Field "testList" is not defined by type "UpdatePostInput"`, + ) }, 60000) test('toggling `shouldIndex` metadata', async () => {