Skip to content

Commit

Permalink
Test query_get_body
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav committed Mar 25, 2024
1 parent 6892586 commit b438976
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions schema_test.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ schema {
}

type Query {
foo(key: Int): String
bar: [String!]!
foo: [String!]!
bar(key: Int): String
person(id: ID!): Person
}

Expand Down
13 changes: 10 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
@@ -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}}")
})

0 comments on commit b438976

Please sign in to comment.