Skip to content

Instantly share code, notes, and snippets.

View taras's full-sized avatar

Taras Mankovski taras

View GitHub Profile
@taras
taras / environments-view.graphql
Last active October 14, 2022 17:40
Examples of using GraphQL Schema and Operations to define CLI from the server
query EnvironmentsView($cursor: String) {
@table
environments(first: 10, after: $cursor) {
nodes {
... on Environment {
name
namespace
deployment {
name
createdBy
query AllOrganizations($organization: String!, $endCursor: String) {
organizations(first: 100, after: $organization) {
pageInfo {
hasNextPage
endCursor
}
nodes {
... OrganizationNode
... on Organization {
repositories(first: 100, after: $endCursor) {
{
"data": {
"meta": [
{
"name": "Component",
"count": 1,
"vertices": {
"owner": {
"name": "Group",
"field": "owner",
type Person {
name: String
accounts: [Account]
}
type Account {
owner: Person! @inverse(of: "Person.accounts")
}

Create a pull request to each repository in an organization with a catalog-info.yaml file

To run this script, download this script to a folder on your computer and run npx zx create-prs.md.

Requirements

You must install the following utilities to run this script.

GitHub CLI

catalog:
locations:
- type: url
target: http://github.com/my-org/my-repo/blob/main/components.yaml
type Component {
ownedBy: ComponentOwners
providesApi: [API]
dependsOn: Component
parentOf: Component
childOf: Component
partOf: PartOf
}
union PartOf = Component | System | Domain
backend:
database:
client: pg
connection:
host: localhost
port: 5432
user: postgres
password: postgres
let app = createAppInteractor();
let signin = createAppInteractor();
describe("sign-in", () => {
describe("when user is anonymous", () => {
beforeEach(async () => {
await app.visit('/sign-in');
});
it("shows sign-in page", () => {
import { TestImplementation, Assertion, Test } from "@bigtest/suite";
const visit = (path: string) => async () => ({ path });
const exists = (selector: string) => () => ({ selector });
const notExists = (selector: string) => () => ({ selector });
const assert = (fn: () => boolean, expected: unknown) => (context: unknown) =>
Promise.resolve(expected);
const click = (selector: string) => async () => Promise.resolve();
const fillIn = (selector: string, value: string) => async () =>
Promise.resolve();