I am having some issues with querying an array of Enums in a GraphQL query. I am expecting that the array or permissions will be returned with the user as per the type
Bizarrely, when I make the same query in the playground (for either my Prisma or Apollo-Server servers) I do get back the array.
My query looks like this:
const user = await ctx.db.query.user({
where: {
id: ctx.userId
}
});
My type definition looks like this:
type User {
id: ID! @id
name: String!
email: String! @unique
password: String!
club: String!
permissions: [Permission!]! @scalarList(strategy: RELATION)
createdAt: DateTime! @createdAt
updatedAt: DateTime! @updatedAt
}
permissions looking like
enum Permission {
ADMIN
CLUB_ADMIN
USER
FRIEND
}
I haven’t included my query resolver as I have just forwarded that to the DB using “forward-to”
But the CL of user is
{ id: 'cjxm9ohfqvkvh0b5963iy734i',
name: 'BERTIE BOBBINS',
email: 'BERTIE@DOGS.COM',
password: '$2b$10$eLPoBuuenogLabiFb4tRFu0KV7LI4LxARhHecPYVbP0qnt5VvcZ3W',
club: 'Dog Club',
createdAt: '2019-07-02T20:30:49.670Z',
updatedAt: '2019-07-02T20:30:49.670Z' }
So not including the Permissions array.