diff --git a/schema_test.graphql b/schema_test.graphql index e4de59e..a1de578 100644 --- a/schema_test.graphql +++ b/schema_test.graphql @@ -3,8 +3,8 @@ schema { } type Query { - foo(key: Int): String - bar: [String!]! + foo: [String!]! + bar(key: Int): String person(id: ID!): Person } diff --git a/test.js b/test.js index f360d73..7ba5eeb 100644 --- a/test.js +++ b/test.js @@ -1,7 +1,14 @@ import * as t from "node:test" import * as assert from "node:assert/strict" -import * as client from "./build/client.js" // Generated +import * as gql from "./build/client.js" // Generated -t.test("test", () => { - +t.test("query_get_body", () => { + const query_foo = gql.query_get_body_foo({}) + assert.equal(query_foo, "query{foo}") + + const query_bat = gql.query_get_body_bar({key: 1}) + assert.equal(query_bat, "query{bar(key:1)}") + + const query_person = gql.query_get_body_person({id: "123"}) + assert.equal(query_person, "query{person(id:\"123\"){id name age}}") }) \ No newline at end of file