From d5c99ca9766c90fb7833fb2057b3ed0495604093 Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Tue, 4 Nov 2025 11:39:59 +0100 Subject: [PATCH] fix: update operation IDs to string type in GraphQL schema Change the type of the `id` field from `Int` to `String` in the GraphQL schema for `Band`, `DanceHall`, and `Event` types. This improves consistency in data representation. Also, modify the `codegen` command in `package.json` to simplify the linting process for generated files, ensuring cleaner code practices. --- codegen.yml | 2 +- graphql/generated/operations.ts | 32 +++++++++++++++++++++++++++----- package.json | 2 +- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/codegen.yml b/codegen.yml index 8821649..a404160 100644 --- a/codegen.yml +++ b/codegen.yml @@ -1,4 +1,4 @@ -schema: ./graphql/schema.graphql +schema: http://localhost:6080/query documents: './graphql/**/*.graphql' generates: ./graphql/generated/operations.ts: diff --git a/graphql/generated/operations.ts b/graphql/generated/operations.ts index e20e44e..c7506b7 100644 --- a/graphql/generated/operations.ts +++ b/graphql/generated/operations.ts @@ -25,7 +25,7 @@ export type Scalars = { export type Band = { __typename?: 'Band' created: Scalars['LocalDateTime']['output'] - id: Maybe + id: Maybe name: Scalars['String']['output'] } @@ -34,7 +34,7 @@ export type DanceHall = { __typename?: 'DanceHall' city: Maybe created: Scalars['LocalDateTime']['output'] - id: Maybe + id: Maybe latitude: Maybe longitude: Maybe municipality: Maybe @@ -64,7 +64,7 @@ export type Event = { distances: Array /** Additional information regarding the event */ extraInfo: Maybe - id: Maybe + id: Maybe /** The time of the event */ time: Maybe } @@ -87,30 +87,37 @@ export type Mutation = { ToggleIgnoreState: Scalars['Boolean']['output'] } + export type MutationRemoveOriginArgs = { origin: Scalars['String']['input'] } + export type MutationSaveOriginArgs = { origin: Scalars['String']['input'] } + export type MutationToggleIgnoreBandArgs = { name: Scalars['String']['input'] } + export type MutationToggleIgnoreCityArgs = { name: Scalars['String']['input'] } + export type MutationToggleIgnoreDanceHallArgs = { name: Scalars['String']['input'] } + export type MutationToggleIgnoreMunicipalityArgs = { name: Scalars['String']['input'] } + export type MutationToggleIgnoreStateArgs = { name: Scalars['String']['input'] } @@ -139,10 +146,12 @@ export type Query = { Origins: Array } + export type QueryAddressFromLatLngArgs = { latlng: Scalars['String']['input'] } + export type QueryEventsArgs = { includeHidden?: InputMaybe origins?: InputMaybe> @@ -162,52 +171,61 @@ export type RemoveOriginMutationVariables = Exact<{ origin: Scalars['String']['input'] }> + export type RemoveOriginMutation = { __typename?: 'Mutation'; removed: boolean } export type SaveOriginMutationVariables = Exact<{ origin: Scalars['String']['input'] }> + export type SaveOriginMutation = { __typename?: 'Mutation'; saved: boolean } export type ToggleIgnoreBandMutationVariables = Exact<{ name: Scalars['String']['input'] }> + export type ToggleIgnoreBandMutation = { __typename?: 'Mutation'; ignore: boolean } export type ToggleIgnoreCityMutationVariables = Exact<{ name: Scalars['String']['input'] }> + export type ToggleIgnoreCityMutation = { __typename?: 'Mutation'; ignore: boolean } export type ToggleIgnoreDanceHallMutationVariables = Exact<{ name: Scalars['String']['input'] }> + export type ToggleIgnoreDanceHallMutation = { __typename?: 'Mutation'; ignore: boolean } export type ToggleIgnoreMunicipalityMutationVariables = Exact<{ name: Scalars['String']['input'] }> + export type ToggleIgnoreMunicipalityMutation = { __typename?: 'Mutation'; ignore: boolean } export type ToggleIgnoreStateMutationVariables = Exact<{ name: Scalars['String']['input'] }> + export type ToggleIgnoreStateMutation = { __typename?: 'Mutation'; ignore: boolean } export type FetchAddressQueryVariables = Exact<{ latlng: Scalars['String']['input'] }> + export type FetchAddressQuery = { __typename?: 'Query'; address: string } export type FetchFiltersQueryVariables = Exact<{ [key: string]: never }> + export type FetchFiltersQuery = { __typename?: 'Query'; bands: Array; cities: Array; states: Array; danceHalls: Array; municipalities: Array } export type FindEventsQueryVariables = Exact<{ @@ -218,12 +236,15 @@ export type FindEventsQueryVariables = Exact<{ includeHidden?: InputMaybe }> -export type FindEventsQuery = { __typename?: 'Query'; origins: Array; events: Array<{ __typename?: 'Event'; date: string; time: string | null | undefined; extraInfo: string | null | undefined; band: { __typename?: 'Band'; name: string } | null | undefined; danceHall: { __typename?: 'DanceHall'; name: string | null | undefined; city: string | null | undefined; municipality: string | null | undefined; state: string | null | undefined } | null | undefined; distances: Array<{ __typename?: 'DanceHallDistance'; origin: string; distance: number; duration: string }> }> } + +export type FindEventsQuery = { __typename?: 'Query'; origins?: Array; events: Array<{ __typename?: 'Event'; date: string; time: string | null | undefined; extraInfo: string | null | undefined; band: { __typename?: 'Band'; name: string } | null | undefined; danceHall: { __typename?: 'DanceHall'; name: string | null | undefined; city: string | null | undefined; municipality: string | null | undefined; state: string | null | undefined } | null | undefined; distances: Array<{ __typename?: 'DanceHallDistance'; origin: string; distance: number; duration: string }> }> } export type FindOriginsQueryVariables = Exact<{ [key: string]: never }> + export type FindOriginsQuery = { __typename?: 'Query'; origins: Array } + export const RemoveOriginDocument = gql` mutation RemoveOrigin($origin: String!) { removed: RemoveOrigin(origin: $origin) @@ -558,6 +579,7 @@ export interface PossibleTypesResultData { } } const result: PossibleTypesResultData = { - possibleTypes: {}, + 'possibleTypes': {}, } export default result + \ No newline at end of file diff --git a/package.json b/package.json index f6e2571..1586e43 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint:style": "stylelint \"**/*.{css,scss,sass,html,vue}\" --ignore-path .gitignore", "lint": "npm run lint:js && npm run lint:style", "lintfix": "eslint --fix . && npm run lint:style --fix", - "codegen": "graphql-codegen && eslint --ext \".ts\" --ignore-path .gitignore graphql/generated/operations.ts --fix" + "codegen": "graphql-codegen && eslint graphql/generated/operations.ts --fix" }, "devDependencies": { "@commitlint/cli": "20.1.0",