Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dotansimha/graphql-code-generator
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @graphql-codegen/cli@1.19.1
Choose a base ref
...
head repository: dotansimha/graphql-code-generator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @graphql-codegen/cli@1.19.2
Choose a head ref

Commits on Nov 5, 2020

  1. [typescript-react-apollo] prevent baseOptions from being required whe…

    …n Mutation is used (#5046)
    
    * prevent baseOptions from being required when Mutation is used
    
    * fix for examples
    dotansimha authored Nov 5, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    lforst Luca Forstner
    Copy the full SHA
    b31ce77 View commit details
  2. chore(release): update monorepo packages versions (#5047)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Nov 5, 2020
    Copy the full SHA
    e12f653 View commit details

Commits on Nov 6, 2020

  1. Copy the full SHA
    4ec178f View commit details

Commits on Nov 9, 2020

  1. Copy the full SHA
    aafb0c6 View commit details
  2. Copy the full SHA
    3e496e4 View commit details
  3. Copy the full SHA
    b6453ff View commit details
  4. Copy the full SHA
    498ce97 View commit details
  5. Copy the full SHA
    d05a5eb View commit details

Commits on Nov 10, 2020

  1. Copy the full SHA
    fa5b258 View commit details

Commits on Nov 11, 2020

  1. Copy the full SHA
    07466ca View commit details
  2. Copy the full SHA
    41eb64b View commit details
  3. Copy the full SHA
    b71c85f View commit details

Commits on Nov 12, 2020

  1. Copy the full SHA
    7156cda View commit details

Commits on Nov 13, 2020

  1. Copy the full SHA
    cd03658 View commit details
  2. Copy the full SHA
    e6c5fc1 View commit details
  3. Copy the full SHA
    692d8b6 View commit details
  4. Copy the full SHA
    cf9346f View commit details

Commits on Nov 16, 2020

  1. Copy the full SHA
    7819534 View commit details
  2. fix(vue-apollo): Use empty object as default value to variables param…

    …eter instead of question mark when variables of query is all optional (#5076)
    
    * fix(vue-apollo): Use default value to variables parameter instead of question mark
    
    * update changeset
    fossamagna authored Nov 16, 2020
    Copy the full SHA
    4e0619e View commit details
  3. Support for @skip and @include directives in `typescript-operatio…

    …ns` (#5017)
    
    * testing issue 3836
    
    * remove console.log
    
    * test passes, yet others fail
    
    * merge with transformPrimitiveFields
    
    * merge PrimitiveField
    
    * rename and type func.
    
    * moving hasConditionalDirectives to utils
    
    * remove redundant import
    
    * updated types
    
    * typed better
    
    * dev-test updated
    
    * aaply fix to flow
    
    * changeset added
    
    * use MakeOptional wrapper
    
    * test updated
    
    * hasConditionalDirectives check improved
    
    * updated testing
    
    * adding MakeOptional wrapper by condition
    
    * rollback flow MakeOptional
    
    * .
    
    * flow use MakeOptional type on skip/include
    
    * declare MakeOptional type
    
    * added MakeOptional decleration
    
    * flow tests update
    
    * tests snapshot update
    
    * clean imports
    
    * update examples
    fix compatibility with presets
    
    * fix
    
    * fixes, update examples
    
    Co-authored-by: Dotan Simha <dotansimha@gmail.com>
    gilgardosh and dotansimha authored Nov 16, 2020
    Copy the full SHA
    475aa9b View commit details

Commits on Nov 17, 2020

  1. Copy the full SHA
    48f855b View commit details
  2. Copy the full SHA
    82a2915 View commit details
  3. Copy the full SHA
    2bd372a View commit details
  4. Copy the full SHA
    3512866 View commit details
  5. Copy the full SHA
    08e6e08 View commit details
  6. Copy the full SHA
    99f887e View commit details
  7. Preset for GraphQL-Modules (v1) integration (#3923)

    * GraphQL Modules preset
    
    * Produce type for resolve middlewares
    
    * match version
    
    * Support enums
    
    * Support InputObject types
    
    * Support Scalars
    
    * isTypeOf
    
    * Support Interfaces
    
    * Support Unions
    
    * Fixes
    
    * Version
    
    * Fixes
    
    * Fixes
    
    * Use key-value objects in resolve middlewares
    
    * Moar
    
    * Examples
    
    * Update snapshot
    
    * Tweaks
    
    * Middlewares
    
    * fixes
    
    * more fixes, added changeset
    
    * fixes
    
    * fixes
    
    * Use canary config
    
    * changeset
    
    * yarn
    
    * fix for scalars
    
    * added encapsulation, fixed external scalars
    
    * fixes
    
    * fixes
    
    * fixes
    
    * fixes
    
    * fixes
    
    * more fixes
    
    * fixes
    
    * fixes
    
    * fix
    
    * added changeset
    
    * fixes
    
    * bring back custom plugin for scalars
    
    * initial support for naming conventions
    
    * fixes
    
    * fix tests
    
    * fixes for enums
    
    * force enumsAsTypes to make it simpler to break to pieces
    
    * fixes
    
    * fixes
    
    * bump config package
    
    * update all examples
    
    * better support for interfaces
    
    * added docs
    docs fixes
    schema config fixes
    
    Co-authored-by: Dotan Simha <dotansimha@gmail.com>
    Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
    3 people authored Nov 17, 2020
    Copy the full SHA
    faa1397 View commit details
  8. chore(release): update monorepo packages versions (#5086)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Nov 17, 2020
    Copy the full SHA
    65b005f View commit details
Showing with 7,137 additions and 3,451 deletions.
  1. +9 −0 dev-test/codegen.yml
  2. +2 −1 dev-test/githunt/flow.flow.js
  3. +2 −0 dev-test/githunt/typed-document-nodes.ts
  4. +2 −0 dev-test/githunt/types.apolloAngular.sdk.ts
  5. +2 −0 dev-test/githunt/types.apolloAngular.ts
  6. +2 −0 dev-test/githunt/types.avoidOptionals.ts
  7. +2 −0 dev-test/githunt/types.d.ts
  8. +2 −0 dev-test/githunt/types.enumsAsTypes.ts
  9. +2 −0 dev-test/githunt/types.flatten.preResolveTypes.ts
  10. +2 −0 dev-test/githunt/types.immutableTypes.ts
  11. +2 −0 dev-test/githunt/types.preResolveTypes.compatibility.ts
  12. +2 −0 dev-test/githunt/types.preResolveTypes.onlyOperationTypes.ts
  13. +2 −0 dev-test/githunt/types.preResolveTypes.ts
  14. +5 −3 dev-test/githunt/types.reactApollo.customSuffix.tsx
  15. +5 −3 dev-test/githunt/types.reactApollo.hooks.tsx
  16. +5 −3 dev-test/githunt/types.reactApollo.preResolveTypes.tsx
  17. +5 −3 dev-test/githunt/types.reactApollo.tsx
  18. +5 −3 dev-test/githunt/types.reactApollo.v2.tsx
  19. +2 −0 dev-test/githunt/types.stencilApollo.tsx
  20. +2 −0 dev-test/githunt/types.ts
  21. +2 −0 dev-test/githunt/types.urql.tsx
  22. +2 −0 dev-test/githunt/types.vueApollo.ts
  23. +39 −0 dev-test/modules/blog/generated.ts
  24. +12 −0 dev-test/modules/blog/types/blog.graphql
  25. +33 −0 dev-test/modules/common/generated.ts
  26. +7 −0 dev-test/modules/common/types/common.graphql
  27. +69 −0 dev-test/modules/dotanions/generated.ts
  28. +33 −0 dev-test/modules/dotanions/types/donations.graphql
  29. +321 −0 dev-test/modules/types.ts
  30. +36 −0 dev-test/modules/users/generated.ts
  31. +10 −0 dev-test/modules/users/types/users.graphql
  32. +1 −1 dev-test/star-wars/__generated__/CreateReviewForEpisode.tsx
  33. +4 −2 dev-test/star-wars/__generated__/HeroNameConditional.tsx
  34. +10 −2 dev-test/star-wars/types.avoidOptionals.ts
  35. +2 −0 dev-test/star-wars/types.d.ts
  36. +9 −2 dev-test/star-wars/types.globallyAvailable.d.ts
  37. +6 −4 dev-test/star-wars/types.immutableTypes.ts
  38. +4 −2 dev-test/star-wars/types.preResolveTypes.onlyOperationTypes.ts
  39. +4 −2 dev-test/star-wars/types.preResolveTypes.ts
  40. +3 −1 dev-test/star-wars/types.refetchFn.tsx
  41. +10 −2 dev-test/star-wars/types.skipSchema.ts
  42. +10 −2 dev-test/star-wars/types.ts
  43. +10 −4 dev-test/test-message/types.tsx
  44. +2 −0 dev-test/test-schema/env.types.ts
  45. +2 −0 dev-test/test-schema/resolvers-federation.ts
  46. +2 −0 dev-test/test-schema/resolvers-root.ts
  47. +2 −0 dev-test/test-schema/resolvers-types.ts
  48. +2 −0 dev-test/test-schema/types.preResolveTypes.onlyOperationTypes.ts
  49. +2 −0 dev-test/test-schema/types.preResolveTypes.ts
  50. +2 −0 dev-test/test-schema/typings.avoidOptionals.ts
  51. +2 −0 dev-test/test-schema/typings.enum.ts
  52. +2 −0 dev-test/test-schema/typings.immutableTypes.ts
  53. +2 −0 dev-test/test-schema/typings.ts
  54. +2 −0 dev-test/test-schema/typings.wrapped.ts
  55. +1 −1 jest.project.js
  56. +14 −14 package.json
  57. +8 −0 packages/graphql-cli-codegen-plugin/CHANGELOG.md
  58. +2 −2 packages/graphql-cli-codegen-plugin/package.json
  59. +7 −0 packages/graphql-codegen-cli/CHANGELOG.md
  60. +3 −3 packages/graphql-codegen-cli/package.json
  61. +14 −8 packages/graphql-codegen-cli/src/config.ts
  62. +20 −11 packages/graphql-codegen-cli/src/load.ts
  63. +8 −0 packages/plugins/flow/operations/CHANGELOG.md
  64. +2 −2 packages/plugins/flow/operations/package.json
  65. +16 −6 packages/plugins/flow/operations/src/flow-selection-set-processor.ts
  66. +7 −4 packages/plugins/flow/operations/src/index.ts
  67. +2 −2 packages/plugins/flow/operations/src/visitor.ts
  68. +75 −1 packages/plugins/flow/operations/tests/__snapshots__/flow-documents.spec.ts.snap
  69. +54 −71 packages/plugins/flow/operations/tests/flow-documents.spec.ts
  70. +8 −0 packages/plugins/flow/resolvers/CHANGELOG.md
  71. +2 −2 packages/plugins/flow/resolvers/package.json
  72. +14 −3 packages/plugins/java/kotlin/src/visitor.ts
  73. +6 −0 packages/plugins/other/visitor-plugin-common/CHANGELOG.md
  74. +1 −1 packages/plugins/other/visitor-plugin-common/package.json
  75. +1 −1 packages/plugins/other/visitor-plugin-common/src/mappers.ts
  76. +4 −4 packages/plugins/other/visitor-plugin-common/src/selection-set-processor/base.ts
  77. +8 −5 packages/plugins/other/visitor-plugin-common/src/selection-set-processor/pre-resolve-types.ts
  78. +5 −1 packages/plugins/other/visitor-plugin-common/src/selection-set-to-object.ts
  79. +13 −1 packages/plugins/other/visitor-plugin-common/src/utils.ts
  80. +12 −0 packages/plugins/other/visitor-plugin-common/tests/parse-mapper.spec.ts
  81. +1 −1 packages/plugins/typescript/apollo-client-helpers/package.json
  82. +3 −0 packages/plugins/typescript/generic-sdk/tests/__snapshots__/generic-sdk.spec.ts.snap
  83. +3 −3 packages/plugins/typescript/graphql-files-modules/src/index.ts
  84. +1 −1 packages/plugins/typescript/graphql-request/package.json
  85. +4 −0 packages/plugins/typescript/graphql-request/tests/__snapshots__/graphql-request.spec.ts.snap
  86. +1 −1 packages/plugins/typescript/mongodb/package.json
  87. +8 −0 packages/plugins/typescript/operations/CHANGELOG.md
  88. +2 −2 packages/plugins/typescript/operations/package.json
  89. +19 −2 packages/plugins/typescript/operations/src/ts-selection-set-processor.ts
  90. +2 −2 packages/plugins/typescript/operations/src/visitor.ts
  91. +4 −0 packages/plugins/typescript/operations/tests/__snapshots__/ts-documents.spec.ts.snap
  92. +138 −0 packages/plugins/typescript/operations/tests/ts-documents.spec.ts
  93. +6 −0 packages/plugins/typescript/react-apollo/CHANGELOG.md
  94. +1 −1 packages/plugins/typescript/react-apollo/package.json
  95. +1 −1 packages/plugins/typescript/react-apollo/src/visitor.ts
  96. +4 −0 packages/plugins/typescript/react-apollo/tests/__snapshots__/react-apollo.spec.ts.snap
  97. +9 −1 packages/plugins/typescript/react-apollo/tests/react-apollo.spec.ts
  98. +8 −0 packages/plugins/typescript/resolvers/CHANGELOG.md
  99. +2 −2 packages/plugins/typescript/resolvers/package.json
  100. +2 −0 packages/plugins/typescript/resolvers/tests/__snapshots__/ts-resolvers.spec.ts.snap
  101. +1 −8 packages/plugins/typescript/type-graphql/src/visitor.ts
  102. +6 −1 packages/plugins/typescript/typescript/src/visitor.ts
  103. +8 −0 packages/plugins/typescript/vue-apollo/CHANGELOG.md
  104. +2 −2 packages/plugins/typescript/vue-apollo/package.json
  105. +3 −3 packages/plugins/typescript/vue-apollo/src/visitor.ts
  106. +44 −1 packages/plugins/typescript/vue-apollo/tests/vue-apollo.spec.ts
  107. +11 −0 packages/presets/graphql-modules/CHANGELOG.md
  108. +1 −0 packages/presets/graphql-modules/jest.config.js
  109. +40 −0 packages/presets/graphql-modules/package.json
  110. +464 −0 packages/presets/graphql-modules/src/builder.ts
  111. +101 −0 packages/presets/graphql-modules/src/config.ts
  112. +124 −0 packages/presets/graphql-modules/src/index.ts
  113. +206 −0 packages/presets/graphql-modules/src/utils.ts
  114. +137 −0 packages/presets/graphql-modules/tests/__snapshots__/builder.spec.ts.snap
  115. +71 −0 packages/presets/graphql-modules/tests/__snapshots__/integration.spec.ts.snap
  116. +365 −0 packages/presets/graphql-modules/tests/builder.spec.ts
  117. +78 −0 packages/presets/graphql-modules/tests/integration.spec.ts
  118. +12 −0 packages/presets/graphql-modules/tests/test-files/modules/blog/types/blog.graphql
  119. +7 −0 packages/presets/graphql-modules/tests/test-files/modules/common/types/common.graphql
  120. +33 −0 packages/presets/graphql-modules/tests/test-files/modules/dotanions/types/donations.graphql
  121. +10 −0 packages/presets/graphql-modules/tests/test-files/modules/users/types/users.graphql
  122. +1 −1 packages/utils/config-schema/package.json
  123. +5 −5 packages/utils/config-schema/src/docs.ts
  124. +44 −27 packages/utils/config-schema/src/index.ts
  125. +51 −32 packages/utils/config-schema/src/plugins.ts
  126. +55 −0 website/docs/generated-config/graphql-modules-preset.md
  127. +52 −0 website/docs/generated-config/import-types-preset.md
  128. +0 −35 website/docs/generated-config/import-types.md
  129. +59 −17 website/docs/generated-config/{near-operation-file.md → near-operation-file-preset.md}
  130. +4 −0 website/docs/getting-started/codegen-config.md
  131. +1 −1 website/docs/getting-started/documents-field.md
  132. +2 −2 website/docs/getting-started/programmatic-usage.md
  133. +52 −0 website/docs/presets/graphql-modules.md
  134. +1 −8 website/docs/presets/import-types.md
  135. +8 −5 website/docs/presets/index.md
  136. +1 −8 website/docs/presets/near-operation-file.md
  137. +7 −7 website/package.json
  138. +6 −1 website/sidebars.js
  139. +485 −832 website/static/config.schema.json
  140. +3,332 −2,255 yarn.lock
9 changes: 9 additions & 0 deletions dev-test/codegen.yml
Original file line number Diff line number Diff line change
@@ -302,6 +302,15 @@ generates:
plugins:
- typescript-operations
- typescript-react-apollo
./dev-test/modules/:
schema: ./dev-test/modules/*/types/*.graphql
preset: graphql-modules
presetConfig:
baseTypesPath: types.ts
filename: generated.ts
plugins:
- typescript
- typescript-resolvers
./dev-test/star-wars/types.globallyAvailable.d.ts:
schema: ./dev-test/star-wars/schema.json
documents: ./dev-test/star-wars/**/*.graphql
3 changes: 2 additions & 1 deletion dev-test/githunt/flow.flow.js
Original file line number Diff line number Diff line change
@@ -168,7 +168,8 @@ export type SubscriptionCommentAddedArgs = {|
|};

type $Pick<Origin: Object, Keys: Object> = $ObjMapi<Keys, <Key>(k: Key) => $ElementType<Origin, Key>>;

type $MakeOptional<T, K: Object> = $Diff<T, K> &
$ObjMapi<$Rest<T, K>, <SubKey>(k: SubKey) => Maybe<$ElementType<T, SubKey>>>;
export type OnCommentAddedSubscriptionVariables = {
repoFullName: $ElementType<Scalars, 'String'>,
};
2 changes: 2 additions & 0 deletions dev-test/githunt/typed-document-nodes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
2 changes: 2 additions & 0 deletions dev-test/githunt/types.apolloAngular.sdk.ts
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@ import * as Apollo from 'apollo-angular';
import * as ApolloCore from '@apollo/client/core';
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
2 changes: 2 additions & 0 deletions dev-test/githunt/types.apolloAngular.ts
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@ import { Injectable } from '@angular/core';
import * as Apollo from 'apollo-angular';
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
2 changes: 2 additions & 0 deletions dev-test/githunt/types.avoidOptionals.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
2 changes: 2 additions & 0 deletions dev-test/githunt/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
2 changes: 2 additions & 0 deletions dev-test/githunt/types.enumsAsTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
2 changes: 2 additions & 0 deletions dev-test/githunt/types.flatten.preResolveTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
2 changes: 2 additions & 0 deletions dev-test/githunt/types.immutableTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
2 changes: 2 additions & 0 deletions dev-test/githunt/types.preResolveTypes.compatibility.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
2 changes: 2 additions & 0 deletions dev-test/githunt/types.preResolveTypes.onlyOperationTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
2 changes: 2 additions & 0 deletions dev-test/githunt/types.preResolveTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
8 changes: 5 additions & 3 deletions dev-test/githunt/types.reactApollo.customSuffix.tsx
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@ import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
@@ -535,7 +537,7 @@ export type SubmitRepositoryMutationFn = Apollo.MutationFunction<
* });
*/
export function useSubmitRepositoryMutation(
baseOptions: Apollo.MutationHookOptions<SubmitRepositoryMutationMyOperation, SubmitRepositoryMutationVariables>
baseOptions?: Apollo.MutationHookOptions<SubmitRepositoryMutationMyOperation, SubmitRepositoryMutationVariables>
) {
return Apollo.useMutation<SubmitRepositoryMutationMyOperation, SubmitRepositoryMutationVariables>(
SubmitRepositoryDocument,
@@ -580,7 +582,7 @@ export type SubmitCommentMutationFn = Apollo.MutationFunction<
* });
*/
export function useSubmitCommentMutation(
baseOptions: Apollo.MutationHookOptions<SubmitCommentMutationMyOperation, SubmitCommentMutationVariables>
baseOptions?: Apollo.MutationHookOptions<SubmitCommentMutationMyOperation, SubmitCommentMutationVariables>
) {
return Apollo.useMutation<SubmitCommentMutationMyOperation, SubmitCommentMutationVariables>(
SubmitCommentDocument,
@@ -625,7 +627,7 @@ export type VoteMutationFn = Apollo.MutationFunction<VoteMutationMyOperation, Vo
* });
*/
export function useVoteMutation(
baseOptions: Apollo.MutationHookOptions<VoteMutationMyOperation, VoteMutationVariables>
baseOptions?: Apollo.MutationHookOptions<VoteMutationMyOperation, VoteMutationVariables>
) {
return Apollo.useMutation<VoteMutationMyOperation, VoteMutationVariables>(VoteDocument, baseOptions);
}
8 changes: 5 additions & 3 deletions dev-test/githunt/types.reactApollo.hooks.tsx
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@ import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
@@ -530,7 +532,7 @@ export type SubmitRepositoryMutationFn = Apollo.MutationFunction<
* });
*/
export function useSubmitRepositoryMutation(
baseOptions: Apollo.MutationHookOptions<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>
baseOptions?: Apollo.MutationHookOptions<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>
) {
return Apollo.useMutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>(
SubmitRepositoryDocument,
@@ -572,7 +574,7 @@ export type SubmitCommentMutationFn = Apollo.MutationFunction<SubmitCommentMutat
* });
*/
export function useSubmitCommentMutation(
baseOptions: Apollo.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>
baseOptions?: Apollo.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>
) {
return Apollo.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(SubmitCommentDocument, baseOptions);
}
@@ -613,7 +615,7 @@ export type VoteMutationFn = Apollo.MutationFunction<VoteMutation, VoteMutationV
* },
* });
*/
export function useVoteMutation(baseOptions: Apollo.MutationHookOptions<VoteMutation, VoteMutationVariables>) {
export function useVoteMutation(baseOptions?: Apollo.MutationHookOptions<VoteMutation, VoteMutationVariables>) {
return Apollo.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument, baseOptions);
}
export type VoteMutationHookResult = ReturnType<typeof useVoteMutation>;
8 changes: 5 additions & 3 deletions dev-test/githunt/types.reactApollo.preResolveTypes.tsx
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@ import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
@@ -557,7 +559,7 @@ export type SubmitRepositoryMutationFn = Apollo.MutationFunction<
* });
*/
export function useSubmitRepositoryMutation(
baseOptions: Apollo.MutationHookOptions<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>
baseOptions?: Apollo.MutationHookOptions<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>
) {
return Apollo.useMutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>(
SubmitRepositoryDocument,
@@ -599,7 +601,7 @@ export type SubmitCommentMutationFn = Apollo.MutationFunction<SubmitCommentMutat
* });
*/
export function useSubmitCommentMutation(
baseOptions: Apollo.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>
baseOptions?: Apollo.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>
) {
return Apollo.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(SubmitCommentDocument, baseOptions);
}
@@ -640,7 +642,7 @@ export type VoteMutationFn = Apollo.MutationFunction<VoteMutation, VoteMutationV
* },
* });
*/
export function useVoteMutation(baseOptions: Apollo.MutationHookOptions<VoteMutation, VoteMutationVariables>) {
export function useVoteMutation(baseOptions?: Apollo.MutationHookOptions<VoteMutation, VoteMutationVariables>) {
return Apollo.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument, baseOptions);
}
export type VoteMutationHookResult = ReturnType<typeof useVoteMutation>;
8 changes: 5 additions & 3 deletions dev-test/githunt/types.reactApollo.tsx
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@ import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
@@ -530,7 +532,7 @@ export type SubmitRepositoryMutationFn = Apollo.MutationFunction<
* });
*/
export function useSubmitRepositoryMutation(
baseOptions: Apollo.MutationHookOptions<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>
baseOptions?: Apollo.MutationHookOptions<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>
) {
return Apollo.useMutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>(
SubmitRepositoryDocument,
@@ -572,7 +574,7 @@ export type SubmitCommentMutationFn = Apollo.MutationFunction<SubmitCommentMutat
* });
*/
export function useSubmitCommentMutation(
baseOptions: Apollo.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>
baseOptions?: Apollo.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>
) {
return Apollo.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(SubmitCommentDocument, baseOptions);
}
@@ -613,7 +615,7 @@ export type VoteMutationFn = Apollo.MutationFunction<VoteMutation, VoteMutationV
* },
* });
*/
export function useVoteMutation(baseOptions: Apollo.MutationHookOptions<VoteMutation, VoteMutationVariables>) {
export function useVoteMutation(baseOptions?: Apollo.MutationHookOptions<VoteMutation, VoteMutationVariables>) {
return Apollo.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument, baseOptions);
}
export type VoteMutationHookResult = ReturnType<typeof useVoteMutation>;
8 changes: 5 additions & 3 deletions dev-test/githunt/types.reactApollo.v2.tsx
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@ import * as ApolloReactCommon from '@apollo/react-common';
import * as ApolloReactHooks from '@apollo/react-hooks';
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
@@ -533,7 +535,7 @@ export type SubmitRepositoryMutationFn = ApolloReactCommon.MutationFunction<
* });
*/
export function useSubmitRepositoryMutation(
baseOptions: ApolloReactHooks.MutationHookOptions<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>
baseOptions?: ApolloReactHooks.MutationHookOptions<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>
) {
return ApolloReactHooks.useMutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>(
SubmitRepositoryDocument,
@@ -578,7 +580,7 @@ export type SubmitCommentMutationFn = ApolloReactCommon.MutationFunction<
* });
*/
export function useSubmitCommentMutation(
baseOptions: ApolloReactHooks.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>
baseOptions?: ApolloReactHooks.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>
) {
return ApolloReactHooks.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(
SubmitCommentDocument,
@@ -623,7 +625,7 @@ export type VoteMutationFn = ApolloReactCommon.MutationFunction<VoteMutation, Vo
* });
*/
export function useVoteMutation(
baseOptions: ApolloReactHooks.MutationHookOptions<VoteMutation, VoteMutationVariables>
baseOptions?: ApolloReactHooks.MutationHookOptions<VoteMutation, VoteMutationVariables>
) {
return ApolloReactHooks.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument, baseOptions);
}
2 changes: 2 additions & 0 deletions dev-test/githunt/types.stencilApollo.tsx
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@ import * as StencilApollo from 'stencil-apollo';
import { h } from '@stencil/core';
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
2 changes: 2 additions & 0 deletions dev-test/githunt/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
2 changes: 2 additions & 0 deletions dev-test/githunt/types.urql.tsx
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@ import gql from 'graphql-tag';
import * as Urql from 'urql';
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
2 changes: 2 additions & 0 deletions dev-test/githunt/types.vueApollo.ts
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@ import * as VueApolloComposable from '@vue/apollo-composable';
import * as VueCompositionApi from '@vue/composition-api';
export type Maybe<T> = T | null;
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 keyof Pick<T, K>]?: Maybe<Pick<T, K>[SubKey]> };
export type ReactiveFunction<TParam> = () => TParam;
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
39 changes: 39 additions & 0 deletions dev-test/modules/blog/generated.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import * as Types from '../types';
import * as gm from 'graphql-modules';
export namespace BlogModule {
interface DefinedFields {
Article: 'id' | 'title' | 'text' | 'author';
Query: 'articles' | 'articleById' | 'articlesByUser';
}

export type Article = Pick<Types.Article, DefinedFields['Article']>;
export type User = Types.User;
export type Query = Pick<Types.Query, DefinedFields['Query']>;

export type ArticleResolvers = Pick<Types.ArticleResolvers, DefinedFields['Article'] | '__isTypeOf'>;
export type QueryResolvers = Pick<Types.QueryResolvers, DefinedFields['Query']>;

export interface Resolvers {
Article?: ArticleResolvers;
Query?: QueryResolvers;
}

export interface MiddlewareMap {
'*'?: {
'*'?: gm.Middleware[];
};
Article?: {
'*'?: gm.Middleware[];
id?: gm.Middleware[];
title?: gm.Middleware[];
text?: gm.Middleware[];
author?: gm.Middleware[];
};
Query?: {
'*'?: gm.Middleware[];
articles?: gm.Middleware[];
articleById?: gm.Middleware[];
articlesByUser?: gm.Middleware[];
};
}
}
12 changes: 12 additions & 0 deletions dev-test/modules/blog/types/blog.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type Article {
id: ID!
title: String!
text: String!
author: User!
}

extend type Query {
articles: [Article!]
articleById(id: ID!): Article
articlesByUser(userId: ID!): [Article!]
}
Loading