Ramin B
11/15/2018, 3:03 AMtype User {
id: ID!
email: String!
name: String
active: Boolean
roles: [Role]
permissions: [Permission!]
forms: [MemberForm!]
}
and the following resolver:
import { UserResolvers } from '../generated/graphqlgen'
export const User: UserResolvers.Type = {
...UserResolvers.defaultResolvers,
permissions: (parent, args, ctx) => ctx.db.user({ id: parent.id }).permissions(),
forms: (parent, args, ctx) => ctx.db.user({ id: parent.id }).forms()
}
Any ideas why I would keep getting this error when trying to query for forms
or permissions
on a user?
"Cannot read property 'selectionSet' of undefined"
user(id: "cjohx9n5h002j092058rtzjc6") {
forms {
name
}
permissions {
value
}
}
Ramin B
11/15/2018, 3:05 AMdatamodel.graphql
has the following:
type User {
id: ID! @unique
email: String! @unique
password: String
name: String
active: Boolean @default(value: "false")
roles: [Role]
permissions: [Permission!]!
forms: [MemberForm!]!
refId: String
refType: UserType @default(value: "WEWORK")
}
type Permission {
id: ID! @unique
value: String! @unique
}
type MemberForm {
id: ID! @unique
name: String! @unique
description: String
formEntries: [MemberFormEntry!]!
}
Jubal Mabaquiao
11/15/2018, 3:06 AMRamin B
11/15/2018, 3:27 AMRamin B
11/15/2018, 3:50 AMRamin B
11/15/2018, 4:04 AM1.20.1