diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..5fc0373 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +graphql/generated +node_modules diff --git a/.eslintrc.js b/.eslintrc.js index f83fbb7..6a99488 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,35 +1,24 @@ module.exports = { + root: true, env: { browser: true, - es6: true + node: true + }, + parser: 'vue-eslint-parser', + plugins: [ + '@typescript-eslint' + ], + parserOptions: { + "parser": "@typescript-eslint/parser", + requireConfigFile: false }, extends: [ - 'airbnb-base', - 'plugin:vue/recommended', - 'eslint:recommended', - 'prettier', - 'plugin:prettier/recommended' + '@nuxtjs', + '@nuxtjs/eslint-config-typescript', + 'plugin:nuxt/recommended', + 'prettier' ], - globals: { - Atomics: 'readonly', - SharedArrayBuffer: 'readonly' - }, - parserOptions: { - ecmaVersion: 2018, - sourceType: 'module' - }, - plugins: ['vue'], - rules: { - 'import/extensions': 0, - 'import/no-unresolved': 0, - 'no-param-reassign': 0, - 'prettier/prettier': [ - 'error', - { - trailingComma: 'none', - singleQuote: true, - semi: false - } - ] - } + ignorePatterns: ["graphql/generated/*"], + // add your custom rules here + rules: {} } diff --git a/.gitignore b/.gitignore index 5ef3e00..d35eb3d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules .nuxt dist +.eslintcache diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..3e3dc36 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,106 @@ +### +# Place your Prettier ignore content here + +### +# .gitignore content is duplicated here due to https://github.com/prettier/prettier/issues/8506 + +# Created by .ignore support plugin (hsz.mobi) +### Node template +# Logs +/logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# Nuxt generate +dist + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless + +# IDE / Editor +.idea + +# Service worker +sw.* + +# macOS +.DS_Store + +# Vim swap files +*.swp + +.eslintrc.js +.gitlab-ci.yml +.gitlab/dependabot.yml +.prettierignore +codegen.yml +graphql/generated/* +k8s/* +nuxt.config.js +tsconfig.json diff --git a/.prettierrc b/.prettierrc index c50384f..b2095be 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,4 @@ { - "trailingComma": "none", - "tabWidth": 2, "semi": false, "singleQuote": true } diff --git a/codegen.yml b/codegen.yml index ef8d782..f5be168 100644 --- a/codegen.yml +++ b/codegen.yml @@ -1,6 +1,22 @@ -schema: ./schema.graphql -overwrite: true +schema: ./graphql/schema.graphql +documents: './graphql/**/*.graphql' generates: - ./fragmentTypes.json: + ./graphql/generated/operations.ts: plugins: - - fragment-matcher + - typescript + - typescript-operations + - typescript-vue-apollo + - fragment-matcher + config: + fetcher: fetch + avoidOptionals: + field: true + inputValue: true + object: false + defaultValue: true + maybeValue: T | null | undefined + strictScalars: true + scalars: + LocalDate: string + LocalDateTime: string + vueCompositionApiImportFrom: vue diff --git a/components/pages/events/Event/index.vue b/components/pages/events/Event/index.vue index 0d5f27f..a822a37 100644 --- a/components/pages/events/Event/index.vue +++ b/components/pages/events/Event/index.vue @@ -1,13 +1,13 @@ - diff --git a/components/pages/events/List/index.vue b/components/pages/events/List/index.vue index 14a6014..5e4715b 100644 --- a/components/pages/events/List/index.vue +++ b/components/pages/events/List/index.vue @@ -1,14 +1,14 @@ diff --git a/components/pages/events/index.vue b/components/pages/events/index.vue index b88dbe8..e7a2b0c 100644 --- a/components/pages/events/index.vue +++ b/components/pages/events/index.vue @@ -1,42 +1,46 @@ - diff --git a/components/pages/filters/List/index.vue b/components/pages/filters/List/index.vue index c47b35f..08d677a 100644 --- a/components/pages/filters/List/index.vue +++ b/components/pages/filters/List/index.vue @@ -1,5 +1,5 @@ diff --git a/fragmentTypes.json b/fragmentTypes.json deleted file mode 100644 index 4c36539..0000000 --- a/fragmentTypes.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "__schema": { - "types": [] - } -} \ No newline at end of file diff --git a/graphql/generated/operations.ts b/graphql/generated/operations.ts new file mode 100644 index 0000000..ee205c1 --- /dev/null +++ b/graphql/generated/operations.ts @@ -0,0 +1,571 @@ +import gql from 'graphql-tag'; +import * as VueApolloComposable from '@vue/apollo-composable'; +import * as VueCompositionApi from 'vue'; +export type Maybe = T | null | undefined; +export type InputMaybe = T | null | undefined; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type ReactiveFunction = () => TParam; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + LocalDate: string; + LocalDateTime: string; +}; + +/** Band */ +export type Band = { + __typename?: 'Band'; + created: Scalars['LocalDateTime']; + id: Maybe; + name: Scalars['String']; +}; + +/** DanceHall */ +export type DanceHall = { + __typename?: 'DanceHall'; + city: Maybe; + created: Scalars['LocalDateTime']; + id: Maybe; + latitude: Maybe; + longitude: Maybe; + municipality: Maybe; + name: Maybe; + state: Maybe; +}; + +/** DanceHallDistance */ +export type DanceHallDistance = { + __typename?: 'DanceHallDistance'; + distance: Scalars['Int']; + duration: Scalars['String']; + origin: Scalars['String']; +}; + +/** Event */ +export type Event = { + __typename?: 'Event'; + /** The band of the event */ + band: Maybe; + created: Scalars['LocalDateTime']; + /** The place of the event */ + danceHall: Maybe; + /** The date of the event */ + date: Scalars['LocalDate']; + /** The driving distances and driving durations to the event from the provided origins */ + distances: Array; + /** Additional information regarding the event */ + extraInfo: Maybe; + id: Maybe; + /** The time of the event */ + time: Maybe; +}; + +export type Mutation = { + __typename?: 'Mutation'; + /** Remove provided origin from authenticated user */ + RemoveOrigin: Scalars['Boolean']; + /** Save provided origin for authenticated user */ + SaveOrigin: Scalars['Boolean']; + /** Toggle band in ignore list */ + ToggleIgnoreBand: Scalars['Boolean']; + /** Toggle city in ignore list */ + ToggleIgnoreCity: Scalars['Boolean']; + /** Toggle dance hall in ignore list */ + ToggleIgnoreDanceHall: Scalars['Boolean']; + /** Toggle municipality in ignore list */ + ToggleIgnoreMunicipality: Scalars['Boolean']; + /** Toggle state in ignore list */ + ToggleIgnoreState: Scalars['Boolean']; +}; + + +export type MutationRemoveOriginArgs = { + origin: Scalars['String']; +}; + + +export type MutationSaveOriginArgs = { + origin: Scalars['String']; +}; + + +export type MutationToggleIgnoreBandArgs = { + name: Scalars['String']; +}; + + +export type MutationToggleIgnoreCityArgs = { + name: Scalars['String']; +}; + + +export type MutationToggleIgnoreDanceHallArgs = { + name: Scalars['String']; +}; + + +export type MutationToggleIgnoreMunicipalityArgs = { + name: Scalars['String']; +}; + + +export type MutationToggleIgnoreStateArgs = { + name: Scalars['String']; +}; + +export type Query = { + __typename?: 'Query'; + /** Fetch address for provided lat/long */ + AddressFromLatLng: Scalars['String']; + /** Find bands given provided criteria */ + Bands: Array; + /** Find dance halls given provided criteria */ + DanceHalls: Array; + /** Find events given provided criteria */ + Events: Array; + /** Fetch ignored bands for authenticated user */ + IgnoredBands: Array; + /** Fetch ignored cities for authenticated user */ + IgnoredCities: Array; + /** Fetch ignored dance halls for authenticated user */ + IgnoredDanceHalls: Array; + /** Fetch ignored municipalities for authenticated user */ + IgnoredMunicipalities: Array; + /** Fetch ignored states for authenticated user */ + IgnoredStates: Array; + /** Fetch origins for authenticated user */ + Origins: Array; +}; + + +export type QueryAddressFromLatLngArgs = { + latlng: Scalars['String']; +}; + + +export type QueryEventsArgs = { + origins?: InputMaybe>; + range?: InputMaybe; +}; + +export enum Range { + OneMonth = 'ONE_MONTH', + OneQuarter = 'ONE_QUARTER', + OneWeek = 'ONE_WEEK', + OneYear = 'ONE_YEAR', + TwoWeeks = 'TWO_WEEKS' +} + +export type RemoveOriginMutationVariables = Exact<{ + origin: Scalars['String']; +}>; + + +export type RemoveOriginMutation = { __typename?: 'Mutation', removed: boolean }; + +export type SaveOriginMutationVariables = Exact<{ + origin: Scalars['String']; +}>; + + +export type SaveOriginMutation = { __typename?: 'Mutation', saved: boolean }; + +export type ToggleIgnoreBandMutationVariables = Exact<{ + name: Scalars['String']; +}>; + + +export type ToggleIgnoreBandMutation = { __typename?: 'Mutation', ignore: boolean }; + +export type ToggleIgnoreCityMutationVariables = Exact<{ + name: Scalars['String']; +}>; + + +export type ToggleIgnoreCityMutation = { __typename?: 'Mutation', ignore: boolean }; + +export type ToggleIgnoreDanceHallMutationVariables = Exact<{ + name: Scalars['String']; +}>; + + +export type ToggleIgnoreDanceHallMutation = { __typename?: 'Mutation', ignore: boolean }; + +export type ToggleIgnoreMunicipalityMutationVariables = Exact<{ + name: Scalars['String']; +}>; + + +export type ToggleIgnoreMunicipalityMutation = { __typename?: 'Mutation', ignore: boolean }; + +export type ToggleIgnoreStateMutationVariables = Exact<{ + name: Scalars['String']; +}>; + + +export type ToggleIgnoreStateMutation = { __typename?: 'Mutation', ignore: boolean }; + +export type FetchAddressQueryVariables = Exact<{ + latlng: Scalars['String']; +}>; + + +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<{ + range?: InputMaybe; + origins?: InputMaybe | Scalars['String']>; + includeOrigins: Scalars['Boolean']; +}>; + + +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) +} + `; + +/** + * __useRemoveOriginMutation__ + * + * To run a mutation, you first call `useRemoveOriginMutation` within a Vue component and pass it any options that fit your needs. + * When your component renders, `useRemoveOriginMutation` returns an object that includes: + * - A mutate function that you can call at any time to execute the mutation + * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return + * + * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options; + * + * @example + * const { mutate, loading, error, onDone } = useRemoveOriginMutation({ + * variables: { + * origin: // value for 'origin' + * }, + * }); + */ +export function useRemoveOriginMutation(options: VueApolloComposable.UseMutationOptions | ReactiveFunction>) { + return VueApolloComposable.useMutation(RemoveOriginDocument, options); +} +export type RemoveOriginMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn; +export const SaveOriginDocument = gql` + mutation SaveOrigin($origin: String!) { + saved: SaveOrigin(origin: $origin) +} + `; + +/** + * __useSaveOriginMutation__ + * + * To run a mutation, you first call `useSaveOriginMutation` within a Vue component and pass it any options that fit your needs. + * When your component renders, `useSaveOriginMutation` returns an object that includes: + * - A mutate function that you can call at any time to execute the mutation + * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return + * + * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options; + * + * @example + * const { mutate, loading, error, onDone } = useSaveOriginMutation({ + * variables: { + * origin: // value for 'origin' + * }, + * }); + */ +export function useSaveOriginMutation(options: VueApolloComposable.UseMutationOptions | ReactiveFunction>) { + return VueApolloComposable.useMutation(SaveOriginDocument, options); +} +export type SaveOriginMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn; +export const ToggleIgnoreBandDocument = gql` + mutation ToggleIgnoreBand($name: String!) { + ignore: ToggleIgnoreBand(name: $name) +} + `; + +/** + * __useToggleIgnoreBandMutation__ + * + * To run a mutation, you first call `useToggleIgnoreBandMutation` within a Vue component and pass it any options that fit your needs. + * When your component renders, `useToggleIgnoreBandMutation` returns an object that includes: + * - A mutate function that you can call at any time to execute the mutation + * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return + * + * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options; + * + * @example + * const { mutate, loading, error, onDone } = useToggleIgnoreBandMutation({ + * variables: { + * name: // value for 'name' + * }, + * }); + */ +export function useToggleIgnoreBandMutation(options: VueApolloComposable.UseMutationOptions | ReactiveFunction>) { + return VueApolloComposable.useMutation(ToggleIgnoreBandDocument, options); +} +export type ToggleIgnoreBandMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn; +export const ToggleIgnoreCityDocument = gql` + mutation ToggleIgnoreCity($name: String!) { + ignore: ToggleIgnoreCity(name: $name) +} + `; + +/** + * __useToggleIgnoreCityMutation__ + * + * To run a mutation, you first call `useToggleIgnoreCityMutation` within a Vue component and pass it any options that fit your needs. + * When your component renders, `useToggleIgnoreCityMutation` returns an object that includes: + * - A mutate function that you can call at any time to execute the mutation + * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return + * + * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options; + * + * @example + * const { mutate, loading, error, onDone } = useToggleIgnoreCityMutation({ + * variables: { + * name: // value for 'name' + * }, + * }); + */ +export function useToggleIgnoreCityMutation(options: VueApolloComposable.UseMutationOptions | ReactiveFunction>) { + return VueApolloComposable.useMutation(ToggleIgnoreCityDocument, options); +} +export type ToggleIgnoreCityMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn; +export const ToggleIgnoreDanceHallDocument = gql` + mutation ToggleIgnoreDanceHall($name: String!) { + ignore: ToggleIgnoreDanceHall(name: $name) +} + `; + +/** + * __useToggleIgnoreDanceHallMutation__ + * + * To run a mutation, you first call `useToggleIgnoreDanceHallMutation` within a Vue component and pass it any options that fit your needs. + * When your component renders, `useToggleIgnoreDanceHallMutation` returns an object that includes: + * - A mutate function that you can call at any time to execute the mutation + * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return + * + * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options; + * + * @example + * const { mutate, loading, error, onDone } = useToggleIgnoreDanceHallMutation({ + * variables: { + * name: // value for 'name' + * }, + * }); + */ +export function useToggleIgnoreDanceHallMutation(options: VueApolloComposable.UseMutationOptions | ReactiveFunction>) { + return VueApolloComposable.useMutation(ToggleIgnoreDanceHallDocument, options); +} +export type ToggleIgnoreDanceHallMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn; +export const ToggleIgnoreMunicipalityDocument = gql` + mutation ToggleIgnoreMunicipality($name: String!) { + ignore: ToggleIgnoreMunicipality(name: $name) +} + `; + +/** + * __useToggleIgnoreMunicipalityMutation__ + * + * To run a mutation, you first call `useToggleIgnoreMunicipalityMutation` within a Vue component and pass it any options that fit your needs. + * When your component renders, `useToggleIgnoreMunicipalityMutation` returns an object that includes: + * - A mutate function that you can call at any time to execute the mutation + * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return + * + * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options; + * + * @example + * const { mutate, loading, error, onDone } = useToggleIgnoreMunicipalityMutation({ + * variables: { + * name: // value for 'name' + * }, + * }); + */ +export function useToggleIgnoreMunicipalityMutation(options: VueApolloComposable.UseMutationOptions | ReactiveFunction>) { + return VueApolloComposable.useMutation(ToggleIgnoreMunicipalityDocument, options); +} +export type ToggleIgnoreMunicipalityMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn; +export const ToggleIgnoreStateDocument = gql` + mutation ToggleIgnoreState($name: String!) { + ignore: ToggleIgnoreState(name: $name) +} + `; + +/** + * __useToggleIgnoreStateMutation__ + * + * To run a mutation, you first call `useToggleIgnoreStateMutation` within a Vue component and pass it any options that fit your needs. + * When your component renders, `useToggleIgnoreStateMutation` returns an object that includes: + * - A mutate function that you can call at any time to execute the mutation + * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return + * + * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options; + * + * @example + * const { mutate, loading, error, onDone } = useToggleIgnoreStateMutation({ + * variables: { + * name: // value for 'name' + * }, + * }); + */ +export function useToggleIgnoreStateMutation(options: VueApolloComposable.UseMutationOptions | ReactiveFunction>) { + return VueApolloComposable.useMutation(ToggleIgnoreStateDocument, options); +} +export type ToggleIgnoreStateMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn; +export const FetchAddressDocument = gql` + query FetchAddress($latlng: String!) { + address: AddressFromLatLng(latlng: $latlng) +} + `; + +/** + * __useFetchAddressQuery__ + * + * To run a query within a Vue component, call `useFetchAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useFetchAddressQuery` returns an object from Apollo Client that contains result, loading and error properties + * you can use to render your UI. + * + * @param variables that will be passed into the query + * @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options; + * + * @example + * const { result, loading, error } = useFetchAddressQuery({ + * latlng: // value for 'latlng' + * }); + */ +export function useFetchAddressQuery(variables: FetchAddressQueryVariables | VueCompositionApi.Ref | ReactiveFunction, options: VueApolloComposable.UseQueryOptions | VueCompositionApi.Ref> | ReactiveFunction> = {}) { + return VueApolloComposable.useQuery(FetchAddressDocument, variables, options); +} +export function useFetchAddressLazyQuery(variables: FetchAddressQueryVariables | VueCompositionApi.Ref | ReactiveFunction, options: VueApolloComposable.UseQueryOptions | VueCompositionApi.Ref> | ReactiveFunction> = {}) { + return VueApolloComposable.useLazyQuery(FetchAddressDocument, variables, options); +} +export type FetchAddressQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn; +export const FetchFiltersDocument = gql` + query FetchFilters { + bands: IgnoredBands + cities: IgnoredCities + states: IgnoredStates + danceHalls: IgnoredDanceHalls + municipalities: IgnoredMunicipalities +} + `; + +/** + * __useFetchFiltersQuery__ + * + * To run a query within a Vue component, call `useFetchFiltersQuery` and pass it any options that fit your needs. + * When your component renders, `useFetchFiltersQuery` returns an object from Apollo Client that contains result, loading and error properties + * you can use to render your UI. + * + * @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options; + * + * @example + * const { result, loading, error } = useFetchFiltersQuery(); + */ +export function useFetchFiltersQuery(options: VueApolloComposable.UseQueryOptions | VueCompositionApi.Ref> | ReactiveFunction> = {}) { + return VueApolloComposable.useQuery(FetchFiltersDocument, {}, options); +} +export function useFetchFiltersLazyQuery(options: VueApolloComposable.UseQueryOptions | VueCompositionApi.Ref> | ReactiveFunction> = {}) { + return VueApolloComposable.useLazyQuery(FetchFiltersDocument, {}, options); +} +export type FetchFiltersQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn; +export const FindEventsDocument = gql` + query FindEvents($range: Range, $origins: [String!], $includeOrigins: Boolean!) { + events: Events(range: $range, origins: $origins) { + date + time + band { + name + } + danceHall { + name + city + municipality + state + } + extraInfo + distances { + origin + distance + duration + } + } + origins: Origins @include(if: $includeOrigins) +} + `; + +/** + * __useFindEventsQuery__ + * + * To run a query within a Vue component, call `useFindEventsQuery` and pass it any options that fit your needs. + * When your component renders, `useFindEventsQuery` returns an object from Apollo Client that contains result, loading and error properties + * you can use to render your UI. + * + * @param variables that will be passed into the query + * @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options; + * + * @example + * const { result, loading, error } = useFindEventsQuery({ + * range: // value for 'range' + * origins: // value for 'origins' + * includeOrigins: // value for 'includeOrigins' + * }); + */ +export function useFindEventsQuery(variables: FindEventsQueryVariables | VueCompositionApi.Ref | ReactiveFunction, options: VueApolloComposable.UseQueryOptions | VueCompositionApi.Ref> | ReactiveFunction> = {}) { + return VueApolloComposable.useQuery(FindEventsDocument, variables, options); +} +export function useFindEventsLazyQuery(variables: FindEventsQueryVariables | VueCompositionApi.Ref | ReactiveFunction, options: VueApolloComposable.UseQueryOptions | VueCompositionApi.Ref> | ReactiveFunction> = {}) { + return VueApolloComposable.useLazyQuery(FindEventsDocument, variables, options); +} +export type FindEventsQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn; +export const FindOriginsDocument = gql` + query FindOrigins { + origins: Origins +} + `; + +/** + * __useFindOriginsQuery__ + * + * To run a query within a Vue component, call `useFindOriginsQuery` and pass it any options that fit your needs. + * When your component renders, `useFindOriginsQuery` returns an object from Apollo Client that contains result, loading and error properties + * you can use to render your UI. + * + * @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options; + * + * @example + * const { result, loading, error } = useFindOriginsQuery(); + */ +export function useFindOriginsQuery(options: VueApolloComposable.UseQueryOptions | VueCompositionApi.Ref> | ReactiveFunction> = {}) { + return VueApolloComposable.useQuery(FindOriginsDocument, {}, options); +} +export function useFindOriginsLazyQuery(options: VueApolloComposable.UseQueryOptions | VueCompositionApi.Ref> | ReactiveFunction> = {}) { + return VueApolloComposable.useLazyQuery(FindOriginsDocument, {}, options); +} +export type FindOriginsQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn; + + export interface PossibleTypesResultData { + possibleTypes: { + [key: string]: string[] + } + } + const result: PossibleTypesResultData = { + "possibleTypes": {} +}; + export default result; + \ No newline at end of file diff --git a/graphql/mutations/RemoveOrigin.graphql b/graphql/mutations/RemoveOrigin.graphql new file mode 100644 index 0000000..7717510 --- /dev/null +++ b/graphql/mutations/RemoveOrigin.graphql @@ -0,0 +1,3 @@ +mutation RemoveOrigin($origin: String!) { + removed: RemoveOrigin(origin: $origin) +} diff --git a/graphql/mutations/SaveOrigin.graphql b/graphql/mutations/SaveOrigin.graphql new file mode 100644 index 0000000..611cae5 --- /dev/null +++ b/graphql/mutations/SaveOrigin.graphql @@ -0,0 +1,3 @@ +mutation SaveOrigin($origin: String!) { + saved: SaveOrigin(origin: $origin) +} diff --git a/graphql/mutations/ToggleIgnoreBand.graphql b/graphql/mutations/ToggleIgnoreBand.graphql new file mode 100644 index 0000000..b96f03e --- /dev/null +++ b/graphql/mutations/ToggleIgnoreBand.graphql @@ -0,0 +1,3 @@ +mutation ToggleIgnoreBand($name: String!) { + ignore: ToggleIgnoreBand(name: $name) +} diff --git a/graphql/mutations/ToggleIgnoreCity.graphql b/graphql/mutations/ToggleIgnoreCity.graphql new file mode 100644 index 0000000..31398df --- /dev/null +++ b/graphql/mutations/ToggleIgnoreCity.graphql @@ -0,0 +1,3 @@ +mutation ToggleIgnoreCity($name: String!) { + ignore: ToggleIgnoreCity(name: $name) +} diff --git a/graphql/mutations/ToggleIgnoreDanceHall.graphql b/graphql/mutations/ToggleIgnoreDanceHall.graphql new file mode 100644 index 0000000..a9426b6 --- /dev/null +++ b/graphql/mutations/ToggleIgnoreDanceHall.graphql @@ -0,0 +1,3 @@ +mutation ToggleIgnoreDanceHall($name: String!) { + ignore: ToggleIgnoreDanceHall(name: $name) +} diff --git a/graphql/mutations/ToggleIgnoreMunicipality.graphql b/graphql/mutations/ToggleIgnoreMunicipality.graphql new file mode 100644 index 0000000..a954cb7 --- /dev/null +++ b/graphql/mutations/ToggleIgnoreMunicipality.graphql @@ -0,0 +1,3 @@ +mutation ToggleIgnoreMunicipality($name: String!) { + ignore: ToggleIgnoreMunicipality(name: $name) +} diff --git a/graphql/mutations/ToggleIgnoreState.graphql b/graphql/mutations/ToggleIgnoreState.graphql new file mode 100644 index 0000000..45f4987 --- /dev/null +++ b/graphql/mutations/ToggleIgnoreState.graphql @@ -0,0 +1,3 @@ +mutation ToggleIgnoreState($name: String!) { + ignore: ToggleIgnoreState(name: $name) +} diff --git a/graphql/queries/FetchAddress.graphql b/graphql/queries/FetchAddress.graphql new file mode 100644 index 0000000..648775d --- /dev/null +++ b/graphql/queries/FetchAddress.graphql @@ -0,0 +1,3 @@ +query FetchAddress($latlng: String!) { + address: AddressFromLatLng(latlng: $latlng) +} diff --git a/graphql/queries/FetchFilters.graphql b/graphql/queries/FetchFilters.graphql new file mode 100644 index 0000000..a3ebd89 --- /dev/null +++ b/graphql/queries/FetchFilters.graphql @@ -0,0 +1,7 @@ +query FetchFilters { + bands: IgnoredBands + cities: IgnoredCities + states: IgnoredStates + danceHalls: IgnoredDanceHalls + municipalities: IgnoredMunicipalities +} diff --git a/graphql/queries/FindEvents.graphql b/graphql/queries/FindEvents.graphql new file mode 100644 index 0000000..a26f13a --- /dev/null +++ b/graphql/queries/FindEvents.graphql @@ -0,0 +1,22 @@ +query FindEvents($range: Range, $origins: [String!], $includeOrigins: Boolean!) { + events: Events(range: $range, origins: $origins) { + date + time + band { + name + } + danceHall { + name + city + municipality + state + } + extraInfo + distances { + origin + distance + duration + } + } + origins: Origins @include(if: $includeOrigins) +} diff --git a/graphql/queries/FindOrigins.graphql b/graphql/queries/FindOrigins.graphql new file mode 100644 index 0000000..ee03d32 --- /dev/null +++ b/graphql/queries/FindOrigins.graphql @@ -0,0 +1,3 @@ +query FindOrigins { + origins: Origins +} diff --git a/schema.graphql b/graphql/schema.graphql similarity index 100% rename from schema.graphql rename to graphql/schema.graphql diff --git a/layouts/components/themed.vue b/layouts/components/themed.vue index 0b425bb..023efd2 100644 --- a/layouts/components/themed.vue +++ b/layouts/components/themed.vue @@ -5,12 +5,16 @@ diff --git a/layouts/default.vue b/layouts/default.vue index 2c94145..79319ca 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -1,11 +1,11 @@ - - - -