Skip to content

Commit

Permalink
Merge branch 'master' into presets-with-enumsAsConst
Browse files Browse the repository at this point in the history
  • Loading branch information
azu authored Aug 22, 2024
2 parents 67ede7c + 6a030b3 commit 21e7d1f
Show file tree
Hide file tree
Showing 146 changed files with 4,468 additions and 21,689 deletions.
6 changes: 6 additions & 0 deletions .changeset/@graphql-codegen_cli-10069-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@graphql-codegen/cli": patch
---
dependencies updates:
- Updated dependency [`@whatwg-node/fetch@^0.9.20` ↗︎](https://www.npmjs.com/package/@whatwg-node/fetch/v/0.9.20) (from `^0.8.0`, in `dependencies`)
- Updated dependency [`graphql-config@^5.1.1` ↗︎](https://www.npmjs.com/package/graphql-config/v/5.1.1) (from `^5.0.2`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/@graphql-codegen_testing-10070-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/testing": patch
---
dependencies updates:
- Updated dependency [`nock@13.5.4` ↗︎](https://www.npmjs.com/package/nock/v/13.5.4) (from `13.5.3`, in `dependencies`)
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.
6 changes: 0 additions & 6 deletions .changeset/forty-cooks-build.md

This file was deleted.

6 changes: 6 additions & 0 deletions .changeset/pretty-berries-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@graphql-codegen/gql-tag-operations': patch
'@graphql-codegen/client-preset': patch
---

Add note about enabling bundle size reduction for the generated `graphql` tag file.
5 changes: 0 additions & 5 deletions .changeset/rotten-eels-eat.md

This file was deleted.

11 changes: 11 additions & 0 deletions .changeset/short-mirrors-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@graphql-codegen/visitor-plugin-common': minor
'@graphql-codegen/typescript-operations': minor
'@graphql-codegen/typescript': minor
'@graphql-codegen/typescript-resolvers': minor
---

Extend `config.avoidOptions` to support query, mutation and subscription

Previously, `config.avoidOptions.resolvers` was being used to make query, mutation and subscription fields non-optional.
Now, `config.avoidOptions.query`, `config.avoidOptions.mutation` and `config.avoidOptions.subscription` can be used to target the respective types.
5 changes: 5 additions & 0 deletions .changeset/swift-parrots-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/cli': patch
---

Bump whatwg-node and graphql-config
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Master
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
Expand All @@ -42,7 +42,7 @@ jobs:
- 'esm'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
Expand All @@ -60,7 +60,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
graphql_version: 16
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
Expand All @@ -132,7 +132,7 @@ jobs:
- name: Install Dependencies
run: yarn
- name: Cache Jest
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .cache/jest
key: ${{runner.os}}-${{matrix.node_version}}-${{matrix.graphql_version}}-jest-${{hashFiles('yarn.lock')}}
Expand All @@ -148,7 +148,7 @@ jobs:
name: Build and Unit Test SWC Plugin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.65.0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jobs:
publish-rust-swc-plugin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/website-integrity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Fetch
run: git fetch origin master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push'
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[![GraphQLConf 2024 Banner: September 10-12, San Francisco. Hosted by the GraphQL Foundation](https://github.com/user-attachments/assets/bdb8cd5d-5186-4ece-b06b-b00a499b7868)](https://graphql.org/conf/2024/?utm_source=github&utm_medium=graphql_codegen&utm_campaign=readme)

<div>
<img src="./logo.svg" width="150px" alt="GraphQL Code Generator logo"/>
<a href="https://the-guild.dev">
<img align="right" src="https://the-guild-org.github.io/press-kit/full-dark-logo.svg" alt="Created by The Guild" style="width: 100px;align:right;"/>
<img align="right" src="https://the-guild-org.github.io/press-kit/full-dark-logo.svg" alt="Created by The Guild" style="width: 100px;align:right;"/>
</a>
</div>

Expand Down
1 change: 1 addition & 0 deletions dev-test/gql-tag-operations-masking/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
* 3. It does not support dead code elimination, so it will add unused operations.
*
* Therefore it is highly recommended to use the babel or swc plugin for production.
* Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size
*/
const documents = {
'\n fragment TweetFragment on Tweet {\n id\n body\n ...TweetAuthorFragment\n }\n':
Expand Down
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
1 change: 1 addition & 0 deletions dev-test/gql-tag-operations-urql/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
* 3. It does not support dead code elimination, so it will add unused operations.
*
* Therefore it is highly recommended to use the babel or swc plugin for production.
* Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size
*/
const documents = {
'\n query Foo {\n Tweets {\n id\n }\n }\n': types.FooDocument,
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
1 change: 1 addition & 0 deletions dev-test/gql-tag-operations/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
* 3. It does not support dead code elimination, so it will add unused operations.
*
* Therefore it is highly recommended to use the babel or swc plugin for production.
* Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size
*/
const documents = {
'\n query Foo {\n Tweets {\n id\n }\n }\n': types.FooDocument,
Expand Down
Loading

0 comments on commit 21e7d1f

Please sign in to comment.