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-community
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @graphql-codegen/typescript-generic-sdk@3.1.0
Choose a base ref
...
head repository: dotansimha/graphql-code-generator-community
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @graphql-codegen/typescript-generic-sdk@4.0.0
Choose a head ref

Commits on Feb 20, 2023

  1. chore(deps): update dependency eslint-plugin-import to v2.27.5 (#241)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1470221 View commit details
  2. chore(deps): update dependency svelte to v3.55.1 (#250)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4b20521 View commit details
  3. chore(deps): update dependency eslint-plugin-promise to v6.1.1 (#243)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d938e7b View commit details
  4. chore(deps): update dependency prettier to v2.8.4 (#263)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5513432 View commit details
  5. chore(deps): update dependency typescript to v4.9.5 (#251)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    56325a9 View commit details
  6. chore(deps): update dependency eslint-plugin-n to v15.6.1 (#242)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4105553 View commit details
  7. chore(deps): update dependency @theguild/prettier-config to v1 (#33)

    * chore(deps): update dependency @theguild/prettier-config to v1
    
    * prettify
    
    * prettify
    
    * prettify
    
    * prettify
    
    * prettify
    
    * prettify
    
    * fixes
    
    * fix
    
    * format flow
    
    * try to fix
    
    ---------
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com>
    renovate[bot] and dimaMachina authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0125c48 View commit details
  8. chore(deps): update dependency @types/node to v18.14.0 (#277)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7093349 View commit details
  9. chore(deps): update dependency lint-staged to v13.1.2 (#275)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6fd1757 View commit details
  10. chore(deps): update dependency flow-bin to v0.200.0 (#278)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6518be1 View commit details
  11. chore(deps): update dependency @urql/exchange-graphcache to v5.0.9 (#274

    )
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    074d614 View commit details
  12. chore(deps): update babel monorepo to v7.21.0 (#276)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9e2b5dd View commit details
  13. chore(deps): update typescript-eslint monorepo to v5.53.0 (#279)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bf9e7a6 View commit details
  14. chore(deps): update dependency flow-parser to v0.200.0 (#245)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    097a671 View commit details
  15. Remove unused deps (#280)

    * remove deps
    
    * more
    
    * more
    
    * more
    
    * more
    
    * more
    
    * more
    dimaMachina authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4c2289a View commit details
  16. chore(deps): update dependency @apollo/client to v3.7.9 (#89)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f50c1a1 View commit details

Commits on Feb 21, 2023

  1. chore(deps): update dependency @reduxjs/toolkit to v1.9.3 (#281)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 21, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    91f4f20 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    61c9819 View commit details

Commits on Feb 23, 2023

  1. chore(deps): update dependency @types/node to v18.14.1 (#284)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 23, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3560475 View commit details

Commits on Feb 26, 2023

  1. chore(deps): update dependency eslint to v8.35.0 (#286)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 26, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    890aabe View commit details

Commits on Mar 2, 2023

  1. chore(deps): update dependency rimraf to v4 (#259)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 2, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    65f8001 View commit details

Commits on Mar 21, 2023

  1. chore(deps): update dependency prettier to v2.8.5 (#308)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 21, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4b9715d View commit details

Commits on Mar 23, 2023

  1. Limit graphql-request version in plugin (#311)

    * Limit graphql-request version in plugin
    
    * Create .changeset/thick-bears-deny.md
    domdomegg authored Mar 23, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2c1652e View commit details
  2. chore(release): update monorepo packages versions (#313)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Mar 23, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3048ae1 View commit details

Commits on Mar 27, 2023

  1. fix(graph-cache-config): correct IntrospectionData (#297)

    * fix(graph-cache-config): correct `IntrospectionData`
    
    In `@urql/exchange-graphcache@v5.2.0` `IntrospectionData` is no longer exported, but can be accessed via `CacheExchangeOpts`'s schema property.
    
    * chore(urql-exchange-graphcache): update test
    
    * chore(ci): add changeset
    
    * chore: format
    
    * chore(githunt): update types
    
    * ci: remove eol node 12
    
    * ci: readd eol node 12
    dargmuesli authored Mar 27, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f73ab71 View commit details
  2. chore(release): update monorepo packages versions (#316)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Mar 27, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3b58033 View commit details

Commits on Mar 28, 2023

  1. chore(deps): update dependency @types/lodash to v4.14.192 (#317)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 28, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9c04f7c View commit details

Commits on Apr 9, 2023

  1. chore(deps): update dependency lint-staged to v13.2.1 (#295)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Apr 9, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bf71aee View commit details

Commits on May 12, 2023

  1. improve GraphCacheConfig type in urql-graphcache plugin (#338)

    * improve GraphCacheConfig type in urql-graphcache plugin
    
    * Changeset
    
    * Remove not needed imports
    
    * Update snapshots
    beerose authored May 12, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7e30935 View commit details

Commits on May 18, 2023

  1. feature: support graphql-request 6+ (#335)

    * feature: support graphql-request 6+
    
    * Create tough-olives-nail.md
    
    ---------
    
    Co-authored-by: Saihajpreet Singh <saihajpreet.singh@gmail.com>
    michaelgmcd and saihaj authored May 18, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b46fff0 View commit details
  2. chore(release): update monorepo packages versions (#343)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored May 18, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a6bb99c View commit details

Commits on May 24, 2023

  1. feat: drop node < 16 (#348)

    n1ru4l authored May 24, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9b6f8a6 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5ee1eb7 View commit details
  3. chore(deps): update graphql-tools monorepo to v10 (major) (#352)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    renovate[bot] and github-actions[bot] authored May 24, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fd3e6e4 View commit details
  4. chore(deps): update dependency cross-fetch to v3.1.6 (#351)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored May 24, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    931a804 View commit details
  5. chore(deps): update dependency @types/lodash to v4.14.194 (#350)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored May 24, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f496ef2 View commit details
  6. chore(deps): update dependency @oclif/command to v1.8.26 (#345)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored May 24, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    756b928 View commit details
  7. feat(react-query): exposeQueryRootKeys (#327)

    * expose query root key
    
    * Create famous-islands-joke.md
    
    * fix test
    
    * fix test
    
    ---------
    
    Co-authored-by: Chua Kang Ming <chuakangming@spgroup.com.sg>
    kambing86 and Chua Kang Ming authored May 24, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    88ea445 View commit details
  8. chore(deps): update dependency lint-staged to v13.2.2 (#356)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored May 24, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f8c8d5a View commit details
  9. style: run prettier

    saihaj committed May 24, 2023
    Copy the full SHA
    6a13cbc View commit details

Commits on Jul 8, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cb57636 View commit details

Commits on Jul 20, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2d3df93 View commit details

Commits on Jul 21, 2023

  1. chore(deps): update dependency @types/pluralize to v0.0.30 (#380)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jul 21, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ba006e6 View commit details

Commits on Aug 17, 2023

  1. fix(flutter-freezed): exported Patterns for advanced configuration (#386

    )
    
    * fix(flutter-freezed): exported Patterns for advanced configuration
    
    This closes #319
    
    * added change set
    
    * exported Patterns for advanced configuration
    Parables authored Aug 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b2ab7cb View commit details

Commits on Sep 7, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e330c6e View commit details

Commits on Sep 11, 2023

  1. chore(deps): update dependency cross-fetch to v3.1.8 (#382)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Sep 11, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    25488ec View commit details
  2. chore(deps): update dependency bob-the-bundler to v7.0.1 (#381)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Sep 11, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8bc81d4 View commit details
  3. fix(deps): update dependency @graphql-tools/utils to v10.0.6 (#377)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Sep 11, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    39f1bdf View commit details
  4. fix(preset/near-operation-file): accept skipDocumentsValidation confi…

    …g parameter. Closes #214 (#383)
    Sacha Lifszyc authored Sep 11, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9a692da View commit details
  5. chore(deps): update dependency @oclif/command to v1.8.36 (#378)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Sep 11, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f71d327 View commit details
Showing 305 changed files with 11,715 additions and 7,793 deletions.
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -2,4 +2,6 @@ blank_issues_enabled: false
contact_links:
- name: Have a question?
url: https://github.com/dotansimha/graphql-code-generator/discussions/new
about: Not sure about something? need help from the community? have a question to our team? please ask and answer questions here.
about:
Not sure about something? need help from the community? have a question to our team? please
ask and answer questions here.
22 changes: 15 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
🚨 **IMPORTANT: Please do not create a Pull Request without creating an issue first.**

_Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request._
_Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of
the pull request._

## Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Please include a summary of the change and which issue is fixed. Please also include relevant
motivation and context. List any dependencies that are required for this change.

Related # (issue)

@@ -18,16 +20,19 @@ Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as
expected)
- [ ] This change requires a documentation update

## Screenshots/Sandbox (if appropriate/relevant):

Adding links to sandbox or providing screenshots can help us understand more about this PR and take action on it as appropriate
Adding links to sandbox or providing screenshots can help us understand more about this PR and take
action on it as appropriate

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Please describe the tests that you ran to verify your changes. Provide instructions so we can
reproduce. Please also list any relevant details for your test configuration

- [ ] Test A
- [ ] Test B
@@ -40,7 +45,9 @@ Please describe the tests that you ran to verify your changes. Provide instructi

## Checklist:

- [ ] I have followed the [CONTRIBUTING](https://github.com/the-guild-org/Stack/blob/master/CONTRIBUTING.md) doc and the style guidelines of this project
- [ ] I have followed the
[CONTRIBUTING](https://github.com/the-guild-org/Stack/blob/master/CONTRIBUTING.md) doc and the
style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
@@ -51,4 +58,5 @@ Please describe the tests that you ran to verify your changes. Provide instructi

## Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...
If this is a relatively large or complex change, kick off the discussion by explaining why you chose
the solution you did and what alternatives you considered, etc...
20 changes: 11 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -24,11 +24,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Main
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 17
nodeVersion: 18
- name: Prettier Check
run: yarn prettier:check
dev-tests:
@@ -41,11 +41,11 @@ jobs:
- 'esm'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 17
nodeVersion: 18
- name: Build
run: yarn build
env:
@@ -59,7 +59,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
@@ -71,7 +71,9 @@ jobs:
- name: Test ESM & CJS integrity
run: yarn bob check
test:
name: Unit Test on Node ${{matrix.node_version}} (${{matrix.os}}) and GraphQL v${{matrix.graphql_version}}
name:
Unit Test on Node ${{matrix.node_version}} (${{matrix.os}}) and GraphQL
v${{matrix.graphql_version}}
runs-on: ubuntu-latest
needs:
- lint
@@ -81,15 +83,15 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest] # remove windows to speed up the tests
node_version: [12, 14, 16, 18]
node_version: [16, 18, 20]
graphql_version: [15, 16]
include:
- node-version: 12
- node-version: 18
os: windows-latest
graphql_version: 16
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
103 changes: 69 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,40 +2,70 @@

# GraphQL Code Generator: Community plugins

This repository is owned by the GraphQL Code Generator community and is home to the community plugins:

- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-react-apollo.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-react-apollo) - `@graphql-codegen/typescript-react-apollo`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-graphql-request.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-graphql-request) - `@graphql-codegen/typescript-graphql-request`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-apollo-angular.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-apollo-angular) - `@graphql-codegen/typescript-apollo-angular`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-apollo-client-helpers.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-apollo-client-helpers) - `@graphql-codegen/typescript-apollo-client-helpers`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-react-query.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-react-query) - `@graphql-codegen/typescript-react-query`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-urql.svg)](hts://badge.fury.io/js/%40graphql-codegen%2Ftypescript-urql) - `@graphql-codegen/typescript-urql`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fnamed-operations-object.svg)](https://badge.fury.io/js/%40graphql-codegen%2Fnamed-operations-object) - `@graphql-codegen/named-operations-object`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Furql-introspection.svg)](https://badge.fury.io/js/%40graphql-codegen%2Furql-introspection) - `@graphql-codegen/urql-introspection`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fcli.svg)](htflow-resolverss://badge.fury.io/js/%40graphql-codegen%2Fflow-resolvers) - `@graphql-codegen/flow-resolvers`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-vue-apollo.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-vue-apollo) - `@graphql-codegen/typescript-vue-apollo`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-rtk-query.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-rtk-query) - `@graphql-codegen/typescript-rtk-query`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fcli.svg)](htflow-operationss://badge.fury.io/js/%40graphql-codegen%2Fflow-operations) - `@graphql-codegen/flow-operations`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fcli.svg)](httypescript-msws://badge.fury.io/js/%40graphql-codegen%2Ftypescript-msw) - `@graphql-codegen/typescript-msw`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-mongodb.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-mongodb) - `@graphql-codegen/typescript-mongodb`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-nhost.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-nhost) - `@graphql-codegen/typescript-nhost`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-type-graphql.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-type-graphql) - `@graphql-codegen/typescript-type-graphql`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fcli.svg)](htjsdocs://badge.fury.io/js/%40graphql-codegen%2Fjsdoc) - `@graphql-codegen/jsdoc`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-vue-urql.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-vue-urql) - `@graphql-codegen/typescript-vue-urql`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fcli.svg)](htkotlins://badge.fury.io/js/%40graphql-codegen%2Fkotlin) - `@graphql-codegen/kotlin`
- [![npm version](https://badge.fury.io/js/%40graphql-cotypescript-vue-apollo-smart-ops%2Fcli.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-vue-apollo-smart-ops) - `@graphql-codegen/typescript-vue-apollo-smart-ops`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fcli.svg)](htjavas://badge.fury.io/js/%40graphql-codegen%2Fjava) - `@graphql-codegen/java`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fc-sharp-operations.svg)](https://badge.fury.io/js/%40graphql-codegen%2Fc-sharp-operations) - `@graphql-codegen/c-sharp-operations`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fhasura-allow-list.svg)](https://badge.fury.io/js/%40graphql-codegen%2Fhasura-allow-list) - `@graphql-codegen/hasura-allow-list`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-stencil-apollo.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-stencil-apollo) - `@graphql-codegen/typescript-stencil-apollo`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Frelay-operation-optimizer.svg)](https://badge.fury.io/js/%40graphql-codegen%2Frelay-operation-optimizer) - `@graphql-codegen/relay-operation-optimizer`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-oclif.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-oclif) - `@graphql-codegen/typescript-oclif`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fcli.svg)](htjava-resolverss://badge.fury.io/js/%40graphql-codegen%2Fjava-resolvers) - `@graphql-codegen/java-resolvers`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fjava-apollo-android.svg)](https://badge.fury.io/js/%40graphql-codegen%2Fjava-apollo-android) - `@graphql-codegen/java-apollo-android`
This repository is owned by the GraphQL Code Generator community and is home to the community
plugins:

- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-react-apollo.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-react-apollo) -
`@graphql-codegen/typescript-react-apollo`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-graphql-request.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-graphql-request) -
`@graphql-codegen/typescript-graphql-request`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-apollo-angular.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-apollo-angular) -
`@graphql-codegen/typescript-apollo-angular`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-apollo-client-helpers.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-apollo-client-helpers) -
`@graphql-codegen/typescript-apollo-client-helpers`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-react-query.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-react-query) -
`@graphql-codegen/typescript-react-query`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-urql.svg)](hts://badge.fury.io/js/%40graphql-codegen%2Ftypescript-urql) -
`@graphql-codegen/typescript-urql`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fnamed-operations-object.svg)](https://badge.fury.io/js/%40graphql-codegen%2Fnamed-operations-object) -
`@graphql-codegen/named-operations-object`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Furql-introspection.svg)](https://badge.fury.io/js/%40graphql-codegen%2Furql-introspection) -
`@graphql-codegen/urql-introspection`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fcli.svg)](htflow-resolverss://badge.fury.io/js/%40graphql-codegen%2Fflow-resolvers) -
`@graphql-codegen/flow-resolvers`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-vue-apollo.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-vue-apollo) -
`@graphql-codegen/typescript-vue-apollo`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-rtk-query.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-rtk-query) -
`@graphql-codegen/typescript-rtk-query`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fcli.svg)](htflow-operationss://badge.fury.io/js/%40graphql-codegen%2Fflow-operations) -
`@graphql-codegen/flow-operations`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fcli.svg)](httypescript-msws://badge.fury.io/js/%40graphql-codegen%2Ftypescript-msw) -
`@graphql-codegen/typescript-msw`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-mongodb.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-mongodb) -
`@graphql-codegen/typescript-mongodb`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-nhost.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-nhost) -
`@graphql-codegen/typescript-nhost`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-type-graphql.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-type-graphql) -
`@graphql-codegen/typescript-type-graphql`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fcli.svg)](htjsdocs://badge.fury.io/js/%40graphql-codegen%2Fjsdoc) -
`@graphql-codegen/jsdoc`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-vue-urql.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-vue-urql) -
`@graphql-codegen/typescript-vue-urql`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fcli.svg)](htkotlins://badge.fury.io/js/%40graphql-codegen%2Fkotlin) -
`@graphql-codegen/kotlin`
- [![npm version](https://badge.fury.io/js/%40graphql-cotypescript-vue-apollo-smart-ops%2Fcli.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-vue-apollo-smart-ops) -
`@graphql-codegen/typescript-vue-apollo-smart-ops`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fcli.svg)](htjavas://badge.fury.io/js/%40graphql-codegen%2Fjava) -
`@graphql-codegen/java`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fc-sharp-operations.svg)](https://badge.fury.io/js/%40graphql-codegen%2Fc-sharp-operations) -
`@graphql-codegen/c-sharp-operations`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fhasura-allow-list.svg)](https://badge.fury.io/js/%40graphql-codegen%2Fhasura-allow-list) -
`@graphql-codegen/hasura-allow-list`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-stencil-apollo.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-stencil-apollo) -
`@graphql-codegen/typescript-stencil-apollo`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Frelay-operation-optimizer.svg)](https://badge.fury.io/js/%40graphql-codegen%2Frelay-operation-optimizer) -
`@graphql-codegen/relay-operation-optimizer`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-oclif.svg)](https://badge.fury.io/js/%40graphql-codegen%2Ftypescript-oclif) -
`@graphql-codegen/typescript-oclif`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fcli.svg)](htjava-resolverss://badge.fury.io/js/%40graphql-codegen%2Fjava-resolvers) -
`@graphql-codegen/java-resolvers`
- [![npm version](https://badge.fury.io/js/%40graphql-codegen%2Fjava-apollo-android.svg)](https://badge.fury.io/js/%40graphql-codegen%2Fjava-apollo-android) -
`@graphql-codegen/java-apollo-android`

### Getting started with codegen

> You can find the complete instructions in [GraphQL Code Generator website](https://www.the-guild.dev/graphql/codegen/docs/getting-started/installation).
> You can find the complete instructions in
> [GraphQL Code Generator website](https://www.the-guild.dev/graphql/codegen/docs/getting-started/installation).
Start by installing the basic dependencies of GraphQL Codegen;

@@ -44,19 +74,24 @@ Start by installing the basic dependencies of GraphQL Codegen;

### Contributing

If this is your first time contributing to this project, please do read our [Contributor Workflow Guide](https://github.com/the-guild-org/Stack/blob/master/CONTRIBUTING.md) before you get started off.
If this is your first time contributing to this project, please do read our
[Contributor Workflow Guide](https://github.com/the-guild-org/Stack/blob/master/CONTRIBUTING.md)
before you get started off.

Feel free to open issues and pull requests. We're always welcome support from the community.

For a contribution guide specific to this project, please refer to: http://graphql-code-generator.com/docs/custom-codegen/contributing
For a contribution guide specific to this project, please refer to:
http://graphql-code-generator.com/docs/custom-codegen/contributing

#### Create a new community plugin

Get started with our guide: https://www.the-guild.dev/graphql/codegen/docs/custom-codegen

### Code of Conduct

Help us keep GraphQL Codegenerator open and inclusive. Please read and follow our [Code of Conduct](https://github.com/the-guild-org/Stack/blob/master/CODE_OF_CONDUCT.md) as adopted from [Contributor Covenant](https://www.contributor-covenant.org/)
Help us keep GraphQL Codegenerator open and inclusive. Please read and follow our
[Code of Conduct](https://github.com/the-guild-org/Stack/blob/master/CODE_OF_CONDUCT.md) as adopted
from [Contributor Covenant](https://www.contributor-covenant.org/)

### License

6 changes: 5 additions & 1 deletion dev-test/codegen.ts
Original file line number Diff line number Diff line change
@@ -103,7 +103,11 @@ const config: CodegenConfig = {
'!./dev-test/githunt-invalid/**/*.graphql',
],
preset: 'near-operation-file',
presetConfig: { extension: '.stencil-component.tsx', folder: '__generated__', baseTypesPath: 'types.d.ts' },
presetConfig: {
extension: '.stencil-component.tsx',
folder: '__generated__',
baseTypesPath: 'types.d.ts',
},
plugins: ['typescript-operations', 'typescript-stencil-apollo'],
config: { componentType: 'class', globalNamespace: true },
},

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 25 additions & 4 deletions dev-test/githunt/flow.flow.js
Original file line number Diff line number Diff line change
@@ -167,7 +167,10 @@ export const VoteTypeValues = Object.freeze({
/** The type of vote to record, when submitting a vote */
export type VoteType = $Values<typeof VoteTypeValues>;

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

export type OnCommentAddedSubscriptionVariables = {
repoFullName: $ElementType<Scalars, 'String'>,
@@ -224,7 +227,13 @@ export type CommentQuery = {
...{ __typename?: 'Repository' },
...$Pick<
Repository,
{| description?: *, open_issues_count?: *, stargazers_count: *, full_name: *, html_url: * |}
{|
description?: *,
open_issues_count?: *,
stargazers_count: *,
full_name: *,
html_url: *,
|},
>,
},
|},
@@ -263,7 +272,13 @@ export type FeedEntryFragment = {
...{ __typename?: 'Repository' },
...$Pick<
Repository,
{| full_name: *, html_url: *, description?: *, stargazers_count: *, open_issues_count?: * |}
{|
full_name: *,
html_url: *,
description?: *,
stargazers_count: *,
open_issues_count?: *,
|},
>,
...{|
owner?: ?{
@@ -304,7 +319,13 @@ export type FeedQuery = {
...{ __typename?: 'Repository' },
...$Pick<
Repository,
{| full_name: *, html_url: *, description?: *, stargazers_count: *, open_issues_count?: * |}
{|
full_name: *,
html_url: *,
description?: *,
stargazers_count: *,
open_issues_count?: *,
|},
>,
...{|
owner?: ?{
136 changes: 97 additions & 39 deletions dev-test/githunt/jit-sdk.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { GraphQLSchema, ExecutionResult } from 'graphql';
import { compileQuery, isCompiledQuery, CompilerOptions } from 'graphql-jit';
import { AggregateError, isAsyncIterable, mapAsyncIterator } from '@graphql-tools/utils';
import { ExecutionResult, GraphQLSchema } from 'graphql';
import { compileQuery, CompilerOptions, isCompiledQuery } from 'graphql-jit';
import gql from 'graphql-tag';
import { AggregateError, isAsyncIterable, mapAsyncIterator } from '@graphql-tools/utils';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
@@ -331,7 +332,12 @@ export type VoteMutationVariables = Exact<{

export type VoteMutation = {
__typename?: 'Mutation';
vote?: { __typename?: 'Entry'; score: number; id: number; vote: { __typename?: 'Vote'; vote_value: number } } | null;
vote?: {
__typename?: 'Entry';
score: number;
id: number;
vote: { __typename?: 'Vote'; vote_value: number };
} | null;
};

export const CommentsPageCommentFragmentDoc = gql`
@@ -474,18 +480,23 @@ export const VoteDocument = gql`
`;
async function handleSubscriptionResult<T>(
resultIterator: AsyncIterableIterator<ExecutionResult> | ExecutionResult,
operationName: string
operationName: string,
) {
if (isAsyncIterable(resultIterator)) {
return mapAsyncIterator<any, T>(resultIterator, result => handleExecutionResult(result, operationName));
return mapAsyncIterator<any, T>(resultIterator, result =>
handleExecutionResult(result, operationName),
);
} else {
return handleExecutionResult<T>(resultIterator, operationName);
}
}
function handleExecutionResult<T>(result: ExecutionResult, operationName: string) {
if (result.errors) {
const originalErrors = result.errors.map(error => error.originalError || error);
throw new AggregateError(originalErrors, `Failed to execute ${operationName}: \n\t${originalErrors.join('\n\t')}`);
throw new AggregateError(
originalErrors,
`Failed to execute ${operationName}: \n\t${originalErrors.join('\n\t')}`,
);
}
return result.data as unknown as T;
}
@@ -494,65 +505,108 @@ export interface SdkOptions<TGlobalContext = any, TGlobalRoot = any> {
globalRoot?: TGlobalRoot;
jitOptions?: Partial<CompilerOptions>;
}
export function getSdk<TGlobalContext = any, TGlobalRoot = any, TOperationContext = any, TOperationRoot = any>(
export function getSdk<
TGlobalContext = any,
TGlobalRoot = any,
TOperationContext = any,
TOperationRoot = any,
>(
schema: GraphQLSchema,
{ globalContext, globalRoot, jitOptions = {} }: SdkOptions<TGlobalContext, TGlobalRoot> = {}
{ globalContext, globalRoot, jitOptions = {} }: SdkOptions<TGlobalContext, TGlobalRoot> = {},
) {
const onCommentAddedCompiled = compileQuery(schema, OnCommentAddedDocument, 'onCommentAdded', jitOptions);
const onCommentAddedCompiled = compileQuery(
schema,
OnCommentAddedDocument,
'onCommentAdded',
jitOptions,
);
if (!isCompiledQuery(onCommentAddedCompiled)) {
const originalErrors = onCommentAddedCompiled?.errors?.map(error => error.originalError || error) || [];
throw new AggregateError(originalErrors, `Failed to compile onCommentAdded: \n\t${originalErrors.join('\n\t')}`);
const originalErrors =
onCommentAddedCompiled?.errors?.map(error => error.originalError || error) || [];
throw new AggregateError(
originalErrors,
`Failed to compile onCommentAdded: \n\t${originalErrors.join('\n\t')}`,
);
}

const CommentCompiled = compileQuery(schema, CommentDocument, 'Comment', jitOptions);
if (!isCompiledQuery(CommentCompiled)) {
const originalErrors = CommentCompiled?.errors?.map(error => error.originalError || error) || [];
throw new AggregateError(originalErrors, `Failed to compile Comment: \n\t${originalErrors.join('\n\t')}`);
const originalErrors =
CommentCompiled?.errors?.map(error => error.originalError || error) || [];
throw new AggregateError(
originalErrors,
`Failed to compile Comment: \n\t${originalErrors.join('\n\t')}`,
);
}

const CurrentUserForProfileCompiled = compileQuery(
schema,
CurrentUserForProfileDocument,
'CurrentUserForProfile',
jitOptions
jitOptions,
);
if (!isCompiledQuery(CurrentUserForProfileCompiled)) {
const originalErrors = CurrentUserForProfileCompiled?.errors?.map(error => error.originalError || error) || [];
const originalErrors =
CurrentUserForProfileCompiled?.errors?.map(error => error.originalError || error) || [];
throw new AggregateError(
originalErrors,
`Failed to compile CurrentUserForProfile: \n\t${originalErrors.join('\n\t')}`
`Failed to compile CurrentUserForProfile: \n\t${originalErrors.join('\n\t')}`,
);
}

const FeedCompiled = compileQuery(schema, FeedDocument, 'Feed', jitOptions);
if (!isCompiledQuery(FeedCompiled)) {
const originalErrors = FeedCompiled?.errors?.map(error => error.originalError || error) || [];
throw new AggregateError(originalErrors, `Failed to compile Feed: \n\t${originalErrors.join('\n\t')}`);
throw new AggregateError(
originalErrors,
`Failed to compile Feed: \n\t${originalErrors.join('\n\t')}`,
);
}

const submitRepositoryCompiled = compileQuery(schema, SubmitRepositoryDocument, 'submitRepository', jitOptions);
const submitRepositoryCompiled = compileQuery(
schema,
SubmitRepositoryDocument,
'submitRepository',
jitOptions,
);
if (!isCompiledQuery(submitRepositoryCompiled)) {
const originalErrors = submitRepositoryCompiled?.errors?.map(error => error.originalError || error) || [];
throw new AggregateError(originalErrors, `Failed to compile submitRepository: \n\t${originalErrors.join('\n\t')}`);
const originalErrors =
submitRepositoryCompiled?.errors?.map(error => error.originalError || error) || [];
throw new AggregateError(
originalErrors,
`Failed to compile submitRepository: \n\t${originalErrors.join('\n\t')}`,
);
}

const submitCommentCompiled = compileQuery(schema, SubmitCommentDocument, 'submitComment', jitOptions);
const submitCommentCompiled = compileQuery(
schema,
SubmitCommentDocument,
'submitComment',
jitOptions,
);
if (!isCompiledQuery(submitCommentCompiled)) {
const originalErrors = submitCommentCompiled?.errors?.map(error => error.originalError || error) || [];
throw new AggregateError(originalErrors, `Failed to compile submitComment: \n\t${originalErrors.join('\n\t')}`);
const originalErrors =
submitCommentCompiled?.errors?.map(error => error.originalError || error) || [];
throw new AggregateError(
originalErrors,
`Failed to compile submitComment: \n\t${originalErrors.join('\n\t')}`,
);
}

const voteCompiled = compileQuery(schema, VoteDocument, 'vote', jitOptions);
if (!isCompiledQuery(voteCompiled)) {
const originalErrors = voteCompiled?.errors?.map(error => error.originalError || error) || [];
throw new AggregateError(originalErrors, `Failed to compile vote: \n\t${originalErrors.join('\n\t')}`);
throw new AggregateError(
originalErrors,
`Failed to compile vote: \n\t${originalErrors.join('\n\t')}`,
);
}

return {
async onCommentAdded(
variables: OnCommentAddedSubscriptionVariables,
context?: TOperationContext,
root?: TOperationRoot
root?: TOperationRoot,
): Promise<AsyncIterableIterator<OnCommentAddedSubscription> | OnCommentAddedSubscription> {
const result = await onCommentAddedCompiled.subscribe!(
{
@@ -563,14 +617,14 @@ export function getSdk<TGlobalContext = any, TGlobalRoot = any, TOperationContex
...globalContext,
...context,
},
variables
variables,
);
return handleSubscriptionResult(result, 'onCommentAdded');
},
async Comment(
variables: CommentQueryVariables,
context?: TOperationContext,
root?: TOperationRoot
root?: TOperationRoot,
): Promise<CommentQuery> {
const result = await CommentCompiled.query(
{
@@ -581,14 +635,14 @@ export function getSdk<TGlobalContext = any, TGlobalRoot = any, TOperationContex
...globalContext,
...context,
},
variables
variables,
);
return handleExecutionResult(result, 'Comment');
},
async CurrentUserForProfile(
variables?: CurrentUserForProfileQueryVariables,
context?: TOperationContext,
root?: TOperationRoot
root?: TOperationRoot,
): Promise<CurrentUserForProfileQuery> {
const result = await CurrentUserForProfileCompiled.query(
{
@@ -599,11 +653,15 @@ export function getSdk<TGlobalContext = any, TGlobalRoot = any, TOperationContex
...globalContext,
...context,
},
variables
variables,
);
return handleExecutionResult(result, 'CurrentUserForProfile');
},
async Feed(variables: FeedQueryVariables, context?: TOperationContext, root?: TOperationRoot): Promise<FeedQuery> {
async Feed(
variables: FeedQueryVariables,
context?: TOperationContext,
root?: TOperationRoot,
): Promise<FeedQuery> {
const result = await FeedCompiled.query(
{
...globalRoot,
@@ -613,14 +671,14 @@ export function getSdk<TGlobalContext = any, TGlobalRoot = any, TOperationContex
...globalContext,
...context,
},
variables
variables,
);
return handleExecutionResult(result, 'Feed');
},
async submitRepository(
variables: SubmitRepositoryMutationVariables,
context?: TOperationContext,
root?: TOperationRoot
root?: TOperationRoot,
): Promise<SubmitRepositoryMutation> {
const result = await submitRepositoryCompiled.query(
{
@@ -631,14 +689,14 @@ export function getSdk<TGlobalContext = any, TGlobalRoot = any, TOperationContex
...globalContext,
...context,
},
variables
variables,
);
return handleExecutionResult(result, 'submitRepository');
},
async submitComment(
variables: SubmitCommentMutationVariables,
context?: TOperationContext,
root?: TOperationRoot
root?: TOperationRoot,
): Promise<SubmitCommentMutation> {
const result = await submitCommentCompiled.query(
{
@@ -649,14 +707,14 @@ export function getSdk<TGlobalContext = any, TGlobalRoot = any, TOperationContex
...globalContext,
...context,
},
variables
variables,
);
return handleExecutionResult(result, 'submitComment');
},
async vote(
variables: VoteMutationVariables,
context?: TOperationContext,
root?: TOperationRoot
root?: TOperationRoot,
): Promise<VoteMutation> {
const result = await voteCompiled.query(
{
@@ -667,7 +725,7 @@ export function getSdk<TGlobalContext = any, TGlobalRoot = any, TOperationContex
...globalContext,
...context,
},
variables
variables,
);
return handleExecutionResult(result, 'vote');
},
51 changes: 36 additions & 15 deletions dev-test/githunt/types.apolloAngular.sdk.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { gql } from 'apollo-angular';
import { Injectable } from '@angular/core';
import * as Apollo from 'apollo-angular';
import { Injectable } from '@angular/core';
import * as ApolloCore from '@apollo/client/core';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
@@ -331,7 +332,12 @@ export type VoteMutationVariables = Exact<{

export type VoteMutation = {
__typename?: 'Mutation';
vote?: { __typename?: 'Entry'; score: number; id: number; vote: { __typename?: 'Vote'; vote_value: number } } | null;
vote?: {
__typename?: 'Entry';
score: number;
id: number;
vote: { __typename?: 'Vote'; vote_value: number };
} | null;
};

export const CommentsPageCommentFragmentDoc = gql`
@@ -507,7 +513,10 @@ export const SubmitRepositoryDocument = gql`
@Injectable({
providedIn: 'root',
})
export class SubmitRepositoryGQL extends Apollo.Mutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables> {
export class SubmitRepositoryGQL extends Apollo.Mutation<
SubmitRepositoryMutation,
SubmitRepositoryMutationVariables
> {
document = SubmitRepositoryDocument;

constructor(apollo: Apollo.Apollo) {
@@ -526,7 +535,10 @@ export const SubmitCommentDocument = gql`
@Injectable({
providedIn: 'root',
})
export class SubmitCommentGQL extends Apollo.Mutation<SubmitCommentMutation, SubmitCommentMutationVariables> {
export class SubmitCommentGQL extends Apollo.Mutation<
SubmitCommentMutation,
SubmitCommentMutationVariables
> {
document = SubmitCommentDocument;

constructor(apollo: Apollo.Apollo) {
@@ -558,13 +570,16 @@ export class VoteGQL extends Apollo.Mutation<VoteMutation, VoteMutationVariables

type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;

interface WatchQueryOptionsAlone<V> extends Omit<ApolloCore.WatchQueryOptions<V>, 'query' | 'variables'> {}
interface WatchQueryOptionsAlone<V>
extends Omit<ApolloCore.WatchQueryOptions<V>, 'query' | 'variables'> {}

interface QueryOptionsAlone<V> extends Omit<ApolloCore.QueryOptions<V>, 'query' | 'variables'> {}

interface MutationOptionsAlone<T, V> extends Omit<ApolloCore.MutationOptions<T, V>, 'mutation' | 'variables'> {}
interface MutationOptionsAlone<T, V>
extends Omit<ApolloCore.MutationOptions<T, V>, 'mutation' | 'variables'> {}

interface SubscriptionOptionsAlone<V> extends Omit<ApolloCore.SubscriptionOptions<V>, 'query' | 'variables'> {}
interface SubscriptionOptionsAlone<V>
extends Omit<ApolloCore.SubscriptionOptions<V>, 'query' | 'variables'> {}

@Injectable({ providedIn: 'root' })
export class ApolloAngularSDK {
@@ -575,12 +590,12 @@ export class ApolloAngularSDK {
private feedGql: FeedGQL,
private submitRepositoryGql: SubmitRepositoryGQL,
private submitCommentGql: SubmitCommentGQL,
private voteGql: VoteGQL
private voteGql: VoteGQL,
) {}

onCommentAdded(
variables: OnCommentAddedSubscriptionVariables,
options?: SubscriptionOptionsAlone<OnCommentAddedSubscriptionVariables>
options?: SubscriptionOptionsAlone<OnCommentAddedSubscriptionVariables>,
) {
return this.onCommentAddedGql.subscribe(variables, options);
}
@@ -589,20 +604,23 @@ export class ApolloAngularSDK {
return this.commentGql.fetch(variables, options);
}

commentWatch(variables: CommentQueryVariables, options?: WatchQueryOptionsAlone<CommentQueryVariables>) {
commentWatch(
variables: CommentQueryVariables,
options?: WatchQueryOptionsAlone<CommentQueryVariables>,
) {
return this.commentGql.watch(variables, options);
}

currentUserForProfile(
variables?: CurrentUserForProfileQueryVariables,
options?: QueryOptionsAlone<CurrentUserForProfileQueryVariables>
options?: QueryOptionsAlone<CurrentUserForProfileQueryVariables>,
) {
return this.currentUserForProfileGql.fetch(variables, options);
}

currentUserForProfileWatch(
variables?: CurrentUserForProfileQueryVariables,
options?: WatchQueryOptionsAlone<CurrentUserForProfileQueryVariables>
options?: WatchQueryOptionsAlone<CurrentUserForProfileQueryVariables>,
) {
return this.currentUserForProfileGql.watch(variables, options);
}
@@ -617,19 +635,22 @@ export class ApolloAngularSDK {

submitRepository(
variables: SubmitRepositoryMutationVariables,
options?: MutationOptionsAlone<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>
options?: MutationOptionsAlone<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>,
) {
return this.submitRepositoryGql.mutate(variables, options);
}

submitComment(
variables: SubmitCommentMutationVariables,
options?: MutationOptionsAlone<SubmitCommentMutation, SubmitCommentMutationVariables>
options?: MutationOptionsAlone<SubmitCommentMutation, SubmitCommentMutationVariables>,
) {
return this.submitCommentGql.mutate(variables, options);
}

vote(variables: VoteMutationVariables, options?: MutationOptionsAlone<VoteMutation, VoteMutationVariables>) {
vote(
variables: VoteMutationVariables,
options?: MutationOptionsAlone<VoteMutation, VoteMutationVariables>,
) {
return this.voteGql.mutate(variables, options);
}
}
20 changes: 16 additions & 4 deletions dev-test/githunt/types.apolloAngular.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { gql } from 'apollo-angular';
import { Injectable } from '@angular/core';
import * as Apollo from 'apollo-angular';
import { Injectable } from '@angular/core';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
@@ -330,7 +331,12 @@ export type VoteMutationVariables = Exact<{

export type VoteMutation = {
__typename?: 'Mutation';
vote?: { __typename?: 'Entry'; score: number; id: number; vote: { __typename?: 'Vote'; vote_value: number } } | null;
vote?: {
__typename?: 'Entry';
score: number;
id: number;
vote: { __typename?: 'Vote'; vote_value: number };
} | null;
};

export const CommentsPageCommentFragmentDoc = gql`
@@ -506,7 +512,10 @@ export const SubmitRepositoryDocument = gql`
@Injectable({
providedIn: 'root',
})
export class SubmitRepositoryGQL extends Apollo.Mutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables> {
export class SubmitRepositoryGQL extends Apollo.Mutation<
SubmitRepositoryMutation,
SubmitRepositoryMutationVariables
> {
document = SubmitRepositoryDocument;

constructor(apollo: Apollo.Apollo) {
@@ -525,7 +534,10 @@ export const SubmitCommentDocument = gql`
@Injectable({
providedIn: 'root',
})
export class SubmitCommentGQL extends Apollo.Mutation<SubmitCommentMutation, SubmitCommentMutationVariables> {
export class SubmitCommentGQL extends Apollo.Mutation<
SubmitCommentMutation,
SubmitCommentMutationVariables
> {
document = SubmitCommentDocument;

constructor(apollo: Apollo.Apollo) {
118 changes: 75 additions & 43 deletions dev-test/githunt/types.react-query.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
import {
useQuery,
useInfiniteQuery,
useMutation,
UseQueryOptions,
UseInfiniteQueryOptions,
useMutation,
UseMutationOptions,
useQuery,
UseQueryOptions,
} from '@tanstack/react-query';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };

function fetcher<TData, TVariables>(endpoint: string, requestInit: RequestInit, query: string, variables?: TVariables) {
function fetcher<TData, TVariables>(
endpoint: string,
requestInit: RequestInit,
query: string,
variables?: TVariables,
) {
return async (): Promise<TData> => {
const res = await fetch(endpoint, {
method: 'POST',
@@ -355,7 +361,12 @@ export type VoteMutationVariables = Exact<{

export type VoteMutation = {
__typename?: 'Mutation';
vote?: { __typename?: 'Entry'; score: number; id: number; vote: { __typename?: 'Vote'; vote_value: number } } | null;
vote?: {
__typename?: 'Entry';
score: number;
id: number;
vote: { __typename?: 'Vote'; vote_value: number };
} | null;
};

export const CommentsPageCommentFragmentDoc = `
@@ -452,32 +463,33 @@ export const CommentDocument = `
export const useCommentQuery = <TData = CommentQuery, TError = unknown>(
dataSource: { endpoint: string; fetchParams?: RequestInit },
variables: CommentQueryVariables,
options?: UseQueryOptions<CommentQuery, TError, TData>
options?: UseQueryOptions<CommentQuery, TError, TData>,
) =>
useQuery<CommentQuery, TError, TData>(
['Comment', variables],
fetcher<CommentQuery, CommentQueryVariables>(
dataSource.endpoint,
dataSource.fetchParams || {},
CommentDocument,
variables
variables,
),
options
options,
);
export const useInfiniteCommentQuery = <TData = CommentQuery, TError = unknown>(
dataSource: { endpoint: string; fetchParams?: RequestInit },
pageParamKey: keyof CommentQueryVariables,
variables: CommentQueryVariables,
options?: UseInfiniteQueryOptions<CommentQuery, TError, TData>
options?: UseInfiniteQueryOptions<CommentQuery, TError, TData>,
) =>
useInfiniteQuery<CommentQuery, TError, TData>(
['Comment.infinite', variables],
metaData =>
fetcher<CommentQuery, CommentQueryVariables>(dataSource.endpoint, dataSource.fetchParams || {}, CommentDocument, {
...variables,
...(metaData.pageParam ?? {}),
})(),
options
fetcher<CommentQuery, CommentQueryVariables>(
dataSource.endpoint,
dataSource.fetchParams || {},
CommentDocument,
{ ...variables, ...(metaData.pageParam ?? {}) },
)(),
options,
);

export const CurrentUserForProfileDocument = `
@@ -491,34 +503,38 @@ export const CurrentUserForProfileDocument = `
export const useCurrentUserForProfileQuery = <TData = CurrentUserForProfileQuery, TError = unknown>(
dataSource: { endpoint: string; fetchParams?: RequestInit },
variables?: CurrentUserForProfileQueryVariables,
options?: UseQueryOptions<CurrentUserForProfileQuery, TError, TData>
options?: UseQueryOptions<CurrentUserForProfileQuery, TError, TData>,
) =>
useQuery<CurrentUserForProfileQuery, TError, TData>(
variables === undefined ? ['CurrentUserForProfile'] : ['CurrentUserForProfile', variables],
fetcher<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>(
dataSource.endpoint,
dataSource.fetchParams || {},
CurrentUserForProfileDocument,
variables
variables,
),
options
options,
);
export const useInfiniteCurrentUserForProfileQuery = <TData = CurrentUserForProfileQuery, TError = unknown>(
export const useInfiniteCurrentUserForProfileQuery = <
TData = CurrentUserForProfileQuery,
TError = unknown,
>(
dataSource: { endpoint: string; fetchParams?: RequestInit },
pageParamKey: keyof CurrentUserForProfileQueryVariables,
variables?: CurrentUserForProfileQueryVariables,
options?: UseInfiniteQueryOptions<CurrentUserForProfileQuery, TError, TData>
options?: UseInfiniteQueryOptions<CurrentUserForProfileQuery, TError, TData>,
) =>
useInfiniteQuery<CurrentUserForProfileQuery, TError, TData>(
variables === undefined ? ['CurrentUserForProfile.infinite'] : ['CurrentUserForProfile.infinite', variables],
variables === undefined
? ['CurrentUserForProfile.infinite']
: ['CurrentUserForProfile.infinite', variables],
metaData =>
fetcher<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>(
dataSource.endpoint,
dataSource.fetchParams || {},
CurrentUserForProfileDocument,
{ ...variables, ...(metaData.pageParam ?? {}) }
{ ...variables, ...(metaData.pageParam ?? {}) },
)(),
options
options,
);

export const FeedDocument = `
@@ -534,27 +550,33 @@ export const FeedDocument = `
export const useFeedQuery = <TData = FeedQuery, TError = unknown>(
dataSource: { endpoint: string; fetchParams?: RequestInit },
variables: FeedQueryVariables,
options?: UseQueryOptions<FeedQuery, TError, TData>
options?: UseQueryOptions<FeedQuery, TError, TData>,
) =>
useQuery<FeedQuery, TError, TData>(
['Feed', variables],
fetcher<FeedQuery, FeedQueryVariables>(dataSource.endpoint, dataSource.fetchParams || {}, FeedDocument, variables),
options
fetcher<FeedQuery, FeedQueryVariables>(
dataSource.endpoint,
dataSource.fetchParams || {},
FeedDocument,
variables,
),
options,
);
export const useInfiniteFeedQuery = <TData = FeedQuery, TError = unknown>(
dataSource: { endpoint: string; fetchParams?: RequestInit },
pageParamKey: keyof FeedQueryVariables,
variables: FeedQueryVariables,
options?: UseInfiniteQueryOptions<FeedQuery, TError, TData>
options?: UseInfiniteQueryOptions<FeedQuery, TError, TData>,
) =>
useInfiniteQuery<FeedQuery, TError, TData>(
['Feed.infinite', variables],
metaData =>
fetcher<FeedQuery, FeedQueryVariables>(dataSource.endpoint, dataSource.fetchParams || {}, FeedDocument, {
...variables,
...(metaData.pageParam ?? {}),
})(),
options
fetcher<FeedQuery, FeedQueryVariables>(
dataSource.endpoint,
dataSource.fetchParams || {},
FeedDocument,
{ ...variables, ...(metaData.pageParam ?? {}) },
)(),
options,
);

export const SubmitRepositoryDocument = `
@@ -566,7 +588,12 @@ export const SubmitRepositoryDocument = `
`;
export const useSubmitRepositoryMutation = <TError = unknown, TContext = unknown>(
dataSource: { endpoint: string; fetchParams?: RequestInit },
options?: UseMutationOptions<SubmitRepositoryMutation, TError, SubmitRepositoryMutationVariables, TContext>
options?: UseMutationOptions<
SubmitRepositoryMutation,
TError,
SubmitRepositoryMutationVariables,
TContext
>,
) =>
useMutation<SubmitRepositoryMutation, TError, SubmitRepositoryMutationVariables, TContext>(
['submitRepository'],
@@ -575,9 +602,9 @@ export const useSubmitRepositoryMutation = <TError = unknown, TContext = unknown
dataSource.endpoint,
dataSource.fetchParams || {},
SubmitRepositoryDocument,
variables
variables,
)(),
options
options,
);
export const SubmitCommentDocument = `
mutation submitComment($repoFullName: String!, $commentContent: String!) {
@@ -588,7 +615,12 @@ export const SubmitCommentDocument = `
${CommentsPageCommentFragmentDoc}`;
export const useSubmitCommentMutation = <TError = unknown, TContext = unknown>(
dataSource: { endpoint: string; fetchParams?: RequestInit },
options?: UseMutationOptions<SubmitCommentMutation, TError, SubmitCommentMutationVariables, TContext>
options?: UseMutationOptions<
SubmitCommentMutation,
TError,
SubmitCommentMutationVariables,
TContext
>,
) =>
useMutation<SubmitCommentMutation, TError, SubmitCommentMutationVariables, TContext>(
['submitComment'],
@@ -597,9 +629,9 @@ export const useSubmitCommentMutation = <TError = unknown, TContext = unknown>(
dataSource.endpoint,
dataSource.fetchParams || {},
SubmitCommentDocument,
variables
variables,
)(),
options
options,
);
export const VoteDocument = `
mutation vote($repoFullName: String!, $type: VoteType!) {
@@ -614,7 +646,7 @@ export const VoteDocument = `
`;
export const useVoteMutation = <TError = unknown, TContext = unknown>(
dataSource: { endpoint: string; fetchParams?: RequestInit },
options?: UseMutationOptions<VoteMutation, TError, VoteMutationVariables, TContext>
options?: UseMutationOptions<VoteMutation, TError, VoteMutationVariables, TContext>,
) =>
useMutation<VoteMutation, TError, VoteMutationVariables, TContext>(
['vote'],
@@ -623,7 +655,7 @@ export const useVoteMutation = <TError = unknown, TContext = unknown>(
dataSource.endpoint,
dataSource.fetchParams || {},
VoteDocument,
variables
variables,
)(),
options
options,
);
99 changes: 68 additions & 31 deletions dev-test/githunt/types.reactApollo.customSuffix.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
@@ -330,7 +331,12 @@ export type VoteMutationVariables = Exact<{

export type VoteMutationMyOperation = {
__typename?: 'Mutation';
vote?: { __typename?: 'Entry'; score: number; id: number; vote: { __typename?: 'Vote'; vote_value: number } } | null;
vote?: {
__typename?: 'Entry';
score: number;
id: number;
vote: { __typename?: 'Vote'; vote_value: number };
} | null;
};

export const CommentsPageCommentFragmentDoc = gql`
@@ -417,16 +423,17 @@ export function useOnCommentAddedSubscription(
baseOptions: Apollo.SubscriptionHookOptions<
OnCommentAddedSubscriptionMyOperation,
OnCommentAddedSubscriptionVariables
>
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSubscription<OnCommentAddedSubscriptionMyOperation, OnCommentAddedSubscriptionVariables>(
OnCommentAddedDocument,
options
);
return Apollo.useSubscription<
OnCommentAddedSubscriptionMyOperation,
OnCommentAddedSubscriptionVariables
>(OnCommentAddedDocument, options);
}
export type OnCommentAddedSubscriptionHookResult = ReturnType<typeof useOnCommentAddedSubscription>;
export type OnCommentAddedSubscriptionResult = Apollo.SubscriptionResult<OnCommentAddedSubscriptionMyOperation>;
export type OnCommentAddedSubscriptionResult =
Apollo.SubscriptionResult<OnCommentAddedSubscriptionMyOperation>;
export const CommentDocument = gql`
query Comment($repoFullName: String!, $limit: Int, $offset: Int) {
currentUser {
@@ -476,15 +483,20 @@ export const CommentDocument = gql`
* },
* });
*/
export function useCommentQuery(baseOptions: Apollo.QueryHookOptions<CommentQueryMyOperation, CommentQueryVariables>) {
export function useCommentQuery(
baseOptions: Apollo.QueryHookOptions<CommentQueryMyOperation, CommentQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<CommentQueryMyOperation, CommentQueryVariables>(CommentDocument, options);
}
export function useCommentLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<CommentQueryMyOperation, CommentQueryVariables>
baseOptions?: Apollo.LazyQueryHookOptions<CommentQueryMyOperation, CommentQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<CommentQueryMyOperation, CommentQueryVariables>(CommentDocument, options);
return Apollo.useLazyQuery<CommentQueryMyOperation, CommentQueryVariables>(
CommentDocument,
options,
);
}
export type CommentQueryHookResult = ReturnType<typeof useCommentQuery>;
export type CommentLazyQueryHookResult = ReturnType<typeof useCommentLazyQuery>;
@@ -514,25 +526,33 @@ export const CurrentUserForProfileDocument = gql`
* });
*/
export function useCurrentUserForProfileQuery(
baseOptions?: Apollo.QueryHookOptions<CurrentUserForProfileQueryMyOperation, CurrentUserForProfileQueryVariables>
baseOptions?: Apollo.QueryHookOptions<
CurrentUserForProfileQueryMyOperation,
CurrentUserForProfileQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<CurrentUserForProfileQueryMyOperation, CurrentUserForProfileQueryVariables>(
CurrentUserForProfileDocument,
options
);
return Apollo.useQuery<
CurrentUserForProfileQueryMyOperation,
CurrentUserForProfileQueryVariables
>(CurrentUserForProfileDocument, options);
}
export function useCurrentUserForProfileLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<CurrentUserForProfileQueryMyOperation, CurrentUserForProfileQueryVariables>
baseOptions?: Apollo.LazyQueryHookOptions<
CurrentUserForProfileQueryMyOperation,
CurrentUserForProfileQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<CurrentUserForProfileQueryMyOperation, CurrentUserForProfileQueryVariables>(
CurrentUserForProfileDocument,
options
);
return Apollo.useLazyQuery<
CurrentUserForProfileQueryMyOperation,
CurrentUserForProfileQueryVariables
>(CurrentUserForProfileDocument, options);
}
export type CurrentUserForProfileQueryHookResult = ReturnType<typeof useCurrentUserForProfileQuery>;
export type CurrentUserForProfileLazyQueryHookResult = ReturnType<typeof useCurrentUserForProfileLazyQuery>;
export type CurrentUserForProfileLazyQueryHookResult = ReturnType<
typeof useCurrentUserForProfileLazyQuery
>;
export type CurrentUserForProfileQueryResult = Apollo.QueryResult<
CurrentUserForProfileQueryMyOperation,
CurrentUserForProfileQueryVariables
@@ -567,11 +587,15 @@ export const FeedDocument = gql`
* },
* });
*/
export function useFeedQuery(baseOptions: Apollo.QueryHookOptions<FeedQueryMyOperation, FeedQueryVariables>) {
export function useFeedQuery(
baseOptions: Apollo.QueryHookOptions<FeedQueryMyOperation, FeedQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<FeedQueryMyOperation, FeedQueryVariables>(FeedDocument, options);
}
export function useFeedLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FeedQueryMyOperation, FeedQueryVariables>) {
export function useFeedLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<FeedQueryMyOperation, FeedQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<FeedQueryMyOperation, FeedQueryVariables>(FeedDocument, options);
}
@@ -608,16 +632,20 @@ export type SubmitRepositoryMutationFn = Apollo.MutationFunction<
* });
*/
export function useSubmitRepositoryMutation(
baseOptions?: Apollo.MutationHookOptions<SubmitRepositoryMutationMyOperation, SubmitRepositoryMutationVariables>
baseOptions?: Apollo.MutationHookOptions<
SubmitRepositoryMutationMyOperation,
SubmitRepositoryMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<SubmitRepositoryMutationMyOperation, SubmitRepositoryMutationVariables>(
SubmitRepositoryDocument,
options
options,
);
}
export type SubmitRepositoryMutationHookResult = ReturnType<typeof useSubmitRepositoryMutation>;
export type SubmitRepositoryMutationResult = Apollo.MutationResult<SubmitRepositoryMutationMyOperation>;
export type SubmitRepositoryMutationResult =
Apollo.MutationResult<SubmitRepositoryMutationMyOperation>;
export type SubmitRepositoryMutationOptions = Apollo.BaseMutationOptions<
SubmitRepositoryMutationMyOperation,
SubmitRepositoryMutationVariables
@@ -654,12 +682,15 @@ export type SubmitCommentMutationFn = Apollo.MutationFunction<
* });
*/
export function useSubmitCommentMutation(
baseOptions?: Apollo.MutationHookOptions<SubmitCommentMutationMyOperation, SubmitCommentMutationVariables>
baseOptions?: Apollo.MutationHookOptions<
SubmitCommentMutationMyOperation,
SubmitCommentMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<SubmitCommentMutationMyOperation, SubmitCommentMutationVariables>(
SubmitCommentDocument,
options
options,
);
}
export type SubmitCommentMutationHookResult = ReturnType<typeof useSubmitCommentMutation>;
@@ -679,7 +710,10 @@ export const VoteDocument = gql`
}
}
`;
export type VoteMutationFn = Apollo.MutationFunction<VoteMutationMyOperation, VoteMutationVariables>;
export type VoteMutationFn = Apollo.MutationFunction<
VoteMutationMyOperation,
VoteMutationVariables
>;

/**
* __useVoteMutation__
@@ -700,11 +734,14 @@ export type VoteMutationFn = Apollo.MutationFunction<VoteMutationMyOperation, Vo
* });
*/
export function useVoteMutation(
baseOptions?: Apollo.MutationHookOptions<VoteMutationMyOperation, VoteMutationVariables>
baseOptions?: Apollo.MutationHookOptions<VoteMutationMyOperation, VoteMutationVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<VoteMutationMyOperation, VoteMutationVariables>(VoteDocument, options);
}
export type VoteMutationHookResult = ReturnType<typeof useVoteMutation>;
export type VoteMutationResult = Apollo.MutationResult<VoteMutationMyOperation>;
export type VoteMutationOptions = Apollo.BaseMutationOptions<VoteMutationMyOperation, VoteMutationVariables>;
export type VoteMutationOptions = Apollo.BaseMutationOptions<
VoteMutationMyOperation,
VoteMutationVariables
>;
71 changes: 53 additions & 18 deletions dev-test/githunt/types.reactApollo.hooks.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
@@ -330,7 +331,12 @@ export type VoteMutationVariables = Exact<{

export type VoteMutation = {
__typename?: 'Mutation';
vote?: { __typename?: 'Entry'; score: number; id: number; vote: { __typename?: 'Vote'; vote_value: number } } | null;
vote?: {
__typename?: 'Entry';
score: number;
id: number;
vote: { __typename?: 'Vote'; vote_value: number };
} | null;
};

export const CommentsPageCommentFragmentDoc = gql`
@@ -414,16 +420,20 @@ export const OnCommentAddedDocument = gql`
* });
*/
export function useOnCommentAddedSubscription(
baseOptions: Apollo.SubscriptionHookOptions<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>
baseOptions: Apollo.SubscriptionHookOptions<
OnCommentAddedSubscription,
OnCommentAddedSubscriptionVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSubscription<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>(
OnCommentAddedDocument,
options
options,
);
}
export type OnCommentAddedSubscriptionHookResult = ReturnType<typeof useOnCommentAddedSubscription>;
export type OnCommentAddedSubscriptionResult = Apollo.SubscriptionResult<OnCommentAddedSubscription>;
export type OnCommentAddedSubscriptionResult =
Apollo.SubscriptionResult<OnCommentAddedSubscription>;
export const CommentDocument = gql`
query Comment($repoFullName: String!, $limit: Int, $offset: Int) {
currentUser {
@@ -473,11 +483,15 @@ export const CommentDocument = gql`
* },
* });
*/
export function useCommentQuery(baseOptions: Apollo.QueryHookOptions<CommentQuery, CommentQueryVariables>) {
export function useCommentQuery(
baseOptions: Apollo.QueryHookOptions<CommentQuery, CommentQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<CommentQuery, CommentQueryVariables>(CommentDocument, options);
}
export function useCommentLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CommentQuery, CommentQueryVariables>) {
export function useCommentLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<CommentQuery, CommentQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<CommentQuery, CommentQueryVariables>(CommentDocument, options);
}
@@ -509,25 +523,33 @@ export const CurrentUserForProfileDocument = gql`
* });
*/
export function useCurrentUserForProfileQuery(
baseOptions?: Apollo.QueryHookOptions<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>
baseOptions?: Apollo.QueryHookOptions<
CurrentUserForProfileQuery,
CurrentUserForProfileQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>(
CurrentUserForProfileDocument,
options
options,
);
}
export function useCurrentUserForProfileLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>
baseOptions?: Apollo.LazyQueryHookOptions<
CurrentUserForProfileQuery,
CurrentUserForProfileQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>(
CurrentUserForProfileDocument,
options
options,
);
}
export type CurrentUserForProfileQueryHookResult = ReturnType<typeof useCurrentUserForProfileQuery>;
export type CurrentUserForProfileLazyQueryHookResult = ReturnType<typeof useCurrentUserForProfileLazyQuery>;
export type CurrentUserForProfileLazyQueryHookResult = ReturnType<
typeof useCurrentUserForProfileLazyQuery
>;
export type CurrentUserForProfileQueryResult = Apollo.QueryResult<
CurrentUserForProfileQuery,
CurrentUserForProfileQueryVariables
@@ -566,7 +588,9 @@ export function useFeedQuery(baseOptions: Apollo.QueryHookOptions<FeedQuery, Fee
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<FeedQuery, FeedQueryVariables>(FeedDocument, options);
}
export function useFeedLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FeedQuery, FeedQueryVariables>) {
export function useFeedLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<FeedQuery, FeedQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<FeedQuery, FeedQueryVariables>(FeedDocument, options);
}
@@ -603,12 +627,15 @@ export type SubmitRepositoryMutationFn = Apollo.MutationFunction<
* });
*/
export function useSubmitRepositoryMutation(
baseOptions?: Apollo.MutationHookOptions<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>
baseOptions?: Apollo.MutationHookOptions<
SubmitRepositoryMutation,
SubmitRepositoryMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>(
SubmitRepositoryDocument,
options
options,
);
}
export type SubmitRepositoryMutationHookResult = ReturnType<typeof useSubmitRepositoryMutation>;
@@ -625,7 +652,10 @@ export const SubmitCommentDocument = gql`
}
${CommentsPageCommentFragmentDoc}
`;
export type SubmitCommentMutationFn = Apollo.MutationFunction<SubmitCommentMutation, SubmitCommentMutationVariables>;
export type SubmitCommentMutationFn = Apollo.MutationFunction<
SubmitCommentMutation,
SubmitCommentMutationVariables
>;

/**
* __useSubmitCommentMutation__
@@ -646,10 +676,13 @@ export type SubmitCommentMutationFn = Apollo.MutationFunction<SubmitCommentMutat
* });
*/
export function useSubmitCommentMutation(
baseOptions?: Apollo.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>
baseOptions?: Apollo.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(SubmitCommentDocument, options);
return Apollo.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(
SubmitCommentDocument,
options,
);
}
export type SubmitCommentMutationHookResult = ReturnType<typeof useSubmitCommentMutation>;
export type SubmitCommentMutationResult = Apollo.MutationResult<SubmitCommentMutation>;
@@ -688,7 +721,9 @@ export type VoteMutationFn = Apollo.MutationFunction<VoteMutation, VoteMutationV
* },
* });
*/
export function useVoteMutation(baseOptions?: Apollo.MutationHookOptions<VoteMutation, VoteMutationVariables>) {
export function useVoteMutation(
baseOptions?: Apollo.MutationHookOptions<VoteMutation, VoteMutationVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument, options);
}
71 changes: 53 additions & 18 deletions dev-test/githunt/types.reactApollo.preResolveTypes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
@@ -330,7 +331,12 @@ export type VoteMutationVariables = Exact<{

export type VoteMutation = {
__typename?: 'Mutation';
vote?: { __typename?: 'Entry'; score: number; id: number; vote: { __typename?: 'Vote'; vote_value: number } } | null;
vote?: {
__typename?: 'Entry';
score: number;
id: number;
vote: { __typename?: 'Vote'; vote_value: number };
} | null;
};

export const CommentsPageCommentFragmentDoc = gql`
@@ -414,16 +420,20 @@ export const OnCommentAddedDocument = gql`
* });
*/
export function useOnCommentAddedSubscription(
baseOptions: Apollo.SubscriptionHookOptions<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>
baseOptions: Apollo.SubscriptionHookOptions<
OnCommentAddedSubscription,
OnCommentAddedSubscriptionVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSubscription<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>(
OnCommentAddedDocument,
options
options,
);
}
export type OnCommentAddedSubscriptionHookResult = ReturnType<typeof useOnCommentAddedSubscription>;
export type OnCommentAddedSubscriptionResult = Apollo.SubscriptionResult<OnCommentAddedSubscription>;
export type OnCommentAddedSubscriptionResult =
Apollo.SubscriptionResult<OnCommentAddedSubscription>;
export const CommentDocument = gql`
query Comment($repoFullName: String!, $limit: Int, $offset: Int) {
currentUser {
@@ -473,11 +483,15 @@ export const CommentDocument = gql`
* },
* });
*/
export function useCommentQuery(baseOptions: Apollo.QueryHookOptions<CommentQuery, CommentQueryVariables>) {
export function useCommentQuery(
baseOptions: Apollo.QueryHookOptions<CommentQuery, CommentQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<CommentQuery, CommentQueryVariables>(CommentDocument, options);
}
export function useCommentLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CommentQuery, CommentQueryVariables>) {
export function useCommentLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<CommentQuery, CommentQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<CommentQuery, CommentQueryVariables>(CommentDocument, options);
}
@@ -509,25 +523,33 @@ export const CurrentUserForProfileDocument = gql`
* });
*/
export function useCurrentUserForProfileQuery(
baseOptions?: Apollo.QueryHookOptions<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>
baseOptions?: Apollo.QueryHookOptions<
CurrentUserForProfileQuery,
CurrentUserForProfileQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>(
CurrentUserForProfileDocument,
options
options,
);
}
export function useCurrentUserForProfileLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>
baseOptions?: Apollo.LazyQueryHookOptions<
CurrentUserForProfileQuery,
CurrentUserForProfileQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>(
CurrentUserForProfileDocument,
options
options,
);
}
export type CurrentUserForProfileQueryHookResult = ReturnType<typeof useCurrentUserForProfileQuery>;
export type CurrentUserForProfileLazyQueryHookResult = ReturnType<typeof useCurrentUserForProfileLazyQuery>;
export type CurrentUserForProfileLazyQueryHookResult = ReturnType<
typeof useCurrentUserForProfileLazyQuery
>;
export type CurrentUserForProfileQueryResult = Apollo.QueryResult<
CurrentUserForProfileQuery,
CurrentUserForProfileQueryVariables
@@ -566,7 +588,9 @@ export function useFeedQuery(baseOptions: Apollo.QueryHookOptions<FeedQuery, Fee
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<FeedQuery, FeedQueryVariables>(FeedDocument, options);
}
export function useFeedLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FeedQuery, FeedQueryVariables>) {
export function useFeedLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<FeedQuery, FeedQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<FeedQuery, FeedQueryVariables>(FeedDocument, options);
}
@@ -603,12 +627,15 @@ export type SubmitRepositoryMutationFn = Apollo.MutationFunction<
* });
*/
export function useSubmitRepositoryMutation(
baseOptions?: Apollo.MutationHookOptions<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>
baseOptions?: Apollo.MutationHookOptions<
SubmitRepositoryMutation,
SubmitRepositoryMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>(
SubmitRepositoryDocument,
options
options,
);
}
export type SubmitRepositoryMutationHookResult = ReturnType<typeof useSubmitRepositoryMutation>;
@@ -625,7 +652,10 @@ export const SubmitCommentDocument = gql`
}
${CommentsPageCommentFragmentDoc}
`;
export type SubmitCommentMutationFn = Apollo.MutationFunction<SubmitCommentMutation, SubmitCommentMutationVariables>;
export type SubmitCommentMutationFn = Apollo.MutationFunction<
SubmitCommentMutation,
SubmitCommentMutationVariables
>;

/**
* __useSubmitCommentMutation__
@@ -646,10 +676,13 @@ export type SubmitCommentMutationFn = Apollo.MutationFunction<SubmitCommentMutat
* });
*/
export function useSubmitCommentMutation(
baseOptions?: Apollo.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>
baseOptions?: Apollo.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(SubmitCommentDocument, options);
return Apollo.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(
SubmitCommentDocument,
options,
);
}
export type SubmitCommentMutationHookResult = ReturnType<typeof useSubmitCommentMutation>;
export type SubmitCommentMutationResult = Apollo.MutationResult<SubmitCommentMutation>;
@@ -688,7 +721,9 @@ export type VoteMutationFn = Apollo.MutationFunction<VoteMutation, VoteMutationV
* },
* });
*/
export function useVoteMutation(baseOptions?: Apollo.MutationHookOptions<VoteMutation, VoteMutationVariables>) {
export function useVoteMutation(
baseOptions?: Apollo.MutationHookOptions<VoteMutation, VoteMutationVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument, options);
}
71 changes: 53 additions & 18 deletions dev-test/githunt/types.reactApollo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
@@ -330,7 +331,12 @@ export type VoteMutationVariables = Exact<{

export type VoteMutation = {
__typename?: 'Mutation';
vote?: { __typename?: 'Entry'; score: number; id: number; vote: { __typename?: 'Vote'; vote_value: number } } | null;
vote?: {
__typename?: 'Entry';
score: number;
id: number;
vote: { __typename?: 'Vote'; vote_value: number };
} | null;
};

export const CommentsPageCommentFragmentDoc = gql`
@@ -414,16 +420,20 @@ export const OnCommentAddedDocument = gql`
* });
*/
export function useOnCommentAddedSubscription(
baseOptions: Apollo.SubscriptionHookOptions<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>
baseOptions: Apollo.SubscriptionHookOptions<
OnCommentAddedSubscription,
OnCommentAddedSubscriptionVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSubscription<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>(
OnCommentAddedDocument,
options
options,
);
}
export type OnCommentAddedSubscriptionHookResult = ReturnType<typeof useOnCommentAddedSubscription>;
export type OnCommentAddedSubscriptionResult = Apollo.SubscriptionResult<OnCommentAddedSubscription>;
export type OnCommentAddedSubscriptionResult =
Apollo.SubscriptionResult<OnCommentAddedSubscription>;
export const CommentDocument = gql`
query Comment($repoFullName: String!, $limit: Int, $offset: Int) {
currentUser {
@@ -473,11 +483,15 @@ export const CommentDocument = gql`
* },
* });
*/
export function useCommentQuery(baseOptions: Apollo.QueryHookOptions<CommentQuery, CommentQueryVariables>) {
export function useCommentQuery(
baseOptions: Apollo.QueryHookOptions<CommentQuery, CommentQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<CommentQuery, CommentQueryVariables>(CommentDocument, options);
}
export function useCommentLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CommentQuery, CommentQueryVariables>) {
export function useCommentLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<CommentQuery, CommentQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<CommentQuery, CommentQueryVariables>(CommentDocument, options);
}
@@ -509,25 +523,33 @@ export const CurrentUserForProfileDocument = gql`
* });
*/
export function useCurrentUserForProfileQuery(
baseOptions?: Apollo.QueryHookOptions<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>
baseOptions?: Apollo.QueryHookOptions<
CurrentUserForProfileQuery,
CurrentUserForProfileQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>(
CurrentUserForProfileDocument,
options
options,
);
}
export function useCurrentUserForProfileLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>
baseOptions?: Apollo.LazyQueryHookOptions<
CurrentUserForProfileQuery,
CurrentUserForProfileQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>(
CurrentUserForProfileDocument,
options
options,
);
}
export type CurrentUserForProfileQueryHookResult = ReturnType<typeof useCurrentUserForProfileQuery>;
export type CurrentUserForProfileLazyQueryHookResult = ReturnType<typeof useCurrentUserForProfileLazyQuery>;
export type CurrentUserForProfileLazyQueryHookResult = ReturnType<
typeof useCurrentUserForProfileLazyQuery
>;
export type CurrentUserForProfileQueryResult = Apollo.QueryResult<
CurrentUserForProfileQuery,
CurrentUserForProfileQueryVariables
@@ -566,7 +588,9 @@ export function useFeedQuery(baseOptions: Apollo.QueryHookOptions<FeedQuery, Fee
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<FeedQuery, FeedQueryVariables>(FeedDocument, options);
}
export function useFeedLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FeedQuery, FeedQueryVariables>) {
export function useFeedLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<FeedQuery, FeedQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<FeedQuery, FeedQueryVariables>(FeedDocument, options);
}
@@ -603,12 +627,15 @@ export type SubmitRepositoryMutationFn = Apollo.MutationFunction<
* });
*/
export function useSubmitRepositoryMutation(
baseOptions?: Apollo.MutationHookOptions<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>
baseOptions?: Apollo.MutationHookOptions<
SubmitRepositoryMutation,
SubmitRepositoryMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>(
SubmitRepositoryDocument,
options
options,
);
}
export type SubmitRepositoryMutationHookResult = ReturnType<typeof useSubmitRepositoryMutation>;
@@ -625,7 +652,10 @@ export const SubmitCommentDocument = gql`
}
${CommentsPageCommentFragmentDoc}
`;
export type SubmitCommentMutationFn = Apollo.MutationFunction<SubmitCommentMutation, SubmitCommentMutationVariables>;
export type SubmitCommentMutationFn = Apollo.MutationFunction<
SubmitCommentMutation,
SubmitCommentMutationVariables
>;

/**
* __useSubmitCommentMutation__
@@ -646,10 +676,13 @@ export type SubmitCommentMutationFn = Apollo.MutationFunction<SubmitCommentMutat
* });
*/
export function useSubmitCommentMutation(
baseOptions?: Apollo.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>
baseOptions?: Apollo.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(SubmitCommentDocument, options);
return Apollo.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(
SubmitCommentDocument,
options,
);
}
export type SubmitCommentMutationHookResult = ReturnType<typeof useSubmitCommentMutation>;
export type SubmitCommentMutationResult = Apollo.MutationResult<SubmitCommentMutation>;
@@ -688,7 +721,9 @@ export type VoteMutationFn = Apollo.MutationFunction<VoteMutation, VoteMutationV
* },
* });
*/
export function useVoteMutation(baseOptions?: Apollo.MutationHookOptions<VoteMutation, VoteMutationVariables>) {
export function useVoteMutation(
baseOptions?: Apollo.MutationHookOptions<VoteMutation, VoteMutationVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument, options);
}
96 changes: 68 additions & 28 deletions dev-test/githunt/types.reactApollo.v2.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import gql from 'graphql-tag';
import * as ApolloReactCommon from '@apollo/react-common';
import * as ApolloReactHooks from '@apollo/react-hooks';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
@@ -331,7 +332,12 @@ export type VoteMutationVariables = Exact<{

export type VoteMutation = {
__typename?: 'Mutation';
vote?: { __typename?: 'Entry'; score: number; id: number; vote: { __typename?: 'Vote'; vote_value: number } } | null;
vote?: {
__typename?: 'Entry';
score: number;
id: number;
vote: { __typename?: 'Vote'; vote_value: number };
} | null;
};

export const CommentsPageCommentFragmentDoc = gql`
@@ -415,16 +421,20 @@ export const OnCommentAddedDocument = gql`
* });
*/
export function useOnCommentAddedSubscription(
baseOptions: ApolloReactHooks.SubscriptionHookOptions<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>
baseOptions: ApolloReactHooks.SubscriptionHookOptions<
OnCommentAddedSubscription,
OnCommentAddedSubscriptionVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return ApolloReactHooks.useSubscription<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>(
OnCommentAddedDocument,
options
);
return ApolloReactHooks.useSubscription<
OnCommentAddedSubscription,
OnCommentAddedSubscriptionVariables
>(OnCommentAddedDocument, options);
}
export type OnCommentAddedSubscriptionHookResult = ReturnType<typeof useOnCommentAddedSubscription>;
export type OnCommentAddedSubscriptionResult = ApolloReactCommon.SubscriptionResult<OnCommentAddedSubscription>;
export type OnCommentAddedSubscriptionResult =
ApolloReactCommon.SubscriptionResult<OnCommentAddedSubscription>;
export const CommentDocument = gql`
query Comment($repoFullName: String!, $limit: Int, $offset: Int) {
currentUser {
@@ -474,15 +484,20 @@ export const CommentDocument = gql`
* },
* });
*/
export function useCommentQuery(baseOptions: ApolloReactHooks.QueryHookOptions<CommentQuery, CommentQueryVariables>) {
export function useCommentQuery(
baseOptions: ApolloReactHooks.QueryHookOptions<CommentQuery, CommentQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return ApolloReactHooks.useQuery<CommentQuery, CommentQueryVariables>(CommentDocument, options);
}
export function useCommentLazyQuery(
baseOptions?: ApolloReactHooks.LazyQueryHookOptions<CommentQuery, CommentQueryVariables>
baseOptions?: ApolloReactHooks.LazyQueryHookOptions<CommentQuery, CommentQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return ApolloReactHooks.useLazyQuery<CommentQuery, CommentQueryVariables>(CommentDocument, options);
return ApolloReactHooks.useLazyQuery<CommentQuery, CommentQueryVariables>(
CommentDocument,
options,
);
}
export type CommentQueryHookResult = ReturnType<typeof useCommentQuery>;
export type CommentLazyQueryHookResult = ReturnType<typeof useCommentLazyQuery>;
@@ -512,25 +527,33 @@ export const CurrentUserForProfileDocument = gql`
* });
*/
export function useCurrentUserForProfileQuery(
baseOptions?: ApolloReactHooks.QueryHookOptions<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>
baseOptions?: ApolloReactHooks.QueryHookOptions<
CurrentUserForProfileQuery,
CurrentUserForProfileQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return ApolloReactHooks.useQuery<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>(
CurrentUserForProfileDocument,
options
options,
);
}
export function useCurrentUserForProfileLazyQuery(
baseOptions?: ApolloReactHooks.LazyQueryHookOptions<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>
baseOptions?: ApolloReactHooks.LazyQueryHookOptions<
CurrentUserForProfileQuery,
CurrentUserForProfileQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return ApolloReactHooks.useLazyQuery<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>(
CurrentUserForProfileDocument,
options
);
return ApolloReactHooks.useLazyQuery<
CurrentUserForProfileQuery,
CurrentUserForProfileQueryVariables
>(CurrentUserForProfileDocument, options);
}
export type CurrentUserForProfileQueryHookResult = ReturnType<typeof useCurrentUserForProfileQuery>;
export type CurrentUserForProfileLazyQueryHookResult = ReturnType<typeof useCurrentUserForProfileLazyQuery>;
export type CurrentUserForProfileLazyQueryHookResult = ReturnType<
typeof useCurrentUserForProfileLazyQuery
>;
export type CurrentUserForProfileQueryResult = ApolloReactCommon.QueryResult<
CurrentUserForProfileQuery,
CurrentUserForProfileQueryVariables
@@ -565,11 +588,15 @@ export const FeedDocument = gql`
* },
* });
*/
export function useFeedQuery(baseOptions: ApolloReactHooks.QueryHookOptions<FeedQuery, FeedQueryVariables>) {
export function useFeedQuery(
baseOptions: ApolloReactHooks.QueryHookOptions<FeedQuery, FeedQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return ApolloReactHooks.useQuery<FeedQuery, FeedQueryVariables>(FeedDocument, options);
}
export function useFeedLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<FeedQuery, FeedQueryVariables>) {
export function useFeedLazyQuery(
baseOptions?: ApolloReactHooks.LazyQueryHookOptions<FeedQuery, FeedQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return ApolloReactHooks.useLazyQuery<FeedQuery, FeedQueryVariables>(FeedDocument, options);
}
@@ -606,16 +633,20 @@ export type SubmitRepositoryMutationFn = ApolloReactCommon.MutationFunction<
* });
*/
export function useSubmitRepositoryMutation(
baseOptions?: ApolloReactHooks.MutationHookOptions<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>
baseOptions?: ApolloReactHooks.MutationHookOptions<
SubmitRepositoryMutation,
SubmitRepositoryMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return ApolloReactHooks.useMutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>(
SubmitRepositoryDocument,
options
options,
);
}
export type SubmitRepositoryMutationHookResult = ReturnType<typeof useSubmitRepositoryMutation>;
export type SubmitRepositoryMutationResult = ApolloReactCommon.MutationResult<SubmitRepositoryMutation>;
export type SubmitRepositoryMutationResult =
ApolloReactCommon.MutationResult<SubmitRepositoryMutation>;
export type SubmitRepositoryMutationOptions = ApolloReactCommon.BaseMutationOptions<
SubmitRepositoryMutation,
SubmitRepositoryMutationVariables
@@ -652,12 +683,15 @@ export type SubmitCommentMutationFn = ApolloReactCommon.MutationFunction<
* });
*/
export function useSubmitCommentMutation(
baseOptions?: ApolloReactHooks.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>
baseOptions?: ApolloReactHooks.MutationHookOptions<
SubmitCommentMutation,
SubmitCommentMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return ApolloReactHooks.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(
SubmitCommentDocument,
options
options,
);
}
export type SubmitCommentMutationHookResult = ReturnType<typeof useSubmitCommentMutation>;
@@ -677,7 +711,10 @@ export const VoteDocument = gql`
}
}
`;
export type VoteMutationFn = ApolloReactCommon.MutationFunction<VoteMutation, VoteMutationVariables>;
export type VoteMutationFn = ApolloReactCommon.MutationFunction<
VoteMutation,
VoteMutationVariables
>;

/**
* __useVoteMutation__
@@ -698,11 +735,14 @@ export type VoteMutationFn = ApolloReactCommon.MutationFunction<VoteMutation, Vo
* });
*/
export function useVoteMutation(
baseOptions?: ApolloReactHooks.MutationHookOptions<VoteMutation, VoteMutationVariables>
baseOptions?: ApolloReactHooks.MutationHookOptions<VoteMutation, VoteMutationVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return ApolloReactHooks.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument, options);
}
export type VoteMutationHookResult = ReturnType<typeof useVoteMutation>;
export type VoteMutationResult = ApolloReactCommon.MutationResult<VoteMutation>;
export type VoteMutationOptions = ApolloReactCommon.BaseMutationOptions<VoteMutation, VoteMutationVariables>;
export type VoteMutationOptions = ApolloReactCommon.BaseMutationOptions<
VoteMutation,
VoteMutationVariables
>;
13 changes: 11 additions & 2 deletions dev-test/githunt/types.rtk-query.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { api } from '../../packages/plugins/typescript/rtk-query/tests/baseApi';

module.hot?.accept();
export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
@@ -329,7 +330,12 @@ export type VoteMutationVariables = Exact<{

export type VoteMutation = {
__typename?: 'Mutation';
vote?: { __typename?: 'Entry'; score: number; id: number; vote: { __typename?: 'Vote'; vote_value: number } } | null;
vote?: {
__typename?: 'Entry';
score: number;
id: number;
vote: { __typename?: 'Vote'; vote_value: number };
} | null;
};

export const CommentsPageCommentFragmentDoc = `
@@ -473,7 +479,10 @@ const injectedRtkApi = api.injectEndpoints({
Comment: build.query<CommentQuery, CommentQueryVariables>({
query: variables => ({ document: CommentDocument, variables }),
}),
CurrentUserForProfile: build.query<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables | void>({
CurrentUserForProfile: build.query<
CurrentUserForProfileQuery,
CurrentUserForProfileQueryVariables | void
>({
query: variables => ({ document: CurrentUserForProfileDocument, variables }),
}),
Feed: build.query<FeedQuery, FeedQueryVariables>({
50 changes: 38 additions & 12 deletions dev-test/githunt/types.stencilApollo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import gql from 'graphql-tag';
import * as StencilApollo from 'stencil-apollo';
import { h } from '@stencil/core';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
@@ -330,7 +331,12 @@ export type VoteMutationVariables = Exact<{

export type VoteMutation = {
__typename?: 'Mutation';
vote?: { __typename?: 'Entry'; score: number; id: number; vote: { __typename?: 'Vote'; vote_value: number } } | null;
vote?: {
__typename?: 'Entry';
score: number;
id: number;
vote: { __typename?: 'Vote'; vote_value: number };
} | null;
};

export const CommentsPageCommentFragmentDoc = gql`
@@ -399,13 +405,23 @@ export const OnCommentAddedDocument = gql`

export type OnCommentAddedProps = {
variables?: OnCommentAddedSubscriptionVariables;
inlist?: StencilApollo.SubscriptionRenderer<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>;
inlist?: StencilApollo.SubscriptionRenderer<
OnCommentAddedSubscription,
OnCommentAddedSubscriptionVariables
>;
};

export const OnCommentAddedComponent = (
props: OnCommentAddedProps,
children: [StencilApollo.SubscriptionRenderer<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>]
) => <apollo-subscription subscription={OnCommentAddedDocument} {...props} renderer={children[0]} />;
children: [
StencilApollo.SubscriptionRenderer<
OnCommentAddedSubscription,
OnCommentAddedSubscriptionVariables
>,
],
) => (
<apollo-subscription subscription={OnCommentAddedDocument} {...props} renderer={children[0]} />
);

export const CommentDocument = gql`
query Comment($repoFullName: String!, $limit: Int, $offset: Int) {
@@ -445,7 +461,7 @@ export type CommentProps = {

export const CommentComponent = (
props: CommentProps,
children: [StencilApollo.QueryRenderer<CommentQuery, CommentQueryVariables>]
children: [StencilApollo.QueryRenderer<CommentQuery, CommentQueryVariables>],
) => <apollo-query query={CommentDocument} {...props} renderer={children[0]} />;

export const CurrentUserForProfileDocument = gql`
@@ -459,12 +475,17 @@ export const CurrentUserForProfileDocument = gql`

export type CurrentUserForProfileProps = {
variables?: CurrentUserForProfileQueryVariables;
inlist?: StencilApollo.QueryRenderer<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>;
inlist?: StencilApollo.QueryRenderer<
CurrentUserForProfileQuery,
CurrentUserForProfileQueryVariables
>;
};

export const CurrentUserForProfileComponent = (
props: CurrentUserForProfileProps,
children: [StencilApollo.QueryRenderer<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>]
children: [
StencilApollo.QueryRenderer<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>,
],
) => <apollo-query query={CurrentUserForProfileDocument} {...props} renderer={children[0]} />;

export const FeedDocument = gql`
@@ -486,7 +507,7 @@ export type FeedProps = {

export const FeedComponent = (
props: FeedProps,
children: [StencilApollo.QueryRenderer<FeedQuery, FeedQueryVariables>]
children: [StencilApollo.QueryRenderer<FeedQuery, FeedQueryVariables>],
) => <apollo-query query={FeedDocument} {...props} renderer={children[0]} />;

export const SubmitRepositoryDocument = gql`
@@ -499,12 +520,17 @@ export const SubmitRepositoryDocument = gql`

export type SubmitRepositoryProps = {
variables?: SubmitRepositoryMutationVariables;
inlist?: StencilApollo.MutationRenderer<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>;
inlist?: StencilApollo.MutationRenderer<
SubmitRepositoryMutation,
SubmitRepositoryMutationVariables
>;
};

export const SubmitRepositoryComponent = (
props: SubmitRepositoryProps,
children: [StencilApollo.MutationRenderer<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>]
children: [
StencilApollo.MutationRenderer<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>,
],
) => <apollo-mutation mutation={SubmitRepositoryDocument} {...props} renderer={children[0]} />;

export const SubmitCommentDocument = gql`
@@ -523,7 +549,7 @@ export type SubmitCommentProps = {

export const SubmitCommentComponent = (
props: SubmitCommentProps,
children: [StencilApollo.MutationRenderer<SubmitCommentMutation, SubmitCommentMutationVariables>]
children: [StencilApollo.MutationRenderer<SubmitCommentMutation, SubmitCommentMutationVariables>],
) => <apollo-mutation mutation={SubmitCommentDocument} {...props} renderer={children[0]} />;

export const VoteDocument = gql`
@@ -545,5 +571,5 @@ export type VoteProps = {

export const VoteComponent = (
props: VoteProps,
children: [StencilApollo.MutationRenderer<VoteMutation, VoteMutationVariables>]
children: [StencilApollo.MutationRenderer<VoteMutation, VoteMutationVariables>],
) => <apollo-mutation mutation={VoteDocument} {...props} renderer={children[0]} />;
254 changes: 208 additions & 46 deletions dev-test/githunt/types.urql.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { IntrospectionQuery } from 'graphql';
import gql from 'graphql-tag';
import * as Urql from 'urql';
import { offlineExchange } from '@urql/exchange-graphcache';
import {
OptimisticMutationResolver as GraphCacheOptimisticMutationResolver,
Resolver as GraphCacheResolver,
UpdateResolver as GraphCacheUpdateResolver,
OptimisticMutationResolver as GraphCacheOptimisticMutationResolver,
StorageAdapter as GraphCacheStorageAdapter,
} from '@urql/exchange-graphcache';
import { IntrospectionData } from '@urql/exchange-graphcache/dist/types/ast';
import gql from 'graphql-tag';
import * as Urql from 'urql';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
@@ -337,7 +338,12 @@ export type VoteMutationVariables = Exact<{

export type VoteMutation = {
__typename?: 'Mutation';
vote?: { __typename?: 'Entry'; score: number; id: number; vote: { __typename?: 'Vote'; vote_value: number } } | null;
vote?: {
__typename?: 'Entry';
score: number;
id: number;
vote: { __typename?: 'Vote'; vote_value: number };
} | null;
};

export const CommentsPageCommentFragmentDoc = gql`
@@ -405,13 +411,14 @@ export const OnCommentAddedDocument = gql`
`;

export function useOnCommentAddedSubscription<TData = OnCommentAddedSubscription>(
options: Omit<Urql.UseSubscriptionArgs<OnCommentAddedSubscriptionVariables>, 'query'> = {},
handler?: Urql.SubscriptionHandler<OnCommentAddedSubscription, TData>
options: Omit<Urql.UseSubscriptionArgs<OnCommentAddedSubscriptionVariables>, 'query'>,
handler?: Urql.SubscriptionHandler<OnCommentAddedSubscription, TData>,
) {
return Urql.useSubscription<OnCommentAddedSubscription, TData, OnCommentAddedSubscriptionVariables>(
{ query: OnCommentAddedDocument, ...options },
handler
);
return Urql.useSubscription<
OnCommentAddedSubscription,
TData,
OnCommentAddedSubscriptionVariables
>({ query: OnCommentAddedDocument, ...options }, handler);
}
export const CommentDocument = gql`
query Comment($repoFullName: String!, $limit: Int, $offset: Int) {
@@ -457,7 +464,7 @@ export const CurrentUserForProfileDocument = gql`
`;

export function useCurrentUserForProfileQuery(
options?: Omit<Urql.UseQueryArgs<CurrentUserForProfileQueryVariables>, 'query'>
options?: Omit<Urql.UseQueryArgs<CurrentUserForProfileQueryVariables>, 'query'>,
) {
return Urql.useQuery<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>({
query: CurrentUserForProfileDocument,
@@ -488,7 +495,9 @@ export const SubmitRepositoryDocument = gql`
`;

export function useSubmitRepositoryMutation() {
return Urql.useMutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>(SubmitRepositoryDocument);
return Urql.useMutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>(
SubmitRepositoryDocument,
);
}
export const SubmitCommentDocument = gql`
mutation submitComment($repoFullName: String!, $commentContent: String!) {
@@ -500,7 +509,9 @@ export const SubmitCommentDocument = gql`
`;

export function useSubmitCommentMutation() {
return Urql.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(SubmitCommentDocument);
return Urql.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(
SubmitCommentDocument,
);
}
export const VoteDocument = gql`
mutation vote($repoFullName: String!, $type: VoteType!) {
@@ -517,7 +528,7 @@ export const VoteDocument = gql`
export function useVoteMutation() {
return Urql.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument);
}
import { IntrospectionQuery } from 'graphql';

export default {
__schema: {
queryType: {
@@ -1050,7 +1061,9 @@ export default {
directives: [],
},
} as unknown as IntrospectionQuery;
export type WithTypename<T extends { __typename?: any }> = Partial<T> & { __typename: NonNullable<T['__typename']> };
export type WithTypename<T extends { __typename?: any }> = Partial<T> & {
__typename: NonNullable<T['__typename']>;
};

export type GraphCacheKeysConfig = {
Comment?: (data: WithTypename<Comment>) => null | string;
@@ -1062,54 +1075,164 @@ export type GraphCacheKeysConfig = {

export type GraphCacheResolvers = {
Query?: {
currentUser?: GraphCacheResolver<WithTypename<Query>, Record<string, never>, WithTypename<User> | string>;
currentUser?: GraphCacheResolver<
WithTypename<Query>,
Record<string, never>,
WithTypename<User> | string
>;
entry?: GraphCacheResolver<WithTypename<Query>, QueryEntryArgs, WithTypename<Entry> | string>;
feed?: GraphCacheResolver<WithTypename<Query>, QueryFeedArgs, Array<WithTypename<Entry> | string>>;
feed?: GraphCacheResolver<
WithTypename<Query>,
QueryFeedArgs,
Array<WithTypename<Entry> | string>
>;
};
Comment?: {
content?: GraphCacheResolver<WithTypename<Comment>, Record<string, never>, Scalars['String'] | string>;
createdAt?: GraphCacheResolver<WithTypename<Comment>, Record<string, never>, Scalars['Float'] | string>;
content?: GraphCacheResolver<
WithTypename<Comment>,
Record<string, never>,
Scalars['String'] | string
>;
createdAt?: GraphCacheResolver<
WithTypename<Comment>,
Record<string, never>,
Scalars['Float'] | string
>;
id?: GraphCacheResolver<WithTypename<Comment>, Record<string, never>, Scalars['Int'] | string>;
postedBy?: GraphCacheResolver<WithTypename<Comment>, Record<string, never>, WithTypename<User> | string>;
repoName?: GraphCacheResolver<WithTypename<Comment>, Record<string, never>, Scalars['String'] | string>;
postedBy?: GraphCacheResolver<
WithTypename<Comment>,
Record<string, never>,
WithTypename<User> | string
>;
repoName?: GraphCacheResolver<
WithTypename<Comment>,
Record<string, never>,
Scalars['String'] | string
>;
};
Entry?: {
commentCount?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, Scalars['Int'] | string>;
comments?: GraphCacheResolver<WithTypename<Entry>, EntryCommentsArgs, Array<WithTypename<Comment> | string>>;
createdAt?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, Scalars['Float'] | string>;
hotScore?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, Scalars['Float'] | string>;
commentCount?: GraphCacheResolver<
WithTypename<Entry>,
Record<string, never>,
Scalars['Int'] | string
>;
comments?: GraphCacheResolver<
WithTypename<Entry>,
EntryCommentsArgs,
Array<WithTypename<Comment> | string>
>;
createdAt?: GraphCacheResolver<
WithTypename<Entry>,
Record<string, never>,
Scalars['Float'] | string
>;
hotScore?: GraphCacheResolver<
WithTypename<Entry>,
Record<string, never>,
Scalars['Float'] | string
>;
id?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, Scalars['Int'] | string>;
postedBy?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, WithTypename<User> | string>;
repository?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, WithTypename<Repository> | string>;
postedBy?: GraphCacheResolver<
WithTypename<Entry>,
Record<string, never>,
WithTypename<User> | string
>;
repository?: GraphCacheResolver<
WithTypename<Entry>,
Record<string, never>,
WithTypename<Repository> | string
>;
score?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, Scalars['Int'] | string>;
vote?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, WithTypename<Vote> | string>;
vote?: GraphCacheResolver<
WithTypename<Entry>,
Record<string, never>,
WithTypename<Vote> | string
>;
};
Repository?: {
description?: GraphCacheResolver<WithTypename<Repository>, Record<string, never>, Scalars['String'] | string>;
full_name?: GraphCacheResolver<WithTypename<Repository>, Record<string, never>, Scalars['String'] | string>;
html_url?: GraphCacheResolver<WithTypename<Repository>, Record<string, never>, Scalars['String'] | string>;
name?: GraphCacheResolver<WithTypename<Repository>, Record<string, never>, Scalars['String'] | string>;
open_issues_count?: GraphCacheResolver<WithTypename<Repository>, Record<string, never>, Scalars['Int'] | string>;
owner?: GraphCacheResolver<WithTypename<Repository>, Record<string, never>, WithTypename<User> | string>;
stargazers_count?: GraphCacheResolver<WithTypename<Repository>, Record<string, never>, Scalars['Int'] | string>;
description?: GraphCacheResolver<
WithTypename<Repository>,
Record<string, never>,
Scalars['String'] | string
>;
full_name?: GraphCacheResolver<
WithTypename<Repository>,
Record<string, never>,
Scalars['String'] | string
>;
html_url?: GraphCacheResolver<
WithTypename<Repository>,
Record<string, never>,
Scalars['String'] | string
>;
name?: GraphCacheResolver<
WithTypename<Repository>,
Record<string, never>,
Scalars['String'] | string
>;
open_issues_count?: GraphCacheResolver<
WithTypename<Repository>,
Record<string, never>,
Scalars['Int'] | string
>;
owner?: GraphCacheResolver<
WithTypename<Repository>,
Record<string, never>,
WithTypename<User> | string
>;
stargazers_count?: GraphCacheResolver<
WithTypename<Repository>,
Record<string, never>,
Scalars['Int'] | string
>;
};
User?: {
avatar_url?: GraphCacheResolver<WithTypename<User>, Record<string, never>, Scalars['String'] | string>;
html_url?: GraphCacheResolver<WithTypename<User>, Record<string, never>, Scalars['String'] | string>;
login?: GraphCacheResolver<WithTypename<User>, Record<string, never>, Scalars['String'] | string>;
avatar_url?: GraphCacheResolver<
WithTypename<User>,
Record<string, never>,
Scalars['String'] | string
>;
html_url?: GraphCacheResolver<
WithTypename<User>,
Record<string, never>,
Scalars['String'] | string
>;
login?: GraphCacheResolver<
WithTypename<User>,
Record<string, never>,
Scalars['String'] | string
>;
};
Vote?: {
vote_value?: GraphCacheResolver<WithTypename<Vote>, Record<string, never>, Scalars['Int'] | string>;
vote_value?: GraphCacheResolver<
WithTypename<Vote>,
Record<string, never>,
Scalars['Int'] | string
>;
};
};

export type GraphCacheOptimisticUpdaters = {
submitComment?: GraphCacheOptimisticMutationResolver<MutationSubmitCommentArgs, Maybe<WithTypename<Comment>>>;
submitRepository?: GraphCacheOptimisticMutationResolver<MutationSubmitRepositoryArgs, Maybe<WithTypename<Entry>>>;
submitComment?: GraphCacheOptimisticMutationResolver<
MutationSubmitCommentArgs,
Maybe<WithTypename<Comment>>
>;
submitRepository?: GraphCacheOptimisticMutationResolver<
MutationSubmitRepositoryArgs,
Maybe<WithTypename<Entry>>
>;
vote?: GraphCacheOptimisticMutationResolver<MutationVoteArgs, Maybe<WithTypename<Entry>>>;
};

export type GraphCacheUpdaters = {
Query?: {
currentUser?: GraphCacheUpdateResolver<
{ currentUser: Maybe<WithTypename<User>> },
Record<string, never>
>;
entry?: GraphCacheUpdateResolver<{ entry: Maybe<WithTypename<Entry>> }, QueryEntryArgs>;
feed?: GraphCacheUpdateResolver<{ feed: Maybe<Array<WithTypename<Entry>>> }, QueryFeedArgs>;
};
Mutation?: {
submitComment?: GraphCacheUpdateResolver<
{ submitComment: Maybe<WithTypename<Comment>> },
@@ -1127,13 +1250,52 @@ export type GraphCacheUpdaters = {
SubscriptionCommentAddedArgs
>;
};
Comment?: {
content?: GraphCacheUpdateResolver<Maybe<WithTypename<Comment>>, Record<string, never>>;
createdAt?: GraphCacheUpdateResolver<Maybe<WithTypename<Comment>>, Record<string, never>>;
id?: GraphCacheUpdateResolver<Maybe<WithTypename<Comment>>, Record<string, never>>;
postedBy?: GraphCacheUpdateResolver<Maybe<WithTypename<Comment>>, Record<string, never>>;
repoName?: GraphCacheUpdateResolver<Maybe<WithTypename<Comment>>, Record<string, never>>;
};
Entry?: {
commentCount?: GraphCacheUpdateResolver<Maybe<WithTypename<Entry>>, Record<string, never>>;
comments?: GraphCacheUpdateResolver<Maybe<WithTypename<Entry>>, EntryCommentsArgs>;
createdAt?: GraphCacheUpdateResolver<Maybe<WithTypename<Entry>>, Record<string, never>>;
hotScore?: GraphCacheUpdateResolver<Maybe<WithTypename<Entry>>, Record<string, never>>;
id?: GraphCacheUpdateResolver<Maybe<WithTypename<Entry>>, Record<string, never>>;
postedBy?: GraphCacheUpdateResolver<Maybe<WithTypename<Entry>>, Record<string, never>>;
repository?: GraphCacheUpdateResolver<Maybe<WithTypename<Entry>>, Record<string, never>>;
score?: GraphCacheUpdateResolver<Maybe<WithTypename<Entry>>, Record<string, never>>;
vote?: GraphCacheUpdateResolver<Maybe<WithTypename<Entry>>, Record<string, never>>;
};
Repository?: {
description?: GraphCacheUpdateResolver<Maybe<WithTypename<Repository>>, Record<string, never>>;
full_name?: GraphCacheUpdateResolver<Maybe<WithTypename<Repository>>, Record<string, never>>;
html_url?: GraphCacheUpdateResolver<Maybe<WithTypename<Repository>>, Record<string, never>>;
name?: GraphCacheUpdateResolver<Maybe<WithTypename<Repository>>, Record<string, never>>;
open_issues_count?: GraphCacheUpdateResolver<
Maybe<WithTypename<Repository>>,
Record<string, never>
>;
owner?: GraphCacheUpdateResolver<Maybe<WithTypename<Repository>>, Record<string, never>>;
stargazers_count?: GraphCacheUpdateResolver<
Maybe<WithTypename<Repository>>,
Record<string, never>
>;
};
User?: {
avatar_url?: GraphCacheUpdateResolver<Maybe<WithTypename<User>>, Record<string, never>>;
html_url?: GraphCacheUpdateResolver<Maybe<WithTypename<User>>, Record<string, never>>;
login?: GraphCacheUpdateResolver<Maybe<WithTypename<User>>, Record<string, never>>;
};
Vote?: {
vote_value?: GraphCacheUpdateResolver<Maybe<WithTypename<Vote>>, Record<string, never>>;
};
};

export type GraphCacheConfig = {
schema?: IntrospectionData;
export type GraphCacheConfig = Parameters<typeof offlineExchange>[0] & {
updates?: GraphCacheUpdaters;
keys?: GraphCacheKeysConfig;
optimistic?: GraphCacheOptimisticUpdaters;
resolvers?: GraphCacheResolvers;
storage?: GraphCacheStorageAdapter;
};
Loading