Seeking assistance with configuring my initial queries on scaphold.io.
Here is the query I am running through the internal GraphiQL:
query AllPrograms {
viewer {
allPrograms{
edges {
node {
id
name
}
}
}
}
}
Result of the query:
{
"data": {
"viewer": {
"allPrograms": {
"edges": [
{
"node": {
"id": "UHJvZ3JhbTo2",
"name": "Blender"
}
},
{
"node": {
"id": "UHJvZ3JhbTo1",
"name": "Inkscape"
}
},
...
Code snippet for my component:
<template>
<md-card>
<span class="md-headline">Programs</span>
<span class="md-headline">{{ allPrograms }}</span>
</md-card>
</template>
<script>
import gql from 'graphql-tag'
import config from '../../config/client'
const log = console.log
const allPrograms = gql `
query AllPrograms {
viewer {
allPrograms{
edges {
node {
id
name
}
}
}
}
}
`
export default {
props: [],
data () {
return {
allPrograms: '',
}
},
// Apollo GraphQL
apollo: {
allPrograms: {
query: allPrograms,
loadingKey: 'loading',
},
}
}
</script>
The error message received: Missing allPrograms attribute on result
Based on the returned JSON, it seems like this might be a part of the correct result:
object: viewer: {allPrograms: Object, __typename: "Viewer"}
It appears that I am close to retrieving the data, but may need to address the data handling in more detail.
Any suggestions or insights?