Skip to content

Commit

Permalink
Merge branch 'master' into defer-with-fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
beerose authored Oct 24, 2023
2 parents 3a7bd84 + a9aad13 commit bd3af2f
Show file tree
Hide file tree
Showing 127 changed files with 3,920 additions and 2,336 deletions.
5 changes: 5 additions & 0 deletions .changeset/@graphql-codegen_add-9640-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/add": patch
---
dependencies updates:
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/client-preset": patch
---
dependencies updates:
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/@graphql-codegen_core-9640-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/core": patch
---
dependencies updates:
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/fragment-matcher": patch
---
dependencies updates:
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/gql-tag-operations": patch
---
dependencies updates:
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/graphql-modules-preset": patch
---
dependencies updates:
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/introspection": patch
---
dependencies updates:
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/plugin-helpers": patch
---
dependencies updates:
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/@graphql-codegen_schema-ast-9640-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/schema-ast": patch
---
dependencies updates:
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/@graphql-codegen_testing-9640-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/testing": patch
---
dependencies updates:
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/@graphql-codegen_testing-9645-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/testing": patch
---
dependencies updates:
- Updated dependency [`jest-diff@^23.0.0 || ^24.0.0 || ^25.0.0 || ^26.0.0 || ^27.0.0 || ^28.0.0 || ^29.0.0` ↗︎](https://www.npmjs.com/package/jest-diff/v/23.0.0) (from `^23.0.0 || ^24.0.0 || ^25.0.0 || ^26.0.0 || ^27.0.0 || ^28.0.0`, in `peerDependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/typed-document-node": patch
---
dependencies updates:
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/@graphql-codegen_typescript-9640-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/typescript": patch
---
dependencies updates:
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/typescript-document-nodes": patch
---
dependencies updates:
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/typescript-operations": patch
---
dependencies updates:
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/typescript-resolvers": patch
---
dependencies updates:
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, 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 [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/chilled-impalas-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/client-preset': minor
---

The client preset now allows the use of the `futureProofEnums` config option
5 changes: 5 additions & 0 deletions .changeset/heavy-jars-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/cli": patch
---

ignore events in `.git` directory
5 changes: 5 additions & 0 deletions .changeset/perfect-forks-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/visitor-plugin-common': patch
---

Avoid reading from null values when selection sets only contain fragments.
5 changes: 5 additions & 0 deletions .changeset/plenty-seahorses-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/cli': patch
---

Surface error occurring during import of @parcel/watcher
5 changes: 5 additions & 0 deletions .changeset/stupid-onions-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/cli': patch
---

fix watcher unable to find highest common directory on Windows
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 16
nodeVersion: 18
- name: Prettier Check
run: yarn prettier:check
dev-tests-old:
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 16
nodeVersion: 18
- name: Build
run: yarn build
env:
Expand All @@ -64,7 +64,7 @@ jobs:
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 16
nodeVersion: 18
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.65.0
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 16
nodeVersion: 18
- name: Build
run: yarn build
env:
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
name: Build and Unit Test SWC Plugin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.65.0
Expand Down
11 changes: 11 additions & 0 deletions dev-test/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,17 @@ const config: CodegenConfig = {
preset: 'client',
presetConfig: { fragmentMasking: true },
},
'./dev-test/test-null-value/result.d.ts': {
schema: './dev-test/test-null-value/schema.graphql',
documents: ['./dev-test/test-null-value/query.ts'],
plugins: ['typescript', 'typescript-operations'],
config: {
// The combination of these two flags caused the following issue:
// https://github.com/dotansimha/graphql-code-generator/pull/9709
skipTypename: true,
mergeFragmentTypes: true,
},
},
},
};

Expand Down
16 changes: 16 additions & 0 deletions dev-test/test-null-value/query.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const MY_QUERY = /* GraphQL */ `
fragment CartLine on CartLine {
id
quantity
}
query Test {
cart {
lines {
nodes {
...CartLine
}
}
}
}
`;
50 changes: 50 additions & 0 deletions dev-test/test-null-value/result.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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 };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: { input: string; output: string };
String: { input: string; output: string };
Boolean: { input: boolean; output: boolean };
Int: { input: number; output: number };
Float: { input: number; output: number };
};

export type BaseCartLine = {
id: Scalars['String']['output'];
quantity: Scalars['Int']['output'];
};

export type BaseCartLineConnection = {
id: Scalars['String']['output'];
nodes: Array<BaseCartLine>;
};

export type Cart = {
id: Scalars['String']['output'];
lines: BaseCartLineConnection;
};

export type CartLine = BaseCartLine & {
id: Scalars['String']['output'];
quantity: Scalars['Int']['output'];
};

export type ComponentizableCartLine = BaseCartLine & {
id: Scalars['String']['output'];
quantity: Scalars['Int']['output'];
};

export type QueryRoot = {
cart?: Maybe<Cart>;
};

export type CartLineFragment = { id: string; quantity: number };

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

export type TestQuery = { cart?: { lines: { nodes: Array<{ id: string; quantity: number }> } } | null };
32 changes: 32 additions & 0 deletions dev-test/test-null-value/schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
schema {
query: QueryRoot
}

interface BaseCartLine {
id: String!
quantity: Int!
}

type BaseCartLineConnection {
id: String!
nodes: [BaseCartLine!]!
}

type Cart {
id: String!
lines: BaseCartLineConnection!
}

type CartLine implements BaseCartLine {
id: String!
quantity: Int!
}

type ComponentizableCartLine implements BaseCartLine {
id: String!
quantity: Int!
}

type QueryRoot {
cart: Cart
}
12 changes: 6 additions & 6 deletions examples/persisted-documents-string-mode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"graphql-yoga": "3.9.1",
"@graphql-yoga/plugin-persisted-operations": "1.9.1"
"graphql-yoga": "4.0.4",
"@graphql-yoga/plugin-persisted-operations": "2.0.4"
},
"devDependencies": {
"@graphql-typed-document-node/core": "3.2.0",
"jest": "28.1.3",
"babel-jest": "28.1.3",
"babel-jest": "29.6.4",
"@graphql-codegen/cli": "5.0.0",
"@graphql-codegen/client-preset": "4.1.0",
"@babel/core": "7.22.8",
"@babel/preset-env": "7.22.7",
"@babel/preset-typescript": "7.22.5"
"@babel/core": "7.22.11",
"@babel/preset-env": "7.22.10",
"@babel/preset-typescript": "7.22.11"
},
"scripts": {
"test": "jest",
Expand Down
12 changes: 6 additions & 6 deletions examples/persisted-documents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"graphql-yoga": "3.9.1",
"@graphql-yoga/plugin-persisted-operations": "1.9.1"
"graphql-yoga": "4.0.4",
"@graphql-yoga/plugin-persisted-operations": "2.0.4"
},
"devDependencies": {
"@graphql-typed-document-node/core": "3.2.0",
"jest": "28.1.3",
"babel-jest": "28.1.3",
"babel-jest": "29.6.4",
"@graphql-codegen/cli": "5.0.0",
"@graphql-codegen/client-preset": "4.1.0",
"@babel/core": "7.22.8",
"@babel/preset-env": "7.22.7",
"@babel/preset-typescript": "7.22.5"
"@babel/core": "7.22.11",
"@babel/preset-env": "7.22.10",
"@babel/preset-typescript": "7.22.11"
},
"scripts": {
"test": "jest",
Expand Down
6 changes: 3 additions & 3 deletions examples/programmatic-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
"@graphql-tools/graphql-file-loader": "8.0.0",
"@graphql-tools/load": "8.0.0",
"@graphql-tools/schema": "10.0.0",
"graphql": "16.6.0",
"graphql": "16.8.0",
"graphql-tag": "2.12.6",
"prettier": "2.8.8"
},
"devDependencies": {
"@types/node": "18.16.19",
"tsup": "6.7.0"
"@types/node": "18.17.11",
"tsup": "7.2.0"
}
}
10 changes: 5 additions & 5 deletions examples/react/apollo-client-defer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"private": true,
"dependencies": {
"@apollo/client": "^3.7.10",
"@graphql-yoga/plugin-defer-stream": "^1.7.3",
"@graphql-yoga/plugin-defer-stream": "^2.0.0",
"graphql": "^16.6.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"graphql-yoga": "3.9.1"
"graphql-yoga": "4.0.4"
},
"devDependencies": {
"@graphql-codegen/cli": "^5.0.0",
Expand All @@ -18,10 +18,10 @@
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.10",
"@vitejs/plugin-react": "^3.1.0",
"cypress": "12.12.0",
"serve": "14.2.0",
"cypress": "12.17.4",
"serve": "14.2.1",
"start-server-and-test": "2.0.0",
"typescript": "4.9.5",
"typescript": "5.2.2",
"vite": "^4.1.0"
},
"scripts": {
Expand Down
Loading

0 comments on commit bd3af2f

Please sign in to comment.