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: relay: Add support for id field in transactions #2565

Closed
wants to merge 6 commits into from

Conversation

tibi77
Copy link
Contributor

@tibi77 tibi77 commented Apr 25, 2024

No description provided.

Copy link

changeset-bot bot commented Apr 25, 2024

⚠️ No Changeset found

Latest commit: 6ff09fd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@mergify mergify bot added the community label Apr 25, 2024
@mergify mergify bot requested a review from a team April 25, 2024 14:10
Copy link
Collaborator

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

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

Cool, so this is the right first step, but our GraphQL client doesn't actually know how to populate that field. You'll need to hook that into the resolver here.

let result: TransactionResult = {
encodedData: {},
signature,
};

packages/rpc-graphql/src/__tests__/transaction-tests.ts Outdated Show resolved Hide resolved
packages/rpc-graphql/src/__tests__/transaction-tests.ts Outdated Show resolved Hide resolved
@buffalojoec buffalojoec changed the title [GraphQL]: Add Relay support [GraphQL]: Relay: Add support for id field in transactions Apr 26, 2024
@tibi77
Copy link
Contributor Author

tibi77 commented Apr 27, 2024

Cool, so this is the right first step, but our GraphQL client doesn't actually know how to populate that field. You'll need to hook that into the resolver here.

let result: TransactionResult = {
encodedData: {},
signature,
};

should i be adding the ID inside the buildTransactionLoaderArgSetFromResolveInfo as well?

export function buildTransactionLoaderArgSetFromResolveInfo(
args: {
commitment?: Omit<Commitment, 'processed'>;
minContextSlot?: Slot;
signature: Signature;
},
info: GraphQLResolveInfo,
): TransactionLoaderArgs[] {
return buildTransactionArgSetWithVisitor(args, info);
}

@buffalojoec
Copy link
Collaborator

should i be adding the ID inside the buildTransactionLoaderArgSetFromResolveInfo as well?

Technically, that's not necessary for cache matching - since we're using another field for that - but to follow the expected Relay pattern I guess we should also include the ID.

@tibi77
Copy link
Contributor Author

tibi77 commented Apr 30, 2024

@buffalojoec I m trying to test locally the tests that are failing inside the pipeline, but i not getting same fails

npm -v; pnpm -v
9.8.1
9.0.6

is it just because of the node versions? Or am i missing something else when i run the tests?

node -v
v18.18.2

i do run

 pnpm build --concurrency=100%

which seems to be the one that fails

@tibi77 tibi77 closed this Apr 30, 2024
@tibi77 tibi77 reopened this Apr 30, 2024
@buffalojoec
Copy link
Collaborator

@buffalojoec I m trying to test locally the tests that are failing inside the pipeline, but i not getting same fails

npm -v; pnpm -v
9.8.1
9.0.6

is it just because of the node versions? Or am i missing something else when i run the tests?

node -v
v18.18.2

i do run

 pnpm build --concurrency=100%

which seems to be the one that fails

I tend to get some flakiness from the main pnpm turbo run build command. But you definitely want to be using Node 20.

Try doing the following, and then running the tests only for the GraphQL library.

pnpm turbo clean
rm -rf node_modules
pnpm i
pnpm turbo compile:js compile:typedefs --force
cd packages/rpc-graphql
pnpm run test:unit:node

@buffalojoec
Copy link
Collaborator

@tibi77 any luck with the commands I shared?

@buffalojoec buffalojoec changed the title [GraphQL]: Relay: Add support for id field in transactions refactor(experimental): relay: Add support for id field in transactions May 2, 2024
@buffalojoec buffalojoec changed the title refactor(experimental): relay: Add support for id field in transactions refactor(experimental): graphql: relay: Add support for id field in transactions May 2, 2024
@buffalojoec
Copy link
Collaborator

Hey @tibi77 I appreciate the contribution here, but I'm taking the Relay effort to a new branch feature/graphql-relay, and I've added the ID fields. Thanks!

Keep an eye on the issues if you want to keep hacking.

@buffalojoec buffalojoec closed this May 7, 2024
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.

None yet

2 participants