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: v1.7.0
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: v1.8.0
Choose a head ref

Commits on Aug 11, 2019

  1. import-types-preset

    veeramarni committed Aug 11, 2019
    Copy the full SHA
    68f8f27 View commit details

Commits on Aug 12, 2019

  1. Copy the full SHA
    5622098 View commit details

Commits on Aug 25, 2019

  1. Fix importDocumentNodeExternallyFrom on CRA TypeScript

    When using graphql-codegen with CRA
    
    I tried to use `importDocumentNodeExternallyFrom: near-operation-file` with in-source-code documents becuase I don't wanna separate document file(`.graphql`) from component code.
    
    in my config:
    ```yaml
    documents:
      - src/**/*.{ts,tsx}
      - '!src/**/*.generated.{ts,tsx}'
    
    generates
      ./src/generated/types.ts:
        plugins:
          - typescript
          - typescript-resolvers
    
      ./src/:
        preset: near-operation-file
        presetConfig:
          extension: .generated.tsx
          baseTypesPath: generated/types.ts
        plugins:
          - typescript-operations
          - typescript-react-apollo
        config:
          gqlImport: graphql.macro#gql
          documentMode: external
          importDocumentNodeExternallyFrom: near-operation-file
          reactApolloVersion: 3
          withComponent: false
          withHOC: false
          withHooks: true
    ```
    
    But I got an error: `An import path cannot end with a '.tsx' extension`
    
    I couldn't find a way to suppress/ignore the specific line without eject CRA or this change. CRA is force my tsconfig.json compilerOptions.moduleResolution to be `node`.
    cometkim committed Aug 25, 2019
    Copy the full SHA
    1358820 View commit details
  2. Fix related specs

    cometkim committed Aug 25, 2019
    Copy the full SHA
    3b09b42 View commit details

Commits on Sep 2, 2019

  1. Update dependency apollo-server to v2.9.3 (#2479)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and dotansimha committed Sep 2, 2019
    Copy the full SHA
    6229511 View commit details
  2. Update dependency husky to v3.0.5 (#2478)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and dotansimha committed Sep 2, 2019
    Copy the full SHA
    40154b2 View commit details
  3. Update dependency @material-ui/core to v4.4.0 (#2476)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and dotansimha committed Sep 2, 2019
    Copy the full SHA
    fc22ed2 View commit details
  4. Update dependency jest to v24.9.0 (#2475)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and dotansimha committed Sep 2, 2019
    Copy the full SHA
    21c9fa0 View commit details

Commits on Sep 3, 2019

  1. Fix comments escaping (#2484)

    ardatan authored and dotansimha committed Sep 3, 2019
    Copy the full SHA
    3d2f020 View commit details
  2. Update dependency graphql-toolkit to v0.5.12 (#2485)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and dotansimha committed Sep 3, 2019
    Copy the full SHA
    b61c644 View commit details
  3. preset [import-types] package dependencies correction (#2482)

    * update dependencies
    
    * correction and cleanup
    
    * correction and cleanup
    veeramarni authored and dotansimha committed Sep 3, 2019
    Copy the full SHA
    969ddf4 View commit details
  4. Update dependency urql to v1.4.1 (#2481)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and dotansimha committed Sep 3, 2019
    Copy the full SHA
    cd06f0c View commit details
  5. Copy the full SHA
    ba9b841 View commit details
  6. Copy the full SHA
    764d1eb View commit details
  7. Use The Guild's contact api (#2483)

    * Use The Guild's website contact api
    
    * Use The Guild's contact api
    
    * Project to String
    
    * Dotan wants, Dotan gets
    
    * Use the-guild.dev
    
    * No sendmail
    kamilkisiela authored and dotansimha committed Sep 3, 2019
    Copy the full SHA
    1b42ab3 View commit details
  8. Update package.json (#2488)

    remove stub package as peer dependency
    lifeiscontent authored and dotansimha committed Sep 3, 2019
    Copy the full SHA
    291848e View commit details
  9. Copy the full SHA
    d7b8a14 View commit details
  10. Copy the full SHA
    a356e78 View commit details
  11. fix(visitor-plugin-common): also include empty selection set types/ge…

    …nerate valid type output
    n1ru4l committed Sep 3, 2019
    Copy the full SHA
    d1c2438 View commit details
  12. 1
    Copy the full SHA
    d49dbba View commit details
  13. Copy the full SHA
    dbf87c2 View commit details
  14. Copy the full SHA
    d187ac1 View commit details

Commits on Sep 4, 2019

  1. Update dependency @microsoft/tsdoc to v0.12.14 (#2494)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and dotansimha committed Sep 4, 2019
    Copy the full SHA
    c1e61fc View commit details
  2. Copy the full SHA
    139e7d8 View commit details

Commits on Sep 5, 2019

  1. Copy the full SHA
    faf364b View commit details
  2. Copy the full SHA
    89ed88b View commit details

Commits on Sep 7, 2019

  1. Copy the full SHA
    2eacf50 View commit details
  2. Copy the full SHA
    5606339 View commit details

Commits on Sep 8, 2019

  1. Update Node.js to v12.10.0 (#2512)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and dotansimha committed Sep 8, 2019
    Copy the full SHA
    460cd79 View commit details
  2. Copy the full SHA
    f4a4582 View commit details
  3. Update dependency @material-ui/core to v4.4.1 (#2514)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and dotansimha committed Sep 8, 2019
    Copy the full SHA
    09e293d View commit details

Commits on Sep 9, 2019

  1. Update dependency @types/request to v2.48.3 (#2517)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and dotansimha committed Sep 9, 2019
    Copy the full SHA
    8c70bf5 View commit details
  2. Copy the full SHA
    d20d0ca View commit details
  3. extensions fixes

    dotansimha committed Sep 9, 2019
    Copy the full SHA
    607c71a View commit details
  4. Copy the full SHA
    5ec72c2 View commit details
  5. Copy the full SHA
    18147be View commit details

Commits on Sep 10, 2019

  1. Copy the full SHA
    0f98e84 View commit details
  2. Copy the full SHA
    b4e56da View commit details

Commits on Sep 11, 2019

  1. Copy the full SHA
    1a90ee0 View commit details
  2. Copy the full SHA
    356903b View commit details
  3. Copy the full SHA
    d15967b View commit details
  4. Update dependency @types/node to v10.14.18 (#2528)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and dotansimha committed Sep 11, 2019
    Copy the full SHA
    d022cd4 View commit details
  5. Copy the full SHA
    aaabd17 View commit details

Commits on Sep 12, 2019

  1. Fixes for flow plugins (#2533)

    added tests for flow plugins
    dotansimha authored Sep 12, 2019
    Copy the full SHA
    f8c5def View commit details
  2. Update dependency graphql-toolkit to v0.5.13 (#2539)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and dotansimha committed Sep 12, 2019
    Copy the full SHA
    08c99ca View commit details
  3. Update dependency aws-sdk to v2.527.0 (#2535)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and dotansimha committed Sep 12, 2019
    Copy the full SHA
    ae6d767 View commit details
  4. Update dependency @material-ui/core to v4.4.2 (#2537)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and dotansimha committed Sep 12, 2019
    Copy the full SHA
    f0349b9 View commit details
  5. Copy the full SHA
    f6a1fa1 View commit details
  6. Copy the full SHA
    bc2dc51 View commit details
  7. Copy the full SHA
    6478b87 View commit details
Showing with 20,241 additions and 3,739 deletions.
  1. +1 −1 .circleci/config.yml
  2. +1 −1 .gitignore
  3. +15 −0 dev-test/apollo-android/.prettierrc
  4. +15 −0 dev-test/apollo-android/codegen.yml
  5. +102 −0 dev-test/apollo-android/generatedJava/fragment/BF.java
  6. +217 −0 dev-test/apollo-android/generatedJava/fragment/NodeFields.java
  7. +308 −0 dev-test/apollo-android/generatedJava/operations/CreateTodoMutation.java
  8. +308 −0 dev-test/apollo-android/generatedJava/operations/DeleteTodoMutation.java
  9. +307 −0 dev-test/apollo-android/generatedJava/operations/GetTodoQuery.java
  10. +442 −0 dev-test/apollo-android/generatedJava/operations/ListTodos2Query.java
  11. +444 −0 dev-test/apollo-android/generatedJava/operations/ListTodosQuery.java
  12. +192 −0 dev-test/apollo-android/generatedJava/operations/NestedQuery.java
  13. +292 −0 dev-test/apollo-android/generatedJava/operations/OnCreateTodoSubscription.java
  14. +292 −0 dev-test/apollo-android/generatedJava/operations/OnDeleteTodoSubscription.java
  15. +292 −0 dev-test/apollo-android/generatedJava/operations/OnUpdateTodoSubscription.java
  16. +670 −0 dev-test/apollo-android/generatedJava/operations/SearchOneQuery.java
  17. +676 −0 dev-test/apollo-android/generatedJava/operations/SearchQuery.java
  18. +515 −0 dev-test/apollo-android/generatedJava/operations/SearchTestQuery.java
  19. +187 −0 dev-test/apollo-android/generatedJava/operations/SomethingQuery.java
  20. +308 −0 dev-test/apollo-android/generatedJava/operations/UpdateTodoMutation.java
  21. +86 −0 dev-test/apollo-android/generatedJava/type/CreateTodoInput.java
  22. +35 −0 dev-test/apollo-android/generatedJava/type/CustomType.java
  23. +56 −0 dev-test/apollo-android/generatedJava/type/DeleteTodoInput.java
  24. +71 −0 dev-test/apollo-android/generatedJava/type/ModelBooleanFilterInput.java
  25. +184 −0 dev-test/apollo-android/generatedJava/type/ModelFloatFilterInput.java
  26. +199 −0 dev-test/apollo-android/generatedJava/type/ModelIDFilterInput.java
  27. +184 −0 dev-test/apollo-android/generatedJava/type/ModelIntFilterInput.java
  28. +199 −0 dev-test/apollo-android/generatedJava/type/ModelStringFilterInput.java
  29. +148 −0 dev-test/apollo-android/generatedJava/type/ModelTodoFilterInput.java
  30. +86 −0 dev-test/apollo-android/generatedJava/type/UpdateTodoInput.java
  31. +1,857 −0 dev-test/apollo-android/schema.json
  32. +20 −0 dev-test/codegen.yml
  33. +0 −5 dev-test/config/gql-gen.json
  34. +1 −1 dev-test/generate-all.sh
  35. +1 −1 dev-test/generate-watch.sh
  36. +1 −1 dev-test/githunt/__generated__/comment.query.stencil-component.tsx
  37. +4 −5 dev-test/githunt/__generated__/feed-entry.fragment.stencil-component.tsx
  38. +1 −1 dev-test/githunt/__generated__/feed.query.stencil-component.tsx
  39. +1 −1 dev-test/githunt/__generated__/submit-comment.mutation.stencil-component.tsx
  40. +180 −57 dev-test/githunt/flow.flow.js
  41. +3 −3 dev-test/githunt/types.avoidOptionals.ts
  42. +3 −3 dev-test/githunt/types.d.ts
  43. +3 −3 dev-test/githunt/types.enumsAsTypes.ts
  44. +238 −0 dev-test/githunt/types.flatten.preResolveTypes.ts
  45. +3 −3 dev-test/githunt/types.immutableTypes.ts
  46. +2 −0 dev-test/githunt/types.preResolveTypes.compatibility.ts
  47. +1 −0 dev-test/githunt/types.preResolveTypes.ts
  48. +5 −3 dev-test/githunt/types.reactApollo.customSuffix.tsx
  49. +128 −6 dev-test/githunt/types.reactApollo.hooks.tsx
  50. +3 −0 dev-test/githunt/types.reactApollo.preResolveTypes.tsx
  51. +5 −3 dev-test/githunt/types.reactApollo.tsx
  52. +4 −3 dev-test/githunt/types.stencilApollo.tsx
  53. +3 −3 dev-test/githunt/types.ts
  54. +5 −3 dev-test/githunt/types.urql.tsx
  55. +1 −1 dev-test/init.sh
  56. +9 −0 dev-test/star-wars/HeroDetailsFragment.graphql
  57. +0 −9 dev-test/star-wars/HeroDetailsWithFragment.graphql
  58. +4 −0 dev-test/star-wars/HumanFields.graphql
  59. +1 −2 dev-test/star-wars/HumanWithNullWeight.graphql
  60. +40 −0 dev-test/star-wars/__generated__/CreateReviewForEpisode.tsx
  61. +42 −0 dev-test/star-wars/__generated__/HeroAndFriendsNames.tsx
  62. +33 −0 dev-test/star-wars/__generated__/HeroAppearsIn.tsx
  63. +40 −0 dev-test/star-wars/__generated__/HeroDetails.tsx
  64. +21 −0 dev-test/star-wars/__generated__/HeroDetailsFragment.tsx
  65. +37 −0 dev-test/star-wars/__generated__/HeroDetailsWithFragment.tsx
  66. +34 −0 dev-test/star-wars/__generated__/HeroName.tsx
  67. +71 −0 dev-test/star-wars/__generated__/HeroNameConditional.tsx
  68. +59 −0 dev-test/star-wars/__generated__/HeroParentTypeDependentField.tsx
  69. +43 −0 dev-test/star-wars/__generated__/HeroTypeDependentAliasedField.tsx
  70. +12 −0 dev-test/star-wars/__generated__/HumanFields.tsx
  71. +35 −0 dev-test/star-wars/__generated__/HumanWithNullWeight.tsx
  72. +38 −0 dev-test/star-wars/__generated__/TwoHeroes.tsx
  73. +11 −4 dev-test/star-wars/types.avoidOptionals.ts
  74. +11 −4 dev-test/star-wars/types.d.ts
  75. +11 −4 dev-test/star-wars/types.globallyAvailable.d.ts
  76. +11 −4 dev-test/star-wars/types.immutableTypes.ts
  77. +11 −4 dev-test/star-wars/types.preResolveTypes.ts
  78. +11 −4 dev-test/star-wars/types.skipSchema.ts
  79. +11 −4 dev-test/star-wars/types.ts
  80. +14 −13 dev-test/test-schema/flow-types.flow.js
  81. +6 −5 dev-test/test-schema/resolvers-federation.ts
  82. +1 −0 dev-test/test-schema/resolvers-root.ts
  83. +1 −0 dev-test/test-schema/resolvers-types.ts
  84. +1 −0 dev-test/test-schema/types.preResolveTypes.ts
  85. +1 −0 dev-test/test-schema/typings.ts
  86. +1 −0 dev-test/test-schema/typings.wrapped.ts
  87. +2 −2 docs/custom-codegen/write-your-plugin.md
  88. +7 −0 docs/generated-config/base-documents-visitor.md
  89. +19 −2 docs/generated-config/flow-operations.md
  90. +2 −2 docs/generated-config/flow.md
  91. +35 −0 docs/generated-config/import-types.md
  92. +51 −0 docs/generated-config/java-apollo-android.md
  93. +46 −0 docs/generated-config/kotlin.md
  94. +18 −0 docs/generated-config/near-operation-file.md
  95. +17 −0 docs/generated-config/typescript-operations.md
  96. +1 −1 docs/generated-config/typescript-react-apollo.md
  97. +1 −1 docs/getting-started/documents-field.md
  98. +2 −0 docs/migration/from-0-13.md
  99. +5 −3 docs/migration/from-0-18.md
  100. +5 −0 docs/plugins/client-note.md
  101. +2 −0 docs/plugins/flow-operations.md
  102. +6 −0 docs/plugins/index.md
  103. +56 −0 docs/plugins/java-apollo-android.md
  104. +3 −3 docs/plugins/java-installation.md
  105. +1 −1 docs/plugins/java.md
  106. +41 −0 docs/plugins/kotlin.md
  107. +4 −2 docs/plugins/typescript-apollo-angular.md
  108. +1 −1 docs/plugins/typescript-graphql-files-modules.md
  109. +2 −0 docs/plugins/typescript-operations.md
  110. +3 −1 docs/plugins/typescript-react-apollo.md
  111. +0 −4 docs/plugins/typescript-resolvers.md
  112. +3 −1 docs/plugins/typescript-stencil-apollo.md
  113. +3 −1 docs/plugins/typescript-urql.md
  114. +14 −0 docs/presets/import-types.md
  115. +1 −0 docs/presets/index.md
  116. +1 −1 lerna.json
  117. +16 −16 package.json
  118. +15 −15 packages/graphql-codegen-cli/package.json
  119. +14 −0 packages/graphql-codegen-cli/src/bin.ts
  120. +12 −24 packages/graphql-codegen-cli/src/cli.ts
  121. +6 −3 packages/graphql-codegen-cli/src/codegen.ts
  122. +4 −0 packages/graphql-codegen-cli/src/index.ts
  123. +5 −4 packages/graphql-codegen-cli/src/utils/listr-renderer.ts
  124. +1 −1 packages/graphql-codegen-cli/tsconfig.json
  125. +4 −4 packages/graphql-codegen-core/package.json
  126. +84 −77 packages/graphql-codegen-core/src/codegen.ts
  127. +12 −5 packages/graphql-codegen-core/src/execute-plugin.ts
  128. +56 −0 packages/graphql-codegen-core/tests/execute-plugin.spec.ts
  129. +7 −7 packages/plugins/flow/flow/package.json
  130. +2 −2 packages/plugins/flow/flow/src/index.ts
  131. +27 −3 packages/plugins/flow/flow/src/visitor.ts
  132. +709 −0 packages/plugins/flow/flow/tests/__snapshots__/flow.spec.ts.snap
  133. +128 −271 packages/plugins/flow/flow/tests/flow.spec.ts
  134. +1 −1 packages/plugins/flow/flow/tsconfig.json
  135. +10 −10 packages/plugins/flow/operations/package.json
  136. +62 −0 packages/plugins/flow/operations/src/flow-selection-set-processor.ts
  137. +0 −90 packages/plugins/flow/operations/src/flow-selection-set-to-object.ts
  138. +23 −4 packages/plugins/flow/operations/src/index.ts
  139. +44 −7 packages/plugins/flow/operations/src/visitor.ts
  140. +3 −0 packages/plugins/flow/operations/tests/__snapshots__/flow-documents.spec.ts.snap
  141. +138 −132 packages/plugins/flow/operations/tests/flow-documents.spec.ts
  142. +1 −1 packages/plugins/flow/operations/tsconfig.json
  143. +10 −10 packages/plugins/flow/resolvers/package.json
  144. +1 −1 packages/plugins/flow/resolvers/src/flow-util-types.ts
  145. +28 −23 packages/plugins/flow/resolvers/src/index.ts
  146. +10 −10 packages/plugins/flow/resolvers/tests/__snapshots__/flow-resolvers.spec.ts.snap
  147. +29 −5 packages/plugins/flow/resolvers/tests/flow-resolvers.spec.ts
  148. +1 −1 packages/plugins/flow/resolvers/tsconfig.json
  149. +5 −0 packages/plugins/java/apollo-android/.gitignore
  150. +4 −0 packages/plugins/java/apollo-android/.npmignore
  151. +36 −0 packages/plugins/java/apollo-android/package.json
  152. +135 −0 packages/plugins/java/apollo-android/src/base-java-visitor.ts
  153. +78 −0 packages/plugins/java/apollo-android/src/custom-type-class.ts
  154. +36 −0 packages/plugins/java/apollo-android/src/field-arguments.ts
  155. +6 −0 packages/plugins/java/apollo-android/src/file-type.ts
  156. +47 −0 packages/plugins/java/apollo-android/src/imports.ts
  157. +2 −0 packages/plugins/java/apollo-android/src/index.ts
  158. +219 −0 packages/plugins/java/apollo-android/src/input-type-visitor.ts
  159. +1,055 −0 packages/plugins/java/apollo-android/src/operation-visitor.ts
  160. +103 −0 packages/plugins/java/apollo-android/src/plugin.ts
  161. +93 −0 packages/plugins/java/apollo-android/src/preset.ts
  162. +9 −0 packages/plugins/java/apollo-android/src/types.ts
  163. +7 −0 packages/plugins/java/apollo-android/src/visitor-config.ts
  164. +1,242 −0 packages/plugins/java/apollo-android/tests/__snapshots__/operations.spec.ts.snap
  165. +167 −0 packages/plugins/java/apollo-android/tests/input.spec.ts
  166. +306 −0 packages/plugins/java/apollo-android/tests/operations.spec.ts
  167. +22 −0 packages/plugins/java/apollo-android/tsconfig.json
  168. +6 −5 packages/plugins/java/common/package.json
  169. +140 −11 packages/plugins/java/common/src/java-declaration-block.ts
  170. +1 −1 packages/plugins/java/common/src/scalars.ts
  171. +1 −1 packages/plugins/java/common/tsconfig.json
  172. +8 −8 packages/plugins/java/java/package.json
  173. +3 −11 packages/plugins/java/java/src/visitor.ts
  174. +1 −1 packages/plugins/java/java/tsconfig.json
  175. +5 −0 packages/plugins/java/kotlin/.gitignore
  176. +4 −0 packages/plugins/java/kotlin/.npmignore
  177. +37 −0 packages/plugins/java/kotlin/package.json
  178. +69 −0 packages/plugins/java/kotlin/src/index.ts
  179. +208 −0 packages/plugins/java/kotlin/src/visitor.ts
  180. +226 −0 packages/plugins/java/kotlin/tests/kotlin.spec.ts
  181. +22 −0 packages/plugins/java/kotlin/tsconfig.json
  182. +8 −8 packages/plugins/java/resolvers/package.json
  183. +4 −2 packages/plugins/java/resolvers/tests/java-resolvers.spec.ts
  184. +1 −1 packages/plugins/java/resolvers/tsconfig.json
  185. +4 −4 packages/plugins/other/add/package.json
  186. +1 −1 packages/plugins/other/add/tsconfig.json
  187. +5 −5 packages/plugins/other/fragment-matcher/package.json
  188. +10 −2 packages/plugins/other/fragment-matcher/src/index.ts
  189. +48 −1 packages/plugins/other/fragment-matcher/tests/plugin.spec.ts
  190. +1 −1 packages/plugins/other/fragment-matcher/tsconfig.json
  191. +5 −5 packages/plugins/other/introspection/package.json
  192. +9 −3 packages/plugins/other/introspection/src/index.ts
  193. +60 −1 packages/plugins/other/introspection/tests/introspection.spec.ts
  194. +1 −1 packages/plugins/other/introspection/tsconfig.json
  195. +5 −5 packages/plugins/other/schema-ast/package.json
  196. +11 −4 packages/plugins/other/schema-ast/src/index.ts
  197. +74 −0 packages/plugins/other/schema-ast/tests/schema-ast.spec.ts
  198. +1 −1 packages/plugins/other/schema-ast/tsconfig.json
  199. +4 −4 packages/plugins/other/time/package.json
  200. +1 −1 packages/plugins/other/time/tsconfig.json
  201. +8 −7 packages/plugins/other/visitor-plugin-common/package.json
  202. +16 −11 packages/plugins/other/visitor-plugin-common/src/base-documents-visitor.ts
  203. +41 −9 packages/plugins/other/visitor-plugin-common/src/base-resolvers-visitor.ts
  204. +27 −21 packages/plugins/other/visitor-plugin-common/src/base-types-visitor.ts
  205. +1 −4 packages/plugins/other/visitor-plugin-common/src/base-visitor.ts
  206. +27 −12 packages/plugins/other/visitor-plugin-common/src/client-side-base-visitor.ts
  207. +5 −1 packages/plugins/other/visitor-plugin-common/src/index.ts
  208. +1 −1 packages/plugins/other/visitor-plugin-common/src/mappers.ts
  209. +29 −0 packages/plugins/other/visitor-plugin-common/src/optimize-operations.ts
  210. +51 −0 packages/plugins/other/visitor-plugin-common/src/selection-set-processor/base.ts
  211. +74 −0 packages/plugins/other/visitor-plugin-common/src/selection-set-processor/pre-resolve-types.ts
  212. +203 −308 packages/plugins/other/visitor-plugin-common/src/selection-set-to-object.ts
  213. +64 −17 packages/plugins/other/visitor-plugin-common/src/utils.ts
  214. +2 −1 packages/plugins/other/visitor-plugin-common/tsconfig.json
  215. +7 −8 packages/plugins/typescript/apollo-angular/package.json
  216. +1 −1 packages/plugins/typescript/apollo-angular/src/index.ts
  217. +3 −3 packages/plugins/typescript/apollo-angular/src/visitor.ts
  218. +1 −1 packages/plugins/typescript/apollo-angular/tsconfig.json
  219. +6 −6 packages/plugins/typescript/compatibility/package.json
  220. +2 −1 packages/plugins/typescript/compatibility/src/selection-set-to-types.ts
  221. +1 −1 packages/plugins/typescript/compatibility/tsconfig.json
  222. +7 −7 packages/plugins/typescript/document-nodes/package.json
  223. +1 −1 packages/plugins/typescript/document-nodes/src/index.ts
  224. +3 −2 packages/plugins/typescript/document-nodes/src/visitor.ts
  225. +1 −1 packages/plugins/typescript/document-nodes/tsconfig.json
  226. +6 −6 packages/plugins/typescript/graphql-files-modules/package.json
  227. +1 −1 packages/plugins/typescript/graphql-files-modules/tsconfig.json
  228. +9 −9 packages/plugins/typescript/mongodb/package.json
  229. +1 −1 packages/plugins/typescript/mongodb/tsconfig.json
  230. +8 −8 packages/plugins/typescript/operations/package.json
  231. +21 −2 packages/plugins/typescript/operations/src/index.ts
  232. +52 −0 packages/plugins/typescript/operations/src/ts-selection-set-processor.ts
  233. +0 −53 packages/plugins/typescript/operations/src/ts-selection-set-to-object.ts
  234. +41 −5 packages/plugins/typescript/operations/src/visitor.ts
  235. +1,010 −141 packages/plugins/typescript/operations/tests/ts-documents.spec.ts
  236. +1 −1 packages/plugins/typescript/operations/tsconfig.json
  237. +7 −8 packages/plugins/typescript/react-apollo/package.json
  238. +2 −2 packages/plugins/typescript/react-apollo/src/index.ts
  239. +66 −18 packages/plugins/typescript/react-apollo/src/visitor.ts
  240. +91 −17 packages/plugins/typescript/react-apollo/tests/react-apollo.spec.ts
  241. +1 −1 packages/plugins/typescript/react-apollo/tsconfig.json
  242. +8 −8 packages/plugins/typescript/resolvers/package.json
  243. +19 −19 packages/plugins/typescript/resolvers/src/index.ts
  244. +89 −168 packages/plugins/typescript/resolvers/tests/federation.spec.ts
  245. +42 −42 packages/plugins/typescript/resolvers/tests/mapping.spec.ts
  246. +1 −1 packages/plugins/typescript/resolvers/tsconfig.json
  247. +8 −8 packages/plugins/typescript/stencil-apollo/package.json
  248. +1 −1 packages/plugins/typescript/stencil-apollo/src/index.ts
  249. +3 −3 packages/plugins/typescript/stencil-apollo/src/visitor.ts
  250. +1 −1 packages/plugins/typescript/stencil-apollo/tsconfig.json
  251. +8 −8 packages/plugins/typescript/type-graphql/package.json
  252. +1 −1 packages/plugins/typescript/type-graphql/tsconfig.json
  253. +7 −7 packages/plugins/typescript/typescript/package.json
  254. +37 −0 packages/plugins/typescript/typescript/tests/typescript.spec.ts
  255. +1 −1 packages/plugins/typescript/typescript/tsconfig.json
  256. +7 −7 packages/plugins/typescript/urql/package.json
  257. +1 −1 packages/plugins/typescript/urql/src/index.ts
  258. +3 −2 packages/plugins/typescript/urql/src/visitor.ts
  259. +2 −2 packages/plugins/typescript/urql/tests/urql.spec.ts
  260. +1 −1 packages/plugins/typescript/urql/tsconfig.json
  261. +9 −9 packages/presets/import-types/package.json
  262. +9 −9 packages/presets/import-types/src/index.ts
  263. +0 −19 packages/presets/import-types/src/utils.ts
  264. +1 −1 packages/presets/import-types/tsconfig.json
  265. +8 −8 packages/presets/near-operation-file/package.json
  266. +52 −22 packages/presets/near-operation-file/src/index.ts
  267. +1 −41 packages/presets/near-operation-file/src/utils.ts
  268. +0 −32 packages/presets/near-operation-file/tests/is-using-types.spec.ts
  269. +18 −1 packages/presets/near-operation-file/tests/near-operation-file.spec.ts
  270. +1 −1 packages/presets/near-operation-file/tsconfig.json
  271. +4 −4 packages/utils/config-md-generator/package.json
  272. +2 −1 packages/utils/config-md-generator/src/index.ts
  273. +3 −3 packages/utils/graphql-codegen-testing/package.json
  274. +8 −8 packages/utils/graphql-codegen-testing/src/index.ts
  275. +1 −1 packages/utils/graphql-codegen-testing/tsconfig.json
  276. +5 −2 packages/utils/plugins-helpers/package.json
  277. +135 −8 packages/{plugins/other/visitor-plugin-common → utils/plugins-helpers}/src/federation.ts
  278. +156 −0 packages/utils/plugins-helpers/src/helpers.ts
  279. +1 −0 packages/utils/plugins-helpers/src/index.ts
  280. +13 −0 packages/utils/plugins-helpers/src/utils.ts
  281. +137 −0 packages/utils/plugins-helpers/tests/is-using-types.spec.ts
  282. +1 −1 packages/utils/plugins-helpers/tsconfig.json
  283. +15 −4 website/core/help/ContactFormController.js
  284. +3 −0 website/generate-config.js
  285. +21 −0 website/i18n/en.json
  286. +0 −66 website/lambda/contact.js
  287. +33 −33 website/live-demo/package.json
  288. +4 −10 website/package.json
  289. +3 −1 website/sidebars.json
  290. +1,161 −1,470 yarn.lock
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:12.9.1
- image: circleci/node:12.10.0
steps:
- checkout
- restore_cache:
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -11,4 +11,4 @@ website/static/live-demo
temp
test-results/
junit.xml

dist
15 changes: 15 additions & 0 deletions dev-test/apollo-android/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"printWidth": 250,
"semi": true,
"singleQuote": true,
"overrides": [
{
"files": "*.java",
"options": {
"parser": "java"
}
}
]
}
15 changes: 15 additions & 0 deletions dev-test/apollo-android/codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
schema:
- https://jpmbfqfpxvcujfn4d4e3lu2pga.appsync-api.us-east-1.amazonaws.com/graphql:
headers:
'x-api-key': da2-t2u7vtm33fattisq6vrrde56ui
documents:
- /Users/dotansimha/Dev/test-app/app/src/main/graphql/com/amazonaws/amplify/generated/graphql/*.graphql
generates:
generatedJava/:
preset: java-apollo-android
config:
package: com.app.generated.graphql
scalars:
AWSDate: Long
plugins:
- java-apollo-android
102 changes: 102 additions & 0 deletions dev-test/apollo-android/generatedJava/fragment/BF.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package com.app.generated.graphql;

import java.util.Arrays;
import com.apollographql.apollo.api.GraphqlFragment;
import java.util.List;
import java.lang.String;
import java.util.Collections;
import java.lang.Override;
import javax.annotation.Generated;
import com.apollographql.apollo.api.ResponseFieldMapper;
import com.apollographql.apollo.api.ResponseField;
import javax.annotation.Nullable;
import javax.annotation.Nonnull;
import com.apollographql.apollo.api.internal.Utils;
import com.apollographql.apollo.api.ResponseReader;
import com.apollographql.apollo.api.ResponseFieldMarshaller;
import com.apollographql.apollo.api.ResponseWriter;

public class BF implements GraphqlFragment {
private final @Nonnull String __typename;
private final @Nullable String b;
private volatile String $toString;
private volatile int $hashCode;
private volatile boolean $hashCodeMemoized;
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.<ResponseField.Condition>emptyList()),
ResponseField.forString("b", "b", null, true, Collections.<ResponseField.Condition>emptyList())
};
public static final String FRAGMENT_DEFINITION = "fragment BF on B { b }";
public static final List<String> POSSIBLE_TYPES = Collections.unmodifiableList(Arrays.asList("B"));
public BF(@Nonnull String __typename, @Nullable String b) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.b = b;
}

public @Nonnull String __typename() {
return this.__typename;
}

public @Nullable String b() {
return this.b;
}

@Override
public String toString() {
if ($toString == null) {
$toString = "BF{"
+ "__typename=" + __typename + ", "
+ "b=" + b + ", "
+ "}";
}

return $toString;
}

@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof BF) {
BF that = (BF) o;
return this.__typename.equals(that.__typename) && ((this.b == null) ? (that.b == null) : this.b.equals(that.b));
}

return false;
}

@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= (b == null) ? 0 : b.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}

return $hashCode;
}

public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeString($responseFields[1], b != null ? b : null);
}
};
}
public static final class Mapper implements ResponseFieldMapper<BF> {
@Override
public BF map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final String b = reader.readString($responseFields[1]);
return new BF(__typename, b);
}
}

}
217 changes: 217 additions & 0 deletions dev-test/apollo-android/generatedJava/fragment/NodeFields.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
package com.app.generated.graphql;

import java.util.Arrays;
import com.apollographql.apollo.api.GraphqlFragment;
import java.util.List;
import java.lang.String;
import java.util.Collections;
import java.lang.Override;
import javax.annotation.Generated;
import com.apollographql.apollo.api.ResponseFieldMapper;
import com.apollographql.apollo.api.ResponseField;
import javax.annotation.Nonnull;
import type.CustomType;
import javax.annotation.Nullable;
import com.apollographql.apollo.api.internal.Utils;
import com.apollographql.apollo.api.ResponseReader;
import com.apollographql.apollo.api.ResponseFieldMarshaller;
import com.apollographql.apollo.api.ResponseWriter;

public class NodeFields implements GraphqlFragment {
private final @Nonnull String __typename;
private final @Nonnull String id;
private final @Nullable Test test;
private volatile String $toString;
private volatile int $hashCode;
private volatile boolean $hashCodeMemoized;
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.<ResponseField.Condition>emptyList()),
ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.<ResponseField.Condition>emptyList()),
ResponseField.forObject("test", "test", null, true, Collections.<ResponseField.Condition>emptyList())
};
public static final String FRAGMENT_DEFINITION = "fragment NodeFields on Node { id test { foo bar } }";
public static final List<String> POSSIBLE_TYPES = Collections.unmodifiableList(Arrays.asList("A", "B"));
public NodeFields(@Nonnull String __typename, @Nonnull String id, @Nullable Test test) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.id = Utils.checkNotNull(id, "id == null");
this.test = test;
}

public @Nonnull String __typename() {
return this.__typename;
}

public @Nonnull String id() {
return this.id;
}

public @Nullable Test test() {
return this.test;
}

@Override
public String toString() {
if ($toString == null) {
$toString = "NodeFields{"
+ "__typename=" + __typename + ", "
+ "id=" + id + ", "
+ "test=" + test + ", "
+ "}";
}

return $toString;
}

@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof NodeFields) {
NodeFields that = (NodeFields) o;
return this.__typename.equals(that.__typename) && this.id.equals(that.id) && ((this.test == null) ? (that.test == null) : this.test.equals(that.test));
}

return false;
}

@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= id.hashCode();
h *= 1000003;
h ^= (test == null) ? 0 : test.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}

return $hashCode;
}

public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeCustom((ResponseField.CustomTypeField) $responseFields[1], id);
writer.writeObject($responseFields[2], test != null ? test.marshaller() : null);
}
};
}
public static final class Mapper implements ResponseFieldMapper<NodeFields> {
private final Test.Mapper testFieldMapper = new Test.Mapper();
@Override
public NodeFields map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
final Test test = reader.readObject($responseFields[2], new ResponseReader.ObjectReader<Test>() {
@Override
public Test read(ResponseReader reader) {
return testFieldMapper.map(reader);
}
});
return new NodeFields(__typename, id, test);
}
}


public static class Test {
private final @Nonnull String __typename;
private final @Nullable String foo;
private final @Nullable String bar;
private volatile String $toString;
private volatile int $hashCode;
private volatile boolean $hashCodeMemoized;
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.<ResponseField.Condition>emptyList()),
ResponseField.forString("foo", "foo", null, true, Collections.<ResponseField.Condition>emptyList()),
ResponseField.forString("bar", "bar", null, true, Collections.<ResponseField.Condition>emptyList())
};
public Test(@Nonnull String __typename, @Nullable String foo, @Nullable String bar) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.foo = foo;
this.bar = bar;
}

public @Nonnull String __typename() {
return this.__typename;
}

public @Nullable String foo() {
return this.foo;
}

public @Nullable String bar() {
return this.bar;
}

@Override
public String toString() {
if ($toString == null) {
$toString = "Test{"
+ "__typename=" + __typename + ", "
+ "foo=" + foo + ", "
+ "bar=" + bar + ", "
+ "}";
}

return $toString;
}

@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Test) {
Test that = (Test) o;
return this.__typename.equals(that.__typename) && ((this.foo == null) ? (that.foo == null) : this.foo.equals(that.foo)) && ((this.bar == null) ? (that.bar == null) : this.bar.equals(that.bar));
}

return false;
}

@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= (foo == null) ? 0 : foo.hashCode();
h *= 1000003;
h ^= (bar == null) ? 0 : bar.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}

return $hashCode;
}

public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeString($responseFields[1], foo != null ? foo : null);
writer.writeString($responseFields[2], bar != null ? bar : null);
}
};
}
public static final class Mapper implements ResponseFieldMapper<Test> {
@Override
public Test map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final String foo = reader.readString($responseFields[1]);
final String bar = reader.readString($responseFields[2]);
return new Test(__typename, foo, bar);
}
}

}

}
Loading