Convert request bodies when changing type (#499)

This commit is contained in:
Gregory Schier
2026-07-04 22:22:35 -07:00
committed by GitHub
parent e52853cc2d
commit eb2a2dd775
13 changed files with 1065 additions and 151 deletions
@@ -66,6 +66,25 @@ describe("exporter-curl", () => {
);
});
test("Exports POST with GraphQL operation name", async () => {
expect(
await convertToCurl({
url: "https://yaak.app",
method: "POST",
bodyType: "graphql",
body: {
query: "query Foo { foo } query Bar { bar }",
operationName: "Foo",
},
}),
).toEqual(
[
`curl -X POST 'https://yaak.app'`,
`--data '{"query":"query Foo { foo } query Bar { bar }","operationName":"Foo"}'`,
].join(" \\\n "),
);
});
test("Exports POST with GraphQL data no variables", async () => {
expect(
await convertToCurl({