Open
Description
Hi, I am working vue-apollo, currently I having issues:
In file Workspace.vue
<script>
import { GetTeam } from '../constants/query.gql'
export default {
name: 'Workspace',
data() {
return {
getTeam: {}
}
},
apollo: {
getTeam: {
query: GetTeam
}
}
}
</script>
......
In file query.gql
query GetTeam {
getTeam {
id
name
}
}
//resolvers.js
const resolvers = {
Query: {
async getTeam(_, args, context) {
const userId = getUserId(context)
const user = await User.findById(userId)
return await Team.findById(user.team)
}
}
//schema.graphql
type Team {
id: String!
name: String!
}
type User {
......
}
Is there a way to fix the issue?