├── .circleci
└── config.yml
├── .eslintrc.cjs
├── .github
├── ISSUE_TEMPLATE.md
├── PULL_REQUEST_TEMPLATE.md
├── dependabot.yml
└── renovate.json5
├── .gitignore
├── CODEOWNERS
├── LICENSE
├── README.md
├── config-overrides.js
├── index.html
├── package-lock.json
├── package.json
├── public
└── vite.svg
├── src
├── index.css
├── index.jsx
├── layout.jsx
├── link.js
├── schema.js
└── subscriptions.jsx
└── vite.config.js
/.circleci/config.yml:
--------------------------------------------------------------------------------
1 | version: 2.1
2 |
3 | orbs:
4 | secops: apollo/circleci-secops-orb@2.0.7
5 |
6 | workflows:
7 | security-scans:
8 | jobs:
9 | - secops/gitleaks:
10 | context:
11 | - platform-docker-ro
12 | - github-orb
13 | - secops-oidc
14 | git-base-revision: <<#pipeline.git.base_revision>><><>
15 | git-revision: << pipeline.git.revision >>
16 | - secops/semgrep:
17 | context:
18 | - secops-oidc
19 | - github-orb
20 | git-base-revision: <<#pipeline.git.base_revision>><><>
21 |
--------------------------------------------------------------------------------
/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:react/recommended',
7 | 'plugin:react/jsx-runtime',
8 | 'plugin:react-hooks/recommended',
9 | ],
10 | ignorePatterns: ['dist', '.eslintrc.cjs'],
11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
12 | settings: { react: { version: '18.2' } },
13 | plugins: ['react-refresh'],
14 | rules: {
15 | 'react-refresh/only-export-components': [
16 | 'warn',
17 | { allowConstantExport: true },
18 | ],
19 | },
20 | }
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # Please see the documentation for all configuration options:
2 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3 |
4 | version: 2
5 | updates:
6 | - package-ecosystem: "npm"
7 | directory: "/" # Location of package manifests
8 | schedule:
9 | interval: "daily"
10 |
--------------------------------------------------------------------------------
/.github/renovate.json5:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json"
3 | }
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | coverage
3 | build
4 | .DS_Store
5 | .env
6 | npm-debug.log
7 |
--------------------------------------------------------------------------------
/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # This file was automatically generated by the Apollo SecOps team
2 | # Please customize this file as needed prior to merging.
3 |
4 | * @apollographql/client-typescript
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2021 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.)
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Apollo Client Issue Reproduction
2 |
3 | Welcome! If you are here then you were likely referred to this repo when reporting an error to [`apollographql/apollo-client`][1]. The core team is invested in making the best client for GraphQL possible, so when you hit an error it is important to the team that the error is resolved as soon as possible.
4 |
5 | Unfortunately, describing an error in GitHub is often not enough to truly understand the reported issue. By creating a small reproduction test case using this template repo the Apollo Client team will be able to identify and fix your error much faster then they could without.
6 |
7 | This repo was created with [`vite`][2] and is appropriate for reproductions of client-rendered React applications. To make changes in the GraphQL schema make sure to look at the `./src/index.jsx` file where we define a GraphQL schema using [GraphQL.js][5] which will run in the browser.
8 |
9 | | ☑️ Apollo Client User Survey |
10 | | :----- |
11 | | What do you like best about Apollo Client? What needs to be improved? Please tell us by taking a [one-minute survey](https://docs.google.com/forms/d/e/1FAIpQLSczNDXfJne3ZUOXjk9Ursm9JYvhTh1_nFTDfdq3XBAFWCzplQ/viewform?usp=pp_url&entry.1170701325=Apollo+Client&entry.204965213=Readme). Your responses will help us understand Apollo Client usage and allow us to serve you better. |
12 |
13 | ## Reproductions with other frameworks
14 |
15 | - **Next.js**: see our [`apollographql/next-apollo-example`][3] repository
16 | - **React Native**: see our [`apollographql/rn-apollo-client-testbed`][4] repository
17 |
18 | If you are not using React, a small reproduction case with your framework of choice would go a long way.
19 |
20 | [1]: https://github.com/apollographql/apollo-client
21 | [2]: https://vitejs.dev/
22 | [3]: https://github.com/apollographql/next-apollo-example
23 | [4]: https://github.com/apollographql/rn-apollo-client-testbed
24 | [5]: http://graphql.org/graphql-js/
25 |
26 | # Reproduction Creation Steps
27 |
28 | 1. Fork this repository to your GitHub account, or fork the [CodeSandbox](https://codesandbox.io/s/github/apollographql/react-apollo-error-template?file=/src/index.jsx) and skip steps 2-4.
29 | 2. By default, cloning this repostiory gives you an Apollo Client 3.0-based application. If you would like to start with a legacy Apollo Client 2.6 application, clone or checkout the `ac2` branch:
30 | ```sh
31 | git clone --branch ac2 git@github.com:apollographql/react-apollo-error-template.git
32 | # Or, after cloning the repository:
33 | git checkout -t origin/ac2
34 | ```
35 | 3. After cloning, install all dependencies with `npm install`.
36 | 4. Start the development server with `npm start`.
37 | 5. Make the changes that will reproduce this error locally.
38 | 6. When ready, push your changes back to GitHub and let the [`apollo-client` team](https://github.com/apollographql/apollo-client#maintainers) know where they can be found.
39 |
--------------------------------------------------------------------------------
/config-overrides.js:
--------------------------------------------------------------------------------
1 | const {
2 | override,
3 | addWebpackPlugin,
4 | } = require("customize-cra");
5 | const webpack = require("webpack");
6 | const StatsPlugin = require("stats-webpack-plugin");
7 |
8 | module.exports = override(
9 | addWebpackPlugin(
10 | new webpack.DefinePlugin({
11 | __DEV__: process.env.NODE_ENV !== "production",
12 | }),
13 | ),
14 | addWebpackPlugin(
15 | new StatsPlugin("stats.json", {
16 | chunkModules: true,
17 | }),
18 | ),
19 | );
20 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |