Browse Source

Added favicon and device suppression

master
Anthony Hinsinger 4 years ago
parent
commit
941b89f729
  1. BIN
      public/favicon.ico
  2. 31
      src/apolloclient.js

BIN
public/favicon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

31
src/apolloclient.js

@ -55,7 +55,13 @@ const client = new ApolloClient({ @@ -55,7 +55,13 @@ const client = new ApolloClient({
]),
cache: new InMemoryCache({
possibleTypes: {
IndiVector: ["NumberVector", "SwitchVector", "TextVector", "LightVector", "BLOBVector"],
IndiVector: [
"NumberVector",
"SwitchVector",
"TextVector",
"LightVector",
"BLOBVector",
],
},
typePolicies: {
Query: {
@ -139,8 +145,26 @@ const GETDEVICE = gql` @@ -139,8 +145,26 @@ const GETDEVICE = gql`
${propertyVectorFragment}
`;
const DEL_DEVICE = gql`
subscription delIndiDevice {
delIndiDevice
}
`;
client
.subscribe({
query: DEL_DEVICE,
})
.subscribe(({ data }) => {
const res = client.readQuery({ query: GETDEVICES });
client.writeQuery({
query: GETDEVICES,
data: { devices: res.devices.filter(d => d.id !== data.delIndiDevice) },
});
});
const NEW_PROPERTY = gql`
subscription newProperty {
subscription newIndiProp {
newIndiProp {
id
name
@ -159,8 +183,6 @@ client @@ -159,8 +183,6 @@ client
query: NEW_PROPERTY,
})
.subscribe(({ data }) => {
console.log(data.newIndiProp.id);
console.log(data.newIndiProp.vector)
const res = client.readQuery({
query: GETDEVICE,
variables: { id: data.newIndiProp.device.id },
@ -247,7 +269,6 @@ client @@ -247,7 +269,6 @@ client
},
},
});
console.log(res);
}
});

Loading…
Cancel
Save