Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useSubscription, gql } from "@apollo/client"

const ORDERS_SUBSCRIPTION_BUY = gql`
subscription {
Order(
order(
where: { status: { _eq: "Active" }, order_type: { _eq: "Buy" } }
order_by: { price: desc }
) {
Expand All @@ -21,7 +21,7 @@ const ORDERS_SUBSCRIPTION_BUY = gql`

const ORDERS_SUBSCRIPTION_SELL = gql`
subscription {
Order(
order(
where: { status: { _eq: "Active" }, order_type: { _eq: "Sell" } }
order_by: { price: asc }
) {
Expand All @@ -39,7 +39,7 @@ const ORDERS_SUBSCRIPTION_SELL = gql`

const ORDERS_SUBSCRIPTION_CLOSED = gql`
subscription {
Order(where: { status: { _eq: "Closed" } }, order_by: { timestamp: desc }) {
order(where: { status: { _eq: "Closed" } }, order_by: { timestamp: desc }) {
id
asset
amount
Expand Down Expand Up @@ -74,9 +74,9 @@ const Orders = () => {
if (sellError) return <p>Error: {sellError.message}</p>
if (closedError) return <p>Error: {closedError.message}</p>

const buyOrders = buyData.Order
const sellOrders = sellData.Order
const closedOrders = closedData.Order
const buyOrders = buyData.order
const sellOrders = sellData.order
const closedOrders = closedData.order

return (
<div>
Expand Down
5 changes: 5 additions & 0 deletions src/apolloClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import { createClient } from "graphql-ws"
const wsLink = new GraphQLWsLink(
createClient({
url: "ws://localhost:8080/v1/graphql",
connectionParams: {
headers: {
'x-hasura-admin-secret': 'admin'
}
}
})
)

Expand Down