Skip to content

Commit

Permalink
New Fusiongraph Plugin: Block Tracking (#623)
Browse files Browse the repository at this point in the history
* New Fusiongraph Plugin: Block Tracking

* chore(dependencies): updated changesets for modified dependencies

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
ardatan and github-actions[bot] authored Mar 6, 2024
1 parent 5b38e99 commit 49d82b7
Show file tree
Hide file tree
Showing 26 changed files with 648 additions and 359 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
'@graphprotocol/client-add-source-name': patch
---

dependencies updates:
- Updated dependency [`@graphql-mesh/types@^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0 || ^0.94.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/types/v/0.78.0) (from `^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0`, in `peerDependencies`)

- Updated dependency [`@graphql-mesh/types@^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0 || ^0.94.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/types/v/0.78.0) (from `^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0`, in `peerDependencies`)
4 changes: 3 additions & 1 deletion .changeset/@graphprotocol_client-apollo-503-dependencies.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
'@graphprotocol/client-apollo': patch
---

dependencies updates:
- Updated dependency [`@graphql-mesh/apollo-link@^0.94.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/apollo-link/v/0.94.0) (from `^0.93.1`, in `dependencies`)

- Updated dependency [`@graphql-mesh/apollo-link@^0.94.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/apollo-link/v/0.94.0) (from `^0.93.1`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
'@graphprotocol/client-auto-pagination': patch
---

dependencies updates:
- Updated dependency [`@graphql-mesh/types@^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0 || ^0.94.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/types/v/0.78.0) (from `^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0`, in `peerDependencies`)

- Updated dependency [`@graphql-mesh/types@^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0 || ^0.94.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/types/v/0.78.0) (from `^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0`, in `peerDependencies`)
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
'@graphprotocol/client-auto-type-merging': patch
---

dependencies updates:
- Updated dependency [`@graphql-mesh/transform-type-merging@^0.94.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/transform-type-merging/v/0.94.0) (from `^0.93.0`, in `dependencies`)
- Updated dependency [`@graphql-mesh/types@^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0 || ^0.94.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/types/v/0.78.0) (from `^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0`, in `peerDependencies`)

- Updated dependency [`@graphql-mesh/transform-type-merging@^0.94.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/transform-type-merging/v/0.94.0) (from `^0.93.0`, in `dependencies`)
- Updated dependency [`@graphql-mesh/types@^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0 || ^0.94.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/types/v/0.78.0) (from `^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0`, in `peerDependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphprotocol/client-block-tracking': patch
---
dependencies updates:
- Added dependency [`@graphql-mesh/fusion-runtime@^0.2.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/fusion-runtime/v/0.2.0) (to `dependencies`)
6 changes: 4 additions & 2 deletions .changeset/@graphprotocol_client-cli-503-dependencies.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
'@graphprotocol/client-cli': patch
---

dependencies updates:
- Updated dependency [`@graphql-mesh/cli@^0.83.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cli/v/0.83.0) (from `^0.82.33`, in `dependencies`)
- Updated dependency [`@graphql-mesh/graphql@^0.94.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/graphql/v/0.94.0) (from `^0.93.0`, in `dependencies`)

- Updated dependency [`@graphql-mesh/cli@^0.83.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cli/v/0.83.0) (from `^0.82.33`, in `dependencies`)
- Updated dependency [`@graphql-mesh/graphql@^0.94.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/graphql/v/0.94.0) (from `^0.93.0`, in `dependencies`)
4 changes: 3 additions & 1 deletion .changeset/@graphprotocol_client-cli-544-dependencies.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
'@graphprotocol/client-cli': patch
---

dependencies updates:
- Updated dependency [`@graphql-mesh/cli@^0.84.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cli/v/0.84.0) (from `^0.83.0`, in `dependencies`)

- Updated dependency [`@graphql-mesh/cli@^0.84.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cli/v/0.84.0) (from `^0.83.0`, in `dependencies`)
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
'@graphprotocol/client-polling-live': patch
---

dependencies updates:
- Updated dependency [`@envelop/core@^2.4.2 || ^3.0.0 || ^4.0.0 || ^5.0.0` ↗︎](https://www.npmjs.com/package/@envelop/core/v/2.4.2) (from `^2.4.2 || ^3.0.0 || ^4.0.0`, in `peerDependencies`)

- Updated dependency [`@envelop/core@^2.4.2 || ^3.0.0 || ^4.0.0 || ^5.0.0` ↗︎](https://www.npmjs.com/package/@envelop/core/v/2.4.2) (from `^2.4.2 || ^3.0.0 || ^4.0.0`, in `peerDependencies`)
4 changes: 3 additions & 1 deletion .changeset/@graphprotocol_client-urql-503-dependencies.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
'@graphprotocol/client-urql': patch
---

dependencies updates:
- Updated dependency [`@graphql-mesh/urql-exchange@^0.94.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/urql-exchange/v/0.94.0) (from `^0.93.1`, in `dependencies`)

- Updated dependency [`@graphql-mesh/urql-exchange@^0.94.0` ↗︎](https://www.npmjs.com/package/@graphql-mesh/urql-exchange/v/0.94.0) (from `^0.93.1`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/lucky-zebras-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphprotocol/client-block-tracking': patch
---

Implement Fusiongraph Plugin
5 changes: 1 addition & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{ targets: { node: process.versions.node.split('.')[0] } },
],
['@babel/preset-env', { targets: { node: process.versions.node.split('.')[0] } }],
'@babel/preset-typescript',
],
plugins: [
Expand Down
46 changes: 23 additions & 23 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ This library is intended to simplify the network aspect of data consumption for

> The tools provided in this repo can be used as standalone, but you can also use it with any existing GraphQL Client!
| Status | Feature | Notes |
| :------: |----------------------------------------------------------------| -------------------------------------------------------------------------------------------------------------------------------- |
| | Multiple indexers | based on fetch strategies |
| | Fetch Strategies | timeout, retry, fallback, race, highestValue |
| | Build time validations & optimizations | |
| | Client-Side Composition | with improved execution planner (based on GraphQL-Mesh) |
| | Cross-chain Subgraph Handling | Use similar subgraphs as a single source |
| | Raw Execution (standalone mode) | without a wrapping GraphQL client |
| | Local (client-side) Mutations | |
| | [Automatic Block Tracking](../packages/block-tracking/README.md) | tracking block numbers [as described here](https://thegraph.com/docs/en/developer/distributed-systems/#polling-for-updated-data) |
| | [Automatic Pagination](../packages/auto-pagination/README.md) | doing multiple requests in a single call to fetch more than the indexer limit |
| | Integration with `@apollo/client` | |
| | Integration with `urql` | |
| | TypeScript support | with built-in GraphQL Codegen and `TypedDocumentNode` |
| | [`@live` queries](./live.md) | Based on polling |
| Status | Feature | Notes |
| :----: | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| | Multiple indexers | based on fetch strategies |
| | Fetch Strategies | timeout, retry, fallback, race, highestValue |
| | Build time validations & optimizations | |
| | Client-Side Composition | with improved execution planner (based on GraphQL-Mesh) |
| | Cross-chain Subgraph Handling | Use similar subgraphs as a single source |
| | Raw Execution (standalone mode) | without a wrapping GraphQL client |
| | Local (client-side) Mutations | |
| | [Automatic Block Tracking](../packages/block-tracking/README.md) | tracking block numbers [as described here](https://thegraph.com/docs/en/developer/distributed-systems/#polling-for-updated-data) |
| | [Automatic Pagination](../packages/auto-pagination/README.md) | doing multiple requests in a single call to fetch more than the indexer limit |
| | Integration with `@apollo/client` | |
| | Integration with `urql` | |
| | TypeScript support | with built-in GraphQL Codegen and `TypedDocumentNode` |
| | [`@live` queries](./live.md) | Based on polling |

> You can find an [extended architecture design here](./architecture.md)
Expand Down Expand Up @@ -187,8 +187,8 @@ Then, you can specify that when you execute operations:
```ts
execute(myQuery, myVariables, {
config: {
apiToken: 'MY_TOKEN'
}
apiToken: 'MY_TOKEN',
},
})
```

Expand Down Expand Up @@ -565,8 +565,8 @@ module.exports = {
// For example, use `web3` lib, connect a wallet and so on.

return true
}
}
},
},
}
```

Expand All @@ -583,8 +583,8 @@ const resolvers: Resolvers = {
// For example, use `web3` lib, connect a wallet and so on.

return true
}
}
},
},
}

export default resolvers
Expand All @@ -597,8 +597,8 @@ execute(
MY_QUERY,
{},
{
myHelper: {} // this will be available in your Mutation resolver as `context.myHelper`
}
myHelper: {}, // this will be available in your Mutation resolver as `context.myHelper`
},
)
```

Expand Down
2 changes: 1 addition & 1 deletion examples/apollo/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
2 changes: 1 addition & 1 deletion examples/execute/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
13 changes: 11 additions & 2 deletions examples/nextjs/styles/Home.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@
border-radius: 5px;
padding: 0.75rem;
font-size: 1.1rem;
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New,
font-family:
Menlo,
Monaco,
Lucida Console,
Liberation Mono,
DejaVu Sans Mono,
Bitstream Vera Sans Mono,
Courier New,
monospace;
}

Expand All @@ -85,7 +92,9 @@
text-decoration: none;
border: 1px solid #eaeaea;
border-radius: 10px;
transition: color 0.15s ease, border-color 0.15s ease;
transition:
color 0.15s ease,
border-color 0.15s ease;
max-width: 300px;
}

Expand Down
14 changes: 12 additions & 2 deletions examples/nextjs/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@ html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans,
Helvetica Neue, sans-serif;
font-family:
-apple-system,
BlinkMacSystemFont,
Segoe UI,
Roboto,
Oxygen,
Ubuntu,
Cantarell,
Fira Sans,
Droid Sans,
Helvetica Neue,
sans-serif;
}

a {
Expand Down
2 changes: 1 addition & 1 deletion examples/react-query/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
2 changes: 1 addition & 1 deletion examples/urql-live-query/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
2 changes: 1 addition & 1 deletion examples/urql/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
1 change: 1 addition & 0 deletions packages/block-tracking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
},
"dependencies": {
"@graphql-tools/utils": "^10.0.0",
"@graphql-mesh/fusion-runtime": "^0.2.0",
"tslib": "^2.4.0"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit 49d82b7

Please sign in to comment.