npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tesseractcollective/react-graphql

v0.9.17

Published

This library provides hooks and components to easily interact with opinionated graphql APIs. It includes patters do create paginated lists, admin interface data grids, and edit views.

Downloads

22

Readme

React GraphQL

This library provides hooks and components to easily interact with opinionated graphql APIs. It includes patters do create paginated lists, admin interface data grids, and edit views.

Supported GraphQL APIs:

  • Hasura

Other APIs on roadmap:

  • TODO

Installation

Add these dependencies: react-router-dom graphql graphql-tag jotai lodash react react-dom react-native-web react-scripts urql type-fest @tesseractcollective\react-graphql

Adding new files (components, hooks, support, other)

Update src/index.web.ts and/or src/index.native.ts to import and export the file and any types created for the new file.

If there is an index file inbetween src and your component you need to update that as well. This isn't necessary but improves local typescript support.

Adding component

If the component can be built and maintained using only react-native-web components, put it in src/components/shared and do that!

Otherwise, put the component in component in src/components/native OR web and only update the matching index file in src.

deploy locally to test (web):

setup the correct dependencies for platform:

pnpm webmode

Then run a pack command based on platform:

pnpm pack:web
  • Find .tgz : Resolve any errors and look for the correct .tgz file in the root of the project.
  • Copy path : Right click and select "copy path"
  • Install via file: In the target project run pnpm add PASTE_PATH_TO_TGZ

This will override the existing version of react-graphl in that project with the one you built on disk.

Repeat as needed.

NOTE: You do not need to bump the version!

deploy locally to test (native):

setup the correct dependencies:

pnpm nativemode

Then run a build command:

pnpm build:native:ts

Update package.json with the path to the native project you want to test in:

"test:copy": "cp -rf ./dist PATH/node_modules/@tesseractcollective/react-graphql/dist"

This will override the existing version of react-graphl in that project with the one you built on disk.

Repeat as needed.

NOTE: You do not need to bump the version!

Storybook

To run story book:

  • Make sure you have installed dependencies via pnpm i
  • add .env.js file in the root of the project
  • Place this content inside:
module.exports = {
  STORYBOOK_HASURA_URL: 'https://DOMAIN.APP/v1/graphql',
  STORYBOOK_HAUSRA_AUTH_KEYNAME: 'x-hasura-admin-secret OR x-collaborator-token OR other key',
  STORYBOOK_HASURA_AUTH_VALUE: 'TOKEN_OR SECRET',
};

Then run:

pnpm storybook