Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: reduce code output of client preset #10073

Merged
merged 3 commits into from
Jul 30, 2024
Merged
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
5 changes: 5 additions & 0 deletions .changeset/cold-pants-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/client-preset': minor
---

Reduce noise of generated code by only generating code relevant to GraphQL operations.
89 changes: 0 additions & 89 deletions dev-test/gql-tag-operations-masking/gql/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,95 +18,6 @@ export type Scalars = {
Url: { input: any; output: any };
};

export type Meta = {
__typename?: 'Meta';
count?: Maybe<Scalars['Int']['output']>;
};

export type Mutation = {
__typename?: 'Mutation';
createTweet?: Maybe<Tweet>;
deleteTweet?: Maybe<Tweet>;
markTweetRead?: Maybe<Scalars['Boolean']['output']>;
};

export type MutationCreateTweetArgs = {
body?: InputMaybe<Scalars['String']['input']>;
};

export type MutationDeleteTweetArgs = {
id: Scalars['ID']['input'];
};

export type MutationMarkTweetReadArgs = {
id: Scalars['ID']['input'];
};

export type Notification = {
__typename?: 'Notification';
date?: Maybe<Scalars['Date']['output']>;
id?: Maybe<Scalars['ID']['output']>;
type?: Maybe<Scalars['String']['output']>;
};

export type Query = {
__typename?: 'Query';
Notifications?: Maybe<Array<Maybe<Notification>>>;
NotificationsMeta?: Maybe<Meta>;
Tweet?: Maybe<Tweet>;
Tweets?: Maybe<Array<Tweet>>;
TweetsMeta?: Maybe<Meta>;
User?: Maybe<User>;
};

export type QueryNotificationsArgs = {
limit?: InputMaybe<Scalars['Int']['input']>;
};

export type QueryTweetArgs = {
id: Scalars['ID']['input'];
};

export type QueryTweetsArgs = {
limit?: InputMaybe<Scalars['Int']['input']>;
skip?: InputMaybe<Scalars['Int']['input']>;
sort_field?: InputMaybe<Scalars['String']['input']>;
sort_order?: InputMaybe<Scalars['String']['input']>;
};

export type QueryUserArgs = {
id: Scalars['ID']['input'];
};

export type Stat = {
__typename?: 'Stat';
likes?: Maybe<Scalars['Int']['output']>;
responses?: Maybe<Scalars['Int']['output']>;
retweets?: Maybe<Scalars['Int']['output']>;
views?: Maybe<Scalars['Int']['output']>;
};

export type Tweet = {
__typename?: 'Tweet';
Stats?: Maybe<Stat>;
author: User;
body: Scalars['String']['output'];
date?: Maybe<Scalars['Date']['output']>;
id: Scalars['ID']['output'];
};

export type User = {
__typename?: 'User';
avatar_url?: Maybe<Scalars['Url']['output']>;
first_name?: Maybe<Scalars['String']['output']>;
full_name?: Maybe<Scalars['String']['output']>;
id: Scalars['ID']['output'];
last_name?: Maybe<Scalars['String']['output']>;
/** @deprecated Field no longer supported */
name?: Maybe<Scalars['String']['output']>;
username?: Maybe<Scalars['String']['output']>;
};

export type TweetFragmentFragment = ({ __typename?: 'Tweet'; id: string; body: string } & {
' $fragmentRefs'?: { TweetAuthorFragmentFragment: TweetAuthorFragmentFragment };
}) & { ' $fragmentName'?: 'TweetFragmentFragment' };
Expand Down
89 changes: 0 additions & 89 deletions dev-test/gql-tag-operations-urql/gql/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,95 +18,6 @@ export type Scalars = {
Url: { input: any; output: any };
};

export type Meta = {
__typename?: 'Meta';
count?: Maybe<Scalars['Int']['output']>;
};

export type Mutation = {
__typename?: 'Mutation';
createTweet?: Maybe<Tweet>;
deleteTweet?: Maybe<Tweet>;
markTweetRead?: Maybe<Scalars['Boolean']['output']>;
};

export type MutationCreateTweetArgs = {
body?: InputMaybe<Scalars['String']['input']>;
};

export type MutationDeleteTweetArgs = {
id: Scalars['ID']['input'];
};

export type MutationMarkTweetReadArgs = {
id: Scalars['ID']['input'];
};

export type Notification = {
__typename?: 'Notification';
date?: Maybe<Scalars['Date']['output']>;
id?: Maybe<Scalars['ID']['output']>;
type?: Maybe<Scalars['String']['output']>;
};

export type Query = {
__typename?: 'Query';
Notifications?: Maybe<Array<Maybe<Notification>>>;
NotificationsMeta?: Maybe<Meta>;
Tweet?: Maybe<Tweet>;
Tweets?: Maybe<Array<Maybe<Tweet>>>;
TweetsMeta?: Maybe<Meta>;
User?: Maybe<User>;
};

export type QueryNotificationsArgs = {
limit?: InputMaybe<Scalars['Int']['input']>;
};

export type QueryTweetArgs = {
id: Scalars['ID']['input'];
};

export type QueryTweetsArgs = {
limit?: InputMaybe<Scalars['Int']['input']>;
skip?: InputMaybe<Scalars['Int']['input']>;
sort_field?: InputMaybe<Scalars['String']['input']>;
sort_order?: InputMaybe<Scalars['String']['input']>;
};

export type QueryUserArgs = {
id: Scalars['ID']['input'];
};

export type Stat = {
__typename?: 'Stat';
likes?: Maybe<Scalars['Int']['output']>;
responses?: Maybe<Scalars['Int']['output']>;
retweets?: Maybe<Scalars['Int']['output']>;
views?: Maybe<Scalars['Int']['output']>;
};

export type Tweet = {
__typename?: 'Tweet';
Author?: Maybe<User>;
Stats?: Maybe<Stat>;
body?: Maybe<Scalars['String']['output']>;
date?: Maybe<Scalars['Date']['output']>;
id: Scalars['ID']['output'];
};

export type User = {
__typename?: 'User';
avatar_url?: Maybe<Scalars['Url']['output']>;
first_name?: Maybe<Scalars['String']['output']>;
full_name?: Maybe<Scalars['String']['output']>;
id: Scalars['ID']['output'];
last_name?: Maybe<Scalars['String']['output']>;
/** @deprecated Field no longer supported */
name?: Maybe<Scalars['String']['output']>;
username?: Maybe<Scalars['String']['output']>;
};

export type FooQueryVariables = Exact<{ [key: string]: never }>;

export type FooQuery = { __typename?: 'Query'; Tweets?: Array<{ __typename?: 'Tweet'; id: string } | null> | null };
Expand Down
89 changes: 0 additions & 89 deletions dev-test/gql-tag-operations/gql/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,95 +18,6 @@ export type Scalars = {
Url: { input: any; output: any };
};

export type Meta = {
__typename?: 'Meta';
count?: Maybe<Scalars['Int']['output']>;
};

export type Mutation = {
__typename?: 'Mutation';
createTweet?: Maybe<Tweet>;
deleteTweet?: Maybe<Tweet>;
markTweetRead?: Maybe<Scalars['Boolean']['output']>;
};

export type MutationCreateTweetArgs = {
body?: InputMaybe<Scalars['String']['input']>;
};

export type MutationDeleteTweetArgs = {
id: Scalars['ID']['input'];
};

export type MutationMarkTweetReadArgs = {
id: Scalars['ID']['input'];
};

export type Notification = {
__typename?: 'Notification';
date?: Maybe<Scalars['Date']['output']>;
id?: Maybe<Scalars['ID']['output']>;
type?: Maybe<Scalars['String']['output']>;
};

export type Query = {
__typename?: 'Query';
Notifications?: Maybe<Array<Maybe<Notification>>>;
NotificationsMeta?: Maybe<Meta>;
Tweet?: Maybe<Tweet>;
Tweets?: Maybe<Array<Maybe<Tweet>>>;
TweetsMeta?: Maybe<Meta>;
User?: Maybe<User>;
};

export type QueryNotificationsArgs = {
limit?: InputMaybe<Scalars['Int']['input']>;
};

export type QueryTweetArgs = {
id: Scalars['ID']['input'];
};

export type QueryTweetsArgs = {
limit?: InputMaybe<Scalars['Int']['input']>;
skip?: InputMaybe<Scalars['Int']['input']>;
sort_field?: InputMaybe<Scalars['String']['input']>;
sort_order?: InputMaybe<Scalars['String']['input']>;
};

export type QueryUserArgs = {
id: Scalars['ID']['input'];
};

export type Stat = {
__typename?: 'Stat';
likes?: Maybe<Scalars['Int']['output']>;
responses?: Maybe<Scalars['Int']['output']>;
retweets?: Maybe<Scalars['Int']['output']>;
views?: Maybe<Scalars['Int']['output']>;
};

export type Tweet = {
__typename?: 'Tweet';
Author?: Maybe<User>;
Stats?: Maybe<Stat>;
body?: Maybe<Scalars['String']['output']>;
date?: Maybe<Scalars['Date']['output']>;
id: Scalars['ID']['output'];
};

export type User = {
__typename?: 'User';
avatar_url?: Maybe<Scalars['Url']['output']>;
first_name?: Maybe<Scalars['String']['output']>;
full_name?: Maybe<Scalars['String']['output']>;
id: Scalars['ID']['output'];
last_name?: Maybe<Scalars['String']['output']>;
/** @deprecated Field no longer supported */
name?: Maybe<Scalars['String']['output']>;
username?: Maybe<Scalars['String']['output']>;
};

export type FooQueryVariables = Exact<{ [key: string]: never }>;

export type FooQuery = { __typename?: 'Query'; Tweets?: Array<{ __typename?: 'Tweet'; id: string } | null> | null };
Expand Down
89 changes: 0 additions & 89 deletions dev-test/gql-tag-operations/graphql/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,95 +18,6 @@ export type Scalars = {
Url: { input: any; output: any };
};

export type Meta = {
__typename?: 'Meta';
count?: Maybe<Scalars['Int']['output']>;
};

export type Mutation = {
__typename?: 'Mutation';
createTweet?: Maybe<Tweet>;
deleteTweet?: Maybe<Tweet>;
markTweetRead?: Maybe<Scalars['Boolean']['output']>;
};

export type MutationCreateTweetArgs = {
body?: InputMaybe<Scalars['String']['input']>;
};

export type MutationDeleteTweetArgs = {
id: Scalars['ID']['input'];
};

export type MutationMarkTweetReadArgs = {
id: Scalars['ID']['input'];
};

export type Notification = {
__typename?: 'Notification';
date?: Maybe<Scalars['Date']['output']>;
id?: Maybe<Scalars['ID']['output']>;
type?: Maybe<Scalars['String']['output']>;
};

export type Query = {
__typename?: 'Query';
Notifications?: Maybe<Array<Maybe<Notification>>>;
NotificationsMeta?: Maybe<Meta>;
Tweet?: Maybe<Tweet>;
Tweets?: Maybe<Array<Maybe<Tweet>>>;
TweetsMeta?: Maybe<Meta>;
User?: Maybe<User>;
};

export type QueryNotificationsArgs = {
limit?: InputMaybe<Scalars['Int']['input']>;
};

export type QueryTweetArgs = {
id: Scalars['ID']['input'];
};

export type QueryTweetsArgs = {
limit?: InputMaybe<Scalars['Int']['input']>;
skip?: InputMaybe<Scalars['Int']['input']>;
sort_field?: InputMaybe<Scalars['String']['input']>;
sort_order?: InputMaybe<Scalars['String']['input']>;
};

export type QueryUserArgs = {
id: Scalars['ID']['input'];
};

export type Stat = {
__typename?: 'Stat';
likes?: Maybe<Scalars['Int']['output']>;
responses?: Maybe<Scalars['Int']['output']>;
retweets?: Maybe<Scalars['Int']['output']>;
views?: Maybe<Scalars['Int']['output']>;
};

export type Tweet = {
__typename?: 'Tweet';
Author?: Maybe<User>;
Stats?: Maybe<Stat>;
body?: Maybe<Scalars['String']['output']>;
date?: Maybe<Scalars['Date']['output']>;
id: Scalars['ID']['output'];
};

export type User = {
__typename?: 'User';
avatar_url?: Maybe<Scalars['Url']['output']>;
first_name?: Maybe<Scalars['String']['output']>;
full_name?: Maybe<Scalars['String']['output']>;
id: Scalars['ID']['output'];
last_name?: Maybe<Scalars['String']['output']>;
/** @deprecated Field no longer supported */
name?: Maybe<Scalars['String']['output']>;
username?: Maybe<Scalars['String']['output']>;
};

export type FooQueryVariables = Exact<{ [key: string]: never }>;

export type FooQuery = { __typename?: 'Query'; Tweets?: Array<{ __typename?: 'Tweet'; id: string } | null> | null };
Expand Down
Loading
Loading