This repository has been archived by the owner on Jul 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature apollo client upgrade (#413)
* upgrade apollo client to 3.x * add apollo as a dev dependency * remove daily related features * migrate apollo client to use v3 and react hooks (for article-fetcher) * fix issues regarding to comments on #413 * bump antd version * rename hook name * update #413 * update import Helmet * fix relative path * update redux * fix koa router wildcard issue * update #413 * fix webpack and graphql compatibility issue * fix IFFE and qury operation name * fix tests * fix build * clean up * fix tests * clean up icons * update Co-authored-by: Anonymous <anonymous@test.com>
- Loading branch information
Showing
75 changed files
with
1,212 additions
and
1,538 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"extends": [ | ||
"@puncsky/eslint-config-onefx-react", | ||
"@puncsky/eslint-config-onefx" | ||
], | ||
"rules": { | ||
"import/no-extraneous-dependencies": ["warn", {"devDependencies": false, "optionalDependencies": false, "peerDependencies": false}] | ||
}, | ||
"ignorePatterns": ["src/client/static/*", "src/client/static/**/*", "src/shared/common/google-analytics.js"] | ||
} | ||
"extends": [ | ||
"@puncsky/eslint-config-onefx", | ||
"@puncsky/eslint-config-onefx-react" | ||
], | ||
"ignorePatterns": ["src/client/static/**/*"], | ||
"rules": { | ||
"import/no-extraneous-dependencies": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,3 +53,5 @@ dump.rdb | |
.vscode/ | ||
|
||
package-lock.json | ||
|
||
__generated__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
client: { | ||
localSchemaFile: "src/api-gateway/api-gateway.graphql", | ||
includes: ["src/shared/**/*.{ts,tsx,js,jsx,graphql}"] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
export default { | ||
require: [ | ||
'ts-node/register', | ||
], | ||
files: [ | ||
'src/**/*.test.ts', | ||
], | ||
require: ["tsconfig-paths/register", "ts-node/register"], | ||
files: ["src/**/*.test.ts"], | ||
compileEnhancements: false, | ||
extensions: [ | ||
'ts', | ||
], | ||
extensions: ["ts"] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module.exports = { | ||
server: { | ||
cdnBase: "https://touchbase.ai/", | ||
proxy: true, | ||
cookie: { | ||
secrets: JSON.parse( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/usr/bin/env node | ||
import { startServer } from "./src/server"; | ||
|
||
startServer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
// @flow | ||
import { | ||
ArticleMeta, | ||
loadDir, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import gql from "graphql-tag"; | ||
|
||
export const getArticles = gql` | ||
query GetArticles($id: String!) { | ||
articles(id: $id) { | ||
title | ||
contentHTML | ||
} | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { useQuery, ApolloError } from "@apollo/client"; | ||
import { | ||
GetArticles, | ||
GetArticlesVariables | ||
} from "../data/__generated__/GetArticles"; | ||
import { getArticles } from "../data/queries"; | ||
|
||
export const useGetArticles = ( | ||
variables?: GetArticlesVariables | ||
): { | ||
loading: boolean; | ||
error?: ApolloError; | ||
data?: GetArticles; | ||
} => { | ||
const { loading, error, data } = useQuery<GetArticles, GetArticlesVariables>( | ||
getArticles, | ||
{ | ||
ssr: false, | ||
variables | ||
} | ||
); | ||
return { loading, error, data }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.