Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
chore: remove sequence from bruno files
Browse files Browse the repository at this point in the history
  • Loading branch information
mvantellingen committed Sep 3, 2024
1 parent f3045d3 commit 66fad8d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/real-bananas-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@labdigital/graphql-codegen-bruno": patch
---

Remove sequence from bruno files
2 changes: 0 additions & 2 deletions src/bruno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { FileContent } from "./operations";

export const asBruno = async (
operation: FileContent,
sequence: number,
defaults: Record<string, unknown>,
) => {
const formattedContent = await prettier.format(operation.content, {
Expand All @@ -16,7 +15,6 @@ export const asBruno = async (
meta {
name: ${operation.name}
type: graphql
seq: ${sequence}
}
post {
Expand Down
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ export const plugin: PluginFunction<BrunoPluginConfig> = async (
}

const operations = extractOperations(schema, documents);
let i = 0;
const result: Record<string, Record<string, string>> = {};
for (const operation of operations) {
const fileName = `${operation.name}.bru`;
const outputPath = path.join(outputDir, fileName);

const formattedContent = await asBruno(operation, i, config.defaults);
const formattedContent = await asBruno(operation, config.defaults);

fs.outputFileSync(outputPath, formattedContent);
result[operation.name] = {
Expand All @@ -40,7 +39,6 @@ export const plugin: PluginFunction<BrunoPluginConfig> = async (
? path.relative(outputDir, operation.location)
: "(unknown)",
};
i++;
}
return JSON.stringify(result, null, 2);
};

0 comments on commit 66fad8d

Please sign in to comment.