user871: I am looking for a GraphQL query that will return transaction details as seen on the Cardano Blockchain Explorer when searched with txId.
For example,
https://explorer.cardano.org/en/transaction?id=f58152cafbd25e618433eae52f72bb419e00efe91b5cf7c74a93f8c29cbb2e7b
Can anyone provide a sample query which can also be tested on the Dandelion GraphQL playground?

user252: To check exact query as explorer for GraphQL - in your browser, when viewing page from explorer - you can check Developer Tools > Network (tab). In the list, look for graphql POST requests where variable is your transaction ID - you would see the graphql query in Request Payload.
Thus, for the mentioned link in example , you'd see the request is:
{"query":"query searchById($id: Hash32Hex!) {\n  blocks(where: {hash: {_eq: $id}}) {\n    ...BlockDetails\n  }\n  transactions(where: {hash: {_eq: $id}}) {\n    ...TransactionDetails\n  }\n}\n\nfragment BlockDetails on Block {\n  ...BlockOverview\n  nextBlock {\n    hash\n    number\n  }\n  previousBlock {\n    hash\n    number\n  }\n  transactions(limit: 10, order_by: {fee: desc}) {\n    ...TransactionDetails\n  }\n}\n\nfragment BlockOverview on Block {\n  forgedAt\n  slotLeader {\n    description\n  }\n  epochNo\n  hash\n  number\n  size\n  slotNo\n  transactions_aggregate {\n    aggregate {\n      count\n      sum {\n        totalOutput\n      }\n    }\n  }\n}\n\nfragment TransactionDetails on Transaction {\n  block {\n    epochNo\n    hash\n    number\n    slotNo\n  }\n  deposit\n  fee\n  hash\n  includedAt\n  mint {\n    asset {\n      assetName\n      decimals\n      description\n      fingerprint\n      name\n      policyId\n      ticker\n    }\n    quantity\n  }\n  inputs {\n    address\n    sourceTxHash\n    sourceTxIndex\n    value\n    tokens {\n      asset {\n        assetName\n        decimals\n        description\n        fingerprint\n        name\n        policyId\n        ticker\n      }\n      quantity\n    }\n  }\n  metadata {\n    key\n    value\n  }\n  outputs {\n    address\n    index\n    value\n    tokens {\n      asset {\n        assetName\n        decimals\n        description\n        fingerprint\n        name\n        policyId\n        ticker\n      }\n      quantity\n    }\n  }\n  totalOutput\n  withdrawals {\n    address\n    amount\n  }\n}\n","variables":{"id":"f58152cafbd25e618433eae52f72bb419e00efe91b5cf7c74a93f8c29cbb2e7b"}}

Note that this is ofcourse a request payload sent to graphql endpoint, you can substitute \n and use/replace variable(s) as desired

871: <p>I am looking for a GraphQL query that will return transaction details as seen on the Cardano Blockchain Explorer when searched with <code>txId</code>.</p>
<p>For example,</p>
<p><a href="https://explorer.cardano.org/en/transaction?id=f58152cafbd25e618433eae52f72bb419e00efe91b5cf7c74a93f8c29cbb2e7b" rel="nofollow noreferrer">https://explorer.cardano.org/en/transaction?id=f58152cafbd25e618433eae52f72bb419e00efe91b5cf7c74a93f8c29cbb2e7b</a></p>
<p>Can anyone provide a sample query which can also be tested on the Dandelion <a href="https://graphql-api.mainnet.dandelion.link/" rel="nofollow noreferrer">GraphQL playground</a>?</p>
 252: <p>To check exact query as explorer for GraphQL - in your browser, when viewing page from explorer - you can check Developer Tools &gt; Network (tab). In the list, look for <code>graphql</code> POST requests where variable is your transaction ID - you would see the graphql query in Request Payload.</p>
<p>Thus, for the mentioned link in example , you'd see the request is:</p>
<pre><code>{&quot;query&quot;:&quot;query searchById($id: Hash32Hex!) {\n  blocks(where: {hash: {_eq: $id}}) {\n    ...BlockDetails\n  }\n  transactions(where: {hash: {_eq: $id}}) {\n    ...TransactionDetails\n  }\n}\n\nfragment BlockDetails on Block {\n  ...BlockOverview\n  nextBlock {\n    hash\n    number\n  }\n  previousBlock {\n    hash\n    number\n  }\n  transactions(limit: 10, order_by: {fee: desc}) {\n    ...TransactionDetails\n  }\n}\n\nfragment BlockOverview on Block {\n  forgedAt\n  slotLeader {\n    description\n  }\n  epochNo\n  hash\n  number\n  size\n  slotNo\n  transactions_aggregate {\n    aggregate {\n      count\n      sum {\n        totalOutput\n      }\n    }\n  }\n}\n\nfragment TransactionDetails on Transaction {\n  block {\n    epochNo\n    hash\n    number\n    slotNo\n  }\n  deposit\n  fee\n  hash\n  includedAt\n  mint {\n    asset {\n      assetName\n      decimals\n      description\n      fingerprint\n      name\n      policyId\n      ticker\n    }\n    quantity\n  }\n  inputs {\n    address\n    sourceTxHash\n    sourceTxIndex\n    value\n    tokens {\n      asset {\n        assetName\n        decimals\n        description\n        fingerprint\n        name\n        policyId\n        ticker\n      }\n      quantity\n    }\n  }\n  metadata {\n    key\n    value\n  }\n  outputs {\n    address\n    index\n    value\n    tokens {\n      asset {\n        assetName\n        decimals\n        description\n        fingerprint\n        name\n        policyId\n        ticker\n      }\n      quantity\n    }\n  }\n  totalOutput\n  withdrawals {\n    address\n    amount\n  }\n}\n&quot;,&quot;variables&quot;:{&quot;id&quot;:&quot;f58152cafbd25e618433eae52f72bb419e00efe91b5cf7c74a93f8c29cbb2e7b&quot;}}
</code></pre>
<p>Note that this is ofcourse a request payload sent to graphql endpoint, you can substitute <code>\n</code> and use/replace variable(s) as desired</p>
