-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to remove temporary integration and component after a comp…
…onent:dev:test (#22) * Add option to remove temporary integration and component after a component:dev:test * PR Feedback
- Loading branch information
1 parent
d97ccd9
commit 9027550
Showing
7 changed files
with
90 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { gql, gqlRequest } from "../../graphql"; | ||
|
||
export const deleteComponentByKey = async (key: string) => { | ||
// Fetch a component by key | ||
const result = await gqlRequest({ | ||
document: gql` | ||
query component($key: String!) { | ||
components(key: $key, public: false) { | ||
nodes { | ||
id | ||
} | ||
} | ||
} | ||
`, | ||
variables: { | ||
key, | ||
}, | ||
}); | ||
// Delete the component by ID | ||
await gqlRequest({ | ||
document: gql` | ||
mutation deleteComponent($id: ID!) { | ||
deleteComponent(input: { id: $id }) { | ||
errors { | ||
field | ||
messages | ||
} | ||
} | ||
} | ||
`, | ||
variables: { id: result.components.nodes[0].id }, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters