aptos-labs / developer-docs

Source for the Aptos developer docs
https://aptos.dev
Apache License 2.0
845 stars 79 forks source link

fix error (doc:fetch-data-via-sdk.mdx) #497

Closed caoyang2002 closed 1 week ago

caoyang2002 commented 1 month ago

Description

The second code block example, which is labeled as fetch-data.ts; correct the erroneous syntax to a nested object.

Checklist

The apps/nextra/pages/en/build/sdks/ts-sdk/fetch-data-via-sdk.mdx

appendix:

queryIndexer<T extends {}>(args: {
    query: GraphqlQuery;
}): Promise<T>;
type GraphqlQuery = {
    query: string;
    variables?: {};
};
vercel[bot] commented 1 month ago

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

Name Status Preview Comments Updated (UTC)
developer-docs-nextra ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2024 8:44pm
netlify[bot] commented 1 month ago

Deploy Preview for aptos-developer-docs ready!

Name Link
Latest commit 28e2918357dbfd39865a863de1d441b27697d7cd
Latest deploy log https://app.netlify.com/sites/aptos-developer-docs/deploys/668c10ea7879ce0008de184e
Deploy Preview https://deploy-preview-497--aptos-developer-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

WGB5445 commented 1 month ago

Very good. Thank you very much.

0xmaayan commented 1 month ago

Description

The second code block example, which is labeled as fetch-data.ts; correct the erroneous syntax to a nested object.

Checklist

The apps/nextra/pages/en/build/sdks/ts-sdk/fetch-data-via-sdk.mdx

appendix:

queryIndexer<T extends {}>(args: {
    query: GraphqlQuery;
}): Promise<T>;
type GraphqlQuery = {
    query: string;
    variables?: {};
};
  • Do all Lints pass?

    • [ ] Have you ran pnpm spellcheck?
    • [ ] Have you ran pnpm fmt?
    • [ ] Have you ran pnpm lint?

Thanks for the PR! The issue is with the object syntax with a missing query field. The variables field is not required if the query does not require variables

gregnazario commented 1 week ago

Looks like all of these changes have gotten in already. Thanks for the contribution!