Skip to content
Draft
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
6 changes: 6 additions & 0 deletions .changeset/@graphql-codegen_cli-10496-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@graphql-codegen/cli": patch
---
dependencies updates:
- Updated dependency [`@graphql-codegen/client-preset@^5.2.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/client-preset/v/5.2.0) (from `^5.1.2`, in `dependencies`)
- Updated dependency [`@graphql-codegen/plugin-helpers@^6.1.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/plugin-helpers/v/6.1.0) (from `^6.0.0`, in `dependencies`)
10 changes: 10 additions & 0 deletions .changeset/@graphql-codegen_client-preset-10496-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@graphql-codegen/client-preset": patch
---
dependencies updates:
- Updated dependency [`@graphql-codegen/typed-document-node@^6.1.3` ↗︎](https://www.npmjs.com/package/@graphql-codegen/typed-document-node/v/6.1.3) (from `^6.1.2`, in `dependencies`)
- Updated dependency [`@graphql-codegen/typescript@^5.0.5` ↗︎](https://www.npmjs.com/package/@graphql-codegen/typescript/v/5.0.5) (from `^5.0.4`, in `dependencies`)
- Updated dependency [`@graphql-codegen/typescript-operations@^5.0.5` ↗︎](https://www.npmjs.com/package/@graphql-codegen/typescript-operations/v/5.0.5) (from `^5.0.4`, in `dependencies`)
- Updated dependency [`@graphql-codegen/gql-tag-operations@5.1.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/gql-tag-operations/v/5.1.0) (from `5.0.5`, in `dependencies`)
- Updated dependency [`@graphql-codegen/plugin-helpers@^6.1.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/plugin-helpers/v/6.1.0) (from `^6.0.0`, in `dependencies`)
- Updated dependency [`@graphql-codegen/visitor-plugin-common@^6.2.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/visitor-plugin-common/v/6.2.0) (from `^6.1.2`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@graphql-codegen/gql-tag-operations": patch
---
dependencies updates:
- Updated dependency [`@graphql-codegen/plugin-helpers@^6.1.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/plugin-helpers/v/6.1.0) (from `^6.0.0`, in `dependencies`)
- Updated dependency [`@graphql-codegen/visitor-plugin-common@6.2.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/visitor-plugin-common/v/6.2.0) (from `6.1.2`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@graphql-codegen/graphql-modules-preset": patch
---
dependencies updates:
- Updated dependency [`@graphql-codegen/plugin-helpers@^6.1.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/plugin-helpers/v/6.1.0) (from `^6.0.0`, in `dependencies`)
- Updated dependency [`@graphql-codegen/visitor-plugin-common@6.2.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/visitor-plugin-common/v/6.2.0) (from `6.1.2`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@graphql-codegen/typed-document-node": patch
---
dependencies updates:
- Updated dependency [`@graphql-codegen/plugin-helpers@^6.1.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/plugin-helpers/v/6.1.0) (from `^6.0.0`, in `dependencies`)
- Updated dependency [`@graphql-codegen/visitor-plugin-common@6.2.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/visitor-plugin-common/v/6.2.0) (from `6.1.2`, in `dependencies`)
6 changes: 6 additions & 0 deletions .changeset/@graphql-codegen_typescript-10496-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@graphql-codegen/typescript": patch
---
dependencies updates:
- Updated dependency [`@graphql-codegen/plugin-helpers@^6.1.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/plugin-helpers/v/6.1.0) (from `^6.0.0`, in `dependencies`)
- Updated dependency [`@graphql-codegen/visitor-plugin-common@6.2.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/visitor-plugin-common/v/6.2.0) (from `6.1.2`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@graphql-codegen/typescript-document-nodes": patch
---
dependencies updates:
- Updated dependency [`@graphql-codegen/plugin-helpers@^6.1.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/plugin-helpers/v/6.1.0) (from `^6.0.0`, in `dependencies`)
- Updated dependency [`@graphql-codegen/visitor-plugin-common@6.2.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/visitor-plugin-common/v/6.2.0) (from `6.1.2`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@graphql-codegen/typescript-operations": patch
---
dependencies updates:
- Updated dependency [`@graphql-codegen/plugin-helpers@^6.1.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/plugin-helpers/v/6.1.0) (from `^6.0.0`, in `dependencies`)
- Updated dependency [`@graphql-codegen/typescript@^5.0.5` ↗︎](https://www.npmjs.com/package/@graphql-codegen/typescript/v/5.0.5) (from `^5.0.4`, in `dependencies`)
- Updated dependency [`@graphql-codegen/visitor-plugin-common@6.2.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/visitor-plugin-common/v/6.2.0) (from `6.1.2`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@graphql-codegen/typescript-resolvers": patch
---
dependencies updates:
- Updated dependency [`@graphql-codegen/plugin-helpers@^6.1.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/plugin-helpers/v/6.1.0) (from `^6.0.0`, in `dependencies`)
- Updated dependency [`@graphql-codegen/typescript@^5.0.5` ↗︎](https://www.npmjs.com/package/@graphql-codegen/typescript/v/5.0.5) (from `^5.0.4`, in `dependencies`)
- Updated dependency [`@graphql-codegen/visitor-plugin-common@6.2.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/visitor-plugin-common/v/6.2.0) (from `6.1.2`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/visitor-plugin-common": patch
---
dependencies updates:
- Updated dependency [`@graphql-codegen/plugin-helpers@^6.1.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/plugin-helpers/v/6.1.0) (from `^6.0.0`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/curly-trees-lead.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/typescript-operations': major
---

BREAKING CHANGE: typescript-operations plugin now generates enum if it is used in operation.
6 changes: 6 additions & 0 deletions .changeset/khaki-turtles-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@graphql-codegen/typescript-operations': major
'@graphql-codegen/typescript': minor
---

The `typescript-operations` plugin no longer generates InputMaybe and Scalars types; it now uses native Typescript types instead.
7 changes: 7 additions & 0 deletions .changeset/lovely-sloths-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@graphql-codegen/typescript-operations': major
'@graphql-codegen/typescript': major
'@graphql-codegen/client-preset': major
---

BREAKING CHANGE: `typescript` plugin no longer generates `Exact` utility type. Instead, `typescript-operations` generates said utility type for every file it creates. This is because it is used _only_ for `Variables`, so we only need to generate it once for every generated operation file.
5 changes: 5 additions & 0 deletions .changeset/proud-cougars-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/visitor-plugin-common': major
---

BREAKING CHANGE: `@graphql-codegen/visitor-plugin-common`'s `base-types-visitor` no longer has `getNodeComment` or `buildEnumValuesBlock` method.
5 changes: 5 additions & 0 deletions .changeset/silly-kiwis-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/typescript': patch
---

Extract utilities from base-type-visitor to be shared with other plugins later: convertSchemaEnumToDeclarationBlockString, getNodeComment
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
push:
branches:
- master
- master-next # FIXME:eddeee888 Remove once done
pull_request:
branches:
- master
- master-next # FIXME:eddeee888 Remove once released

env:
NODE_OPTIONS: '--max_old_space_size=4096'
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FIXME:eddeee888

<div>
<img src="./logo.svg" width="150px" alt="GraphQL Code Generator logo"/>
<a href="https://the-guild.dev">
Expand Down
34 changes: 23 additions & 11 deletions dev-test/githunt/typed-document-nodes.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: { input: string; output: string };
Expand Down Expand Up @@ -169,8 +169,20 @@ export enum VoteType {
Up = 'UP',
}

/** A list of options for the sort order of the feed */
export type FeedType =
/** Sort by a combination of freshness and score, using Reddit's algorithm */
| 'HOT'
/** Newest entries first */
| 'NEW'
/** Highest score entries first */
| 'TOP';

/** The type of vote to record, when submitting a vote */
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';

export type OnCommentAddedSubscriptionVariables = Exact<{
repoFullName: Scalars['String']['input'];
repoFullName: string;
}>;

export type OnCommentAddedSubscription = {
Expand All @@ -185,9 +197,9 @@ export type OnCommentAddedSubscription = {
};

export type CommentQueryVariables = Exact<{
repoFullName: Scalars['String']['input'];
limit?: InputMaybe<Scalars['Int']['input']>;
offset?: InputMaybe<Scalars['Int']['input']>;
repoFullName: string;
limit?: number | null;
offset?: number | null;
}>;

export type CommentQuery = {
Expand Down Expand Up @@ -253,8 +265,8 @@ export type FeedEntryFragment = {

export type FeedQueryVariables = Exact<{
type: FeedType;
offset?: InputMaybe<Scalars['Int']['input']>;
limit?: InputMaybe<Scalars['Int']['input']>;
offset?: number | null;
limit?: number | null;
}>;

export type FeedQuery = {
Expand All @@ -281,7 +293,7 @@ export type FeedQuery = {
};

export type SubmitRepositoryMutationVariables = Exact<{
repoFullName: Scalars['String']['input'];
repoFullName: string;
}>;

export type SubmitRepositoryMutation = {
Expand All @@ -302,8 +314,8 @@ export type RepoInfoFragment = {
};

export type SubmitCommentMutationVariables = Exact<{
repoFullName: Scalars['String']['input'];
commentContent: Scalars['String']['input'];
repoFullName: string;
commentContent: string;
}>;

export type SubmitCommentMutation = {
Expand All @@ -324,7 +336,7 @@ export type VoteButtonsFragment = {
};

export type VoteMutationVariables = Exact<{
repoFullName: Scalars['String']['input'];
repoFullName: string;
type: VoteType;
}>;

Expand Down
34 changes: 23 additions & 11 deletions dev-test/githunt/types.avoidOptionals.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: { input: string; output: string };
Expand Down Expand Up @@ -168,8 +168,20 @@ export enum VoteType {
Up = 'UP',
}

/** A list of options for the sort order of the feed */
export type FeedType =
/** Sort by a combination of freshness and score, using Reddit's algorithm */
| 'HOT'
/** Newest entries first */
| 'NEW'
/** Highest score entries first */
| 'TOP';

/** The type of vote to record, when submitting a vote */
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';

export type OnCommentAddedSubscriptionVariables = Exact<{
repoFullName: Scalars['String']['input'];
repoFullName: string;
}>;

export type OnCommentAddedSubscription = {
Expand All @@ -184,9 +196,9 @@ export type OnCommentAddedSubscription = {
};

export type CommentQueryVariables = Exact<{
repoFullName: Scalars['String']['input'];
limit: InputMaybe<Scalars['Int']['input']>;
offset: InputMaybe<Scalars['Int']['input']>;
repoFullName: string;
limit: number | null;
offset: number | null;
}>;

export type CommentQuery = {
Expand Down Expand Up @@ -252,8 +264,8 @@ export type FeedEntryFragment = {

export type FeedQueryVariables = Exact<{
type: FeedType;
offset: InputMaybe<Scalars['Int']['input']>;
limit: InputMaybe<Scalars['Int']['input']>;
offset: number | null;
limit: number | null;
}>;

export type FeedQuery = {
Expand All @@ -280,7 +292,7 @@ export type FeedQuery = {
};

export type SubmitRepositoryMutationVariables = Exact<{
repoFullName: Scalars['String']['input'];
repoFullName: string;
}>;

export type SubmitRepositoryMutation = {
Expand All @@ -301,8 +313,8 @@ export type RepoInfoFragment = {
};

export type SubmitCommentMutationVariables = Exact<{
repoFullName: Scalars['String']['input'];
commentContent: Scalars['String']['input'];
repoFullName: string;
commentContent: string;
}>;

export type SubmitCommentMutation = {
Expand All @@ -323,7 +335,7 @@ export type VoteButtonsFragment = {
};

export type VoteMutationVariables = Exact<{
repoFullName: Scalars['String']['input'];
repoFullName: string;
type: VoteType;
}>;

Expand Down
34 changes: 23 additions & 11 deletions dev-test/githunt/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: { input: string; output: string };
Expand Down Expand Up @@ -163,8 +163,20 @@ export type Vote = {
/** The type of vote to record, when submitting a vote */
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';

/** A list of options for the sort order of the feed */
export type FeedType =
/** Sort by a combination of freshness and score, using Reddit's algorithm */
| 'HOT'
/** Newest entries first */
| 'NEW'
/** Highest score entries first */
| 'TOP';

/** The type of vote to record, when submitting a vote */
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';

export type OnCommentAddedSubscriptionVariables = Exact<{
repoFullName: Scalars['String']['input'];
repoFullName: string;
}>;

export type OnCommentAddedSubscription = {
Expand All @@ -179,9 +191,9 @@ export type OnCommentAddedSubscription = {
};

export type CommentQueryVariables = Exact<{
repoFullName: Scalars['String']['input'];
limit?: InputMaybe<Scalars['Int']['input']>;
offset?: InputMaybe<Scalars['Int']['input']>;
repoFullName: string;
limit?: number | null;
offset?: number | null;
}>;

export type CommentQuery = {
Expand Down Expand Up @@ -247,8 +259,8 @@ export type FeedEntryFragment = {

export type FeedQueryVariables = Exact<{
type: FeedType;
offset?: InputMaybe<Scalars['Int']['input']>;
limit?: InputMaybe<Scalars['Int']['input']>;
offset?: number | null;
limit?: number | null;
}>;

export type FeedQuery = {
Expand All @@ -275,7 +287,7 @@ export type FeedQuery = {
};

export type SubmitRepositoryMutationVariables = Exact<{
repoFullName: Scalars['String']['input'];
repoFullName: string;
}>;

export type SubmitRepositoryMutation = {
Expand All @@ -296,8 +308,8 @@ export type RepoInfoFragment = {
};

export type SubmitCommentMutationVariables = Exact<{
repoFullName: Scalars['String']['input'];
commentContent: Scalars['String']['input'];
repoFullName: string;
commentContent: string;
}>;

export type SubmitCommentMutation = {
Expand All @@ -318,7 +330,7 @@ export type VoteButtonsFragment = {
};

export type VoteMutationVariables = Exact<{
repoFullName: Scalars['String']['input'];
repoFullName: string;
type: VoteType;
}>;

Expand Down
Loading