diff --git a/dev-test/gatsby/schema.graphql b/dev-test/gatsby/schema.graphql index 2d4a8f75c2a..dbce6e2f929 100644 --- a/dev-test/gatsby/schema.graphql +++ b/dev-test/gatsby/schema.graphql @@ -15277,7 +15277,7 @@ type WpMediaItemMeta { iso: Int """ - List of keywords used to describe or identfy the media item. + List of keywords used to describe or identify the media item. """ keywords: [String] @@ -20283,7 +20283,7 @@ type WpTaxonomy implements Node & WpNode { public: Boolean """ - Name of content type to diplay in REST API "wp/v2" namespace. + Name of content type to display in REST API "wp/v2" namespace. """ restBase: String diff --git a/packages/graphql-codegen-cli/src/generate-and-save.ts b/packages/graphql-codegen-cli/src/generate-and-save.ts index 384b84e3a4e..2062c1a9292 100644 --- a/packages/graphql-codegen-cli/src/generate-and-save.ts +++ b/packages/graphql-codegen-cli/src/generate-and-save.ts @@ -76,7 +76,7 @@ export async function generate( const currentHash = hash(content); if (previousHash && currentHash === previousHash) { - debugLog(`Skipping file (${result.filename}) writing due to indentical hash...`); + debugLog(`Skipping file (${result.filename}) writing due to identical hash...`); return; } @@ -105,7 +105,7 @@ export async function generate( // compare the prettified content with the previous hash // to compare the content with an existing prettified file if (hash(content) === previousHash) { - debugLog(`Skipping file (${result.filename}) writing due to indentical hash after prettier...`); + debugLog(`Skipping file (${result.filename}) writing due to identical hash after prettier...`); // the modified content is NOT stored in recentOutputHash // so a diff can already be detected before executing the hook return; diff --git a/packages/graphql-codegen-cli/src/utils/patterns.ts b/packages/graphql-codegen-cli/src/utils/patterns.ts index b584a3af58a..a6f97c408d5 100644 --- a/packages/graphql-codegen-cli/src/utils/patterns.ts +++ b/packages/graphql-codegen-cli/src/utils/patterns.ts @@ -51,7 +51,7 @@ export const makeShouldRebuild = ({ return (path: string) => { // Is path negated by any negating watch pattern? if (matchesAnyNegatedPattern(path, [...globalPatternSet.watch.negated, ...localPatternSet.watch.negated])) { - // Short circut: negations in watch patterns take priority + // Short circuit: negations in watch patterns take priority return false; } @@ -134,7 +134,7 @@ export const makeGlobalPatternSet = (initialContext: CodegenContext) => { * * In the `shouldRebuild` algorithm, any of these watch patterns will take * precedence over documents or schemas patterns, and the documents and schemas - * patterns will be mixed into the pattern set of their respective gobal pattern + * patterns will be mixed into the pattern set of their respective global pattern * set equivalents. */ export const makeLocalPatternSet = (conf: Types.ConfiguredOutput) => { diff --git a/packages/graphql-codegen-cli/tests/watcher-test-helpers/assert-watcher-build-triggers.ts b/packages/graphql-codegen-cli/tests/watcher-test-helpers/assert-watcher-build-triggers.ts index 296371678f0..8957daa7407 100644 --- a/packages/graphql-codegen-cli/tests/watcher-test-helpers/assert-watcher-build-triggers.ts +++ b/packages/graphql-codegen-cli/tests/watcher-test-helpers/assert-watcher-build-triggers.ts @@ -89,7 +89,7 @@ export const assertBuildTriggers = async ( * * This assertion helper will look for an **exact match** of each string * in this array. Any relative globs should be specified relative from the - * `watchDirectory`, because this asertion helper will not attempt to convert + * `watchDirectory`, because this assertion helper will not attempt to convert * them (unlike with {@link pathsWouldBeIgnoredByParcelWatcher}). * * For each string in this array: diff --git a/packages/graphql-codegen-cli/tests/watcher.spec.ts b/packages/graphql-codegen-cli/tests/watcher.spec.ts index a89ca46e472..adbebaad242 100644 --- a/packages/graphql-codegen-cli/tests/watcher.spec.ts +++ b/packages/graphql-codegen-cli/tests/watcher.spec.ts @@ -752,7 +752,7 @@ describe('Watch targets', () => { './fuzz/some-other-bar/schemas/never-watch-schema.graphql', // excluded by local watchPattern group // // globally negated paths should be excluded even when a local pattern matches them - './fuzz/alphabet/queries/exclude-watch-everywhere.graphql', // included in types-no-sigma.ts, but globaly excluded + './fuzz/alphabet/queries/exclude-watch-everywhere.graphql', // included in types-no-sigma.ts, but globally excluded 'fuzz/global-beats-local/exclude-watch-everywhere.graphql', 'fuzz/global-beats-local/exclude-doc-everywhere.graphql', 'fuzz/global-beats-local/exclude-schema-everywhere.graphql', diff --git a/packages/plugins/other/visitor-plugin-common/CHANGELOG.md b/packages/plugins/other/visitor-plugin-common/CHANGELOG.md index 061bbee3e77..c8dcb731ffc 100644 --- a/packages/plugins/other/visitor-plugin-common/CHANGELOG.md +++ b/packages/plugins/other/visitor-plugin-common/CHANGELOG.md @@ -574,7 +574,7 @@ This is extending on `ResolversUnionTypes` implemented in https://github.com/dotansimha/graphql-code-generator/pull/9069 - `resolversNonOptionalTypename` adds non-optional `__typename` to union members of `ResolversUnionTypes`, without affecting the union members' base intefaces. + `resolversNonOptionalTypename` adds non-optional `__typename` to union members of `ResolversUnionTypes`, without affecting the union members' base interfaces. A common use case for non-optional `__typename` of union members is using it as the common field to work out the final schema type. This makes implementing the union's `__resolveType` very simple as we can use `__typename` to decide which union member the resolved object is. Without this, we have to check the existence of field/s on the incoming object which could be verbose. diff --git a/packages/plugins/other/visitor-plugin-common/src/base-resolvers-visitor.ts b/packages/plugins/other/visitor-plugin-common/src/base-resolvers-visitor.ts index 119db4119dc..56f2c07c83c 100644 --- a/packages/plugins/other/visitor-plugin-common/src/base-resolvers-visitor.ts +++ b/packages/plugins/other/visitor-plugin-common/src/base-resolvers-visitor.ts @@ -1169,7 +1169,7 @@ export class BaseResolversVisitor< const members = memberTypes .map(type => { const isTypeMapped = this.config.mappers[type.name]; - // 1. If mapped without placehoder, just use it without doing extra checks + // 1. If mapped without placeholder, just use it without doing extra checks if (isTypeMapped && !hasPlaceholder(isTypeMapped.type)) { return { typename: type.name, typeValue: isTypeMapped.type }; } diff --git a/packages/plugins/other/visitor-plugin-common/src/base-types-visitor.ts b/packages/plugins/other/visitor-plugin-common/src/base-types-visitor.ts index a153e0283ec..b99fbb34acd 100644 --- a/packages/plugins/other/visitor-plugin-common/src/base-types-visitor.ts +++ b/packages/plugins/other/visitor-plugin-common/src/base-types-visitor.ts @@ -532,7 +532,7 @@ export class BaseTypesVisitor< ...additionalConfig, }); - // Note: Missing directive mappers but not a problem since always overriden by implementors + // Note: Missing directive mappers but not a problem since always overridden by implementers this._argumentsTransformer = new OperationVariablesToObject(this.scalars, this.convertName); } diff --git a/packages/plugins/other/visitor-plugin-common/src/types.ts b/packages/plugins/other/visitor-plugin-common/src/types.ts index 88f01fe14ed..3a83f75b29c 100644 --- a/packages/plugins/other/visitor-plugin-common/src/types.ts +++ b/packages/plugins/other/visitor-plugin-common/src/types.ts @@ -28,7 +28,7 @@ export type NormalizedScalarsMap = { }; /** * Parsed scalars map - a mapping between GraphQL scalar name and the parsed mapper object, - * including all required information for generting code for that mapping. + * including all required information for generating code for that mapping. */ export type ParsedScalarsMap = { [name: string]: { @@ -45,7 +45,7 @@ export type EnumValuesMap = | { [enumName: string]: string | ({ [key: string]: string | number } & AdditionalProps) }; export type ParsedEnumValuesMap = { [enumName: string]: { - // If values are explictly set, this will include the mapped values + // If values are explicitly set, this will include the mapped values mappedValues?: { [valueName: string]: string | number }; // The GraphQL enum name typeIdentifier: string; @@ -55,7 +55,7 @@ export type ParsedEnumValuesMap = { sourceFile?: string; // If the identifier is external (imported) - this will contain the imported expression (including alias), otherwise null importIdentifier?: string; - // Is defualt import is used to import the enum + // Is default import is used to import the enum isDefault?: boolean; }; }; diff --git a/packages/plugins/typescript/document-nodes/tests/graphql-document-nodes.spec.ts b/packages/plugins/typescript/document-nodes/tests/graphql-document-nodes.spec.ts index 196ed1edec2..492b06757d0 100644 --- a/packages/plugins/typescript/document-nodes/tests/graphql-document-nodes.spec.ts +++ b/packages/plugins/typescript/document-nodes/tests/graphql-document-nodes.spec.ts @@ -31,7 +31,7 @@ describe('graphql-codegen typescript-graphql-document-nodes', () => { validateTs(mergeOutputs([result])); }); - it('Should generate correctly for mutiple files', async () => { + it('Should generate correctly for multiple files', async () => { const result = (await plugin( null, [ diff --git a/packages/plugins/typescript/operations/tests/shared/schema.ts b/packages/plugins/typescript/operations/tests/shared/schema.ts index afd9a934c46..44f463691f8 100644 --- a/packages/plugins/typescript/operations/tests/shared/schema.ts +++ b/packages/plugins/typescript/operations/tests/shared/schema.ts @@ -29,18 +29,18 @@ export const schema = buildSchema(/* GraphQL */ ` userCreated: User } - interface Notifiction { + interface Notification { id: ID! createdAt: String! } - type TextNotification implements Notifiction { + type TextNotification implements Notification { id: ID! text: String! createdAt: String! } - type ImageNotification implements Notifiction { + type ImageNotification implements Notification { id: ID! imageUrl: String! metadata: ImageMetadata! @@ -64,7 +64,7 @@ export const schema = buildSchema(/* GraphQL */ ` type Query { me: User unionTest: MyUnion - notifications: [Notifiction!]! + notifications: [Notification!]! mixedNotifications: [AnyNotification!]! search(term: String!): [SearchResult!]! dummy: String diff --git a/packages/plugins/typescript/operations/tests/ts-documents.spec.ts b/packages/plugins/typescript/operations/tests/ts-documents.spec.ts index 89945dcc0a9..bd1785fba5b 100644 --- a/packages/plugins/typescript/operations/tests/ts-documents.spec.ts +++ b/packages/plugins/typescript/operations/tests/ts-documents.spec.ts @@ -1161,7 +1161,7 @@ export type Q2Query = { search: Array< await validate(content, config); }); - it('Should add __typename as non-optional when its explictly specified, even if skipTypename is true', async () => { + it('Should add __typename as non-optional when its explicitly specified, even if skipTypename is true', async () => { const ast = parse(/* GraphQL */ ` query { __typename @@ -2109,7 +2109,7 @@ export type Q2Query = { search: Array< const ast = parse(/* GraphQL */ ` query unionTest { mixedNotifications { - ... on Notifiction { + ... on Notification { id } @@ -2151,7 +2151,7 @@ export type Q2Query = { search: Array< id } - ... on Notifiction { + ... on Notification { id } @@ -2196,7 +2196,7 @@ export type Q2Query = { search: Array< } } - fragment N on Notifiction { + fragment N on Notification { id } `); @@ -2226,7 +2226,7 @@ export type Q2Query = { search: Array< it('Should support computing correct names for merged fragment union types', async () => { const ast = parse(/* GraphQL */ ` - fragment N on Notifiction { + fragment N on Notification { id ... on TextNotification { text @@ -2350,7 +2350,7 @@ export type Q2Query = { search: Array< } } - fragment N on Notifiction { + fragment N on Notification { id } `); @@ -2369,7 +2369,7 @@ export type Q2Query = { search: Array< it('Should support computing correct names for merged fragment union types with skipTypename', async () => { const ast = parse(/* GraphQL */ ` - fragment N on Notifiction { + fragment N on Notification { id ... on TextNotification { text @@ -2399,7 +2399,7 @@ export type Q2Query = { search: Array< } } - fragment N on Notifiction { + fragment N on Notification { id } `); @@ -4559,7 +4559,7 @@ export type Q2Query = { search: Array< ); }); - it('#5422 - Error when interface doesnt have implemeting types', async () => { + it('#5422 - Error when interface doesnt have implementing types', async () => { const testSchema = buildSchema(/* GraphQL */ ` interface A { a: String! diff --git a/packages/plugins/typescript/resolvers/CHANGELOG.md b/packages/plugins/typescript/resolvers/CHANGELOG.md index 95670696ebf..46cbbe3cacf 100644 --- a/packages/plugins/typescript/resolvers/CHANGELOG.md +++ b/packages/plugins/typescript/resolvers/CHANGELOG.md @@ -615,7 +615,7 @@ This is extending on `ResolversUnionTypes` implemented in https://github.com/dotansimha/graphql-code-generator/pull/9069 - `resolversNonOptionalTypename` adds non-optional `__typename` to union members of `ResolversUnionTypes`, without affecting the union members' base intefaces. + `resolversNonOptionalTypename` adds non-optional `__typename` to union members of `ResolversUnionTypes`, without affecting the union members' base interfaces. A common use case for non-optional `__typename` of union members is using it as the common field to work out the final schema type. This makes implementing the union's `__resolveType` very simple as we can use `__typename` to decide which union member the resolved object is. Without this, we have to check the existence of field/s on the incoming object which could be verbose. diff --git a/packages/plugins/typescript/resolvers/tests/ts-resolvers.spec.ts b/packages/plugins/typescript/resolvers/tests/ts-resolvers.spec.ts index b558857820d..ceed05f9977 100644 --- a/packages/plugins/typescript/resolvers/tests/ts-resolvers.spec.ts +++ b/packages/plugins/typescript/resolvers/tests/ts-resolvers.spec.ts @@ -625,7 +625,7 @@ __isTypeOf?: IsTypeOfResolverFn; content: ` const resolvers: QueryResolvers = { something: (root, args, context, info) => { - return args.arg; // This should work becuase "args.arg" is now forced + return args.arg; // This should work because "args.arg" is now forced } };`, }, diff --git a/packages/plugins/typescript/typescript/tests/typescript.spec.ts b/packages/plugins/typescript/typescript/tests/typescript.spec.ts index f829c5e2550..0f8cfc65d20 100644 --- a/packages/plugins/typescript/typescript/tests/typescript.spec.ts +++ b/packages/plugins/typescript/typescript/tests/typescript.spec.ts @@ -155,7 +155,7 @@ describe('TypeScript', () => { };`); }); - it('Should work with inteface and inteface fields', async () => { + it('Should work with interface and interface fields', async () => { const schema = buildSchema(/* GraphQL */ ` interface Node { "the id" @@ -486,7 +486,7 @@ describe('TypeScript', () => { };`); }); - it('Should work with inteface and inteface fields', async () => { + it('Should work with interface and interface fields', async () => { const schema = buildSchema(/* GraphQL */ ` interface Node { "the id" @@ -1846,7 +1846,7 @@ describe('TypeScript', () => { validateTs(result); }); - it('Should extend mutiple interfaces', async () => { + it('Should extend multiple interfaces', async () => { const schema = buildSchema(/* GraphQL */ ` interface MyInterface1 { id: ID! diff --git a/packages/presets/client/CHANGELOG.md b/packages/presets/client/CHANGELOG.md index 50fc4a429fb..1daf36ebe9d 100644 --- a/packages/presets/client/CHANGELOG.md +++ b/packages/presets/client/CHANGELOG.md @@ -177,7 +177,7 @@ ### Minor Changes -- [#10136](https://github.com/dotansimha/graphql-code-generator/pull/10136) [`3fd4486`](https://github.com/dotansimha/graphql-code-generator/commit/3fd4486a548c27099377c7bd696a22d1638227f4) Thanks [@wxt2005](https://github.com/wxt2005)! - foward skipTypeNameForRoot to client-preset +- [#10136](https://github.com/dotansimha/graphql-code-generator/pull/10136) [`3fd4486`](https://github.com/dotansimha/graphql-code-generator/commit/3fd4486a548c27099377c7bd696a22d1638227f4) Thanks [@wxt2005](https://github.com/wxt2005)! - forward skipTypeNameForRoot to client-preset ### Patch Changes @@ -381,7 +381,7 @@ ### Minor Changes -- [#9562](https://github.com/dotansimha/graphql-code-generator/pull/9562) [`5beee9794`](https://github.com/dotansimha/graphql-code-generator/commit/5beee9794de208fed17e516a259535f56d626c9d) Thanks [@n1ru4l](https://github.com/n1ru4l)! - Add the `addTypenameSelectionDocumentTransform` for automatically adding `__typename` selections to all objct type selection sets. +- [#9562](https://github.com/dotansimha/graphql-code-generator/pull/9562) [`5beee9794`](https://github.com/dotansimha/graphql-code-generator/commit/5beee9794de208fed17e516a259535f56d626c9d) Thanks [@n1ru4l](https://github.com/n1ru4l)! - Add the `addTypenameSelectionDocumentTransform` for automatically adding `__typename` selections to all object type selection sets. This is useful for GraphQL Clients such as Apollo Client or urql that need typename information for their cache to function. diff --git a/packages/presets/graphql-modules/tests/builder.spec.ts b/packages/presets/graphql-modules/tests/builder.spec.ts index b42b32cce4a..2f644e3f023 100644 --- a/packages/presets/graphql-modules/tests/builder.spec.ts +++ b/packages/presets/graphql-modules/tests/builder.spec.ts @@ -400,7 +400,7 @@ test('should use and export resolver signatures of types defined or extended in `); }); -test('should not generate resolver signatures of types that are not defined or extened by a module', () => { +test('should not generate resolver signatures of types that are not defined or extended by a module', () => { const output = buildModule('test', testDoc, { importPath: '../types', importNamespace: 'core', diff --git a/packages/utils/graphql-codegen-testing/CHANGELOG.md b/packages/utils/graphql-codegen-testing/CHANGELOG.md index 7ffbcbf1bdf..051895c655d 100644 --- a/packages/utils/graphql-codegen-testing/CHANGELOG.md +++ b/packages/utils/graphql-codegen-testing/CHANGELOG.md @@ -4,7 +4,7 @@ ### Major Changes -- [#10218](https://github.com/dotansimha/graphql-code-generator/pull/10218) [`140298a`](https://github.com/dotansimha/graphql-code-generator/commit/140298a33b257a0b7958e361971b5bc97bbc01c2) Thanks [@eddeee888](https://github.com/eddeee888)! - Bump depdendencies major versions: +- [#10218](https://github.com/dotansimha/graphql-code-generator/pull/10218) [`140298a`](https://github.com/dotansimha/graphql-code-generator/commit/140298a33b257a0b7958e361971b5bc97bbc01c2) Thanks [@eddeee888](https://github.com/eddeee888)! - Bump dependencies major versions: - nock v14 diff --git a/packages/utils/plugins-helpers/CHANGELOG.md b/packages/utils/plugins-helpers/CHANGELOG.md index 538f0bc608a..c53c21aa7ce 100644 --- a/packages/utils/plugins-helpers/CHANGELOG.md +++ b/packages/utils/plugins-helpers/CHANGELOG.md @@ -264,7 +264,7 @@ ### Patch Changes -- [`307a5d350`](https://github.com/dotansimha/graphql-code-generator/commit/307a5d350643dd065d228b04ef3b4bd70cac0e81) Thanks [@saihaj](https://github.com/saihaj)! - Something went wrong in old relesae so this will ensure we have a good bump on all packages +- [`307a5d350`](https://github.com/dotansimha/graphql-code-generator/commit/307a5d350643dd065d228b04ef3b4bd70cac0e81) Thanks [@saihaj](https://github.com/saihaj)! - Something went wrong in old release so this will ensure we have a good bump on all packages ## 3.1.0 diff --git a/packages/utils/plugins-helpers/src/types.ts b/packages/utils/plugins-helpers/src/types.ts index 87bcedc15dd..ed80d9b0d9b 100644 --- a/packages/utils/plugins-helpers/src/types.ts +++ b/packages/utils/plugins-helpers/src/types.ts @@ -536,7 +536,7 @@ export namespace Types { */ hooks?: Partial; /** - * @description Alows to raise errors if any matched files are not valid GraphQL. Default: false. + * @description Allows to raise errors if any matched files are not valid GraphQL. Default: false. */ noSilentErrors?: boolean; /** diff --git a/website/public/config.schema.json b/website/public/config.schema.json index c105a545acc..f2998d2630b 100644 --- a/website/public/config.schema.json +++ b/website/public/config.schema.json @@ -99,7 +99,7 @@ "description": "Specifies scripts to run when events are happening in the codegen core.\nHooks defined on that level will effect all output files.\n\nFor more details: https://graphql-code-generator.com/docs/config-reference/lifecycle-hooks" }, "noSilentErrors": { - "description": "Alows to raise errors if any matched files are not valid GraphQL. Default: false.", + "description": "Allows to raise errors if any matched files are not valid GraphQL. Default: false.", "type": "boolean" }, "allowPartialOutputs": { @@ -335,7 +335,7 @@ } }, "RawGenericSdkPluginConfig": { - "description": "This plugin generate a generic SDK (without any Requester implemented), allow you to easily customize the way you fetch your data, without loosing the strongly-typed integration.", + "description": "This plugin generate a generic SDK (without any Requester implemented), allow you to easily customize the way you fetch your data, without losing the strongly-typed integration.", "type": "object", "properties": { "usingObservableFrom": { @@ -4760,11 +4760,11 @@ }, { "const": "typescript-generic-sdk", - "description": "This plugin generate a generic SDK (without any Requester implemented), allow you to easily customize the way you fetch your data, without loosing the strongly-typed integration.\n\nFor more details and documentation: https://the-guild.dev/graphql/codegen/docs/plugins/typescript-generic-sdk\n\n=> Make sure to include \"@graphql-codegen/typescript-generic-sdk\" in your package.json file and install your dependencies.\n\n" + "description": "This plugin generate a generic SDK (without any Requester implemented), allow you to easily customize the way you fetch your data, without losing the strongly-typed integration.\n\nFor more details and documentation: https://the-guild.dev/graphql/codegen/docs/plugins/typescript-generic-sdk\n\n=> Make sure to include \"@graphql-codegen/typescript-generic-sdk\" in your package.json file and install your dependencies.\n\n" }, { "const": "@graphql-codegen/typescript-generic-sdk", - "description": "This plugin generate a generic SDK (without any Requester implemented), allow you to easily customize the way you fetch your data, without loosing the strongly-typed integration.\n\nFor more details and documentation: https://the-guild.dev/graphql/codegen/docs/plugins/typescript-generic-sdk\n\n=> Make sure to include \"@graphql-codegen/typescript-generic-sdk\" in your package.json file and install your dependencies.\n\n" + "description": "This plugin generate a generic SDK (without any Requester implemented), allow you to easily customize the way you fetch your data, without losing the strongly-typed integration.\n\nFor more details and documentation: https://the-guild.dev/graphql/codegen/docs/plugins/typescript-generic-sdk\n\n=> Make sure to include \"@graphql-codegen/typescript-generic-sdk\" in your package.json file and install your dependencies.\n\n" }, { "const": "typescript-apollo-client-helpers", diff --git a/website/src/pages/docs/guides/flutter-freezed.mdx b/website/src/pages/docs/guides/flutter-freezed.mdx index 23425ad760e..b30afd629f1 100644 --- a/website/src/pages/docs/guides/flutter-freezed.mdx +++ b/website/src/pages/docs/guides/flutter-freezed.mdx @@ -418,7 +418,7 @@ class SearchResult with _$SearchResult { // @6 ### Identifying the building blocks The generated output consists of several blocks enabling you to specify a configuration -targetting a specific block. +targeting a specific block. > All `APPLIES_ON_*` values are exported from the `plugin-config` module of this package.