Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ const config: CodegenConfig = {
documents: ['src/renderer/utils/api/**/*.graphql'],
generates: {
'src/renderer/utils/api/graphql/generated/graphql.ts': {
plugins: ['typescript', 'typescript-operations', 'typed-document-node'],
plugins: ['typescript-operations', 'typed-document-node'],
config: {
onlyOperationTypes: true,
documentMode: 'string',
// enumType: 'native',
scalars: {
DateTime: 'string',
URI: '../../../../types#Link',
},
useTypeImports: true,
enumsAsTypes: true,
skipTypename: true,
fragmentMasking: false, // Disables masking
},
},
},
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@
"@biomejs/biome": "2.4.13",
"@discordapp/twemoji": "16.0.1",
"@electron/notarize": "3.1.1",
"@graphql-codegen/cli": "6.3.1",
"@graphql-codegen/schema-ast": "5.0.2",
"@graphql-codegen/cli": "7.0.0",
"@graphql-codegen/schema-ast": "6.0.0",
"@graphql-codegen/typescript-operations": "6.0.0",
"@graphql-typed-document-node/core": "3.2.0",
"@octokit/core": "7.0.6",
"@octokit/graphql": "9.0.3",
Expand Down
721 changes: 308 additions & 413 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/renderer/utils/api/__mocks__/response-mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function mockDiscussionResponseNode(mocks: {
number: 123,
title: 'This is a mock discussion',
url: 'https://github.com/gitify-app/notifications-test/discussions/123' as Link,
stateReason: mocks.stateReason,
stateReason: mocks.stateReason ?? null,
isAnswered: mocks.isAnswered,
author: mockAuthor,
comments: {
Expand All @@ -99,8 +99,8 @@ export function mockIssueResponseNode(mocks: {
number: 123,
title: 'PR Title',
state: mocks.state,
stateReason: mocks.stateReason,
url: 'https://github.com/gitify-app/notifications-test/issues/123',
stateReason: mocks.stateReason ?? null,
url: 'https://github.com/gitify-app/notifications-test/issues/123' as Link,
author: mockAuthor,
labels: { nodes: [] },
comments: { totalCount: 0, nodes: [] },
Expand Down Expand Up @@ -129,7 +129,7 @@ export function mockPullRequestResponseNode(mocks: {
isDraft: mocks.isDraft ?? false,
merged: mocks.merged ?? false,
isInMergeQueue: mocks.isInMergeQueue ?? false,
url: 'https://github.com/gitify-app/notifications-test/pulls/123',
url: 'https://github.com/gitify-app/notifications-test/pulls/123' as Link,
author: mockAuthor,
labels: { nodes: [] },
comments: {
Expand Down
7 changes: 3 additions & 4 deletions src/renderer/utils/api/graphql/MergeQueryBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { FragmentInfo, VariableDef } from './types';

import {
type Exact,
FetchMergedDetailsTemplateDocument,
type FetchMergedDetailsTemplateQueryVariables,
} from './generated/graphql';
Expand Down Expand Up @@ -102,7 +101,7 @@ export class MergeQueryBuilder {
* Set shared (non-indexed) variables
*/
setSharedVariables(
values: Exact<FetchBatchMergedTemplateNonIndexedVariables>,
values: FetchBatchMergedTemplateNonIndexedVariables,
): this {
for (const [name, value] of Object.entries(values)) {
this.setVariableValue(name, value as VariableValue);
Expand All @@ -115,7 +114,7 @@ export class MergeQueryBuilder {
* @param values The values for the selection set variables/arguments.
* @returns the computed node alias name
*/
addNode(values: Exact<FetchBatchMergedTemplateIndexedBaseVariables>): string {
addNode(values: FetchBatchMergedTemplateIndexedBaseVariables): string {
const index = this.selections.length;
const aliasWithIndex = `node${index}`;
this.addSelectionNodeFromQueryTemplate(aliasWithIndex, index, values);
Expand All @@ -128,7 +127,7 @@ export class MergeQueryBuilder {
private addSelectionNodeFromQueryTemplate(
alias: string,
index: number,
values: Exact<FetchBatchMergedTemplateIndexedBaseVariables>,
values: FetchBatchMergedTemplateIndexedBaseVariables,
): this {
const selection = aliasFieldAndSubstituteIndexedVars(
alias,
Expand Down
1 change: 0 additions & 1 deletion src/renderer/utils/api/graphql/discussion.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ fragment DiscussionDetails on Discussion {
}

fragment CommentFields on DiscussionComment {
databaseId
createdAt
author {
...AuthorFields
Expand Down
Loading
Loading