All Projects → cawfree → thegraph-react

cawfree / thegraph-react

Licence: MIT license
⚛️ React bindings for helping build decentralized applications quickly on Ethereum and IPFS using GraphQL.

Programming Languages

java
68154 projects - #9 most used programming language
typescript
32286 projects
objective c
16641 projects - #2 most used programming language
Starlark
911 projects
javascript
184084 projects - #8 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to thegraph-react

enzyme-subgraph
The official subgraph the Enzyme protocol.
Stars: ✭ 20 (-35.48%)
Mutual labels:  thegraph, graphprotocol
Graph-Academy-Hub
The Graph Hub is a free, open-source and community-driven knowledge base and documentation initiative on The Graph Protocol. The vision of The Graph Academy is to establish a single go-to-resource for essential information about The Graph Protocol.
Stars: ✭ 62 (+100%)
Mutual labels:  thegraph, graphprotocol
tiddlywiki-ipfs
IPFS with TiddlyWiki
Stars: ✭ 50 (+61.29%)
Mutual labels:  ipfs
pollinations
Generate Art
Stars: ✭ 100 (+222.58%)
Mutual labels:  ipfs
demo-ipfs-todo
Simple ToDo app using window.ipfs
Stars: ✭ 16 (-48.39%)
Mutual labels:  ipfs
orb
A DID method implementation that extends the Sidetree protocol into a Fediverse of interconnected nodes and witnessed using certificate transparency. Spec: https://trustbloc.github.io/did-method-orb/
Stars: ✭ 25 (-19.35%)
Mutual labels:  ipfs
nftool
A suite of tools for NFT generative art.
Stars: ✭ 145 (+367.74%)
Mutual labels:  ipfs
apebase
Bored Ape Database
Stars: ✭ 110 (+254.84%)
Mutual labels:  ipfs
go-stellar-ipfs
🌀 A library that is a bridge between Stellar and IPFS.
Stars: ✭ 25 (-19.35%)
Mutual labels:  ipfs
ethereum-dapp-ipfs-node.js-mongodb
以太坊开发DApp实战教程——用区块链、星际文件系统(IPFS)、Node.js和MongoDB来构建电商平台
Stars: ✭ 46 (+48.39%)
Mutual labels:  ipfs
php-ipfs-api
php client library for ipfs
Stars: ✭ 46 (+48.39%)
Mutual labels:  ipfs
martianpins
Self hosted IPFS pinning service.
Stars: ✭ 23 (-25.81%)
Mutual labels:  ipfs
nft-art-maker
NFT Art Maker - generates images and metadata files, packs them into IPFS CAR files, and uploads them using nft.storage. All from provided PNG layers.
Stars: ✭ 77 (+148.39%)
Mutual labels:  ipfs
ipfs-eth-database
An example of usage IPFS in Ethereum Smart Contracts
Stars: ✭ 55 (+77.42%)
Mutual labels:  ipfs
estuary
A custom IPFS/Filecoin node that makes it easy to pin IPFS content and make Filecoin deals.
Stars: ✭ 195 (+529.03%)
Mutual labels:  ipfs
superhighway84
USENET-inspired, uncensorable, decentralized internet discussion system running on IPFS & OrbitDB
Stars: ✭ 437 (+1309.68%)
Mutual labels:  ipfs
ipfs-crawler
A crawler for the IPFS network, code for our paper (https://arxiv.org/abs/2002.07747). Also holds scripts to evaluate the obtained data and make similar plots as in the paper.
Stars: ✭ 46 (+48.39%)
Mutual labels:  ipfs
git-lfs-ipfs
Use IPFS as a git-lfs endpoint
Stars: ✭ 41 (+32.26%)
Mutual labels:  ipfs
almonit-plugin
ENS+IPFS Firefox plugin by Almonit
Stars: ✭ 17 (-45.16%)
Mutual labels:  ipfs
nebula-crawler
🌌 A libp2p DHT crawler, monitor, and measurement tool that exposes timely information about DHT networks.
Stars: ✭ 97 (+212.9%)
Mutual labels:  ipfs

thegraph-react

https://camo.githubusercontent.com/0f9fcc0ac1b8617ad4989364f60f78b2d6b32985ad6a508f215f14d8f897b8d3/68747470733a2f2f62616467656e2e6e65742f62616467652f547970655363726970742f7374726963742532302546302539462539322541412f626c7565

⚛️ Build decentralized applications quickly and cheaply on Ethereum and IPFS using GraphQL.

Compatible with both React and React Native!

🚀 Getting Started

Using yarn:

yarn add thegraph-react

You'll also need to manually supply install the following dependencies:

@apollo/client
graphql
nanoid

✍️ Usage

import { gql } from "@apollo/client";
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import { Chains, Subgraph, Subgraphs, TheGraphProvider, useCreateSubgraph, useSubgraph } from "thegraph-react";

const styles = StyleSheet.create({
  center: { alignItems: "center", justifyContent: "center" },
});

function Aave({ aave }: {
  readonly aave: Subgraph,
}): JSX.Element {
  const { useQuery } = useSubgraph(aave);
  const { error, loading, data } = useQuery(gql`
  {
    lendingPoolConfigurationHistoryItems(first: 5) {
      id
      provider {
        id
      }
      lendingPool
      lendingPoolCore
    }
    lendingPoolConfigurations(first: 5) {
      id
      lendingPool
      lendingPoolCore
      lendingPoolParametersProvider
    }
  }
  `);
  return (
    <View style={[StyleSheet.absoluteFill, styles.center]}>
      <Text>{(error || loading) ? 'Loading...' : JSON.stringify(data)}</Text>
    </View>
  );
}

export default function App(): JSX.Element {
  const aave = useCreateSubgraph({
    [Chains.MAINNET]: 'https://api.thegraph.com/subgraphs/name/aave/protocol',
  });

  const subgraphs = React.useMemo((): Subgraphs => {
    return [aave];
  }, [aave]);

  return (
    <TheGraphProvider chain={Chains.MAINNET} subgraphs={subgraphs}>
      <Aave aave={aave} />
    </TheGraphProvider>
  );
}

✌️ License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].