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

refactor(experimental): GraphQL: Refactor program accounts filters #3098

Merged
merged 4 commits into from
Aug 14, 2024

Conversation

buffalojoec
Copy link
Contributor

@buffalojoec buffalojoec commented Aug 13, 2024

Problem

The filters input parameter for the GraphQL resolver is malformed. This PR brings it to parity with the Solana JSON RPC API as well as the @solana/rpc-api package's definition for program accounts filters.

Summary of Changes

First add some test coverage to @solana/rpc-api for program accounts filters to ensure everything is working properly.

Then, refactor the GraphQL API for the programAccounts query to correct the program accounts filters input. Finally, add some tests for GraphQL.

Since GraphQL doesn't allow unions as input types, I had to split the two types of filters into two separate filters for the GraphQL API, then coalesce them into the same filters argument for the RPC.

Copy link

changeset-bot bot commented Aug 13, 2024

🦋 Changeset detected

Latest commit: f7368bd

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@buffalojoec buffalojoec force-pushed the program-accounts-filters branch from 936f728 to a37e7f3 Compare August 13, 2024 17:40
@buffalojoec buffalojoec force-pushed the program-accounts-filters branch from a37e7f3 to 436094e Compare August 13, 2024 18:01
@buffalojoec buffalojoec marked this pull request as ready for review August 13, 2024 18:22
Copy link
Contributor

@mcintyre94 mcintyre94 left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

@buffalojoec buffalojoec merged commit 2f541b6 into master Aug 14, 2024
8 checks passed
@buffalojoec buffalojoec deleted the program-accounts-filters branch August 14, 2024 15:54
@github-actions github-actions bot mentioned this pull request Aug 14, 2024
Copy link
Contributor

Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2024
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.

3 participants