mentallyretired
07/11/2017, 1:19 PMgojutin
07/11/2017, 1:20 PMdankent
07/11/2017, 1:21 PMnilan
07/11/2017, 1:23 PMgraphql-js
track was SUPER helpful to improve my understanding of how backend and frontend are connected 🙂ilja
07/11/2017, 1:29 PMbequis
07/11/2017, 2:35 PMtomaash
07/11/2017, 2:41 PMfedebozo
07/11/2017, 2:49 PMfrankspin
07/11/2017, 3:09 PMdomthegrom
07/11/2017, 3:41 PM12brols
07/11/2017, 3:45 PMjohhansantana
07/11/2017, 4:26 PMlewisblackwood
07/11/2017, 5:05 PMnilan
07/11/2017, 5:59 PMcarlc
07/11/2017, 6:16 PMlewisblackwood
07/11/2017, 6:35 PMconnectionParams: {
authToken: JWT,
}
and can see that the SubscriptionClient
is being initialised with the JWT. However, I'm seeing message: "Insufficient Permissions"
when the subscription is triggered. I'm just using Authentication required
as the rule right now, without a permission query.frankspin
07/11/2017, 9:19 PM<script>
import gql from 'graphql-tag';
// GraphQL query
const ClientQuery = gql`
query allClients {
allClients(orderBy: createdAt_DESC) {
id,
name
}
}`;
export default {
data() {
return {
msg: 'Welcome 2 to Your Vue.js App',
loading: 0,
allClients: {},
};
},
// Apollo GraphQL
apollo: {
allClients() {
return {
query: ClientQuery,
loadingKey: 'loading',
};
},
},
mounted() {
// Query runs to start the subscription
const subQuery = gql`
subscription {
Client(filter: {
mutation_in: [CREATED]
}) {
node {
id,
name
}
}
}`;
this.clientsSubscription = this.$apollo.queries.allClients.subscribeToMore({
document: subQuery,
// Mutate the previous result
updateQuery: (previousResult, { subscriptionData }) => ({
allClients: [
...previousResult.allClients,
// Add the new tag
subscriptionData.data.Client.node,
],
}),
});
},
};
</script>
mentallyretired
07/11/2017, 9:42 PMmentallyretired
07/11/2017, 9:42 PMmentallyretired
07/11/2017, 9:42 PMmentallyretired
07/11/2017, 9:43 PMadrianocola
07/11/2017, 9:45 PMDirective 'include' may not be used on fragment definition
when creating a new request pipeline
function in the consolestton
07/11/2017, 10:10 PMstton
07/11/2017, 10:11 PMstton
07/11/2017, 10:15 PMstton
07/11/2017, 10:15 PMauser
07/11/2017, 10:45 PMphil
07/11/2017, 11:16 PMauser
07/11/2017, 11:17 PMjohhansantana
07/11/2017, 11:44 PM