Skip to content

Commit

Permalink
refactor(web): replace graphql-tag by graphql parse (#22194)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongbo-miao authored Jan 2, 2025
1 parent e556218 commit afaf4ad
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 29 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ The diagram illustrates the repository's architecture, which is considered overl
- **Vite** - JavaScript build tool and development server
- **TanStack Query** - Hooks for fetching, caching and updating asynchronous data
- **RxJS** - Asynchronous programming with observable streams
- **graphql-tag** - GraphQL query parsing
- **Bulma** - CSS framework
- **PurgeCSS** - Unused CSS removing
- **Jest** - Unit testing, snapshot testing
Expand Down
16 changes: 0 additions & 16 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"bulma": "1.0.3",
"clsx": "2.1.1",
"graphql": "16.10.0",
"graphql-tag": "2.12.6",
"graphql-ws": "5.16.0",
"normalize.css": "8.0.1",
"react": "19.0.0",
Expand Down
6 changes: 3 additions & 3 deletions web/src/Home/queries/meNamesFragment.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { gql } from 'graphql-tag';
import { parse } from 'graphql';

const meNamesFragment = gql`
const meNamesFragment = parse(`
fragment meNames on Me {
firstName
lastName
}
`;
`);

export default meNamesFragment;
9 changes: 5 additions & 4 deletions web/src/Home/queries/meQuery.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { print } from 'graphql';
import { gql } from 'graphql-tag';
import { print, parse } from 'graphql';
import meNamesFragment from './meNamesFragment';

const meQuery = print(gql`
const meQuery = print(
parse(`
query Me {
me {
name
Expand All @@ -11,6 +11,7 @@ const meQuery = print(gql`
}
}
${meNamesFragment}
`);
`),
);

export default meQuery;
9 changes: 5 additions & 4 deletions web/src/health/queries/pingSubscription.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { print } from 'graphql';
import { gql } from 'graphql-tag';
import { print, parse } from 'graphql';

const pingSubscription = print(gql`
const pingSubscription = print(
parse(`
subscription {
ping
}
`);
`),
);

export default pingSubscription;

0 comments on commit afaf4ad

Please sign in to comment.