From 1c5737b68acaf842ff7a93fc12fa59dffb01191b Mon Sep 17 00:00:00 2001 From: Dan Ribbens Date: Wed, 19 Apr 2023 09:48:31 -0400 Subject: [PATCH] chore: add graphql variable to collection-graphql test (#2525) --- test/collections-graphql/int.spec.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/collections-graphql/int.spec.ts b/test/collections-graphql/int.spec.ts index bff7e50227..4dbffcaabb 100644 --- a/test/collections-graphql/int.spec.ts +++ b/test/collections-graphql/int.spec.ts @@ -44,6 +44,20 @@ describe('collections-graphql', () => { expect(doc.id.length).toBeGreaterThan(0); }); + it('should create using graphql variables', async () => { + const query = `mutation Create($title: String!) { + createPost(data: {title: $title}) { + id + title + } + }`; + const response = await client.request(query, { title }); + const doc: Post = response.createPost; + + expect(doc).toMatchObject({ title }); + expect(doc.id.length).toBeGreaterThan(0); + }); + it('should read', async () => { const query = `query { Post(id: "${existingDoc.id}") {