This commit is contained in:
tonyrewin 2022-11-21 08:55:22 +03:00
parent ea80131505
commit f6b084f66f
8 changed files with 16 additions and 9 deletions

View File

@ -1,5 +1,5 @@
overwrite: true
schema: 'http://localhost:8080'
schema: 'https://testapi.discours.io'
generates:
src/graphql/introspec.gen.ts:
plugins:

View File

@ -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) => {

View File

@ -13,8 +13,8 @@ export default gql`
_id: shouts
shouts
authors
# viewed
followers
viewed
}
}
}

View File

@ -12,7 +12,6 @@ export default gql`
_id: shouts
shouts
authors
# viewed
followers
}
}

View File

@ -12,7 +12,6 @@ export default gql`
_id: shouts
shouts
authors
# viewed
followers
}
}

View File

@ -13,7 +13,6 @@ export default gql`
_id: shouts
shouts
authors
# viewed
followers
}
}

View File

@ -667,7 +667,7 @@ export type TopicStat = {
rating?: Maybe<Scalars['Int']>
reacted: Scalars['Int']
shouts: Scalars['Int']
viewed: Scalars['Int']
viewed?: Maybe<Scalars['Int']>
}
export type User = {

View File

@ -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';