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

Query for fields in within asset fails for onNotification subscription #3

Open
artola opened this issue Jul 23, 2022 · 0 comments
Open
Assignees

Comments

@artola
Copy link
Member

artola commented Jul 23, 2022

The idea is to query for this field in a way that the asset is refreshed automatically.
If I am looking to BTC and it has 1 alert, once the price is reached, the screen should remove the "hasAlerts" icon without user intervention.

image

query PriceForBTC {
  assetBySymbol(symbol: "BTC") {
    price {
      lastPrice
    }
  }
}

subscription NotificationSubscription {
  onNotification {
    unreadNotifications
    notification {
      asset {
        hasAlerts
      }
    }
  }
}

mutation CreateAlert {
  createAlert(
    input: {
      symbol: "BTC"
      currency: "USD"
      targetPrice: 47075
      recurring: false
    }
  ) {
    createdAlert {
      asset {
        hasAlerts
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants