Skip to content
This repository has been archived by the owner on Oct 2, 2020. It is now read-only.

Migrate to The Graph #200

Merged
merged 26 commits into from
Jul 31, 2020
Merged

Migrate to The Graph #200

merged 26 commits into from
Jul 31, 2020

Conversation

onbjerg
Copy link
Contributor

@onbjerg onbjerg commented Jul 24, 2020

❗ THIS IS WORK IN PROGRESS ❗

After several different prototypes, I've landed on using the schema stitching feature of Apollo in conjunction with our own local type definitions to add things we store (like Apiary Profiles). This is a major breaking change of the API, since we rely on the pagination and filtering mechanism of The Graph, which is considerably different from ours.

This also means that some of the functionality on the website will have to be altered heavily or removed altogether.

Here's a tentative to do list:

Lite release

  • Delete the worker
  • Delete the taskmaster
  • Connect to the Aragon Connect subgraph
  • Ability to read Apiary Profiles
  • Ability to write Apiary Profiles
  • Update or remove scripts, depending on the state of app mining
  • Update website to query new API
  • Fix website sorting
  • Multi-network support (using a NETWORK_ID environment variable)
  • Wiki-style profile editing
  • "Verified" checkmark

Full migration release

  • Filter on the values we filter on now, but filter based on the correct subgraph
  • Add AUM to API (possibly using this subgraph)
  • Profile filter

Missing things

There are some things that block us from completing the base functionality of the API:

App Mining

Currently there is no way to capture a meaningful activity metric using a subgraph. After some talk with The Graph team this might be changed in the near future, so for now this implementation disregards app mining altogether.

Preview

The API can be found at https://apiary-graph-oaa5c9gej21448vwi.herokuapp.com/

onbjerg and others added 4 commits July 23, 2020 10:15
The worker was the actual indexing component of Apiary,
and the taskmaster was the component that queued units of work
for the workers to process in order to facilitate multiple
workers running at once in parallel.

These components are being replaced by a subgraph and the API
will be a wrapper around one or more subgraphs instead.

The documentation has been updated accordingly.
This version of the API decorates aspects of the Aragon Connect
subgraph, however it currently lacks some information, most
notably:

- The address of the kit used to create the organization,
  which is unavailable in the subgraph we are currently using.
- The ENS name of the organization, which is unavailable in the
  subgraph.
- A creation timestamp, which is unavailable in the subgraph.
- An AUM metric which we will need to get from another
  subgraph.
- The `updateProfile` mutation currently present in Apiary,
  however this is somewhat trivial to add.

However, it does contain the ability to read existing profiles
in our database.

This is a major breaking change, since most of the schema changed,
including the pagination and filtering mechanism, as well as
a lot of the field names and types.
@onbjerg onbjerg self-assigned this Jul 24, 2020
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 24, 2020 12:44 Inactive
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 24, 2020 12:46 Inactive
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 24, 2020 12:48 Inactive
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 24, 2020 13:06 Inactive
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 24, 2020 13:49 Inactive
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 24, 2020 14:11 Inactive
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 24, 2020 14:13 Inactive
onbjerg added 4 commits July 24, 2020 18:07
If a profile is not claimed by one or more editors then anyone
can contribute to the profile of an organisation, provided
they pass a valid signed description of the changes they wish to
make.

A profile is considered claimed once an address with permissions
on the specific organization makes a change to the profile.
These scripts are no longer usable since we cannot
measure the activity metric using The Graph as it currently
stands.

I've moved the Cycle 1 app mining data to a directory called
`data`.
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 28, 2020 12:43 Inactive
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 28, 2020 12:56 Inactive
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 28, 2020 12:58 Inactive
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 29, 2020 07:05 Inactive
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 29, 2020 07:08 Inactive
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 30, 2020 09:58 Inactive
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 30, 2020 10:37 Inactive
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 30, 2020 11:05 Inactive
@onbjerg onbjerg had a problem deploying to apiary-graph-oaa5c9gej21448vwi July 31, 2020 09:55 Failure
@onbjerg onbjerg temporarily deployed to apiary-graph-oaa5c9gej21448vwi July 31, 2020 10:01 Inactive
@onbjerg onbjerg marked this pull request as ready for review July 31, 2020 10:06
@onbjerg onbjerg requested a review from lkngtn as a code owner July 31, 2020 10:06
@onbjerg onbjerg merged commit 3dc6ad7 into master Jul 31, 2020
@onbjerg onbjerg deleted the graph branch July 31, 2020 10:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant