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

[doc] fix: using-events graphql error #20618

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

klren0312
Copy link
Contributor

Description

The GraphQL in Query events with GraphQL has error

Test plan

  1. crates/sui-graphql-rpc/examples/event_connection/event_connection.graphql and crates/sui-graphql-rpc/examples/event_connection/filter_by_sender.graphql

throw the error

{
  "data": null,
  "errors": [
    {
      "message": "Unknown field \"type\" on type \"Event\".",
      "locations": [
        {
          "line": 18,
          "column": 7
        }
      ]
    },
    {
      "message": "Unknown field \"json\" on type \"Event\".",
      "locations": [
        {
          "line": 25,
          "column": 7
        }
      ]
    }
  ]
}

need to be modified to

contents {
  type {
    repr
  }
  json
}
  1. crates/sui-graphql-rpc/examples/event_connection/filter_by_emitting_package_module_and_event_type.graphql

throw the error

{
  "data": null,
  "errors": [
    {
      "message": "Filtering by both emitting module and event type is not supported",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "events"
      ],
      "extensions": {
        "code": "BAD_USER_INPUT"
      }
    }
  ]
}

Read the EventFilter.emittingModule doc, it says We currently do not support filtering by emitting module and event type at the same time so if both are provided in one filter, the query will error..

So I think the doc need to delete the example [Filter events by emitting package and type]


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

Copy link

vercel bot commented Dec 13, 2024

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

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 2:07am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Dec 13, 2024 2:07am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Dec 13, 2024 2:07am
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Dec 13, 2024 2:07am

@github-actions github-actions bot added the Type: Documentation Improvements or additions to documentation label Dec 13, 2024
@klren0312 klren0312 temporarily deployed to sui-typescript-aws-kms-test-env December 13, 2024 18:10 — with GitHub Actions Inactive
Copy link
Member

@amnn amnn left a comment

Choose a reason for hiding this comment

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

Amazing, thank you for this contribution @klren0312 !

@amnn amnn merged commit 531a6d7 into MystenLabs:main Dec 13, 2024
47 of 48 checks passed
@klren0312 klren0312 deleted the fixbug/events-graphql branch December 14, 2024 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants