Handle no GraphQL variables

This commit is contained in:
Gregory Schier
2024-10-22 08:05:58 -07:00
parent 59b0b7321f
commit ab48f118af
2 changed files with 16 additions and 1 deletions

View File

@@ -54,6 +54,21 @@ describe('exporter-curl', () => {
);
});
test('Exports POST with GraphQL data no variables', async () => {
expect(
await pluginHookExport(ctx, {
url: 'https://yaak.app',
method: 'POST',
bodyType: 'graphql',
body: {
query : '{foo,bar}',
},
}),
).toEqual(
[`curl -X POST 'https://yaak.app'`, `--data-raw '{"query":"{foo,bar}"}'`].join(` \\\n `),
);
});
test('Exports PUT with multipart form', async () => {
expect(
await pluginHookExport(ctx, {