From f6b084f66f269c7bcba856bc304ec2632428a066 Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Mon, 21 Nov 2022 08:55:22 +0300 Subject: [PATCH] premerge --- codegen.yml | 2 +- src/graphql/client.ts | 15 ++++++++++++--- src/graphql/query/topics-all.ts | 2 +- src/graphql/query/topics-by-author.ts | 1 - src/graphql/query/topics-by-community.ts | 1 - src/graphql/query/topics-random.ts | 1 - src/graphql/types.gen.ts | 2 +- src/styles/_imports.scss | 1 + 8 files changed, 16 insertions(+), 9 deletions(-) diff --git a/codegen.yml b/codegen.yml index 44d1e541..2219d008 100644 --- a/codegen.yml +++ b/codegen.yml @@ -1,5 +1,5 @@ overwrite: true -schema: 'http://localhost:8080' +schema: 'https://testapi.discours.io' generates: src/graphql/introspec.gen.ts: plugins: diff --git a/src/graphql/client.ts b/src/graphql/client.ts index aebee452..ecd35ce2 100644 --- a/src/graphql/client.ts +++ b/src/graphql/client.ts @@ -2,9 +2,18 @@ import { createClient } from '@urql/core' import { isDev } from '../utils/config' const localClient = (options) => { - console.info('[graphql] using local client') - options.url = 'http://localhost:8080' - return createClient(options) + const url = 'http://localhost:8080' + let c + try { + c = createClient({ ...options, url }) + console.info('[graphql] using local client') + } catch (e) { + c = createClient(options) + console.info( + `[graphql] using ${options.url.replace('https://', '').replace('/graphql', '').replace('/', '')}` + ) + } + return c } export const initClient = (options) => { diff --git a/src/graphql/query/topics-all.ts b/src/graphql/query/topics-all.ts index e838f8e5..633d2d1d 100644 --- a/src/graphql/query/topics-all.ts +++ b/src/graphql/query/topics-all.ts @@ -13,8 +13,8 @@ export default gql` _id: shouts shouts authors - # viewed followers + viewed } } } diff --git a/src/graphql/query/topics-by-author.ts b/src/graphql/query/topics-by-author.ts index 90e7be5b..eaae45bc 100644 --- a/src/graphql/query/topics-by-author.ts +++ b/src/graphql/query/topics-by-author.ts @@ -12,7 +12,6 @@ export default gql` _id: shouts shouts authors - # viewed followers } } diff --git a/src/graphql/query/topics-by-community.ts b/src/graphql/query/topics-by-community.ts index 6545289e..32213a51 100644 --- a/src/graphql/query/topics-by-community.ts +++ b/src/graphql/query/topics-by-community.ts @@ -12,7 +12,6 @@ export default gql` _id: shouts shouts authors - # viewed followers } } diff --git a/src/graphql/query/topics-random.ts b/src/graphql/query/topics-random.ts index 2cf88e20..b85bf45c 100644 --- a/src/graphql/query/topics-random.ts +++ b/src/graphql/query/topics-random.ts @@ -13,7 +13,6 @@ export default gql` _id: shouts shouts authors - # viewed followers } } diff --git a/src/graphql/types.gen.ts b/src/graphql/types.gen.ts index e32832a6..a57bc253 100644 --- a/src/graphql/types.gen.ts +++ b/src/graphql/types.gen.ts @@ -667,7 +667,7 @@ export type TopicStat = { rating?: Maybe reacted: Scalars['Int'] shouts: Scalars['Int'] - viewed: Scalars['Int'] + viewed?: Maybe } export type User = { diff --git a/src/styles/_imports.scss b/src/styles/_imports.scss index 3224dcdf..f44faa83 100644 --- a/src/styles/_imports.scss +++ b/src/styles/_imports.scss @@ -2,6 +2,7 @@ @import 'globals'; @import 'bootstrap/scss/functions'; @import 'bootstrap/scss/variables'; +@import 'bootstrap/scss/maps'; @import 'bootstrap/scss/vendor/rfs'; @import 'bootstrap/scss/mixins/breakpoints'; @import 'bootstrap/scss/mixins/grid';