0

I have a transaction ID, however sometimes it takes a little bit of time for a monetary transaction to show up on Blockchains.

I'm using GraphQL to query the blockchain with this transaction ID. If it returns true, that means the transaction was successful, if not, unsuccessful.

Can anyone provide me with a template?

  • Does this answer your question? [How to approach a GraphQL query that returns a boolean value?](https://stackoverflow.com/questions/56879288/how-to-approach-a-graphql-query-that-returns-a-boolean-value) – Antoni Sep 16 '21 at 07:37

1 Answers1

0

A "query" is just a field on what happens to be the Query type. A field can return any output type, including scalars -- it doesn't need to return an object. So it's sufficient to have a schema like:

type Query {
  transaction(transactionId: String!): Boolean!
}
Antoni
  • 1,316
  • 2
  • 16
  • 42