Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Apollo Client Devtools | 1,441 | 7 days ago | 35 | mit | TypeScript | |||||
Apollo Client browser developer tools. | ||||||||||
Graphql Config | 1,107 | 9,102 | 114 | 2 days ago | 176 | May 24, 2022 | 22 | mit | TypeScript | |
One configuration for all your GraphQL tools (supported by most tools, editors & IDEs) | ||||||||||
Awesome React Graphql | 619 | 2 years ago | cc-by-4.0 | |||||||
A curated collection of resources, clients and tools that make working with `GraphQL and React/React Native` awesome | ||||||||||
Get Graphql Schema | 585 | 45 | 26 | 6 months ago | 6 | November 14, 2018 | 58 | TypeScript | ||
Fetch and print the GraphQL schema from a GraphQL HTTP endpoint. (Can be used for Relay Modern.) | ||||||||||
Lucid | 398 | 6 months ago | 15 | mit | JavaScript | |||||
A developer tool for engineers working with React and GraphQL. | ||||||||||
React Redux Graphql Apollo Bootstrap Webpack Starter | 124 | 4 years ago | 4 | JavaScript | ||||||
react js + redux + graphQL + Apollo + react router + hot reload + devTools + bootstrap + webpack starter | ||||||||||
Artemis Dev Tool | 65 | 3 years ago | 2 | mit | TypeScript | |||||
An Apollo GraphQL Query Schema Testing Tool | ||||||||||
Apollo Vue Devtools | 17 | a day ago | 2 | mit | TypeScript | |||||
Integrate GraphQL Apollo with Vue Devtools! | ||||||||||
Lyra | 11 | 3 years ago | 3 | mit | JavaScript | |||||
State Visualizer for GraphQL applications built with Apollo State Management | ||||||||||
Apollo Synchronizer | 2 | a year ago | mit | Go | ||||||
Help developer to sync between local file and remote apollo portal web since portal web is so messy to use |
Download for Firefox | Download for Chrome
This repository contains the Apollo Client Browser Devtools extension for Chrome & Firefox.
The Apollo Client Browser Devtools appear as an "Apollo" tab in your web browser inspector, alongside other tabs like "Elements" and "Console". The devtools currently have four main features:
Name | Username |
---|---|
Ben Newman | @benjamn |
Alessia Bellisario | @alessbell |
Jeff Auriemma | @bignimbus |
Hugh Willson | @hwillson |
Jerel Miller | @jerelmiller |
Lenz Weber-Tronic | @phryneas |
if you are using an older version of Apollo Client and have issues with our Client Browser Devtools we recommend you upgrade to the latest version of Apollo Client.
3.x
versions of Apollo Client for use with our Client Browser DevTools.2.x
versions of Apollo Client for use with our Client Browser DevTools.You can install the extension via Firefox Browser Add-ons or the Chrome Webstore. If you want to install a local version of the extension instead, skip ahead to the Developing section.
While your application is in dev mode, the devtools will appear as an "Apollo" tab in your web browser inspector. To enable the devtools for your application in production, pass connectToDevTools: true
to the ApolloClient constructor in your application. Pass connectToDevTools: false
if want to manually disable this functionality.
The "Apollo" tab will appear in your web browser inspector if a global window.__APOLLO_CLIENT__
object exists in your application. Apollo Client adds this hook to the window automatically unless process.env.NODE_ENV === 'production'
. If you would like to use the devtools in production, manually attach your Apollo Client instance to window.__APOLLO_CLIENT__
or pass connectToDevTools: true
to the constructor.
If you are seeing the "Apollo" tab but are still having issues, skip ahead to the Debugging section.
After cloning this repo, install the required packages:
cd apollo-client-devtools
npm install
We provide a sample application to run when developing and testing the extension. To run it, install the required dependencies for both the client and server:
npm run install:dev
Then start the application:
npm run start:dev
Navigate to localhost:3000
to view the application. To view the API schema, navigate to localhost:4000
.
For cross-browser development, we rely on the web-ext command line tool and a modified version of the WebExtWebpackPlugin that hooks into the build process.
To develop with Firefox, run the following command:
npm run firefox
For Chrome, run the following command:
npm run chrome
Running either of these commands will:
webpack --watch
to watch source files for changeslocalhost:3000
(the sample application)Note that even though the extension is rebuilt and reloaded, a hard refresh is still required. Hot reloading is not an option for web extensions.
Defaults can be found and modified in the WebExtPlugin. You might want to do so if you'd like the targeted browser to open to a different address or to turn on lintOnBuild
.
We use Jest and the React Testing Library to write and run our tests.
To run tests for both src
and development
, run the following command:
npm run test
You can also run with --watch
to watch and re-run tests automatically:
npm run test:watch
There are two main pieces of the Apollo Client Browser Devtools: the extension itself and a React application. The extension is the code that communicates with the browser. It allows us to search an inspected window for an instance of Apollo Client and to create the Apollo tab in the browser's devtools panel. The React application powers the experience in the devtools panel.
The devtools folder structure mirrors this architecture. The source code for the extension can be found in src/extension
. The React application code can be found in src/application
.
For builds, we use the build
folder. After a build, all of the files needed to run the devtools can be found here. If these files are bundled for development, source maps are provided. When these files are bundled for production, source maps are not provided and the code is minified. We use the dist
folder for distributable zip files.
The Apollo Client Devtools project is split up by Screens. In the navigation of the Apollo Client Devtools you can select from Explorer, Queries, Mutations and Cache. Each of these Screens has their own React component and is wrapped in a Layout component.
The Explorer is an Embedded iframe that renders Apollo Studio's Explorer. The Explorer accepts post messages from the dev tools to populate the schema and to communicate network requests and responses. All network requests are done in this app via the parent page's Apollo Client instance. Documentation for all of the configurable properties of the Embedded Explorer can be found in the studio docs.
hook.ts
is where we hook into the Apollo Client instance of the parent page and execute operations. In initializeHook
we set up a communication between the client page and the Apollo Client Devtools tab via an instance of Relay.ts
using postMessage. The hook sends the tab information from the parent page, such as the queries, mutations & the cache info on this page (from the Apollo Client instance), responses that come back from Devtools-triggered network requests, and when the page is reloading.
tabRelay.ts
is injected into each tab via script tag. Any communication that needs to go from the client to the Apollo Client Devtools need to be forwarded in tabRelay.ts
.
devtools.ts
is the file where all Apollo Client Devtools communication happens. In this file, network communications for executed operations are forwarded to the Explorer. This is also the file where incoming client messages about the tab state are handled & acted on. Any communication that needs to go from the Apollo Client Devtools to the client needs to be forwarded in devtools.ts
.
explorerRelay.ts
is a file with a bunch of exported functions that are specific to the Explorer network communications for executed operations. devtools.ts
uses the functions as callbacks for its incoming messages, and Explorer.tsx
uses the functions to dispatch network requests & accept responses to display in the embedded Explorer.
When requests are triggered by the user from Explorer, sendExplorerRequest
in explorerRelay.ts
dispatches an EXPLORER_REQUEST
event which is picked up in devtools.ts
and forwarded to the client. In hook.ts
the EXPLORER_REQUEST
message is listened for, and an operation is executed. When a response for this network request is recieved by the client, EXPLORER_RESPONSE
is sent to the tab by the client in hook.ts
. This message is forwarded in tabRelay.ts
to the devtools, which calls sendResponseToExplorer
which is picked up by receiveExplorerResponses
called in Explorer.tsx
.
If there is an error in the devtools panel, you can inspect it just like you would inspect a normal webpage.
In Chrome, detach the inspector console from the window (if it's not already detached) by clicking the button with three vertical dots in the upper right corner of the console and selecting the detach option. With the detached console in focus, press opt-cmd-I
again to open an inspector for the detached console (inspector inception). In this new inspector you will be able to inspect elements in the first inspector, including the devtools panel.
In Firefox, go to about:debugging
, click on This Firefox
, find the Apollo Devtool extension and click Inspect
.
If you are using Apollo Client 2.0, make sure you are using at least version 2.0.5 of the devtools.
If you are using Apollo Client 3.0, make sure you are using at least version 2.3.5 of the devtools.
If you're seeing an error that's being caused by the devtools, please open an issue on this repository with a detailed explanation of the problem and steps that we can take to replicate the error.
Release process, for those with permission:
./package.json
and ./src/extension/manifest.json
version numbers.npm publish
in the root of the project. We're publishing to npm to allow other projects to have a dependency on devtools.npm run zip
to pack all of the builds for submission.chrome://extensions/
Load unpacked
.apollo-client-devtools/build
directory.Apollo Client Devtools
extension to update.Package
then Upload new package
../dist/chrome.zip
file for upload.about:debugging#/runtime/this-firefox
Load Temporary Add-on
.apollo-client-devtools/dist/apollo_client_developer_tools-X.X.X.zip
file.apollo-client-devtools/dist/apollo_client_developer_tools-X.X.X.zip
for upload and submit. NOTE: when uploading to Firefox, you also must include the source code. A zipped version of the apollo-client-devtools
repo with the built files, node_modules, tests & development folder deleted will do
This project is governed by the Apollo Code of Conduct.
Apollo builds open-source software and a graph platform to unify GraphQL across your apps and services. We help you ship faster with:
Check out the Odyssey learning platform, the perfect place to start your GraphQL journey with videos and interactive code challenges. Join the Apollo Community to interact with and get technical help from the GraphQL community.