Further cleanup of components for subscription use

This commit is contained in:
Patrick Fic
2019-12-11 18:50:48 -08:00
parent f333301f67
commit 3c3f1e8650
6 changed files with 7 additions and 12 deletions

View File

@@ -38,7 +38,7 @@ class AppContainer extends Component {
// split based on operation type
({ query }) => {
const definition = getMainDefinition(query);
console.log("000000", definition.operation);
console.log("##Intercepted GQL Transaction##", query);
return (
definition.kind === "OperationDefinition" &&
definition.operation === "subscription"

View File

@@ -64,7 +64,7 @@ export default () => {
mutation: UPSERT_USER,
variables: { authEmail: user.email, authToken: user.uid }
})
.then(r => console.log("Successful Upsert", r))
.then()
.catch(error => {
console.log("Upsert error!!!!", error);
});

View File

@@ -12,16 +12,12 @@ class SignInForm extends React.Component {
handleSubmit = e => {
e.preventDefault();
const { apolloClient } = this.props;
this.props.form.validateFields(async (err, values) => {
if (!err) {
const { email, password } = values;
try {
const { user } = await auth.signInWithEmailAndPassword(
email,
password
);
await auth.signInWithEmailAndPassword(email, password);
this.props.form.resetFields();
} catch (error) {

View File

@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { Redirect } from "react-router-dom";
//import { Redirect } from "react-router-dom";
import firebase from "../../firebase/firebase.utils";
export default class SignOut extends Component {
state = {

View File

@@ -1,7 +1,7 @@
import { gql } from "apollo-boost";
export const GET_ALL_OPEN_JOBS = gql`
query {
{
jobs {
id
est_number

View File

@@ -1,5 +1,6 @@
import React from "react";
import { useQuery, useSubscription } from "@apollo/react-hooks";
import AlertComponent from "../../components/alert/alert.component";
//import { GET_ALL_OPEN_JOBS } from "../../graphql/jobs.queries";
import { Table, Divider, Icon } from "antd";
@@ -76,9 +77,7 @@ export default function JobsPage() {
];
//if (loading) return "Loading";
if (error) return `Error! ${error.message}`;
//console.log("$$$Develop (jobs.page.jsx) | jobs", jobs);
console.log("JobsPage Rendering...");
if (error) return <AlertComponent message={error.message} />;
return (
<div>