Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add initial graphql changes #61

Merged
merged 3 commits into from
Oct 30, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend/src/data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { initMigration1665782029662 } from "migrations/1665782029662-init-migrat
import { addUniqueConstraintApiEndpoint1666678487137 } from "migrations/1666678487137-add-unique-constraint-api-endpoint"
import { dropAnalyzedColumnFromApiTrace1666752646836 } from "migrations/1666752646836-drop-analyzed-column-from-api-trace"
import { addIndexForDataField1666941075032 } from "migrations/1666941075032-add-index-for-data-field"
import { addIsgraphqlColumnApiEndpoint1667095325334 } from "migrations/1667095325334-add-isgraphql-column-api-endpoint"

export const AppDataSource: DataSource = new DataSource({
type: "postgres",
Expand All @@ -47,6 +48,7 @@ export const AppDataSource: DataSource = new DataSource({
addUniqueConstraintApiEndpoint1666678487137,
dropAnalyzedColumnFromApiTrace1666752646836,
addIndexForDataField1666941075032,
addIsgraphqlColumnApiEndpoint1667095325334,
],
migrationsRun: runMigration,
logging: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { MigrationInterface, QueryRunner } from "typeorm"

export class addIsgraphqlColumnApiEndpoint1667095325334
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE api_endpoint ADD COLUMN IF NOT EXISTS "isGraphQl" BOOLEAN NOT NULL DEFAULT FALSE`,
)
await queryRunner.query(
`CREATE INDEX IF NOT EXISTS "isGraphQl_api_endpoint" ON "api_endpoint" ("isGraphQl")`,
)
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP INDEX IF EXISTS "isGraphQl_api_endpoint"`)
await queryRunner.query(
`ALTER TABLE api_endpoint DROP COLUMN IF EXISTS "isGraphQl"`,
)
}
}
3 changes: 3 additions & 0 deletions backend/src/models/api-endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export class ApiEndpoint extends BaseEntity {
@Column({ type: "bool", nullable: true })
isAuthenticatedUserSet: boolean

@Column({ type: "bool", default: false })
isGraphQl: boolean

@Column({ nullable: true })
openapiSpecName: string

Expand Down
1 change: 1 addition & 0 deletions backend/src/utils/words.json
Original file line number Diff line number Diff line change
Expand Up @@ -129063,6 +129063,7 @@
"grapewise": 1,
"grapewort": 1,
"graph": 1,
"graphql": 1,
"graphalloy": 1,
"graphanalysis": 1,
"graphed": 1,
Expand Down
1 change: 1 addition & 0 deletions common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ export interface ApiEndpoint {
openapiSpecName: string
isAuthenticatedDetected: boolean
isAuthenticatedUserSet: boolean
isGraphQl: boolean
}

export interface ApiEndpointDetailed extends ApiEndpoint {
Expand Down