Fixed subscription issue. Related to no authorization token for WS request.

This commit is contained in:
Patrick Fic
2019-12-11 23:17:09 -08:00
parent 3c3f1e8650
commit aa21c51023
3 changed files with 41 additions and 11 deletions

View File

@@ -6,13 +6,17 @@ import { Table, Divider, Icon } from "antd";
import {
GET_ALL_OPEN_JOBS,
SUBSCRIPTION_ALL_OPEN_JOBS
SUBSCRIPTION_ALL_OPEN_JOBS,
test
} from "../../graphql/jobs.queries";
export default function JobsPage() {
const { loading, error, data } = useQuery(GET_ALL_OPEN_JOBS);
//const { loading, error, data } = useSubscription(SUBSCRIPTION_ALL_OPEN_JOBS);
// const { loading, error, data } = useQuery(GET_ALL_OPEN_JOBS, {
// fetchPolicy: "network-only"
// });
const { loading, error, data } = useSubscription(SUBSCRIPTION_ALL_OPEN_JOBS, {
fetchPolicy: "network-only"
});
const columns = [
{
@@ -76,8 +80,10 @@ export default function JobsPage() {
}
];
//if (loading) return "Loading";
if (error) return <AlertComponent message={error.message} />;
if (error) {
console.log("error", error);
return <AlertComponent message={error} />;
}
return (
<div>