Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENG-4695 feat(portal,graphql,1ui): merge feature/graphql-migration into main (WIP -- do not merge) #906

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from

Conversation

jonathanprozzi
Copy link
Member

@jonathanprozzi jonathanprozzi commented Nov 12, 2024

Affected Packages

Apps

  • data populator
  • portal
  • template

Packages

  • 1ui
  • api
  • graphql
  • protocol
  • sdk

Tools

  • tools

Overview

Overview of the changes in the PR.

Screen Captures

If applicable, add screenshots or screen captures of your changes.

Declaration

  • I hereby declare that I have abided by the rules and regulations as outlined in the CONTRIBUTING.md

jonathanprozzi and others added 7 commits November 12, 2024 16:39
- Note: This PR is into the `feature/graphql-migration` branch, not
`main`
- Updates our `account.graphql` fragments and `accounts.graphql` queries
(`GetAccount` and `GetAccounts`) to include the `createdAtoms_aggregate`
and `createdTriples_aggregate` and supporting variables
- This is a response to @Vitalsine85 and I exploring the queries that
we'd need for each specific page in Portal and we needed to add these to
the query to match the use cases.
- Adds in the HydrationBoundary in the providers.tsx -- this enables the
partial hydration pattern referenced in
#885
- Once this wraps Portal via the providers we can partially hydrate as
long as the queryKey matches server + client side. This won't have any
bearing on our client-side only hooks such as in modals but enables the
hydration pattern where loaders are available
- The HydrationBoundary ensures that our client-side cache for each
query (where loaders are available) starts with the same data that was
fetched and rendered on the server
- Note: This re-opens PR #888 into `feature/graphql-migration` instead
of onto `main`
…low modal (#891)

Apps

- [ ] data populator
- [x] portal
- [ ] template

Packages

- [ ] 1ui
- [ ] api
- [ ] graphql
- [ ] protocol
- [ ] sdk

Tools

- [ ] tools

- Added useFollowMutation hook which handles the transaction and
updating queries based on their queryKeys.
- Removed fetchReval fetcher in favor of this new method.
- Renamed GetStats query key to get-stats to follow standard.

If applicable, add screenshots or screen captures of your changes.

- [x] I hereby declare that I have abided by the rules and regulations
as outlined in the
[CONTRIBUTING.md](https://github.com/0xIntuition/intuition-ts/blob/main/CONTRIBUTING.md)
…ery (#890)

Apps

- [ ] data populator
- [x] portal
- [ ] template

Packages

- [ ] 1ui
- [ ] api
- [ ] graphql
- [ ] protocol
- [ ] sdk

Tools

- [ ] tools

- Replaced claimChecker fetcher with ReactQuery hook, still leverages
RPC
- Replaced claimFetcher fetcher with GQL hook useGetTripleQuery
- Replaced feeFetcher with ReactQuery hook useCreateClaimConfig, similar
to useCreateIdentityConfig, still leverages RPC

If applicable, add screenshots or screen captures of your changes.

- [x] I hereby declare that I have abided by the rules and regulations
as outlined in the
[CONTRIBUTING.md](https://github.com/0xIntuition/intuition-ts/blob/main/CONTRIBUTING.md)

---------

Co-authored-by: Jonathan Prozzi <jonathanprozzi@gmail.com>
- Follow Modal was still trying to use useCreateConfig, but should have
been using useCreateClaimConfig.
- This updates the `render.yaml` file to deploy a GraphQL version of
Portal for QA during the migration
- This is only temporary -- since this'll live only on that feature
branch we'll want to create a unified `render.yaml` for this and Data
Populator when we merge back into `main` -- we'd likely want to
completely remove the GraphQL Render deployment at that point. We'll
revert the `render.yaml` back to the Data Populator version (or unify
the two if we want to go that route for future deployments)
- I tested the deployment from this branch and it works -- once we merge
this in to the `feature/graphql-migration` branch I can update the
deployment target to that branch for ongoing QA
- Co-authored-by: Vital <rob@creative-element.net>
…s-header and create-identity-form to add missing hook values after rebase.
@jonathanprozzi jonathanprozzi changed the title (Feature) feature/graphql migration (WIP -- Do Not Merge) ENG-4695 feat(portal, graphql, 1ui): feature/graphql migration (WIP -- Do Not Merge) Nov 12, 2024
Copy link

linear bot commented Nov 12, 2024

@jonathanprozzi jonathanprozzi changed the title ENG-4695 feat(portal, graphql, 1ui): feature/graphql migration (WIP -- Do Not Merge) ENG-4695 feat(portal, graphql, 1ui): feature/graphql migration -- WIP do not merge Nov 12, 2024
@jonathanprozzi jonathanprozzi changed the title ENG-4695 feat(portal, graphql, 1ui): feature/graphql migration -- WIP do not merge ENG-4695 feat(portal,graphql,1ui): feature/graphql migration (WIP -- do not merge) Nov 12, 2024
@jonathanprozzi jonathanprozzi changed the title ENG-4695 feat(portal,graphql,1ui): feature/graphql migration (WIP -- do not merge) ENG-4695 feat(portal,graphql,1ui): merge feature/graphql-migration into main (WIP -- do not merge) Nov 12, 2024
- Somehow this was lost in the rebase. Adds this back in -- should fix
build issues.
@github-actions github-actions bot added the feat Feature label Nov 12, 2024
jonathanprozzi and others added 14 commits November 14, 2024 15:19
…ents query (#912)

- Adds metadata to several queries (this is an iteration -- may still
need refinement)
- Rounds out the `GetEvents` query to support the use cases we need for
Portal as well as allowing for filtering by multiple addresses on the
positions on the activity/event feed
- Updates all of the related fragments to support all of these use cases
- Runs codegen to generate updated queries and hooks
- Note: May still need additional tweaks -- will either do a separate
small PR or as part of the specific feature it's being used in
… to use aggregates (#918)

- Updates the atoms, lists, and triples queries to use aggregate
versions of atoms and triples
- Runs codegen
… fixes build issue in template playground (#919)

- Re-runs codegen to get new hooks and fixes build issue in template
playground
- Adds `aggregate` `count` field to all queries that use the
`_aggregate` field so we can have an accurate count for pagination.
- Re-runs codegen to add this to queries and hooks.
## Affected Packages

Apps

- [ ] data populator
- [x] portal
- [ ] template

Packages

- [x] 1ui
- [ ] api
- [ ] graphql
- [ ] protocol
- [ ] sdk

Tools

- [ ] tools

## Overview

Based off branch/PR 4383 since there were some important updates to the
stake modal that had to be accounted for. Cannot merge until we get that
PR merged in.

- Swapped out vaultDetails fetcher for react query hook
- honestly can't remember some of the other updates since so much is
crammed into this due it being based off another branch. Once that is
merged and this is rebased, it will clear that all up.

## Screen Captures

If applicable, add screenshots or screen captures of your changes.

## Declaration

- [x] I hereby declare that I have abided by the rules and regulations
as outlined in the
[CONTRIBUTING.md](https://github.com/0xIntuition/intuition-ts/blob/main/CONTRIBUTING.md)

---------

Co-authored-by: Jonathan Prozzi <jonathanprozzi@gmail.com>
…and update template playground (#923)

- Updates core queries and fragments to use a split approach that's more
aligned with Hasura best practices for aggregates and data querying for
use in pagination.
- Adds Get[Entities]WithAggregate queries and Get[Entities]Count queries
for more flexibility and thoroughness for the exported queries/hooks
from our package
- Runs codegen with the new queries
- Updates the template playground routes that use this
- Note: We'll likely need to keep tweaking these -- covering as many
bases as we need and updating as we implement in specific use cases
…onnections) and codegen for hooks (#925)

- Adds `GetFollowingPositions`, `GetFollowerPositions`, and
`GetConnections` queries and supporting fragments.
- Runs codegen to generate hooks and query documents for each of these
…template update (#928)

- Adds in `GetTags` and `GetTagsCustom` queries in `tags.graphql` --
`GetTags` is more streamlined and specific with the variables it takes
(`subjectId` and `predicateId`) whereas `GetTagsCustom` uses a more
general `where` for the variable. This allows for more flexible use,
whereas the `GetTags` covers almost all of our tag related use cases
- Updates the fragments to support the data we need in these queries
- Runs codegen and updates the template to remove `triple.label` from
use since it's removed from the `TripleMetadata` fragment
- Adds `data` to the `AtomMetadata` fragment 
- Re-runs codegen
- This reworks the `connections.tsx` in the User Profile (personal
profile) to use the new GraphQL API
- Reworks the components needed to get the UI working (such as the
connections-header) and the follow.tsx List component
- There are some uses of `any` we need to fix, and we also need to
resolve the following: Decouple the search/sort and pagination UI from
the previous architecture, update our helper utils to use the new data
model. Doing what we can along the way but we'll need to make
incremental progress.
- Search and sorting and pagination work at the query level but I
removed the UI until we decouple it as it was causing unnecessary
refreshes
- Leaves in the old interface options for connections-header until we
can also update the other `connections.tsx` (other user's profile) so to
not break the build with missing interface/props
… graphql package (#937)

- This reworks the connections.tsx in the User Profile (another user's
profile) to use the new GraphQL API
- Same as with the user profile -- there are some uses of any we need to
fix, and we also need to resolve the following: Decouple the search/sort
and pagination UI from the previous architecture, update our helper
utils to use the new data model. Doing what we can along the way but
we'll need to make incremental progress.
- Search and sorting and pagination work at the query level but I
removed the UI until we decouple it as it was causing unnecessary
refreshes
- Removes old interface options for connections-header.tsx and
follow.tsx -- removes all uses of followClaim
## Affected Packages

Apps

- [ ] data populator
- [x] portal
- [ ] template

Packages

- [ ] 1ui
- [ ] api
- [ ] graphql
- [ ] protocol
- [ ] sdk

Tools

- [ ] tools

## Overview

- Swapped out fetchers for claim checker hook
- Update useInvalidItems to work with claim checker hook

## Screen Captures

If applicable, add screenshots or screen captures of your changes.

## Declaration

- [x] I hereby declare that I have abided by the rules and regulations
as outlined in the
[CONTRIBUTING.md](https://github.com/0xIntuition/intuition-ts/blob/main/CONTRIBUTING.md)
- Updates queries and fragments to support what we need for the user
metadata. Runs codegen
- Uses the `useGetVaultDetails` hook and GraphQL hooks for all user data
(excluding Points)
- This includes several TODO comments flagging our need to fix/update
the type safety once we lock it all in
- This breaks the _View All Tags_ modal but there are a lot of other
pieces we need to fix to get this to work and we'll need to revisit it
## Affected Packages

Apps

- [ ] data populator
- [x] portal
- [ ] template

Packages

- [ ] 1ui
- [ ] api
- [ ] graphql
- [ ] protocol
- [ ] sdk

Tools

- [ ] tools

## Overview

- Swaps out fetchers for queries in Save List modal
- Updates Add Tags modal to work within the Save List modal
- Created useSaveListMutation hook to handle staking on lists
- Fixed issue with Staking Modal that popped up while testing redeems

## Screen Captures

If applicable, add screenshots or screen captures of your changes.

## Declaration

- [x] I hereby declare that I have abided by the rules and regulations
as outlined in the
[CONTRIBUTING.md](https://github.com/0xIntuition/intuition-ts/blob/main/CONTRIBUTING.md)
jonathanprozzi and others added 12 commits November 21, 2024 15:42
- Incremental adoption of GraphQL for the metadata (left panel) when
viewing another user's profile
- Certain modals are being reworked on other branches and will be
updated in another PR
- We'll do another pass for the data (and continue removing unused
calls) as we incrementally progress
## Affected Packages

Apps

- [ ] data populator
- [x] portal
- [ ] template

Packages

- [ ] 1ui
- [ ] api
- [ ] graphql
- [ ] protocol
- [ ] sdk

Tools

- [ ] tools

## Overview

- Now fetches the vaultDetails, followClaim, etc inside of the follow
modal rather than passing it in from route

## Screen Captures

If applicable, add screenshots or screen captures of your changes.

## Declaration

- [x] I hereby declare that I have abided by the rules and regulations
as outlined in the
[CONTRIBUTING.md](https://github.com/0xIntuition/intuition-ts/blob/main/CONTRIBUTING.md)
- Converts all of Identity Details to use GraphQL API
- Updates several components to work with this, including pagination,
but keeps the previous version until we fully migrate to keep the
typechecks building
- Note: Still need pagination/sort/search adjustments but those are in
another ticket. We also need to tweak the staking actions, but we're
going to do that in a separate PR.
…raphql equivalent (#945)

## Affected Packages

Apps

- [ ] data populator
- [x] portal
- [ ] template

Packages

- [ ] 1ui
- [ ] api
- [x] graphql
- [ ] protocol
- [ ] sdk

Tools

- [ ] tools

## Overview

- Replaces the combobox search in Create Claim flow with new GraphQL
powered search, courtesy of the lovely @0xjojikun. Added a bit of salt
and pepper but he did a beautiful job on these new components!

## Screen Captures


https://www.loom.com/share/450e9ce606f44e9caaf785995035caa5?sid=40b26455-6a42-467c-97b8-842b10f8e739

## Declaration

- [x] I hereby declare that I have abided by the rules and regulations
as outlined in the
[CONTRIBUTING.md](https://github.com/0xIntuition/intuition-ts/blob/main/CONTRIBUTING.md)
)

- Updates the global activity feed to use GraphQL and we also can now
support showing the user's positions on the atoms/triples in the feed.
This takes in an array of addresses.
- Modifies the events queries to support this feature and runs codegen
- Pagination works in the query, and added in a placeholder component --
doing pagination in a future PR
- Begins adding in new implementations of our utils in `misc.tsx` and
suffixes these with `New` -- same with the new component
implementations. This is to support the legacy versions until we fully
migrate. This is needed to ensure that everything builds.
- Note: We need to adjust the stake modals to work with the new types
without breaking the other implementations until we fully migrate
## Affected Packages

Apps

- [ ] data populator
- [x] portal
- [ ] template

Packages

- [ ] 1ui
- [ ] api
- [ ] graphql
- [ ] protocol
- [ ] sdk

Tools

- [ ] tools

## Overview

Replaces the combobox search components on Explore Claims route with the
new components that leverage GraphQL.

## Screen Captures


https://www.loom.com/share/474de219325246aba29929fd1a94b9ac?sid=e5a7664c-ca8c-4eec-8046-450b5ee1794a

## Declaration

- [x] I hereby declare that I have abided by the rules and regulations
as outlined in the
[CONTRIBUTING.md](https://github.com/0xIntuition/intuition-ts/blob/main/CONTRIBUTING.md)
…953)

- Builds out the user profile data about route and switches to use new
versions of the list components
- Pagination/search/sort still WIP but the rest of the data is loading
using GraphQL now
- All fields / metadata working as expected except for the TVL on the
triples query -- there is a TODO with a note about this in the code
comments
## Affected Packages

Apps

- [ ] data populator
- [x] portal
- [ ] template

Packages

- [ ] 1ui
- [ ] api
- [ ] graphql
- [ ] protocol
- [ ] sdk

Tools

- [ ] tools

## Overview

Updates ImageModal to handle the props individually rather than passing
the full atom object. While we may want to simplify this by passing the
complete atom in the future, the current type mismatches between the
GraphQL and legacy API make granular prop handling more maintainable.

## Screen Captures

If applicable, add screenshots or screen captures of your changes.

## Declaration

- [x] I hereby declare that I have abided by the rules and regulations
as outlined in the
[CONTRIBUTING.md](https://github.com/0xIntuition/intuition-ts/blob/main/CONTRIBUTING.md)
## Affected Packages

Apps

- [ ] data populator
- [x] portal
- [ ] template

Packages

- [ ] 1ui
- [ ] api
- [ ] graphql
- [ ] protocol
- [ ] sdk

Tools

- [ ] tools

## Overview

Updates User Data About route to use GraphQL query.

## Screen Captures

If applicable, add screenshots or screen captures of your changes.

## Declaration

- [x] I hereby declare that I have abided by the rules and regulations
as outlined in the
[CONTRIBUTING.md](https://github.com/0xIntuition/intuition-ts/blob/main/CONTRIBUTING.md)
)

- Adds in everything for Overview with exception of Lists -- still uses
API for userIdentity/Quests (userIdentity can be stripped back but want
to ensure the Quests call succeeds)
- Leaves in previous implementaiton of OverviewAboutHeader to not break
build until we do this in the $wallet route as well
- Lists will be done in another PR
- Some comments/questions about TVL that we'll want to doublecheck
- Queries are aggregates and are consumed as their own query because we
want to invalidate them granularly -- this shouldn't be an issue since
they load in parallel, but we can always combine them if we need
…951)

- Reworks the personal activity feed (`/activity/personal`) to use
GraphQL with a few caveats. The data is scoped to the user and shows the
user's position on anything created (if there is one)
- Currently omits 'Deposited' and 'Redeemed' events due to some
questions about how to best filter these. I had Deposited events working
but omitting since this may be streamlined depending on how we decide to
answer the question around Redeemed events. We have another ticket for
this
- Pagination rework is also in another ticket, although the query
supports it and there is a temporary pagination component at the bottom
of the UI for testing purposes
- Converts the Claim Details pages (index and id) to use GraphQL. Adds
the necessary queries to get the data as well as check if the Claim is
part of a List and also to pull the For/Against positions. Creates a new
version of the DetailInfoCard component to not break the Readonly route
build until we fully migrate and then we can remove
- Handling the positions was the biggest change from the previous
implementation. Previously, all positions came through in a single list
with a `for` and `against` direction as a property. This isn't the case
now, so we needed to combine the vault and counterVault positions
together. This works, but there are definitely performance improvements,
especially since we should likely be doing the tab filtering client side
instead of a refresh. There's room for us to continue to improve in the
future.
- Also, the search/sort/pagination will be wired up to the UI component
in a future PR, but the query supports it!
- @Vitalsine85 -- The staking modals will need to be updated as part of
the sweep you do. That should cover all the bases here!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants