https://launchpad.graphql.com/9qvqz3v5r
这是我的示例 graphQL Schema。我正在尝试使用枚举类型。我如何从后端获取枚举值并将其提供给架构?
// Construct a schema, using GraphQL schema language
const typeDefs = `
type User {
userId: Int
firstName: String
lastName: String
pincode:String
state:String
country:String
}
type Query {
hello: String
user: User
}
type CreateUserLoad {
user: User
}
enum Role {
writer
reader
author
admin
superAdmin
}
type Mutation{
createUser(firstName: String, lastName: String, role: Role): User
}
`;
我想将动态变量中的枚举角色值填充为
const roleData = ['writer','reader','author','admin','superAdmin'];
谁能帮我?