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.
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
schema: ./graphql/schema.graphql
|
||||
schema: http://localhost:6080/query
|
||||
documents: './graphql/**/*.graphql'
|
||||
generates:
|
||||
./graphql/generated/operations.ts:
|
||||
|
||||
@@ -25,7 +25,7 @@ export type Scalars = {
|
||||
export type Band = {
|
||||
__typename?: 'Band'
|
||||
created: Scalars['LocalDateTime']['output']
|
||||
id: Maybe<Scalars['Int']['output']>
|
||||
id: Maybe<Scalars['String']['output']>
|
||||
name: Scalars['String']['output']
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export type DanceHall = {
|
||||
__typename?: 'DanceHall'
|
||||
city: Maybe<Scalars['String']['output']>
|
||||
created: Scalars['LocalDateTime']['output']
|
||||
id: Maybe<Scalars['Int']['output']>
|
||||
id: Maybe<Scalars['String']['output']>
|
||||
latitude: Maybe<Scalars['Float']['output']>
|
||||
longitude: Maybe<Scalars['Float']['output']>
|
||||
municipality: Maybe<Scalars['String']['output']>
|
||||
@@ -64,7 +64,7 @@ export type Event = {
|
||||
distances: Array<DanceHallDistance>
|
||||
/** Additional information regarding the event */
|
||||
extraInfo: Maybe<Scalars['String']['output']>
|
||||
id: Maybe<Scalars['Int']['output']>
|
||||
id: Maybe<Scalars['String']['output']>
|
||||
/** The time of the event */
|
||||
time: Maybe<Scalars['String']['output']>
|
||||
}
|
||||
@@ -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<Scalars['String']['output']>
|
||||
}
|
||||
|
||||
|
||||
export type QueryAddressFromLatLngArgs = {
|
||||
latlng: Scalars['String']['input']
|
||||
}
|
||||
|
||||
|
||||
export type QueryEventsArgs = {
|
||||
includeHidden?: InputMaybe<Scalars['Boolean']['input']>
|
||||
origins?: InputMaybe<Array<Scalars['String']['input']>>
|
||||
@@ -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<string>; cities: Array<string>; states: Array<string>; danceHalls: Array<string>; municipalities: Array<string> }
|
||||
|
||||
export type FindEventsQueryVariables = Exact<{
|
||||
@@ -218,12 +236,15 @@ export type FindEventsQueryVariables = Exact<{
|
||||
includeHidden?: InputMaybe<Scalars['Boolean']['input']>
|
||||
}>
|
||||
|
||||
export type FindEventsQuery = { __typename?: 'Query'; origins: Array<string>; 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<string>; 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<string> }
|
||||
|
||||
|
||||
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
|
||||
|
||||
+1
-1
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user