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

fetch Allo V2 programs from the indexer #2871

Merged
merged 6 commits into from
Feb 15, 2024
Merged

fetch Allo V2 programs from the indexer #2871

merged 6 commits into from
Feb 15, 2024

Conversation

bhargavaparoksham
Copy link
Contributor

Fixes: #2816

Description

fetch Allo V2 programs from the indexer

Checklist

This PR:

  • Includes only changes relevant to the original ticket. Significant refactoring needs to be separated.
  • Doesn't disable eslint rules.
  • Doesn't work around the type checker (including but not limited to: type casts, non-null assertions, @ts-ignore, unjustified optional values).
  • Doesn't contain commented out code.
  • If adding/updating a feature, it adds/updates its test script on Notion.

Copy link

vercel bot commented Feb 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
builder ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 14, 2024 0:37am
builder-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 14, 2024 0:37am
explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 14, 2024 0:37am
explorer-staging 🛑 Canceled (Inspect) Feb 14, 2024 0:37am
manager ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 14, 2024 0:37am
manager-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 14, 2024 0:37am

@bhargavaparoksham bhargavaparoksham marked this pull request as ready for review February 6, 2024 12:50
@bhargavaparoksham bhargavaparoksham marked this pull request as draft February 6, 2024 14:42
@bhargavaparoksham bhargavaparoksham marked this pull request as ready for review February 7, 2024 13:16
Copy link
Contributor

@michellema1208 michellema1208 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @bhargavaparoksham - I'm able to see the profile I created on Builder on Manager, but not able to open the profile on Manager. Is that expected / out of scope for this PR? Otherwise, I would expect to be able to open the profile and be able to create rounds under it (once the "create round on v2" PR is ready).

Manager link: https://manager-staging-git-manager-2816-grants-stack.vercel.app/#/program/0x16aaa61bcdf4445bad79cc671fa513c357b218b13720d6e2adb70af404d2007b

Screen Shot 2024-02-12 at 10 59 00 AM Screen Shot 2024-02-12 at 10 58 48 AM

Copy link
Contributor

@boudra boudra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure i understand why both queries that are exactly the same, have different types and if statements, where one is being mapped to the exact same type, it feels like there's a lot of repetition that could cause human error if someone would forget to update a type or a query

would something like this work?

const getProgramsByUserAndTag = gql`
  query ($address: String!, $chainId: Int!, $filterByTag: String ) {
    projects(
      filter: {
        tags: { contains: $filterByTag }
        roles: { some: { address: { equalTo: $address } } }
        chainId: { equalTo: $chainId }
      }
    ) {
      id
      chainId
      metadata
      metadataCid
      tags
      roles {
        address
        role
        createdAtBlock
      }
    }
  }
`;

let response: { projects: Program[] } = { projects: [] };

response = await request(
  this.gsIndexerEndpoint,
  getProgramsByUserAndTag,
  { ...requestVariables, filterByTag: alloVersion === "allo-v2" ? "allo-v2" : "program" },
);

return response.projects;

packages/data-layer/src/queries.ts Outdated Show resolved Hide resolved
Copy link

gitstream-cm bot commented Feb 14, 2024

This PR is 78.18181818181819% new code.

@boudra boudra merged commit 7b303a3 into main Feb 15, 2024
21 checks passed
@boudra boudra deleted the manager-2816 branch February 15, 2024 11:02
Copy link

gitstream-cm bot commented Feb 15, 2024

🥷 Code experts: codenamejason, 0xKurt

codenamejason, bhargavaparoksham have most 👩‍💻 activity in the files.
codenamejason, bhargavaparoksham have most 🧠 knowledge in the files.

See details

packages/data-layer/src/data-layer.ts

Activity based on git-commit:

codenamejason bhargavaparoksham
FEB 184 additions & 9 deletions 55 additions & 3 deletions
JAN
DEC
NOV
OCT
SEP

Knowledge based on git-blame:
codenamejason: 31%
bhargavaparoksham: 9%

packages/data-layer/src/queries.ts

Activity based on git-commit:

codenamejason bhargavaparoksham
FEB 153 additions & 0 deletions 63 additions & 0 deletions
JAN
DEC
NOV
OCT
SEP

Knowledge based on git-blame:
codenamejason: 51%
bhargavaparoksham: 21%

To learn more about /:\ gitStream - Visit our Docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Manager: fetch Allo V2 programs from the indexer
5 participants