-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into client-preset-cli
- Loading branch information
Showing
14 changed files
with
182 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
website/src/pages/plugins/typescript/typescript-fabbrica.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: typescript-fabbrica | ||
description: GraphQL Code Generator Plugin to define mock data factory. | ||
--- | ||
|
||
import { PluginApiDocs, PluginHeader } from '@/components/plugin' | ||
import { pluginGetStaticProps } from '@/lib/plugin-get-static-props' | ||
export const getStaticProps = pluginGetStaticProps(__filename) | ||
|
||
<PluginHeader /> | ||
<PluginApiDocs /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2258,16 +2258,16 @@ | |
change-case-all "1.0.14" | ||
tslib "~2.4.0" | ||
|
||
"@graphql-codegen/[email protected].1": | ||
version "0.0.1" | ||
resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-nhost/-/typescript-nhost-0.0.1.tgz#81a222ed9b03b6265c94b23f11e2cfd3ac567544" | ||
integrity sha512-ISVfpk7PYqWEhcA5Ypky7X9Fyosb9etxyGkT85rW4AK9VrshwN32osbA1Zkmsx3WhoZxIBpGzUk1Vf4YNYSurg== | ||
"@graphql-codegen/[email protected].2": | ||
version "0.0.2" | ||
resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-nhost/-/typescript-nhost-0.0.2.tgz#e29bd26073c2bac548d67b42899f6992d7a53646" | ||
integrity sha512-DhBqEyTZti3MARYXKezgX2TgG0aTM5AgEuGm96sWHR7OxkrXx73VX+lsC2xARI/vue7liqxjJLDOxBjV5CpqjQ== | ||
dependencies: | ||
"@graphql-codegen/plugin-helpers" "^4.0.0" | ||
"@graphql-codegen/typescript" "^3.0.0" | ||
"@graphql-codegen/visitor-plugin-common" "3.0.0" | ||
"@urql/introspection" "^1.0.0" | ||
tslib "~2.5.0" | ||
tslib "~2.6.0" | ||
|
||
"@graphql-codegen/[email protected]": | ||
version "3.3.7" | ||
|
@@ -3389,6 +3389,14 @@ | |
html-react-parser "^4.2.0" | ||
posthog-js "^1.45.1" | ||
|
||
"@mizdra/graphql-codegen-typescript-fabbrica@^0.3.0": | ||
version "0.3.0" | ||
resolved "https://registry.yarnpkg.com/@mizdra/graphql-codegen-typescript-fabbrica/-/graphql-codegen-typescript-fabbrica-0.3.0.tgz#783ffc7c4ade7b844a6c65cc1fb7bac340a2f42d" | ||
integrity sha512-ShPEpC6GrzL1fqXqx4Ua1heid8ExrK/evJI1vozVPt6mZWebwKG0tf26v9KwQ0F8HZBufnq4BURUMXobWi9ckQ== | ||
dependencies: | ||
"@graphql-codegen/plugin-helpers" "^5.0.1" | ||
"@graphql-codegen/visitor-plugin-common" "^4.0.1" | ||
|
||
"@monaco-editor/loader@^1.3.3": | ||
version "1.3.3" | ||
resolved "https://registry.yarnpkg.com/@monaco-editor/loader/-/loader-1.3.3.tgz#7f1742bd3cc21c0362a46a4056317f6e5215cfca" | ||
|
@@ -4161,17 +4169,17 @@ | |
dependencies: | ||
"@babel/types" "^7.0.0" | ||
|
||
"@types/[email protected].0": | ||
version "7.10.0" | ||
resolved "https://registry.yarnpkg.com/@types/babel__helper-plugin-utils/-/babel__helper-plugin-utils-7.10.0.tgz#dcd2416f9c189d5837ab2a276368cf67134efe78" | ||
integrity sha512-60YtHzhQ9HAkToHVV+TB4VLzBn9lrfgrsOjiJMtbv/c1jPdekBxaByd6DMsGBzROXWoIL6U3lEFvvbu69RkUoA== | ||
"@types/[email protected].2": | ||
version "7.10.2" | ||
resolved "https://registry.yarnpkg.com/@types/babel__helper-plugin-utils/-/babel__helper-plugin-utils-7.10.2.tgz#d733528f1181c606e92f1a38f18e95575518254b" | ||
integrity sha512-Sa17cG0SKMedlH5bEozh0eXo/54iWpSxbxCoqknRJY0oGGTwO9/SCfIx1taDnG0dvkJnYW+/7tv+PTSFaQsRNA== | ||
dependencies: | ||
"@types/babel__core" "*" | ||
|
||
"@types/babel__template@*", "@types/[email protected].1": | ||
version "7.4.1" | ||
resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969" | ||
integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g== | ||
"@types/babel__template@*", "@types/[email protected].3": | ||
version "7.4.3" | ||
resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.3.tgz#db9ac539a2fe05cfe9e168b24f360701bde41f5f" | ||
integrity sha512-ciwyCLeuRfxboZ4isgdNZi/tkt06m8Tw6uGbBSBgWrnnZGNXiEyM27xc/PjXGQLqlZ6ylbgHMnm7ccF9tCkOeQ== | ||
dependencies: | ||
"@babel/parser" "^7.1.0" | ||
"@babel/types" "^7.0.0" | ||
|
@@ -4212,10 +4220,10 @@ | |
resolved "https://registry.yarnpkg.com/@types/d3-time/-/d3-time-3.0.0.tgz#e1ac0f3e9e195135361fa1a1d62f795d87e6e819" | ||
integrity sha512-sZLCdHvBUcNby1cB6Fd3ZBrABbjz3v1Vm90nysCQ6Vt7vd6e/h9Lt7SiJUoEX0l4Dzc7P5llKyhqSi1ycSf1Hg== | ||
|
||
"@types/[email protected].1": | ||
version "1.2.1" | ||
resolved "https://registry.yarnpkg.com/@types/debounce/-/debounce-1.2.1.tgz#79b65710bc8b6d44094d286aecf38e44f9627852" | ||
integrity sha512-epMsEE85fi4lfmJUH/89/iV/LI+F5CvNIvmgs5g5jYFPfhO2S/ae8WSsLOKWdwtoaZw9Q2IhJ4tQ5tFCcS/4HA== | ||
"@types/[email protected].3": | ||
version "1.2.3" | ||
resolved "https://registry.yarnpkg.com/@types/debounce/-/debounce-1.2.3.tgz#52c50549708d403684b29e42d14235276517765f" | ||
integrity sha512-97mx7gWt4e+kd0wPa1pNEvE4tYGhgBVa4ExWOLcfFohAjF9wERfJ+3qrn7I1e76oHupOvRs4UyYe9xzy0i4TUw== | ||
|
||
"@types/debug@^4.0.0": | ||
version "4.1.7" | ||
|
@@ -4224,10 +4232,10 @@ | |
dependencies: | ||
"@types/ms" "*" | ||
|
||
"@types/[email protected].0": | ||
version "0.7.0" | ||
resolved "https://registry.yarnpkg.com/@types/dedent/-/dedent-0.7.0.tgz#155f339ca404e6dd90b9ce46a3f78fd69ca9b050" | ||
integrity sha512-EGlKlgMhnLt/cM4DbUSafFdrkeJoC9Mvnj0PUCU7tFmTjMjNRT957kXCx0wYm3JuEq4o4ZsS5vG+NlkM2DMd2A== | ||
"@types/[email protected].1": | ||
version "0.7.1" | ||
resolved "https://registry.yarnpkg.com/@types/dedent/-/dedent-0.7.1.tgz#05a6af9dbe7d3c927f3f6f54082fc69157a31a69" | ||
integrity sha512-NKo033xLkoVCgUobq+FS1S3J6kwWeOcyqEBc2r2oi9J/dKncY11J9VgS0Giv7T4rxVt/MajUVcFppT2TPJA2Cg== | ||
|
||
"@types/estree-jsx@^1.0.0": | ||
version "1.0.0" | ||
|
@@ -4262,10 +4270,10 @@ | |
dependencies: | ||
"@types/unist" "*" | ||
|
||
"@types/[email protected].6": | ||
version "8.2.6" | ||
resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-8.2.6.tgz#abd41a5fb689c7f1acb12933d787d4262a02a0ab" | ||
integrity sha512-3uT88kxg8lNzY8ay2ZjP44DKcRaTGztqeIvN2zHvhzIBH/uAPaL75aBtdNRKbA7xXoMbBt5kX0M00VKAnfOYlA== | ||
"@types/[email protected].9": | ||
version "8.2.9" | ||
resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-8.2.9.tgz#bb29e7d2358e3af7d9f4d6c6410320498b428d48" | ||
integrity sha512-5IEO2PwCy4NZDgj977dho4Qbdiw6dJZJzD4ZaB/9j7dfppf7z0xxFPKZz/FtTAUQbDjmWHJ6Jlz/gn0YzWHPsw== | ||
dependencies: | ||
"@types/through" "*" | ||
rxjs "^7.2.0" | ||
|
@@ -8617,11 +8625,16 @@ [email protected]: | |
lru-cache "^10.0.0" | ||
tslib "^2.5.2" | ||
|
||
[email protected], graphql@^16.0.0, graphql@^16.6.0: | ||
[email protected], graphql@^16.6.0: | ||
version "16.8.0" | ||
resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.0.tgz#374478b7f27b2dc6153c8f42c1b80157f79d79d4" | ||
integrity sha512-0oKGaR+y3qcS5mCu1vb7KG+a89vjn06C7Ihq/dDl3jA+A8B3TKomvi3CiEcVLJQGalbu8F52LxkOym7U5sSfbg== | ||
|
||
graphql@^16.0.0: | ||
version "16.8.1" | ||
resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.1.tgz#1930a965bef1170603702acdb68aedd3f3cf6f07" | ||
integrity sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw== | ||
|
||
gray-matter@^4.0.3: | ||
version "4.0.3" | ||
resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-4.0.3.tgz#e893c064825de73ea1f5f7d88c7a9f7274288798" | ||
|