Hello here,
I’m trying redwoodjs and so far I like it quite much.
I’m having issues though with custom reducers & graphql queries.
The goal is to retrieve the configuration field from the User table based on a uid field ( not the default id), here’s the related schema:
type User {
id: String!
uid: String!
createdAt: DateTime!
updatedAt: DateTime
handle: String!
email: String!
lastname: String!
firstname: String!
localisations: Localisation
collections: Collection
configuration: String
}
type UserConfiguration {
handle: String!
configuration: String!
}
type Query {
users: [User]
user(id: String!): User
userConfiguration(uid: String!): UserConfiguration
}
Here’s the reducer in the related api/services/user/user.js:
export const userConfiguration = ({ uid }) => db.user.findOne({ where: { uid } })
Now this is the query on the client side:
query UserConfiguration($uid: String!) {
userConfiguration: userConfiguration(uid: $uid) {
handle
configuration
}
}
And finally, here comes the error message:
Where does the UserWhereUniqueInput comes from?
From my research it’s from Prisma but I don’t understand how it is composed and why it is used.
How are selected the limited authorized parameters, id, handle & email?
What have I missed to implement this different query?